This is an automated email from the ASF dual-hosted git repository.

richardstartin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 56282e8b2f track group by evaluation statistics (#8683)
56282e8b2f is described below

commit 56282e8b2f35bfd4a86d926f47aeedeee56aaf65
Author: Richard Startin <[email protected]>
AuthorDate: Wed May 11 21:56:15 2022 +0200

    track group by evaluation statistics (#8683)
---
 .../core/operator/query/AggregationGroupByOrderByOperator.java   | 2 ++
 .../java/org/apache/pinot/spi/trace/InvocationRecording.java     | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/operator/query/AggregationGroupByOrderByOperator.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/operator/query/AggregationGroupByOrderByOperator.java
index 7f61327675..ce60222672 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/operator/query/AggregationGroupByOrderByOperator.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/operator/query/AggregationGroupByOrderByOperator.java
@@ -37,6 +37,7 @@ import 
org.apache.pinot.core.query.aggregation.groupby.GroupByExecutor;
 import org.apache.pinot.core.query.request.context.QueryContext;
 import org.apache.pinot.core.startree.executor.StarTreeGroupByExecutor;
 import org.apache.pinot.core.util.GroupByUtils;
+import org.apache.pinot.spi.trace.Tracing;
 
 
 /**
@@ -110,6 +111,7 @@ public class AggregationGroupByOrderByOperator extends 
BaseOperator<Intermediate
 
     // Check if the groups limit is reached
     boolean numGroupsLimitReached = groupByExecutor.getNumGroups() >= 
_queryContext.getNumGroupsLimit();
+    Tracing.activeRecording().setNumGroups(_queryContext.getNumGroupsLimit(), 
groupByExecutor.getNumGroups());
 
     // Trim the groups when iff:
     // - Query has ORDER BY clause
diff --git 
a/pinot-spi/src/main/java/org/apache/pinot/spi/trace/InvocationRecording.java 
b/pinot-spi/src/main/java/org/apache/pinot/spi/trace/InvocationRecording.java
index ad86e8b6db..eb9ec1011e 100644
--- 
a/pinot-spi/src/main/java/org/apache/pinot/spi/trace/InvocationRecording.java
+++ 
b/pinot-spi/src/main/java/org/apache/pinot/spi/trace/InvocationRecording.java
@@ -28,6 +28,15 @@ import org.apache.pinot.spi.data.FieldSpec;
  */
 public interface InvocationRecording {
 
+  /**
+   * Sets the upper bound for the number of groups in a group by evaluation, 
along with the actual number of groups.
+   * The ratio of these two quantities indicates how efficient the group by 
was, and if truncation has occurred.
+   * @param numGroupsLimit the upper bound for the number of groups
+   * @param numGroups the actual number of groups
+   */
+  default void setNumGroups(int numGroupsLimit, int numGroups) {
+  }
+
   /**
    * Sets the number of docs scanned by the operator.
    * @param numDocsScanned how many docs were scanned.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to