Skip to content

Commit 1c620eb

Browse files
authored
feat(timestamp): enhance RecordBinder to support TIMESTAMP and TIME types in union handling (#2981)
* feat(timestamp): enhance RecordBinder to support TIMESTAMP and TIME types in union handling * test(avro): add missing import for AvroRecordBinderTest
1 parent 6ed1940 commit 1c620eb

File tree

2 files changed

+313
-485
lines changed

2 files changed

+313
-485
lines changed

core/src/main/java/kafka/automq/table/binder/RecordBinder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ private FieldMapping createOptimizedMapping(String avroFieldName, int avroPositi
156156
nestedSchema = icebergType.asStructType().asSchema();
157157
nestedSchemaId = icebergType.toString();
158158
}
159-
if (Type.TypeID.MAP.equals(icebergType.typeId()) || Type.TypeID.LIST.equals(icebergType.typeId())) {
159+
if (Type.TypeID.TIMESTAMP.equals(icebergType.typeId())
160+
|| Type.TypeID.TIME.equals(icebergType.typeId())
161+
|| Type.TypeID.MAP.equals(icebergType.typeId())
162+
|| Type.TypeID.LIST.equals(icebergType.typeId())) {
160163
avroType = resolveUnionElement(avroType);
161164
}
162165
return new FieldMapping(avroPosition, avroFieldName, icebergType, icebergType.typeId(), avroType, nestedSchema, nestedSchemaId);

0 commit comments

Comments
 (0)