[
https://issues.apache.org/jira/browse/BEAM-8630?focusedWorklogId=377090&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-377090
]
ASF GitHub Bot logged work on BEAM-8630:
----------------------------------------
Author: ASF GitHub Bot
Created on: 24/Jan/20 22:35
Start Date: 24/Jan/20 22:35
Worklog Time Spent: 10m
Work Description: robinyqiu commented on pull request #10618: [BEAM-8630]
Turn on BeamZetaSqlCalcRel
URL: https://github.com/apache/beam/pull/10618#discussion_r370871995
##########
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:
Done!
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 377090)
Time Spent: 8h 40m (was: 8.5h)
> 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 40m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)