Commit 4328d2f
kongfanshen
Adapt "Right Semi Join" backport for Apache Cloudberry MPP
This commit carries the Cloudberry/Greenplum-specific changes needed on
top of the two cherry-picked upstream commits (aa86129, 5668a85),
which only touch the upstream PostgreSQL planner/executor files.
- nodes.h: move JOIN_RIGHT_SEMI to the END of the JoinType enum. Upstream
places it next to JOIN_RIGHT_ANTI, but in the Cloudberry tree that shifts
the integer values of the GPDB-specific JOIN_DEDUP_SEMI/REVERSE and
JOIN_UNIQUE_* codes. Value-dependent code then corrupts MPP motion
planning, producing a degenerate plan ("Gather Motion 0:1" /
"Redistribute Motion 1:0") that crashes with SIGSEGV in
setupCdbProcessList() during dispatch. Appending keeps every pre-existing
enum value stable.
- cdbpath.c (cdbpath_motion_for_join, both the serial and parallel switch):
handle JOIN_RIGHT_SEMI like JOIN_RIGHT/JOIN_RIGHT_ANTI. A right-semi join
emits inner (build-side) rows, so the inner side must not be replicated,
otherwise matched inner rows could be emitted more than once. Without this
the new join type would hit the switch default and elog(ERROR,
"unexpected join type") at plan time.
Note: this feature is only exercised by the PostgreSQL planner
(optimizer=off); GPORCA does not generate JOIN_RIGHT_SEMI.1 parent e810621 commit 4328d2f
2 files changed
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1469 | 1469 | | |
1470 | 1470 | | |
1471 | 1471 | | |
| 1472 | + | |
1472 | 1473 | | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1473 | 1479 | | |
1474 | 1480 | | |
1475 | 1481 | | |
| |||
3220 | 3226 | | |
3221 | 3227 | | |
3222 | 3228 | | |
| 3229 | + | |
3223 | 3230 | | |
3224 | 3231 | | |
3225 | 3232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
1029 | | - | |
1030 | 1029 | | |
1031 | 1030 | | |
1032 | 1031 | | |
| |||
1046 | 1045 | | |
1047 | 1046 | | |
1048 | 1047 | | |
1049 | | - | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
1050 | 1061 | | |
1051 | 1062 | | |
1052 | 1063 | | |
| |||
0 commit comments