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 2020/08/04 19:41:00 UTC

[jira] [Work logged] (BEAM-10595) Remove rules that not work well with Java UDF

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

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

                Author: ASF GitHub Bot
            Created on: 04/Aug/20 19:40
            Start Date: 04/Aug/20 19:40
    Worklog Time Spent: 10m 
      Work Description: apilloud commented on a change in pull request #12400:
URL: https://github.com/apache/beam/pull/12400#discussion_r465286741



##########
File path: sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSQLQueryPlanner.java
##########
@@ -93,6 +95,14 @@ public ZetaSQLQueryPlanner(JdbcConnection jdbcConnection, RuleSet[] ruleSets) {
         //  requires the JoinCommuteRule, which doesn't work without struct flattening.
         if (rule instanceof JoinCommuteRule) {
           continue;
+        } else if (rule instanceof FilterCalcMergeRule || rule instanceof ProjectCalcMergeRule) {
+          // In order to support Java UDF, we need both BeamZetaSqlCalcRel and BeamCalcRel. It is
+          // because BeamZetaSqlCalcRel can execute ZetaSQL built-in functions while BeamCalcRel
+          // can execute UDFs. So during planning, we expect both Filter and Project are converted
+          // to Calc nodes before merging with other Project/Filter/Calc nodes. Thus we should not
+          // add FilterCalcMergeRule and ProjectCalcMergeRule. CalcMergeRule will achieve equivalent
+          // planning result eventually.

Review comment:
       Shouldn't we just disable these rules all together (in `BeamRuleSets.java`) if they are redundant instead of special casing them for ZetaSQL?




----------------------------------------------------------------
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: 466415)
    Time Spent: 1.5h  (was: 1h 20m)

> Remove rules that not work well with Java UDF
> ---------------------------------------------
>
>                 Key: BEAM-10595
>                 URL: https://issues.apache.org/jira/browse/BEAM-10595
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql-zetasql
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: P2
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> In order to support Java UDF, we need both BeamZetaSqlCalcRel and BeamCalcRel. It is 
> because BeamZetaSqlCalcRel can execute ZetaSQL built-in functions while BeamCalcRel
> can execute UDFs. So during planning, we expect both Filter and Project are converted to
>  a Calc before merging with other Projec/Filter/Calc. Thus we should not add FilterCalcMergeRuleand ProjectCalcMergeRule.



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