Hive上的重建索引失败

时间:2015-10-12 10:55:04

标签: hadoop hive bigdata

我正在使用HortonWorks沙箱来探索Hive的一些功能,并使用Sqoop将表格导入其中。

由于它是一个相当大的表,我试图在其中一个列上创建索引。它要我添加“WITH DEFERRED REBUILD”选项,我做了并创建了索引。

但是当我尝试重建索引时,作业失败并显示以下日志。

日志

Failure while running task:java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:171)
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.run(TezProcessor.java:137)
    at org.apache.tez.runtime.LogicalIOProcessorRuntimeTask.run(LogicalIOProcessorRuntimeTask.java:337)
    at org.apache.tez.runtime.task.TezTaskRunner$TaskRunnerCallable$1.run(TezTaskRunner.java:179)
    at org.apache.tez.runtime.task.TezTaskRunner$TaskRunnerCallable$1.run(TezTaskRunner.java:171)
    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:1657)
    at org.apache.tez.runtime.task.TezTaskRunner$TaskRunnerCallable.callInternal(TezTaskRunner.java:171)
    at org.apache.tez.runtime.task.TezTaskRunner$TaskRunnerCallable.callInternal(TezTaskRunner.java:167)
    at org.apache.tez.common.CallableWithNdc.call(CallableWithNdc.java:36)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.RuntimeException: java.lang.NullPointerException
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:192)
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.<init>(TezGroupedSplitsInputFormat.java:131)
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat.getRecordReader(TezGroupedSplitsInputFormat.java:97)
    at org.apache.tez.mapreduce.lib.MRReaderMapred.setupOldRecordReader(MRReaderMapred.java:149)
    at org.apache.tez.mapreduce.lib.MRReaderMapred.setSplit(MRReaderMapred.java:80)
    at org.apache.tez.mapreduce.input.MRInput.initFromEventInternal(MRInput.java:614)
    at org.apache.tez.mapreduce.input.MRInput.initFromEvent(MRInput.java:593)
    at org.apache.tez.mapreduce.input.MRInputLegacy.checkAndAwaitRecordReaderInitialization(MRInputLegacy.java:141)
    at org.apache.tez.mapreduce.input.MRInputLegacy.init(MRInputLegacy.java:109)
    at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.getMRInput(MapRecordProcessor.java:370)
    at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.init(MapRecordProcessor.java:127)
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:147)
    ... 14 more

Caused by: java.lang.NullPointerException
    at org.apache.hadoop.hive.ql.io.HiveInputFormat.init(HiveInputFormat.java:270)
    at org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:234)
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:189)
    ... 25 more

2 个答案:

答案 0 :(得分:2)

我遇到了同样的问题。我找到了解决方法

set hive.execution.engine=mr;
alter index index_name on table_name rebuild;
set hive.execution.engine=tez;

使用MR运行索引的重建对我没有任何问题。我不确定为什么TEZ会失败。

答案 1 :(得分:0)

问题实际上与tez中配置错误的内存参数有关。

这就是为什么切换到先生解决了这个问题。

有关tez内存的好文章在调试此问题时非常有用。

https://community.hortonworks.com/content/kbentry/14309/demystify-tez-tuning-step-by-step.html