[ 
https://issues.apache.org/jira/browse/BEAM-4388?focusedWorklogId=107209&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-107209
 ]

ASF GitHub Bot logged work on BEAM-4388:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/May/18 15:45
            Start Date: 30/May/18 15:45
    Worklog Time Spent: 10m 
      Work Description: kennknowles commented on a change in pull request 
#5481: [BEAM-4388] Support optimized logical plan
URL: https://github.com/apache/beam/pull/5481#discussion_r191816567
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamFilterRel.java
 ##########
 @@ -45,6 +48,14 @@ public Filter copy(RelTraitSet traitSet, RelNode input, 
RexNode condition) {
     return new BeamFilterRel(getCluster(), traitSet, input, condition);
   }
 
+  @Override
+  public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery 
mq) {
+    double rowCnt = mq.getRowCount(this);
+    return planner
+        .getCostFactory()
+        .makeCost(rowCnt, rowCnt, rowCnt * estimateRowSize(getRowType()));
 
 Review comment:
   So just checking - this overrides the default of
   
    - rowcount
    - cpu proportional to rowcount
    - IO zero
   
   and makes it
   
    - rowcount
    - cpu proportional to rowcount
    - IO proportional to rowcount * schema size
   
   That seems like a good change. Since it is just a vague generalization, 
though, I think that you might just put IO cost on GBK (since it usually is a 
shuffle) and sinks, but leave it zero for filters and projects, etc.
   
   Later we'll need to be able to plug in cost models.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 107209)
    Time Spent: 0.5h  (was: 20m)

> Support optimized logical plan
> ------------------------------
>
>                 Key: BEAM-4388
>                 URL: https://issues.apache.org/jira/browse/BEAM-4388
>             Project: Beam
>          Issue Type: Sub-task
>          Components: dsl-sql
>            Reporter: Kai Jiang
>            Assignee: Kai Jiang
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Before converting into Beam Pipeline physical plan, logical plan should be 
> optimized and it will be super helpful for efficiently executing Beam 
> PTransforms pipeline. 
> Calcite has two ways for optimizing logical plan (HepPlanner and 
> VolcanoPlanner). We can support VolcanoPlanner first and apply calcite 
> builtin optimize rules (like 
> FilterJoinRule.FILTER_ON_JOIN) to sql query optimize plans.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to