[
https://issues.apache.org/jira/browse/CALCITE-5093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17523509#comment-17523509
]
yanjing.wang commented on CALCITE-5093:
---------------------------------------
Hi, [~zabetak] , I made some investigations,
# Calcite follows Oracle now, Oracle supports *1 = any(1, 2, 3),* see
[comparison
operators|https://docs.oracle.com/cd/E12095_01/doc.10303/e12092/sqopr.htm#i1004774]
# PostgreSQL supports '{*}scalar op ANY (array){*}' form, see
[comparisons|https://www.postgresql.org/docs/current/functions-comparisons.html#id-1.5.8.30.16]
and
[commit|https://github.com/postgres/postgres/commit/bee217924d51af8cf0411167bfc8a7eb55122577]
.
# I didn't find any other dbms support more than any(table query).
# the SQL-92 only contains
{code:java}
<quantified comparison predicate> ::=
<row value constructor> <comp op> <quantifier> <table subquery>
{code}
I don't know if higher sql standard has expanded it.
[~omidbb] , I has changed the title and description, you can change it if you
think it can be improved.
> Cannot validate Array type
> --------------------------
>
> 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
>
> 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.
>
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)