Skip to content

[Backport] [13537] MSQ: Only look at sqlInsertSegmentGranularity on the outer query #13542

Merged
kfaraz merged 1 commit intoapache:25.0.0from
cryptoe:apache_25.0.0
Dec 10, 2022
Merged

[Backport] [13537] MSQ: Only look at sqlInsertSegmentGranularity on the outer query #13542
kfaraz merged 1 commit intoapache:25.0.0from
cryptoe:apache_25.0.0

Conversation

@cryptoe
Copy link
Copy Markdown
Contributor

@cryptoe cryptoe commented Dec 9, 2022

The planner sets sqlInsertSegmentGranularity in its context when using PARTITIONED BY, which sets it on every native query in the stack (as all native queries for a SQL query typically have the same context). QueryKit would interpret that as a request to configure bucketing for all native queries. This isn't useful, as bucketing is only used for the penultimate stage in INSERT / REPLACE.

So, this patch modifies QueryKit to only look at sqlInsertSegmentGranularity on the outermost query.

As an additional change, this patch switches the static ObjectMapper to use the processwide ObjectMapper for deserializing Granularities. Saves an ObjectMapper instance, and ensures that if there are any special serdes registered for Granularity, we'll pick them up.

(cherry picked from commit 5581488)

Original PR: #13537

…ache#13537)

The planner sets sqlInsertSegmentGranularity in its context when using
PARTITIONED BY, which sets it on every native query in the stack (as all
native queries for a SQL query typically have the same context).
QueryKit would interpret that as a request to configure bucketing for
all native queries. This isn't useful, as bucketing is only used for
the penultimate stage in INSERT / REPLACE.

So, this patch modifies QueryKit to only look at sqlInsertSegmentGranularity
on the outermost query.

As an additional change, this patch switches the static ObjectMapper to
use the processwide ObjectMapper for deserializing Granularities. Saves
an ObjectMapper instance, and ensures that if there are any special
serdes registered for Granularity, we'll pick them up.

(cherry picked from commit 5581488)
@kfaraz kfaraz added this to the 25.0 milestone Dec 10, 2022
@kfaraz
Copy link
Copy Markdown
Contributor

kfaraz commented Dec 10, 2022

Merging as failure is unrelated.

@kfaraz kfaraz merged commit 977792d into apache:25.0.0 Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants