You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Milinda Lakmal Pathirage (JIRA)" <ji...@apache.org> on 2015/07/08 19:25:05 UTC

[jira] [Comment Edited] (CALCITE-783) Infer collation of Project using monotonicity

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

Milinda Lakmal Pathirage edited comment on CALCITE-783 at 7/8/15 5:24 PM:
--------------------------------------------------------------------------

Hi [~julianhyde],

I changed RelMdCollation and RellCallBinding to get monotonicity metadata to aggregates. But after these changes several tests listed below failed. I think all failures are caused by a single assertion in VolcanoPlanner (org.apache.calcite.plan.volcano.VolcanoPlanner.changeTraits(VolcanoPlanner.java:693)). toTraits.allSimple() returns false due to the composite trait created when input's traits are used to infer LogicalAggregate's trait set.

But I'm not sure what is the proper way to fix this. Can you please have a look at this patch.


was (Author: milinda):
Hi Julian,

I changed RelMdCollation and RellCallBinding to get monotonicity metadata to aggregates. But after these changes several tests listed below failed. I think all failures are caused by a single assertion in VolcanoPlanner (org.apache.calcite.plan.volcano.VolcanoPlanner.changeTraits(VolcanoPlanner.java:693)). toTraits.allSimple() returns false due to the composite trait created when input's traits are used to infer LogicalAggregate's trait set.

But I'm not sure what is the proper way to fix this. Can you please have a look at this patch.

> Infer collation of Project using monotonicity
> ---------------------------------------------
>
>                 Key: CALCITE-783
>                 URL: https://issues.apache.org/jira/browse/CALCITE-783
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Milinda Lakmal Pathirage
>            Assignee: Milinda Lakmal Pathirage
>         Attachments: CALCITE-783-0.patch, CALCITE-783-1.patch
>
>
> Current implementation of RelMdCollation#project doesn't handle function expressions and because of that we loose any collation metadata related to monotonic expressions which can be useful for generating streaming query execution plans involving tumbling windows.
> Following is how current code looks like (RelMdCollation):
> 185: for (Ord<RexNode> project : Ord.zip(projects)) {
> 186:       if (project.e instanceof RexInputRef) {
> 187:         targets.put(((RexInputRef) project.e).getIndex(), project.i);
> 188:       } 
> 189: }
> We only handle projects of type RexInputRef. But to support monotonic expressions we should laso handle projects of type RexCall.



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