You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by jl...@apache.org on 2024/04/11 20:12:47 UTC
(pinot) 01/01: Unify the usage of broker empty results
This is an automated email from the ASF dual-hosted git repository.
jlli pushed a commit to branch unify-broker-empty-result
in repository https://gitbox.apache.org/repos/asf/pinot.git
commit 8e5f7b8e41dfbb65dfb26a0d6632215bdf52b521
Author: jlli_LinkedIn <jl...@linkedin.com>
AuthorDate: Thu Apr 11 13:12:26 2024 -0700
Unify the usage of broker empty results
---
.../apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java | 2 +-
.../pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java | 2 +-
.../org/apache/pinot/common/response/broker/BrokerResponseNative.java | 4 ++--
.../java/org/apache/pinot/core/query/reduce/BrokerReduceService.java | 2 +-
.../apache/pinot/core/query/reduce/SelectionOnlyStreamingReducer.java | 2 +-
.../org/apache/pinot/core/query/reduce/StreamingReduceService.java | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java b/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
index b2d4e24d3f..b7b1e7d215 100644
--- a/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
+++ b/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
@@ -827,7 +827,7 @@ public abstract class BaseBrokerRequestHandler implements BrokerRequestHandler {
}
// Send empty response since we don't need to evaluate either offline or realtime request.
- BrokerResponseNative brokerResponse = BrokerResponseNative.empty();
+ BrokerResponseNative brokerResponse = BrokerResponseNative.EMPTY_RESULT;
// Extract source info from incoming request
_queryLogger.log(
new QueryLogger.QueryLogParams(requestId, query, requestContext, tableName, 0, null, brokerResponse,
diff --git a/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java b/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
index 01e4884d6a..b8015a9203 100644
--- a/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
+++ b/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
@@ -320,7 +320,7 @@ public class MultiStageBrokerRequestHandler extends BaseBrokerRequestHandler {
}
private BrokerResponseNative constructMultistageExplainPlan(String sql, String plan) {
- BrokerResponseNative brokerResponse = BrokerResponseNative.empty();
+ BrokerResponseNative brokerResponse = BrokerResponseNative.EMPTY_RESULT;
List<Object[]> rows = new ArrayList<>();
rows.add(new Object[]{sql, plan});
DataSchema multistageExplainResultSchema = new DataSchema(new String[]{"SQL", "PLAN"},
diff --git a/pinot-common/src/main/java/org/apache/pinot/common/response/broker/BrokerResponseNative.java b/pinot-common/src/main/java/org/apache/pinot/common/response/broker/BrokerResponseNative.java
index 9fe098e26d..142e497ad0 100644
--- a/pinot-common/src/main/java/org/apache/pinot/common/response/broker/BrokerResponseNative.java
+++ b/pinot-common/src/main/java/org/apache/pinot/common/response/broker/BrokerResponseNative.java
@@ -117,7 +117,7 @@ public class BrokerResponseNative implements BrokerResponse {
/** Generate EXPLAIN PLAN output when queries are evaluated by Broker without going to the Server. */
private static BrokerResponseNative getBrokerResponseExplainPlanOutput() {
- BrokerResponseNative brokerResponse = BrokerResponseNative.empty();
+ BrokerResponseNative brokerResponse = BrokerResponseNative.EMPTY_RESULT;
List<Object[]> rows = new ArrayList<>();
rows.add(new Object[]{"BROKER_EVALUATE", 0, -1});
brokerResponse.setResultTable(new ResultTable(DataSchema.EXPLAIN_RESULT_SCHEMA, rows));
@@ -127,7 +127,7 @@ public class BrokerResponseNative implements BrokerResponse {
/**
* Get a new empty {@link BrokerResponseNative}.
*/
- public static BrokerResponseNative empty() {
+ private static BrokerResponseNative empty() {
return new BrokerResponseNative();
}
diff --git a/pinot-core/src/main/java/org/apache/pinot/core/query/reduce/BrokerReduceService.java b/pinot-core/src/main/java/org/apache/pinot/core/query/reduce/BrokerReduceService.java
index c664a78e67..9e8d93940e 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/query/reduce/BrokerReduceService.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/query/reduce/BrokerReduceService.java
@@ -63,7 +63,7 @@ public class BrokerReduceService extends BaseReduceService {
Map<ServerRoutingInstance, DataTable> dataTableMap, long reduceTimeOutMs, @Nullable BrokerMetrics brokerMetrics) {
if (dataTableMap.isEmpty()) {
// Empty response.
- return BrokerResponseNative.empty();
+ return BrokerResponseNative.EMPTY_RESULT;
}
Map<String, String> queryOptions = brokerRequest.getPinotQuery().getQueryOptions();
diff --git a/pinot-core/src/main/java/org/apache/pinot/core/query/reduce/SelectionOnlyStreamingReducer.java b/pinot-core/src/main/java/org/apache/pinot/core/query/reduce/SelectionOnlyStreamingReducer.java
index ffa0ffdbd0..664091f4f7 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/query/reduce/SelectionOnlyStreamingReducer.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/query/reduce/SelectionOnlyStreamingReducer.java
@@ -90,7 +90,7 @@ public class SelectionOnlyStreamingReducer implements StreamingReducer {
@Override
public BrokerResponseNative seal() {
if (_dataSchema == null) {
- return BrokerResponseNative.empty();
+ return BrokerResponseNative.EMPTY_RESULT;
}
Pair<DataSchema, int[]> pair =
SelectionOperatorUtils.getResultTableDataSchemaAndColumnIndices(_queryContext, _dataSchema);
diff --git a/pinot-core/src/main/java/org/apache/pinot/core/query/reduce/StreamingReduceService.java b/pinot-core/src/main/java/org/apache/pinot/core/query/reduce/StreamingReduceService.java
index f3a04f1857..971fa3b590 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/query/reduce/StreamingReduceService.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/query/reduce/StreamingReduceService.java
@@ -63,7 +63,7 @@ public class StreamingReduceService extends BaseReduceService {
throws IOException {
if (serverResponseMap.isEmpty()) {
// Empty response.
- return BrokerResponseNative.empty();
+ return BrokerResponseNative.EMPTY_RESULT;
}
// prepare contextual info for reduce.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org