Cassandra“没有可行的输入替代方案" [英] Cassandra "no viable alternative at input"

查看:22
本文介绍了Cassandra“没有可行的输入替代方案"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在表格中插入一个简单的行.有人可以指出这里发生了什么吗?

I am trying to insert a simple row into the table. Can someone point out what is happening here ?

CREATE TABLE recommendation_engine_poc.user_by_category (
        game_category text,
        customer_id text,
        amount double,
        game_date timestamp,
        PRIMARY KEY (game_category, customer_id)
    ) WITH CLUSTERING ORDER BY (customer_id 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';

    cqlsh:recommendation_engine_poc> insert into user_by_category  ('game_category','customer_id') VALUES ('Goku','12') ;
    SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] message="line 1:31 no viable alternative at input 'game_category' (insert into user_by_category  (['game_categor]...)">

推荐答案

语法错误.你在这里:

插入 user_by_category (game_category,customer_id) VALUES('悟空','12');

insert into user_by_category (game_category,customer_id) VALUES ('Goku','12');

或:

插入 user_by_category ("game_category","customer_id") VALUES('卡卡罗特','12');

insert into user_by_category ("game_category","customer_id") VALUES ('Kakarot','12');

第二个通常用于区分大小写的列名.

The second one is normally used for case-sensitive column names.

这篇关于Cassandra“没有可行的输入替代方案"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆