rdblue commented on a change in pull request #1612:
URL: https://github.com/apache/iceberg/pull/1612#discussion_r522558454



##########
File path: 
hive3/src/test/java/org/apache/iceberg/mr/hive/serde/objectinspector/TestIcebergTimestampObjectInspectorHive3.java
##########
@@ -52,9 +54,8 @@ public void testIcebergTimestampObjectInspector() {
     Assert.assertNull(oi.getPrimitiveJavaObject(null));
     Assert.assertNull(oi.getPrimitiveWritableObject(null));
 
-    long epochMilli = 1601471970000L;
-    LocalDateTime local = 
LocalDateTime.ofInstant(Instant.ofEpochMilli(epochMilli), ZoneId.of("UTC"));
-    Timestamp ts = Timestamp.ofEpochMilli(epochMilli);
+    LocalDateTime local = LocalDateTime.of(2020, 11, 22, 8, 11, 16, 123456789);
+    Timestamp ts = Timestamp.valueOf("2020-11-22 8:11:16.123456789");

Review comment:
       To make sure tests don't break across zones, we create date/time values 
using `Instant` or millis. Looks like you're trying to add micros to this test, 
which I think is a good idea. But we should avoid using these factory methods 
because the underlying values are not reliable.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to