You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by si...@apache.org on 2023/10/03 17:14:18 UTC
[pinot] branch master updated: Reduce cpu usage by avoiding throwing an exception during query execution (#11715)
This is an automated email from the ASF dual-hosted git repository.
siddteotia 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 1d0303ce55 Reduce cpu usage by avoiding throwing an exception during query execution (#11715)
1d0303ce55 is described below
commit 1d0303ce55d17ce4157520bee254b70c8f600b07
Author: Vivek Iyer Vaidyanathan <vv...@gmail.com>
AuthorDate: Tue Oct 3 10:14:09 2023 -0700
Reduce cpu usage by avoiding throwing an exception during query execution (#11715)
* Avoid throwing exception
* Address review comment
Co-authored-by: Xiaotian (Jackie) Jiang <17...@users.noreply.github.com>
---------
Co-authored-by: Xiaotian (Jackie) Jiang <17...@users.noreply.github.com>
---
.../main/java/org/apache/pinot/core/common/Operator.java | 2 +-
.../pinot/core/operator/combine/CombineOperatorUtils.java | 14 ++++++--------
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/pinot-core/src/main/java/org/apache/pinot/core/common/Operator.java b/pinot-core/src/main/java/org/apache/pinot/core/common/Operator.java
index e8b812306d..b6abbcb266 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/common/Operator.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/common/Operator.java
@@ -72,7 +72,7 @@ public interface Operator<T extends Block> {
* Returns the index segment associated with the operator.
*/
default IndexSegment getIndexSegment() {
- throw new UnsupportedOperationException();
+ return null;
}
/**
diff --git a/pinot-core/src/main/java/org/apache/pinot/core/operator/combine/CombineOperatorUtils.java b/pinot-core/src/main/java/org/apache/pinot/core/operator/combine/CombineOperatorUtils.java
index eae5678f61..4715d26a77 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/operator/combine/CombineOperatorUtils.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/operator/combine/CombineOperatorUtils.java
@@ -48,15 +48,13 @@ public class CombineOperatorUtils {
if (executionStatistics.getNumDocsScanned() > 0) {
numSegmentsMatched++;
}
- // TODO: Check all operators and properly implement the getIndexSegment and remove this exception handling
- try {
- if (operator.getIndexSegment() instanceof MutableSegment) {
- numConsumingSegmentsProcessed += 1;
- if (executionStatistics.getNumDocsScanned() > 0) {
- numConsumingSegmentsMatched++;
- }
+
+ // TODO: Check all operators and properly implement the getIndexSegment.
+ if (operator.getIndexSegment() instanceof MutableSegment) {
+ numConsumingSegmentsProcessed += 1;
+ if (executionStatistics.getNumDocsScanned() > 0) {
+ numConsumingSegmentsMatched++;
}
- } catch (UnsupportedOperationException ignored) {
}
numDocsScanned += executionStatistics.getNumDocsScanned();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org