jacobmarble commented on code in PR #9008:
URL: https://github.com/apache/iceberg/pull/9008#discussion_r1669416443
##########
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 answer 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]