Timeout and maxScatterGatherBytes handling for queries run by Druid SQL#4305
Timeout and maxScatterGatherBytes handling for queries run by Druid SQL#4305gianm merged 4 commits intoapache:masterfrom
Conversation
| morePages.set(false); | ||
| final AtomicBoolean gotResult = new AtomicBoolean(); | ||
|
|
||
| queryWithPagination = (SelectQuery) QueryMaker.withDefaultTimeoutAndMaxScatterGatherBytes( |
There was a problem hiding this comment.
IMO, non-finals that are redefined halfway through a method make things difficult to follow. Why not apply this to queryWithPagination directly when it's created?
|
|
||
| public static Map<String, Object> makeResponseContextForQuery(Query query) | ||
| { | ||
| final Map<String, Object> responseContext = new MapMaker().makeMap(); |
There was a problem hiding this comment.
It looks like this is just making a new ConcurrentHashMap, might as well create it directly rather than going through this (somewhat obscure?) helper.
There was a problem hiding this comment.
Also, could this code be shared with QueryResource through a common helper -- maybe a helper located in DirectDruidClient, which seems to be what cares about the values? It looks a bit finicky to be a good idea to copy and paste it.
|
@gianm Addressed your comments |
|
@jon-wei, compilation issue: |
|
@gianm my bad, fixed |
|
@jon-wei thanks; it looks like there's a different error now, from checkstyle. |
This PR sets timeout and maxScatterGatherBytes parameters (#4229) in the query context/responseContext for SQL-originated queries.
Without this, SQL queries fail with a NullPointerException at this line in DirectDruidClient.run():