dawidwys commented on a change in pull request #8655: [FLINK-12254][table]
Update field references to new type system
URL: https://github.com/apache/flink/pull/8655#discussion_r291486726
##########
File path:
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AggregateOperationFactory.java
##########
@@ -257,28 +260,31 @@ private FieldReferenceExpression
getValidatedTimeAttribute(GroupWindow window, E
}
FieldReferenceExpression timeField = (FieldReferenceExpression)
timeFieldExpr;
- validateTimeAttributeType(timeField);
+
+ final LogicalType timeFieldType =
timeField.getOutputDataType().getLogicalType();
+
+ validateTimeAttributeType(timeFieldType);
+
return timeField;
}
- private void validateTimeAttributeType(FieldReferenceExpression
timeField) {
- TypeInformation<?> timeFieldType = timeField.getResultType();
+ private void validateTimeAttributeType(LogicalType timeFieldType) {
if (isStreaming) {
validateStreamTimeAttribute(timeFieldType);
} else {
validateBatchTimeAttribute(timeFieldType);
}
}
- private void validateBatchTimeAttribute(TypeInformation<?>
timeFieldType) {
- if (!(timeFieldType instanceof SqlTimeTypeInfo || timeFieldType
== LONG_TYPE_INFO)) {
+ private void validateBatchTimeAttribute(LogicalType timeFieldType) {
+ if (!(hasRoot(timeFieldType, TIMESTAMP_WITHOUT_TIME_ZONE) ||
hasRoot(timeFieldType, BIGINT))) {
Review comment:
Is this enough for the legacy planner? I think legacy planner supports only
subset of the `TIMESTAMP_WITHOUT_TIME_ZONE` root? Where should we validate that?
I understand it is hard to tame two different types systems and two
different planners that support different subsets of those type systems. I
guess the user will always have the possibility to fallback to the legacy type
system for now if something goes wrong. So I am ok with it.
----------------------------------------------------------------
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