drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Serhii Harnyk (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-5197) CASE statement fails due to error: Unable to get value vector class for minor type [NULL] and mode [OPTIONAL]
Date Mon, 16 Jan 2017 15:37:26 GMT

    [ https://issues.apache.org/jira/browse/DRILL-5197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15824162#comment-15824162
] 

Serhii Harnyk commented on DRILL-5197:
--------------------------------------

Replacing 
{noformat}
THEN `tname`.`full_name`
{noformat}
statement with a literal value you defines the type of result field as VARCHAR(REQUIRED),

but the root of problem this part of query:
{noformat}
WHEN `tname`.`full_name` = 'ABC' 
         THEN NULL 
         ELSE NULL 
{noformat}
because drill couldn't define the type of result. 
You can ensure in that by replacing any "NULL" of this part of query.

> CASE statement fails due to error: Unable to get value vector class for minor type [NULL]
and mode [OPTIONAL]
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-5197
>                 URL: https://issues.apache.org/jira/browse/DRILL-5197
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Data Types
>    Affects Versions: 1.9.0
>            Reporter: Muhammad Gelbana
>
> The following query fails for no obvious reason
> {code:sql}
> 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`
> {code}
> If the `THEN `tname`.`full_name`` statements is changed to `THEN 'ABC'` the error does
not occur.
> Thrown exception
> {noformat}
> [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
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message