[
https://issues.apache.org/jira/browse/BEAM-4388?focusedWorklogId=108146&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-108146
]
ASF GitHub Bot logged work on BEAM-4388:
----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Jun/18 17:22
Start Date: 01/Jun/18 17:22
Worklog Time Spent: 10m
Work Description: vectorijk commented on a change in pull request #5481:
[BEAM-4388] Support optimized logical plan
URL: https://github.com/apache/beam/pull/5481#discussion_r192461895
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamRelNode.java
##########
@@ -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:
Didn't notice that. I think that's a good way and I will switch to
`RowCoder.estimatedSizeBytes()`
----------------------------------------------------------------
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: 108146)
Time Spent: 50m (was: 40m)
> 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: 50m
> 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)