-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Enhancement] Append LIST partition info when list table partitions by rest api. #53382
[Enhancement] Append LIST partition info when list table partitions by rest api. #53382
Conversation
69b386e
to
ef6b979
Compare
…y rest api. Signed-off-by: plotor <zhenchao.wang@hotmail.com>
ef6b979
to
e3726b0
Compare
|
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 33 / 41 (80.49%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
fe/fe-core/src/main/java/com/starrocks/http/rest/TableQueryPlanAction.java
Show resolved
Hide resolved
how about the pagination, is it taken care in the rest api ? @plotor |
@kevincai The reason for introducing pagination is that some tables may have too many partitions, which may cause the API response time to be longer or unavailable. As described in #41938, there are 4 control params for pagination (which borrowed from the traditional Java Web project API design):
Users can obtain all partitions of the table in the following way: int pageNum = 0;
while (true) {
PagedResult<TablePartition> pagedResult =
listTablePartitions(catalog, database, table, temporary, pageNum, pageSize);
partitions.addAll(pagedResult.getItems());
// Loop until the page parameter reaches the value in the request response.
if (++pageNum >= pagedResult.getPages()) {
break;
}
} And we will provide REST API SDK in subsequent PRs latter, which will simplify the call of it. |
Why I'm doing:
You can learn about the background from PR #52682.
What I'm doing:
This PR is a supplement to #41938, and append LIST partition info when list table's partitions by RESTful API. For example, for the following LIST partition table:
The
/api/v2/catalogs/{catalog}/databases/{db}/tables/{table}/partition
API will return the LIST partition information through theinKeys
field:What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: