Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@whitehawk
Copy link

ADBDEV-7104: FOR CI only

This adds support for RETURNING operator for ORCA optimizer

returningList from query transforms into LogicalProject that wraps
around logical dml node in dxl query

dml nodes inside ORCA were changed to provide required columns for this
project node

nodeDML also was changed to return modified tuples to print them on
coordinator through projection
output is first because most of other nodes expects it
fixed serializers, readers
Also small cleanup of unused changes
SELECT on table with no columns is accepted but RETURNING cannot have
zero columns.
The only way to output from DML node is by using RETURNING.
So to require output for SELECT with zero columns tighten condition for
only DML operations
…de doesn't return enougn columns

problem occurs in case DML returns modified columns with replicated distribution and columns from subplan, which selects data from other table

Subplan inside ORCA is planned as NLJoin
On Expr2DXL stage subplan is pushed to projlist of nearest Result node above join node, join node itself is not needed so it is not added to DXL tree

Problem is that GatherMotion is added above DML with replicated distribution to return data to qdir
But this motion is under nearest Result node so when subplan is executed, its data has replicated distribution and there is no other motion to gather it

This commit adds intermediate Result node right before motion, after join, in case when join requires more columns than child node can derive
This will cause subplan to execute where is was meant to be executed while planning in ORCA
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.

3 participants