raminqaf commented on code in PR #28146:
URL: https://github.com/apache/flink/pull/28146#discussion_r3227441197
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/DateTimeUtils.java:
##########
@@ -380,6 +388,15 @@ private static TimestampData epochToTimestampData(long
epoch, int precision) {
return TimestampData.fromInstant(Instant.ofEpochSecond(epochSeconds,
nanoAdjustment));
}
+ private static void validatePrecision(int precision) {
+ if (precision < MIN_PRECISION || precision > MAX_PRECISION) {
+ throw new TableRuntimeException(
+ String.format(
+ "Precision for TO_TIMESTAMP_LTZ must be between %d
and %d but was %d.",
+ MIN_PRECISION, MAX_PRECISION, precision));
+ }
+ }
Review Comment:
@twalthr I dig deeper here and notice that after introducing the changes
FLINK-39244 we made a change in the runtime behavior. So I went back to the old
behavior and throw an Exception at this point if the precision is invalid.
Please have a look in the diff:
https://github.com/apache/flink/pull/27757/changes#diff-e29751e95291efb2d7e399b60ee820322a29d24a716b7373a121a5d4d617aefbL382
The old behavior threw a `TableException` for precisions >3
--
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]