插入到配置单元嵌套表时出现负数组大小异常

yrwegjxp  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(332)

我正试图插入到一个Hive状的排序表中,却遇到了由reducer引发的数组大小为负的异常。请找到下面的堆栈跟踪。

Error: org.apache.hadoop.mapreduce.task.reduce.Shuffle$ShuffleError: error in shuffle in fetcher#3
    at org.apache.hadoop.mapreduce.task.reduce.Shuffle.run(Shuffle.java:134)
    at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:376)
    at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1693)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.NegativeArraySizeException
    at org.apache.hadoop.io.BoundedByteArrayOutputStream.<init>(BoundedByteArrayOutputStream.java:56)
    at org.apache.hadoop.io.BoundedByteArrayOutputStream.<init>(BoundedByteArrayOutputStream.java:46)
    at org.apache.hadoop.mapreduce.task.reduce.InMemoryMapOutput.<init>(InMemoryMapOutput.java:63)
    at org.apache.hadoop.mapreduce.task.reduce.MergeManagerImpl.unconditionalReserve(MergeManagerImpl.java:305)
    at org.apache.hadoop.mapreduce.task.reduce.MergeManagerImpl.reserve(MergeManagerImpl.java:295)
    at org.apache.hadoop.mapreduce.task.reduce.Fetcher.copyMapOutput(Fetcher.java:514)
    at org.apache.hadoop.mapreduce.task.reduce.Fetcher.copyFromHost(Fetcher.java:336)
    at org.apache.hadoop.mapreduce.task.reduce.Fetcher.run(Fetcher.java:193)

我的表ddl是(为了可读性只显示列的子集)。实际ddl有100列)

CREATE TABLE clustered_sorted_orc( conv_type string,
                                   multi_dim_id int,
                                   multi_key_id int,
                                   advertiser_id bigint,
                                   buy_id bigint,
                                   day timestamp
PARTITIONED BY(job_instance_id int) 
CLUSTERED BY(conv_type) SORTED BY (day) INTO 8 BUCKETS
STORED AS ORC;

insert语句为

FROM not_clustered_orc
INSERT OVERWRITE TABLE clustered_sorted_orc PARTITION(job_instance_id)
SELECT conv_type ,multi_dim_id ,multi_key_id ,advertiser_id,buy_id ,day, job_instance_id

设置了以下配置单元属性

set hive.enforce.bucketing = true;
set hive.exec.dynamic.partition.mode=nonstrict;

这是一个来自mergermanageimpl的日志片段,它指定iosortfactor、mergerthreshold等(如果有帮助的话)。

2016-06-30 05:57:20,518 INFO [main] org.apache.hadoop.mapreduce.task.reduce.MergeManagerImpl: MergerManager: memoryLimit=12828540928, maxSingleShuffleLimit=3207135232, mergeThreshold=8466837504, ioSortFactor=64, memToMemMergeOutputsThreshold=64

我正在使用cdh5.7.1、hive1.1.0、hadoop2.6.0。以前有人遇到过类似的问题吗?非常感谢您的帮助。

w6mmgewl

w6mmgewl1#

我让它工作后设置

hive.optimize.sort.dynamic.partition=true

相关问题