gpt4 book ai didi

load - 类型转换问题 - Pig -> HCatalog

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

我正在尝试从 HCatalog 加载表,对数据进行一些练习并将其存储到另一个表中。

源表:stage.iboa_event_definitions

inno_description  string    
inno_id double
inno_name string
inno_url string
inno_valid_from string
inno_valid_to string

目的地表:
create table dictionary (id int,src_id double,source_code string, src_code string,     src_description string, group_code string);

我的脚本:
iboa_event_definitions = LOAD 'stage.iboa_event_definitions' USING org.apache.hcatalog.pig.HCatLoader();
iboa_event_definitions_filter = foreach iboa_event_definitions generate inno_id as src_id, 'IBOA' as source_code, inno_name as src_code, inno_description as src_description, '' as group_code;
iboa_event_definitions_filter_id = RANK iboa_event_definitions_filter;
final_table = foreach iboa_event_definitions_filter_id generate rank_iboa_event_definitions_filter as id:int, src_id, source_code as source_code, src_code,
src_description, group_code;
store final_table into 'dictionary' using org.apache.hcatalog.pig.HCatStorer();

我得到错误:

2013-11-26 13:18:06,140 [main] INFO org.apache.pig.tools.pigstats.ScriptState - Pig features used in the script: RANK 2013-11-26 13:18:06,143 [main] INFO org.apache.pig.newplan.logical.rules.ColumnPruneVisitor - Columns pruned for iboa_event_definitions: $3, $4, $5 2013-11-26 13:18:06,212 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1115: Unsupported type: 10 in Pig's schema Details at logfile: /export/home/pig/pig_1385463241554.log



为什么?
让我们检查字段类型。
describe iboa_event_definitions_filter_id;
iboa_event_definitions_filter_id: {rank_iboa_event_definitions_filter: long,src_id: double,source_code: chararray,src_code: chararray,src_description: chararray,group_code: chararray}

describe final_table;
final_table: {id: int,src_id: double,source_code: chararray,src_code: chararray,src_description: chararray,group_code: chararray}

也许错误是由 Long 类型引起的?但这就是我尝试将其转换为 int 的原因。

谁能帮我解决这个问题?

谢谢

帕维尔

最佳答案

错误消息的关键部分是:

Unsupported type: 10 in Pig's schema

当我有一个 INT 时,这发生在我身上。并尝试将其存储在表中,其中对应的列是 BIGINT .

我的解决方案是更改表(所以不是 Pig 脚本),之后商店运行良好。

关于load - 类型转换问题 - Pig -> HCatalog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20217155/

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