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

duan xiong commented on CALCITE-4844:
-------------------------------------

[~julianhyde]  (In this issue we only discuss this case about *IN list includes 
columns*)Firstly. According to the CALCITE-1155. Implement 
{code:java}
'x in (a, b, c)' {code}
by expands to
{code:java}
'x = a or x = b or x = c'{code}
the unit test in 
[https://github.com/apache/calcite/blob/master/core/src/test/resources/sql/sub-query.iq#L239.|https://github.com/apache/calcite/blob/master/core/src/test/resources/sql/sub-query.iq#L239]

This unit test can succeed only because the condition is the [true 
condition|https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java#L1144]

 
So I think Calcite should convert an IN-list that include columns as if the 
user had written OR, even if the IN-list size is greater than the  sub-query 
threshold.

> when the value of sub-query threshold smaller than IN list size the In list 
> include columns return wrong result.
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4844
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4844
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.27.0
>            Reporter: duan xiong
>            Assignee: duan xiong
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> According CALCITE-1155[Support columns for IN list]. We support 
> {code:java}
>  'x in (a, b, c)' {code}
> by expands to
> {code:java}
> 'x = a or x = b or x = c'{code}
> In Calcite. Only the list size smaller than the value of the sub-query 
> threshold can convert.  We should ignore the the value of the sub-query 
> threshold to convert this.



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

Reply via email to