Aman Sinha created DRILL-536:
--------------------------------

             Summary: 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


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)

Reply via email to