pvary commented on code in PR #15410:
URL: https://github.com/apache/iceberg/pull/15410#discussion_r2944699822


##########
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedRleBooleanValuesReader.java:
##########
@@ -0,0 +1,84 @@
+/*
+ * 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.IOException;
+import org.apache.arrow.vector.BitVector;
+import org.apache.arrow.vector.FieldVector;
+import org.apache.parquet.bytes.ByteBufferInputStream;
+import org.apache.parquet.bytes.BytesUtils;
+import org.apache.parquet.column.values.ValuesReader;
+
+/**
+ * A {@link VectorizedValuesReader} implementation for the encoding type Run 
Length Encoding / RLE.
+ *
+ * @see <a
+ *     
href="https://parquet.apache.org/docs/file-format/data-pages/encodings/#run-length-encoding--bit-packing-hybrid-rle--3";>
+ *     Parquet format encodings: RLE</a>
+ */
+public class VectorizedRleBooleanValuesReader extends ValuesReader
+    implements VectorizedValuesReader {
+
+  // Since we can only read booleans, bit-width is always 1
+  private static final int BOOLEAN_BIT_WIDTH = 1;
+  // Since this can only be used in the context of a data page, the definition 
level can be set to
+  // anything, and it doesn't really matter
+  private static final int IRRELEVANT_MAX_DEFINITION_LEVEL = 1;
+  // This class reads the length prefix itself in initFromPage, so the 
delegate must not read it
+  private static final boolean DONT_READ_LENGTH = false;
+
+  private final BaseVectorizedParquetValuesReader delegate;

Review Comment:
   There is a misunderstanding here. How much code are we really using from the 
`BaseVectorizedParquetValuesReader`? Setting dummy values there seems like a 
serious code smell to me, that we don't use much of the functionality. Can we 
first copy the code which is relevant, then decide what to do with it? Maybe it 
is small enough to keep the duplication for performance reasons. Maybe we can 
have some util methods or common ancestors for this class and the base one.



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