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

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

                Author: ASF GitHub Bot
            Created on: 13/Jun/18 17:40
            Start Date: 13/Jun/18 17:40
    Worklog Time Spent: 10m 
      Work Description: XuMingmin commented on a change in pull request #5481: 
[BEAM-4388] Support optimized logical plan
URL: https://github.com/apache/beam/pull/5481#discussion_r195174527
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/BeamSqlExplainTest.java
 ##########
 @@ -0,0 +1,78 @@
+/*
+ * 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;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.beam.sdk.extensions.sql.impl.parser.impl.BeamSqlParserImpl;
+import org.apache.beam.sdk.extensions.sql.meta.provider.text.TextTableProvider;
+import org.apache.beam.sdk.extensions.sql.meta.store.InMemoryMetaStore;
+import org.apache.calcite.sql.parser.SqlParseException;
+import org.apache.calcite.tools.RelConversionException;
+import org.apache.calcite.tools.ValidationException;
+import org.junit.Before;
+import org.junit.Test;
+
+/** UnitTest for {@link BeamSqlParserImpl}. */
+public class BeamSqlExplainTest {
+  private InMemoryMetaStore metaStore;
+  private BeamSqlCli cli;
+
+  @Before
+  public void setUp() throws SqlParseException, RelConversionException, 
ValidationException {
+    metaStore = new InMemoryMetaStore();
+    metaStore.registerProvider(new TextTableProvider());
+    cli = new BeamSqlCli().metaStore(metaStore);
+
+    cli.execute(
+        "create table person (\n"
+            + "id int COMMENT 'id', \n"
+            + "name varchar COMMENT 'name', \n"
+            + "age int COMMENT 'age') \n"
+            + "TYPE 'text' \n"
+            + "COMMENT '' ");
+
+    cli.execute(
+        "create table A (\n"
+            + "c1 int COMMENT 'c1',\n"
+            + "c2 int COMMENT 'c2')\n"
+            + "TYPE 'text'\n"
+            + "COMMENT '' ");
+
+    cli.execute(
+        "create table B (\n"
+            + "c1 int COMMENT 'c1',\n"
+            + "c2 int COMMENT 'c2')\n"
+            + "TYPE 'text'\n"
+            + "COMMENT '' ");
+  }
+
+  @Test
+  public void testExplainCommaJoin() {
 
 Review comment:
   String comparison is vulnerable. Another way to run a strict rule(if you 
want) is, call 
[BeamQueryPlanner.convertToBeamRel](https://github.com/apache/beam/blob/master/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/BeamQueryPlanner.java#L116),
 and inspect the RelNode hierarchy.   

----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 111576)
    Time Spent: 5h 10m  (was: 5h)

> 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: 5h 10m
>  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