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

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

                Author: ASF GitHub Bot
            Created on: 15/Jul/19 18:58
            Start Date: 15/Jul/19 18:58
    Worklog Time Spent: 10m 
      Work Description: akedin commented on pull request #9040: [BEAM-7545] 
Reordering Beam Joins
URL: https://github.com/apache/beam/pull/9040#discussion_r303579948
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rule/JoinRelOptRuleCall.java
 ##########
 @@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.sdk.extensions.sql.impl.rule;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.calcite.plan.RelOptPlanner;
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelOptRuleOperand;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.metadata.RelMetadataQuery;
+import org.apache.calcite.tools.RelBuilder;
+
+/**
+ * This is a class to catch the built join and check if it is a legal join 
before passing it to the
+ * actual RelOptRuleCall.
+ */
+public class JoinRelOptRuleCall extends RelOptRuleCall {
+  private final RelOptRuleCall originalCall;
+  private final JoinChecker checker;
+
+  JoinRelOptRuleCall(RelOptRuleCall originalCall, JoinChecker checker) {
+    super(originalCall.getPlanner(), originalCall.getOperand0(), 
originalCall.rels, null, null);
+    this.originalCall = originalCall;
+    this.checker = checker;
+  }
+
+  @Override
+  public RelOptRuleOperand getOperand0() {
+    return originalCall.getOperand0();
+  }
+
+  @Override
+  public RelOptRule getRule() {
+    return originalCall.getRule();
+  }
+
+  @Override
+  public List<RelNode> getRelList() {
+    return originalCall.getRelList();
+  }
+
+  @Override
+  @SuppressWarnings("TypeParameterUnusedInFormals")
+  public <T extends RelNode> T rel(int ordinal) {
+    return originalCall.rel(ordinal);
+  }
+
+  @Override
+  public List<RelNode> getChildRels(RelNode rel) {
+    return originalCall.getChildRels(rel);
+  }
+
+  @Override
+  public RelOptPlanner getPlanner() {
+    return originalCall.getPlanner();
+  }
+
+  @Override
+  public RelMetadataQuery getMetadataQuery() {
+    return originalCall.getMetadataQuery();
+  }
+
+  @Override
+  public List<RelNode> getParents() {
+    return originalCall.getParents();
+  }
+
+  @Override
+  public RelBuilder builder() {
+    return originalCall.builder();
+  }
+
+  @Override
+  public void transformTo(RelNode rel, Map<RelNode, RelNode> equiv) {
 
 Review comment:
   nit: can you move this and `JoinChecker` to the top and add a comment that 
these are the only two custom things, and everything else is delegated to the 
`originalCall`?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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: 276932)
    Time Spent: 6h 10m  (was: 6h)

> Row Count Estimation for CSV TextTable
> --------------------------------------
>
>                 Key: BEAM-7545
>                 URL: https://issues.apache.org/jira/browse/BEAM-7545
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql
>            Reporter: Alireza Samadianzakaria
>            Assignee: Alireza Samadianzakaria
>            Priority: Major
>             Fix For: Not applicable
>
>          Time Spent: 6h 10m
>  Remaining Estimate: 0h
>
> Implementing Row Count Estimation for CSV Tables by reading the first few 
> lines of the file and estimating the number of records based on the length of 
> these lines and the total length of the file.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to