Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 14-java.mdx #24365

Open
wants to merge 72 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
94baecd
docs: add alias name and column referencing comment
dapan1121 Dec 18, 2023
7d3e9ca
fix too many open session
Dec 18, 2023
ea1b148
Merge pull request #24115 from taosdata/docs/aliasAndColumnName
dapan1121 Dec 19, 2023
26a9112
Merge pull request #24124 from taosdata/fix/liaohj
hjxilinx Dec 19, 2023
ffb28e1
Revert "other: merge new features into main branch"
hjxilinx Dec 19, 2023
305bff9
Merge pull request #24126 from taosdata/revert-24124-fix/liaohj
hjxilinx Dec 19, 2023
91052b2
Revert "Revert "other: merge new features into main branch""
hjxilinx Dec 19, 2023
95e67bf
add debug info
yihaoDeng Dec 19, 2023
cecb176
Merge pull request #24132 from taosdata/revert-24126-revert-24124-fix…
hjxilinx Dec 19, 2023
6d20f43
release mem check
cadem Dec 18, 2023
67b1d8a
update odbc doc
sheyanjie-taos Dec 19, 2023
aea36b3
Merge pull request #24138 from taosdata/feat/odbc-doc
gccgdb1234 Dec 19, 2023
ac3ace4
Merge pull request #24136 from taosdata/fix/release-mem-check-main
gccgdb1234 Dec 19, 2023
7c84a47
add debug info
yihaoDeng Dec 19, 2023
8940850
add debug info
yihaoDeng Dec 19, 2023
5ed1c32
add debug info
yihaoDeng Dec 19, 2023
85c3748
add debug info
yihaoDeng Dec 19, 2023
f9363e7
Merge pull request #24135 from taosdata/fix/merge_to_main
hjxilinx Dec 19, 2023
390e99f
add debug info
yihaoDeng Dec 20, 2023
16bc583
add debug info
yihaoDeng Dec 20, 2023
13a2cb1
docs: release 3.2.2.0
xiaopingcs Dec 20, 2023
3ef0830
add debug info
yihaoDeng Dec 20, 2023
fce07e3
add debug info
yihaoDeng Dec 20, 2023
82e86be
add debug info
yihaoDeng Dec 20, 2023
8dfb521
Merge pull request #24144 from taosdata/docs/release_3220_main
gccgdb1234 Dec 20, 2023
34a8359
Update 26-udf.md
gccgdb1234 Dec 20, 2023
79f5286
add debug info
yihaoDeng Dec 20, 2023
c5e14c8
add debug info
yihaoDeng Dec 20, 2023
2478887
add debug info
yihaoDeng Dec 20, 2023
4e8db15
update taoskeeper in deb and rpm
xiaopingcs Dec 20, 2023
adc9b90
Revert "add debug info"
yihaoDeng Dec 20, 2023
63b36e6
Revert "add debug info"
yihaoDeng Dec 20, 2023
2d1251b
init backend mutex
Dec 21, 2023
97c0f8e
Merge pull request #24120 from taosdata/fix/fixTooManyOpen
hjxilinx Dec 21, 2023
4b479f7
refactor code
yihaoDeng Dec 21, 2023
f8551d9
change rpc debug log
yihaoDeng Dec 21, 2023
07405ff
fix snode crash
yihaoDeng Dec 21, 2023
df8c92f
Revert "fix: remove tags keyword from document"
shenglian-zhou Dec 19, 2023
f4f8b9c
doc: select tags to retrieve tags
shenglian-zhou Dec 19, 2023
721b089
Merge pull request #24184 from taosdata/docs/szhou/tag-restore-main
dapan1121 Dec 22, 2023
6ace2e6
doc: update doc for unsupported CLI drop dnode endpoint
bgzhao66 Dec 22, 2023
cf7d750
Merge pull request #24171 from taosdata/fix/fixTooManyOpen
hjxilinx Dec 22, 2023
6d528ca
Merge pull request #24160 from taosdata/fix/fix/initBackendHashmutexMain
hjxilinx Dec 22, 2023
6165a80
update script
xiaopingcs Dec 22, 2023
50a07cb
Merge pull request #24151 from taosdata/packaging/taoskeeper_main
DuanKuanJun Dec 22, 2023
209bb9a
Merge pull request #24180 from taosdata/fix/snodeBackendCrashMain
hjxilinx Dec 22, 2023
e3c9ac7
fix: cache scan heap overflow
wangjiaming0909 Dec 22, 2023
6ef881d
Merge pull request #24200 from taosdata/fix/main/TD-28004
dapan1121 Dec 22, 2023
5b4fa74
Merge pull request #24187 from taosdata/DOC/TS-4395-main
gccgdb1234 Dec 23, 2023
0527538
enh(cmake/curl): download from github instead of curl.se
stephenkgu Dec 25, 2023
ff9044d
Merge pull request #24206 from taosdata/fix/TD-27309-main
hzcheng Dec 25, 2023
47db3f3
fix tag index double free
yihaoDeng Dec 26, 2023
9a164df
fix tag index double free
yihaoDeng Dec 26, 2023
c22ce9e
add test case
yihaoDeng Dec 26, 2023
7eb58ca
add test case
yihaoDeng Dec 26, 2023
03050e8
Merge pull request #24233 from taosdata/fix/TS-4403_main
hjxilinx Dec 26, 2023
5a6ff78
Avoid untimely reporting of status msg
Dec 28, 2023
1c91ba2
Avoid untimely reporting of status msg
yihaoDeng Dec 28, 2023
1855923
update script
xiaopingcs Dec 27, 2023
ea381f4
Merge pull request #24266 from taosdata/packaging/TD-27384
DuanKuanJun Dec 28, 2023
253b394
Merge pull request #24265 from taosdata/opt/optStatusReport_main
hjxilinx Dec 28, 2023
13f678a
opt status send
Dec 29, 2023
fd5799e
Avoid untimely reporting of status msg
yihaoDeng Dec 29, 2023
389a085
Merge pull request #24277 from taosdata/fix/optStatusMsg_main
hjxilinx Dec 29, 2023
07835d3
fix: the pre-allocated column has no data to copy
shenglian-zhou Dec 21, 2023
a01fa72
fix: add test case
shenglian-zhou Dec 21, 2023
be5c6c9
fix TD-28132
xiaopingcs Jan 3, 2024
5d86335
Merge pull request #24327 from taosdata/packaging/TD-28132
DuanKuanJun Jan 3, 2024
5251eca
Merge pull request #24321 from taosdata/szhou/fix/main/TS-4382
gccgdb1234 Jan 4, 2024
6895488
update packaging script
xiaopingcs Jan 5, 2024
68da55b
Merge pull request #24354 from taosdata/packaging/TD-28157-main
DuanKuanJun Jan 5, 2024
15c9ffb
Update 14-java.mdx
litongjava Jan 7, 2024
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 cmake/cmake.version
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
IF (DEFINED VERNUMBER)
SET(TD_VER_NUMBER ${VERNUMBER})
ELSE ()
SET(TD_VER_NUMBER "3.2.2.0.alpha")
SET(TD_VER_NUMBER "3.2.3.0.alpha")
ENDIF ()

IF (DEFINED VERCOMPATIBLE)
Expand Down
3 changes: 2 additions & 1 deletion cmake/curl_CMakeLists.txt.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# curl
ExternalProject_Add(curl2
URL https://curl.se/download/curl-8.2.1.tar.gz
URL https://github.com/curl/curl/releases/download/curl-8_2_1/curl-8.2.1.tar.gz
#URL https://curl.se/download/curl-8.2.1.tar.gz
URL_HASH MD5=b25588a43556068be05e1624e0e74d41
DOWNLOAD_NO_PROGRESS 1
DOWNLOAD_DIR "${TD_CONTRIB_DIR}/deps-download"
Expand Down
4 changes: 2 additions & 2 deletions docs/en/08-client-libraries/50-odbc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ TDengine ODBC driver supports two kinds of connections to TDengine cluster, nati

4.6 [Password]: optional field, only used for connection testing in step 5;

5. Click "Test Connecting" to test whether the data source can be connectted; if successful, it will prompt "connecting success"
5. Click "Test Connection" to test whether the data source can be connectted; if successful, it will prompt "Successfully connected to URL"

6. Click "OK" to sae the configuration and exit.
6. Click "OK" to set the configuration and exit.

7. You can also select an already configured data source name in step 2 to change existing configuration.

Expand Down
Binary file modified docs/en/08-client-libraries/assets/odbc-ws-config-en.webp
Binary file not shown.
6 changes: 0 additions & 6 deletions docs/en/10-deployment/01-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,6 @@ Query OK, 8 row(s) in set (0.001154s)

Before running the TDengine CLI, ensure that the taosd process has been stopped on the dnode that you want to delete.

```sql
DROP DNODE "fqdn:port";
```

or

```sql
DROP DNODE dnodeId;
```
Expand Down
20 changes: 17 additions & 3 deletions docs/en/12-taos-sql/06-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: This document describes how to query data in TDengine.
```sql
SELECT {DATABASE() | CLIENT_VERSION() | SERVER_VERSION() | SERVER_STATUS() | NOW() | TODAY() | TIMEZONE() | CURRENT_USER() | USER() }

SELECT [hints] [DISTINCT] select_list
SELECT [hints] [DISTINCT] [TAGS] select_list
from_clause
[WHERE condition]
[partition_by_clause]
Expand Down Expand Up @@ -139,6 +139,11 @@ You can query tag columns in supertables and subtables and receive results in th
SELECT location, groupid, current FROM d1001 LIMIT 2;
```

### Alias Name

The naming rules for aliases are the same as those for columns, and it supports directly specifying Chinese aliases in UTF-8 encoding format.


### Distinct Values

The DISTINCT keyword returns only values that are different over one or more columns. You can use the DISTINCT keyword with tag columns and data columns.
Expand Down Expand Up @@ -182,7 +187,7 @@ The TBNAME pseudocolumn in a supertable contains the names of subtables within t
The following SQL statement returns all unique subtable names and locations within the meters supertable:

```mysql
SELECT DISTINCT TBNAME, location FROM meters;
SELECT TAGS TBNAME, location FROM meters;
```

Use the `INS_TAGS` system table in `INFORMATION_SCHEMA` to query the information for subtables in a supertable. For example, the following statement returns the name and tag values for each subtable in the `meters` supertable.
Expand Down Expand Up @@ -227,6 +232,14 @@ The \_IROWTS pseudocolumn can only be used with INTERP function. This pseudocolu
select _irowts, interp(current) from meters range('2020-01-01 10:00:00', '2020-01-01 10:30:00') every(1s) fill(linear);
```

### TAGS Query

The TAGS keyword returns only tag columns from all child tables when only tag columns are specified. One row containing tag columns is returned for each child table.

```sql
SELECT TAGS tag_name [, tag_name ...] FROM stb_name
```

## Query Objects

`FROM` can be followed by a number of tables or super tables, or can be followed by a sub-query.
Expand Down Expand Up @@ -434,7 +447,8 @@ SELECT ... FROM (SELECT ... FROM ...) ...;

:::info

- The result of a nested query is returned as a virtual table used by the outer query. It's recommended to give an alias to this table for the convenience of using it in the outer query.
- The result of a nested query is returned as a virtual table used by the outer query. It's recommended to give an alias to this table for the convenience of using it in the outer query.
- Outer queries support directly referencing columns or pseudo-columns of inner queries in the form of column names or `column names`.
- JOIN operation is allowed between tables/STables inside both inner and outer queries. Join operation can be performed on the result set of the inner query.
- The features that can be used in the inner query are the same as those that can be used in a non-nested query.
- `ORDER BY` inside the inner query is unnecessary and will slow down the query performance significantly. It is best to avoid the use of `ORDER BY` inside the inner query.
Expand Down
4 changes: 2 additions & 2 deletions docs/en/12-taos-sql/21-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ The preceding SQL command shows all dnodes in the cluster with the ID, endpoint,
## Delete a DNODE

```sql
DROP DNODE {dnode_id | dnode_endpoint}
DROP DNODE dnode_id
```

You can delete a dnode by its ID or by its endpoint. Note that deleting a dnode does not stop its process. You must stop the process after the dnode is deleted.
Note that deleting a dnode does not stop its process. You must stop the process after the dnode is deleted.

## Modify Dnode Configuration

Expand Down
2 changes: 1 addition & 1 deletion docs/en/12-taos-sql/26-udf.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ CREATE AGGREGATE FUNCTION function_name AS library_path OUTPUTTYPE output_type [
CREATE AGGREGATE FUNCTION l2norm AS "/home/taos/udf_example/libl2norm.so" OUTPUTTYPE DOUBLE bufsize 64;
```

For more information about user-defined functions, see [User-Defined Functions](../../develop/udf).
For more information about user-defined functions, see [User-Defined Functions](https://docs.tdengine.com/develop/udf/).

## Manage UDF

Expand Down
4 changes: 4 additions & 0 deletions docs/en/28-releases/01-tdengine.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ For TDengine 2.x installation packages by version, please visit [here](https://t

import Release from "/components/ReleaseV3";

## 3.2.2.0

<Release type="tdengine" version="3.2.2.0" />

## 3.2.1.0

<Release type="tdengine" version="3.2.1.0" />
Expand Down
118 changes: 118 additions & 0 deletions docs/zh/08-connector/14-java.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import TabItem from '@theme/TabItem';

- JDBC 原生连接:Java 应用在物理节点 1(pnode1)上使用 TSDBDriver 直接调用客户端驱动(libtaos.so 或 taos.dll)的 API 将写入和查询请求发送到位于物理节点 2(pnode2)上的 taosd 实例。
- JDBC REST 连接:Java 应用通过 RestfulDriver 将 SQL 封装成一个 REST 请求,发送给物理节点 2 的 REST 服务器(taosAdapter),通过 REST 服务器请求 taosd 并返回结果。
- JDBC WebSocket 连接 : 是JDBC REST 连接的一种扩展形式.JDBC Rest使用http协议,JDBC WebSocket使用WebSocket协议.使用JDBC WebSocket可以进行一些JDBC Rest不支持的操作

使用 REST 连接,不依赖 TDengine 客户端驱动,可以跨平台,更加方便灵活。

Expand Down Expand Up @@ -1418,6 +1419,123 @@ public static void main(String[] args) throws Exception {

> 更多 druid 使用问题请查看[官方说明](https://github.com/alibaba/druid)。

### 使用连接池整合tio-boot框架
#### tio-boot讲解
tio-boot是一个高性能的网络框架,本章节是使用连接池和tio-boot框架整合来管理数据库连接的示例

#### TDUtils 存储 DataSource
```java
package com.litongjava.tio.web.hello.config.utils;

import javax.sql.DataSource;

public class TDUtils {

public static DataSource ds;

public static void setDataSource(DataSource ds) {
TDUtils.ds = ds;
}
}

```
- `TDUtils` 类用于全局存储和访问 `DataSource` 实例。
- 通过 `setDataSource` 方法,可以设置一个 `DataSource` 实例,这通常是在应用启动时完成的。

#### 创建配置类
```java
package com.litongjava.tio.web.hello.config;

import com.litongjava.jfinal.aop.annotation.ABean;
import com.litongjava.jfinal.aop.annotation.AConfiguration;
import com.litongjava.tio.web.hello.config.utils.TDUtils;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;

import javax.sql.DataSource;

@AConfiguration
public class TdEngineDataSourceConfig {

@ABean(destroyMethod = "close", priority = 10)
public DataSource hikariDataSource() {
HikariConfig config = new HikariConfig();
// jdbc properties
String host = "192.168.3.9";
int port = 6041;
String user = "root";
String pswd = "taosdata";
String dbName = "test_ws_parabind";
String driverClassName = "com.taosdata.jdbc.rs.RestfulDriver";
// String driverClassName = "com.taosdata.jdbc.TSDBDriver";

String jdbcUrl = getJdbcUrl(host, port, user, pswd, dbName);
config.setJdbcUrl(jdbcUrl);
config.setDriverClassName(driverClassName);
// connection pool configurations
config.setMinimumIdle(10); // minimum number of idle connection
config.setMaximumPoolSize(10); // maximum number of connection in the pool
config.setConnectionTimeout(30000); // maximum wait milliseconds for get connection from pool
config.setMaxLifetime(0); // maximum life time for each connection
config.setIdleTimeout(0); // max idle time for recycle idle connection
config.setConnectionTestQuery("select server_status()"); // validation query

HikariDataSource ds = new HikariDataSource(config); // create datasource
TDUtils.setDataSource(ds);
return ds;
}

private String getJdbcUrl(String host, int port, String user, String pswd, String dbName) {
// 添加batchfetch=true属性后得到的Websocket连接
return "jdbc:TAOS-RS://" + host + ":" + port + "/" + dbName + "?user=" + user + "&password=" + pswd
+ "&batchfetch=true";
}
}
```
- 这是一个配置类,用于创建和配置 `HikariDataSource`。
- 使用了 `HikariConfig` 来设置数据库连接的详细信息,如主机名、端口、用户、密码等。
- 配置了连接池的参数,如最小空闲连接数、最大连接数、连接超时时间等。
- `hikariDataSource` 方法创建了 `HikariDataSource` 的实例,并使用 `TDUtils.setDataSource` 方法存储它。

#### 测试获取连接
```java
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
import java.util.List;
import java.util.Random;

import com.litongjava.jfinal.plugin.activerecord.Record;
import com.litongjava.tio.http.server.annotation.RequestPath;
import com.litongjava.tio.web.hello.config.utils.TDUtils;
import com.taosdata.jdbc.ws.TSWSPreparedStatement;

import lombok.Cleanup;

@RequestPath("/tdeingien/test")
public class TbEngineTestController {

public String connection() throws SQLException {
@Cleanup
Connection connection = TDUtils.ds.getConnection();
String string = connection.toString();
return string;
}
}
```
- `TbEngineTestController` 类用于测试数据库连接。
- `connection` 方法从 `TDUtils` 获取一个 `DataSource` 实例,然后从中获取一个连接,并将连接对象的字符串表示返回。
- `@Cleanup` 用于在操作完成后自动关闭 Connection

#### 完整的代码示例
[示例1](https://github.com/litongjava/java-ee-tio-boot-study/tree/main/tio-boot-latest-study/tio-boot-jfinal-plugins-tdengine-study)
[示例2](https://github.com/litongjava/java-ee-tio-boot-study/tree/main/tio-boot-latest-study/tio-boot-mybatis-plus-tdengine-study)




### 更多示例程序

示例程序源码位于 `TDengine/examples/JDBC` 下:
Expand Down
24 changes: 12 additions & 12 deletions docs/zh/08-connector/50-odbc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ TDengine ODBC 支持两种连接 TDengine 数据库方式:Websocket 连接与

4.1 【DSN】:Data Source Name 必填,为新添加的 ODBC 数据源命名

4.2【Connection Type】 : 必选,选择连接类型,这里选择 【Websocket】
4.2【连接类型】 : 必选,选择连接类型,这里选择 【Websocket】

4.3【URL】必填,ODBC 数据源 URL,example: `http://localhost:6041`, 云服务的 url 示例: `https://gw.cloud.taosdata.com?token=your_token`
4.3【URL】必填,ODBC 数据源 URL,示例: `http://localhost:6041`, 云服务的 url 示例: `https://gw.cloud.taosdata.com?token=your_token`

4.4【Database】选填,需要连接的默认数据库
4.4【数据库】选填,需要连接的默认数据库

4.5【User】仅供第5步测试连接使用,选填,数据库用户名,如果不填,TDengine 默认 root
4.5【用户名】仅供第5步测试连接使用,选填,数据库用户名,如果不填,TDengine 默认 root

4.6【Password】仅供第5步测试连接使用,选填,数据库用户密码,如果不填,TDengine 默认 taosdata
4.6【密码】仅供第5步测试连接使用,选填,数据库用户密码,如果不填,TDengine 默认 taosdata

5. 点【Test Connecting...】测试连接情况,如果成功,提示"connecting success"
5. 点【测试连接】测试连接情况,如果成功,提示"成功连接到URL"

6. 点【确定】,即可保存配置并退出

Expand All @@ -78,17 +78,17 @@ TDengine ODBC 支持两种连接 TDengine 数据库方式:Websocket 连接与

4.1 【DSN】:Data Source Name 必填,为新添加的 ODBC 数据源命名

4.2 【Connection Type】 : 必选,选择连接类型,这里选择 【Native】 原生连接;
4.2 【连接类型】 : 必选,选择连接类型,这里选择 【Native】 原生连接;

4.3 【Server】必填,ODBC 数据源 Server 地址,example: `localhost:6030`
4.3 【服务器】必填,ODBC 数据源 服务器 地址,示例: `localhost:6030`

4.4 【Database】选填,需要连接的默认数据库
4.4 【数据库】选填,需要连接的默认数据库

4.5 【User】仅供第5步测试连接使用,选填,数据库用户名,如果不填,TDengine 默认 root
4.5 【用户名】仅供第5步测试连接使用,选填,数据库用户名,如果不填,TDengine 默认 root

4.6 【Password】仅供第5步测试连接使用,选填,数据库用户密码,如果不填,TDengine 默认 taosdata
4.6 【密码】仅供第5步测试连接使用,选填,数据库用户密码,如果不填,TDengine 默认 taosdata

5. 点【Test Connecting...】测试连接情况,如果成功,提示"connecting success"
5. 点【测试连接】测试连接情况,如果成功,提示"连接成功"

6. 点【确定】,即可保存配置并退出

Expand Down
Binary file modified docs/zh/08-connector/assets/odbc-native-config-zh.webp
Binary file not shown.
Binary file modified docs/zh/08-connector/assets/odbc-ws-config-zh.webp
Binary file not shown.
8 changes: 1 addition & 7 deletions docs/zh/10-deployment/01-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,11 @@ Query OK, 8 row(s) in set (0.001154s)

启动 CLI 程序 taos,执行:

```sql
DROP DNODE "fqdn:port";
```

或者

```sql
DROP DNODE dnodeId;
```

通过 “fqdn:port” 或 dnodeID 来指定一个具体的节点都是可以的。其中 fqdn 是被删除的节点的 FQDN,port 是其对外服务器的端口号;dnodeID 可以通过 SHOW DNODES 获得。
dnodeId 可以通过 SHOW DNODES 获得。

:::warning

Expand Down
20 changes: 17 additions & 3 deletions docs/zh/12-taos-sql/06-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: 查询数据的详细语法
```sql
SELECT {DATABASE() | CLIENT_VERSION() | SERVER_VERSION() | SERVER_STATUS() | NOW() | TODAY() | TIMEZONE() | CURRENT_USER() | USER() }

SELECT [hints] [DISTINCT] select_list
SELECT [hints] [DISTINCT] [TAGS] select_list
from_clause
[WHERE condition]
[partition_by_clause]
Expand Down Expand Up @@ -139,6 +139,9 @@ SELECT d1001.* FROM d1001,d1003 WHERE d1001.ts = d1003.ts;
SELECT location, groupid, current FROM d1001 LIMIT 2;
```

### 别名
别名的命名规则与列相同,支持直接指定 UTF-8 编码格式的中文别名。

### 结果去重

`DISTINCT` 关键字可以对结果集中的一列或多列进行去重,去除的列既可以是标签列也可以是数据列。
Expand All @@ -162,6 +165,16 @@ SELECT DISTINCT col_name [, col_name ...] FROM tb_name;

:::

### 标签查询

当查询的列只有标签列时,`TAGS` 关键字可以指定返回所有子表的标签列。每个子表只返回一行标签列。

返回所有子表的标签列:

```sql
SELECT TAGS tag_name [, tag_name ...] FROM stb_name
```

### 结果集列名

`SELECT`子句中,如果不指定返回结果集合的列名,结果集列名称默认使用`SELECT`子句中的表达式名称作为列名称。此外,用户可使用`AS`来重命名返回结果集合中列的名称。例如:
Expand All @@ -182,7 +195,7 @@ taos> SELECT ts, ts AS primary_key_ts FROM d1001;
获取一个超级表所有的子表名及相关的标签信息:

```mysql
SELECT DISTINCT TBNAME, location FROM meters;
SELECT TAGS TBNAME, location FROM meters;
```

建议用户使用 INFORMATION_SCHEMA 下的 INS_TAGS 系统表来查询超级表的子表标签信息,例如获取超级表 meters 所有的子表名和标签值:
Expand Down Expand Up @@ -434,7 +447,8 @@ SELECT ... FROM (SELECT ... FROM ...) ...;

:::info

- 内层查询的返回结果将作为“虚拟表”供外层查询使用,此虚拟表建议起别名,以便于外层查询中方便引用。
- 内层查询的返回结果将作为“虚拟表”供外层查询使用,此虚拟表建议起别名,以便于外层查询中方便引用。
- 外层查询支持直接通过列名或`列名`的形式引用内层查询的列或伪列。
- 在内层和外层查询中,都支持普通的表间/超级表间 JOIN。内层查询的计算结果也可以再参与数据子表的 JOIN 操作。
- 内层查询支持的功能特性与非嵌套的查询语句能力是一致的。
- 内层查询的 ORDER BY 子句一般没有意义,建议避免这样的写法以免无谓的资源消耗。
Expand Down
4 changes: 2 additions & 2 deletions docs/zh/12-taos-sql/21-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ SHOW DNODES;
## 删除数据节点

```sql
DROP DNODE {dnode_id | dnode_endpoint}
DROP DNODE dnode_id
```

可以用 dnoe_id 或 endpoint 两种方式从集群中删除一个 dnode。注意删除 dnode 不等于停止相应的进程。实际中推荐先将一个 dnode 删除之后再停止其所对应的进程。
注意删除 dnode 不等于停止相应的进程。实际中推荐先将一个 dnode 删除之后再停止其所对应的进程。

## 修改数据节点配置

Expand Down
Loading