2017-03-20 33 views
0

我查詢卡桑德拉表執行以下命令: select * from oap.purchase_events where clientNumber = '100'卡桑德拉未定義的名稱在where子句

表包含與clientNumber 100行,但是我得到這個錯誤:

InvalidRequest:代碼= 2200 [查詢無效]消息= 「未定義名稱clientnumber在where子句( 'clientnumber = 100')」

表定義:

CREATE TABLE oap.purchase_events (
    "parentId" text, 
    "childId" text, 
    "clientNumber" text, 
    cost double, 
    description text, 
    "eventDate" timestamp, 
    "logDate" timestamp, 
    message text, 
    "operationalChannel" text, 
    "productDuration" bigint, 
    "productId" text, 
    "transactionId" text, 
    volume double, 
    "volumeUnit" text, 
    PRIMARY KEY ("parentId", "childId") 
) WITH CLUSTERING ORDER BY ("childId" ASC) 
    AND bloom_filter_fp_chance = 0.01 
    AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}' 
    AND comment = '' 
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'} 
    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'} 
    AND dclocal_read_repair_chance = 0.1 
    AND default_time_to_live = 0 
    AND gc_grace_seconds = 864000 
    AND max_index_interval = 2048 
    AND memtable_flush_period_in_ms = 0 
    AND min_index_interval = 128 
    AND read_repair_chance = 0.0 
    AND speculative_retry = '99.0PERCENTILE'; 
CREATE INDEX purchase_events_clientNumber_idx ON gestor.purchase_events ("clientNumber"); 

任何幫助?

回答

1

只需附上clientNumber用雙引號

例子:select * from purchase_events where "clientNumber" = '100';

+0

請檢查我的編輯。 –

+0

@RafaelReyes現在檢查 –

+0

它的工作原理,謝謝! –