@@ -58,44 +58,42 @@ explain merge into t1 using t2 on t1.a < t2.a when matched then update * when no
58
58
----
59
59
MergeInto:
60
60
target_table: default.default.t1
61
- ├── distributed: false
61
+ ├── distributed: true
62
62
├── target_build_optimization: false
63
63
├── can_try_update_column_only: true
64
64
├── matched update: [condition: None,update set a = a (#0)]
65
65
└── unmatched insert: [condition: None,insert into (a) values(CAST(a (#0) AS Int32 NULL))]
66
66
HashJoin
67
- ├── output columns: [t1.a (#1), t1._row_id (#2), t2.a (#0)]
67
+ ├── output columns: [t1.a (#1), t1._row_id (#2), t2.a (#0), #_row_number ]
68
68
├── join type: RIGHT OUTER
69
69
├── build keys: []
70
70
├── probe keys: []
71
71
├── filters: [t1.a (#1) < t2.a (#0)]
72
72
├── estimated rows: 15.00
73
73
├── Exchange(Build)
74
- │ ├── output columns: [t2.a (#0)]
75
- │ ├── exchange type: Merge
76
- │ └── TableScan
77
- │ ├── table: default.default.t2
78
- │ ├── output columns: [a (#0)]
79
- │ ├── read rows: 1
80
- │ ├── read size: < 1 KiB
81
- │ ├── partitions total: 1
82
- │ ├── partitions scanned: 1
83
- │ ├── pruning stats: [segments: <range pruning: 1 to 1>, blocks: <range pruning: 1 to 1>]
84
- │ ├── push downs: [filters: [], limit: NONE]
85
- │ └── estimated rows: 1.00
86
- └── Exchange(Probe)
87
- ├── output columns: [t1.a (#1), t1._row_id (#2)]
88
- ├── exchange type: Merge
89
- └── TableScan
90
- ├── table: default.default.t1
91
- ├── output columns: [a (#1), _row_id (#2)]
92
- ├── read rows: 15
93
- ├── read size: < 1 KiB
94
- ├── partitions total: 3
95
- ├── partitions scanned: 3
96
- ├── pruning stats: [segments: <range pruning: 3 to 3>, blocks: <range pruning: 3 to 3>]
97
- ├── push downs: [filters: [], limit: NONE]
98
- └── estimated rows: 15.00
74
+ │ ├── output columns: [t2.a (#0), #_row_number]
75
+ │ ├── exchange type: Broadcast
76
+ │ └── MergeIntoAddRowNumber
77
+ │ └── TableScan
78
+ │ ├── table: default.default.t2
79
+ │ ├── output columns: [a (#0)]
80
+ │ ├── read rows: 1
81
+ │ ├── read size: < 1 KiB
82
+ │ ├── partitions total: 1
83
+ │ ├── partitions scanned: 1
84
+ │ ├── pruning stats: [segments: <range pruning: 1 to 1>, blocks: <range pruning: 1 to 1>]
85
+ │ ├── push downs: [filters: [], limit: NONE]
86
+ │ └── estimated rows: 1.00
87
+ └── TableScan(Probe)
88
+ ├── table: default.default.t1
89
+ ├── output columns: [a (#1), _row_id (#2)]
90
+ ├── read rows: 15
91
+ ├── read size: < 1 KiB
92
+ ├── partitions total: 3
93
+ ├── partitions scanned: 3
94
+ ├── pruning stats: [segments: <range pruning: 3 to 3>, blocks: <range pruning: 3 to 3>]
95
+ ├── push downs: [filters: [], limit: NONE]
96
+ └── estimated rows: 15.00
99
97
100
98
query TT
101
99
merge into t1 using t2 on t1.a < t2.a when matched then update * when not matched then insert *;
@@ -173,6 +171,15 @@ HashJoin
173
171
│ ├── output columns: [stage._$1 (#0), #_row_number]
174
172
│ ├── exchange type: Broadcast
175
173
│ └── MergeIntoAddRowNumber
174
+ │ └── TableScan
175
+ │ ├── table: default.system.stage
176
+ │ ├── output columns: [_$1 (#0)]
177
+ │ ├── read rows: 6
178
+ │ ├── read size: < 1 KiB
179
+ │ ├── partitions total: 1
180
+ │ ├── partitions scanned: 1
181
+ │ ├── push downs: [filters: [], limit: NONE]
182
+ │ └── estimated rows: 0.00
176
183
└── TableScan(Probe)
177
184
├── table: default.default.t1
178
185
├── output columns: [a (#1), _row_id (#2)]
0 commit comments