Hi Michel, My only other guess is that you actually are running Cassandra 2.1, since thats the exact error I get if I try to execute a JSON statement against a version earlier than 2.2.
On Mon, Jun 1, 2015 at 6:13 PM, Michel Blase <mblas...@gmail.com> wrote: > Thanks Zach, > > tried that but I get the same error: > > *SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] > message="line 1:24 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]}}]}';)">* > > On Mon, Jun 1, 2015 at 6:12 PM, Zach Kurey <zach.ku...@datastax.com> > wrote: > >> Looks like you have your use of single vs. double quotes inverted. What >> you want is: >> >> INSERT INTO users JSON '{"id": 123,"name": "jbellis","address": {"home": >> {"street": "123 Cassandra Dr","city": "Austin","zip_code": 78747,"phones": >> [2101234567]}}}'; >> >> HTH >> >> On Mon, Jun 1, 2015 at 6:03 PM, Michel Blase <mblas...@gmail.com> wrote: >> >>> 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 >>> >>> >>> >> >