[
https://issues.apache.org/jira/browse/CALCITE-5093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
yanjing.wang updated CALCITE-5093:
----------------------------------
Description:
Now Calcite supports quantified comparison predicates like this
{code:java}
1 = any(1, 2, 3)
{code}
but not
{code:java}
1 = any(array[1, 2, 3])
{code}
It follows Oracle's quantified comparison predicates, but not PostgreSQL.
PostgreSQL supports
{code:java}
// code placeholder
{code}
was:
I'm trying to validate a simple query against a schema:
{code:java}
// SQL Query
select id from product
where 'item0' = any(attributes) {code}
Running the validator and digging deep in the place that throws an exception I
get to here:
[https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeChecker.java#L100]
The inputs are two types:
{code:java}
RecordType(CHAR(5) ROW_VALUE)
RecordType(VARCHAR ARRAY ROW_VALUE){code}
As you can see, these types must be compatible but Calcite don't match them
right.
> Quantified comparison operators support array type input
> --------------------------------------------------------
>
> Key: CALCITE-5093
> URL: https://issues.apache.org/jira/browse/CALCITE-5093
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.30.0
> Reporter: Omid B
> Priority: Major
>
> Now Calcite supports quantified comparison predicates like this
> {code:java}
> 1 = any(1, 2, 3)
> {code}
> but not
> {code:java}
> 1 = any(array[1, 2, 3])
> {code}
> It follows Oracle's quantified comparison predicates, but not PostgreSQL.
> PostgreSQL supports
> {code:java}
> // code placeholder
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)