[
https://issues.apache.org/jira/browse/BEAM-6114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16904557#comment-16904557
]
Rui Wang edited comment on BEAM-6114 at 8/11/19 5:10 AM:
---------------------------------------------------------
Thanks [~rahul8383]
1. Is it possible to use RelTrait to define boundedness and seek-ability?
RelTrait is a part of RelNode. These two classes might be helpful:
[RelTrait|https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/plan/RelTrait.java]
and
[RelTraitDef|https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/plan/RelTraitDef.java]
2. I found a FlinkSQL's example rule for you:
[BatchExecHashJoinRule|https://github.com/apache/flink/blob/master/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/batch/BatchExecHashJoinRule.scala].
BatchExecHashJoinRule is more closer what I was thinking: matches() decides if
to fire this rule and onMatch() construct the right engine specific rel node.
What do you think?
was (Author: amaliujia):
Thanks [~rahul8383]
1. Is it possible to use RelTrait to define boundedness and seek-ability?
RelTrait is a part of RelNode. These two classes might be helpful:
[RelTrait|https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/plan/RelTrait.java]
and
[RelTraitDef|https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/plan/RelTraitDef.java]
2. ConverterRule also has
[OnMatch|https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/rel/convert/ConverterRule.java#L136].
In default implementation, it actually tries to match current node's inTrait,
which I think is Convention, and it calls convert() if it matches. I think we
can override OnMatch() and the not only match Convention, but also convert
inputs of current node and check inputs's boundedness and seek-ability traits,
to decide which BeamRelNode to create.
What do you think?
> SQL join selection should be done in planner, not in expansion to PTransform
> ----------------------------------------------------------------------------
>
> Key: BEAM-6114
> URL: https://issues.apache.org/jira/browse/BEAM-6114
> Project: Beam
> Issue Type: Improvement
> Components: dsl-sql
> Reporter: Kenneth Knowles
> Assignee: Rahul Patwari
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Currently Beam SQL joins all go through a single physical operator which has
> a single PTransform that does all join algorithms based on properties of its
> input PCollections as well as the relational algebra.
> A first step is to make the needed information part of the relational
> algebra, so it can choose a PTransform based on that, and the PTransforms can
> be simpler.
> Second step is to have separate (physical) relational operators for different
> join algorithms.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)