[
https://issues.apache.org/jira/browse/CALCITE-7032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17953284#comment-17953284
]
xiong duan commented on CALCITE-7032:
-------------------------------------
[~mbudiu] The invalid test:
null = some (CAST ARRAY[10000,2,3] as tinyint ARRAY)
The range of TINYINT is [-128, 127]. Therefore, converting 10000 to TINYINT
will result in a boundary violation exception and cannot be directly converted
to NULL.(There are other similar issues as well. For instance, in
RexBuilder.makeIn, values are converted to SEARCH. When IN-LIST-VALUES is
(cast(10000 as tinyint), 100000), it will create an IN-LIST-VALUE of type
INTEGER (10000, 100000), which actually ignores the exceptions directly).
Should we simply throw an exception when creating the cast (10000 as tinyint),
or do we need to have each stage handle the cast? I prefer the first approach.
The test:
null = some (ARRAY[1,2,3])
Because the left operand is NULL, therefore, the result of this expression is
definitely NULL.
> 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)