github-actions[bot] commented on code in PR #65502:
URL: https://github.com/apache/doris/pull/65502#discussion_r3568092481


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergUtils.java:
##########
@@ -1198,6 +1204,27 @@ public static List<Column> parseSchema(Schema schema, 
boolean enableMappingVarbi
         return resSchema;
     }
 
+    private static String 
serializeInitialDefault(org.apache.iceberg.types.Type type, Object value,
+            boolean enableMappingVarbinary) {
+        String humanValue = Transforms.identity(type).toHumanString(type, 
value);
+        if (type.typeId() == TypeID.TIMESTAMP) {
+            // Iceberg formats timestamps as ISO-8601 (for example 
2024-01-01T00:00:00), while
+            // Doris' DATETIMEV2 default parser requires a space between the 
date and time.
+            return humanValue.replace('T', ' ');

Review Comment:
   This still misses the timestamp-with-zone branch when 
`enable.mapping.timestamp_tz` is left at its default `false`. `parseSchema()` 
maps `TimestampType.shouldAdjustToUTC()` to Doris `DATETIMEV2` unless that flag 
is enabled, but `serializeInitialDefault()` only knows about 
`enableMappingVarbinary` and just replaces `T` in the Iceberg human string. 
Iceberg timestamptz human strings carry an offset, so a value like `2024-01-01 
00:00:00.123456+00:00` is later parsed by BE through the restored `DATETIMEV2` 
type. `DataTypeDateTimeV2SerDe::from_olap_string()` expects `YYYY-MM-DD 
HH:MM:SS[.ffffff]` and falls back to `MIN_DATETIME_V2` on parse failure, so old 
files missing this equality key compare against the wrong default and matching 
deletes can be missed. Please pass `enableMappingTimestampTz` into this 
normalization and emit the offset-free Doris datetime representation when the 
Iceberg field is timestamptz but Doris maps it to `DATETIMEV2`; also add 
coverage for `TimestampType.withZo
 ne()` with `enable.mapping.timestamp_tz=false`.
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to