mccheah commented on a change in pull request #152: Applies Baseline to
iceberg-common and fixes applying Baseline to Iceberg-api
URL: https://github.com/apache/incubator-iceberg/pull/152#discussion_r273638076
##########
File path: api/src/test/java/org/apache/iceberg/transforms/TestTimestamps.java
##########
@@ -28,44 +28,44 @@
@Test
public void testTimestampWithoutZoneToHumanString() {
Types.TimestampType type = Types.TimestampType.withoutZone();
- Literal<Integer> date = Literal.of("2017-12-01T10:12:55.038194").to(type);
+ Literal<Long> date = Literal.of("2017-12-01T10:12:55.038194").to(type);
- Transform<Integer, Integer> year = Transforms.year(type);
+ Transform<Long, Integer> year = Transforms.year(type);
Assert.assertEquals("Should produce the correct Human string",
"2017", year.toHumanString(year.apply(date.value())));
- Transform<Integer, Integer> month = Transforms.month(type);
+ Transform<Long, Integer> month = Transforms.month(type);
Assert.assertEquals("Should produce the correct Human string",
"2017-12", month.toHumanString(month.apply(date.value())));
- Transform<Integer, Integer> day = Transforms.day(type);
+ Transform<Long, Integer> day = Transforms.day(type);
Assert.assertEquals("Should produce the correct Human string",
"2017-12-01", day.toHumanString(day.apply(date.value())));
- Transform<Integer, Integer> hour = Transforms.hour(type);
+ Transform<Long, Integer> hour = Transforms.hour(type);
Assert.assertEquals("Should produce the correct Human string",
"2017-12-01-10", hour.toHumanString(hour.apply(date.value())));
}
@Test
public void testTimestampWithZoneToHumanString() {
Types.TimestampType type = Types.TimestampType.withZone();
- Literal<Integer> date =
Literal.of("2017-12-01T10:12:55.038194-08:00").to(type);
+ Literal<Long> date =
Literal.of("2017-12-01T10:12:55.038194-08:00").to(type);
Review comment:
This started happening after we are now actually properly applying Baseline
- I'm not sure as to why, but the test fails without this patch with
`ClassCastException` failing to cast `Long` to `Integer`.
Intuitively though all timestamps should be treated as `Long`s and not
`Integer`s, so this is probably the correct way to write the test anyways?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]