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/09/01 16:11:20 UTC

[jira] [Commented] (CALCITE-1366) Metadata provider for predicates pulls up expressions without references incorrectly

    [ https://issues.apache.org/jira/browse/CALCITE-1366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15455880#comment-15455880 ] 

Julian Hyde commented on CALCITE-1366:
--------------------------------------

I wasn't clear, because I'm confused about what it even means to pull up a predicate on an aggregate function. Can you revisit the example and explain what predicates are pulled up?

By the way, it's probably not helpful, but the pedantic logician in me has to point this out: if you have a relational expression that you're sure returns 0 rows, you can validly put any predicate you like on it. Consider {{select a, b from t where false}}. If you put a predicate {{a < 10}}, it would be valid - no rows will violate that predicate. [False implies anything|https://en.wikipedia.org/wiki/Principle_of_explosion]. So, for these purposes, examples with {{where false}} are probably not the best.

> Metadata provider for predicates pulls up expressions without references incorrectly
> ------------------------------------------------------------------------------------
>
>                 Key: CALCITE-1366
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1366
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.9.0
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>
> In org.apache.calcite.rel.metadata.RelMdPredicates.java:
> {code}
> ...
>     for (RexNode r : inputInfo.pulledUpPredicates) {
>       ImmutableBitSet rCols = RelOptUtil.InputFinder.bits(r);
>       if (groupKeys.contains(rCols)) {
>         r = r.accept(new RexPermuteInputsShuttle(m, input));
>         aggPullUpPredicates.add(r);
>       }
>     }
> ...
> {code}
> The check does not take into account that _rCols_ might be empty, and then _r_ cannot be pulled up e.g. count\(*).



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