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 @@ -260,7 +260,37 @@ IoTDB> desc tableB details
+----------+---------+-----------+----------+-------+
```

### 1.4 Update Tables

### 1.4 View Table Creation Statement

Retrieves the complete definition statement of a table or view under the table model. This feature automatically fills in all default values that were omitted during creation, so the displayed statement may differ from the original CREATE statement.

> This feature is supported starting from v2.0.5.

**Syntax:**

```SQL
SHOW CREATE TABLE <TABLE_NAME>
```

**Note::**

1. This statement does not support queries on system tables.

**Example:**

```SQL
IoTDB:database1> show create table table1
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table| Create Table|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|table1|CREATE TABLE "table1" ("region" STRING TAG,"plant_id" STRING TAG,"device_id" STRING TAG,"model_id" STRING ATTRIBUTE,"maintenance" STRING ATTRIBUTE,"temperature" FLOAT FIELD,"humidity" FLOAT FIELD,"status" BOOLEAN FIELD,"arrival_time" TIMESTAMP FIELD) WITH (ttl=31536000000)|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Total line number = 1
```


### 1.5 Update Tables

Used to update a table, including adding or deleting columns and configuring table properties.

Expand Down Expand Up @@ -291,7 +321,7 @@ COMMENT ON TABLE table1 IS 'table1'
COMMENT ON COLUMN table1.a IS null
```

### 1.5 Delete Tables
### 1.6 Delete Tables

Used to delete a table.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,36 @@ IoTDB> desc tableB details
+----------+---------+-----------+----------+-------+
```

### 1.4 Update Tables
### 1.4 View Table Creation Statement

Retrieves the complete definition statement of a table or view under the table model. This feature automatically fills in all default values that were omitted during creation, so the displayed statement may differ from the original CREATE statement.

> This feature is supported starting from v2.0.5.

**Syntax:**

```SQL
SHOW CREATE TABLE <TABLE_NAME>
```

**Note::**

1. This statement does not support queries on system tables.

**Example:**

```SQL
IoTDB:database1> show create table table1
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table| Create Table|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|table1|CREATE TABLE "table1" ("region" STRING TAG,"plant_id" STRING TAG,"device_id" STRING TAG,"model_id" STRING ATTRIBUTE,"maintenance" STRING ATTRIBUTE,"temperature" FLOAT FIELD,"humidity" FLOAT FIELD,"status" BOOLEAN FIELD,"arrival_time" TIMESTAMP FIELD) WITH (ttl=31536000000)|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Total line number = 1
```


### 1.5 Update Tables

Used to update a table, including adding or deleting columns and configuring table properties.

Expand Down Expand Up @@ -291,7 +320,7 @@ COMMENT ON TABLE table1 IS 'table1'
COMMENT ON COLUMN table1.a IS null
```

### 1.5 Delete Tables
### 1.6 Delete Tables

Used to delete a table.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,30 @@ IoTDB> desc tableB details
+----------+---------+-----------+----------+-------+
```

### 2.4 Modify Table

### 2.4 View Table Creation Statement

**Syntax:**

```SQL
SHOW CREATE TABLE <TABLE_NAME>
```

**Examples:**

```SQL
IoTDB:database1> show create table table1
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table| Create Table|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|table1|CREATE TABLE "table1" ("region" STRING TAG,"plant_id" STRING TAG,"device_id" STRING TAG,"model_id" STRING ATTRIBUTE,"maintenance" STRING ATTRIBUTE,"temperature" FLOAT FIELD,"humidity" FLOAT FIELD,"status" BOOLEAN FIELD,"arrival_time" TIMESTAMP FIELD) WITH (ttl=31536000000)|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Total line number = 1
```



### 2.5 Modify Table

**Syntax:**

Expand All @@ -286,7 +309,7 @@ COMMENT ON TABLE table1 IS 'table1'
COMMENT ON COLUMN table1.a IS null
```

### 2.5 Drop Table
### 2.6 Drop Table

**Syntax:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,29 @@ IoTDB> desc tableB details
+----------+---------+-----------+----------+-------+
```

### 2.4 Modify Table

### 2.4 View Table Creation Statement

**Syntax:**

```SQL
SHOW CREATE TABLE <TABLE_NAME>
```

**Examples:**

```SQL
IoTDB:database1> show create table table1
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table| Create Table|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|table1|CREATE TABLE "table1" ("region" STRING TAG,"plant_id" STRING TAG,"device_id" STRING TAG,"model_id" STRING ATTRIBUTE,"maintenance" STRING ATTRIBUTE,"temperature" FLOAT FIELD,"humidity" FLOAT FIELD,"status" BOOLEAN FIELD,"arrival_time" TIMESTAMP FIELD) WITH (ttl=31536000000)|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Total line number = 1
```


### 2.5 Modify Table

**Syntax:**

Expand All @@ -286,7 +308,7 @@ COMMENT ON TABLE table1 IS 'table1'
COMMENT ON COLUMN table1.a IS null
```

### 2.5 Drop Table
### 2.6 Drop Table

**Syntax:**

Expand Down
20 changes: 8 additions & 12 deletions src/UserGuide/Master/Table/User-Manual/Tree-to-Table_apache.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,29 +261,22 @@ IoTDB> show tables details from information_schema
+--------------+-------+------+-------+-----------+
```

#### 2.4.2 **`Show Create Table/View`**
#### 2.4.2 **`Show Create View`**
1. Syntax Definition

```SQL
SHOW CREATE TABLE|VIEW viewname;
SHOW CREATE VIEW viewname;
```

2. Syntax Explanation

* The `SHOW CREATE TABLE`statement can be used to display the complete creation information for ordinary tables or views.
* The `SHOW CREATE VIEW`statement can only be used to display the complete creation information for views.
* Neither statement can be used to display system tables.
* This statement retrieves the complete definition of a table or view.
* It automatically fills in all default values omitted during creation, so the statement shown in the result may differ from the original CREATE statement.
* This statement does not support system tables.

3. Usage Examples

```SQL
IoTDB> show create table tableview
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| View| Create View|
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|tableview|CREATE VIEW "tableview" ("device" STRING TAG,"model" STRING TAG,"status" BOOLEAN FIELD,"hardware" STRING FIELD) COMMENT '树转表' WITH (ttl=INF) AS root.ln.**|
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+

IoTDB> show create view tableview
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| View| Create View|
Expand All @@ -292,6 +285,9 @@ IoTDB> show create view tableview
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
```

> Additionally, you can also use the `SHOW CREATE TABLE` statement to view the creation information of table views. For more details, see [show create table](../Basic-Concept/Table-Management_apache.md#_1-4-view-table-creation-statement)


### 2.5 Query Differences Between Non-aligned and Aligned Devices

Queries on tree-to-table views may yield different results compared to equivalent tree model `ALIGN BY DEVICE`queries when dealing with null values in aligned and non-aligned devices.
Expand Down
20 changes: 8 additions & 12 deletions src/UserGuide/Master/Table/User-Manual/Tree-to-Table_timecho.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,29 +261,22 @@ IoTDB> show tables details from information_schema
+--------------+-------+------+-------+-----------+
```

#### 2.4.2 **`Show Create Table/View`**
#### 2.4.2 **`Show Create View`**
1. Syntax Definition

```SQL
SHOW CREATE TABLE|VIEW viewname;
SHOW CREATE VIEW viewname;
```

2. Syntax Explanation

* The `SHOW CREATE TABLE`statement can be used to display the complete creation information for ordinary tables or views.
* The `SHOW CREATE VIEW`statement can only be used to display the complete creation information for views.
* Neither statement can be used to display system tables.
* This statement retrieves the complete definition of a table or view.
* It automatically fills in all default values omitted during creation, so the statement shown in the result may differ from the original CREATE statement.
* This statement does not support system tables.

3. Usage Examples

```SQL
IoTDB> show create table tableview
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| View| Create View|
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|tableview|CREATE VIEW "tableview" ("device" STRING TAG,"model" STRING TAG,"status" BOOLEAN FIELD,"hardware" STRING FIELD) COMMENT '树转表' WITH (ttl=INF) AS root.ln.**|
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+

IoTDB> show create view tableview
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| View| Create View|
Expand All @@ -292,6 +285,9 @@ IoTDB> show create view tableview
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
```

> Additionally, you can also use the `SHOW CREATE TABLE` statement to view the creation information of table views. For more details, see [show create table](../Basic-Concept/Table-Management_timecho.md#_1-4-view-table-creation-statement)


### 2.5 Query Differences Between Non-aligned and Aligned Devices

Queries on tree-to-table views may yield different results compared to equivalent tree model `ALIGN BY DEVICE`queries when dealing with null values in aligned and non-aligned devices.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,37 @@ IoTDB> desc tableB details
+----------+---------+-----------+----------+-------+
```

### 1.4 Update Tables

### 1.4 View Table Creation Statement

Retrieves the complete definition statement of a table or view under the table model. This feature automatically fills in all default values that were omitted during creation, so the displayed statement may differ from the original CREATE statement.

> This feature is supported starting from v2.0.5.

**Syntax:**

```SQL
SHOW CREATE TABLE <TABLE_NAME>
```

**Note::**

1. This statement does not support queries on system tables.

**Example:**

```SQL
IoTDB:database1> show create table table1
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table| Create Table|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|table1|CREATE TABLE "table1" ("region" STRING TAG,"plant_id" STRING TAG,"device_id" STRING TAG,"model_id" STRING ATTRIBUTE,"maintenance" STRING ATTRIBUTE,"temperature" FLOAT FIELD,"humidity" FLOAT FIELD,"status" BOOLEAN FIELD,"arrival_time" TIMESTAMP FIELD) WITH (ttl=31536000000)|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Total line number = 1
```


### 1.5 Update Tables

Used to update a table, including adding or deleting columns and configuring table properties.

Expand Down Expand Up @@ -291,7 +321,7 @@ COMMENT ON TABLE table1 IS 'table1'
COMMENT ON COLUMN table1.a IS null
```

### 1.5 Delete Tables
### 1.6 Delete Tables

Used to delete a table.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,36 @@ IoTDB> desc tableB details
+----------+---------+-----------+----------+-------+
```

### 1.4 Update Tables
### 1.4 View Table Creation Statement

Retrieves the complete definition statement of a table or view under the table model. This feature automatically fills in all default values that were omitted during creation, so the displayed statement may differ from the original CREATE statement.

> This feature is supported starting from v2.0.5.

**Syntax:**

```SQL
SHOW CREATE TABLE <TABLE_NAME>
```

**Note::**

1. This statement does not support queries on system tables.

**Example:**

```SQL
IoTDB:database1> show create table table1
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table| Create Table|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|table1|CREATE TABLE "table1" ("region" STRING TAG,"plant_id" STRING TAG,"device_id" STRING TAG,"model_id" STRING ATTRIBUTE,"maintenance" STRING ATTRIBUTE,"temperature" FLOAT FIELD,"humidity" FLOAT FIELD,"status" BOOLEAN FIELD,"arrival_time" TIMESTAMP FIELD) WITH (ttl=31536000000)|
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Total line number = 1
```


### 1.5 Update Tables

Used to update a table, including adding or deleting columns and configuring table properties.

Expand Down Expand Up @@ -291,7 +320,7 @@ COMMENT ON TABLE table1 IS 'table1'
COMMENT ON COLUMN table1.a IS null
```

### 1.5 Delete Tables
### 1.6 Delete Tables

Used to delete a table.

Expand Down
Loading