Hi all,

I'm trying to test the new JSON functionalities in C* 2.2.

I'm using this example:

https://issues.apache.org/jira/browse/CASSANDRA-7970

I believe there is a typo in the CREATE TABLE statement that requires
frozen:

CREATE TABLE users (id int PRIMARY KEY,name text,addresses map<text,
frozen<address>>);

but my real problem is in the insert syntax. I've found the CQL-2.2
documentation and my best guess is this:

INSERT INTO users JSON "{'id': 123,'name': 'jbellis','address': {'home':
{'street': '123 Cassandra Dr','city': 'Austin','zip_code': 78747,'phones':
[2101234567]}}}";

but I get the error:

SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query]
message="line 1:23 mismatched input '{'id': 123,'name':
'jbellis','address': {'home': {'street': '123 Cassandra Dr','city':
'Austin','zip_code': 78747,'phones': [2101234567]}}}' expecting ')' (INSERT
INTO users JSON ["{'id': 123,'name': 'jbellis','address': {'home':
{'street': '123 Cassandra Dr','city': 'Austin','zip_code': 78747,'phones':
[2101234567]}}]}";)">


Any idea?


Thanks,

Michael

Reply via email to