vvivekiyer commented on code in PR #10845: URL: https://github.com/apache/pinot/pull/10845#discussion_r1242588866
########## pinot-core/src/main/java/org/apache/pinot/core/common/IntermediateStageBlockValSet.java: ########## @@ -0,0 +1,250 @@ +/** + * 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.common; + +import java.math.BigDecimal; +import java.util.List; +import javax.annotation.Nullable; +import org.apache.pinot.common.utils.DataSchema; +import org.apache.pinot.common.utils.PinotDataType; +import org.apache.pinot.segment.spi.index.reader.Dictionary; +import org.apache.pinot.spi.data.FieldSpec; +import org.roaringbitmap.RoaringBitmap; + +/** + * In the multistage engine, the leaf stage servers process the data in columnar fashion. By the time the + * intermediate stage receives the projected column, they are converted to a row based format. This class provides + * the capability to convert the row based represenation into blocks so that they can be used to process + * aggregations. + * TODO: Support MV + */ +public class IntermediateStageBlockValSet implements BlockValSet { + private final FieldSpec.DataType _dataType; + private final PinotDataType _pinotDataType; + private final List<Object> _values; + private final RoaringBitmap _nullBitMap; + private boolean _nullBitMapSet; + + public IntermediateStageBlockValSet(DataSchema.ColumnDataType columnDataType, List<Object> values) { + _dataType = columnDataType.toDataType(); + _pinotDataType = PinotDataType.getPinotDataTypeForExecution(columnDataType); + _values = values; Review Comment: Instead of extracting the list of objects here - store the original block here (entire block) along with an index. - When you are actually extracting the primitive types, use the index to get the value out. -- 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: commits-unsubscr...@pinot.apache.org 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