[
https://issues.apache.org/jira/browse/HIVE-22082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17929956#comment-17929956
]
Yuan Chen commented on HIVE-22082:
----------------------------------
This error typically arises due to changes in how Hive 3.x handles bucketed
tables compared to Hive 1.x. To address this issue, consider the following
steps:
1.Verify Table Bucketing: Check if the ti_ins.instinct_result_info table is
bucketed. If it is, ensure that the bucketing columns and the number of buckets
are correctly defined and compatible with Hive 3.x requirements.
2.Update Table Statistics: After upgrading, it’s essential to refresh the
table’s metadata and statistics. Execute:
{code:java}
ANALYZE TABLE ti_ins.instinct_result_info COMPUTE STATISTICS;{code}
This command updates the table’s statistics, aiding the query planner in making
accurate decisions.
3.Inspect Data Files: Ensure that the underlying data files conform to Hive
3.x’s expectations for bucketed tables. Inconsistencies in data file
organization can lead to the bucketId out of range: -1 error.
4.Consult Official Documentation: Hive 3.x introduced several changes in the
handling of bucketed tables. Reviewing the official Hive 3.x documentation can
provide insights into these changes and guide necessary adjustments.
If these steps don’t resolve the issue, consider providing additional context,
such as the table’s DDL (Data Definition Language) statements, sample data, and
the complete error stack trace. This information can facilitate a more in-depth
analysis and help identify the root cause of the problem.
> SQL 错误 [2] [08S01]: Error while processing statement: FAILED: Execution Error
> -----------------------------------------------------------------------------
>
> Key: HIVE-22082
> URL: https://issues.apache.org/jira/browse/HIVE-22082
> Project: Hive
> Issue Type: Bug
> Components: Hive, hpl/sql, SQL, Tez
> Affects Versions: 3.1.0
> Environment: 报错环境为hive的3.1.0.3.1.0.0-78,可以运行的环境是 Hive 1.2.1000
> Reporter: 冯伟
> Assignee: Richard Zhang
> Priority: Blocker
>
> hive 1.2.1旧版本SQL语句运行没问题,3.1版本运行报错:
> 查询使用的是TEZ。
> SQL语句:
> {code:java}
> // SQL语句:
> select id ,triggered from ti_ins.instinct_result_info lateral view
> explode(split( concat_ws(',',rule_triggered_1,rule_triggered_2),','))num as
> triggered LIMIT 1{code}
> {code:java}
> //代码占位符SQL 错误 [2] [08S01]: Error while processing statement: FAILED:
> Execution Error, return code 2 from
> org.apache.hadoop.hive.ql.exec.tez.TezTask. Vertex failed, vertexName=Map 1,
> vertexId=vertex_1563265369069_0167_15_00, diagnostics=[Task failed,
> taskId=task_1563265369069_0167_15_00_000003, diagnostics=[TaskAttempt 0
> failed, info=[Error: Error while running task ( failure ) :
> attempt_1563265369069_0167_15_00_000003_0:java.lang.RuntimeException:
> java.lang.RuntimeException: java.io.IOException:
> java.lang.IllegalArgumentException: bucketId out of range: -1
> at
> org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:296)
> at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.run(TezProcessor.java:250)
> at
> org.apache.tez.runtime.LogicalIOProcessorRuntimeTask.run(LogicalIOProcessorRuntimeTask.java:374)
> at
> org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:73)
> at
> org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:61)
> at java.security.AccessController.doPrivileged(Native Method)
> at javax.security.auth.Subject.doAs(Subject.java:422)
> at
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1730)
> at
> org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:61)
> at
> org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:37)
> at org.apache.tez.common.CallableWithNdc.call(CallableWithNdc.java:36)
> at
> com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:108)
> at
> com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:41)
> at
> com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:77)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.RuntimeException: java.io.IOException:
> java.lang.IllegalArgumentException: bucketId out of range: -1
> at
> org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:206)
> at
> org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.<init>(TezGroupedSplitsInputFormat.java:145)
> at
> org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat.getRecordReader(TezGroupedSplitsInputFormat.java:111)
> at
> org.apache.tez.mapreduce.lib.MRReaderMapred.setupOldRecordReader(MRReaderMapred.java:157)
> at
> org.apache.tez.mapreduce.lib.MRReaderMapred.setSplit(MRReaderMapred.java:83)
> at
> org.apache.tez.mapreduce.input.MRInput.initFromEventInternal(MRInput.java:703)
> at org.apache.tez.mapreduce.input.MRInput.initFromEvent(MRInput.java:662)
> at
> org.apache.tez.mapreduce.input.MRInputLegacy.checkAndAwaitRecordReaderInitialization(MRInputLegacy.java:150)
> at org.apache.tez.mapreduce.input.MRInputLegacy.init(MRInputLegacy.java:114)
> at
> org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.getMRInput(MapRecordProcessor.java:532)
> at
> org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.init(MapRecordProcessor.java:178)
> at
> org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:266)
> ... 16 more
> Caused by: java.io.IOException: java.lang.IllegalArgumentException: bucketId
> out of range: -1
> at
> org.apache.hadoop.hive.io.HiveIOExceptionHandlerChain.handleRecordReaderCreationException(HiveIOExceptionHandlerChain.java:97)
> at
> org.apache.hadoop.hive.io.HiveIOExceptionHandlerUtil.handleRecordReaderCreationException(HiveIOExceptionHandlerUtil.java:57)
> at
> org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:421)
> at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat $
> TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:203)
> ......还有27个{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)