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

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

                Author: ASF GitHub Bot
            Created on: 24/Jan/20 22:03
            Start Date: 24/Jan/20 22:03
    Worklog Time Spent: 10m 
      Work Description: apilloud commented on pull request #10618: [BEAM-8630] 
Turn on BeamZetaSqlCalcRel
URL: https://github.com/apache/beam/pull/10618#discussion_r370861607
 
 

 ##########
 File path: 
sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/translation/ExpressionConverter.java
 ##########
 @@ -486,27 +489,38 @@ private RexNode 
convertRexNodeFromComputedColumnWithFieldList(
         return rexBuilder()
             .makeInputRef(fieldList.get(windowFieldIndex).getType(), 
windowFieldIndex);
       case FIXED_WINDOW_END:
-        // WINDOW END is a function call
         operands.add(
             
rexBuilder().makeInputRef(fieldList.get(windowFieldIndex).getType(), 
windowFieldIndex));
         // TODO: check window_end 's duration is the same as it's aggregate 
window.
         operands.add(
             convertIntervalToRexIntervalLiteral(
                 (ResolvedLiteral) functionCall.getArgumentList().get(0)));
-        return rexBuilder().makeCall(SqlStdOperatorTable.PLUS, operands);
+        return rexBuilder()
+            .makeCall(createSqlFunction("timestamp_add", 
SqlTypeName.TIMESTAMP), operands);
       case SLIDING_WINDOW_END:
         operands.add(
             
rexBuilder().makeInputRef(fieldList.get(windowFieldIndex).getType(), 
windowFieldIndex));
         operands.add(
             convertIntervalToRexIntervalLiteral(
                 (ResolvedLiteral) functionCall.getArgumentList().get(1)));
-        return rexBuilder().makeCall(SqlStdOperatorTable.PLUS, operands);
+        return rexBuilder()
+            .makeCall(createSqlFunction("timestamp_add", 
SqlTypeName.TIMESTAMP), operands);
       default:
         throw new RuntimeException(
             "Does not support window start/end: " + 
functionCall.getFunction().getName());
     }
   }
 
+  private SqlFunction createSqlFunction(String name, SqlTypeName returnType) {
 
 Review comment:
   Can you add this to `SqlOperators.java` and add the two calls above as a 
constant there instead?
 
----------------------------------------------------------------
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: 377066)
    Time Spent: 8h  (was: 7h 50m)

> Prototype of BeamSQL Calc using ZetaSQL Expression Evaluator
> ------------------------------------------------------------
>
>                 Key: BEAM-8630
>                 URL: https://issues.apache.org/jira/browse/BEAM-8630
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql
>            Reporter: Yueyang Qiu
>            Assignee: Yueyang Qiu
>            Priority: Major
>          Time Spent: 8h
>  Remaining Estimate: 0h
>




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

Reply via email to