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

Julian Hyde commented on CALCITE-4758:
--------------------------------------

I stand corrected. I had forgotten that we had implemented syntax such as 
'{{sal > all(500, 2000)}}'. Since we've implemented it, let's continue to 
support it.

Yes, we should make it work regardless of the value of sub-query threshold. I'd 
be happy to accept a fix that works for queries smaller than the sub-query 
threshold, and tackle the larger lists as a separate issue.

Note that the {{<}}, {{<=}}, {{>}} and {{>=}} case can be optimized. For 
example, {{sal > all (1, 2, 3, 4, 5, 6, 7, null)}} can be optimized to {{sal >  
(7, null)}} because 7 is the max. If we put in place that optimization, there 
will be very few cases that are over the threshold.

> When SOME sub-query is SqlNodeList, Calcite returns wrong result 
> -----------------------------------------------------------------
>
>                 Key: CALCITE-4758
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4758
>             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
>
> As discussed in the comments: The SQL
> {code:java}
> select * from "scott".emp where sal > some (4000, 2000)
> {code}
> isĀ illegal SQL. So we should throw an exception instead of return a wrong 
> result.



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

Reply via email to