Example: + * + *
+ * CometColumnReader reader = ... + * reader.setBatchSize(batchSize); + * + * while (hasMoreRowsToRead) { + * if (endOfRowGroup) { + * reader.reset(); + * PageReader pageReader = ... + * reader.setPageReader(pageReader); + * } + * + * int numRows = ... + * CometVector vector = reader.read(null, numRows); + * + * // consume the vector + * } + * + * reader.close(); + *+ */ +@SuppressWarnings({"checkstyle:VisibilityModifier", "ParameterAssignment"}) +class CometColumnReader implements VectorizedReader
NOTE: this should be called before reading a new Parquet column chunk, and after {@link
+ * CometColumnReader#reset} is called.
+ */
+ public void setPageReader(PageReader pageReader) throws IOException {
+ if (!initialized) {
+ throw new IllegalStateException("Invalid state: 'reset' should be called first");
+ }
+ ((ColumnReader) delegate).setPageReader(pageReader);
+ }
+
+ @Override
+ public void close() {
+ if (delegate != null) {
+ delegate.close();
+ }
+ }
+
+ @Override
+ public void setBatchSize(int size) {
+ this.batchSize = size;
+ }
+
+ @Override
+ public void setRowGroupInfo(
+ PageReadStore pageReadStore, Map>, VectorizedReader>> readerFactory;
+ private final DeleteFilter
>, VectorizedReader>> readerFactory,
+ DeleteFilter