drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Volodymyr Vysotskyi (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-4407) Group by subquery causes Java NPE
Date Fri, 19 Jan 2018 11:40:00 GMT

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

Volodymyr Vysotskyi commented on DRILL-4407:
--------------------------------------------

I have reproduced this issue using the query:
{code:sql}
select count(*) from cp.`tpch/nation.parquet` group by ( select CURRENT_DATE from cp.`tpch/nation.parquet`
where n_nationKey = 1);
{code}
After the fix for DRILL-3993, the error message was changed and now it is:
{noformat}
org.apache.drill.common.exceptions.UserException: UNSUPPORTED_OPERATION ERROR: Non-scalar
sub-query used in an expression
See Apache Drill JIRA: DRILL-1937


[Error Id: 648bdc67-ea16-4f9d-ae84-687ab24b01c7 ]
        at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:586)
~[drill-common-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.DrillSqlWorker.getQueryPlan(DrillSqlWorker.java:156)
[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:84)
[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
        at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:567) [drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
        at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:264) [drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[na:1.8.0_151]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[na:1.8.0_151]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]
Caused by: org.apache.drill.exec.work.foreman.UnsupportedFunctionException: Non-scalar sub-query
used in an expression
See Apache Drill JIRA: DRILL-1937
        at org.apache.drill.exec.exception.UnsupportedOperatorCollector.convertException(UnsupportedOperatorCollector.java:43)
~[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
        at org.apache.drill.exec.planner.logical.PreProcessLogicalRel.convertException(PreProcessLogicalRel.java:253)
~[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.preprocessNode(DefaultSqlHandler.java:664)
~[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert(DefaultSqlHandler.java:200)
~[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:168)
~[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.DrillSqlWorker.getQueryPlan(DrillSqlWorker.java:146)
[drill-java-exec-1.13.0-SNAPSHOT.jar:1.13.0-SNAPSHOT]
        ... 6 common frames omitted
{noformat}

> Group by subquery causes Java NPE
> ---------------------------------
>
>                 Key: DRILL-4407
>                 URL: https://issues.apache.org/jira/browse/DRILL-4407
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Storage - JDBC
>    Affects Versions: 1.5.0
>            Reporter: N Campbell
>            Assignee: Taras Supyk
>            Priority: Major
>
> select count(*) from postgres.public.tjoin2  group by ( select c1 from postgres.public.tjoin1
where rnum = 0)
> Error: VALIDATION ERROR: java.lang.NullPointerException
> [Error Id: d3453085-d77c-484e-8df7-f5fadc7bcc7d on centos1:31010]
>   (org.apache.calcite.tools.ValidationException) java.lang.NullPointerException
>     org.apache.calcite.prepare.PlannerImpl.validate():189
>     org.apache.calcite.prepare.PlannerImpl.validateAndGetType():198
>     org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateNode():451
>     org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert():198
>     org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():167
>     org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan():199
>     org.apache.drill.exec.work.foreman.Foreman.runSQL():924
>     org.apache.drill.exec.work.foreman.Foreman.run():250
>     java.util.concurrent.ThreadPoolExecutor.runWorker():1142
>     java.util.concurrent.ThreadPoolExecutor$Worker.run():617
>     java.lang.Thread.run():745
>   Caused By (java.lang.NullPointerException) null
>     org.apache.calcite.sql.validate.SqlValidatorUtil$ExpansionAndDeepCopier.visit():633
>     org.apache.calcite.sql.validate.SqlValidatorUtil$ExpansionAndDeepCopier.visit():619
>     org.apache.calcite.sql.SqlIdentifier.accept():274
>     org.apache.calcite.sql.validate.SqlValidatorUtil$DeepCopier.visit():676
>     org.apache.calcite.sql.validate.SqlValidatorUtil$DeepCopier.visit():663
>     org.apache.calcite.sql.SqlNodeList.accept():152
>     org.apache.calcite.sql.util.SqlShuttle$CallCopyingArgHandler.visitChild():134
>     org.apache.calcite.sql.util.SqlShuttle$CallCopyingArgHandler.visitChild():101
>     org.apache.calcite.sql.SqlOperator.acceptCall():720
>     org.apache.calcite.sql.SqlSelectOperator.acceptCall():128
>     org.apache.calcite.sql.validate.SqlValidatorUtil$DeepCopier.visitScoped():686
>     org.apache.calcite.sql.validate.SqlScopedShuttle.visit():50
>     org.apache.calcite.sql.validate.SqlScopedShuttle.visit():32
>     org.apache.calcite.sql.SqlCall.accept():130
>     org.apache.calcite.sql.validate.SqlValidatorUtil$DeepCopier.visit():676
>     org.apache.calcite.sql.validate.SqlValidatorUtil$DeepCopier.visit():663
>     org.apache.calcite.sql.SqlNodeList.accept():152
>     org.apache.calcite.sql.validate.SqlValidatorUtil$ExpansionAndDeepCopier.copy():626
>     org.apache.calcite.sql.validate.AggregatingSelectScope.<init>():92
>     org.apache.calcite.sql.validate.SqlValidatorImpl.registerQuery():2200
>     org.apache.calcite.sql.validate.SqlValidatorImpl.registerQuery():2122
>     org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression():835
>     org.apache.calcite.sql.validate.SqlValidatorImpl.validate():551
>     org.apache.calcite.prepare.PlannerImpl.validate():187
>     org.apache.calcite.prepare.PlannerImpl.validateAndGetType():198
>     org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateNode():451
>     org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert():198
>     org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():167
>     org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan():199
>     org.apache.drill.exec.work.foreman.Foreman.runSQL():924
>     org.apache.drill.exec.work.foreman.Foreman.run():250
>     java.util.concurrent.ThreadPoolExecutor.runWorker():1142
>     java.util.concurrent.ThreadPoolExecutor$Worker.run():617
>     java.lang.Thread.run():745
> SQLState:  null
> ErrorCode: 0
> create table TJOIN1 (RNUM integer   not null , C1 integer, C2 integer);
> create table TJOIN2 (RNUM integer   not null , C1 integer, C2 char(2));



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message