[
https://issues.apache.org/jira/browse/CALCITE-7894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18132701#comment-18132701
]
Mihai Budiu commented on CALCITE-7894:
--------------------------------------
This is related to CALCITE-7888.
> Quantified comparisons with SOME and ALL compare only the first column of a
> row
> -------------------------------------------------------------------------------
>
> Key: CALCITE-7894
> URL: https://issues.apache.org/jira/browse/CALCITE-7894
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.42.0
> Reporter: Mihai Budiu
> Priority: Minor
>
> The following quidem test:
> {code:java}
> with t(x, y) as (values (1, 1), (1, 3)),
> s(a, b) as (values (1, 2))
> select t.x, t.y,
> (t.x, t.y) < some (select a, b from s) as lt_some,
> (t.x, t.y) <> some (select a, b from s) as ne_some,
> (t.x, t.y) = all (select a, b from s) as eq_all,
> (t.x, t.y) >= all (select a, b from s) as ge_all
> from t;
> +---+---+---------+---------+--------+--------+
> | X | Y | LT_SOME | NE_SOME | EQ_ALL | GE_ALL |
> +---+---+---------+---------+--------+--------+
> | 1 | 1 | true | true | false | false |
> | 1 | 3 | false | true | false | true |
> +---+---+---------+---------+--------+--------+
> (2 rows) {code}
> produces incorrect results:
> {code:java}
> +---+---+---------+---------+--------+--------+
> | X | Y | LT_SOME | NE_SOME | EQ_ALL | GE_ALL |
> +---+---+---------+---------+--------+--------+
> | 1 | 1 | false | false | true | true |
> | 1 | 3 | false | false | true | true |
> +---+---+---------+---------+--------+--------+ {code}
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)