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


##########
api/src/test/java/org/apache/iceberg/transforms/TestBucketing.java:
##########
@@ -112,12 +112,59 @@ public void testSpecValues() {
         .as("Spec example: hash(2017-11-16T22:31:08) = -2047944441")
         .isEqualTo(-2047944441);
 
+    timestampVal = 
Literal.of("2017-11-16T22:31:08.000001").to(Types.TimestampType.withoutZone());
+    assertThat(BucketUtil.hash(timestampVal.value()))
+        .as("Spec example: hash(2017-11-16T22:31:08.000001) = -1207196810")
+        .isEqualTo(-1207196810);
+
     Literal<Long> timestamptzVal =
         
Literal.of("2017-11-16T14:31:08-08:00").to(Types.TimestampType.withZone());
     assertThat(BucketUtil.hash(timestamptzVal.value()))
         .as("Spec example: hash(2017-11-16T14:31:08-08:00) = -2047944441")
         .isEqualTo(-2047944441);
 
+    timestamptzVal =
+        
Literal.of("2017-11-16T14:31:08.000001-08:00").to(Types.TimestampType.withZone());
+    assertThat(BucketUtil.hash(timestamptzVal.value()))
+        .as("Spec example: hash(2017-11-16T14:31:08.000001-08:00) = 
-1207196810")
+        .isEqualTo(-1207196810);
+
+    Literal<Long> timestampNsVal =
+        
Literal.of("2017-11-16T22:31:08").to(Types.TimestampNanoType.withoutZone());
+    assertThat(BucketUtil.hash(timestampNsVal.value()))
+        .as("Spec example: hash(2017-11-16T22:31:08) = -737750069")

Review Comment:
   Yes, `testTimestampNanoPromotion` added in commit 753aed5 and 
`testTimestampTzNanoPromotion` added in commit eb5e382.



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