Jackie-Jiang commented on a change in pull request #7568:
URL: https://github.com/apache/pinot/pull/7568#discussion_r758918478



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/query/request/context/utils/QueryContextUtils.java
##########
@@ -52,4 +58,79 @@ public static boolean isDistinctQuery(QueryContext query) {
     return aggregationFunctions != null && aggregationFunctions.length == 1
         && aggregationFunctions[0] instanceof DistinctAggregationFunction;
   }
+
+  /** Collect aggregation functions (except for the ones in filter). */
+  public static void generateTransforms(QueryContext queryContext, Set<String> 
postAggregations) {

Review comment:
       Rename it to `collectPostAggregations`? Same for other methods

##########
File path: 
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
##########
@@ -519,6 +545,15 @@ private BrokerResponseNative handleSQLRequest(long 
requestId, String query, Json
     return brokerResponse;
   }
 
+  /** Set EXPLAIN PLAN query to route to only one server. */
+  private void setRoutingToOneServer(Map<ServerInstance, List<String>> 
routingTable) {

Review comment:
       (minor) Rename the method to reflect that only one segment is queried

##########
File path: 
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
##########
@@ -491,6 +504,19 @@ private BrokerResponseNative handleSQLRequest(long 
requestId, String query, Json
 
     // Execute the query
     ServerStats serverStats = new ServerStats();
+    if (brokerRequest.getPinotQuery().isExplain()) {

Review comment:
       (minor)
   ```suggestion
       if (pinotQuery.isExplain()) {
   ```

##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/operator/BaseOperator.java
##########
@@ -52,4 +52,14 @@ public final T nextBlock() {
 
   // Make it protected because we should always call nextBlock()
   protected abstract T getNextBlock();
+
+  @Override
+  public String toExplainString() {
+    return getExplainPlanName();
+  }
+
+  @Override
+  public ExecutionStatistics getExecutionStatistics() {

Review comment:
       This method override can be removed because it is the same as the 
default implementation in the interface

##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/operator/filter/EmptyFilterOperator.java
##########
@@ -26,10 +29,9 @@
  * Singleton class which extends {@link BaseFilterOperator} that is empty, 
i.e. does not match any document.
  */
 public final class EmptyFilterOperator extends BaseFilterOperator {
-  private EmptyFilterOperator() {

Review comment:
       Don't remove this private constructor. We want to use this operator as a 
singleton

##########
File path: 
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
##########
@@ -106,6 +106,7 @@
   private static final String IN_SUBQUERY = "inSubquery";
   private static final Expression FALSE = 
RequestUtils.getLiteralExpression(false);
   private static final Expression TRUE = 
RequestUtils.getLiteralExpression(true);
+  private static final BrokerResponseNative BROKER_ONLY_EXPLAIN_PLAN_OUTPUT = 
getBrokerResponseExplainPlanOutput();

Review comment:
       Suggest moving this to `BrokerResponseNative` class which contains all 
the constant responses

##########
File path: pinot-core/src/main/java/org/apache/pinot/core/common/Operator.java
##########
@@ -39,12 +40,20 @@
    */
   T nextBlock();
 
+  /** @return Name of this operator */
+  String getOperatorName();
+
+  /** @return List of {@link Operator}s that this operator depends upon. */
+  List<Operator> getChildOperators();
+
   /**
-   * Returns the name of the operator.
-   * NOTE: This method is called for tracing purpose. The sub-class should try 
to return a constant to avoid the
-   * unnecessary overhead.
+   * @return EXPLAIN PLAN name if one is defined; otherwise, null. null 
EXPLAIN PLAN name means that this operator
+   * won't be included in EXPLAIN PLAN output.
    */
-  String getOperatorName();
+  String getExplainPlanName();

Review comment:
       ^^

##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/operator/filter/predicate/PredicateEvaluator.java
##########
@@ -28,6 +28,16 @@
    * APIs for both dictionary based and raw value based predicate evaluator
    */
 
+  /**
+   * Set the predicate
+   */
+  void setPredicate(Predicate predicate);

Review comment:
       #7840 




-- 
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]

Reply via email to