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 2016/11/22 00:01:58 UTC

[jira] [Updated] (CALCITE-1498) Allow LIMIT with trivial ORDER BY to be pushed through JOIN

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

Julian Hyde updated CALCITE-1498:
---------------------------------
    Summary: Allow LIMIT with trivial ORDER BY to be pushed through JOIN  (was: RelMdUtil.checkInputForCollationAndLimit() should also consider input collations as a zero-length collation list.)

> Allow LIMIT with trivial ORDER BY to be pushed through JOIN
> -----------------------------------------------------------
>
>                 Key: CALCITE-1498
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1498
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.10.0
>            Reporter: Maryann Xue
>            Assignee: Maryann Xue
>            Priority: Minor
>
> {code}
>     // Check if the input is already sorted
>     boolean alreadySorted = false;
>     if (!alreadySorted) {
>       for (RelCollation inputCollation : mq.collations(input)) {
>         if (inputCollation.satisfies(collation)) {
>           alreadySorted = true;
>           break;
>         }
>       }
>     }
> {code}
> if {{mq.collations(input)}} returns an empty array, {{alreadySorted}} will always be false even if the required {{collation}} is an empty collation (which indicates there's no need to sort).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)