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

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

                Author: ASF GitHub Bot
            Created on: 05/Nov/19 22:53
            Start Date: 05/Nov/19 22:53
    Worklog Time Spent: 10m 
      Work Description: 11moon11 commented on pull request #9943: [BEAM-8508] 
[SQL] Standalone filter push down
URL: https://github.com/apache/beam/pull/9943#discussion_r342839842
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rule/BeamIOPushDownRule.java
 ##########
 @@ -124,11 +126,20 @@ public void onMatch(RelOptRuleCall call) {
     RelDataType calcInputType =
         CalciteUtils.toCalciteRowType(newSchema, 
ioSourceRel.getCluster().getTypeFactory());
 
+    // TODO: Check if an IO supports field reordering and drop a Calc when it 
does (1).
     // Check if the calc can be dropped:
-    // 1. Calc only does projects and renames.
+    // 1. Calc only does projects and renames of fields in the same order.
     //    And
     // 2. Predicate can be completely pushed-down to IO level.
-    if (isProjectRenameOnlyProgram(program) && 
tableFilter.getNotSupported().isEmpty()) {
+    //    And
+    // 3. And IO supports project push-down OR all fields are projected by a 
Calc.
+    if (isProjectRenameOnlyProgram(program, beamSqlTable.supportsProjects())
 
 Review comment:
   This should be resolved now, IOs can specify whether they support field 
reordering. When reordering in not supported and fields are projected in a 
different order (from Schema) - Calc should not be dropped.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 339037)
    Time Spent: 2h 20m  (was: 2h 10m)

> [SQL] Support predicate push-down without project push-down
> -----------------------------------------------------------
>
>                 Key: BEAM-8508
>                 URL: https://issues.apache.org/jira/browse/BEAM-8508
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql
>            Reporter: Kirill Kozlov
>            Assignee: Kirill Kozlov
>            Priority: Major
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> In this PR: [https://github.com/apache/beam/pull/9863]
> Support for Predicate push-down is added, but only for IOs that support 
> project push-down.
> In order to accomplish that some checks need to be added to not perform 
> certain Calc and IO manipulations when only filter push-down is needed.



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

Reply via email to