我試圖在本地docker(https://hub.docker.com/_/cassandra/)中設置和運行Cassandra 3.10。一切都很順利,直到我嘗試從一個表中選擇。SELECT錯誤Cassandra'Row'對象沒有屬性值'
這是我的錯誤,每次我運行select無論從什麼:
'Row' object has no attribute 'values'
,我遵循的步驟:
我創建使用默認的超級用戶一個新的密鑰空間:卡桑德拉。創建
keyspace test with replication = {'class':'SimpleStrategy','replication_factor' : 2};
和USE test;
我創建了一個新表:
create table usertable (userid int primary key, usergivenname varchar, userfamilyname varchar, userprofession varchar);
插入一些數據:
insert into usertable (userid, usergivenname, userfamilyname, userprofession) values (1, 'Oliver', 'Veits', 'Freelancer');
儘量選擇:
select * from usertable where userid = 1;
我得到這個步驟從:https://oliverveits.wordpress.com/2016/12/08/cassandra-hello-world-example/只是複製&粘貼一些工作代碼(我生氣的語法和拼寫錯誤)
這是我的泊塢窗圖像日誌:
INFO [Native-Transport-Requests-1] 2017-04-23 19:09:12,543 MigrationManager.java:303 - Create new Keyspace: KeyspaceMetadata{name=test2, params=KeyspaceParams{durable_writes=true, replication=ReplicationParams{class=org.apache.cassandra.locator.SimpleStrategy, replication_factor=2}}, tables=[], views=[], functions=[], types=[]}
INFO [Native-Transport-Requests-1] 2017-04-23 19:09:41,415 MigrationManager.java:343 - Create new table: [email protected][cfId=6757f460-2858-11e7-9787-6d2c86545d91,ksName=test2,cfName=usertable,flags=[COMPOUND],params=TableParams{comment=, read_repair_chance=0.0, dclocal_read_repair_chance=0.1, bloom_filter_fp_chance=0.01, crc_check_chance=1.0, gc_grace_seconds=864000, default_time_to_live=0, memtable_flush_period_in_ms=0, min_index_interval=128, max_index_interval=2048, speculative_retry=99PERCENTILE, caching={'keys' : 'ALL', 'rows_per_partition' : 'NONE'}, compaction=CompactionParams{class=org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy, options={min_threshold=4, max_threshold=32}}, [email protected]3f, extensions={}, cdc=false},comparator=comparator(),partitionColumns=[[] | [userfamilyname usergivenname userprofession]],partitionKeyColumns=[userid],clusteringColumns=[],keyValidator=org.apache.cassandra.db.marshal.Int32Type,columnMetadata=[usergivenname, userprofession, userid, userfamilyname],droppedColumns={},triggers=[],indexes=[]]
INFO [MigrationStage:1] 2017-04-23 19:09:41,484 ColumnFamilyStore.java:406 - Initializing test2.usertable
INFO [IndexSummaryManager:1] 2017-04-23 19:13:25,214 IndexSummaryRedistribution.java:75 - Redistributing index summaries
非常感謝!
UPDATE
我創建了這樣的UUID列中的另一表中: 「UID UUID主鍵」。它工作時,表是空的,但一個插入後,我得到相同的錯誤
嘗試'\須藤PIP安裝卡桑德拉驅動--upgrade' –
嗨@AshrafulIslam,感謝,但還是同樣的問題 –
的問題是在cqlsh,你Cassandra是好的。順便說一下你使用的是哪種操作系統? –