Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/taosdata/TDengine
Browse files Browse the repository at this point in the history
  • Loading branch information
54liuyao committed Dec 17, 2024
2 parents 63a6428 + 88f1c52 commit e6ac454
Show file tree
Hide file tree
Showing 697 changed files with 38,616 additions and 9,404 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ tests/examples/JDBC/JDBCDemo/.classpath
tests/examples/JDBC/JDBCDemo/.project
tests/examples/JDBC/JDBCDemo/.settings/
source/libs/parser/inc/sql.*
source/os/src/timezone/
tests/script/tmqResult.txt
tests/system-test/case_to_run.txt
tests/develop-test/case_to_run.txt
Expand Down Expand Up @@ -162,3 +163,12 @@ geos_c.h
source/libs/parser/src/sql.c
include/common/ttokenauto.h
!packaging/smokeTest/pytest_require.txt
tdengine-test-dir/
localtime.c
private.h
strftime.c
tzdir.h
tzfile.h
coverage.info
taos
taosd
1 change: 1 addition & 0 deletions Jenkinsfile2
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ pipeline {
WKDIR = '/var/lib/jenkins/workspace'
WK = '/var/lib/jenkins/workspace/TDinternal'
WKC = '/var/lib/jenkins/workspace/TDinternal/community'
WKPY = '/var/lib/jenkins/workspace/taos-connector-python'
DOC_WKC = '/root/doc_ci_work'
td_repo = 'TDengine'
zh_doc_repo = 'docs.taosdata.com'
Expand Down
9 changes: 6 additions & 3 deletions cmake/cmake.define
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,13 @@ ELSE()
SET(TD_TAOS_TOOLS TRUE)
ENDIF()

SET(TAOS_LIB taos)
SET(TAOS_LIB_STATIC taos_static)

IF(${TD_WINDOWS})
SET(TAOS_LIB taos_static)
SET(TAOS_LIB_PLATFORM_SPEC taos_static)
ELSE()
SET(TAOS_LIB taos)
SET(TAOS_LIB_PLATFORM_SPEC taos)
ENDIF()

# build TSZ by default
Expand Down Expand Up @@ -128,7 +131,7 @@ IF(TD_WINDOWS)
SET(COMMON_FLAGS "/w /D_WIN32 /DWIN32 /Zi /MTd")
ENDIF()

SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /FORCE:MULTIPLE")

# IF (MSVC AND (MSVC_VERSION GREATER_EQUAL 1900))
# SET(COMMON_FLAGS "${COMMON_FLAGS} /Wv:18")
Expand Down
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.3.4.8.alpha")
SET(TD_VER_NUMBER "3.3.5.0.alpha")
ENDIF ()

IF (DEFINED VERCOMPATIBLE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/libuv_CMakeLists.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# libuv
ExternalProject_Add(libuv
GIT_REPOSITORY https://github.com/libuv/libuv.git
GIT_TAG v1.48.0
GIT_TAG v1.49.2
SOURCE_DIR "${TD_CONTRIB_DIR}/libuv"
BINARY_DIR "${TD_CONTRIB_DIR}/libuv"
CONFIGURE_COMMAND ""
Expand Down
15 changes: 15 additions & 0 deletions cmake/tz_CMakeLists.txt.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# timezone
ExternalProject_Add(tz
GIT_REPOSITORY https://github.com/eggert/tz.git
GIT_TAG main
SOURCE_DIR "${TD_CONTRIB_DIR}/tz"
BINARY_DIR ""
CONFIGURE_COMMAND ""
#BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
GIT_SHALLOW true
GIT_PROGRESS true
BUILD_COMMAND ""
)

33 changes: 33 additions & 0 deletions contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ cat("${TD_SUPPORT_DIR}/zlib_CMakeLists.txt.in" ${CONTRIB_TMP_FILE})
# cJson
cat("${TD_SUPPORT_DIR}/cjson_CMakeLists.txt.in" ${CONTRIB_TMP_FILE})

if(NOT ${TD_WINDOWS})
cat("${TD_SUPPORT_DIR}/tz_CMakeLists.txt.in" ${CONTRIB_TMP_FILE})
endif(NOT ${TD_WINDOWS})

# xz
# cat("${TD_SUPPORT_DIR}/xz_CMakeLists.txt.in" ${CONTRIB_TMP_FILE})

Expand Down Expand Up @@ -651,6 +655,35 @@ if(${TD_LINUX} AND ${BUILD_WITH_S3})
add_subdirectory(azure-cmake EXCLUDE_FROM_ALL)
endif()

IF(TD_LINUX)
SET(TZ_OUTPUT_PATH /usr/share/zoneinfo)
ELSEIF(TD_DARWIN)
SET(TZ_OUTPUT_PATH /var/db/timezone/zoneinfo)
ENDIF()


if(NOT ${TD_WINDOWS})
MESSAGE(STATUS "timezone file path: " ${TZ_OUTPUT_PATH})

execute_process(
COMMAND make TZDIR=${TZ_OUTPUT_PATH}/ clean tzdir.h
WORKING_DIRECTORY "${TD_CONTRIB_DIR}/tz"
)

set(TZ_SRC_DIR "${TD_SOURCE_DIR}/source/os/src/timezone")
file(REMOVE_RECURSE ${TZ_SRC_DIR})
file(MAKE_DIRECTORY ${TZ_SRC_DIR})
file(COPY ${TD_CONTRIB_DIR}/tz/private.h ${TD_CONTRIB_DIR}/tz/tzdir.h ${TD_CONTRIB_DIR}/tz/tzfile.h
${TD_CONTRIB_DIR}/tz/localtime.c ${TD_CONTRIB_DIR}/tz/strftime.c
DESTINATION ${TZ_SRC_DIR})
endif(NOT ${TD_WINDOWS})

#if(NOT ${TD_WINDOWS})
# execute_process(
# COMMAND make CFLAGS+=-fPIC CFLAGS+=-g TZDIR=${TZ_OUTPUT_PATH} clean libtz.a
# WORKING_DIRECTORY "${TD_CONTRIB_DIR}/tz"
# )
#endif(NOT ${TD_WINDOWS})
# ================================================================================================
# Build test
# ================================================================================================
Expand Down
5 changes: 4 additions & 1 deletion contrib/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ if(${BUILD_WITH_TRAFT})
# add_subdirectory(traft)
endif(${BUILD_WITH_TRAFT})

add_subdirectory(azure)
if(${BUILD_S3})
add_subdirectory(azure)
endif()

add_subdirectory(tdev)
add_subdirectory(lz4)
Binary file modified deps/arm/dm_static/libdmodule.a
Binary file not shown.
Binary file modified deps/darwin/arm/dm_static/libdmodule.a
Binary file not shown.
Binary file modified deps/darwin/x64/dm_static/libdmodule.a
Binary file not shown.
Binary file modified deps/mips/dm_static/libdmodule.a
Binary file not shown.
Binary file modified deps/win/x64/dm_static/dmodule.lib
Binary file not shown.
Binary file modified deps/x86/dm_static/libdmodule.a
Binary file not shown.
26 changes: 13 additions & 13 deletions docs/en/07-develop/01-connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Image from '@theme/IdealImage';
import imgConnect from '../assets/connecting-to-tdengine-01.png';
import ConnJava from "./_connect_java.mdx";
import ConnGo from "./_connect_go.mdx";
import ConnRust from "./_connect_rust.mdx";
import ConnNode from "./_connect_node.mdx";
import ConnPythonNative from "./_connect_python.mdx";
import ConnCSNative from "./_connect_cs.mdx";
import ConnC from "./_connect_c.mdx";
import InstallOnLinux from "../14-reference/05-connector/_linux_install.mdx";
import InstallOnWindows from "../14-reference/05-connector/_windows_install.mdx";
import InstallOnMacOS from "../14-reference/05-connector/_macos_install.mdx";
import VerifyLinux from "../14-reference/05-connector/_verify_linux.mdx";
import VerifyMacOS from "../14-reference/05-connector/_verify_macos.mdx";
import VerifyWindows from "../14-reference/05-connector/_verify_windows.mdx";
import ConnJava from "../assets/resources/_connect_java.mdx";
import ConnGo from "../assets/resources/_connect_go.mdx";
import ConnRust from "../assets/resources/_connect_rust.mdx";
import ConnNode from "../assets/resources/_connect_node.mdx";
import ConnPythonNative from "../assets/resources/_connect_python.mdx";
import ConnCSNative from "../assets/resources/_connect_cs.mdx";
import ConnC from "../assets/resources/_connect_c.mdx";
import InstallOnLinux from "../assets/resources/_linux_install.mdx";
import InstallOnWindows from "../assets/resources/_windows_install.mdx";
import InstallOnMacOS from "../assets/resources/_macos_install.mdx";
import VerifyLinux from "../assets/resources/_verify_linux.mdx";
import VerifyMacOS from "../assets/resources/_verify_macos.mdx";
import VerifyWindows from "../assets/resources/_verify_windows.mdx";

TDengine provides a rich set of application development interfaces. To facilitate users in quickly developing their applications, TDengine supports connectors for multiple programming languages. The official connectors include support for C/C++, Java, Python, Go, Node.js, C#, Rust, Lua (community contribution), and PHP (community contribution). These connectors support connecting to the TDengine cluster using the native interface (taosc) and REST interface (not supported in some languages yet). Community developers have also contributed several unofficial connectors, such as ADO.NET connector, Lua connector, and PHP connector. Additionally, TDengine can directly call the REST API provided by taosadapter for data writing and querying operations.

Expand Down
11 changes: 7 additions & 4 deletions docs/en/08-operation/14-user.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ TDengine is configured by default with only one root user, who has the highest p
Only the root user can perform the operation of creating users, with the syntax as follows.

```sql
create user user_name pass'password' [sysinfo {1|0}]
create user user_name pass'password' [sysinfo {1|0}] [createdb {1|0}]
```

The parameters are explained as follows.

- user_name: Up to 23 B long.
- password: Up to 128 B long, valid characters include letters and numbers as well as special characters other than single and double quotes, apostrophes, backslashes, and spaces, and it cannot be empty.
- password: The password must be between 8 and 16 characters long and include at least three types of characters from the following: uppercase letters, lowercase letters, numbers, and special characters. Special characters include `! @ # $ % ^ & * ( ) - _ + = [ ] { } : ; > < ? | ~ , .`.
- sysinfo: Whether the user can view system information. 1 means they can view it, 0 means they cannot. System information includes server configuration information, various node information such as dnode, query node (qnode), etc., as well as storage-related information, etc. The default is to view system information.
- createdb: Whether the user can create databases. 1 means they can create databases, 0 means they cannot. The default value is 0. // Supported starting from TDengine Enterprise version 3.3.2.0

The following SQL can create a user named test with the password 123456 who can view system information.
The following SQL can create a user named test with the password abc123!@# who can view system information.

```sql
create user test pass '123456' sysinfo 1
create user test pass 'abc123!@#' sysinfo 1
```

### Viewing Users
Expand All @@ -51,6 +52,7 @@ alter_user_clause: {
pass 'literal'
| enable value
| sysinfo value
| createdb value
}
```

Expand All @@ -59,6 +61,7 @@ The parameters are explained as follows.
- pass: Modify the user's password.
- enable: Whether to enable the user. 1 means to enable this user, 0 means to disable this user.
- sysinfo: Whether the user can view system information. 1 means they can view system information, 0 means they cannot.
- createdb: Whether the user can create databases. 1 means they can create databases, 0 means they cannot. // Supported starting from TDengine Enterprise version 3.3.2.0

The following SQL disables the user test.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/10-third-party/01-collection/02-prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Prometheus
slug: /third-party-tools/data-collection/prometheus
---

import Prometheus from "./_prometheus.mdx"
import Prometheus from "../../assets/resources/_prometheus.mdx"

Prometheus is a popular open-source monitoring and alerting system. In 2016, Prometheus joined the Cloud Native Computing Foundation (CNCF), becoming the second hosted project after Kubernetes. The project has a very active developer and user community.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/10-third-party/01-collection/03-telegraf.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Telegraf
slug: /third-party-tools/data-collection/telegraf
---

import Telegraf from "./_telegraf.mdx"
import Telegraf from "../../assets/resources/_telegraf.mdx"

Telegraf is a very popular open-source metric collection software. In data collection and platform monitoring systems, Telegraf can collect operational information from various components without the need to manually write scripts for periodic collection, reducing the difficulty of data acquisition.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/10-third-party/01-collection/05-collectd.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: collectd
slug: /third-party-tools/data-collection/collectd
---

import CollectD from "./_collectd.mdx"
import CollectD from "../../assets/resources/_collectd.mdx"

collectd is a daemon for collecting system performance. collectd provides various storage mechanisms to store different values. It periodically collects relevant statistical information about the system while it is running and storing information. Utilizing this information helps identify current system performance bottlenecks and predict future system loads.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/10-third-party/01-collection/06-statsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: StatsD
slug: /third-party-tools/data-collection/statsd
---

import StatsD from "./_statsd.mdx"
import StatsD from "../../assets/resources/_statsd.mdx"

StatsD is a simple daemon for aggregating and summarizing application metrics that has rapidly evolved in recent years into a unified protocol for collecting application performance metrics.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/10-third-party/01-collection/07-icinga2.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Icinga2
slug: /third-party-tools/data-collection/icinga2
---

import Icinga2 from "./_icinga2.mdx"
import Icinga2 from "../../assets/resources/_icinga2.mdx"

icinga2 is an open-source host and network monitoring software, originally developed from the Nagios network monitoring application. Currently, icinga2 is released under the GNU GPL v2 license.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/10-third-party/01-collection/08-tcollector.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: TCollector
slug: /third-party-tools/data-collection/tcollector
---

import TCollector from "./_tcollector.mdx"
import TCollector from "../../assets/resources/_tcollector.mdx"

TCollector is part of openTSDB, used for collecting client logs and sending them to the database.

Expand Down
76 changes: 76 additions & 0 deletions docs/en/10-third-party/05-bi/11-superset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
sidebar_label: Superset
title: Integration With Superset
toc_max_heading_level: 4
---
Apache Superset is a modern enterprise level business intelligence (BI) web application primarily used for data exploration and visualization.
It is supported by the Apache Software Foundation and is an open source project with an active community and rich ecosystem.
Apache Superset provides an intuitive user interface that makes creating, sharing, and visualizing data simple, while supporting multiple data sources and rich visualization options.

Through the Python connector of TDengine, Superset can support TDengine data sources and provide functions such as data presentation and analysis

## Install Apache Superset

Ensure that Apache Superset v2.1.0 or above is installed. If not, please visit [official website](https://superset.apache.org/) to install

## Install TDengine

Both TDengine Enterprise Edition and Community Edition are supported, with version requirements of 3.0 or higher

## Install TDengine Python Connector

The Python connector of TDengine comes with a connection driver that supports Superset in versions 2.1.18 and later, which will be automatically installed in the Superset directory and provide data source services.
The connection uses the WebSocket protocol, so it is necessary to install the `taos-ws-py` component of TDengine separately. The complete installation script is as follows:
```bash
pip3 install taospy
pip3 install taos-ws-py
```

## Configure TDengine Connection In Superset

**Step 1**, enter the new database connection page, "Superset" → "Setting" → "Database Connections" → "+DATABASE"
**Step 2**, select TDengine database connection, select the "TDengine" option from the drop-down list of "SUPPORTED DATABASES".
:::tip
If there is no TDengine option in the drop-down list, please confirm that the steps of installing, `Superset` is first and `Python Connector` is second.
:::
**Step 3**, write a name of connection in "DISPLAY NAME"
**Step 4**, The "SQLALCHEMY URL" field is a key connection information string, and it must be filled in correctly
```bash
taosws://user:password@host:port
```
| Parameter | <center>Parameter Description</center> |
|:---------- |:--------------------------------------------------------- |
|user | Username for logging into TDengine database |
|password | Password for logging into TDengine database |
|host | Name of the host where the TDengine database is located |
|port | The port that provides WebSocket services, default is 6041 |

Example:
The TDengine database installed on this machine provides WebSocket service port 6041, using the default username and password, "SQLALCHEMY URL" is:
```bash
taosws://root:taosdata@localhost:6041
```
**Step 5**, configure the connection string, click "TEST CONNECTION" to test if the connection can be successful. After passing the test, click the "CONNECT" button to complete the connection


## Start

There is no difference in the use of TDengine data source compared to other data sources. Here is a brief introduction to basic data queries:
1. Click the "+" button in the upper right corner of the Superset interface, select "SQL query", and enter the query interface
2. Select the "TDengine" data source that has been created earlier from the dropdown list of "DATABASES" in the upper left corner
3. Select the name of the database to be operated on from the drop-down list of "SCHEMA" (system libraries are not displayed)
4. "SEE TABLE SCHEMA" select the name of the super table or regular table to be operated on (sub tables are not displayed)
5. Subsequently, the schema information of the selected table will be displayed in the following area
6. In the SQL editor area, any SQL statement that conforms to TDengine syntax can be entered for execution

## Example

We chose two popular templates from the Superset Chart template to showcase their effects, using smart meter data as an example:

1. "Aggregate" Type, which displays the maximum voltage value collected per minute during the specified time period in Group 4

![superset-demo1](./superset-demo1.jpeg)

2. "RAW RECORDS" Type, which displays the collected values of current and voltage during the specified time period in Group 4

![superset-demo2](./superset-demo2.jpeg)
Binary file added docs/en/10-third-party/05-bi/superset-demo1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en/10-third-party/05-bi/superset-demo2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e6ac454

Please sign in to comment.