vrajat commented on code in PR #15523: URL: https://github.com/apache/pinot/pull/15523#discussion_r2056539639
########## pinot-core/src/main/java/org/apache/pinot/core/query/executor/TableExecutionInfo.java: ########## @@ -0,0 +1,197 @@ +/** + * 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.query.executor; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import javax.annotation.Nullable; +import org.apache.pinot.core.query.pruner.SegmentPrunerService; +import org.apache.pinot.core.query.pruner.SegmentPrunerStatistics; +import org.apache.pinot.core.query.request.context.QueryContext; +import org.apache.pinot.core.query.request.context.TimerContext; +import org.apache.pinot.segment.local.data.manager.SegmentDataManager; +import org.apache.pinot.segment.spi.IndexSegment; +import org.apache.pinot.segment.spi.SegmentContext; + + +public interface TableExecutionInfo { + /** + * Check if consuming segments are being queried. + * @return true if consuming segments are being queried, false otherwise + */ + boolean hasRealtime(); + + /** + * Get the index segments for a table referenced in the query. + * @return A list of index segments for the table + */ + List<IndexSegment> getIndexSegments(); + + /** + * Get a copy of the index segments for a table referenced in the query as some functions may mutate the list. + * @return A copy of the list of index segments for the table + */ + List<IndexSegment> getCopyOfIndexSegments(); Review Comment: For now, I'll remove it and make a copy in `selectedSegmentsInfo`. The usage is misleading as the logical table implementation is not in this PR. The implementation for `LogicalTable` is: ``` @Override public SelectedSegmentsInfo getSelectedSegmentsInfo(QueryContext queryContext, TimerContext timerContext, ExecutorService executorService, SegmentPrunerService segmentPrunerService) { SelectedSegmentsInfo aggregatedSelectedSegmentsInfo = new SelectedSegmentsInfo(); for (SingleTableExecutionInfo tableExecutionInfo : _tableExecutionInfos) { SelectedSegmentsInfo selectedSegmentsInfo = tableExecutionInfo.getSelectedSegmentsInfo(queryContext, timerContext, executorService, segmentPrunerService); aggregatedSelectedSegmentsInfo.aggregate(selectedSegmentsInfo); } LOGGER.debug("Matched {} segments after pruning", aggregatedSelectedSegmentsInfo._numSelectedSegments); return aggregatedSelectedSegmentsInfo; } ``` I think making a copy in `SingleTableExecutionInfo` should be fine. I'll recheck when creating a PR for logical tables. -- 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