Skip to content

Commit

Permalink
Merge branch 'main' into fix/liaohj
Browse files Browse the repository at this point in the history
  • Loading branch information
hjxilinx committed Nov 15, 2024
2 parents b1981d3 + d343a00 commit 20ad165
Show file tree
Hide file tree
Showing 141 changed files with 9,235 additions and 3,197 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ version.h
geos_c.h
source/libs/parser/src/sql.c
include/common/ttokenauto.h

!packaging/smokeTest/pytest_require.txt
191 changes: 138 additions & 53 deletions Jenkinsfile2
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import hudson.model.Result
import hudson.model.*;
import jenkins.model.CauseOfInterruption
docs_only=0
node {
}
file_zh_changed = ''
file_en_changed = ''
file_no_doc_changed = ''
def abortPreviousBuilds() {
def currentJobName = env.JOB_NAME
def currentBuildNumber = env.BUILD_NUMBER.toInteger()
Expand All @@ -29,7 +31,7 @@ def abort_previous(){
if (buildNumber > 1) milestone(buildNumber - 1)
milestone(buildNumber)
}
def check_docs() {
def check_docs(){
if (env.CHANGE_URL =~ /\/TDengine\//) {
sh '''
hostname
Expand All @@ -40,39 +42,94 @@ def check_docs() {
cd ${WKC}
git reset --hard
git clean -f
rm -rf examples/rust/
git remote prune origin
git fetch
'''
script {
sh '''
cd ${WKC}
git checkout ''' + env.CHANGE_TARGET + '''
'''
}
sh '''
cd ${WKC}
git remote prune origin
git checkout ''' + env.CHANGE_TARGET + '''
git pull >/dev/null
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
git checkout -qf FETCH_HEAD
'''
def file_changed = sh (

file_zh_changed = sh (
script: '''
cd ${WKC}
git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD ${CHANGE_TARGET}`|grep -v "^docs/en/"|grep -v "^docs/zh/" || :
git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD ${CHANGE_TARGET}`|grep "^docs/zh/" || :
''',
returnStdout: true
)

file_en_changed = sh (
script: '''
cd ${WKC}
git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD ${CHANGE_TARGET}`|grep "^docs/en/" || :
''',
returnStdout: true
)

file_no_doc_changed = sh (
script: '''
cd ${WKC}
git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD ${CHANGE_TARGET}`|grep -v "^docs/en/"|grep -v "^docs/zh/"|grep -v "*.md" || :
''',
returnStdout: true
).trim()
if (file_changed == '') {
echo "docs PR"
docs_only=1
} else {
echo file_changed
}
env.FILE_CHANGED = file_changed
echo "file_zh_changed: ${file_zh_changed}"
echo "file_en_changed: ${file_en_changed}"
echo "file_no_doc_changed: ${file_no_doc_changed}"
}
}

def build_pre_docs(){
if (env.CHANGE_URL =~ /\/TDengine\//) {
sh '''
hostname
date
env
'''

sh '''
cd ${DOC_WKC}/${td_repo}
git reset --hard
git clean -f
git remote prune origin
git fetch
git checkout ''' + env.CHANGE_TARGET + '''
git pull >/dev/null
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
'''

sh '''
cd ${DOC_WKC}/${tools_repo}
git reset --hard
git clean -f
git fetch
git remote prune origin
git checkout ''' + env.CHANGE_TARGET + '''
git pull >/dev/null
'''
}
}

def build_zh_docs(){
sh '''
cd ${DOC_WKC}/${zh_doc_repo}
# git pull
yarn ass local
yarn build
'''
}

def build_en_docs(){
sh '''
cd ${DOC_WKC}/${en_doc_repo}
# git pull
yarn ass local
yarn build
'''
}


def pre_test(){
sh '''
hostname
Expand Down Expand Up @@ -153,6 +210,7 @@ def pre_test(){
'''
return 1
}

def pre_test_build_mac() {
sh '''
hostname
Expand All @@ -173,6 +231,7 @@ def pre_test_build_mac() {
date
'''
}

def pre_test_win(){
bat '''
hostname
Expand Down Expand Up @@ -273,17 +332,8 @@ def pre_test_win(){
cd %WIN_COMMUNITY_ROOT%
git submodule update --init --recursive
'''
bat '''
cd %WIN_CONNECTOR_ROOT%
git branch
git reset --hard
git pull
'''
bat '''
cd %WIN_CONNECTOR_ROOT%
git log -5
'''
}

def pre_test_build_win() {
bat '''
echo "building ..."
Expand All @@ -303,16 +353,14 @@ def pre_test_build_win() {
time /t
'''
bat '''
cd %WIN_CONNECTOR_ROOT%
python.exe -m pip install --upgrade pip
python -m pip uninstall taospy -y
python -m pip install taospy==2.7.16
python -m pip uninstall taos-ws-py -y
python -m pip install taos-ws-py==0.3.3
cd %WIN_COMMUNITY_ROOT%/tests/ci
pip3 install taospy==2.7.16
pip3 install taos-ws-py==0.3.3
xcopy /e/y/i/f %WIN_INTERNAL_ROOT%\\debug\\build\\lib\\taos.dll C:\\Windows\\System32
'''
return 1
}

def run_win_ctest() {
bat '''
echo "windows ctest ..."
Expand All @@ -322,10 +370,10 @@ def run_win_ctest() {
time /t
'''
}

def run_win_test() {
bat '''
echo "windows test ..."
cd %WIN_CONNECTOR_ROOT%
xcopy /e/y/i/f %WIN_INTERNAL_ROOT%\\debug\\build\\lib\\taos.dll C:\\Windows\\System32
ls -l C:\\Windows\\System32\\taos.dll
time /t
Expand All @@ -343,29 +391,67 @@ 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'
en_doc_repo = 'docs.tdengine.com'
tools_repo = 'taos-tools'
}
stages {
stage('check') {
stage ('check doc file changed') {
agent{label " slave1_47 || slave1_48 || slave1_49 || slave1_50 || slave1_52 || slave1_59 || slave1_63 || worker03 || slave215 || slave217 || slave219 || Mac_catalina "}
steps {
check_docs()
}
}

stage ('pre for build docs') {
when {
allOf {
not { expression { env.CHANGE_BRANCH =~ /docs\// }}
}
beforeAgent true
expression { env.CHANGE_BRANCH =~ /(?i)doc.*/ || file_zh_changed != '' || file_en_changed != '' }
}
agent{label "doc_build_0_30"}
steps {
build_pre_docs()
}
}

stage('build Docs') {
when {
beforeAgent true
expression { env.CHANGE_BRANCH =~ /(?i)doc.*/ || file_zh_changed != '' || file_en_changed != '' }
}
parallel {
stage('check docs') {
agent{label " slave1_47 || slave1_48 || slave1_49 || slave1_50 || slave1_52 || slave1_59 || slave1_63 || worker03 || slave215 || slave217 || slave219 || Mac_catalina "}
stage('build zh docs') {
agent{label "doc_build_0_30"}
when {
expression { file_zh_changed != '' }
}
steps {
check_docs()
build_zh_docs()
}
}
stage('build en docs') {
agent{label "doc_build_0_30"}
when {
expression { file_en_changed != '' }
}
steps {
build_en_docs()
}
}
}
post {
unsuccessful {
error('build docs stage failed, terminating pipeline.')
}
}
}

stage('run test') {
when {
allOf {
not { expression { env.CHANGE_BRANCH =~ /docs\// }}
expression { docs_only == 0 }
not { expression { file_no_doc_changed == '' }}
}
}
parallel {
Expand All @@ -375,7 +461,6 @@ pipeline {
WIN_INTERNAL_ROOT="C:\\workspace\\${env.EXECUTOR_NUMBER}\\TDinternal"
WIN_COMMUNITY_ROOT="C:\\workspace\\${env.EXECUTOR_NUMBER}\\TDinternal\\community"
WIN_SYSTEM_TEST_ROOT="C:\\workspace\\${env.EXECUTOR_NUMBER}\\TDinternal\\community\\tests\\system-test"
WIN_CONNECTOR_ROOT="C:\\workspace\\${env.EXECUTOR_NUMBER}\\taos-connector-python"
}
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
Expand Down Expand Up @@ -420,7 +505,7 @@ pipeline {
script {
sh '''
mkdir -p ${WKDIR}/tmp/${BRANCH_NAME}_${BUILD_ID}
echo "''' + env.FILE_CHANGED + '''" > ${WKDIR}/tmp/${BRANCH_NAME}_${BUILD_ID}/docs_changed.txt
echo "''' + file_no_doc_changed + '''" > ${WKDIR}/tmp/${BRANCH_NAME}_${BUILD_ID}/docs_changed.txt
'''
sh '''
cd ${WKC}/tests/parallel_test
Expand Down Expand Up @@ -570,4 +655,4 @@ pipeline {
)
}
}
}
}
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.0.alpha")
SET(TD_VER_NUMBER "3.3.4.3.alpha")
ENDIF ()

IF (DEFINED VERCOMPATIBLE)
Expand Down
2 changes: 1 addition & 1 deletion docs/en/14-reference/03-taos-sql/10-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ TOP(expr, k)
UNIQUE(expr)
```

**Description**: The values that occur the first time in the specified column. The effect is similar to `distinct` keyword. For a table with composite primary key, only the data with the smallest primary key value is returned.
**Description**: Return the unique values of this column. The effect is similar to `distinct` keyword. Return the row with the earliest timestamp for duplicate data. For a table with composite primary key, only the data with the smallest primary key value is returned.

**Return value type**:Same as the data type of the column being operated upon

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 @@ -20,6 +20,10 @@ For TDengine 2.x installation packages by version, please visit [here](https://t

import Release from "/components/ReleaseV3";

## 3.3.4.3

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

## 3.3.3.0

<Release type="tdengine" version="3.3.3.0" />
Expand Down
33 changes: 32 additions & 1 deletion docs/zh/06-advanced/03-stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,35 @@ PAUSE STREAM [IF EXISTS] stream_name;
RESUME STREAM [IF EXISTS] [IGNORE UNTREATED] stream_name;
```

没有指定 IF EXISTS,如果该 stream 不存在,则报错。如果存在,则恢复流计算。指定了 IF EXISTS,如果 stream 不存在,则返回成功。如果存在,则恢复流计算。如果指定 IGNORE UNTREATED,则恢复流计算时,忽略流计算暂停期间写入的数据。
没有指定 IF EXISTS,如果该 stream 不存在,则报错。如果存在,则恢复流计算。指定了 IF EXISTS,如果 stream 不存在,则返回成功。如果存在,则恢复流计算。如果指定 IGNORE UNTREATED,则恢复流计算时,忽略流计算暂停期间写入的数据。

### 流计算升级故障恢复

升级 TDengine 后,如果流计算不兼容,需要删除流计算,然后重新创建流计算。步骤如下:

1.修改 taos.cfg,添加 disableStream 1

2.重启 taosd。如果启动失败,修改 stream 目录的名称,避免 taosd 启动的时候尝试加载 stream 目录下的流计算数据信息。不使用删除操作避免误操作导致的风险。需要修改的文件夹:$dataDir/vnode/vnode*/tq/stream,$dataDir 指 TDengine 存储数据的目录,在 $dataDir/vnode/ 目录下会有多个类似 vnode1 、vnode2...vnode* 的目录,全部需要修改里面的 tq/stream 目录的名字,改为 tq/stream.bk

3.启动 taos

```sql
drop stream xxxx; ---- xxx 指stream name
flush database stream_source_db; ---- 流计算读取数据的超级表所在的 database
flush database stream_dest_db; ---- 流计算写入数据的超级表所在的 database
```

举例:

```sql
create stream streams1 into test1.streamst as select _wstart, count(a) c1 from test.st interval(1s) ;
drop database streams1;
flush database test;
flush database test1;
```

4.关闭 taosd

5.修改 taos.cfg,去掉 disableStream 1,或将 disableStream 改为 0

6.启动 taosd
2 changes: 1 addition & 1 deletion docs/zh/07-develop/07-tmq.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ TDengine 提供了类似于消息队列产品的数据订阅和消费接口。

**注意**
在 TDengine 连接器实现中,对于订阅查询,有以下限制。
- 查询语句限制:订阅查询只能使用 select 语句,不支持其他类型的SQL,如 insert、update 或 delete 等。
- 查询语句限制:订阅查询只能使用 select 语句,并不支持其他类型的SQL,如订阅库,订阅超级表(非 select 方式),insert、update 或 delete 等。
- 原始始数据查询:订阅查询只能查询原始数据,而不能查询聚合或计算结果。
- 时间顺序限制:订阅查询只能按照时间正序查询数据。

Expand Down
Loading

0 comments on commit 20ad165

Please sign in to comment.