forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[improvement](http) add show_table_data http api (apache#28380)
In some cases, users need to get the data size of single replica of a table, and evaluate certain actions based on this, such as estimating the precise backup size. Signed-off-by: nextdreamblue <zxw520blue1@163.com>
- Loading branch information
1 parent
d495dde
commit 51638ad
Showing
5 changed files
with
402 additions
and
0 deletions.
There are no files selected for viewing
163 changes: 163 additions & 0 deletions
163
docs/en/docs/admin-manual/http-actions/fe/show-table-data-action.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
--- | ||
{ | ||
"title": "Show Table Data Action", | ||
"language": "en" | ||
} | ||
--- | ||
|
||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
|
||
# Show Table Data Action | ||
|
||
## Request | ||
|
||
`GET /api/show_table_data` | ||
|
||
## Description | ||
|
||
Used to get the data size of all tables in all databases under all internal catalog, or the data size of the specified database or table. Unit byte. | ||
|
||
## Path parameters | ||
|
||
NULL | ||
|
||
## Query parameters | ||
|
||
* `db` | ||
|
||
Optional. If specified, get the data size of the tables under the specified database. | ||
|
||
* `table` | ||
|
||
Optional. If specified, get the data size of the specified table. | ||
|
||
* `single_replica` | ||
|
||
Optional. If specified, get the data size of the single replica of the table. | ||
|
||
## Request body | ||
|
||
NULL | ||
|
||
## Response | ||
|
||
1. The data size of all tables in the specified database. | ||
|
||
``` | ||
{ | ||
"msg":"success", | ||
"code":0, | ||
"data":{ | ||
"tpch":{ | ||
"partsupp":9024548244, | ||
"revenue0":0, | ||
"customer":1906421482 | ||
} | ||
}, | ||
"count":0 | ||
} | ||
``` | ||
2. The data size of the specified table of the specified db. | ||
``` | ||
{ | ||
"msg":"success", | ||
"code":0, | ||
"data":{ | ||
"tpch":{ | ||
"partsupp":9024548244 | ||
} | ||
}, | ||
"count":0 | ||
} | ||
``` | ||
3. The data size of the single replica of the specified table of the specified db. | ||
``` | ||
{ | ||
"msg":"success", | ||
"code":0, | ||
"data":{ | ||
"tpch":{ | ||
"partsupp":3008182748 | ||
} | ||
}, | ||
"count":0 | ||
} | ||
``` | ||
## Examples | ||
1. The data size of all tables in the specified database. | ||
``` | ||
GET /api/show_table_data?db=tpch | ||
Response: | ||
{ | ||
"msg":"success", | ||
"code":0, | ||
"data":{ | ||
"tpch":{ | ||
"partsupp":9024548244, | ||
"revenue0":0, | ||
"customer":1906421482 | ||
} | ||
}, | ||
"count":0 | ||
} | ||
``` | ||
2. The data size of the specified table of the specified db. | ||
``` | ||
GET /api/show_table_data?db=tpch&table=partsupp | ||
Response: | ||
{ | ||
"msg":"success", | ||
"code":0, | ||
"data":{ | ||
"tpch":{ | ||
"partsupp":9024548244 | ||
} | ||
}, | ||
"count":0 | ||
} | ||
``` | ||
3. The data size of the single replica of the specified table of the specified db. | ||
``` | ||
GET /api/show_table_data?db=tpch&table=partsupp&single_replica=true | ||
Response: | ||
{ | ||
"msg":"success", | ||
"code":0, | ||
"data":{ | ||
"tpch":{ | ||
"partsupp":3008182748 | ||
} | ||
}, | ||
"count":0 | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
163 changes: 163 additions & 0 deletions
163
docs/zh-CN/docs/admin-manual/http-actions/fe/show-table-data-action.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
--- | ||
{ | ||
"title": "Show Table Data Action", | ||
"language": "zh-CN" | ||
} | ||
--- | ||
|
||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
|
||
# Show Table Data Action | ||
|
||
## Request | ||
|
||
`GET /api/show_table_data` | ||
|
||
## Description | ||
|
||
用于获取所有internal源下所有数据库所有表的数据量,或者指定数据库或指定表的数据量。单位字节。 | ||
|
||
## Path parameters | ||
|
||
无 | ||
|
||
## Query parameters | ||
|
||
* `db` | ||
|
||
可选。如果指定,则获取指定数据库下表的数据量。 | ||
|
||
* `table` | ||
|
||
可选。如果指定,则获取指定表的数据量。 | ||
|
||
* `single_replica` | ||
|
||
可选。如果指定,则获取表单副本所占用的数据量。 | ||
|
||
## Request body | ||
|
||
无 | ||
|
||
## Response | ||
|
||
1. 指定数据库所有表的数据量。 | ||
|
||
``` | ||
{ | ||
"msg":"success", | ||
"code":0, | ||
"data":{ | ||
"tpch":{ | ||
"partsupp":9024548244, | ||
"revenue0":0, | ||
"customer":1906421482 | ||
} | ||
}, | ||
"count":0 | ||
} | ||
``` | ||
2. 指定数据库指定表的数据量。 | ||
``` | ||
{ | ||
"msg":"success", | ||
"code":0, | ||
"data":{ | ||
"tpch":{ | ||
"partsupp":9024548244 | ||
} | ||
}, | ||
"count":0 | ||
} | ||
``` | ||
3. 指定数据库指定表单副本的数据量。 | ||
``` | ||
{ | ||
"msg":"success", | ||
"code":0, | ||
"data":{ | ||
"tpch":{ | ||
"partsupp":3008182748 | ||
} | ||
}, | ||
"count":0 | ||
} | ||
``` | ||
## Examples | ||
1. 获取指定数据库的数据量 | ||
``` | ||
GET /api/show_table_data?db=tpch | ||
Response: | ||
{ | ||
"msg":"success", | ||
"code":0, | ||
"data":{ | ||
"tpch":{ | ||
"partsupp":9024548244, | ||
"revenue0":0, | ||
"customer":1906421482 | ||
} | ||
}, | ||
"count":0 | ||
} | ||
``` | ||
2. 指定数据库指定表的数据量。 | ||
``` | ||
GET /api/show_table_data?db=tpch&table=partsupp | ||
Response: | ||
{ | ||
"msg":"success", | ||
"code":0, | ||
"data":{ | ||
"tpch":{ | ||
"partsupp":9024548244 | ||
} | ||
}, | ||
"count":0 | ||
} | ||
``` | ||
3. 指定数据库指定表单副本的数据量。 | ||
``` | ||
GET /api/show_table_data?db=tpch&table=partsupp&single_replica=true | ||
Response: | ||
{ | ||
"msg":"success", | ||
"code":0, | ||
"data":{ | ||
"tpch":{ | ||
"partsupp":3008182748 | ||
} | ||
}, | ||
"count":0 | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.