Skip to content

Disable pull-up when correlated inner columns are not a subset of the PARTITION BY columns - #2353

Open
andr-sokolov wants to merge 1 commit into
apache:REL_2_STABLEfrom
andr-sokolov:CXformLeftSemiApply2LeftSemiJoin_2
Open

andr-sokolov wants to merge 1 commit into
apache:REL_2_STABLEfrom
andr-sokolov:CXformLeftSemiApply2LeftSemiJoin_2

Conversation

@andr-sokolov

Copy link
Copy Markdown
Collaborator

Orca built invalid plan because it pulled up subquery which contains a window
function during the Apply to Join transformations. Window function could return
incorrect value after the pull-up because tuples number which this function was
calculated over was changed after the optimization.

The pull-up is safe when the correlated inner columns are a subset of
the PARTITION BY columns. Otherwise the pull-up is disabled.

FProcessProject processes CLogicalProject too. CLogicalProject processing is
not changed.

The queries to reproduce the bug are added to tests.

Cherry-picked from b98a1e5

… PARTITION BY columns (apache#2274)

Orca built invalid plan because it pulled up subquery which contains a window
function during the Apply to Join transformations. Window function could return
incorrect value after the pull-up because tuples number which this function was
calculated over was changed after the optimization.

The pull-up is safe when the correlated inner columns are a subset of
the PARTITION BY columns. Otherwise the pull-up is disabled.

FProcessProject processes CLogicalProject too. CLogicalProject processing is
not changed.

The queries to reproduce the bug are added to tests.

Cherry-picked from b98a1e5

@Alena0704 Alena0704 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants