Skip to content

Commit f655273

Browse files
authored
Fix table TTL example SQL (#1192)
1 parent 6a303ce commit f655273

4 files changed

Lines changed: 24 additions & 24 deletions

File tree

src/UserGuide/Master/Table/Basic-Concept/TTL-Delete-Data_apache.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ If TTL is specified when creating a table using SQL, the table’s TTL takes pre
4747
Example 1: Setting TTL during table creation:
4848

4949
```SQL
50-
CREATE TABLE test3 ("site" string id, "temperature" int32) with (TTL=3600);
50+
CREATE TABLE test3 ("site" string, "temperature" int32) with (TTL=3600);
5151
```
5252

5353
Example 2: Changing TTL for an existing table:
@@ -59,8 +59,8 @@ ALTER TABLE tableB SET PROPERTIES TTL=3600;
5959
**Example 3:** If TTL is not specified or set to the default value, it will inherit the database's TTL. By default, the database TTL is `'INF'` (infinite):
6060

6161
```SQL
62-
CREATE TABLE test3 ("site" string id, "temperature" int32) with (TTL=DEFAULT);
63-
CREATE TABLE test3 ("site" string id, "temperature" int32);
62+
CREATE TABLE test3 ("site" string, "temperature" int32) with (TTL=DEFAULT);
63+
CREATE TABLE test3 ("site" string, "temperature" int32);
6464
ALTER TABLE tableB set properties TTL=DEFAULT;
6565
```
6666

@@ -73,23 +73,23 @@ Example 4: A database with TTL=3600000 creates tables inheriting this TTL:
7373
```SQL
7474
CREATE DATABASE db WITH (ttl=3600000);
7575
use db;
76-
CREATE TABLE test3 ("site" string id, "temperature" int32);
76+
CREATE TABLE test3 ("site" string, "temperature" int32);
7777
```
7878

7979
Example 5: A database without a TTL setting creates tables without TTL:
8080

8181
```SQL
8282
CREATE DATABASE db;
8383
use db;
84-
CREATE TABLE test3 ("site" string id, "temperature" int32);
84+
CREATE TABLE test3 ("site" string, "temperature" int32);
8585
```
8686

8787
Example 6: Setting a table with no TTL explicitly (TTL=INF) in a database with a configured TTL:
8888

8989
```SQL
9090
CREATE DATABASE db WITH (ttl=3600000);
9191
use db;
92-
CREATE TABLE test3 ("site" string id, "temperature" int32) with (ttl='INF');
92+
CREATE TABLE test3 ("site" string, "temperature" int32) with (ttl='INF');
9393
```
9494

9595
## 3. Remove TTL

src/UserGuide/latest-Table/Basic-Concept/TTL-Delete-Data_apache.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ If TTL is specified when creating a table using SQL, the table’s TTL takes pre
4747
Example 1: Setting TTL during table creation:
4848

4949
```SQL
50-
CREATE TABLE test3 ("site" string id, "temperature" int32) with (TTL=3600);
50+
CREATE TABLE test3 ("site" string, "temperature" int32) with (TTL=3600);
5151
```
5252

5353
Example 2: Changing TTL for an existing table:
@@ -59,8 +59,8 @@ ALTER TABLE tableB SET PROPERTIES TTL=3600;
5959
**Example 3:** If TTL is not specified or set to the default value, it will inherit the database's TTL. By default, the database TTL is `'INF'` (infinite):
6060

6161
```SQL
62-
CREATE TABLE test3 ("site" string id, "temperature" int32) with (TTL=DEFAULT);
63-
CREATE TABLE test3 ("site" string id, "temperature" int32);
62+
CREATE TABLE test3 ("site" string, "temperature" int32) with (TTL=DEFAULT);
63+
CREATE TABLE test3 ("site" string, "temperature" int32);
6464
ALTER TABLE tableB set properties TTL=DEFAULT;
6565
```
6666

@@ -73,23 +73,23 @@ Example 4: A database with TTL=3600000 creates tables inheriting this TTL:
7373
```SQL
7474
CREATE DATABASE db WITH (ttl=3600000);
7575
use db;
76-
CREATE TABLE test3 ("site" string id, "temperature" int32);
76+
CREATE TABLE test3 ("site" string, "temperature" int32);
7777
```
7878

7979
Example 5: A database without a TTL setting creates tables without TTL:
8080

8181
```SQL
8282
CREATE DATABASE db;
8383
use db;
84-
CREATE TABLE test3 ("site" string id, "temperature" int32);
84+
CREATE TABLE test3 ("site" string, "temperature" int32);
8585
```
8686

8787
Example 6: Setting a table with no TTL explicitly (TTL=INF) in a database with a configured TTL:
8888

8989
```SQL
9090
CREATE DATABASE db WITH (ttl=3600000);
9191
use db;
92-
CREATE TABLE test3 ("site" string id, "temperature" int32) with (ttl='INF');
92+
CREATE TABLE test3 ("site" string, "temperature" int32) with (ttl='INF');
9393
```
9494

9595
## 3. Remove TTL

src/zh/UserGuide/Master/Table/Basic-Concept/TTL-Delete-Data_apache.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ IoTDB支持对表(table)级别设置数据保留时间(TTL),允许系
4545
示例1:创建表时设置 TTL
4646

4747
```SQL
48-
CREATE TABLE test3 ("场站" string id, "温度" int32) with (TTL=3600);
48+
CREATE TABLE test3 ("场站" string, "温度" int32) with (TTL=3600);
4949
```
5050

5151
示例2:更改表语句设置TTL:
@@ -57,8 +57,8 @@ ALTER TABLE tableB SET PROPERTIES TTL=3600;
5757
示例3:不指定TTL或设为默认值,它将与数据库的TTL相同,默认情况下是'INF'(无穷大):
5858

5959
```SQL
60-
CREATE TABLE test3 ("场站" string id, "温度" int32) with (TTL=DEFAULT);
61-
CREATE TABLE test3 ("场站" string id, "温度" int32);
60+
CREATE TABLE test3 ("场站" string, "温度" int32) with (TTL=DEFAULT);
61+
CREATE TABLE test3 ("场站" string, "温度" int32);
6262
ALTER TABLE tableB set properties TTL=DEFAULT;
6363
```
6464

@@ -71,23 +71,23 @@ ALTER TABLE tableB set properties TTL=DEFAULT;
7171
```SQL
7272
CREATE DATABASE db WITH (ttl=3600000);
7373
use db;
74-
CREATE TABLE test3 ("场站" string id, "温度" int32);
74+
CREATE TABLE test3 ("场站" string, "温度" int32);
7575
```
7676

7777
示例5:数据库不设置ttl,将生成一个没有ttl的表:
7878

7979
```SQL
8080
CREATE DATABASE db;
8181
use db;
82-
CREATE TABLE test3 ("场站" string id, "温度" int32);
82+
CREATE TABLE test3 ("场站" string, "温度" int32);
8383
```
8484

8585
示例6:数据库设置了ttl,但想显式设置没有TTL的表,可以将TTL设置为'INF':
8686

8787
```SQL
8888
CREATE DATABASE db WITH (ttl=3600000);
8989
use db;
90-
CREATE TABLE test3 ("场站" string id, "温度" int32) with (ttl='INF');
90+
CREATE TABLE test3 ("场站" string, "温度" int32) with (ttl='INF');
9191
```
9292

9393
## 3. 取消 TTL

src/zh/UserGuide/latest-Table/Basic-Concept/TTL-Delete-Data_apache.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ IoTDB支持对表(table)级别设置数据保留时间(TTL),允许系
4545
示例1:创建表时设置 TTL
4646

4747
```SQL
48-
CREATE TABLE test3 ("场站" string id, "温度" int32) with (TTL=3600);
48+
CREATE TABLE test3 ("场站" string, "温度" int32) with (TTL=3600);
4949
```
5050

5151
示例2:更改表语句设置TTL:
@@ -57,8 +57,8 @@ ALTER TABLE tableB SET PROPERTIES TTL=3600;
5757
示例3:不指定TTL或设为默认值,它将与数据库的TTL相同,默认情况下是'INF'(无穷大):
5858

5959
```SQL
60-
CREATE TABLE test3 ("场站" string id, "温度" int32) with (TTL=DEFAULT);
61-
CREATE TABLE test3 ("场站" string id, "温度" int32);
60+
CREATE TABLE test3 ("场站" string, "温度" int32) with (TTL=DEFAULT);
61+
CREATE TABLE test3 ("场站" string, "温度" int32);
6262
ALTER TABLE tableB set properties TTL=DEFAULT;
6363
```
6464

@@ -71,23 +71,23 @@ ALTER TABLE tableB set properties TTL=DEFAULT;
7171
```SQL
7272
CREATE DATABASE db WITH (ttl=3600000);
7373
use db;
74-
CREATE TABLE test3 ("场站" string id, "温度" int32);
74+
CREATE TABLE test3 ("场站" string, "温度" int32);
7575
```
7676

7777
示例5:数据库不设置ttl,将生成一个没有ttl的表:
7878

7979
```SQL
8080
CREATE DATABASE db;
8181
use db;
82-
CREATE TABLE test3 ("场站" string id, "温度" int32);
82+
CREATE TABLE test3 ("场站" string, "温度" int32);
8383
```
8484

8585
示例6:数据库设置了ttl,但想显式设置没有TTL的表,可以将TTL设置为'INF':
8686

8787
```SQL
8888
CREATE DATABASE db WITH (ttl=3600000);
8989
use db;
90-
CREATE TABLE test3 ("场站" string id, "温度" int32) with (ttl='INF');
90+
CREATE TABLE test3 ("场站" string, "温度" int32) with (ttl='INF');
9191
```
9292

9393
## 3. 取消 TTL

0 commit comments

Comments
 (0)