Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/new-framework-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- '3.0'
- 'main'
- '3.3.6'
- '3.3.8'
paths-ignore:
- 'packaging/**'
- 'docs/**'
Expand Down
44 changes: 22 additions & 22 deletions docs/en/05-basic/02-insert.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ Assume that the smart meter with device ID d1001 collected data on October 3, 20

1. You can write time-series data into the subtable d1001 using the following INSERT statement.

```sql
insert into d1001 (ts, current, voltage, phase) values ( "2018-10-03 14:38:05", 10.3, 219, 0.31)
```
```sql
INSERT INTO d1001 (ts, current, voltage, phase) VALUES ("2018-10-03 14:38:05", 10.3, 219, 0.31);
```

The above SQL writes `2018-10-03 14:38:05`, `10.3`, `219`, `0.31` into the columns `ts`, `current`, `voltage`, `phase` of the subtable `d1001`.
The above SQL writes `2018-10-03 14:38:05`, `10.3`, `219`, `0.31` into the columns `ts`, `current`, `voltage`, `phase` of the subtable `d1001`.

1. When the `VALUES` part of the `INSERT` statement includes all columns of the table, the list of fields before `VALUES` can be omitted, as shown in the following SQL statement, which has the same effect as the previous INSERT statement specifying columns.

```sql
insert into d1001 values("2018-10-03 14:38:05", 10.3, 219, 0.31)
```
```sql
INSERT INTO d1001 VALUES ("2018-10-03 14:38:05", 10.3, 219, 0.31);
```

1. For the table's timestamp column (the first column), you can also directly use the timestamp of the database precision.

```sql
INSERT INTO d1001 VALUES (1538548685000, 10.3, 219, 0.31);
```
```sql
INSERT INTO d1001 VALUES (1538548685000, 10.3, 219, 0.31);
```

The effects of the above three SQL statements are exactly the same.

Expand All @@ -41,10 +41,10 @@ The effects of the above three SQL statements are exactly the same.
Assume that the smart meter with device ID d1001 collects data every 10s and reports data every 30s, i.e., it needs to write 3 records every 30s. Users can write multiple records in one insert statement. The following SQL writes a total of 3 records.

```sql
insert into d1001 values
( "2018-10-03 14:38:05", 10.2, 220, 0.23),
( "2018-10-03 14:38:15", 12.6, 218, 0.33),
( "2018-10-03 14:38:25", 12.3, 221, 0.31)
INSERT INTO d1001 VALUES
("2018-10-03 14:38:05", 10.2, 220, 0.23),
("2018-10-03 14:38:15", 12.6, 218, 0.33),
("2018-10-03 14:38:25", 12.3, 221, 0.31);
```

The above SQL writes a total of three records.
Expand Down Expand Up @@ -76,18 +76,18 @@ The above SQL writes a total of nine records.
You can write data to specific columns of a table by specifying columns. Columns not appearing in the SQL will be automatically filled with NULL values. Note that the timestamp column must be present, and its value cannot be NULL. The following SQL writes one record to the subtable d1004. This record only includes voltage and phase, with the current value being NULL.

```sql
insert into d1004 (ts, voltage, phase) values("2018-10-04 14:38:06", 223, 0.29)
INSERT INTO d1004 (ts, voltage, phase) VALUES ("2018-10-04 14:38:06", 223, 0.29);
```

### Automatic Table Creation on Insert

Users can perform inserts using the `using` keyword for automatic table creation. If the subtable does not exist, it triggers automatic table creation before data insertion; if the subtable already exists, it directly inserts the data. An insert statement with automatic table creation can also specify only some tag columns for insertion, leaving the unspecified tag columns as NULL values. The following SQL inserts a record. If the subtable d1005 does not exist, it first creates the table automatically with the tag `group_id` value as NULL, then inserts the data.

```sql
insert into d1005
using meters (location)
tags ( "beijing.chaoyang")
values ( "2018-10-04 14:38:07", 10.15, 217, 0.33)
INSERT INTO d1005
USING meters (location)
TAGS ("California.SanFrancisco")
VALUES ("2018-10-04 14:38:07", 10.15, 217, 0.33);
```

The insert statement with automatic table creation also supports inserting data into multiple tables in one statement. The following SQL uses an automatic table creation insert statement to insert 9 records.
Expand All @@ -113,8 +113,8 @@ d1003 USING meters TAGS ("California.LosAngeles", 2) VALUES
TDengine also supports direct data insertion into supertables. It is important to note that a supertable is a template and does not store data itself; the data is stored in the corresponding subtables. The following SQL inserts a record into the subtable d1001 by specifying the tbname column.

```sql
insert into meters (tbname, ts, current, voltage, phase, location, group_id)
values( "d1001, "2018-10-03 14:38:05", 10.2, 220, 0.23, "California.SanFrancisco", 2)
INSERT INTO meters (tbname, ts, current, voltage, phase, location, group_id)
VALUES ("d1001", "2018-10-03 14:38:05", 10.2, 220, 0.23, "California.SanFrancisco", 2);
```

### Zero-Code Insertion
Expand All @@ -134,5 +134,5 @@ INSERT INTO d1001 (ts, current) VALUES ("2018-10-03 14:38:05", 22);
To facilitate the cleanup of abnormal data caused by equipment failures and other reasons, TDengine supports deleting time-series data based on timestamps. The following SQL deletes all data in the supertable `meters` with timestamps earlier than `2021-10-01 10:40:00.100`. Data deletion is irreversible, so use it with caution. To ensure that the data being deleted is indeed what you want to delete, it is recommended to first use a select statement with the deletion condition in the where clause to view the data to be deleted, and confirm it is correct before executing delete.

```sql
delete from meters where ts < '2021-10-01 10:40:00.100' ;
DELETE FROM meters WHERE ts < '2021-10-01 10:40:00.100';
```
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ SELECT _wstart, _wend, SUM(i32)
FROM foo
ANOMALY_WINDOW(i32, "algo=ksigma,k=2");

taos> SELECT _wstart, _wend, count(*) FROM foo ANOMAYL_WINDOW(i32);
taos> SELECT _wstart, _wend, count(*) FROM foo ANOMALY_WINDOW(i32);
_wstart | _wend | count(*) |
====================================================================
2020-01-01 00:00:16.000 | 2020-01-01 00:00:17.000 | 2 |
Expand Down
2 changes: 1 addition & 1 deletion docs/en/08-operation/09-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TDengine Enterprise implements incremental backup and recovery of data by using
1. Incremental data backup: Based on TDengine's data subscription function, all data changes of **the backup object** (including: addition, modification, deletion, metadata change, etc.) are recorded to generate a backup file.
2. Data recovery: Use the backup file generated by incremental data backup to restore **the backup object** to a specified point in time.
3. Backup object: The object that the user backs up can be a **database** or a **supertable**.
4. Backup plan: The user creates a periodic backup task for the backup object. The backup plan starts at a specified time point and periodically executes the backup task at intervals of **the backup cycle. Each backup task generates a** **backup point** .
4. Backup plan: The user creates a periodic backup task for the backup object. The backup plan starts at a specified time point and periodically executes the backup task at intervals of **the backup cycle.** Each backup task generates a **backup point** .
5. Backup point: Each time a backup task is executed, a set of backup files is generated. They correspond to a time point, called **a backup point** . The first backup point is called **the initial backup point** .
6. Restore task: The user selects a backup point in the backup plan and creates a restore task. The restore task starts from **the initial backup point** and plays back the data changes in **the backup file** one by one until the specified backup point ends.

Expand Down
4 changes: 1 addition & 3 deletions docs/en/08-operation/10-disaster.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,4 @@ The following steps describe how to easily set up a data disaster recovery syste

- Step 5: Add a data synchronization task on the "System Management - Data Synchronization" page of the taosExplorer service, fill in the configuration information of the task with the database db1 to be synchronized and the target database db2's DSN, and start data synchronization after creating the task.

- Step 6: Access Cluster B, and you can see that the database db2 in Cluster B continuously writes data from the database db1 in Cluster A until the data volumes of the databases in both clusters are roughly equal. At this point, a simple data disaster recovery system based on

TDengine Enterprise is set up.
- Step 6: Access Cluster B, and you can see that the database db2 in Cluster B continuously writes data from the database db1 in Cluster A until the data volumes of the databases in both clusters are roughly equal. At this point, a simple data disaster recovery system based on TDengine Enterprise is set up.
39 changes: 33 additions & 6 deletions docs/en/14-reference/03-taos-sql/92-keywords.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ The list of keywords is as follows:
| ALIAS | |
| ALIVE | |
| ALL | |
| ALLOW_DATETIME | 3.4.0.0+ |
| ALLOW_TOKEN_NUM | 3.4.0.0+ |
| ALTER | |
| ANALYZE | 3.3.4.3+ |
| AND | |
Expand Down Expand Up @@ -77,9 +79,11 @@ The list of keywords is as follows:
| CACHEMODEL | |
| CACHESIZE | |
| CALC_NOTIFY_ONLY | 3.3.7.0+ |
| CALL_PER_SESSION | 3.4.0.0+ |
| CASE | |
| CAST | |
| CHANGE | |
| CHANGEPASS | 3.4.0.0+ |
| CHILD | |
| CLIENT_VERSION | |
| CLUSTER | |
Expand All @@ -98,6 +102,8 @@ The list of keywords is as follows:
| COMPRESS | |
| CONCAT | |
| CONFLICT | |
| CONNECT_IDLE_TIME | 3.4.0.0+ |
| CONNECT_TIME | 3.4.0.0+ |
| CONNECTION | |
| CONNECTIONS | |
| CONNS | |
Expand All @@ -123,6 +129,7 @@ The list of keywords is as follows:
| DBS | |
| DB_KEY | |
| DECIMAL | 3.3.6.0+ |
| DEFAULT | 3.4.0.0+ |
| DEFERRED | |
| DELETE | |
| DELETE_MARK | |
Expand Down Expand Up @@ -152,6 +159,8 @@ The list of keywords is as follows:
| ENCODE | |
| ENABLE | |
| ENCRYPT_ALGORITHM | |
| ENCRYPT_ALGORITHMS | 3.4.0.0+ |
| ENCRYPT_ALGR | 3.4.0.0+ |
| ENCRYPT_KEY | |
| ENCRYPT_STATUS | |
| ENCRYPTIONS | |
Expand All @@ -165,14 +174,14 @@ The list of keywords is as follows:
| EXPIRED | 3.0.0.0 - 3.3.7.0 |
| EXPIRED_TIME | 3.3.7.0+ |
| EXPLAIN | |
| ENCRYPT_ALGORITHMS | 3.4.0.0+ |
| ENCRYPT_ALGR | 3.4.0.0+ |
| EXTRA_INFO | 3.4.0.0+ |

### F

|Keyword|Description|
|----------------------|-|
| FAIL | |
| FAILED_LOGIN_ATTEMPTS | 3.4.0.0+ |
| FHIGH | 3.3.4.3+ |
| FILE | |
| FILL | |
Expand Down Expand Up @@ -225,6 +234,7 @@ The list of keywords is as follows:
| IMMEDIATE | |
| IMPORT | |
| IN | |
| INACTIVE_ACCOUNT_TIME | 3.4.0.0+ |
| INDEX | |
| INDEXES | |
| INITIALLY | |
Expand Down Expand Up @@ -320,6 +330,8 @@ The list of keywords is as follows:
| NONE | |
| NORMAL | |
| NOT | |
| NOT_ALLOW_DATETIME | 3.4.0.0+ |
| NOT_ALLOW_HOST | 3.4.0.0+ |
| NOTIFY | 3.3.6.0+ |
| NOTIFY_HISTORY | 3.3.6.0+ |
| NOTIFY_OPTIONS | 3.3.7.0+ |
Expand Down Expand Up @@ -355,6 +367,11 @@ The list of keywords is as follows:
| PAGESIZE | |
| PARTITION | |
| PASS | |
| PASSWORD_LIFE_TIME | 3.4.0.0+ |
| PASSWORD_REUSE_TIME | 3.4.0.0+ |
| PASSWORD_REUSE_MAX | 3.4.0.0+ |
| PASSWORD_LOCK_TIME | 3.4.0.0+ |
| PASSWORD_GRACE_TIME | 3.4.0.0+ |
| PAUSE | |
| PERIOD | 3.3.7.0+ |
| PI | |
Expand All @@ -368,6 +385,7 @@ The list of keywords is as follows:
| PRIMARY | |
| PRIVILEGE | |
| PRIVILEGES | |
| PROVIDER | 3.4.0.0+ |

### Q

Expand Down Expand Up @@ -411,15 +429,21 @@ The list of keywords is as follows:
| RETENTIONS | |
| REVOKE | |
| RIGHT | |
| ROLE | |
| ROLES | |
| ROLLUP | |
| ROW | |
| ROWTS | |
| RP | |
| RSHIFT | |
| ROLE | |
| ROLES | |
| RSMA | |
| RSMAS | |
| RIGHT | |
| ROLLUP | |
| ROW | |
| ROWTS | |
| RP | |
| RSHIFT | |
Comment on lines +441 to +446
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There are several duplicated keywords in this list (RIGHT, ROLLUP, ROW, ROWTS, RP, RSHIFT). Please remove these duplicate entries to keep the list clean and accurate.


### S

Expand All @@ -433,6 +457,7 @@ The list of keywords is as follows:
| SERVER_STATUS | |
| SERVER_VERSION | |
| SESSION | |
| SESSION_PER_USER | 3.4.0.0+ |
| SET | |
| SHOW | |
| SINGLE_STABLE | |
Expand Down Expand Up @@ -492,10 +517,11 @@ The list of keywords is as follows:
| TINYINT | |
| TO | |
| TODAY | |
| TOKEN | |
| TOKENS | |
| TOKEN | 3.4.0.0+ |
| TOKENS | 3.4.0.0+ |
| TOPIC | |
| TOPICS | |
| TOTP_SECRET | 3.4.0.0+ |
| TRAILING | |
| TRANSACTION | |
| TRANSACTIONS | |
Expand Down Expand Up @@ -543,6 +569,7 @@ The list of keywords is as follows:
| VIEWS | |
| VIRTUAL | |
| VNODE | |
| VNODE_PER_CALL | 3.4.0.0+ |
| VNODES | |
| VTABLE | |
| VTABLES | |
Expand Down
Loading
Loading