parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject git commit: PARQUET-56: Added an accessor for the Long column type.
Date Wed, 30 Jul 2014 21:19:40 GMT
Repository: incubator-parquet-mr
Updated Branches:
  refs/heads/master b0e26ee6f -> 21d871b54


PARQUET-56: Added an accessor for the Long column type.

I noticed there was a missing accessor for the Long column type in the example Group.

Author: James Scott <jim.scott@urbanairship.com>

Closes #25 from scottjab/getLong and squashes the following commits:

f96bb83 [James Scott] Added support for getting Longs in the sample group object.


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/21d871b5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/tree/21d871b5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/diff/21d871b5

Branch: refs/heads/master
Commit: 21d871b54940ad8e552fac54808fe0b31872ade8
Parents: b0e26ee
Author: James Scott <jim.scott@urbanairship.com>
Authored: Wed Jul 30 14:19:00 2014 -0700
Committer: Brock Noland <brock@apache.org>
Committed: Wed Jul 30 14:19:00 2014 -0700

----------------------------------------------------------------------
 .../src/main/java/parquet/example/data/GroupValueSource.java   | 6 ++++++
 .../src/main/java/parquet/example/data/simple/SimpleGroup.java | 5 +++++
 2 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/blob/21d871b5/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 71c0644..e9eb922 100644
--- a/parquet-column/src/main/java/parquet/example/data/GroupValueSource.java
+++ b/parquet-column/src/main/java/parquet/example/data/GroupValueSource.java
@@ -36,6 +36,10 @@ abstract public class GroupValueSource {
     return getInteger(getType().getFieldIndex(field), index);
   }
 
+  public long getLong(String field, int index) {
+    return getLong(getType().getFieldIndex(field), index);
+  }
+
   public boolean getBoolean(String field, int index) {
     return getBoolean(getType().getFieldIndex(field), index);
   }
@@ -56,6 +60,8 @@ abstract public class GroupValueSource {
 
   abstract public int getInteger(int fieldIndex, int index);
 
+  abstract public long getLong(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/21d871b5/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 765e9fc..8403a04 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
@@ -127,6 +127,11 @@ public class SimpleGroup extends Group {
   }
 
   @Override
+  public long getLong(int fieldIndex, int index) {
+    return ((LongValue)getValue(fieldIndex, index)).getLong();
+  }
+
+  @Override
   public boolean getBoolean(int fieldIndex, int index) {
     return ((BooleanValue)getValue(fieldIndex, index)).getBoolean();
   }


Mime
View raw message