beyond1920 commented on a change in pull request #17666:
URL: https://github.com/apache/flink/pull/17666#discussion_r749980934



##########
File path: 
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/SqlWindowTableFunction.java
##########
@@ -275,16 +277,25 @@ boolean checkTableAndDescriptorOperands(SqlCallBinding 
callBinding, int descript
             SqlNameMatcher matcher = 
validator.getCatalogReader().nameMatcher();
             for (RelDataTypeField field : type.getFieldList()) {
                 if (matcher.matches(field.getName(), columnName)) {
-                    if (FlinkTypeFactory.isTimeIndicatorType(field.getType())) 
{
+                    RelDataType fieldType = field.getType();
+                    if (FlinkTypeFactory.isTimeIndicatorType(fieldType)) {
                         return Optional.empty();
                     } else {
-                        ValidationException exception =
-                                new ValidationException(
-                                        String.format(
-                                                "The window function %s 
requires the timecol is a time attribute type, but is %s.",
-                                                
callBinding.getOperator().getAllowedSignatures(),
-                                                field.getType()));
-                        return Optional.of(exception);
+                        LogicalType timeAttributeType = 
FlinkTypeFactory.toLogicalType(fieldType);
+                        if (!canBeTimeAttributeType(timeAttributeType)) {
+                            ValidationException exception =
+                                    new ValidationException(
+                                            String.format(
+                                                    "The window function %s 
requires the timecol is a time attribute type.\n"
+                                                            + "The supported 
time indicator type are TIMESTAMP and TIMESTAMP_LTZ, but is %s.",

Review comment:
       make sense.




-- 
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]


Reply via email to