weixiangsun commented on a change in pull request #8029: URL: https://github.com/apache/pinot/pull/8029#discussion_r815209865
########## File path: pinot-core/src/main/java/org/apache/pinot/core/plan/GapfillSelectionPlanNode.java ########## @@ -0,0 +1,90 @@ +/** + * 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.plan; + +import com.google.common.base.Preconditions; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.apache.pinot.common.request.context.ExpressionContext; +import org.apache.pinot.core.common.Operator; +import org.apache.pinot.core.operator.blocks.IntermediateResultsBlock; +import org.apache.pinot.core.operator.query.SelectionOnlyOperator; +import org.apache.pinot.core.operator.transform.TransformOperator; +import org.apache.pinot.core.query.request.context.QueryContext; +import org.apache.pinot.core.query.selection.SelectionOperatorUtils; +import org.apache.pinot.core.util.GapfillUtils; +import org.apache.pinot.segment.spi.IndexSegment; + + +/** + * The <code>PreAggGapFillSelectionPlanNode</code> class provides the execution + * plan for pre-aggregate gapfill query on a single segment. + */ +public class GapfillSelectionPlanNode implements PlanNode { + private final IndexSegment _indexSegment; + private final QueryContext _queryContext; + + public GapfillSelectionPlanNode(IndexSegment indexSegment, QueryContext queryContext) { + _indexSegment = indexSegment; + _queryContext = queryContext; + } + + @Override + public Operator<IntermediateResultsBlock> run() { + int limit = _queryContext.getLimit(); + + QueryContext queryContext = getSelectQueryContext(); + Preconditions.checkArgument(queryContext.getOrderByExpressions() == null, + "The gapfill query should not have orderby expression."); Review comment: At the beginning, I thought since the result will be sorted by timestamp anyway, maybe we should not allow the customer to order the result by any other dimension. But you might be right, we should allow the customer order the result by the other dimension(s) also. We do not need do the ordering on pinot server for now. We can do the sorting on the broker side. I will make the change. -- 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]
