Jackie-Jiang commented on code in PR #16727:
URL: https://github.com/apache/pinot/pull/16727#discussion_r2408955927


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/ColumnarSegmentCreationDataSource.java:
##########
@@ -0,0 +1,96 @@
+/**
+ * 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.segment.local.segment.creator;
+
+import java.util.Map;
+import 
org.apache.pinot.segment.local.segment.creator.impl.stats.ColumnarSegmentPreIndexStatsContainer;
+import org.apache.pinot.segment.spi.creator.SegmentCreationDataSource;
+import org.apache.pinot.segment.spi.creator.SegmentPreIndexStatsCollector;
+import org.apache.pinot.segment.spi.creator.StatsCollectorConfig;
+import org.apache.pinot.spi.data.readers.ColumnReader;
+import org.apache.pinot.spi.data.readers.ColumnReaderFactory;
+import org.apache.pinot.spi.data.readers.RecordReader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * SegmentCreationDataSource implementation that uses ColumnReaderFactory for 
columnar data access.
+ *
+ * <p>This data source enables columnar segment building by providing access 
to column readers
+ * instead of row-based record readers. It supports:
+ * <ul>
+ *   <li>Columnar statistics collection</li>
+ *   <li>Column-wise data access through ColumnReaderFactory</li>
+ *   <li>Efficient handling of new columns with default values</li>
+ *   <li>Data type conversions during schema evolution</li>
+ * </ul>
+ */
+public class ColumnarSegmentCreationDataSource implements 
SegmentCreationDataSource {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(ColumnarSegmentCreationDataSource.class);
+
+  private final ColumnReaderFactory _columnReaderFactory;
+  private final Map<String, ColumnReader> _columnReaders;
+
+  /**
+   * Create a ColumnarSegmentCreationDataSource.
+   *
+   * @param columnReaderFactory Factory for creating column readers
+   * @param columnReaders Map of column name to ColumnReader instances
+   */
+    public ColumnarSegmentCreationDataSource(ColumnReaderFactory 
columnReaderFactory,
+                                          Map<String, ColumnReader> 
columnReaders) {

Review Comment:
   (code format) Can you reformat all the changes with [Pinot 
Style](https://docs.pinot.apache.org/developers/developers-and-contributors/code-setup#set-up-ide)



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