Cassandra在where子句中的未定义名称

时间:2017-03-20 17:02:44

标签: cassandra nosql

我正在查询执行以下命令的cassandra表: select * from oap.purchase_events where clientNumber = '100'

该表包含一行clientNumber 100,但是我收到此错误:

InvalidRequest:code = 2200 [Invalid query] message =" where子句中未定义的名称clientnumber(' 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 个答案:

答案 0 :(得分:1)

用双引号括起clientNumber

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