JingsongLi commented on code in PR #7077:
URL: https://github.com/apache/paimon/pull/7077#discussion_r2710718121
##########
paimon-python/pypaimon/schema/data_types.py:
##########
@@ -589,31 +595,40 @@ def to_avro_type(field_type: pyarrow.DataType,
field_name: str) -> Union[str, Di
return {"type": "int", "logicalType": "date"}
elif pyarrow.types.is_timestamp(field_type):
unit = field_type.unit
- if unit == 'us':
- return {"type": "long", "logicalType": "timestamp-micros"}
- elif unit == 'ms':
- return {"type": "long", "logicalType": "timestamp-millis"}
+ if field_type.tz is None:
+ if unit == 'us':
+ return {"type": "long", "logicalType":
"local-timestamp-micros"}
+ elif unit == 'ms':
+ return {"type": "long", "logicalType":
"local-timestamp-millis"}
+ else:
+ return {"type": "long", "logicalType":
"local-timestamp-micros"}
Review Comment:
Whatever Java does, Python should align with. We need to ensure compatibility
--
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]