You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Neha Dave <ne...@gmail.com> on 2015/11/16 07:11:01 UTC

UDT - Collection - Query

CREATE type metadata1 (
      key text,
      value set<text>,
  );

CREATE TABLE test_path3 (

      path_id text,
      mdata frozen<metadata1>,
      PRIMARY KEY (path_id,mdata)
  );
CREATE INDEX metadata_teste_path3 on test_path3 (mdata) ;

INSERT INTO test_path3 (path_id, mdata ) VALUES ( '2', { key
:'mime-type',value: {'Mime'}});

INSERT INTO test_path3 (path_id, mdata ) VALUES ( '1', { key
:'mime-type',value: {'Mime'}});

INSERT INTO test_path3 (path_id, mdata ) VALUES ( '1', { key
:'applicable-security-policy',value: {'SOX'}});

INSERT INTO test_path3 (path_id, mdata ) VALUES ( '1', { key
:'applicable-security-policy',value: {'FOX'}});





*Can I query Something like....cqlsh:mykeyspace> SELECT * FROM test_path3
where mdata.value CONTAINS {'Mime'};SyntaxException: <ErrorMessage
code=2000 [Syntax error in CQL query] message="line 1:36 no viable
alternative at input '.' (SELECT * FROM test_path3 where [mdata]....)">*
Thanks
regards
Neha