dawidwys commented on code in PR #24534:
URL: https://github.com/apache/flink/pull/24534#discussion_r1530780573
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/calcite/FlinkCalciteSqlValidator.java:
##########
@@ -222,14 +223,23 @@ protected void registerNamespace(
Collections.singletonList(simplifiedRexNode),
reducedNodes);
// check whether period is the unsupported expression
- if (!(reducedNodes.get(0) instanceof RexLiteral)) {
- throw new UnsupportedOperationException(
+ final RexNode reducedNode = reducedNodes.get(0);
+ if (!(reducedNode instanceof RexLiteral)) {
+ throw new ValidationException(
String.format(
"Unsupported time travel expression: %s for
the expression can not be reduced to a constant by Flink.",
periodNode));
}
- RexLiteral rexLiteral = (RexLiteral) (reducedNodes).get(0);
+ RexLiteral rexLiteral = (RexLiteral) reducedNode;
+ final SqlTypeName sqlTypeName = rexLiteral.getTypeName();
+ if (!(sqlTypeName == SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE
+ || sqlTypeName == SqlTypeName.TIMESTAMP)) {
Review Comment:
Good idea! I was looking for sth like it, but I failed.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]