Github user hequn8128 commented on a diff in the pull request:
https://github.com/apache/flink/pull/6188#discussion_r197662959
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/time.scala
---
@@ -349,6 +349,17 @@ case class TimestampAdd(
if (!TypeCheckUtils.isString(unit.resultType)) {
return ValidationFailure(s"TimestampAdd operator requires unit to be
of type " +
s"String Literal, but get ${unit.resultType}.")
+ } else {
+ val unitStr = unit.toString()
+ if (!sqlTsiArray.contains(unitStr) &&
+ !sqlTsiArray.map(item => item.split("_").last).contains(unitStr)) {
+ return ValidationFailure(s"TimestampAdd operator requires unit
to be one of (YEAR, " +
--- End diff --
Remove the "(" from "(YEAR", or add a ")" behind
---