rohityadav1993 commented on code in PR #16727: URL: https://github.com/apache/pinot/pull/16727#discussion_r2356156792
########## 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: This sounds good, I will have a follow up PR to apply this feature in minino refresh job. Will handle the enhancements in a separate PR for upsert merger tasks. -- 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]
