snleee commented on a change in pull request #6479: URL: https://github.com/apache/incubator-pinot/pull/6479#discussion_r599121158
########## File path: pinot-core/src/main/java/org/apache/pinot/core/data/readers/IntermediateSegmentRecordReader.java ########## @@ -0,0 +1,79 @@ +/** + * 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.core.data.readers; + +import java.io.File; +import java.io.IOException; +import java.util.Set; +import javax.annotation.Nullable; +import org.apache.pinot.core.indexsegment.mutable.IntermediateSegment; +import org.apache.pinot.spi.data.readers.GenericRow; +import org.apache.pinot.spi.data.readers.RecordReader; +import org.apache.pinot.spi.data.readers.RecordReaderConfig; + + +public class IntermediateSegmentRecordReader implements RecordReader { Review comment: Do we plan to support the `sortedColumn` in the record reader? For instance, realtime segments can sort the data by itself without depending on the input's sorting order. ########## File path: pinot-core/src/main/java/org/apache/pinot/core/segment/creator/IntermediateSegmentSegmentCreationDataSource.java ########## @@ -0,0 +1,56 @@ +/** + * 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.core.segment.creator; + +import org.apache.pinot.common.Utils; +import org.apache.pinot.core.data.readers.IntermediateSegmentRecordReader; +import org.apache.pinot.core.indexsegment.mutable.IntermediateSegment; +import org.apache.pinot.spi.data.readers.RecordReader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class IntermediateSegmentSegmentCreationDataSource implements SegmentCreationDataSource { + private static final Logger LOGGER = LoggerFactory.getLogger(IntermediateSegmentSegmentCreationDataSource.class); + private final IntermediateSegment _intermediateSegment; + private final IntermediateSegmentRecordReader _intermediateSegmentRecordReader; + + + public IntermediateSegmentSegmentCreationDataSource(IntermediateSegmentRecordReader intermediateSegmentRecordReader) { + _intermediateSegmentRecordReader = intermediateSegmentRecordReader; + _intermediateSegment = _intermediateSegmentRecordReader.getIntermediateSegment(); + } + + @Override + public SegmentPreIndexStatsContainer gatherStats(StatsCollectorConfig statsCollectorConfig) { + Review comment: remove line ########## File path: pinot-core/src/main/java/org/apache/pinot/core/indexsegment/generator/SegmentGeneratorConfig.java ########## @@ -679,4 +680,12 @@ public boolean isFailOnEmptySegment() { public void setFailOnEmptySegment(boolean failOnEmptySegment) { _failOnEmptySegment = failOnEmptySegment; } + + public boolean isIntermediateSegmentRecordReader() { Review comment: Why do we need this new config to `SegmentGeneratorConfig`? We can simply pass `IntermediateSegmentRecordReader` when we need to use the intermediate segment based record reader? ########## File path: pinot-core/src/main/java/org/apache/pinot/core/realtime/converter/stats/MutableColumnStatistics.java ########## @@ -33,15 +33,15 @@ * * TODO: Gather more info on the fly to avoid scanning the segment */ -public class RealtimeColumnStatistics implements ColumnStatistics { +public class MutableColumnStatistics implements ColumnStatistics { Review comment: Do we ever read this from the controller? Can you confirm that this is only used by the server? If this is used by multiple components, renaming may cause incompatibility during the deployement. ########## File path: pinot-core/src/main/java/org/apache/pinot/core/realtime/converter/stats/MutableNoDictionaryColStatistics.java ########## @@ -28,11 +28,11 @@ import static org.apache.pinot.core.common.Constants.UNKNOWN_CARDINALITY; -public class RealtimeNoDictionaryColStatistics implements ColumnStatistics { +public class MutableNoDictionaryColStatistics implements ColumnStatistics { Review comment: Do we ever read this from the controller? Can you confirm that this is only used by the server? -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org