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


##########
api/src/test/java/org/apache/iceberg/expressions/TestStringLiteralConversions.java:
##########
@@ -181,17 +226,30 @@ public void testNegativeStringToTimestampLiteral() {
   @Test
   public void testTimestampWithZoneWithoutZoneInLiteral() {
     // Zone must be present in literals when converting to timestamp with zone
-    Literal<CharSequence> timestampStr = Literal.of("2017-08-18T14:21:01.919");
-    assertThatThrownBy(() -> timestampStr.to(Types.TimestampType.withZone()))
+    assertThatThrownBy(
+            () -> 
Literal.of("2017-08-18T14:21:01.919123").to(Types.TimestampType.withZone()))
+        .isInstanceOf(DateTimeException.class)
+        .hasMessageContaining("could not be parsed");
+    assertThatThrownBy(
+            () ->
+                
Literal.of("2017-08-18T14:21:01.919123456").to(Types.TimestampNanoType.withZone()))
         .isInstanceOf(DateTimeException.class)
         .hasMessageContaining("could not be parsed");
   }
 
   @Test
   public void testTimestampWithoutZoneWithZoneInLiteral() {
     // Zone must not be present in literals when converting to timestamp 
without zone
-    Literal<CharSequence> timestampStr = 
Literal.of("2017-08-18T14:21:01.919+07:00");
-    assertThatThrownBy(() -> 
timestampStr.to(Types.TimestampType.withoutZone()))
+    assertThatThrownBy(
+            () ->
+                Literal.of("2017-08-18T14:21:01.919123+07:00")

Review Comment:
   same question as above



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