You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2020/12/18 21:38:00 UTC

[jira] [Closed] (CALCITE-4266) JDBC adapter throws UnsupportedOperationException if query contains range predicate on columns from sub-query

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

Julian Hyde closed CALCITE-4266.
--------------------------------

Resolved in release 1.26.0 (2020-10-06)

> JDBC adapter throws UnsupportedOperationException if query contains range predicate on columns from sub-query
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4266
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4266
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Priority: Major
>             Fix For: 1.26.0
>
>
> JDBC adapter throws {{UnsupportedOperationException}} if query contains range predicate on columns from sub-query. The query
> {code}
> SELECT CASE WHEN v.g IN (0, 1) THEN 0 ELSE 1 END
> FROM (SELECT * FROM "foodmart"."customer") AS c,
>  (SELECT 0 AS g) AS v
> GROUP BY v.g
> {code}
> contains a range (by virtue of the {{IN (0, 1)}}) and throws
> {noformat}
> java.lang.UnsupportedOperationException
> 	at org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.implementor(SqlImplementor.java:1597)
> 	at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.lambda$toSql$0(SqlImplementor.java:862)
> 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
> {noformat}
> The problem is that, in order to simplify a Sarg (see CALCITE-4173), the {{implementor()}} is being called in a context where it was not called before. The solution is to implement the {{SqlImplementor.Context.implementor()}} method in more sub-classes.



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