<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: NullPointerException (but not always) in GroupBy in Hive with tez in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NullPointerException-but-not-always-in-GroupBy-in-Hive-with/m-p/269783#M207080</link>
    <description>&lt;P&gt;Thanks you nailed it indeed. &lt;EM&gt;set hiveconf:tez.am.container.reuse.enabled=false;&lt;/EM&gt; did the trick.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Sep 2019 05:30:32 GMT</pubDate>
    <dc:creator>guillaume_roger</dc:creator>
    <dc:date>2019-09-05T05:30:32Z</dc:date>
    <item>
      <title>NullPointerException (but not always) in GroupBy in Hive with tez</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NullPointerException-but-not-always-in-GroupBy-in-Hive-with/m-p/239765#M201574</link>
      <description>&lt;P&gt;This query outputs NPE. The tasks with NPEs are retried, and most of the times (but not always) end up succeeding.&lt;/P&gt;&lt;P&gt;I could not find a smaller query showing my problem so I give here my full query:&lt;/P&gt;&lt;PRE&gt;select
&amp;nbsp; s.ts_utc as sent_dowhour
, o.ts_utc as open_dowhour
, sum(count(s.ts_utc)) over(partition by s.ts_utc) as sent_count
from vault.sent s
left join open o on
o.id=s.id
group by 1, 2&lt;/PRE&gt;&lt;P&gt;My guess is that the construction &lt;/P&gt;&lt;PRE&gt;sum(count(...)) over(partition by ...)&lt;/PRE&gt;&lt;P&gt;has issues.&lt;/P&gt;&lt;P&gt;When it fails, this is the output I get:&lt;/P&gt;&lt;PRE&gt;Vertex failed, vertexName=Reducer 2, vertexId=vertex_1556016846110_42971_7_03, diagnostics=
» Task failed, taskId=task_1556016846110_42971_7_03_000221, diagnostics=
» TaskAttempt 0 failed, info=
» Error: Error while running task ( failure ) : attempt_1556016846110_42971_7_03_000221_0:java.lang.RuntimeException: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row
  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:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row
  at org.apache.hadoop.hive.ql.exec.tez.ReduceRecordSource.pushRecord(ReduceRecordSource.java:304)
  at org.apache.hadoop.hive.ql.exec.tez.ReduceRecordProcessor.run(ReduceRecordProcessor.java:318)
  at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:267)
  ... 16 more
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row
  at org.apache.hadoop.hive.ql.exec.tez.ReduceRecordSource$GroupIterator.next(ReduceRecordSource.java:378)
  at org.apache.hadoop.hive.ql.exec.tez.ReduceRecordSource.pushRecord(ReduceRecordSource.java:294)
  ... 18 more
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.NullPointerException
  at org.apache.hadoop.hive.ql.exec.GroupByOperator.process(GroupByOperator.java:795)
  at org.apache.hadoop.hive.ql.exec.tez.ReduceRecordSource$GroupIterator.next(ReduceRecordSource.java:363)
  ... 19 more
Caused by: java.lang.NullPointerException
  at org.apache.hadoop.hive.ql.exec.persistence.PTFRowContainer.first(PTFRowContainer.java:115)
  at org.apache.hadoop.hive.ql.exec.PTFPartition.iterator(PTFPartition.java:114)
  at org.apache.hadoop.hive.ql.udf.ptf.BasePartitionEvaluator.getPartitionAgg(BasePartitionEvaluator.java:200)
  at org.apache.hadoop.hive.ql.udf.ptf.WindowingTableFunction.evaluateFunctionOnPartition(WindowingTableFunction.java:155)
  at org.apache.hadoop.hive.ql.udf.ptf.WindowingTableFunction.iterator(WindowingTableFunction.java:538)
  at org.apache.hadoop.hive.ql.exec.PTFOperator$PTFInvocation.finishPartition(PTFOperator.java:349)
  at org.apache.hadoop.hive.ql.exec.PTFOperator.process(PTFOperator.java:123)
  at org.apache.hadoop.hive.ql.exec.Operator.baseForward(Operator.java:994)
  at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:940)
  at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:927)
  at org.apache.hadoop.hive.ql.exec.GroupByOperator.forward(GroupByOperator.java:1050)
  at org.apache.hadoop.hive.ql.exec.GroupByOperator.processAggr(GroupByOperator.java:850)
  at org.apache.hadoop.hive.ql.exec.GroupByOperator.processKey(GroupByOperator.java:724)
  at org.apache.hadoop.hive.ql.exec.GroupByOperator.process(GroupByOperator.java:790)
  ... 20 more&lt;/PRE&gt;&lt;P&gt;Semantically my query is valid (and indeed sometimes succeeds) so what is going on?&lt;/P&gt;&lt;P&gt;Note:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;hdp 3.1, hive 3&lt;/LI&gt;&lt;LI&gt;orc tables, orc intermediate results&lt;/LI&gt;&lt;LI&gt;tez&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 03 May 2019 20:50:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NullPointerException-but-not-always-in-GroupBy-in-Hive-with/m-p/239765#M201574</guid>
      <dc:creator>guillaume_roger</dc:creator>
      <dc:date>2019-05-03T20:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException (but not always) in GroupBy in Hive with tez</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NullPointerException-but-not-always-in-GroupBy-in-Hive-with/m-p/239766#M201575</link>
      <description>&lt;P&gt;Might be related to a container-reuse issue: &lt;A rel="noopener noreferrer noopener noreferrer" href="https://issues.apache.org/jira/browse/HIVE-18786" target="_blank"&gt;HIVE-18786&lt;/A&gt; -- perhaps disable tez.am.container.reuse.enabled in tez-site.xml to verify?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 10:22:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NullPointerException-but-not-always-in-GroupBy-in-Hive-with/m-p/239766#M201575</guid>
      <dc:creator>packet</dc:creator>
      <dc:date>2019-08-12T10:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException (but not always) in GroupBy in Hive with tez</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NullPointerException-but-not-always-in-GroupBy-in-Hive-with/m-p/269783#M207080</link>
      <description>&lt;P&gt;Thanks you nailed it indeed. &lt;EM&gt;set hiveconf:tez.am.container.reuse.enabled=false;&lt;/EM&gt; did the trick.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 05:30:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NullPointerException-but-not-always-in-GroupBy-in-Hive-with/m-p/269783#M207080</guid>
      <dc:creator>guillaume_roger</dc:creator>
      <dc:date>2019-09-05T05:30:32Z</dc:date>
    </item>
  </channel>
</rss>

