You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/07/10 17:08:14 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #1191: ORC: Use ConstantReader for identity partition columns

rdblue commented on a change in pull request #1191:
URL: https://github.com/apache/iceberg/pull/1191#discussion_r452967447



##########
File path: orc/src/main/java/org/apache/iceberg/orc/OrcValueReaders.java
##########
@@ -181,12 +173,25 @@ private T readInternal(T struct, ColumnVector[] columnVectors, int row) {
       for (int c = 0; c < readers.length; ++c) {
         set(struct, c, reader(c).read(columnVectors[c], row));
       }
+      return struct;
+    }
+  }
 
-      for (int i = 0; i < positions.length; i += 1) {
-        set(struct, positions[i], constants[i]);
-      }
+  private static class ConstantReader<C> implements OrcValueReader<C> {
+    private final C constant;
 
-      return struct;
+    private ConstantReader(C constant) {
+      this.constant = constant;
+    }
+
+    @Override
+    public C read(ColumnVector ignored, int ignoredRow) {

Review comment:
       Is `ColumnVector` still materialized? Is it possible to avoid reading that entirely?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org