Repository: arrow Updated Branches: refs/heads/master 1541a08c7 -> b4d34f8fd
ARROW-1191: [JAVA] Implement getField() method for complex readers Author: Steven Phillips <ste...@dremio.com> Closes #818 from StevenMPhillips/bugs/arrow-1191 and squashes the following commits: 5225bb6 [Steven Phillips] ARROW-1191: [JAVA] Implement getField() method for complex readers Project: http://git-wip-us.apache.org/repos/asf/arrow/repo Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/b4d34f8f Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/b4d34f8f Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/b4d34f8f Branch: refs/heads/master Commit: b4d34f8fde52df14f087cedcca8b7276b5cf0697 Parents: 1541a08 Author: Steven Phillips <ste...@dremio.com> Authored: Mon Jul 17 18:33:25 2017 +0200 Committer: Uwe L. Korn <uw...@xhochy.com> Committed: Mon Jul 17 18:33:25 2017 +0200 ---------------------------------------------------------------------- java/vector/src/main/codegen/templates/UnionReader.java | 6 ++++++ .../arrow/vector/complex/impl/NullableMapReaderImpl.java | 6 ++++++ .../apache/arrow/vector/complex/impl/SingleMapReaderImpl.java | 6 ++++++ .../org/apache/arrow/vector/complex/impl/UnionListReader.java | 6 ++++++ 4 files changed, 24 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/arrow/blob/b4d34f8f/java/vector/src/main/codegen/templates/UnionReader.java ---------------------------------------------------------------------- diff --git a/java/vector/src/main/codegen/templates/UnionReader.java b/java/vector/src/main/codegen/templates/UnionReader.java index 2246fb3..fd3a766 100644 --- a/java/vector/src/main/codegen/templates/UnionReader.java +++ b/java/vector/src/main/codegen/templates/UnionReader.java @@ -18,6 +18,7 @@ import org.apache.arrow.vector.types.Types.MinorType; +import org.apache.arrow.vector.types.pojo.Field; <@pp.dropOutputFile /> <@pp.changeOutputFile name="/org/apache/arrow/vector/complex/impl/UnionReader.java" /> @@ -53,6 +54,11 @@ public class UnionReader extends AbstractFieldReader { } } + @Override + public Field getField() { + return data.getField(); + } + public boolean isSet(){ return !data.getAccessor().isNull(idx()); } http://git-wip-us.apache.org/repos/asf/arrow/blob/b4d34f8f/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapReaderImpl.java ---------------------------------------------------------------------- diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapReaderImpl.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapReaderImpl.java index 7c389e6..067716e 100644 --- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapReaderImpl.java +++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapReaderImpl.java @@ -21,6 +21,7 @@ package org.apache.arrow.vector.complex.impl; import org.apache.arrow.vector.complex.MapVector; import org.apache.arrow.vector.complex.NullableMapVector; import org.apache.arrow.vector.complex.writer.BaseWriter.MapWriter; +import org.apache.arrow.vector.types.pojo.Field; public class NullableMapReaderImpl extends SingleMapReaderImpl { @@ -32,6 +33,11 @@ public class NullableMapReaderImpl extends SingleMapReaderImpl { } @Override + public Field getField() { + return nullableMapVector.getField(); + } + + @Override public void copyAsValue(MapWriter writer){ NullableMapWriter impl = (NullableMapWriter) writer; impl.container.copyFromSafe(idx(), impl.idx(), nullableMapVector); http://git-wip-us.apache.org/repos/asf/arrow/blob/b4d34f8f/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleMapReaderImpl.java ---------------------------------------------------------------------- diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleMapReaderImpl.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleMapReaderImpl.java index ae17b4b..4801909 100644 --- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleMapReaderImpl.java +++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleMapReaderImpl.java @@ -26,6 +26,7 @@ import org.apache.arrow.vector.complex.MapVector; import org.apache.arrow.vector.complex.reader.FieldReader; import org.apache.arrow.vector.complex.writer.BaseWriter.MapWriter; import org.apache.arrow.vector.types.Types.MinorType; +import org.apache.arrow.vector.types.pojo.Field; import com.google.common.collect.Maps; @@ -46,6 +47,11 @@ public class SingleMapReaderImpl extends AbstractFieldReader{ } @Override + public Field getField() { + return vector.getField(); + } + + @Override public FieldReader reader(String name){ FieldReader reader = fields.get(name); if(reader == null){ http://git-wip-us.apache.org/repos/asf/arrow/blob/b4d34f8f/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionListReader.java ---------------------------------------------------------------------- diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionListReader.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionListReader.java index 6c7c230..2bd0ca8 100644 --- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionListReader.java +++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionListReader.java @@ -26,6 +26,7 @@ import org.apache.arrow.vector.complex.writer.BaseWriter.ListWriter; import org.apache.arrow.vector.complex.writer.FieldWriter; import org.apache.arrow.vector.holders.UnionHolder; import org.apache.arrow.vector.types.Types.MinorType; +import org.apache.arrow.vector.types.pojo.Field; public class UnionListReader extends AbstractFieldReader { @@ -40,6 +41,11 @@ public class UnionListReader extends AbstractFieldReader { } @Override + public Field getField() { + return vector.getField(); + } + + @Override public boolean isSet() { return !vector.getAccessor().isNull(idx()); }