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

๐ŸŒ Add LLM Translations #1711

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
@@ -1,52 +1,64 @@
Here's the documentation for the `fuse_time_travel_size` function in a professional format:

---
title: FUSE_TIME_TRAVEL_SIZE
---
import FunctionDescription from '@site/src/components/FunctionDescription';

<FunctionDescription description="ๅผ•ๅ…ฅๆˆ–ๆ›ดๆ–ฐไบŽ๏ผšv1.2.684"/>
# fuse_time_travel_size

<FunctionDescription description="Introduced or updated: v1.2.684"/>

่ฎก็ฎ—่กจ็š„ๅŽ†ๅฒๆ•ฐๆฎ๏ผˆ็”จไบŽๆ—ถ้—ดๅ›žๆบฏ๏ผ‰็š„ๅญ˜ๅ‚จๅคงๅฐใ€‚
The `fuse_time_travel_size` function calculates the storage size of historical data (for Time Travel) for tables in Databend.

## ่ฏญๆณ•
## Syntax

```sql
-- ่ฎก็ฎ—ๆ‰€ๆœ‰ๆ•ฐๆฎๅบ“ไธญๆ‰€ๆœ‰่กจ็š„ๅŽ†ๅฒๆ•ฐๆฎๅคงๅฐ
SELECT ...
FROM fuse_time_travel_size();
-- Calculate historical data size for all tables in all databases
SELECT * FROM fuse_time_travel_size();

-- ่ฎก็ฎ—ๆŒ‡ๅฎšๆ•ฐๆฎๅบ“ไธญๆ‰€ๆœ‰่กจ็š„ๅŽ†ๅฒๆ•ฐๆฎๅคงๅฐ
SELECT ...
FROM fuse_time_travel_size('<database_name>');
-- Calculate historical data size for all tables in a specified database
SELECT * FROM fuse_time_travel_size('<database_name>');

-- ่ฎก็ฎ—ๆŒ‡ๅฎšๆ•ฐๆฎๅบ“ไธญๆŒ‡ๅฎš่กจ็š„ๅŽ†ๅฒๆ•ฐๆฎๅคงๅฐ
SELECT ...
FROM fuse_time_travel_size('<database_name>', '<table_name>'));
-- Calculate historical data size for a specific table
SELECT * FROM fuse_time_travel_size('<database_name>', '<table_name>');
```

## ่พ“ๅ‡บ
## Output Columns

่ฏฅๅ‡ฝๆ•ฐ่ฟ”ๅ›žไธ€ไธชๅŒ…ๅซไปฅไธ‹ๅˆ—็š„็ป“ๆžœ้›†๏ผš
| Column Name | Data Type | Description |
|-------------|-----------|-------------|
| `database_name` | String | Name of the database containing the table |
| `table_name` | String | Name of the table |
| `is_dropped` | Boolean | `true` if the table has been dropped, `false` otherwise |
| `time_travel_size` | UInt64 | Total size of historical data (Time Travel) in bytes |
| `latest_snapshot_size` | UInt64 | Size of the latest table snapshot in bytes |
| `data_retention_period_in_hours` | Nullable(UInt64) | Retention period for Time Travel data in hours (NULL means using default policy) |
| `error` | Nullable(String) | Error message if any occurred during calculation |

| ๅˆ—ๅ | ๆ่ฟฐ |
|----------------------------------|-------------------------------------------------------------------------------------------------------|
| `database_name` | ่กจๆ‰€ๅœจ็š„ๆ•ฐๆฎๅบ“ๅ็งฐใ€‚ |
| `table_name` | ่กจ็š„ๅ็งฐใ€‚ |
| `is_dropped` | ่กจ็คบ่กจๆ˜ฏๅฆๅทฒ่ขซๅˆ ้™ค๏ผˆ`true` ่กจ็คบๅทฒๅˆ ้™ค๏ผŒ`false` ่กจ็คบๆœชๅˆ ้™ค๏ผ‰ใ€‚ |
| `time_travel_size` | ่กจ็š„ๅŽ†ๅฒๆ•ฐๆฎ๏ผˆ็”จไบŽๆ—ถ้—ดๅ›žๆบฏ๏ผ‰็š„ๆ€ปๅญ˜ๅ‚จๅคงๅฐ๏ผŒๅ•ไฝไธบๅญ—่Š‚ใ€‚ |
| `latest_snapshot_size` | ่กจ็š„ๆœ€ๆ–ฐๅฟซ็…ง็š„ๅญ˜ๅ‚จๅคงๅฐ๏ผŒๅ•ไฝไธบๅญ—่Š‚ใ€‚ |
| `data_retention_period_in_hours` | ๆ—ถ้—ดๅ›žๆบฏๆ•ฐๆฎ็š„ไฟ็•™ๆ—ถ้—ด๏ผŒๅ•ไฝไธบๅฐๆ—ถ๏ผˆ`NULL` ่กจ็คบไฝฟ็”จ้ป˜่ฎคไฟ็•™็ญ–็•ฅ๏ผ‰ใ€‚ |
| `error` | ่Žทๅ–ๅญ˜ๅ‚จๅคงๅฐๆ—ถ้‡ๅˆฐ็š„ไปปไฝ•้”™่ฏฏ๏ผˆๅฆ‚ๆžœๆฒกๆœ‰้”™่ฏฏๅ‘็”Ÿ๏ผŒๅˆ™ไธบ `NULL`๏ผ‰ใ€‚ |
## Examples

### Calculate Time Travel size for all tables in the 'default' database

```sql
SELECT * FROM fuse_time_travel_size('default');
```

## ็คบไพ‹
Result:
```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ database_name โ”‚ table_name โ”‚ is_dropped โ”‚ time_travel_size โ”‚ latest_snapshot_size โ”‚ data_retention_period_in_hours โ”‚ error โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ default โ”‚ books โ”‚ true โ”‚ 2810 โ”‚ 1490 โ”‚ NULL โ”‚ NULL โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

ไปฅไธ‹็คบไพ‹่ฎก็ฎ— `default` ๆ•ฐๆฎๅบ“ไธญๆ‰€ๆœ‰่กจ็š„ๅŽ†ๅฒๆ•ฐๆฎ๏ผš
### Calculate Time Travel size for a specific table

```sql
SELECT * FROM fuse_time_travel_size('default')

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ database_name โ”‚ table_name โ”‚ is_dropped โ”‚ time_travel_size โ”‚ latest_snapshot_size โ”‚ data_retention_period_in_hours โ”‚ error โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ default โ”‚ books โ”‚ true โ”‚ 2810 โ”‚ 1490 โ”‚ NULL โ”‚ NULL โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```
SELECT * FROM fuse_time_travel_size('default', 'books');
```

## Notes

- The function requires appropriate privileges to access table metadata
- The `time_travel_size` includes all historical versions of the table data
- A NULL `data_retention_period_in_hours` indicates the table inherits the system default retention policy
- Dropped tables will still appear in results with `is_dropped` set to true