Skip to content

Conversation

@morningman
Copy link
Contributor

Proposed changes

SQL like:
select a join b union select c join d;

if both a/b and c/d are colocate join, the query may failed with error like:

failed to get tablet. tablet_id=26846, with schema_hash=398972982, reason=tablet does not exist

This is because when assigning exec host for fragment, the planner failed to distinguish which scan nodes
belong to the certain fragment. So it may choose the wrong host for scan range.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)

Checklist

…cate Join.

SQL like:
`select a join b union select c join d`;

if a b is colocate join, and c d is also colocate join, the query may failed
with error like:

`failed to get tablet. tablet_id=26846, with schema_hash=398972982, reason=tablet does not exist`
@morningman morningman added kind/fix Categorizes issue or PR as related to a bug. area/planner Issues or PRs related to the query planner labels Nov 3, 2020
@morningman morningman self-assigned this Nov 3, 2020
Copy link
Contributor

@EmmyMiao87 EmmyMiao87 left a comment

Choose a reason for hiding this comment

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

LGTM

}

private void computeColocateJoinInstanceParam(PlanFragmentId fragmentId, int parallelExecInstanceNum, FragmentExecParams params) {
Map<Integer, TNetworkAddress> bucketSeqToAddress = fragmentIdToSeqToAddressMap.get(fragmentId);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe bucketSeqToScanRang should be a map like fragmentIdToSeqToAddressMap to solve this problem is a
better understanding way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will leave it when refactoring them.

@morningman morningman added the approved Indicates a PR has been approved by one committer. label Nov 4, 2020
@morningman morningman merged commit bde84e4 into apache:master Nov 5, 2020
@yangzhg yangzhg mentioned this pull request Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. area/planner Issues or PRs related to the query planner kind/fix Categorizes issue or PR as related to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][SQL] query failed with Union and Colocate Join

3 participants