Skip to content

MSQ: Nicer error when sortMerge join falls back to broadcast.#16002

Merged
gianm merged 3 commits intoapache:masterfrom
gianm:smj-bcst-error
Mar 1, 2024
Merged

MSQ: Nicer error when sortMerge join falls back to broadcast.#16002
gianm merged 3 commits intoapache:masterfrom
gianm:smj-bcst-error

Conversation

@gianm
Copy link
Copy Markdown
Contributor

@gianm gianm commented Feb 29, 2024

In certain cases, joins run as broadcast even when the user hinted that they wanted sortMerge. This happens when the sortMerge algorithm is unable to process the join, because it isn't a direct comparison between two fields on the LHS and RHS.

When this happens, the error message from BroadcastTablesTooLargeFault is quite confusing, since it mentions that you should try sortMerge to fix it. But the user may have already configured sortMerge.

This patch fixes it by having two error messages, based on whether broadcast join was used as a primary selection or as a fallback selection.

In certain cases, joins run as broadcast even when the user hinted
that they wanted sortMerge. This happens when the sortMerge algorithm
is unable to process the join, because it isn't a direct comparison
between two fields on the LHS and RHS.

When this happens, the error message from BroadcastTablesTooLargeFault
is quite confusing, since it mentions that you should try sortMerge
to fix it. But the user may have already configured sortMerge.

This patch fixes it by having two error messages, based on whether
broadcast join was used as a primary selection or as a fallback selection.
@github-actions github-actions Bot added Area - Batch Ingestion Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 labels Feb 29, 2024
);
} else {
return StringUtils.format(
"Size of broadcast tables in JOIN exceeds reserved memory limit "
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can ask the user to "Increase the available memory" to remedy the situation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good point, I lost that part by accident. Added it back.

Copy link
Copy Markdown
Contributor

@LakshSingla LakshSingla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR 🚀

@gianm gianm merged commit 8d3ed31 into apache:master Mar 1, 2024
@gianm gianm deleted the smj-bcst-error branch March 1, 2024 21:16
@adarshsanjeev adarshsanjeev added this to the 30.0.0 milestone May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants