mchades commented on code in PR #6657:
URL: https://github.com/apache/gravitino/pull/6657#discussion_r2225141421
##########
catalogs/catalog-lakehouse-iceberg/src/main/java/org/apache/gravitino/catalog/lakehouse/iceberg/converter/ToIcebergType.java:
##########
@@ -120,12 +120,31 @@ public Type
atomic(org.apache.gravitino.rel.types.Type.PrimitiveType primitive)
} else if (primitive instanceof
org.apache.gravitino.rel.types.Types.DateType) {
return Types.DateType.get();
} else if (primitive instanceof
org.apache.gravitino.rel.types.Types.TimeType) {
- return Types.TimeType.get();
+ org.apache.gravitino.rel.types.Types.TimeType timeType =
+ (org.apache.gravitino.rel.types.Types.TimeType) primitive;
+ if (!timeType.hasPrecisionSet() || timeType.precision() == 6) {
+ return Types.TimeType.get();
+ } else {
+ throw new IllegalArgumentException(
+ "Iceberg only supports microsecond precision (6) for time type,
but got precision: "
Review Comment:
Could you please attach a relevant document link to the code comment?
--
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]