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.
This commit is contained in:
Gian Merlino 2023-06-15 23:32:20 -07:00 committed by GitHub
parent 5d76d0ea74
commit 85656a467c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -154,6 +154,14 @@ public class MSQWorkerTask extends AbstractTask
return getContextValue(Tasks.PRIORITY_KEY, Tasks.DEFAULT_BATCH_INDEX_TASK_PRIORITY); 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 @Override
public boolean equals(Object o) public boolean equals(Object o)
{ {

View File

@ -182,7 +182,12 @@ public interface Task
<T> QueryRunner<T> getQueryRunner(Query<T> query); <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(); boolean supportsQueries();