From c177bfb60bae091a7f70261afe25d6e14a23f13a Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Sun, 28 Apr 2024 01:10:50 +0000 Subject: [PATCH 1/4] Add configurable storage compression documentation --- docs/en/12-taos-sql/03-table.md | 5 ++++- docs/zh/12-taos-sql/03-table.md | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/en/12-taos-sql/03-table.md b/docs/en/12-taos-sql/03-table.md index a10abd28a5..fca953584e 100644 --- a/docs/en/12-taos-sql/03-table.md +++ b/docs/en/12-taos-sql/03-table.md @@ -22,7 +22,7 @@ create_subtable_clause: { } create_definition: - col_name column_definition + col_name column_type [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] column_definition: type_name [comment 'string_value'] @@ -50,6 +50,7 @@ table_option: { Only ASCII visible characters can be used with escape character. **Parameter description** + 1. COMMENT: specifies comments for the table. This parameter can be used with supertables, standard tables, and subtables. 2. SMA: specifies functions on which to enable small materialized aggregates (SMA). SMA is user-defined precomputation of aggregates based on data blocks. Enter one of the following values: max, min, or sum This parameter can be used with supertables and standard tables. 3. TTL: specifies the time to live (TTL) for the table. If TTL is specified when creatinga table, after the time period for which the table has been existing is over TTL, TDengine will automatically delete the table. Please be noted that the system may not delete the table at the exact moment that the TTL expires but guarantee there is such a system and finally the table will be deleted. The unit of TTL is in days. The default value is 0, i.e. never expire. @@ -103,6 +104,7 @@ alter_table_option: { **More explanations** You can perform the following modifications on existing tables: + 1. ADD COLUMN: adds a column to the supertable. 2. DROP COLUMN: deletes a column from the supertable. 3. MODIFY COLUMN: changes the length of the data type specified for the column. Note that you can only specify a length greater than the current length. @@ -152,6 +154,7 @@ alter_table_option: { ``` **More explanations** + 1. Only the value of a tag can be modified directly. For all other modifications, you must modify the supertable from which the subtable was created. ### Change Tag Value Of Sub Table diff --git a/docs/zh/12-taos-sql/03-table.md b/docs/zh/12-taos-sql/03-table.md index 7e20f20574..0205145904 100644 --- a/docs/zh/12-taos-sql/03-table.md +++ b/docs/zh/12-taos-sql/03-table.md @@ -23,7 +23,7 @@ create_subtable_clause: { } create_definition: - col_name column_type + col_name column_type [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] table_options: table_option ... From 2d1c07546b988132a376001b260f9d75b9d423e2 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Sun, 28 Apr 2024 02:52:37 +0000 Subject: [PATCH 2/4] Add configurable storage compression documentation --- docs/en/12-taos-sql/03-table.md | 2 +- docs/zh/12-taos-sql/03-table.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/12-taos-sql/03-table.md b/docs/en/12-taos-sql/03-table.md index fca953584e..1419cddcf8 100644 --- a/docs/en/12-taos-sql/03-table.md +++ b/docs/en/12-taos-sql/03-table.md @@ -22,7 +22,7 @@ create_subtable_clause: { } create_definition: - col_name column_type [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] + col_name column_type [PRIMARY_KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] column_definition: type_name [comment 'string_value'] diff --git a/docs/zh/12-taos-sql/03-table.md b/docs/zh/12-taos-sql/03-table.md index 0205145904..7514b14fcd 100644 --- a/docs/zh/12-taos-sql/03-table.md +++ b/docs/zh/12-taos-sql/03-table.md @@ -23,7 +23,7 @@ create_subtable_clause: { } create_definition: - col_name column_type [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] + col_name column_type [PRIMARY_KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] table_options: table_option ... From 23599809d79a15b5696b5fe3ddcb58bc9c4eec05 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Sun, 28 Apr 2024 03:08:13 +0000 Subject: [PATCH 3/4] Add configurable storage compression documentation --- docs/en/12-taos-sql/03-table.md | 2 +- docs/zh/12-taos-sql/03-table.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/12-taos-sql/03-table.md b/docs/en/12-taos-sql/03-table.md index 1419cddcf8..c35c7efa89 100644 --- a/docs/en/12-taos-sql/03-table.md +++ b/docs/en/12-taos-sql/03-table.md @@ -22,7 +22,7 @@ create_subtable_clause: { } create_definition: - col_name column_type [PRIMARY_KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] + col_name column_type [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] column_definition: type_name [comment 'string_value'] diff --git a/docs/zh/12-taos-sql/03-table.md b/docs/zh/12-taos-sql/03-table.md index 7514b14fcd..71500a78e4 100644 --- a/docs/zh/12-taos-sql/03-table.md +++ b/docs/zh/12-taos-sql/03-table.md @@ -23,7 +23,7 @@ create_subtable_clause: { } create_definition: - col_name column_type [PRIMARY_KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] + col_name column_type [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] table_options: table_option ... From 037b394bd64261bd599201dca47dab487b7771da Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Sun, 28 Apr 2024 08:09:44 +0000 Subject: [PATCH 4/4] Refactor table creation code --- docs/en/12-taos-sql/03-table.md | 4 ++-- docs/zh/12-taos-sql/03-table.md | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/en/12-taos-sql/03-table.md b/docs/en/12-taos-sql/03-table.md index c94e536cf6..ca22a6ace7 100644 --- a/docs/en/12-taos-sql/03-table.md +++ b/docs/en/12-taos-sql/03-table.md @@ -22,10 +22,10 @@ create_subtable_clause: { } create_definition: - col_name column_type [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] + col_name column_definition column_definition: - type_name [comment 'string_value'] [PRIMARY KEY] + type_name [comment 'string_value'] [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] table_options: table_option ... diff --git a/docs/zh/12-taos-sql/03-table.md b/docs/zh/12-taos-sql/03-table.md index a6df940133..773ce75430 100644 --- a/docs/zh/12-taos-sql/03-table.md +++ b/docs/zh/12-taos-sql/03-table.md @@ -23,7 +23,10 @@ create_subtable_clause: { } create_definition: - col_name column_type [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] + col_name column_definition + +column_definition: + type_name [comment 'string_value'] [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] table_options: table_option ...