Commit 64eb931
authored
fix shuffle join for recursive cte (#22055)
### **User description**
## What type of PR is this?
- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring
## Which issue(s) this PR fixes:
issue #matrixorigin/MO-Cloud#5764
## What this PR does / why we need it:
fix shuffle join for recursive cte
___
### **PR Type**
Bug fix
___
### **Description**
- Fix shuffle join handling for recursive CTE operations
- Add proper batch termination check for Last() batches
- Add test case for recursive CTE with large dataset
___
### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>shuffle.go</strong><dd><code>Add Last batch handling in
shuffle</code>
</dd></summary>
<hr>
pkg/sql/colexec/shuffle/shuffle.go
<li>Remove empty line import formatting<br> <li> Add condition to handle
<code>bat.Last()</code> case by returning result directly<br> <li>
Prevent processing of last batches in shuffle operations
</details>
</td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/22055/files#diff-dd874410fa94e53ef1b1a5d4d599903dd307785afc25ad7d334874218f8cf73f">+2/-1</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Tests</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>recursive_cte.result</strong><dd><code>Update test
results for recursive CTE</code>
</dd></summary>
<hr>
test/distributed/cases/recursive_cte/recursive_cte.result
<li>Add newline at end of file<br> <li> Add test results for new
recursive CTE test case with large dataset<br> <li> Show expected count
result of 0 for the new test
</details>
</td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/22055/files#diff-3e8dee7ccef2614ba5e9bc5d56dd46d2386b1144c89cdffc45ac3479bb3dcd86">+8/-1</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>recursive_cte.sql</strong><dd><code>Add recursive CTE
test case</code>
</dd></summary>
<hr>
test/distributed/cases/recursive_cte/recursive_cte.sql
<li>Add new test case with table creation and large dataset
insertion<br> <li> Add recursive CTE query with specific ID filtering
and tenant <br>conditions<br> <li> Add table cleanup statements
</details>
</td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/22055/files#diff-9c73dbc8fa464a2a39025aec6058d797dabfb60f413e80d49e0ba667cda50bc2">+5/-0</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
___
> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about Qodo Merge
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>1 parent c55a2c9 commit 64eb931
File tree
3 files changed
+15
-2
lines changed- pkg/sql/colexec/shuffle
- test/distributed/cases/recursive_cte
3 files changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
90 | 89 | | |
91 | 90 | | |
92 | 91 | | |
| 92 | + | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments