parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jul...@apache.org
Subject git commit: PARQUET-96: fill out some missing methods on parquet.example classes
Date Thu, 25 Sep 2014 23:46:11 GMT
Repository: incubator-parquet-mr
Updated Branches:
  refs/heads/master 3a082e8e3 -> bf20abbf4


PARQUET-96: fill out some missing methods on parquet.example classes

I'm slightly embarrassed to say that we use these, and we'd really like to stop needing a
fork, so here we are.

Author: Colin Marc <colinmarc@gmail.com>

Closes #59 from colinmarc/missing-group-methods and squashes the following commits:

af8ea08 [Colin Marc] fill out some missing methods on parquet.example classes


Project: http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/commit/bf20abbf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/tree/bf20abbf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/diff/bf20abbf

Branch: refs/heads/master
Commit: bf20abbf4825fa5892d8e15c066e768671a39289
Parents: 3a082e8
Author: Colin Marc <colinmarc@gmail.com>
Authored: Thu Sep 25 16:45:56 2014 -0700
Committer: julien <julien@twitter.com>
Committed: Thu Sep 25 16:45:56 2014 -0700

----------------------------------------------------------------------
 .../src/main/java/parquet/example/data/Group.java  |  6 ++++++
 .../parquet/example/data/GroupValueSource.java     | 12 ++++++++++++
 .../parquet/example/data/simple/SimpleGroup.java   | 17 ++++++++++++++++-
 3 files changed, 34 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/blob/bf20abbf/parquet-column/src/main/java/parquet/example/data/Group.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/main/java/parquet/example/data/Group.java b/parquet-column/src/main/java/parquet/example/data/Group.java
index d8e0de3..bb04623 100644
--- a/parquet-column/src/main/java/parquet/example/data/Group.java
+++ b/parquet-column/src/main/java/parquet/example/data/Group.java
@@ -56,6 +56,10 @@ abstract public class Group extends GroupValueSource {
     add(getType().getFieldIndex(field), value);
   }
 
+  public void add(String field, Group value) {
+    add(getType().getFieldIndex(field), value);
+  }
+
   public Group addGroup(String field) {
     if (DEBUG) logger.debug("add group "+field+" to "+getType().getName());
     return addGroup(getType().getFieldIndex(field));
@@ -81,6 +85,8 @@ abstract public class Group extends GroupValueSource {
 
   abstract public void add(int fieldIndex, double value);
 
+  abstract public void add(int fieldIndex, Group value);
+
   abstract public Group addGroup(int fieldIndex);
 
   abstract public Group getGroup(int fieldIndex, int index);

http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/blob/bf20abbf/parquet-column/src/main/java/parquet/example/data/GroupValueSource.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/main/java/parquet/example/data/GroupValueSource.java b/parquet-column/src/main/java/parquet/example/data/GroupValueSource.java
index e9eb922..3cf6e6d 100644
--- a/parquet-column/src/main/java/parquet/example/data/GroupValueSource.java
+++ b/parquet-column/src/main/java/parquet/example/data/GroupValueSource.java
@@ -40,6 +40,14 @@ abstract public class GroupValueSource {
     return getLong(getType().getFieldIndex(field), index);
   }
 
+  public double getDouble(String field, int index) {
+    return getDouble(getType().getFieldIndex(field), index);
+  }
+
+  public float getFloat(String field, int index) {
+    return getFloat(getType().getFieldIndex(field), index);
+  }
+
   public boolean getBoolean(String field, int index) {
     return getBoolean(getType().getFieldIndex(field), index);
   }
@@ -62,6 +70,10 @@ abstract public class GroupValueSource {
 
   abstract public long getLong(int fieldIndex, int index);
 
+  abstract public double getDouble(int fieldIndex, int index);
+
+  abstract public float getFloat(int fieldIndex, int index);
+
   abstract public boolean getBoolean(int fieldIndex, int index);
 
   abstract public Binary getBinary(int fieldIndex, int index);

http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/blob/bf20abbf/parquet-column/src/main/java/parquet/example/data/simple/SimpleGroup.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/main/java/parquet/example/data/simple/SimpleGroup.java b/parquet-column/src/main/java/parquet/example/data/simple/SimpleGroup.java
index 76c84e4..55f9ce3 100644
--- a/parquet-column/src/main/java/parquet/example/data/simple/SimpleGroup.java
+++ b/parquet-column/src/main/java/parquet/example/data/simple/SimpleGroup.java
@@ -72,7 +72,7 @@ public class SimpleGroup extends Group {
   @Override
   public Group addGroup(int fieldIndex) {
     SimpleGroup g = new SimpleGroup(schema.getType(fieldIndex).asGroupType());
-    data[fieldIndex].add(g);
+    add(fieldIndex, g);
     return g;
   }
 
@@ -132,6 +132,16 @@ public class SimpleGroup extends Group {
   }
 
   @Override
+  public double getDouble(int fieldIndex, int index) {
+    return ((DoubleValue)getValue(fieldIndex, index)).getDouble();
+  }
+
+  @Override
+  public float getFloat(int fieldIndex, int index) {
+    return ((FloatValue)getValue(fieldIndex, index)).getFloat();
+  }
+
+  @Override
   public boolean getBoolean(int fieldIndex, int index) {
     return ((BooleanValue)getValue(fieldIndex, index)).getBoolean();
   }
@@ -202,6 +212,11 @@ public class SimpleGroup extends Group {
   }
 
   @Override
+  public void add(int fieldIndex, Group value) {
+    data[fieldIndex].add(value);
+  }
+
+  @Override
   public GroupType getType() {
     return schema;
   }


Mime
View raw message