Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f86bfb43
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f86bfb43
编写于
11月 07, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into fix/liao_cov
上级
27040431
76649005
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
146 addition
and
8 deletion
+146
-8
cmake/taosws_CMakeLists.txt.in
cmake/taosws_CMakeLists.txt.in
+1
-1
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+17
-3
source/libs/function/src/functionMgt.c
source/libs/function/src/functionMgt.c
+5
-1
tests/system-test/2-query/countAlwaysReturnValue.py
tests/system-test/2-query/countAlwaysReturnValue.py
+115
-0
tests/system-test/2-query/hyperloglog.py
tests/system-test/2-query/hyperloglog.py
+1
-1
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+7
-2
未找到文件。
cmake/taosws_CMakeLists.txt.in
浏览文件 @
f86bfb43
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# taosws-rs
# taosws-rs
ExternalProject_Add(taosws-rs
ExternalProject_Add(taosws-rs
GIT_REPOSITORY https://github.com/taosdata/taos-connector-rust.git
GIT_REPOSITORY https://github.com/taosdata/taos-connector-rust.git
GIT_TAG
0373a70
GIT_TAG
38c4599
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosws-rs"
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosws-rs"
BINARY_DIR ""
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
#BUILD_IN_SOURCE TRUE
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
f86bfb43
...
@@ -181,6 +181,7 @@ typedef enum { UNKNOWN_BIN = 0, USER_INPUT_BIN, LINEAR_BIN, LOG_BIN } EHistoBinT
...
@@ -181,6 +181,7 @@ typedef enum { UNKNOWN_BIN = 0, USER_INPUT_BIN, LINEAR_BIN, LOG_BIN } EHistoBinT
typedef
struct
SHLLFuncInfo
{
typedef
struct
SHLLFuncInfo
{
uint64_t
result
;
uint64_t
result
;
uint64_t
totalCount
;
uint8_t
buckets
[
HLL_BUCKETS
];
uint8_t
buckets
[
HLL_BUCKETS
];
}
SHLLInfo
;
}
SHLLInfo
;
...
@@ -551,7 +552,7 @@ int32_t countFunction(SqlFunctionCtx* pCtx) {
...
@@ -551,7 +552,7 @@ int32_t countFunction(SqlFunctionCtx* pCtx) {
if
(
tsCountAlwaysReturnValue
)
{
if
(
tsCountAlwaysReturnValue
)
{
pResInfo
->
numOfRes
=
1
;
pResInfo
->
numOfRes
=
1
;
}
else
{
}
else
{
SET_VAL
(
pResInfo
,
1
,
1
);
SET_VAL
(
pResInfo
,
*
((
int64_t
*
)
buf
)
,
1
);
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -4605,7 +4606,14 @@ int32_t hllFunction(SqlFunctionCtx* pCtx) {
...
@@ -4605,7 +4606,14 @@ int32_t hllFunction(SqlFunctionCtx* pCtx) {
}
}
}
}
SET_VAL
(
GET_RES_INFO
(
pCtx
),
numOfElems
,
1
);
pInfo
->
totalCount
+=
numOfElems
;
if
(
pInfo
->
totalCount
==
0
&&
!
tsCountAlwaysReturnValue
)
{
SET_VAL
(
GET_RES_INFO
(
pCtx
),
0
,
1
);
}
else
{
SET_VAL
(
GET_RES_INFO
(
pCtx
),
1
,
1
);
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -4615,6 +4623,7 @@ static void hllTransferInfo(SHLLInfo* pInput, SHLLInfo* pOutput) {
...
@@ -4615,6 +4623,7 @@ static void hllTransferInfo(SHLLInfo* pInput, SHLLInfo* pOutput) {
pOutput
->
buckets
[
k
]
=
pInput
->
buckets
[
k
];
pOutput
->
buckets
[
k
]
=
pInput
->
buckets
[
k
];
}
}
}
}
pOutput
->
totalCount
+=
pInput
->
totalCount
;
}
}
int32_t
hllFunctionMerge
(
SqlFunctionCtx
*
pCtx
)
{
int32_t
hllFunctionMerge
(
SqlFunctionCtx
*
pCtx
)
{
...
@@ -4632,7 +4641,12 @@ int32_t hllFunctionMerge(SqlFunctionCtx* pCtx) {
...
@@ -4632,7 +4641,12 @@ int32_t hllFunctionMerge(SqlFunctionCtx* pCtx) {
hllTransferInfo
(
pInputInfo
,
pInfo
);
hllTransferInfo
(
pInputInfo
,
pInfo
);
}
}
SET_VAL
(
GET_RES_INFO
(
pCtx
),
1
,
1
);
if
(
pInfo
->
totalCount
==
0
&&
!
tsCountAlwaysReturnValue
)
{
SET_VAL
(
GET_RES_INFO
(
pCtx
),
0
,
1
);
}
else
{
SET_VAL
(
GET_RES_INFO
(
pCtx
),
1
,
1
);
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
source/libs/function/src/functionMgt.c
浏览文件 @
f86bfb43
...
@@ -241,7 +241,11 @@ bool fmIsNotNullOutputFunc(int32_t funcId) {
...
@@ -241,7 +241,11 @@ bool fmIsNotNullOutputFunc(int32_t funcId) {
FUNCTION_TYPE_LAST_MERGE
==
funcMgtBuiltins
[
funcId
].
type
||
FUNCTION_TYPE_LAST_MERGE
==
funcMgtBuiltins
[
funcId
].
type
||
FUNCTION_TYPE_FIRST
==
funcMgtBuiltins
[
funcId
].
type
||
FUNCTION_TYPE_FIRST
==
funcMgtBuiltins
[
funcId
].
type
||
FUNCTION_TYPE_FIRST_PARTIAL
==
funcMgtBuiltins
[
funcId
].
type
||
FUNCTION_TYPE_FIRST_PARTIAL
==
funcMgtBuiltins
[
funcId
].
type
||
FUNCTION_TYPE_FIRST_MERGE
==
funcMgtBuiltins
[
funcId
].
type
;
FUNCTION_TYPE_FIRST_MERGE
==
funcMgtBuiltins
[
funcId
].
type
||
FUNCTION_TYPE_COUNT
==
funcMgtBuiltins
[
funcId
].
type
||
FUNCTION_TYPE_HYPERLOGLOG
==
funcMgtBuiltins
[
funcId
].
type
||
FUNCTION_TYPE_HYPERLOGLOG_PARTIAL
==
funcMgtBuiltins
[
funcId
].
type
||
FUNCTION_TYPE_HYPERLOGLOG_MERGE
==
funcMgtBuiltins
[
funcId
].
type
;
}
}
bool
fmIsSelectValueFunc
(
int32_t
funcId
)
{
bool
fmIsSelectValueFunc
(
int32_t
funcId
)
{
...
...
tests/system-test/2-query/countAlwaysReturnValue.py
0 → 100644
浏览文件 @
f86bfb43
import
taos
import
sys
import
datetime
import
inspect
from
util.log
import
*
from
util.sql
import
*
from
util.cases
import
*
import
random
class
TDTestCase
:
updatecfgDict
=
{
"countAlwaysReturnValue"
:
0
}
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
False
)
def
prepare_data
(
self
,
dbname
=
"db"
):
tdSql
.
execute
(
f
"create database if not exists
{
dbname
}
keep 3650 duration 1000"
)
tdSql
.
execute
(
f
"use
{
dbname
}
"
)
tdSql
.
execute
(
f
"create table
{
dbname
}
.tb (ts timestamp, c0 int)"
)
tdSql
.
execute
(
f
"create table
{
dbname
}
.stb (ts timestamp, c0 int) tags (t0 int)"
)
tdSql
.
execute
(
f
"create table
{
dbname
}
.ctb1 using
{
dbname
}
.stb tags (1)"
)
tdSql
.
execute
(
f
"create table
{
dbname
}
.ctb2 using
{
dbname
}
.stb tags (2)"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.tb values (now(), NULL)"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.ctb1 values (now(), NULL)"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.ctb2 values (now() + 1s, NULL)"
)
def
test_results
(
self
,
dbname
=
"db"
):
# count
tdSql
.
query
(
f
"select count(c0) from
{
dbname
}
.tb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select count(NULL) from
{
dbname
}
.tb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select c0,count(c0) from
{
dbname
}
.tb group by c0"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
query
(
f
"select count(c0) from
{
dbname
}
.stb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select count(NULL) from
{
dbname
}
.stb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select c0,count(c0) from
{
dbname
}
.stb group by c0"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
query
(
f
"select count(NULL)"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
# hyperloglog
tdSql
.
query
(
f
"select hyperloglog(c0) from
{
dbname
}
.tb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select hyperloglog(NULL) from
{
dbname
}
.tb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select c0,hyperloglog(c0) from
{
dbname
}
.tb group by c0"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
query
(
f
"select hyperloglog(c0) from
{
dbname
}
.stb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select hyperloglog(NULL) from
{
dbname
}
.stb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select c0,hyperloglog(c0) from
{
dbname
}
.stb group by c0"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
query
(
f
"select hyperloglog(NULL)"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
def
run
(
self
):
tdSql
.
prepare
()
tdLog
.
printNoPrefix
(
"==========step1:prepare data =============="
)
self
.
prepare_data
()
tdLog
.
printNoPrefix
(
"==========step2:test results =============="
)
self
.
test_results
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tests/system-test/2-query/hyperloglog.py
浏览文件 @
f86bfb43
...
@@ -28,7 +28,7 @@ ALL_COL = [ INT_COL, BINT_COL, SINT_COL, TINT_COL, FLOAT_COL, DOUBLE_COL, BOOL_C
...
@@ -28,7 +28,7 @@ ALL_COL = [ INT_COL, BINT_COL, SINT_COL, TINT_COL, FLOAT_COL, DOUBLE_COL, BOOL_C
DBNAME
=
"db"
DBNAME
=
"db"
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
updatecfgDict
=
{
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
...
...
tests/system-test/fulltest.sh
浏览文件 @
f86bfb43
...
@@ -17,7 +17,7 @@ python3 ./test.py -f 0-others/taosdShell.py -N 5 -M 3 -Q 3
...
@@ -17,7 +17,7 @@ python3 ./test.py -f 0-others/taosdShell.py -N 5 -M 3 -Q 3
python3 ./test.py
-f
0-others/sysinfo.py
python3 ./test.py
-f
0-others/sysinfo.py
python3 ./test.py
-f
0-others/user_control.py
python3 ./test.py
-f
0-others/user_control.py
python3 ./test.py
-f
0-others/fsync.py
python3 ./test.py
-f
0-others/fsync.py
python3 ./test.py
-f
0-others/compatibility.py
python3 ./test.py
-f
0-others/compatibility.py
python3 ./test.py
-f
1-insert/alter_database.py
python3 ./test.py
-f
1-insert/alter_database.py
python3 ./test.py
-f
1-insert/influxdb_line_taosc_insert.py
python3 ./test.py
-f
1-insert/influxdb_line_taosc_insert.py
python3 ./test.py
-f
1-insert/opentsdb_telnet_line_taosc_insert.py
python3 ./test.py
-f
1-insert/opentsdb_telnet_line_taosc_insert.py
...
@@ -76,6 +76,8 @@ python3 ./test.py -f 2-query/count_partition.py
...
@@ -76,6 +76,8 @@ python3 ./test.py -f 2-query/count_partition.py
python3 ./test.py
-f
2-query/count_partition.py
-R
python3 ./test.py
-f
2-query/count_partition.py
-R
python3 ./test.py
-f
2-query/count.py
python3 ./test.py
-f
2-query/count.py
python3 ./test.py
-f
2-query/count.py
-R
python3 ./test.py
-f
2-query/count.py
-R
python3 ./test.py
-f
2-query/countAlwaysReturnValue.py
python3 ./test.py
-f
2-query/countAlwaysReturnValue.py
-R
python3 ./test.py
-f
2-query/db.py
python3 ./test.py
-f
2-query/db.py
python3 ./test.py
-f
2-query/db.py
-R
python3 ./test.py
-f
2-query/db.py
-R
python3 ./test.py
-f
2-query/diff.py
python3 ./test.py
-f
2-query/diff.py
...
@@ -385,6 +387,7 @@ python3 ./test.py -f 2-query/Today.py -Q 2
...
@@ -385,6 +387,7 @@ python3 ./test.py -f 2-query/Today.py -Q 2
python3 ./test.py
-f
2-query/max.py
-Q
2
python3 ./test.py
-f
2-query/max.py
-Q
2
python3 ./test.py
-f
2-query/min.py
-Q
2
python3 ./test.py
-f
2-query/min.py
-Q
2
python3 ./test.py
-f
2-query/count.py
-Q
2
python3 ./test.py
-f
2-query/count.py
-Q
2
python3 ./test.py
-f
2-query/countAlwaysReturnValue.py
-Q
2
python3 ./test.py
-f
2-query/last.py
-Q
2
python3 ./test.py
-f
2-query/last.py
-Q
2
python3 ./test.py
-f
2-query/first.py
-Q
2
python3 ./test.py
-f
2-query/first.py
-Q
2
python3 ./test.py
-f
2-query/To_iso8601.py
-Q
2
python3 ./test.py
-f
2-query/To_iso8601.py
-Q
2
...
@@ -480,6 +483,7 @@ python3 ./test.py -f 2-query/Today.py -Q 3
...
@@ -480,6 +483,7 @@ python3 ./test.py -f 2-query/Today.py -Q 3
python3 ./test.py
-f
2-query/max.py
-Q
3
python3 ./test.py
-f
2-query/max.py
-Q
3
python3 ./test.py
-f
2-query/min.py
-Q
3
python3 ./test.py
-f
2-query/min.py
-Q
3
python3 ./test.py
-f
2-query/count.py
-Q
3
python3 ./test.py
-f
2-query/count.py
-Q
3
python3 ./test.py
-f
2-query/countAlwaysReturnValue.py
-Q
3
python3 ./test.py
-f
2-query/last.py
-Q
3
python3 ./test.py
-f
2-query/last.py
-Q
3
python3 ./test.py
-f
2-query/first.py
-Q
3
python3 ./test.py
-f
2-query/first.py
-Q
3
python3 ./test.py
-f
2-query/To_iso8601.py
-Q
3
python3 ./test.py
-f
2-query/To_iso8601.py
-Q
3
...
@@ -577,6 +581,7 @@ python3 ./test.py -f 2-query/Today.py -Q 4
...
@@ -577,6 +581,7 @@ python3 ./test.py -f 2-query/Today.py -Q 4
python3 ./test.py
-f
2-query/max.py
-Q
4
python3 ./test.py
-f
2-query/max.py
-Q
4
python3 ./test.py
-f
2-query/min.py
-Q
4
python3 ./test.py
-f
2-query/min.py
-Q
4
python3 ./test.py
-f
2-query/count.py
-Q
4
python3 ./test.py
-f
2-query/count.py
-Q
4
python3 ./test.py
-f
2-query/countAlwaysReturnValue.py
-Q
4
python3 ./test.py
-f
2-query/last.py
-Q
4
python3 ./test.py
-f
2-query/last.py
-Q
4
python3 ./test.py
-f
2-query/first.py
-Q
4
python3 ./test.py
-f
2-query/first.py
-Q
4
python3 ./test.py
-f
2-query/To_iso8601.py
-Q
4
python3 ./test.py
-f
2-query/To_iso8601.py
-Q
4
...
@@ -592,7 +597,7 @@ python3 ./test.py -f 2-query/apercentile.py -Q 4
...
@@ -592,7 +597,7 @@ python3 ./test.py -f 2-query/apercentile.py -Q 4
python3 ./test.py
-f
2-query/abs.py
-Q
4
python3 ./test.py
-f
2-query/abs.py
-Q
4
python3 ./test.py
-f
2-query/ceil.py
-Q
4
python3 ./test.py
-f
2-query/ceil.py
-Q
4
python3 ./test.py
-f
2-query/floor.py
-Q
4
python3 ./test.py
-f
2-query/floor.py
-Q
4
python3 ./test.py
-f
2-query/round.py
-Q
4
python3 ./test.py
-f
2-query/round.py
-Q
4
python3 ./test.py
-f
2-query/log.py
-Q
4
python3 ./test.py
-f
2-query/log.py
-Q
4
python3 ./test.py
-f
2-query/pow.py
-Q
4
python3 ./test.py
-f
2-query/pow.py
-Q
4
python3 ./test.py
-f
2-query/sqrt.py
-Q
4
python3 ./test.py
-f
2-query/sqrt.py
-Q
4
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录