Skip to content

Commit

Permalink
Merge pull request #22394 from taosdata/3.0
Browse files Browse the repository at this point in the history
merge 3.0 to feat/TD-22970
  • Loading branch information
cadem committed Aug 10, 2023
2 parents 70a598f + b658608 commit dd271bc
Show file tree
Hide file tree
Showing 171 changed files with 2,622 additions and 899 deletions.
2 changes: 1 addition & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ cd TDengine
```bash
mkdir debug
cd debug
cmake .. -DBUILD_TOOLS=true
cmake .. -DBUILD_TOOLS=true -DBUILD_CONTRIB=true
make
```

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ It equals to execute following commands:
```bash
mkdir debug
cd debug
cmake .. -DBUILD_TOOLS=true
cmake .. -DBUILD_TOOLS=true -DBUILD_CONTRIB=true
make
```

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ if [ ! -d debug ]; then
mkdir debug || echo -e "failed to make directory for build"
fi

cd debug && cmake .. -DBUILD_TOOLS=true && make
cd debug && cmake .. -DBUILD_TOOLS=true -DBUILD_CONTRIB=true && make

16 changes: 15 additions & 1 deletion docs/en/05-get-started/01-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ docker run -d -p 6030:6030 -p 6041:6041 -p 6043-6049:6043-6049 -p 6043-6049:6043

Note that TDengine Server 3.0 uses TCP port 6030. Port 6041 is used by taosAdapter for the REST API service. Ports 6043 through 6049 are used by taosAdapter for other connectors. You can open these ports as needed.

If you need to persist data to a specific directory on your local machine, please run the following command:
```shell
docker run -d -v ~/data/taos/dnode/data:/var/lib/taos \
-v ~/data/taos/dnode/log:/var/log/taos \
-p 6030:6030 -p 6041:6041 -p 6043-6049:6043-6049 -p 6043-6049:6043-6049/udp tdengine/tdengine
```
:::note

- /var/lib/taos: TDengine's default data file directory. The location can be changed via [configuration file]. Also you can modify ~/data/taos/dnode/data to your any local empty data directory
- /var/log/taos: TDengine's default log file directory. The location can be changed via [configure file]. you can modify ~/data/taos/dnode/log to your any local empty log directory

:::


Run the following command to ensure that your container is running:

```shell
Expand Down Expand Up @@ -113,4 +127,4 @@ In the query above you are selecting the first timestamp (ts) in the interval, a

## Additional Information

For more information about deploying TDengine in a Docker environment, see [Using TDengine in Docker](../../reference/docker).
For more information about deploying TDengine in a Docker environment, see [Deploying TDengine with Docker](../../deployment/docker).
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Deploying TDengine with Docker
sidebar_label: Docker
description: This chapter describes how to start and access TDengine in a Docker container.
---

Expand All @@ -10,8 +11,17 @@ This chapter describes how to start the TDengine service in a container and acce
The TDengine image starts with the HTTP service activated by default, using the following command:

```shell
docker run -d --name tdengine -p 6041:6041 tdengine/tdengine
docker run -d --name tdengine \
-v ~/data/taos/dnode/data:/var/lib/taos \
-v ~/data/taos/dnode/log:/var/log/taos \
-p 6041:6041 tdengine/tdengine
```
:::note

* /var/lib/taos: TDengine's default data file directory. The location can be changed via [configuration file]. And also you can modify ~/data/taos/dnode/data to your any other local emtpy data directory
* /var/log/taos: TDengine's default log file directory. The location can be changed via [configure file]. And also you can modify ~/data/taos/dnode/log to your any other local empty log directory

:::

The above command starts a container named "tdengine" and maps the HTTP service port 6041 to the host port 6041. You can verify that the HTTP service provided in this container is available using the following command.

Expand Down Expand Up @@ -283,39 +293,38 @@ services:
environment:
TAOS_FQDN: "td-1"
TAOS_FIRST_EP: "td-1"
ports:
- 6041:6041
- 6030:6030
volumes:
- taosdata-td1:/var/lib/taos/
- taoslog-td1:/var/log/taos/
# /var/lib/taos: TDengine's default data file directory. The location can be changed via [configuration file]. you can modify ~/data/taos/dnode1/data to your own data directory
- ~/data/taos/dnode1/data:/var/lib/taos
# /var/log/taos: TDengine's default log file directory. The location can be changed via [configure file]. you can modify ~/data/taos/dnode1/log to your own log directory
- ~/data/taos/dnode1/log:/var/log/taos
td-2:
image: tdengine/tdengine:$VERSION
environment:
TAOS_FQDN: "td-2"
TAOS_FIRST_EP: "td-1"
volumes:
- taosdata-td2:/var/lib/taos/
- taoslog-td2:/var/log/taos/
- ~/data/taos/dnode2/data:/var/lib/taos
- ~/data/taos/dnode2/log:/var/log/taos
td-3:
image: tdengine/tdengine:$VERSION
environment:
TAOS_FQDN: "td-3"
TAOS_FIRST_EP: "td-1"
volumes:
- taosdata-td3:/var/lib/taos/
- taoslog-td3:/var/log/taos/
volumes:
taosdata-td1:
taoslog-td1:
taosdata-td2:
taoslog-td2:
taosdata-td3:
taoslog-td3:
- ~/data/taos/dnode3/data:/var/lib/taos
- ~/data/taos/dnode3/log:/var/log/taos
```

:::note

- The `VERSION` environment variable is used to set the tdengine image tag
- `TAOS_FIRST_EP` must be set on the newly created instance so that it can join the TDengine cluster; if there is a high availability requirement, `TAOS_SECOND_EP` needs to be used at the same time
:::

:::

2. Start the cluster

Expand Down Expand Up @@ -382,24 +391,22 @@ networks:
services:
td-1:
image: tdengine/tdengine:$VERSION
networks:
- inter
environment:
TAOS_FQDN: "td-1"
TAOS_FIRST_EP: "td-1"
volumes:
- taosdata-td1:/var/lib/taos/
- taoslog-td1:/var/log/taos/
# /var/lib/taos: TDengine's default data file directory. The location can be changed via [configuration file]. you can modify ~/data/taos/dnode1/data to your own data directory
- ~/data/taos/dnode1/data:/var/lib/taos
# /var/log/taos: TDengine's default log file directory. The location can be changed via [configure file]. you can modify ~/data/taos/dnode1/log to your own log directory
- ~/data/taos/dnode1/log:/var/log/taos
td-2:
image: tdengine/tdengine:$VERSION
networks:
- inter
environment:
TAOS_FQDN: "td-2"
TAOS_FIRST_EP: "td-1"
volumes:
- taosdata-td2:/var/lib/taos/
- taoslog-td2:/var/log/taos/
- ~/data/taos/dnode2/data:/var/lib/taos
- ~/data/taos/dnode2/log:/var/log/taos
adapter:
image: tdengine/tdengine:$VERSION
entrypoint: "taosadapter"
Expand Down Expand Up @@ -431,11 +438,6 @@ services:
>> /etc/nginx/nginx.conf;cat /etc/nginx/nginx.conf;
nginx -g 'daemon off;'",
]
volumes:
taosdata-td1:
taoslog-td1:
taosdata-td2:
taoslog-td2:
```

## Deploy with docker swarm
Expand Down
2 changes: 1 addition & 1 deletion docs/en/10-deployment/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: This document describes how to deploy a TDengine cluster on a serve

TDengine has a native distributed design and provides the ability to scale out. A few nodes can form a TDengine cluster. If you need higher processing power, you just need to add more nodes into the cluster. TDengine uses virtual node technology to virtualize a node into multiple virtual nodes to achieve load balancing. At the same time, TDengine can group virtual nodes on different nodes into virtual node groups, and use the replication mechanism to ensure the high availability of the system. The cluster feature of TDengine is completely open source.

This document describes how to manually deploy a cluster on a host as well as how to deploy on Kubernetes and by using Helm.
This document describes how to manually deploy a cluster on a host directly and deploy a cluster with Docker, Kubernetes or Helm.

```mdx-code-block
import DocCardList from '@theme/DocCardList';
Expand Down
2 changes: 1 addition & 1 deletion docs/en/12-taos-sql/01-data-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ In TDengine, the data types below can be used when specifying a column or tag.
| 14 | NCHAR | User Defined | Multi-byte string that can include multi byte characters like Chinese characters. Each character of NCHAR type consumes 4 bytes storage. The string value should be quoted with single quotes. Literal single quote inside the string must be preceded with backslash, like `\'`. The length must be specified when defining a column or tag of NCHAR type, for example nchar(10) means it can store at most 10 characters of nchar type and will consume fixed storage of 40 bytes. An error will be reported if the string value exceeds the length defined. |
| 15 | JSON | | JSON type can only be used on tags. A tag of json type is excluded with any other tags of any other type. |
| 16 | VARCHAR | User-defined | Alias of BINARY |
| 16 | GEOMETRY | User-defined | Geometry |
| 17 | GEOMETRY | User-defined | Geometry |
:::note

- Each row of the table cannot be longer than 48KB (64KB since version 3.0.5.0) (note that each BINARY/NCHAR/GEOMETRY column takes up an additional 2 bytes of storage space).
Expand Down
158 changes: 158 additions & 0 deletions docs/en/12-taos-sql/10-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -1274,3 +1274,161 @@ SELECT SERVER_STATUS();
```

**Description**: The server status.


## Geometry Functions

### Geometry Input Functions

Geometry input functions create geometry data from WTK.

#### ST_GeomFromText

```sql
ST_GeomFromText(VARCHAR WKT expr)
```

**Description**: Return a specified GEOMETRY value from Well-Known Text representation (WKT).

**Return value type**: GEOMETRY

**Applicable data types**: VARCHAR

**Applicable table types**: standard tables and supertables

**Explanations**
- The input can be one of WTK string, like POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION.
- The output is a GEOMETRY data type, internal defined as binary string.

### Geometry Output Functions

Geometry output functions convert geometry data into WTK.

#### ST_AsText

```sql
ST_AsText(GEOMETRY geom)
```

**Description**: Return a specified Well-Known Text representation (WKT) value from GEOMETRY data.

**Return value type**: VARCHAR

**Applicable data types**: GEOMETRY

**Applicable table types**: standard tables and supertables

**Explanations**
- The output can be one of WTK string, like POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION.

### Geometry Relationships Functions

Geometry relationships functions determine spatial relationships between geometries.

#### ST_Intersects

```sql
ST_Intersects(GEOMETRY geomA, GEOMETRY geomB)
```

**Description**: Compares two geometries and returns true if they intersect.

**Return value type**: BOOL

**Applicable data types**: GEOMETRY, GEOMETRY

**Applicable table types**: standard tables and supertables

**Explanations**
- Geometries intersect if they have any point in common.


#### ST_Equals

```sql
ST_Equals(GEOMETRY geomA, GEOMETRY geomB)
```

**Description**: Returns TRUE if the given geometries are "spatially equal".

**Return value type**: BOOL

**Applicable data types**: GEOMETRY, GEOMETRY

**Applicable table types**: standard tables and supertables

**Explanations**
- 'Spatially equal' means ST_Contains(A,B) = true and ST_Contains(B,A) = true, and the ordering of points can be different but represent the same geometry structure.


#### ST_Touches

```sql
ST_Touches(GEOMETRY geomA, GEOMETRY geomB)
```

**Description**: Returns TRUE if A and B intersect, but their interiors do not intersect.

**Return value type**: BOOL

**Applicable data types**: GEOMETRY, GEOMETRY

**Applicable table types**: standard tables and supertables

**Explanations**
- A and B have at least one point in common, and the common points lie in at least one boundary.
- For Point/Point inputs the relationship is always FALSE, since points do not have a boundary.


#### ST_Covers

```sql
ST_Covers(GEOMETRY geomA, GEOMETRY geomB)
```

**Description**: Returns TRUE if every point in Geometry B lies inside (intersects the interior or boundary of) Geometry A.

**Return value type**: BOOL

**Applicable data types**: GEOMETRY, GEOMETRY

**Applicable table types**: standard tables and supertables

**Explanations**
- A covers B means no point of B lies outside (in the exterior of) A.


#### ST_Contains

```sql
ST_Contains(GEOMETRY geomA, GEOMETRY geomB)
```

**Description**: Returns TRUE if geometry A contains geometry B.

**Return value type**: BOOL

**Applicable data types**: GEOMETRY, GEOMETRY

**Applicable table types**: standard tables and supertables

**Explanations**
- A contains B if and only if all points of B lie inside (i.e. in the interior or boundary of) A (or equivalently, no points of B lie in the exterior of A), and the interiors of A and B have at least one point in common.


#### ST_ContainsProperly

```sql
ST_ContainsProperly(GEOMETRY geomA, GEOMETRY geomB)
```

**Description**: Returns TRUE if every point of B lies inside A.

**Return value type**: BOOL

**Applicable data types**: GEOMETRY, GEOMETRY

**Applicable table types**: standard tables and supertables

**Explanations**
- There is no point of B that lies on the boundary of A or in the exterior of A.
2 changes: 1 addition & 1 deletion docs/en/12-taos-sql/16-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ LIKE is used together with wildcards to match strings. Its usage is described as
MATCH and NMATCH are used together with regular expressions to match strings. Their usage is described as follows:

- Use POSIX regular expression syntax. For more information, see Regular Expressions.
- Regular expression can be used against only table names, i.e. `tbname`, and tags of binary/nchar types, but can't be used against data columns.
- Regular expression can be used against only table names, i.e. `tbname`, and tags/columns of binary/nchar types.
- The maximum length of regular expression string is 128 bytes. Configuration parameter `maxRegexStringLen` can be used to set the maximum allowed regular expression. It's a configuration parameter on the client side, and will take effect after restarting the client.

## Logical Operators
Expand Down
1 change: 1 addition & 0 deletions docs/en/12-taos-sql/20-keywords.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ The following list shows all reserved keywords:

- MATCH
- MAX_DELAY
- MAX_SPEED
- MAXROWS
- MERGE
- META
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/en/14-reference/03-connector/07-python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ conn.execute("CREATE STABLE weather(ts TIMESTAMP, temperature FLOAT) TAGS (locat
<TabItem value="websocket" label="WebSocket connection">

```python
conn = taosws.connect(url="ws://localhost:6041")
conn = taosws.connect("taosws://localhost:6041")
# Execute a sql, ignore the result set, just get affected rows. It's useful for DDL and DML statement.
conn.execute("DROP DATABASE IF EXISTS test")
conn.execute("CREATE DATABASE test")
Expand Down

0 comments on commit dd271bc

Please sign in to comment.