Skip to content

[Backport] Patches (#17039) (#17173) (#17216) (#17224) (#17230) (#17238)#17251

Merged
kfaraz merged 6 commits intoapache:31.0.0from
kfaraz:backport_17224_et_al
Oct 5, 2024
Merged

[Backport] Patches (#17039) (#17173) (#17216) (#17224) (#17230) (#17238)#17251
kfaraz merged 6 commits intoapache:31.0.0from
kfaraz:backport_17224_et_al

Conversation

@kfaraz
Copy link
Copy Markdown
Contributor

@kfaraz kfaraz commented Oct 4, 2024

Backport the following patches:
#17039
#17173
#17216
#17224
#17230
#17238

gianm and others added 5 commits October 4, 2024 19:53
)

* SQL: Use regular filters for time filtering in subqueries.

Using the "intervals" feature on subqueries, or any non-table, should be
avoided because it isn't a meaningful optimization in those cases, and
it's simpler for runtime implementations if they can assume all filters
are located in the regular filter object.

Two changes:

1) Fix the logic in DruidQuery.canUseIntervalFiltering. It was intended
   to return false for QueryDataSource, but actually returned true.

2) Add a validation to ScanQueryFrameProcessor to ensure that when running
   on an input channel (which would include any subquery), the query has
   "intervals" set to ONLY_ETERNITY.

Prior to this patch, the new test case in testTimeFilterOnSubquery would
throw a "Can only handle a single interval" error in the native engine,
and "QueryNotSupported" in the MSQ engine.

* Mark new case as having extra columns in decoupled mode.

* Adjust test.
…ache#17216)

* RunWorkOrder: Account for two simultaneous statistics collectors.

As a follow up to apache#17057, divide the amount of partitionStatsMemory
by two, to account for the fact that there are at some times going to
be two copies of the full collector. First there will be one for processors
and one for the accumulated collector. Then, after the processor ones are
GCed, a snapshot of the accumulated collector will be created.

Also includes an optimization to "addAll" for the two KeyCollectors,
for the case where we're adding into an empty collector. This is always
going to happen once per stage due to the "withAccumulation" call.

* Fix missing variable.

* Don't divide by numProcessingThreads twice.

* Fix test.
We should use getHost(), which returns TLS if configured or plaintext
otherwise. getHostAndPort() returns plaintext only.
This fixes a race where, if there is no output at all, setAllDoneIfPossible
could be called twice (once when the output partitions future resolves, and
once when the batcher finishes). If the calls happen in that order, it would
try to create nil output channels both times, resulting in a "Channel already set"
error.
@kfaraz kfaraz added the Backport label Oct 4, 2024
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
@github-actions github-actions Bot added Area - Batch Ingestion Area - Querying Area - Dependencies Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 labels Oct 4, 2024
There were some problematic cases

join branches are run with finalize=false instead of finalize=true like normal subqueries
this inconsistency is not good - but fixing it is a bigger thing
ensure that right hand sides of joins are always subqueries - or accessible globally
To achieve the above:

operand indexes were needed for the upstream reltree nodes in the generator
source unwrapping now takes the join situation into account as well
@kfaraz kfaraz changed the title [Backport] Patches (#17173) (#17216) (#17224) (#17230) (#17238) [Backport] Patches (#17039) (#17173) (#17216) (#17224) (#17230) (#17238) Oct 4, 2024
@kfaraz
Copy link
Copy Markdown
Contributor Author

kfaraz commented Oct 5, 2024

IT failure is unrelated, merging.

@kfaraz kfaraz merged commit 10528a6 into apache:31.0.0 Oct 5, 2024
@kfaraz kfaraz deleted the backport_17224_et_al branch October 5, 2024 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area - Batch Ingestion Area - Dependencies Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 Area - Querying Backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants