You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/14 02:51:24 UTC

[GitHub] [doris] morrySnow commented on a diff in pull request #14979: [feature](nereids) Support query on specific partitions

morrySnow commented on code in PR #14979:
URL: https://github.com/apache/doris/pull/14979#discussion_r1047958903


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScanBuilder.java:
##########
@@ -0,0 +1,155 @@
+// 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.doris.nereids.trees.plans.logical;
+
+import org.apache.doris.catalog.Table;
+import org.apache.doris.nereids.memo.GroupExpression;
+import org.apache.doris.nereids.properties.LogicalProperties;
+import org.apache.doris.nereids.trees.plans.PreAggStatus;
+import org.apache.doris.nereids.trees.plans.PushDownAggOperator;
+import org.apache.doris.nereids.trees.plans.RelationId;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * Builder for LogicalOlapScan
+ */
+public class LogicalOlapScanBuilder {
+    private RelationId id;
+    private Table table;
+    private List<String> qualifier = Collections.emptyList();
+    private Optional<GroupExpression> groupExpression = Optional.empty();
+    private Optional<LogicalProperties> logicalProperties = Optional.empty();
+    private List<Long> selectedPartitionIds = Collections.emptyList();
+    private boolean partitionPruned;
+    private List<Long> selectedTabletIds = Collections.emptyList();
+    private boolean tabletPruned;
+    private List<Long> candidateIndexIds = Collections.emptyList();
+    private boolean indexSelected;
+    private PreAggStatus preAggStatus = PreAggStatus.on();
+    private boolean aggPushed;
+    private PushDownAggOperator pushDownAggOperator = PushDownAggOperator.NONE;
+    private List<Long> partitions = Collections.emptyList();
+
+    public LogicalOlapScanBuilder() {
+    }
+
+    /**
+     * Builder based on logicalOlapScan
+     */
+    public LogicalOlapScanBuilder(LogicalOlapScan logicalOlapScan) {

Review Comment:
   the builder should follow the rule of withXXX such as:
   1. if set LogicalProperties, uset set groupExpression to Option.empty()
   2. related attributed should be set together and flag should be set automatically
   
   and make the builder private and as a inner class of LogicalOlapScan to ensure only used in the withXXX function in LogicalOlapScan class



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org