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-775: add simple constructors to value vectors
Date Thu, 06 Apr 2017 16:07:42 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 49b3e0e2a -> ff744ef13


ARROW-775: add simple constructors to value vectors

Author: Julien Le Dem <julien@apache.org>

Closes #498 from julienledem/ARROW-775 and squashes the following commits:

badf8d1 [Julien Le Dem] ARROW-775: add simple constructors to value vectors


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

Branch: refs/heads/master
Commit: ff744ef13c6dff42abf4a0a3ca697634f84b9bf8
Parents: 49b3e0e
Author: Julien Le Dem <julien@apache.org>
Authored: Thu Apr 6 09:07:35 2017 -0700
Committer: Julien Le Dem <julien@apache.org>
Committed: Thu Apr 6 09:07:35 2017 -0700

----------------------------------------------------------------------
 .../src/main/codegen/templates/NullableValueVectors.java     | 8 ++++++++
 .../java/org/apache/arrow/vector/complex/ListVector.java     | 4 ++++
 .../org/apache/arrow/vector/complex/NullableMapVector.java   | 4 ++++
 .../main/java/org/apache/arrow/vector/util/DateUtility.java  | 8 ++++----
 4 files changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/ff744ef1/java/vector/src/main/codegen/templates/NullableValueVectors.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/codegen/templates/NullableValueVectors.java b/java/vector/src/main/codegen/templates/NullableValueVectors.java
index 8e1727c..a50771a 100644
--- a/java/vector/src/main/codegen/templates/NullableValueVectors.java
+++ b/java/vector/src/main/codegen/templates/NullableValueVectors.java
@@ -64,6 +64,14 @@ public final class ${className} extends BaseDataValueVector implements
<#if type
   <#if minor.class == "Decimal">
   private final int precision;
   private final int scale;
+
+  public ${className}(String name, BufferAllocator allocator, int precision, int scale) {
+    this(name, new FieldType(true, new Decimal(precision, scale), null), allocator);
+  }
+  <#else>
+  public ${className}(String name, BufferAllocator allocator) {
+    this(name, new FieldType(true, org.apache.arrow.vector.types.Types.MinorType.${minor.class?upper_case}.getType(),
null), allocator);
+  }
   </#if>
 
   public ${className}(String name, FieldType fieldType, BufferAllocator allocator) {

http://git-wip-us.apache.org/repos/asf/arrow/blob/ff744ef1/java/vector/src/main/java/org/apache/arrow/vector/complex/ListVector.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/ListVector.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/ListVector.java
index d138ca3..0461a8d 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/ListVector.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/ListVector.java
@@ -64,6 +64,10 @@ public class ListVector extends BaseRepeatedValueVector implements FieldVector
{
   private CallBack callBack;
   private final DictionaryEncoding dictionary;
 
+  public ListVector(String name, BufferAllocator allocator, CallBack callBack) {
+    this(name, allocator, null, callBack);
+  }
+
   public ListVector(String name, BufferAllocator allocator, DictionaryEncoding dictionary,
CallBack callBack) {
     super(name, allocator, callBack);
     this.bits = new BitVector("$bits$", allocator);

http://git-wip-us.apache.org/repos/asf/arrow/blob/ff744ef1/java/vector/src/main/java/org/apache/arrow/vector/complex/NullableMapVector.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/NullableMapVector.java
b/java/vector/src/main/java/org/apache/arrow/vector/complex/NullableMapVector.java
index 7fe35e8..71fee67 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/NullableMapVector.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/NullableMapVector.java
@@ -54,6 +54,10 @@ public class NullableMapVector extends MapVector implements FieldVector
{
   private final Accessor accessor;
   private final Mutator mutator;
 
+  public NullableMapVector(String name, BufferAllocator allocator, CallBack callBack) {
+    this(name, allocator, null, callBack);
+  }
+
   public NullableMapVector(String name, BufferAllocator allocator, DictionaryEncoding dictionary,
CallBack callBack) {
     super(name, checkNotNull(allocator), callBack);
     this.bits = new BitVector("$bits$", allocator);

http://git-wip-us.apache.org/repos/asf/arrow/blob/ff744ef1/java/vector/src/main/java/org/apache/arrow/vector/util/DateUtility.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/util/DateUtility.java b/java/vector/src/main/java/org/apache/arrow/vector/util/DateUtility.java
index f4fc173..1f8ce06 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/util/DateUtility.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/util/DateUtility.java
@@ -618,10 +618,10 @@ public class DateUtility {
       }
     }
 
-    public static final DateTimeFormatter formatDate        = DateTimeFormat.forPattern("yyyy-MM-dd");
-    public static final DateTimeFormatter formatTimeStamp    = DateTimeFormat.forPattern("yyyy-MM-dd
HH:mm:ss.SSS");
-    public static final DateTimeFormatter formatTimeStampTZ = DateTimeFormat.forPattern("yyyy-MM-dd
HH:mm:ss.SSS ZZZ");
-    public static final DateTimeFormatter formatTime        = DateTimeFormat.forPattern("HH:mm:ss.SSS");
+    public static final DateTimeFormatter formatDate           = DateTimeFormat.forPattern("yyyy-MM-dd");
+    public static final DateTimeFormatter formatTimeStampMilli = DateTimeFormat.forPattern("yyyy-MM-dd
HH:mm:ss.SSS");
+    public static final DateTimeFormatter formatTimeStampTZ    = DateTimeFormat.forPattern("yyyy-MM-dd
HH:mm:ss.SSS ZZZ");
+    public static final DateTimeFormatter formatTime           = DateTimeFormat.forPattern("HH:mm:ss.SSS");
 
     public static DateTimeFormatter dateTimeTZFormat = null;
     public static DateTimeFormatter timeFormat = null;


Mime
View raw message