jbewing commented on code in PR #15373:
URL: https://github.com/apache/iceberg/pull/15373#discussion_r2838953816


##########
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedByteStreamSplitValuesReader.java:
##########
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg.arrow.vectorized.parquet;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import org.apache.arrow.vector.FieldVector;
+import org.apache.parquet.bytes.ByteBufferInputStream;
+import org.apache.parquet.column.values.ValuesReader;
+
+/**
+ * A {@link VectorizedValuesReader} implementation for the encoding type 
BYTE_STREAM_SPLIT. This is
+ * adapted from Parquet's ByteStreamSplitValuesReader.
+ *
+ * @see <a
+ *     
href="https://parquet.apache.org/docs/file-format/data-pages/encodings/#byte-stream-split-byte_stream_split--9";>
+ *     Parquet format encodings: BYTE_STREAM_SPLIT</a>
+ */
+public class VectorizedByteStreamSplitValuesReader extends ValuesReader
+    implements VectorizedValuesReader {
+
+  private int totalBytesInStream;
+  private ByteBufferInputStream in;
+  private ByteBuffer decodedDataStream;
+
+  public VectorizedByteStreamSplitValuesReader() {}
+
+  @Override
+  public void initFromPage(int ignoredValueCount, ByteBufferInputStream 
inputStream)
+      throws IOException {
+    totalBytesInStream = inputStream.available();
+    this.in = inputStream;
+  }
+
+  @Override
+  public float readFloat() {
+    ensureDecoded(FLOAT_SIZE);
+    return decodedDataStream.getFloat();
+  }
+
+  @Override
+  public double readDouble() {

Review Comment:
   I too agree that it's not of significant complexity. I do plan on punting it 
to a follow up PR though just to keep these small and focused. My intention 
with these PRs was to support vectorized reads over Parquet v2 writers. This 
scope creeps into Parquet v2.1 which isn't as well adopted on the writer side. 
I'll tag you into that PR for review as well



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to