twalthr commented on a change in pull request #11081: [FLINK-16033][table-api]
Introduced Java Table API Expression DSL
URL: https://github.com/apache/flink/pull/11081#discussion_r380096106
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/Expressions.java
##########
@@ -280,6 +282,40 @@ public static ApiExpression rowInterval(Long rows) {
return new ApiExpression(valueLiteral(rows));
}
+
+ /**
+ * Creates a SQL INTERVAL literal corresponding to the given {@link
Duration}.
+ * Equivalent to {@code lit(Duration)}.
Review comment:
this logic is different from `lit(Duration)` because the
`ValueDataTypeConverter` analyzes the values and generates suitable intervals:
`INTERVAL DAY(2) TO SECOND(3) != INTERVAL SECOND(3)`
Either we don't limit intervals in the API and let the planner fail (this is
also what we do in `lit()`) or we call `valueLiteral()` first and check for
`INTERVAL SECOND(3)` afterwards.
----------------------------------------------------------------
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]
With regards,
Apache Git Services