Skip to content
Open
Show file tree
Hide file tree
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
Expand Up @@ -47,7 +47,7 @@ If TTL is specified when creating a table using SQL, the table’s TTL takes pre
Example 1: Setting TTL during table creation:

```SQL
CREATE TABLE test3 ("site" string id, "temperature" int32) with (TTL=3600);
CREATE TABLE test3 ("site" string, "temperature" int32) with (TTL=3600);
```

Example 2: Changing TTL for an existing table:
Expand All @@ -59,8 +59,8 @@ ALTER TABLE tableB SET PROPERTIES TTL=3600;
**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):

```SQL
CREATE TABLE test3 ("site" string id, "temperature" int32) with (TTL=DEFAULT);
CREATE TABLE test3 ("site" string id, "temperature" int32);
CREATE TABLE test3 ("site" string, "temperature" int32) with (TTL=DEFAULT);
CREATE TABLE test3 ("site" string, "temperature" int32);
ALTER TABLE tableB set properties TTL=DEFAULT;
```

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

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

```SQL
CREATE DATABASE db;
use db;
CREATE TABLE test3 ("site" string id, "temperature" int32);
CREATE TABLE test3 ("site" string, "temperature" int32);
```

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

```SQL
CREATE DATABASE db WITH (ttl=3600000);
use db;
CREATE TABLE test3 ("site" string id, "temperature" int32) with (ttl='INF');
CREATE TABLE test3 ("site" string, "temperature" int32) with (ttl='INF');
```

## 3. Remove TTL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ If TTL is specified when creating a table using SQL, the table’s TTL takes pre
Example 1: Setting TTL during table creation:

```SQL
CREATE TABLE test3 ("site" string id, "temperature" int32) with (TTL=3600);
CREATE TABLE test3 ("site" string, "temperature" int32) with (TTL=3600);
```

Example 2: Changing TTL for an existing table:
Expand All @@ -59,8 +59,8 @@ ALTER TABLE tableB SET PROPERTIES TTL=3600;
**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):

```SQL
CREATE TABLE test3 ("site" string id, "temperature" int32) with (TTL=DEFAULT);
CREATE TABLE test3 ("site" string id, "temperature" int32);
CREATE TABLE test3 ("site" string, "temperature" int32) with (TTL=DEFAULT);
CREATE TABLE test3 ("site" string, "temperature" int32);
ALTER TABLE tableB set properties TTL=DEFAULT;
```

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

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

```SQL
CREATE DATABASE db;
use db;
CREATE TABLE test3 ("site" string id, "temperature" int32);
CREATE TABLE test3 ("site" string, "temperature" int32);
```

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

```SQL
CREATE DATABASE db WITH (ttl=3600000);
use db;
CREATE TABLE test3 ("site" string id, "temperature" int32) with (ttl='INF');
CREATE TABLE test3 ("site" string, "temperature" int32) with (ttl='INF');
```

## 3. Remove TTL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ IoTDB支持对表(table)级别设置数据保留时间(TTL),允许系
示例1:创建表时设置 TTL

```SQL
CREATE TABLE test3 ("场站" string id, "温度" int32) with (TTL=3600);
CREATE TABLE test3 ("场站" string, "温度" int32) with (TTL=3600);
```

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

```SQL
CREATE TABLE test3 ("场站" string id, "温度" int32) with (TTL=DEFAULT);
CREATE TABLE test3 ("场站" string id, "温度" int32);
CREATE TABLE test3 ("场站" string, "温度" int32) with (TTL=DEFAULT);
CREATE TABLE test3 ("场站" string, "温度" int32);
ALTER TABLE tableB set properties TTL=DEFAULT;
```

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

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

```SQL
CREATE DATABASE db;
use db;
CREATE TABLE test3 ("场站" string id, "温度" int32);
CREATE TABLE test3 ("场站" string, "温度" int32);
```

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

```SQL
CREATE DATABASE db WITH (ttl=3600000);
use db;
CREATE TABLE test3 ("场站" string id, "温度" int32) with (ttl='INF');
CREATE TABLE test3 ("场站" string, "温度" int32) with (ttl='INF');
```

## 3. 取消 TTL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ IoTDB支持对表(table)级别设置数据保留时间(TTL),允许系
示例1:创建表时设置 TTL

```SQL
CREATE TABLE test3 ("场站" string id, "温度" int32) with (TTL=3600);
CREATE TABLE test3 ("场站" string, "温度" int32) with (TTL=3600);
```

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

```SQL
CREATE TABLE test3 ("场站" string id, "温度" int32) with (TTL=DEFAULT);
CREATE TABLE test3 ("场站" string id, "温度" int32);
CREATE TABLE test3 ("场站" string, "温度" int32) with (TTL=DEFAULT);
CREATE TABLE test3 ("场站" string, "温度" int32);
ALTER TABLE tableB set properties TTL=DEFAULT;
```

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

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

```SQL
CREATE DATABASE db;
use db;
CREATE TABLE test3 ("场站" string id, "温度" int32);
CREATE TABLE test3 ("场站" string, "温度" int32);
```

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

```SQL
CREATE DATABASE db WITH (ttl=3600000);
use db;
CREATE TABLE test3 ("场站" string id, "温度" int32) with (ttl='INF');
CREATE TABLE test3 ("场站" string, "温度" int32) with (ttl='INF');
```

## 3. 取消 TTL
Expand Down