Skip to content

Commit

Permalink
[flink] Procedure sorting compact a table without partitions filter. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
LinMingQiang authored Oct 30, 2024
1 parent 74634b9 commit 1488e1c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
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

0 comments on commit 1488e1c

Please sign in to comment.