You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jd...@apache.org on 2014/11/04 19:26:51 UTC
svn commit: r1636677 -
/hive/branches/branch-0.14/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/serde/TestParquetTimestampUtils.java
Author: jdere
Date: Tue Nov 4 18:26:51 2014
New Revision: 1636677
URL: http://svn.apache.org/r1636677
Log:
HIVE-8713 : Unit test TestParquetTimestampUtils.testTimezone failing (Szehon, reviewed by Brock)
Modified:
hive/branches/branch-0.14/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/serde/TestParquetTimestampUtils.java
Modified: hive/branches/branch-0.14/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/serde/TestParquetTimestampUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.14/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/serde/TestParquetTimestampUtils.java?rev=1636677&r1=1636676&r2=1636677&view=diff
==============================================================================
--- hive/branches/branch-0.14/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/serde/TestParquetTimestampUtils.java (original)
+++ hive/branches/branch-0.14/ql/src/test/org/apache/hadoop/hive/ql/io/parquet/serde/TestParquetTimestampUtils.java Tue Nov 4 18:26:51 2014
@@ -143,22 +143,23 @@ public class TestParquetTimestampUtils e
cal.set(Calendar.YEAR, 1968);
cal.set(Calendar.MONTH, Calendar.MAY);
cal.set(Calendar.DAY_OF_MONTH, 23);
- if ((TimeZone.getTimeZone("US/Pacific").inDaylightTime(new Date()))) {
- cal.set(Calendar.HOUR_OF_DAY, 18);
- } else {
- cal.set(Calendar.HOUR_OF_DAY, 17);
- }
+ cal.set(Calendar.HOUR_OF_DAY, 17);
cal.set(Calendar.MINUTE, 1);
cal.set(Calendar.SECOND, 1);
cal.setTimeZone(TimeZone.getTimeZone("US/Pacific"));
Timestamp ts = new Timestamp(cal.getTimeInMillis());
ts.setNanos(1);
- //18:00 PST = 01:00 GMT (if daylight-savings)
- //17:00 PST = 01:00 GMT (if not daylight savings)
- //(1*60*60 + 1*60 + 1)*10e9 + 1
+ /**
+ * 17:00 PDT = 00:00 GMT (daylight-savings)
+ * (0*60*60 + 1*60 + 1)*10e9 + 1 = 61000000001, or
+ *
+ * 17:00 PST = 01:00 GMT (if not daylight savings)
+ * (1*60*60 + 1*60 + 1)*10e9 + 1 = 3661000000001
+ */
NanoTime nt = NanoTimeUtils.getNanoTime(ts);
- Assert.assertEquals(nt.getTimeOfDayNanos(), 3661000000001L);
+ long timeOfDayNanos = nt.getTimeOfDayNanos();
+ Assert.assertTrue(timeOfDayNanos == 61000000001L || timeOfDayNanos == 3661000000001L);
//in both cases, this will be the next day in GMT
Assert.assertEquals(nt.getJulianDay(), 2440001);