arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jul...@apache.org
Subject arrow git commit: ARROW-325: make TestArrowFile not dependent on timezone
Date Sat, 08 Oct 2016 00:09:04 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 1196691e2 -> eb1491a96


ARROW-325: make TestArrowFile not dependent on timezone

Author: Julien Le Dem <julien@dremio.com>

Closes #162 from julienledem/tz and squashes the following commits:

74b5ee8 [Julien Le Dem] ARROW-325: make TestArrowFile not dependent on timezone


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/eb1491a9
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/eb1491a9
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/eb1491a9

Branch: refs/heads/master
Commit: eb1491a96d1fb92bf9c8bfc1acb7a8768af53a7e
Parents: 1196691
Author: Julien Le Dem <julien@dremio.com>
Authored: Fri Oct 7 17:09:00 2016 -0700
Committer: Julien Le Dem <julien@dremio.com>
Committed: Fri Oct 7 17:09:00 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/arrow/vector/file/TestArrowFile.java  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/eb1491a9/java/vector/src/test/java/org/apache/arrow/vector/file/TestArrowFile.java
----------------------------------------------------------------------
diff --git a/java/vector/src/test/java/org/apache/arrow/vector/file/TestArrowFile.java b/java/vector/src/test/java/org/apache/arrow/vector/file/TestArrowFile.java
index ad30168..7a5e7b5 100644
--- a/java/vector/src/test/java/org/apache/arrow/vector/file/TestArrowFile.java
+++ b/java/vector/src/test/java/org/apache/arrow/vector/file/TestArrowFile.java
@@ -40,10 +40,12 @@ import org.apache.arrow.vector.complex.writer.BaseWriter.ListWriter;
 import org.apache.arrow.vector.complex.writer.BaseWriter.MapWriter;
 import org.apache.arrow.vector.complex.writer.BigIntWriter;
 import org.apache.arrow.vector.complex.writer.IntWriter;
+import org.apache.arrow.vector.holders.NullableTimeStampHolder;
 import org.apache.arrow.vector.schema.ArrowBuffer;
 import org.apache.arrow.vector.schema.ArrowRecordBatch;
 import org.apache.arrow.vector.types.Types.MinorType;
 import org.apache.arrow.vector.types.pojo.Schema;
+import org.joda.time.DateTimeZone;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -58,14 +60,18 @@ public class TestArrowFile {
   private static final int COUNT = 10;
   private BufferAllocator allocator;
 
+  private DateTimeZone defaultTimezone = DateTimeZone.getDefault();
+
   @Before
   public void init() {
+    DateTimeZone.setDefault(DateTimeZone.forOffsetHours(2));
     allocator = new RootAllocator(Integer.MAX_VALUE);
   }
 
   @After
   public void tearDown() {
     allocator.close();
+    DateTimeZone.setDefault(defaultTimezone);
   }
 
   @Test
@@ -258,7 +264,9 @@ public class TestArrowFile {
       Assert.assertEquals(i, rootReader.reader("int").readInteger().intValue());
       Assert.assertEquals(i, rootReader.reader("bigInt").readLong().longValue());
       Assert.assertEquals(i % 3, rootReader.reader("list").size());
-      Assert.assertEquals(i, rootReader.reader("map").reader("timestamp").readDateTime().getMillis()
% COUNT);
+      NullableTimeStampHolder h = new NullableTimeStampHolder();
+      rootReader.reader("map").reader("timestamp").read(h);
+      Assert.assertEquals(i, h.value % COUNT);
     }
   }
 


Mime
View raw message