beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Work logged] (BEAM-4388) Support optimized logical plan
Date Wed, 30 May 2018 15:46:00 GMT


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

 File path: sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/
 @@ -17,15 +17,77 @@
 package org.apache.beam.sdk.extensions.sql.impl.rel;
+import java.util.List;
 import org.apache.beam.sdk.transforms.PTransform;
 import org.apache.beam.sdk.values.PCollection;
 import org.apache.beam.sdk.values.PCollectionTuple;
 import org.apache.beam.sdk.values.Row;
 import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeField;
 /** A {@link RelNode} that can also give a {@link PTransform} that implements the expression.
 public interface BeamRelNode extends RelNode {
+  default double estimateRowSize(RelDataType rowType) {
+    List<RelDataTypeField> fieldList = rowType.getFieldList();
+    return fieldList
+        .stream()
+        .mapToDouble(typeField -> estimateDataTypeSize(typeField.getType()))
+        .sum();
+  }
+  default double estimateDataTypeSize(RelDataType type) {
 Review comment:
   This can actually go onto `RowCoder` for now I think. Coders already have a place for size
estimation. And you can get a `RowCoder` from any schema. You can use `CalciteUtils` to convert
to `Schema`.

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:

Issue Time Tracking

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

> Support optimized logical plan
> ------------------------------
>                 Key: BEAM-4388
>                 URL:
>             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

View raw message