Syntax error at position 7: no viable alternative at input 'table'

柔情痞子 提交于 2020-01-05 04:38:11

问题


Environment:

Cassandra and CLI version is 1.2.12
OS                           Windows7 Enterprise, 64 Bit.

ran cassendra-cli.bat, When running the create table command I get following:

[default@unknown] create table us(name varchar); Syntax error at position 7: no viable alternative at input 'table'

Any idea why its throwing error ?


回答1:


You are using the older CLI client. This is pre-CQL and uses the Thrit API. If you want to use that client then check out the older docs. The general view is that CQL is the way to go though.

To use CQL use the CQLSH client instead.

One thing to note, even in CQL your statement is not valid. You must specify a primary key.

create table us(name varchar, primary key (name));


来源:https://stackoverflow.com/questions/20292822/syntax-error-at-position-7-no-viable-alternative-at-input-table

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!