gpt4 book ai didi

insert - cassandra hive 插入空值异常

转载 作者:行者123 更新时间:2023-12-02 04:50:26 25 4
gpt4 key购买 nike

尝试使用 hive 通过 DSE 3.1.3 将数据导入 Cassandra。似乎不支持通过配置单元插入 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)

最佳答案

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

关于insert - cassandra hive 插入空值异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18951448/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com