无法通过Hive映射到Cassandra来查看数据

从Oracle DB通过Sqoop将数据加载到Cassandra之后,我可以通过Cassandra和Hive查看我的数据。 有人告诉我这样做,每个文件都会生成2个文件,造成空间问题。 为了解决这个问题,我把表格放在了Hive中,并创build了一个外部表格,并将其映射到Cassandra中的列族。 但是我无法查看Hive表中的任何数据。 我正在使用Datastax Enterprise 3.0.1。 使用Sqoop,我将表'test'从Oracle DB迁移到了密钥空间'test_keyspace'中同名的Cassandra列族。 我能够通过使用以下命令通过cassandra-cli查看数据:list test;

在cqlsh中描述列族给了我下面的结果:

CREATE TABLE test ( rowkey text PRIMARY KEY, bar text, gump bigint, home text, note text, pay text ) WITH comment='' AND comparator=text AND read_repair_chance=0.100000 AND gc_grace_seconds=864000 AND default_validation=text AND min_compaction_threshold=4 AND max_compaction_threshold=32 AND replication_on_write='true' AND compaction_strategy_class='SizeTieredCompactionStrategy' AND compression_parameters:stable_compression='SnappyCompressor'; 

我用来创buildHive表的命令是:

 CREATE external TABLE test ( rowkey string, bar string, gump string, home string, note string, pay string ) STORED BY 'org.apache.hadoop.hive.cassandra.CassandraStorageHandler' TBLPROPERTIES ( "cassandra.ks.name" = "test_keyspace" ); 

当我在Hive中input'show tables'的时候,表格就会列出来。 但是'select * from test'显示表中的所有值为NULL,除了行键。

谁会知道一个解决scheme?

尝试像这样创build表格:

 CREATE external TABLE test ( rowkey string, bar string, gump string, home string, note string, pay string ) STORED BY 'org.apache.hadoop.hive.cassandra.CassandraStorageHandler' WITH SERDEPROPERTIES("cql.primarykey"="rowkey" TBLPROPERTIES ( "cassandra.ks.name" = "test_keyspace", "cassandra.cql.type"="text, text, text, text, text, text" );