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-1092: More Decimal and scale flipped follow-up
Date Tue, 06 Jun 2017 18:32:53 GMT
Repository: arrow
Updated Branches:
  refs/heads/master c3e865d5f -> 402baa4ec


ARROW-1092: More Decimal and scale flipped follow-up

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

Closes #736 from julienledem/ARROW-1092 and squashes the following commits:

1bc1ade [Julien Le Dem] ARROW-1092: More Decimal and scale flipped follow-up


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

Branch: refs/heads/master
Commit: 402baa4ec391b61dd37c770ae7978d51b9b550fa
Parents: c3e865d
Author: Julien Le Dem <julien@apache.org>
Authored: Tue Jun 6 11:32:39 2017 -0700
Committer: Julien Le Dem <julien@apache.org>
Committed: Tue Jun 6 11:32:39 2017 -0700

----------------------------------------------------------------------
 .../vector/src/main/codegen/data/ValueVectorTypes.tdd |  2 +-
 .../src/main/codegen/templates/FixedValueVectors.java |  9 +++++----
 .../src/main/codegen/templates/HolderReaderImpl.java  |  2 +-
 .../vector/src/main/codegen/templates/MapWriters.java |  2 +-
 .../main/codegen/templates/NullableValueVectors.java  | 14 ++++++++------
 5 files changed, 16 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/402baa4e/java/vector/src/main/codegen/data/ValueVectorTypes.tdd
----------------------------------------------------------------------
diff --git a/java/vector/src/main/codegen/data/ValueVectorTypes.tdd b/java/vector/src/main/codegen/data/ValueVectorTypes.tdd
index b147c9e..970d887 100644
--- a/java/vector/src/main/codegen/data/ValueVectorTypes.tdd
+++ b/java/vector/src/main/codegen/data/ValueVectorTypes.tdd
@@ -116,7 +116,7 @@
         {
           class: "Decimal",
           maxPrecisionDigits: 38, nDecimalDigits: 4, friendlyType: "BigDecimal",
-          typeParams: [ {name: "precision", type: "int"}, { name: "scale", type: "int"}],
+          typeParams: [ {name: "scale", type: "int"}, { name: "precision", type: "int"}],
           arrowType: "org.apache.arrow.vector.types.pojo.ArrowType.Decimal",
           fields: [{name: "start", type: "int"}, {name: "buffer", type: "ArrowBuf"}]
         }

http://git-wip-us.apache.org/repos/asf/arrow/blob/402baa4e/java/vector/src/main/codegen/templates/FixedValueVectors.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/codegen/templates/FixedValueVectors.java b/java/vector/src/main/codegen/templates/FixedValueVectors.java
index 395417b..5d92cd2 100644
--- a/java/vector/src/main/codegen/templates/FixedValueVectors.java
+++ b/java/vector/src/main/codegen/templates/FixedValueVectors.java
@@ -56,13 +56,14 @@ public final class ${className} extends BaseDataValueVector implements
FixedWidt
   private int allocationMonitor = 0;
   <#if minor.typeParams??>
 
-    <#list minor.typeParams as typeParam>
+    <#assign typeParams = minor.typeParams?reverse />
+    <#list typeParams as typeParam>
   private final ${typeParam.type} ${typeParam.name};
     </#list>
 
-  public ${className}(String name, BufferAllocator allocator<#list minor.typeParams as
typeParam>, ${typeParam.type} ${typeParam.name}</#list>) {
+  public ${className}(String name, BufferAllocator allocator<#list typeParams as typeParam>,
${typeParam.type} ${typeParam.name}</#list>) {
     super(name, allocator);
-    <#list minor.typeParams as typeParam>
+    <#list typeParams as typeParam>
     this.${typeParam.name} = ${typeParam.name};
     </#list>
   }
@@ -242,7 +243,7 @@ public final class ${className} extends BaseDataValueVector implements
FixedWidt
     private ${className} to;
 
     public TransferImpl(String name, BufferAllocator allocator){
-      to = new ${className}(name, allocator<#if minor.typeParams??><#list minor.typeParams
as typeParam>,  ${className}.this.${typeParam.name}</#list></#if>);
+      to = new ${className}(name, allocator<#if minor.typeParams??><#list typeParams
as typeParam>,  ${className}.this.${typeParam.name}</#list></#if>);
     }
 
     public TransferImpl(${className} to) {

http://git-wip-us.apache.org/repos/asf/arrow/blob/402baa4e/java/vector/src/main/codegen/templates/HolderReaderImpl.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/codegen/templates/HolderReaderImpl.java b/java/vector/src/main/codegen/templates/HolderReaderImpl.java
index 471fe41..c2aa837 100644
--- a/java/vector/src/main/codegen/templates/HolderReaderImpl.java
+++ b/java/vector/src/main/codegen/templates/HolderReaderImpl.java
@@ -29,7 +29,7 @@
 <#assign friendlyType = (minor.friendlyType!minor.boxedType!type.boxedType) />
 <#assign safeType=friendlyType />
 <#if safeType=="byte[]"><#assign safeType="ByteArray" /></#if>
-<#assign fields = minor.fields!type.fields + minor.typeParams![]/>
+<#assign fields = (minor.fields!type.fields) + minor.typeParams![]/>
 
 <@pp.changeOutputFile name="/org/apache/arrow/vector/complex/impl/${holderMode}${name}HolderReaderImpl.java"
/>
 <#include "/@includes/license.ftl" />

http://git-wip-us.apache.org/repos/asf/arrow/blob/402baa4e/java/vector/src/main/codegen/templates/MapWriters.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/codegen/templates/MapWriters.java b/java/vector/src/main/codegen/templates/MapWriters.java
index 05048c5..14cc08d 100644
--- a/java/vector/src/main/codegen/templates/MapWriters.java
+++ b/java/vector/src/main/codegen/templates/MapWriters.java
@@ -235,7 +235,7 @@ public class ${mode}MapWriter extends AbstractFieldWriter {
               <#assign constructorParams = minor.arrowTypeConstructorParams />
             <#else>
               <#assign constructorParams = [] />
-              <#list minor.typeParams as typeParam>
+              <#list minor.typeParams?reverse as typeParam>
                 <#assign constructorParams = constructorParams + [ typeParam.name ] />
               </#list>
             </#if>    

http://git-wip-us.apache.org/repos/asf/arrow/blob/402baa4e/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 36f8338..4aa0076 100644
--- a/java/vector/src/main/codegen/templates/NullableValueVectors.java
+++ b/java/vector/src/main/codegen/templates/NullableValueVectors.java
@@ -62,22 +62,23 @@ public final class ${className} extends BaseDataValueVector implements
<#if type
   private final List<BufferBacked> innerVectors;
 
   <#if minor.typeParams??>
-     <#list minor.typeParams as typeParam>
+    <#assign typeParams = minor.typeParams?reverse>
+    <#list typeParams as typeParam>
   private final ${typeParam.type} ${typeParam.name};
     </#list>
 
   /**
    * Assumes the type is nullable and not dictionary encoded
    * @param name name of the field
-   * @param allocator allocator to use to resize the vector<#list minor.typeParams as
typeParam>
+   * @param allocator allocator to use to resize the vector<#list typeParams as typeParam>
    * @param ${typeParam.name} type parameter ${typeParam.name}</#list>
    */
-  public ${className}(String name, BufferAllocator allocator<#list minor.typeParams as
typeParam>, ${typeParam.type} ${typeParam.name}</#list>) {
+  public ${className}(String name, BufferAllocator allocator<#list typeParams as typeParam>,
${typeParam.type} ${typeParam.name}</#list>) {
     <#if minor.arrowTypeConstructorParams??>
        <#assign constructorParams = minor.arrowTypeConstructorParams />
     <#else>
        <#assign constructorParams = [] />
-       <#list minor.typeParams as typeParam>
+       <#list typeParams as typeParam>
          <#assign constructorParams = constructorParams + [ typeParam.name ] />
       </#list>
     </#if>
@@ -92,11 +93,12 @@ public final class ${className} extends BaseDataValueVector implements
<#if type
   public ${className}(String name, FieldType fieldType, BufferAllocator allocator) {
     super(name, allocator);
     <#if minor.typeParams??>
+    <#assign typeParams = minor.typeParams?reverse>
     ${minor.arrowType} arrowType = (${minor.arrowType})fieldType.getType();
-    <#list minor.typeParams as typeParam>
+    <#list typeParams as typeParam>
     this.${typeParam.name} = arrowType.get${typeParam.name?cap_first}();
     </#list>
-    this.values = new ${valuesName}(valuesField, allocator<#list minor.typeParams as typeParam>,
${typeParam.name}</#list>);
+    this.values = new ${valuesName}(valuesField, allocator<#list typeParams as typeParam>,
${typeParam.name}</#list>);
     <#else>
     this.values = new ${valuesName}(valuesField, allocator);
     </#if>


Mime
View raw message