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

CASE statement fails due to error: Unable to get value vector class for minor type [NULL] and mode [OPTIONAL]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • 1.9.0
    • None
    • Execution - Data Types
    • None

    Description

      The following query fails for no obvious reason

      SELECT
         CASE
            WHEN `tname`.`full_name` = 'ABC' 
            THEN
               ( 
               CASE
                  WHEN `tname`.`full_name` = 'ABC' 
                  THEN
                     (
                        CASE
                           WHEN `tname`.`full_name` = ' ' 
                           THEN
                              (
                                 CASE
                                    WHEN `tname`.`full_name` = 'ABC' 
                                    THEN `tname`.`full_name` 
                                    ELSE NULL 
                                 END
                              )
                              ELSE NULL 
                        END
                     )
                     ELSE NULL 
               END
               )
               WHEN `tname`.`full_name` = 'ABC' 
               THEN NULL 
               ELSE NULL 
         END
      FROM
         cp.`employee.json` `tname`
      

      If the `THEN `tname`.`full_name`` statements is changed to `THEN 'ABC'` the error does not occur.

      Thrown exception

      [Error Id: e75fd0fe-132b-4eb4-b2e8-7b34dc39657e on mgelbana-incorta:31010]
      	at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:543) ~[drill-common-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.work.fragment.FragmentExecutor.sendFinalState(FragmentExecutor.java:293) [drill-java-exec-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.work.fragment.FragmentExecutor.cleanup(FragmentExecutor.java:160) [drill-java-exec-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:262) [drill-java-exec-1.9.0.jar:1.9.0]
      	at org.apache.drill.common.SelfCleaningRunnable.run(SelfCleaningRunnable.java:38) [drill-common-1.9.0.jar:1.9.0]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_111]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_111]
      	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]
      Caused by: java.lang.UnsupportedOperationException: Unable to get value vector class for minor type [NULL] and mode [OPTIONAL]
      	at org.apache.drill.exec.expr.BasicTypeHelper.getValueVectorClass(BasicTypeHelper.java:441) ~[vector-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.record.VectorContainer.addOrGet(VectorContainer.java:123) ~[drill-java-exec-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.setupNewSchema(ProjectRecordBatch.java:463) ~[drill-java-exec-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:78) ~[drill-java-exec-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext(ProjectRecordBatch.java:135) ~[drill-java-exec-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:162) ~[drill-java-exec-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:104) ~[drill-java-exec-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext(ScreenCreator.java:81) ~[drill-java-exec-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:94) ~[drill-java-exec-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:232) ~[drill-java-exec-1.9.0.jar:1.9.0]
      	at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:226) ~[drill-java-exec-1.9.0.jar:1.9.0]
      	at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_111]
      	at javax.security.auth.Subject.doAs(Subject.java:422) ~[na:1.8.0_111]
      	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657) ~[hadoop-common-2.7.1.jar:na]
      	at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:226) [drill-java-exec-1.9.0.jar:1.9.0]
      	... 4 common frames omitted
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mgelbana Mohamed Mohsen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: