Skip to content

[CALCITE-500] Fix EnumerableJoin to build the left side and probe the right#691

Closed
atris wants to merge 2 commits intoapache:masterfrom
atris:join_side_improvements
Closed

[CALCITE-500] Fix EnumerableJoin to build the left side and probe the right#691
atris wants to merge 2 commits intoapache:masterfrom
atris:join_side_improvements

Conversation

@atris
Copy link
Contributor

@atris atris commented May 17, 2018

No description provided.

Atri Sharma added 2 commits May 17, 2018 16:29
… as second. This will ensure that smaller side is built and larger side is probed
@atris
Copy link
Contributor Author

atris commented May 17, 2018

@julianhyde Can you please help review? Thanks

@atris atris changed the title CALCITE-500 -- Change cost model of EnumerableJoin to put smaller set… CALCITE-500 -- Fix EnumerableJoin to build the left side and probe the right May 17, 2018
@zinking
Copy link
Contributor

zinking commented May 22, 2018

you will need a test, and some descriptions.

@michaelmior
Copy link
Member

Also, the two commits should be squashed together.

@atris
Copy link
Contributor Author

atris commented May 22, 2018 via email

@zabetak
Copy link
Member

zabetak commented Sep 25, 2018

I haven't looked a lot in this issue but the fix seems wrong. I think it breaks LEFT, RIGHT, and FULL outer joins.

@atris
Copy link
Contributor Author

atris commented Sep 25, 2018 via email

@vlsi
Copy link
Contributor

vlsi commented Sep 25, 2018

Yes, it is not valid to just swap rightExpression and leftExpression.
leftResult.physType.generateAccessor(leftKeys) and friends should be replaced as well.

@atris
Copy link
Contributor Author

atris commented Sep 25, 2018 via email

@zabetak
Copy link
Member

zabetak commented Sep 25, 2018

I would be inclined to change the cost function so that left and right inputs are set correctly. That way the implement method would not need to be changed at all.

@vlsi
Copy link
Contributor

vlsi commented Sep 25, 2018

@zabetak , that depends on the background :)

For instance, in Oracle DB the first input is used to build the table.

@vlsi vlsi changed the title CALCITE-500 -- Fix EnumerableJoin to build the left side and probe the right [CALCITE-500] Fix EnumerableJoin to build the left side and probe the right Jan 9, 2019
@hsyuan
Copy link
Member

hsyuan commented Apr 23, 2019

@atris Are you going to continue working on this issue?

@danny0405 danny0405 force-pushed the master branch 2 times, most recently from 80f411d to ca27fe9 Compare November 30, 2019 07:52
@vlsi vlsi force-pushed the master branch 2 times, most recently from 49cb002 to 8768a23 Compare December 29, 2019 12:07
@vlsi
Copy link
Contributor

vlsi commented Jan 2, 2020

Executor implementation has to be consistent with the planner.
For instance, the planner assumes the join would retain left input collation, so we can't use left input for lookup.

That is why I decline this PR in favour of adjusting the cost so it prefers smaller inputs on the right input.

See #1712

@vlsi vlsi closed this Jan 2, 2020
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.

6 participants