2

尝试使用 hive 通过 DSE 3.1.3 将数据导入 Cassandra。似乎不支持通过 hive 插入 NULL 值。这支持吗?

人为的例子:

cqlsh:
create table foo(id text, name text, primary key(id));
create table fooo(id text, name text, primary key(id));

insert into foo(id,name) values('a',null);

hive: (use keyspace where foo and fooo were created)
insert into table fooo select id,null from foo;

Stack from jobtracker...

java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row {"id":"a","name":""}
    at org.apache.hadoop.hive.ql.exec.ExecMapper.map(ExecMapper.java:161)
    at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
    at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:436)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:372)
    at org.apache.hadoop.mapred.Child$4.run(Child.java:266)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:396)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
    at org.apache.hadoop.mapred.Child.main(Child.java:260)
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row {"id":"a","name":""}
    at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:548)
    at org.apache.hadoop.hive.ql.exec.ExecMapper.map(ExecMapper.java:143)
    ... 8 more
Caused by: java.lang.NullPointerException
    at org.apache.hadoop.hive.serde2.lazy.LazyUtils.writePrimitiveUTF8(LazyUtils.java:220)
    at org.apache.hadoop.hive.cassandra.serde.AbstractTableMapping.serialize(AbstractTableMapping.java:149)
    at org.apache.hadoop.hive.cassandra.serde.AbstractTableMapping.serializeToBytes(AbstractTableMapping.java:118)
    at org.apache.hadoop.hive.cassandra.cql3.serde.CqlTableMapping.getWritable(CqlTableMapping.java:53)
    at org.apache.hadoop.hive.cassandra.serde.AbstractColumnSerDe.serialize(AbstractColumnSerDe.java:150)
4

2 回答 2

3

我们将解决这个问题。它不能将 null 序列化为 Hive

于 2013-09-24T22:04:18.000 回答
2

我刚刚在最新的 DSE 版本 3.1.4 中进行了尝试,现在它可以正常工作了。

http://www.datastax.com/docs/datastax_enterprise3.1/dse_release_notes#datastax-enterprise-3-1-4-release-notes

于 2013-10-04T15:18:52.737 回答