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

Selecting a non-existing field from a MapR-DB JSON table fails with NPE

Attach filesAttach ScreenshotVotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Query 1

      > select C_FIRST_NAME,C_BIRTH_COUNTRY,C_BIRTH_YEAR,C_BIRTH_MONTH,C_BIRTH_DAY from customer ORDER BY C_BIRTH_COUNTRY ASC, C_FIRST_NAME ASC LIMIT 10;
      Error: SYSTEM ERROR: NullPointerException
      
        (java.lang.NullPointerException) null
          org.apache.drill.exec.record.SchemaUtil.coerceContainer():176
          org.apache.drill.exec.physical.impl.xsort.managed.BufferedBatches.convertBatch():124
          org.apache.drill.exec.physical.impl.xsort.managed.BufferedBatches.add():90
          org.apache.drill.exec.physical.impl.xsort.managed.SortImpl.addBatch():265
          org.apache.drill.exec.physical.impl.xsort.managed.ExternalSortBatch.loadBatch():421
          org.apache.drill.exec.physical.impl.xsort.managed.ExternalSortBatch.load():357
          org.apache.drill.exec.physical.impl.xsort.managed.ExternalSortBatch.innerNext():302
          org.apache.drill.exec.record.AbstractRecordBatch.next():164
          org.apache.drill.exec.record.AbstractRecordBatch.next():119
          org.apache.drill.exec.record.AbstractRecordBatch.next():109
          org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51
          org.apache.drill.exec.physical.impl.svremover.RemovingRecordBatch.innerNext():93
          org.apache.drill.exec.record.AbstractRecordBatch.next():164
          org.apache.drill.exec.record.AbstractRecordBatch.next():119
          org.apache.drill.exec.record.AbstractRecordBatch.next():109
          org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51
          org.apache.drill.exec.physical.impl.limit.LimitRecordBatch.innerNext():115
          org.apache.drill.exec.record.AbstractRecordBatch.next():164
          org.apache.drill.exec.record.AbstractRecordBatch.next():119
          org.apache.drill.exec.record.AbstractRecordBatch.next():109
          org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51
          org.apache.drill.exec.physical.impl.limit.LimitRecordBatch.innerNext():115
          org.apache.drill.exec.record.AbstractRecordBatch.next():164
          org.apache.drill.exec.record.AbstractRecordBatch.next():119
          org.apache.drill.exec.record.AbstractRecordBatch.next():109
          org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51
          org.apache.drill.exec.physical.impl.svremover.RemovingRecordBatch.innerNext():93
          org.apache.drill.exec.record.AbstractRecordBatch.next():164
          org.apache.drill.exec.record.AbstractRecordBatch.next():119
          org.apache.drill.exec.record.AbstractRecordBatch.next():109
          org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51
          org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext():134
          org.apache.drill.exec.record.AbstractRecordBatch.next():164
          org.apache.drill.exec.physical.impl.BaseRootExec.next():105
          org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext():81
          org.apache.drill.exec.physical.impl.BaseRootExec.next():95
          org.apache.drill.exec.work.fragment.FragmentExecutor$1.run():234
          org.apache.drill.exec.work.fragment.FragmentExecutor$1.run():227
          java.security.AccessController.doPrivileged():-2
          javax.security.auth.Subject.doAs():422
          org.apache.hadoop.security.UserGroupInformation.doAs():1595
          org.apache.drill.exec.work.fragment.FragmentExecutor.run():227
          org.apache.drill.common.SelfCleaningRunnable.run():38
          java.util.concurrent.ThreadPoolExecutor.runWorker():1149
          java.util.concurrent.ThreadPoolExecutor$Worker.run():624
          java.lang.Thread.run():748 (state=,code=0)
      

      Plan

      00-00    Screen
      00-01      Project(C_FIRST_NAME=[$0], C_BIRTH_COUNTRY=[$1], C_BIRTH_YEAR=[$2], C_BIRTH_MONTH=[$3], C_BIRTH_DAY=[$4])
      00-02        SelectionVectorRemover
      00-03          Limit(fetch=[10])
      00-04            Limit(fetch=[10])
      00-05              SelectionVectorRemover
      00-06                Sort(sort0=[$1], sort1=[$0], dir0=[ASC], dir1=[ASC])
      00-07                  Scan(groupscan=[JsonTableGroupScan [ScanSpec=JsonScanSpec [tableName=maprfs:///drill/testdata/tpch/sf1/maprdb/json/range/customer, condition=null], columns=[`C_FIRST_NAME`, `C_BIRTH_COUNTRY`, `C_BIRTH_YEAR`, `C_BIRTH_MONTH`, `C_BIRTH_DAY`]]])
      

      Query 2

      > select C_SALUTATION,C_FIRST_NAME,C_LAST_NAME from customer ORDER BY C_BIRTH_COUNTRY DESC, C_FIRST_NAME DESC LIMIT 10;
      Error: SYSTEM ERROR: NullPointerException
      
      Fragment 0:0
      
      [Error Id: fc02de86-ce9b-418a-80ce-b7f5365911e1 on sidrill1:31010]
      
        (java.lang.NullPointerException) null
          org.apache.drill.exec.record.SchemaUtil.coerceContainer():176
          org.apache.drill.exec.physical.impl.xsort.managed.BufferedBatches.convertBatch():124
          org.apache.drill.exec.physical.impl.xsort.managed.BufferedBatches.add():90
          org.apache.drill.exec.physical.impl.xsort.managed.SortImpl.addBatch():265
          org.apache.drill.exec.physical.impl.xsort.managed.ExternalSortBatch.loadBatch():421
          org.apache.drill.exec.physical.impl.xsort.managed.ExternalSortBatch.load():357
          org.apache.drill.exec.physical.impl.xsort.managed.ExternalSortBatch.innerNext():302
          org.apache.drill.exec.record.AbstractRecordBatch.next():164
          org.apache.drill.exec.record.AbstractRecordBatch.next():119
          org.apache.drill.exec.record.AbstractRecordBatch.next():109
          org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51
          org.apache.drill.exec.physical.impl.svremover.RemovingRecordBatch.innerNext():93
          org.apache.drill.exec.record.AbstractRecordBatch.next():164
          org.apache.drill.exec.record.AbstractRecordBatch.next():119
          org.apache.drill.exec.record.AbstractRecordBatch.next():109
          org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51
          org.apache.drill.exec.physical.impl.limit.LimitRecordBatch.innerNext():115
          org.apache.drill.exec.record.AbstractRecordBatch.next():164
          org.apache.drill.exec.record.AbstractRecordBatch.next():119
          org.apache.drill.exec.record.AbstractRecordBatch.next():109
          org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51
          org.apache.drill.exec.physical.impl.limit.LimitRecordBatch.innerNext():115
          org.apache.drill.exec.record.AbstractRecordBatch.next():164
          org.apache.drill.exec.record.AbstractRecordBatch.next():119
          org.apache.drill.exec.record.AbstractRecordBatch.next():109
          org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51
          org.apache.drill.exec.physical.impl.svremover.RemovingRecordBatch.innerNext():93
          org.apache.drill.exec.record.AbstractRecordBatch.next():164
          org.apache.drill.exec.record.AbstractRecordBatch.next():119
          org.apache.drill.exec.record.AbstractRecordBatch.next():109
          org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51
          org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext():134
          org.apache.drill.exec.record.AbstractRecordBatch.next():164
          org.apache.drill.exec.physical.impl.BaseRootExec.next():105
          org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext():81
          org.apache.drill.exec.physical.impl.BaseRootExec.next():95
          org.apache.drill.exec.work.fragment.FragmentExecutor$1.run():234
          org.apache.drill.exec.work.fragment.FragmentExecutor$1.run():227
          java.security.AccessController.doPrivileged():-2
          javax.security.auth.Subject.doAs():422
          org.apache.hadoop.security.UserGroupInformation.doAs():1595
          org.apache.drill.exec.work.fragment.FragmentExecutor.run():227
          org.apache.drill.common.SelfCleaningRunnable.run():38
          java.util.concurrent.ThreadPoolExecutor.runWorker():1149
          java.util.concurrent.ThreadPoolExecutor$Worker.run():624
          java.lang.Thread.run():748 (state=,code=0)
      

      Plan

      00-00    Screen
      00-01      Project(C_SALUTATION=[$0], C_FIRST_NAME=[$1], C_LAST_NAME=[$2])
      00-02        SelectionVectorRemover
      00-03          Limit(fetch=[10])
      00-04            Limit(fetch=[10])
      00-05              SelectionVectorRemover
      00-06                Sort(sort0=[$3], sort1=[$1], dir0=[DESC], dir1=[DESC])
      00-07                  Scan(groupscan=[JsonTableGroupScan [ScanSpec=JsonScanSpec [tableName=maprfs:///drill/testdata/tpch/sf1/maprdb/json/range/customer, condition=null], columns=[`C_SALUTATION`, `C_FIRST_NAME`, `C_LAST_NAME`, `C_BIRTH_COUNTRY`]]])
      

      Logs attached.

      Attachments

        1. OrderByNPE2.log
          417 kB
          Abhishek Girish
        2. OrderByNPE.log
          413 kB
          Abhishek Girish

        Activity

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

          People

            hanu.ncr Hanumath Rao Maduri
            agirish Abhishek Girish
            Votes:
            0 Vote for this issue
            Watchers:
            4 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment