You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/10/17 00:49:28 UTC

[GitHub] [pinot] jackjlli commented on a change in pull request #7568: EXPLAIN PLAN

jackjlli commented on a change in pull request #7568:
URL: https://github.com/apache/pinot/pull/7568#discussion_r730106820



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/operator/filter/OrFilterOperator.java
##########
@@ -49,4 +50,18 @@ protected FilterBlock getNextBlock() {
   public String getOperatorName() {
     return OPERATOR_NAME;
   }
+
+  @Override
+  public String getExplainPlanName() {
+    return EXPLAIN_NAME;
+  }
+
+  @Override
+  public List<Operator> getChildOperators() {
+    List<Operator> operators = new ArrayList<>();

Review comment:
       Same here.

##########
File path: pinot-core/src/main/java/org/apache/pinot/core/operator/query/AggregationOperator.java
##########
@@ -75,11 +79,36 @@ public String getOperatorName() {
     return OPERATOR_NAME;
   }
 
+  @Override
+  public String getExplainPlanName() {
+    return EXPLAIN_NAME;
+  }
+
+  @Override
+  public List<Operator> getChildOperators() {
+    return Arrays.asList(_transformOperator);
+  }
+
   @Override
   public ExecutionStatistics getExecutionStatistics() {
     long numEntriesScannedInFilter = _transformOperator.getExecutionStatistics().getNumEntriesScannedInFilter();
     long numEntriesScannedPostFilter = (long) _numDocsScanned * _transformOperator.getNumColumnsProjected();
     return new ExecutionStatistics(_numDocsScanned, numEntriesScannedInFilter, numEntriesScannedPostFilter,
         _numTotalDocs);
   }
+
+  @Override
+  public String toExplainString() {
+    StringBuilder stringBuilder = new StringBuilder(getExplainPlanName()).append("(aggregations:");
+    int count = 0;
+    for (AggregationFunction func : _aggregationFunctions) {

Review comment:
       I found there are two formats to form the explain string; one is to use a for loop like this and the other one is to use a variable `i` like the one in `DistinctOperator`. Can we unify the behavior?

##########
File path: pinot-core/src/main/java/org/apache/pinot/core/operator/filter/AndFilterOperator.java
##########
@@ -47,4 +49,18 @@ protected FilterBlock getNextBlock() {
   public String getOperatorName() {
     return OPERATOR_NAME;
   }
+
+  @Override
+  public List<Operator> getChildOperators() {
+    ArrayList<Operator> result = new ArrayList<>();

Review comment:
       Can it be replaced by `List<Operator> result = new ArrayList<>(_filterOperators);` ?




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

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



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