[
https://issues.apache.org/jira/browse/DRILL-536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13972231#comment-13972231
]
Aman Sinha commented on DRILL-536:
----------------------------------
Forgot to mention...the patch is based on the upstream master branch.
> HashAggregate encounters NPE when no aggregate functions are present
> --------------------------------------------------------------------
>
> Key: DRILL-536
> URL: https://issues.apache.org/jira/browse/DRILL-536
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Aman Sinha
> Assignee: Aman Sinha
> Attachments:
> 0001-Fix-DRILL-536-Check-for-number-of-aggregate-function.patch
>
>
> For a plan that contains only group-by keys and no aggregate functions, we
> encounter a NPE, which is coming during code generation. See below. The
> physical plan to reproduce is also given below.
> {
> head : {
> version : 1,
> generator : {
> type : "optiq",
> info : "na"
> },
> type : "APACHE_DRILL_PHYSICAL"
> },
> graph : [ {
> "pop" : "parquet-scan",
> "@id" : 1,
> "entries" : [ {
> "path" : "tpch/nation.parquet"
> } ],
> "storage" : {
> "type" : "file",
> "connection" : "classpath:///"
> },
> "format" : {
> "type" : "parquet"
> }
> }, {
> pop : "project",
> @id : 2,
> exprs : [ {
> ref : "output.$f0",
> expr : "N_REGIONKEY"
> }, {
> ref : "output.$f1",
> expr : "N_NATIONKEY"
> }, {
> ref : "output.$f2",
> expr : "N_NAME"
> } ],
> child : 1
> }, {
> pop : "hash-aggregate",
> @id : 3,
> child : 2,
> keys : [ {
> ref : "$f0",
> expr : "$f0"
> }, {
> ref : "$f1",
> expr : "$f1"
> }, {
> ref : "$f2",
> expr : "$f2 "
> } ]
> }, {
> pop : "screen",
> @id : 4,
> child : 3
> } ]
> }
> java.lang.NullPointerException
>
> org.apache.drill.exec.physical.impl.aggregate.HashAggBatch.createAggregatorInternal(HashAggBatch.java:184)
> ~[classes/:na]
>
> org.apache.drill.exec.physical.impl.aggregate.HashAggBatch.createAggregator(HashAggBatch.java:165)
> ~[classes/:na]
>
> org.apache.drill.exec.physical.impl.aggregate.HashAggBatch.next(HashAggBatch.java:112)
> ~[classes/:na]
>
> org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next(IteratorValidatorBatchIterator.java:107)
> ~[classes/:na]
>
> org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.next(ScreenCreator.java:85)
> ~[classes/:na]
>
> org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:83)
> ~[classes/:na]
--
This message was sent by Atlassian JIRA
(v6.2#6252)