epgif commented on code in PR #9008:
URL: https://github.com/apache/iceberg/pull/9008#discussion_r1490138784


##########
api/src/main/java/org/apache/iceberg/types/Types.java:
##########
@@ -205,38 +208,74 @@ public String toString() {
   }
 
   public static class TimestampType extends PrimitiveType {
-    private static final TimestampType INSTANCE_WITH_ZONE = new 
TimestampType(true);
-    private static final TimestampType INSTANCE_WITHOUT_ZONE = new 
TimestampType(false);
 
+    private static final TimestampType INSTANCE_MICROS_WITH_ZONE =
+        new TimestampType(true, ChronoUnit.MICROS);
+    private static final TimestampType INSTANCE_MICROS_WITHOUT_ZONE =
+        new TimestampType(false, ChronoUnit.MICROS);
+    private static final TimestampType INSTANCE_NANOS_WITH_ZONE =
+        new TimestampType(true, ChronoUnit.NANOS);
+    private static final TimestampType INSTANCE_NANOS_WITHOUT_ZONE =
+        new TimestampType(false, ChronoUnit.NANOS);
+
+    /** @deprecated use {@link #microsWithZone()} instead. */
+    @Deprecated
     public static TimestampType withZone() {
-      return INSTANCE_WITH_ZONE;
+      return INSTANCE_MICROS_WITH_ZONE;
     }
 
+    /** @deprecated use {@link #microsWithoutZone()} instead. */
+    @Deprecated
     public static TimestampType withoutZone() {
-      return INSTANCE_WITHOUT_ZONE;
+      return INSTANCE_MICROS_WITHOUT_ZONE;
+    }
+
+    public static TimestampType microsWithZone() {
+      return INSTANCE_MICROS_WITH_ZONE;
+    }
+
+    public static TimestampType microsWithoutZone() {
+      return INSTANCE_MICROS_WITHOUT_ZONE;
+    }
+
+    public static TimestampType nanosWithZone() {
+      return INSTANCE_NANOS_WITH_ZONE;
+    }
+
+    public static TimestampType nanosWithoutZone() {
+      return INSTANCE_NANOS_WITHOUT_ZONE;
     }
 
     private final boolean adjustToUTC;
+    private final ChronoUnit unit;
 
-    private TimestampType(boolean adjustToUTC) {
+    private TimestampType(boolean adjustToUTC, ChronoUnit unit) {
       this.adjustToUTC = adjustToUTC;
+      this.unit = unit;
     }
 
     public boolean shouldAdjustToUTC() {
       return adjustToUTC;
     }
 
+    public ChronoUnit unit() {

Review Comment:
   Done.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to