RussellSpitzer commented on a change in pull request #1287:
URL: https://github.com/apache/iceberg/pull/1287#discussion_r464607549
##########
File path:
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/VectorizedArrowReader.java
##########
@@ -356,5 +356,36 @@ public String toString() {
public void setBatchSize(int batchSize) {}
}
+ /**
+ * A Dummy Vector Reader which doesn't actually read files, instead it
returns a dummy
+ * VectorHolder which indicates the constant value which should be used for
this column.
+ * @param <T> The constant value to use
+ */
+ public static class ConstantVectorReader<T> extends VectorizedArrowReader {
+ private final T value;
+
+ public ConstantVectorReader(T value) {
+ this.value = value;
+ }
+
+ @Override
+ public VectorHolder read(VectorHolder reuse, int numValsToRead) {
+ return VectorHolder.constantHolder(numValsToRead, value);
Review comment:
Of course, I was thinking about that but I got a little worried about
the "null" version since I felt a little weird about creating a parameterized
type with null. I forgot how Java handles that but I'll double check and change
the class if possible. IE what happens with
foo<t> ( T bar) when you invoke foo(null)
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]