You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Ruben Q L (Jira)" <ji...@apache.org> on 2020/10/02 16:56:00 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17206331#comment-17206331 ] 

Ruben Q L commented on CALCITE-4266:
------------------------------------

[~julianhyde] I'm moving this issue to "Resolved", since it seems it was done via https://github.com/apache/calcite/commit/1d7e281c199e0f020dd41468c0b721e2baa415a5 (but this ticket was never updated to reflect that)

> 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
>
> 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)