-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
opt: fix bug with incorrect results returned by left lookup/inverted …
…join This commit fixes a bug in which incorrect results could be returned for left and anti lookup and inverted joins. This could happen when one of the prefix columns was constrained to more than one constant value, either due to a check constraint or an IN clause. The current implementation used to support lookup and inverted joins for this case creates a cross-join between the constant values and the input, thus artifically increasing the size of the input to the join. This works for inner and semi joins, but it is not correct for left or anti joins, because non-matching input rows will be returned multiple times in the output, which is incorrect. This commit fixes the bug by avoiding creating lookup or inverted joins in these cases. However, this is suboptimal for performance, and in a future commit we should try to find a way to create left/anti inverted/lookup joins safely for these cases. Fixes #59615 Release note (bug fix): Fixed a bug in which incorrect results could be returned for left and anti joins. This could happen when one of the columns on one side of the join was constrained to multiple constant values, either due to a check constraint or an IN clause. The bug resulted in non-matching input rows getting returned multiple times in the output, which is incorrect. This bug only affected previous alpha releases of 21.1, and has now been fixed.
- Loading branch information
Showing
5 changed files
with
246 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.