You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2021/09/22 18:37:00 UTC

[jira] [Resolved] (CALCITE-4486) UNIQUE predicate

     [ https://issues.apache.org/jira/browse/CALCITE-4486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Hyde resolved CALCITE-4486.
----------------------------------
    Resolution: Fixed

Fixed in [d66f4c50|https://github.com/apache/calcite/commit/d66f4c50737ad3a95a89f49712fc3ff69a1413ee]; thanks for the PR, [~nobigo]!

> UNIQUE predicate
> ----------------
>
>                 Key: CALCITE-4486
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4486
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Julian Hyde
>            Assignee: duan xiong
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.28.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Implement the UNIQUE predicate, as specified by the SQL standard.
> Example:
> {code:java}
> UNIQUE (SELECT publishedIn FROM Book
>             WHERE authorId = 3)
> NOT UNIQUE (SELECT publishedIn FROM BOOK
>             WHERE authorId = 3)
> {code}
> {{UNIQUE}} returns {{FALSE}} if the query returns two or more rows that do not include NULL values and are equal. Like {{EXISTS}}, it never returns {{UNKNOWN}}.
> More details at [JOOQ|https://www.jooq.org/doc/3.0/manual/sql-building/conditional-expressions/unique-predicate/].
> This Issue support the UNIQUE predicate by set {{isExpand}} to return false, so sub-queries are converted to {{RexSubQuery}} expressions and handled later by {{SubQueryRemoveRule}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)