gpt4 book ai didi

hadoop - 使用列表数据类型将数据从Pig插入Cassandra失败

转载 作者:行者123 更新时间:2023-12-02 21:45:10 28 4
gpt4 key购买 nike

我有以下情况:

Cassandra 表:

CREATE TABLE tb_st_test (
id int,
email list<text>,
PRIMARY KEY ((id));

pig 码:
teste = LOAD 'cql://main/tb_st_test' USING CqlStorage();

testing = FOREACH teste GENERATE $0 as cod, ['emailtest@test.com'] as field:();

insert_test =
FOREACH testing GENERATE
TOTUPLE(
TOTUPLE('id',cod)
),
TOTUPLE(field);

STORE insert_test INTO 'cql://main/tb_st_test?output_query=UPDATE tb_st_test set email %3D%3F' USING CqlStorage();

这里的想法是读取表tb_st_test,获取键值,并更新字段电子邮件。
但是,当我运行脚本时,出现以下错误:

后端错误消息
java.io.IOException: org.apache.thrift.transport.TTransportException
at org.apache.cassandra.hadoop.cql3.CqlRecordWriter$RangeClient.run(CqlRecordWriter.java:256)
Caused by: org.apache.thrift.transport.TTransportException
at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.transport.TFramedTransport.readFrame(TFramedTransport.java:129)
at org.apache.thrift.transport.TFramedTransport.read(TFramedTransport.java:101)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:362)
at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:284)
at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:191)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
at org.apache.cassandra.thrift.Cassandra$Client.recv_execute_prepared_cql3_query(Cassandra.java:1820)
at org.apache.cassandra.thrift.Cassandra$Client.execute_prepared_cql3_query(Cassandra.java:1805)
at org.apache.cassandra.hadoop.cql3.CqlRecordWriter$RangeClient.run(CqlRecordWriter.java:240)

有人知道发生了什么吗?

最佳答案

insert_test格式错误,因为列表收集格式应为TOTUPLE(TOUTUPLE('some email','email2'))。检查https://issues.apache.org/jira/browse/CASSANDRA-5867

关于hadoop - 使用列表数据类型将数据从Pig插入Cassandra失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25953507/

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