Skip to content

Fix multiple sources build side in AdaptiveReorderPartitionedJoin#23454

Merged
losipiuk merged 2 commits intotrinodb:masterfrom
gaurav8297:gaurav8297/fix_adaptive_partitioned_join
Sep 20, 2024
Merged

Fix multiple sources build side in AdaptiveReorderPartitionedJoin#23454
losipiuk merged 2 commits intotrinodb:masterfrom
gaurav8297:gaurav8297/fix_adaptive_partitioned_join

Conversation

@gaurav8297
Copy link
Member

@gaurav8297 gaurav8297 commented Sep 17, 2024

Description

Fix: #23407

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text:

# General
* Fix possible query failure when `retry_policy` is set to `TASK` and when adaptive join reordering is enabled . ({issue}`23407`)

@cla-bot cla-bot bot added the cla-signed label Sep 17, 2024
@losipiuk
Copy link
Member

Please add add a regression test for this one.

@gaurav8297 gaurav8297 force-pushed the gaurav8297/fix_adaptive_partitioned_join branch from d79a3b3 to 15f7f03 Compare September 19, 2024 03:29
@gaurav8297 gaurav8297 marked this pull request as ready for review September 19, 2024 03:29
@gaurav8297 gaurav8297 requested a review from losipiuk September 19, 2024 03:30
Copy link
Member

@losipiuk losipiuk left a comment

Choose a reason for hiding this comment

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

Seem fine - but hard to follow.
So more idiot-friendly comments would be nice.

Copy link
Member

Choose a reason for hiding this comment

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

should we comply to SystemSessionProperties.isUseExactPartitioning here?

Copy link
Member Author

@gaurav8297 gaurav8297 Sep 20, 2024

Choose a reason for hiding this comment

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

I think this is only applicable for remote exchange and in our case we only care about changing local exchange. Additionally, we have a check (!expectedRightProperties.isSatisfiedBy(rightProperties)) using deriveStreamPropertiesRecursively so it won't add extra local exchange if not needed.

Comment on lines 260 to 262
Copy link
Member

Choose a reason for hiding this comment

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

This is the same as visitPlan(node, ctx);. Looks like you can just drop if. Or whole visitAggregation actually

Copy link
Member Author

Choose a reason for hiding this comment

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

Added some more checks. PTAL

Copy link
Member

Choose a reason for hiding this comment

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

what if there is partitined exchange? Looks like we will add another one even if not needed

Copy link
Member Author

Choose a reason for hiding this comment

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

If there's a partitioned exchange which comply with partitioning scheme needed for join then we won't add anything because of this check. !expectedRightProperties.isSatisfiedBy(rightProperties)

@gaurav8297 gaurav8297 force-pushed the gaurav8297/fix_adaptive_partitioned_join branch from 15f7f03 to cf6e515 Compare September 20, 2024 05:24
@gaurav8297 gaurav8297 requested a review from losipiuk September 20, 2024 05:31
@losipiuk losipiuk merged commit 6c25ebf into trinodb:master Sep 20, 2024
@github-actions github-actions bot added this to the 459 milestone Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

fault_tolerant_execution_adaptive_join_reordering_enabled is causing previous working queries to fail

2 participants