mardi 29 avril 2014

colonne composite cassandra à la ruche - Stack Overflow


I have cf as


    create column family foo 
with comparator = 'CompositeType(LongType(reversed=true), UTF8Type)'
and key_validation_class = UTF8Type
and default_validation_class = UTF8Type;

Then created this Hive Table


CREATE EXTERNAL TABLE foo
(time_bucket string, score_article STRUCT<col1:BIGINT, col2:STRING>, article string)
STORED BY 'org.apache.hadoop.hive.cassandra.CassandraStorageHandler'
WITH SERDEPROPERTIES ("cassandra.columns.mapping" = ":key,:column,:value",
"cassandra.cf.name" = "foo");

but when I do


 hive> select * from foo;
OK
1374170825754 {"col1":null,"col2":null} VIEW
1374170825754 {"col1":null,"col2":null} VIEW
11111111 {"col1":null,"col2":null} ASKED
11111111 {"col1":null,"col2":null} ASKED
Time taken: 0.301 seconds, Fetched: 4 row(s)
hive>

I see nulls in the structure. Do anyone know what am I doing wrong here.



I have cf as


    create column family foo 
with comparator = 'CompositeType(LongType(reversed=true), UTF8Type)'
and key_validation_class = UTF8Type
and default_validation_class = UTF8Type;

Then created this Hive Table


CREATE EXTERNAL TABLE foo
(time_bucket string, score_article STRUCT<col1:BIGINT, col2:STRING>, article string)
STORED BY 'org.apache.hadoop.hive.cassandra.CassandraStorageHandler'
WITH SERDEPROPERTIES ("cassandra.columns.mapping" = ":key,:column,:value",
"cassandra.cf.name" = "foo");

but when I do


 hive> select * from foo;
OK
1374170825754 {"col1":null,"col2":null} VIEW
1374170825754 {"col1":null,"col2":null} VIEW
11111111 {"col1":null,"col2":null} ASKED
11111111 {"col1":null,"col2":null} ASKED
Time taken: 0.301 seconds, Fetched: 4 row(s)
hive>

I see nulls in the structure. Do anyone know what am I doing wrong here.


0 commentaires:

Enregistrer un commentaire