You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by ka...@apache.org on 2023/06/16 06:32:26 UTC
[druid] branch master updated: MSQ: Load broadcast tables on workers. (#14437)
This is an automated email from the ASF dual-hosted git repository.
karan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 85656a467c MSQ: Load broadcast tables on workers. (#14437)
85656a467c is described below
commit 85656a467c66cffbe616dfa5e3646a0ac82b9afc
Author: Gian Merlino <gi...@gmail.com>
AuthorDate: Thu Jun 15 23:32:20 2023 -0700
MSQ: Load broadcast tables on workers. (#14437)
They were not previously loaded because supportsQueries was false.
This patch sets supportsQueries to true, and clarifies in Task
javadocs that supportsQueries can be true for tasks that aren't
directly queryable over HTTP.
---
.../main/java/org/apache/druid/msq/indexing/MSQWorkerTask.java | 8 ++++++++
.../src/main/java/org/apache/druid/indexing/common/task/Task.java | 7 ++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTask.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTask.java
index d0dd70b0dd..95abc6b03a 100644
--- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTask.java
+++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTask.java
@@ -154,6 +154,14 @@ public class MSQWorkerTask extends AbstractTask
return getContextValue(Tasks.PRIORITY_KEY, Tasks.DEFAULT_BATCH_INDEX_TASK_PRIORITY);
}
+ @Override
+ public boolean supportsQueries()
+ {
+ // Even though we don't have a QueryResource, we do embed a query stack, and so we need preloaded resources
+ // such as broadcast tables.
+ return true;
+ }
+
@Override
public boolean equals(Object o)
{
diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/Task.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/Task.java
index 1cc2d329c8..5c3186ef39 100644
--- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/Task.java
+++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/Task.java
@@ -182,7 +182,12 @@ public interface Task
<T> QueryRunner<T> getQueryRunner(Query<T> query);
/**
- * @return true if this Task type is queryable, such as streaming ingestion tasks
+ * True if this task type embeds a query stack, and therefore should preload resources (like broadcast tables)
+ * that may be needed by queries.
+ *
+ * If true, {@link #getQueryRunner(Query)} does not necessarily return nonnull query runners. For example,
+ * MSQWorkerTask returns true from this method (because it embeds a query stack for running multi-stage queries)
+ * even though it is not directly queryable via HTTP.
*/
boolean supportsQueries();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org