Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-2921

Query with a mix of distinct and not distinct scalar aggregates runs out of memory

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Query below fails with NULL pointer exception.
      This bug is a request to investigate why 8GB of direct memory is not enough to execute this query.
      General enhancement to fail properly when running out of memory is addressed in DRILL-2920

      Query below was executed on a single node with direct memory of 8GB and planner.slice_target = 1. Table size is 100 rows (parquet file)
      Increasing direct memory to 20GB allowed query to finish and return results.

      Failing query:

      select
              count(*),
              count(distinct c_varchar),
              count(c_varchar),
              count(distinct c_integer),
              count(c_integer),
              count(distinct c_bigint),
              count(c_bigint),
              count(distinct c_smalldecimal),
              count(c_smalldecimal),
              count(distinct c_bigdecimal),
              count(c_bigdecimal),
              count(distinct c_float),
              count(c_float),
              count(distinct c_date),
              count(c_date),
              count(distinct c_time),
              count(c_time),
              count(distinct c_timestamp),
              count(c_timestamp),
              count(distinct c_boolean),
              count(c_boolean)
      from
              alltypes
      ;
      

      Exception in drillbit.log:

      [6e59caeb-a5f5-45f0-80db-58d220f87306 on atsqa4-133.qa.lab:31010]
      org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: null
      
      Fragment 19:2
      
      [6e59caeb-a5f5-45f0-80db-58d220f87306 on atsqa4-133.qa.lab:31010]
              at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:465) ~[drill-common-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.work.fragment.FragmentExecutor.sendFinalState(FragmentExecutor.java:262) [drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:232) [drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_71]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_71]
              at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
      Caused by: java.lang.NullPointerException: null
              at org.apache.drill.exec.vector.IntVector.allocateNew(IntVector.java:164) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.test.generated.HashTableGen16.allocMetadataVector(HashTableTemplate.java:746) ~[na:na]
              at org.apache.drill.exec.test.generated.HashTableGen16.setup(HashTableTemplate.java:461) ~[na:na]
              at org.apache.drill.exec.physical.impl.common.ChainedHashTable.createAndSetupHashTable(ChainedHashTable.java:223) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.test.generated.HashAggregatorGen0.setup(HashAggTemplate.java:269) ~[na:na]
              at org.apache.drill.exec.physical.impl.aggregate.HashAggBatch.createAggregatorInternal(HashAggBatch.java:234) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.aggregate.HashAggBatch.createAggregator(HashAggBatch.java:157) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.aggregate.HashAggBatch.buildSchema(HashAggBatch.java:101) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:132) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next(IteratorValidatorBatchIterator.java:118) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:101) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:91) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.aggregate.StreamingAggBatch.buildSchema(StreamingAggBatch.java:99) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:132) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next(IteratorValidatorBatchIterator.java:118) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:74) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.SingleSenderCreator$SingleSenderRootExec.innerNext(SingleSenderCreator.java:91) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:64) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:199) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:193) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_71]
              at javax.security.auth.Subject.doAs(Subject.java:415) ~[na:1.7.0_71]
              at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1469) ~[hadoop-common-2.4.1-mapr-1408.jar:na]
              at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:193) [drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              ... 3 common frames omitted
      

      I will attach drillbit.log, alltypes data file and explain plan.

      Attachments

        1. alltypes
          10 kB
          Victoria Markman
        2. drillbit-drill-2921.log
          8.88 MB
          Victoria Markman
        3. plan-drill-2921.txt
          10 kB
          Victoria Markman

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            sphillips Steven Phillips
            vicky Victoria Markman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment