rohityadav1993 commented on code in PR #16727: URL: https://github.com/apache/pinot/pull/16727#discussion_r2366373366
########## pinot-spi/src/main/java/org/apache/pinot/spi/data/readers/ColumnReader.java: ########## @@ -0,0 +1,83 @@ +/** + * 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.pinot.spi.data.readers; + +import java.io.Closeable; +import java.io.IOException; +import java.io.Serializable; +import javax.annotation.Nullable; + + +/** + * The <code>ColumnReader</code> interface is used to read column data from various data sources + * for columnar segment building. Unlike RecordReader which reads row-by-row, ColumnReader provides + * column-wise access to data, enabling efficient columnar segment creation. + * + * <p>This interface follows an iterator pattern similar to RecordReader: + * <ul> + * <li>Sequential iteration over all values in a column using hasNext() and next()</li> + * <li>Null value detection for the current value</li> + * <li>Rewind capability to restart iteration</li> + * <li>Resource cleanup</li> + * </ul> + * + * <p>Implementations should handle data type conversions, default values for new columns, + * and efficient column-wise data access patterns. + */ +public interface ColumnReader extends Closeable, Serializable { Review Comment: The interface looks good, but one will need to create a `ParquetSegmentColumnReaderFactory` similar to `PinotSegmentColumnReaderFactory` which should be able to correctly initialise a `ParquetSegmentColumnReaderImpl` for a given parquet file to be read. On a high level Parquet files are analogous to a Pinot segment as collection of columns and there is a similar low level columnar reader: https://github.com/apache/parquet-java/blob/f50dd6cb4b526cf4b585993c1b69a838cd8151f3/parquet-column/src/main/java/org/apache/parquet/column/ColumnReader.java#L40 -- 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]
