Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support dynamic overwrite for insert overwrite #51615

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

meegoo
Copy link
Contributor

@meegoo meegoo commented Oct 8, 2024

Why I'm doing:

What I'm doing:

mysql> create table t(k int, v int) partition by (k);
Query OK, 0 rows affected (0.03 sec)

mysql> select * from t;
+------+------+
| k    | v    |
+------+------+
|    1 |    1 |
|    2 |    1 |
+------+------+
2 rows in set (0.04 sec)

mysql> insert overwrite t values(2,2),(3,1);
Query OK, 2 rows affected (0.67 sec)
{'label':'insert_2a8326fc-84e5-11ef-8832-00163e077b59', 'status':'VISIBLE', 'txnId':'16018'}

mysql> select * from t;
+------+------+
| k    | v    |
+------+------+
|    3 |    1 |
|    2 |    2 |
+------+------+
2 rows in set (0.32 sec)

mysql> set dynamic_overwrite=true;
Query OK, 0 rows affected (0.00 sec)

mysql> insert overwrite t values(4,1),(3,2);
Query OK, 2 rows affected (0.19 sec)
{'label':'insert_4f641217-84e5-11ef-8832-00163e077b59', 'status':'VISIBLE', 'txnId':'16021'}

mysql> select * from t;
+------+------+
| k    | v    |
+------+------+
|    2 |    2 |
|    4 |    1 |
|    3 |    2 |
+------+------+
3 rows in set (0.08 sec)

Fixes #51619

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

wangruin
wangruin previously approved these changes Nov 8, 2024
Seaven
Seaven previously approved these changes Nov 8, 2024
Copy link

sonarcloud bot commented Nov 8, 2024

Copy link

github-actions bot commented Nov 8, 2024

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

github-actions bot commented Nov 8, 2024

[FE Incremental Coverage Report]

pass : 97 / 115 (84.35%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/qe/SessionVariable.java 2 4 50.00% [2843, 2844]
🔵 com/starrocks/load/InsertOverwriteJobRunner.java 16 31 51.61% [264, 432, 433, 434, 435, 437, 438, 439, 440, 441, 442, 443, 444, 446, 517]
🔵 com/starrocks/sql/analyzer/AnalyzerUtils.java 8 9 88.89% [1347]
🔵 com/starrocks/service/FrontendServiceImpl.java 7 7 100.00% []
🔵 com/starrocks/catalog/OlapTable.java 17 17 100.00% []
🔵 com/starrocks/sql/analyzer/InsertAnalyzer.java 9 9 100.00% []
🔵 com/starrocks/planner/OlapTableSink.java 8 8 100.00% []
🔵 com/starrocks/sql/ast/InsertStmt.java 4 4 100.00% []
🔵 com/starrocks/load/InsertOverwriteJob.java 8 8 100.00% []
🔵 com/starrocks/qe/StmtExecutor.java 4 4 100.00% []
🔵 com/starrocks/transaction/TransactionState.java 3 3 100.00% []
🔵 com/starrocks/persist/CreateInsertOverwriteJobLog.java 5 5 100.00% []
🔵 com/starrocks/sql/InsertPlanner.java 5 5 100.00% []
🔵 com/starrocks/load/InsertOverwriteJobMgr.java 1 1 100.00% []

Copy link

github-actions bot commented Nov 8, 2024

[BE Incremental Coverage Report]

pass : 5 / 5 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/exec/tablet_sink.cpp 5 5 100.00% []

@meegoo meegoo merged commit f73f983 into StarRocks:main Nov 8, 2024
56 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support dynamic overwrite
6 participants