[
https://issues.apache.org/jira/browse/CALCITE-7032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17953285#comment-17953285
]
Mihai Budiu commented on CALCITE-7032:
--------------------------------------
If code rewrite/optimization triggers an exception, the rewrite should not be
performed, because the exception needs to be thrown by the code at runtime.
I don't think you want to handle casts in this optimization, that's the concern
of constant folding, which is implemented by other existing REDUCE rules.
> Simplify 'NULL>ALL (ARRAY[1,2,NULL])' to 'NULL'
> -----------------------------------------------
>
> Key: CALCITE-7032
> URL: https://issues.apache.org/jira/browse/CALCITE-7032
> Project: Calcite
> Issue Type: Bug
> Reporter: xiong duan
> Assignee: xiong duan
> Priority: Major
>
> In SqlOperatorTest#testQuantifyCollectionOperators, Some unit test:
> {code:java}
> null = some (COLLECTION[1,2,3])
> null = some (COLLECTION[1,2,null])
> null = some (COLLECTION[null,null,null])
> COLLECTION can be ARRAY OR MULTISET.{code}
> Some invalid unit tests(should throw exception):
> {code:java}
> null = some (CAST ARRAY[10000,2,3] as tinyint ARRAY)
> null = some (CAST ARRAY[cast(10000 as tinyint array),2,3]){code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)