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

[flink] Procedure sorting compact a table without partitions filter. #4405

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/content/flink/procedures.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ All available procedures are listed below.
-- Use indexed argument<br/>
CALL [catalog.]sys.compact('table') <br/><br/>
CALL [catalog.]sys.compact('table', 'partitions') <br/><br/>
CALL [catalog.]sys.compact('table', 'order_strategy', 'order_by') <br/><br/>
CALL [catalog.]sys.compact('table', 'partitions', 'order_strategy', 'order_by') <br/><br/>
CALL [catalog.]sys.compact('table', 'partitions', 'order_strategy', 'order_by', 'options') <br/><br/>
CALL [catalog.]sys.compact('table', 'partitions', 'order_strategy', 'order_by', 'options', 'where') <br/><br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
* CALL sys.compact('tableId', 'pt1=A,pt2=a;pt1=B,pt2=b')
*
* -- compact a table with sorting
* CALL sys.compact('tableId', 'ORDER/ZORDER', 'col1,col2')
*
* -- compact specific partitions with sorting
* CALL sys.compact('tableId', 'partitions', 'ORDER/ZORDER', 'col1,col2', 'sink.parallelism=6')
*
* </code></pre>
Expand All @@ -61,6 +64,15 @@ public String[] call(ProcedureContext procedureContext, String tableId, String p
return call(procedureContext, tableId, partitions, "", "", "", "");
}

public String[] call(
ProcedureContext procedureContext,
String tableId,
String orderStrategy,
String orderByColumns)
throws Exception {
return call(procedureContext, tableId, "", orderStrategy, orderByColumns, "", "");
}

public String[] call(
ProcedureContext procedureContext,
String tableId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public void testCompactDatabaseAndTable() {
assertThatCode(() -> sql("CALL sys.compact('default.T')")).doesNotThrowAnyException();
assertThatCode(() -> sql("CALL sys.compact('default.T', 'pt=1')"))
.doesNotThrowAnyException();
assertThatCode(() -> sql("CALL sys.compact('default.T', '', '')"))
.doesNotThrowAnyException();
assertThatCode(() -> sql("CALL sys.compact('default.T', 'pt=1', '', '')"))
.doesNotThrowAnyException();
assertThatCode(() -> sql("CALL sys.compact('default.T', '', '', '', 'sink.parallelism=1')"))
Expand Down
Loading