liyubin117 commented on code in PR #21182:
URL: https://github.com/apache/flink/pull/21182#discussion_r1044056409
##########
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:
I used to remove `rowtime` attri during the conversion from
`ResolvedSchema` to `Schema`, but this will make about fifty test cases trigger
the Calcite exception as follow:
```
Cannot add expression of different type to set:
set type is RecordType(INTEGER amount, VARCHAR(2147483647) CHARACTER SET
"UTF-16LE" currency, TIMESTAMP(3) *ROWTIME* rowtime, TIMESTAMP_LTZ(3)
*PROCTIME* NOT NULL proctime, VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT
NULL currency0, INTEGER rate, TIMESTAMP(3) rowtime0) NOT NULL
expression type is RecordType(INTEGER amount, VARCHAR(2147483647) CHARACTER
SET "UTF-16LE" currency, TIMESTAMP(3) *ROWTIME* rowtime, TIMESTAMP_LTZ(3)
*PROCTIME* NOT NULL proctime, VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT
NULL currency0, INTEGER rate, TIMESTAMP(3) *ROWTIME* rowtime0) NOT NULL
```
As we can see in the previous version `TimeIndicatorTypeInfo`,
LongSerializer is just a temporal hacky way and should be enhanced.
--
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]