You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Tim Armstrong (Jira)" <ji...@apache.org> on 2020/07/10 16:08:00 UTC

[jira] [Assigned] (IMPALA-9945) Subquery inside some Expr subclasses in WHERE results in IllegalStateException

     [ https://issues.apache.org/jira/browse/IMPALA-9945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Armstrong reassigned IMPALA-9945:
-------------------------------------

    Assignee: Tim Armstrong

> Subquery inside some Expr subclasses in WHERE results in IllegalStateException
> ------------------------------------------------------------------------------
>
>                 Key: IMPALA-9945
>                 URL: https://issues.apache.org/jira/browse/IMPALA-9945
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>            Reporter: Tim Armstrong
>            Assignee: Tim Armstrong
>            Priority: Major
>              Labels: newbie, ramp-up
>
> {noformat}
> [localhost.EXAMPLE.COM:21000] default> explain select * from functional.alltypes t
> where nvl(exists(select id from functional.alltypesagg), false);
> Query: explain select * from functional.alltypes t
> where nvl(exists(select id from functional.alltypesagg), false)
> ERROR: IllegalStateException: Failed analysis after expr substitution.
> CAUSED BY: ClassCastException: org.apache.impala.analysis.SlotRef cannot be cast to org.apache.impala.analysis.Subquery
> [localhost.EXAMPLE.COM:21000] default> explain select * from functional.alltypes t
> where case when id % 2 = 0 then exists(select id from functional.alltypesagg) end;
> Query: explain select * from functional.alltypes t
> where case when id % 2 = 0 then exists(select id from functional.alltypesagg) end
> ERROR: IllegalStateException: Failed analysis after expr substitution.
> CAUSED BY: ClassCastException: org.apache.impala.analysis.SlotRef cannot be cast to org.apache.impala.analysis.Subquery
> {noformat}
> These predicates are not expected to be supported - since we don't support arbitrary subqueries in where - see IMPALA-5226 - but we should produce a more meaningful error, like
> {noformat}
> [localhost.EXAMPLE.COM:21000] default> explain select * from functional.alltypes t
> where cast((t.id IN (select id from functional.alltypesagg) or t.bool_col = false) as string) is not
>  null;
> Query: explain select * from functional.alltypes t
> where cast((t.id IN (select id from functional.alltypesagg) or t.bool_col = false) as string) is not
>  null
> ERROR: AnalysisException: Unsupported IS NULL predicate that contains a subquery: CAST((t.id IN (SEL
> ECT id FROM functional.alltypesagg) OR t.bool_col = FALSE) AS STRING) IS NOT NULL
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org