pgaref commented on a change in pull request #653:
URL: https://github.com/apache/orc/pull/653#discussion_r597990537
##########
File path:
java/core/src/java/org/apache/orc/impl/reader/tree/StructBatchReader.java
##########
@@ -20,11 +20,18 @@
import org.apache.hadoop.hive.ql.exec.vector.ColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
import org.apache.orc.impl.OrcFilterContextImpl;
+import org.apache.orc.impl.PositionProvider;
import org.apache.orc.impl.TreeReaderFactory;
+import org.apache.orc.impl.reader.StripePlanner;
import java.io.IOException;
import java.util.Set;
+/**
+ * Handles the Struct rootType for batch handling. The handling assumes that
the root
+ * {@link org.apache.orc.impl.TreeReaderFactory.StructTreeReader} has no
nulls, this is required as
+ * the {@link VectorizedRowBatch} does not represent the root Struct as a
vector.
Review comment:
Nice, I would rephrase to something like: ..has no nulls. Root Struct
vector is not represented as part of the final the {@link
org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch}.
##########
File path:
java/core/src/java/org/apache/orc/impl/reader/tree/StructBatchReader.java
##########
@@ -76,4 +83,31 @@ public void nextBatch(VectorizedRowBatch batch, int
batchSize) throws IOExceptio
}
}
}
+
+ @Override
+ public void startStripe(StripePlanner planner) throws IOException {
Review comment:
Makes sense, maybe we should make these methods abstract on BatchReader
instead?
Then we would only keep setVectorColumnCount and resetBatch methods with
implementation that apply both for Primitive and Struct reading.
##########
File path: java/core/src/java/org/apache/orc/impl/InStream.java
##########
@@ -621,9 +631,20 @@ private ByteBuffer slice(int chunkLength) throws
IOException {
chunkLength + " bytes");
}
- void seek(long desired) throws IOException {
+ /**
+ * Seek to the desired chunk based on the input position.
+ *
+ * @param desired position in the compressed stream
+ * @return Indicates whether a seek was performed or not
+ * @throws IOException when seeking outside the stream bounds
+ */
+ boolean seek(long desired) throws IOException {
if (desired == 0 && bytes == null) {
- return;
+ return false;
Review comment:
Lets remove ORC-758 leftovers from the PR
##########
File path: java/core/src/test/org/apache/orc/impl/TestInStream.java
##########
@@ -434,8 +437,30 @@ public void testCompressed() throws Exception {
int x = in.read();
assertEquals(i & 0xff, x);
}
+
+ // Forward seek test
Review comment:
another ORC-758 leftover
--
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]