[
https://issues.apache.org/jira/browse/BEAM-9178?focusedWorklogId=381783&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-381783
]
ASF GitHub Bot logged work on BEAM-9178:
----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Feb/20 18:24
Start Date: 04/Feb/20 18:24
Worklog Time Spent: 10m
Work Description: robinyqiu commented on pull request #10634: [BEAM-9178]
Support all ZetaSQL TIMESTAMP functions
URL: https://github.com/apache/beam/pull/10634#discussion_r374842900
##########
File path:
sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/translation/ExpressionConverter.java
##########
@@ -770,88 +765,34 @@ private RexNode convertResolvedFunctionCall(
throw new UnsupportedOperationException(
"Only support TUMBLE, HOP AND SESSION functions right now.");
}
- } else if (functionCall.getFunction().getGroup().equals("ZetaSQL")) {
- op =
-
SqlStdOperatorMappingTable.ZETASQL_FUNCTION_TO_CALCITE_SQL_OPERATOR.get(
- functionCall.getFunction().getName());
-
+ } else if ("ZetaSQL".equals(funGroup)) {
if (op == null) {
- throw new UnsupportedOperationException(
- "Does not support ZetaSQL function: " +
functionCall.getFunction().getName());
+ TypeKind returnType =
+
SqlStdOperatorMappingTable.ZETASQL_FUNCTION_NAME_TO_RETURN_TYPE.get(funName);
Review comment:
Great suggestion! Removing the manual map simplifies the code quite a lot.
----------------------------------------------------------------
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: 381783)
Time Spent: 1.5h (was: 1h 20m)
> Support ZetaSQL TIMESTAMP functions in BeamSQL
> ----------------------------------------------
>
> Key: BEAM-9178
> URL: https://issues.apache.org/jira/browse/BEAM-9178
> Project: Beam
> Issue Type: New Feature
> Components: dsl-sql-zetasql
> Reporter: Yueyang Qiu
> Assignee: Yueyang Qiu
> Priority: Major
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> Support *all* TIMESTAMP functions defined in ZetaSQL (BigQuery Standard SQL).
> See the full list of functions below:
> [https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)