You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/10/03 22:31:00 UTC

[jira] [Work logged] (BEAM-8343) Add means for IO APIs to support predicate and/or project push-down when running SQL pipelines

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

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

                Author: ASF GitHub Bot
            Created on: 03/Oct/19 22:30
            Start Date: 03/Oct/19 22:30
    Worklog Time Spent: 10m 
      Work Description: apilloud commented on pull request #9718: [BEAM-8343] Added methods to BeamSqlTable to enable support for predicate/project push-down
URL: https://github.com/apache/beam/pull/9718#discussion_r331279152
 
 

 ##########
 File path: sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/DefaultTableFilter.java
 ##########
 @@ -0,0 +1,46 @@
+/*
+ * 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.meta;
+
+import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rex.RexNode;
+import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rex.RexProgram;
+
+/**
+ * This default implementation of {@link BeamSqlTableFilter} interface. Assumes that predicate
+ * push-down is not supported.
+ */
+public class DefaultTableFilter implements BeamSqlTableFilter {
+  private final RexProgram program;
+  private final RexNode filter;
+
+  public DefaultTableFilter(RexProgram program, RexNode filter) {
+    this.program = program;
+    this.filter = filter;
+  }
+
+  /**
+   * Since predicate push-down is assumed not to be supported by default - return an unchanged
+   * filter to be preserved.
+   *
+   * @return Predicate {@code RexNode} which is not supported
+   */
+  @Override
+  public RexNode getNotSupported() {
 
 Review comment:
   After learning about `RexNode`, we probably need something else. You suggested a List<RexNode>, where the list entries are ANDs?
 
----------------------------------------------------------------
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:
users@infra.apache.org


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

    Worklog Id:     (was: 323000)
    Time Spent: 20m  (was: 10m)

> Add means for IO APIs to support predicate and/or project push-down when running SQL pipelines
> ----------------------------------------------------------------------------------------------
>
>                 Key: BEAM-8343
>                 URL: https://issues.apache.org/jira/browse/BEAM-8343
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql
>            Reporter: Kirill Kozlov
>            Assignee: Kirill Kozlov
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> The objective is to create a universal way for Beam SQL IO APIs to support predicate/project push-down.
> A proposed way to achieve that is by introducing an interface responsible for identifying what portion(s) of a Calc can be moved down to IO layer. Also, adding following methods to a BeamSqlTable interface to pass necessary parameters to IO APIs:
> - BeamSqlTableFilter supportsFilter(RexProgram program, RexNode filter)
> - Boolean supportsProjects()
> - PCollection<Row> buildIOReader(PBegin begin, BeamSqlTableFilter filters, List<String> fieldNames)
>  
> Design doc [link|https://docs.google.com/document/d/1-ysD7U7qF3MAmSfkbXZO_5PLJBevAL9bktlLCerd_jE/edit?usp=sharing].



--
This message was sent by Atlassian Jira
(v8.3.4#803005)