liyubin117 commented on code in PR #21182:
URL: https://github.com/apache/flink/pull/21182#discussion_r1031324721
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/typeutils/TimeIndicatorTypeInfo.java:
##########
@@ -62,13 +61,10 @@ protected TimeIndicatorTypeInfo(boolean isEventTime) {
this.isEventTime = isEventTime;
}
- // this replaces the effective serializer by a LongSerializer
- // it is a hacky but efficient solution to keep the object creation
overhead low but still
- // be compatible with the corresponding SqlTimestampTypeInfo
@Override
@SuppressWarnings("unchecked")
public TypeSerializer<Timestamp> createSerializer(ExecutionConfig
executionConfig) {
- return (TypeSerializer) LongSerializer.INSTANCE;
+ return (TypeSerializer) LocalDateTimeSerializer.INSTANCE;
Review Comment:
Good question~ The problem has stucked me for two weeks, if not do so, some
tests like `FunctionITCase#testAggregateFunction` would fail. In fact,
`TimeIndicatorTypeInfo` as a deprecated class just provide a hacky solution and
not cover the new schema framework, when deprecated `TableSchema` coverted from
new `ResolvedSchema`, extra info like `rowtime` would retain, thus flink regard
a timestamp watermark column as `TimeIndicatorTypeInfo` and use LongSerializer
to serialize a LocalDateTime object then throw ClassCastException.
--
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]