提交 77ad2996 编写于 作者: A Alex Duan

Merge branch '2.4' of github.com:taosdata/TDengine into 2.4

version: 1.0.{build}
image:
- Visual Studio 2015
- macos
environment:
matrix:
- ARCH: amd64
- ARCH: x86
matrix:
exclude:
- image: macos
ARCH: x86
for:
-
matrix:
only:
- image: Visual Studio 2015
clone_folder: c:\dev\TDengine
clone_depth: 1
init:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %ARCH%
before_build:
- cd c:\dev\TDengine
- md build
build_script:
- cd build
- cmake -G "NMake Makefiles" .. -DBUILD_JDBC=false
- nmake install
-
matrix:
only:
- image: macos
clone_depth: 1
build_script:
- mkdir debug
- cd debug
- cmake .. > /dev/null
- make > /dev/null
notifications:
- provider: Email
to:
- sangshuduo@gmail.com
on_build_success: true
on_build_failure: true
on_build_status_changed: true
...@@ -4,7 +4,7 @@ PROJECT(TDengine) ...@@ -4,7 +4,7 @@ PROJECT(TDengine)
IF (DEFINED VERNUMBER) IF (DEFINED VERNUMBER)
SET(TD_VER_NUMBER ${VERNUMBER}) SET(TD_VER_NUMBER ${VERNUMBER})
ELSE () ELSE ()
SET(TD_VER_NUMBER "2.4.0.3") SET(TD_VER_NUMBER "2.4.0.4")
ENDIF () ENDIF ()
IF (DEFINED VERCOMPATIBLE) IF (DEFINED VERCOMPATIBLE)
......
...@@ -1801,9 +1801,9 @@ TDengine 中的表(列)名命名规则如下: ...@@ -1801,9 +1801,9 @@ TDengine 中的表(列)名命名规则如下:
1. 在where条件中时,支持函数match/nmatch/between and/like/and/or/is null/is no null,不支持in 1. 在where条件中时,支持函数match/nmatch/between and/like/and/or/is null/is no null,不支持in
```mysql ```mysql
select * from s1 where info'k1' match 'v*'; select * from s1 where info->'k1' match 'v*';
select * from s1 where info'k1' like 'v%' and info contains 'k2'; select * from s1 where info->'k1' like 'v%' and info contains 'k2';
select * from s1 where info is null; select * from s1 where info is null;
...@@ -1815,7 +1815,7 @@ TDengine 中的表(列)名命名规则如下: ...@@ -1815,7 +1815,7 @@ TDengine 中的表(列)名命名规则如下:
3. 支持distinct操作. 3. 支持distinct操作.
```mysql ```mysql
select distinct info'k1' from s1 select distinct info->'k1' from s1
``` ```
5. 标签操作 5. 标签操作
...@@ -1846,7 +1846,7 @@ TDengine 中的表(列)名命名规则如下: ...@@ -1846,7 +1846,7 @@ TDengine 中的表(列)名命名规则如下:
比如暂不支持 比如暂不支持
```mysql ```mysql
select jtag'key' from (select jtag from stable) select jtag->'key' from (select jtag from stable)
``` ```
不支持 不支持
......
...@@ -11,12 +11,16 @@ RUN tar -zxf ${pkgFile} ...@@ -11,12 +11,16 @@ RUN tar -zxf ${pkgFile}
WORKDIR /root/${dirName}/ WORKDIR /root/${dirName}/
RUN /bin/bash install.sh -e no RUN /bin/bash install.sh -e no
RUN apt-get clean && apt-get update && apt-get install -y locales && locale-gen en_US.UTF-8 ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean && apt-get update && apt-get install -y locales tzdata netcat && locale-gen en_US.UTF-8
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib" \ ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib" \
LC_CTYPE=en_US.UTF-8 \ LC_CTYPE=en_US.UTF-8 \
LANG=en_US.UTF-8 \ LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 LC_ALL=en_US.UTF-8
EXPOSE 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 EXPOSE 6030-6049
EXPOSE 6030-6039/udp
COPY ./bin/* /usr/bin/
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
CMD ["taosd"] CMD ["taosd"]
VOLUME [ "/var/lib/taos", "/var/log/taos","/etc/taos/" ] VOLUME [ "/var/lib/taos", "/var/log/taos", "/corefile" ]
此差异已折叠。
#!/bin/sh
set -e
# for TZ awareness
if [ "$TZ" != "" ]; then
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
echo $TZ >/etc/timezone
fi
# option to disable taosadapter, default is no
DISABLE_ADAPTER=${TAOS_DISABLE_ADAPTER:-0}
unset TAOS_DISABLE_ADAPTER
# to get mnodeEpSet from data dir
DATA_DIR=${TAOS_DATA_DIR:-/var/lib/taos}
# append env to custom taos.cfg
CFG_DIR=/tmp/taos
CFG_FILE=$CFG_DIR/taos.cfg
mkdir -p $CFG_DIR >/dev/null 2>&1
[ -f /etc/taos/taos.cfg ] && cat /etc/taos/taos.cfg | grep -E -v "^#|^\s*$" >$CFG_FILE
env-to-cfg >>$CFG_FILE
FQDN=$(cat $CFG_FILE | grep -E -v "^#|^$" | grep fqdn | tail -n1 | sed -E 's/.*fqdn\s+//')
# ensure the fqdn is resolved as localhost
grep "$FQDN" /etc/hosts >/dev/null || echo "127.0.0.1 $FQDN" >>/etc/hosts
# parse first ep host and port
FIRST_EP_HOST=${TAOS_FIRST_EP%:*}
FIRST_EP_PORT=${TAOS_FIRST_EP#*:}
# in case of custom server port
SERVER_PORT=$(cat $CFG_FILE | grep -E -v "^#|^$" | grep serverPort | tail -n1 | sed -E 's/.*serverPort\s+//')
SERVER_PORT=${SERVER_PORT:-6030}
# for other binaries like interpreters
if echo $1 | grep -E "taosd$" - >/dev/null; then
true # will run taosd
else
cp -f $CFG_FILE /etc/taos/taos.cfg || true
$@
exit $?
fi
set +e
ulimit -c unlimited
# set core files pattern, maybe failed
sysctl -w kernel.core_pattern=/corefile/core-$FQDN-%e-%p >/dev/null >&1
set -e
if [ "$DISABLE_ADAPTER" = "0" ]; then
which taosadapter >/dev/null && taosadapter &
# wait for 6041 port ready
for _ in $(seq 1 20); do
nc -z localhost 6041 && break
sleep 0.5
done
fi
# if has mnode ep set or the host is first ep or not for cluster, just start.
if [ -f "$DATA_DIR/dnode/mnodeEpSet.json" ] ||
[ "$TAOS_FQDN" = "$FIRST_EP_HOST" ]; then
$@ -c $CFG_DIR
# others will first wait the first ep ready.
else
if [ "$TAOS_FIRST_EP" = "" ]; then
echo "run TDengine with single node."
$@ -c $CFG_DIR
exit $?
fi
while true; do
es=0
taos -h $FIRST_EP_HOST -P $FIRST_EP_PORT -n startup >/dev/null || es=$?
if [ "$es" -eq 0 ]; then
taos -h $FIRST_EP_HOST -P $FIRST_EP_PORT -s "create dnode \"$FQDN:$SERVER_PORT\";"
break
fi
sleep 1s
done
$@ -c $CFG_DIR
fi
#!/bin/sh
set -e
self=$0
snake_to_camel_case() {
echo $1 | awk -F _ '{printf "%s", $1; for(i=2; i<=NF; i++) printf "%s", toupper(substr($i,1,1)) substr($i,2); print"";}'
}
if echo $1 | grep -E "^$" - >/dev/null; then
export |grep -E 'TAOS_.*' -o| sed 's/TAOS_//' |tr A-Z a-z | awk -F"=" '{print "name=$(""'$self' " $1"); echo $name "$2}' |sh
else
snake_to_camel_case $1
fi
version: "3"
networks:
inter:
api:
services:
arbitrator:
image: tdengine/tdengine:$VERSION
command: tarbitrator
networks:
- inter
td-1:
image: tdengine/tdengine:$VERSION
networks:
- inter
environment:
TAOS_FQDN: "td-1"
TAOS_FIRST_EP: "td-1"
TAOS_NUM_OF_MNODES: "2"
TAOS_REPLICA: "2"
TAOS_ARBITRATOR: arbitrator:6042
volumes:
- taosdata-td1:/var/lib/taos/
- taoslog-td1:/var/log/taos/
td-2:
image: tdengine/tdengine:$VERSION
networks:
- inter
environment:
TAOS_FQDN: "td-2"
TAOS_FIRST_EP: "td-1"
TAOS_NUM_OF_MNODES: "2"
TAOS_REPLICA: "2"
TAOS_ARBITRATOR: arbitrator:6042
volumes:
- taosdata-td2:/var/lib/taos/
- taoslog-td2:/var/log/taos/
adapter:
image: tdengine/tdengine:$VERSION
command: taosadapter
networks:
- inter
environment:
TAOS_FIRST_EP: "td-1"
TOAS_SECOND_EP: "td-2"
deploy:
replicas: 4
update_config:
parallelism: 4
nginx:
image: nginx
depends_on:
- adapter
networks:
- inter
- api
ports:
- 6041:6041
- 6044:6044/udp
command: [
"sh",
"-c",
"while true;
do curl -s http://adapter:6041/-/ping >/dev/null && break;
done;
printf 'server{listen 6041;location /{proxy_pass http://adapter:6041;}}'
> /etc/nginx/conf.d/rest.conf;
printf 'stream{server{listen 6044 udp;proxy_pass adapter:6044;}}'
>> /etc/nginx/nginx.conf;cat /etc/nginx/nginx.conf;
nginx -g 'daemon off;'",
]
volumes:
taosdata-td1:
taoslog-td1:
taosdata-td2:
taoslog-td2:
name: tdengine name: tdengine
base: core20 base: core20
version: '2.4.0.3' version: '2.4.0.4'
icon: snap/gui/t-dengine.svg icon: snap/gui/t-dengine.svg
summary: an open-source big data platform designed and optimized for IoT. summary: an open-source big data platform designed and optimized for IoT.
description: | description: |
......
...@@ -4656,7 +4656,7 @@ static int32_t validateSQLExprItemSQLFunc(SSqlCmd* pCmd, tSqlExpr* pExpr, ...@@ -4656,7 +4656,7 @@ static int32_t validateSQLExprItemSQLFunc(SSqlCmd* pCmd, tSqlExpr* pExpr,
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
static int32_t validateSQLExprItemArithmeticExpr(SSqlCmd* pCmd, tSqlExpr* pExpr, SQueryInfo* pQueryInfo, SColumnList* pList, static int32_t validateSQLExprItemOperatorExpr(SSqlCmd* pCmd, tSqlExpr* pExpr, SQueryInfo* pQueryInfo, SColumnList* pList,
int32_t* type, uint64_t* uid, int32_t* height) { int32_t* type, uint64_t* uid, int32_t* height) {
uint64_t uidLeft = 0; uint64_t uidLeft = 0;
uint64_t uidRight = 0; uint64_t uidRight = 0;
...@@ -4685,7 +4685,9 @@ static int32_t validateSQLExprItemArithmeticExpr(SSqlCmd* pCmd, tSqlExpr* pExpr, ...@@ -4685,7 +4685,9 @@ static int32_t validateSQLExprItemArithmeticExpr(SSqlCmd* pCmd, tSqlExpr* pExpr,
*height = (leftHeight > rightHeight) ? leftHeight + 1 : rightHeight+1; *height = (leftHeight > rightHeight) ? leftHeight + 1 : rightHeight+1;
{ {
assert(leftType != SQLEXPR_TYPE_UNASSIGNED && rightType != SQLEXPR_TYPE_UNASSIGNED); if (leftType == SQLEXPR_TYPE_UNASSIGNED || rightType == SQLEXPR_TYPE_UNASSIGNED) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "invalid operand expression");
}
// return invalid operation when one child aggregate and the other child scalar or column // return invalid operation when one child aggregate and the other child scalar or column
if ((leftType == SQLEXPR_TYPE_AGG && rightType == SQLEXPR_TYPE_SCALAR) || (rightType == SQLEXPR_TYPE_AGG && leftType == SQLEXPR_TYPE_SCALAR)) { if ((leftType == SQLEXPR_TYPE_AGG && rightType == SQLEXPR_TYPE_SCALAR) || (rightType == SQLEXPR_TYPE_AGG && leftType == SQLEXPR_TYPE_SCALAR)) {
...@@ -4713,6 +4715,11 @@ static int32_t validateSQLExprItemArithmeticExpr(SSqlCmd* pCmd, tSqlExpr* pExpr, ...@@ -4713,6 +4715,11 @@ static int32_t validateSQLExprItemArithmeticExpr(SSqlCmd* pCmd, tSqlExpr* pExpr,
rightType == SQLEXPR_TYPE_AGG || rightType == SQLEXPR_TYPE_SCALAR) { rightType == SQLEXPR_TYPE_AGG || rightType == SQLEXPR_TYPE_SCALAR) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg4); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg4);
} }
} else if (pExpr->tokenId == TK_ISNULL || pExpr->tokenId == TK_NOTNULL ||
pExpr->tokenId == TK_IS || pExpr->tokenId == TK_LIKE ||
pExpr->tokenId == TK_MATCH || pExpr->tokenId == TK_NMATCH ||
pExpr->tokenId == TK_CONTAINS || pExpr->tokenId == TK_IN) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "unsupported filtering operations");
} }
} }
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -4728,7 +4735,7 @@ static int32_t validateSQLExprItem(SSqlCmd* pCmd, tSqlExpr* pExpr, ...@@ -4728,7 +4735,7 @@ static int32_t validateSQLExprItem(SSqlCmd* pCmd, tSqlExpr* pExpr,
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
if (pExpr->type == SQL_NODE_EXPR) { if (pExpr->type == SQL_NODE_EXPR) {
int32_t ret = validateSQLExprItemArithmeticExpr(pCmd, pExpr, pQueryInfo, pList, type, uid, height); int32_t ret = validateSQLExprItemOperatorExpr(pCmd, pExpr, pQueryInfo, pList, type, uid, height);
if (ret != TSDB_CODE_SUCCESS) { if (ret != TSDB_CODE_SUCCESS) {
return ret; return ret;
} }
......
...@@ -213,8 +213,8 @@ TAOS *taos_connect_internal(const char *ip, const char *user, const char *pass, ...@@ -213,8 +213,8 @@ TAOS *taos_connect_internal(const char *ip, const char *user, const char *pass,
tscDebug("%p DB connection is opening, rpcObj: %p, dnodeConn:%p", pObj, pObj->pRpcObj, pObj->pRpcObj->pDnodeConn); tscDebug("%p DB connection is opening, rpcObj: %p, dnodeConn:%p", pObj, pObj->pRpcObj, pObj->pRpcObj->pDnodeConn);
taos_free_result(pSql); taos_free_result(pSql);
// version compare only requires the first 3 segments of the version string // version compare only requires the first 1 segments of the version string
int code = taosCheckVersion(version, taos_get_server_info(pObj), 3); int code = taosCheckVersion(version, taos_get_server_info(pObj), 1);
if (code != 0) { if (code != 0) {
terrno = code; terrno = code;
taos_close(pObj); taos_close(pObj);
......
Subproject commit 8c11dcf6856bca0860e7e9999f57274864218f4f Subproject commit a6531c1528b5b50fb234e2519106feae91cc8d38
...@@ -243,7 +243,7 @@ static int32_t mnodeProcessHeartBeatMsg(SMnodeMsg *pMsg) { ...@@ -243,7 +243,7 @@ static int32_t mnodeProcessHeartBeatMsg(SMnodeMsg *pMsg) {
} }
SHeartBeatMsg *pHBMsg = pMsg->rpcMsg.pCont; SHeartBeatMsg *pHBMsg = pMsg->rpcMsg.pCont;
if (taosCheckVersion(pHBMsg->clientVer, version, 3) != TSDB_CODE_SUCCESS) { if (taosCheckVersion(pHBMsg->clientVer, version, 1) != TSDB_CODE_SUCCESS) {
rpcFreeCont(pRsp); rpcFreeCont(pRsp);
return TSDB_CODE_TSC_INVALID_VERSION; // todo change the error code return TSDB_CODE_TSC_INVALID_VERSION; // todo change the error code
} }
...@@ -307,7 +307,7 @@ static int32_t mnodeProcessConnectMsg(SMnodeMsg *pMsg) { ...@@ -307,7 +307,7 @@ static int32_t mnodeProcessConnectMsg(SMnodeMsg *pMsg) {
goto connect_over; goto connect_over;
} }
code = taosCheckVersion(pConnectMsg->clientVersion, version, 3); code = taosCheckVersion(pConnectMsg->clientVersion, version, 1);
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
goto connect_over; goto connect_over;
} }
......
...@@ -8471,7 +8471,7 @@ static int32_t deserializeColFilterInfo(SColumnFilterInfo* pColFilters, int16_t ...@@ -8471,7 +8471,7 @@ static int32_t deserializeColFilterInfo(SColumnFilterInfo* pColFilters, int16_t
int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) { int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) {
int32_t code = TSDB_CODE_SUCCESS; int32_t code = TSDB_CODE_SUCCESS;
if (taosCheckVersion(pQueryMsg->version, version, 3) != 0) { if (taosCheckVersion(pQueryMsg->version, version, 1) != 0) {
return TSDB_CODE_QRY_INVALID_MSG; return TSDB_CODE_QRY_INVALID_MSG;
} }
......
...@@ -1129,6 +1129,56 @@ class TDTestCase: ...@@ -1129,6 +1129,56 @@ class TDTestCase:
tdSql.error('select 1 != 2 and 1 < 2 or \'abc123\' or 2 between \'abc123\' and 5 and false or "abc123" from tb;') tdSql.error('select 1 != 2 and 1 < 2 or \'abc123\' or 2 between \'abc123\' and 5 and false or "abc123" from tb;')
tdSql.error('select \'1234\' or 1 < 2 or \'aace\' and "cde" between 4 and "def" and "ckas" or 10.1 from tb;') tdSql.error('select \'1234\' or 1 < 2 or \'aace\' and "cde" between 4 and "def" and "ckas" or 10.1 from tb;')
#operator: is NULL
tdSql.error('select 1 is NULL from tb;')
tdSql.error('select 1.0 is NULL from tb;')
tdSql.error('select true is NULL from tb;')
tdSql.error('select \'a\' is NULL from tb;')
tdSql.error('select "abc" is NULL from tb;')
tdSql.error('select 1 is NULL and 1.0 is NULL or "abc" is NULL from tb;')
#operator: is not NULL
tdSql.error('select 1 is not NULL from tb;')
tdSql.error('select 1.0 is not NULL from tb;')
tdSql.error('select true is not NULL from tb;')
tdSql.error('select \'a\' is not NULL from tb;')
tdSql.error('select "abc" is not NULL from tb;')
tdSql.error('select 1 is not NULL and 1.0 is not NULL or "abc" is not NULL from tb;')
#operator: like
tdSql.error('select 1 like 1 from tb;')
tdSql.error('select 1.0 like 1.0 from tb;')
tdSql.error('select true like true from tb;')
tdSql.error('select \'abc\' like \'a_\' from tb;')
tdSql.error('select "abc" like "ab__%" from tb;')
tdSql.error('select 1 like 1 and 1.0 like 1.0 or "abc" like "a%" from tb;')
#operator: match
tdSql.error('select 1 match 1 from tb;')
tdSql.error('select 1.0 match 1.0 from tb;')
tdSql.error('select true match true from tb;')
tdSql.error('select \'abc\' match \'a_\' from tb;')
tdSql.error('select "abc" match "ab__%" from tb;')
tdSql.error('select 1 match 1 and 1.0 match 1.0 or "abc" match "a%" from tb;')
#operator: nmatch
tdSql.error('select 1 nmatch 1 from tb;')
tdSql.error('select 1.0 nmatch 1.0 from tb;')
tdSql.error('select true nmatch true from tb;')
tdSql.error('select \'abc\' nmatch \'a_\' from tb;')
tdSql.error('select "abc" nmatch "ab__%" from tb;')
tdSql.error('select 1 nmatch 1 and 1.0 nmatch 1.0 or "abc" nmatch "a%" from tb;')
#operator: in
tdSql.error('select 1 in 1 from tb;')
tdSql.error('select 1 in (1, 2, 3) from tb;')
tdSql.error('select 1.0 in 1.0 from tb;')
tdSql.error('select 1.0 in (1.0, 2.0, 3.0) from tb;')
tdSql.error('select true in (true, false, true) from tb;')
tdSql.error('select \'abc\' in (\'acd\', \'bce\') from tb;')
tdSql.error('select "abc" in ("acd", "bce") from tb;')
tdSql.error('select 1 in (1,2,3) and 1.0 in (1.0,2.0,3.0) or "abc" in ("abc","cde") from tb;')
tdSql.execute('drop database db') tdSql.execute('drop database db')
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
...@@ -297,6 +297,91 @@ class TDTestCase: ...@@ -297,6 +297,91 @@ class TDTestCase:
tdSql.error('select percentile(value, 50) or diff(value) = ceil(value) and apercentile(value, 50) from tb') tdSql.error('select percentile(value, 50) or diff(value) = ceil(value) and apercentile(value, 50) from tb')
tdSql.error('select floor(3.5) or round(3.5) and ceil(3.5) > true and round(3.5) or 3 from tb') tdSql.error('select floor(3.5) or round(3.5) and ceil(3.5) > true and round(3.5) or 3 from tb')
#operator: is NULL
tdSql.error('select count(*) is NULL from tb;')
tdSql.error('select avg(value) is NULL from tb;')
tdSql.error('select twa(value) is NULL from tb;')
tdSql.error('select sum(value) is NULL from tb;')
tdSql.error('select stddev(value) is NULL from tb;')
tdSql.error('select min(value) is NULL from tb;')
tdSql.error('select max(value) is NULL from tb;')
tdSql.error('select first(*) is NULL from tb;')
tdSql.error('select last(*) is NULL from tb;')
tdSql.error('select top(value, 3) is NULL or bottom(value,3) is NULL from tb;')
tdSql.error('select percentile(value, 50) is NULL or apercentile(value, 50) is NULL from tb')
tdSql.error('select diff(value) is NULL or ceil(value) is NULL from tb')
tdSql.error('select floor(3.5) is NULL or round(3.5) is NULL or ceil(3.5) is NULL from tb')
#operator: is not NULL
tdSql.error('select count(*) is not NULL from tb;')
tdSql.error('select avg(value) is not NULL from tb;')
tdSql.error('select twa(value) is not NULL from tb;')
tdSql.error('select sum(value) is not NULL from tb;')
tdSql.error('select stddev(value) is not NULL from tb;')
tdSql.error('select min(value) is not NULL from tb;')
tdSql.error('select max(value) is not NULL from tb;')
tdSql.error('select first(*) is not NULL from tb;')
tdSql.error('select last(*) is not NULL from tb;')
tdSql.error('select top(value, 3) is not NULL or bottom(value,3) is not NULL from tb;')
tdSql.error('select percentile(value, 50) is not NULL or apercentile(value, 50) is not NULL from tb')
tdSql.error('select diff(value) is not NULL or ceil(value) is not NULL from tb')
tdSql.error('select floor(3.5) is not NULL or round(3.5) is not NULL or ceil(3.5) is not NULL from tb')
#operator: like
tdSql.error('select count(*) like "abc" from tb;')
tdSql.error('select avg(value) like "abc" from tb;')
tdSql.error('select twa(value) like "abc" from tb;')
tdSql.error('select sum(value) like "abc" from tb;')
tdSql.error('select stddev(value) like "abc" from tb;')
tdSql.error('select min(value) like "abc" from tb;')
tdSql.error('select max(value) like "abc" from tb;')
tdSql.error('select first(*) like "abc" from tb;')
tdSql.error('select last(*) like "abc" from tb;')
tdSql.error('select top(value, 3) like "abc" or bottom(value,3) like "abc" from tb;')
tdSql.error('select percentile(value, 50) like "abc" or apercentile(value, 50) like "abc" from tb')
tdSql.error('select diff(value) like "abc" or ceil(value) like "abc" from tb')
tdSql.error('select floor(3.5) like "abc" or round(3.5) like "abc" or ceil(3.5) like "abc" from tb')
#operator: match
tdSql.error('select count(*) match "abc" from tb;')
tdSql.error('select avg(value) match "abc" from tb;')
tdSql.error('select twa(value) match "abc" from tb;')
tdSql.error('select sum(value) match "abc" from tb;')
tdSql.error('select stddev(value) match "abc" from tb;')
tdSql.error('select min(value) match "abc" from tb;')
tdSql.error('select max(value) match "abc" from tb;')
tdSql.error('select first(*) match "abc" from tb;')
tdSql.error('select last(*) match "abc" from tb;')
tdSql.error('select top(value, 3) match "abc" or bottom(value,3) match "abc" from tb;')
tdSql.error('select percentile(value, 50) match "abc" or apercentile(value, 50) match "abc" from tb')
tdSql.error('select diff(value) match "abc" or ceil(value) match "abc" from tb')
tdSql.error('select floor(3.5) match "abc" or round(3.5) match "abc" or ceil(3.5) match "abc" from tb')
#operator: nmatch
tdSql.error('select count(*) nmatch "abc" from tb;')
tdSql.error('select avg(value) nmatch "abc" from tb;')
tdSql.error('select twa(value) nmatch "abc" from tb;')
tdSql.error('select sum(value) nmatch "abc" from tb;')
tdSql.error('select stddev(value) nmatch "abc" from tb;')
tdSql.error('select min(value) nmatch "abc" from tb;')
tdSql.error('select max(value) nmatch "abc" from tb;')
tdSql.error('select first(*) nmatch "abc" from tb;')
tdSql.error('select last(*) nmatch "abc" from tb;')
tdSql.error('select top(value, 3) nmatch "abc" or bottom(value,3) nmatch "abc" from tb;')
tdSql.error('select percentile(value, 50) nmatch "abc" or apercentile(value, 50) nmatch "abc" from tb')
tdSql.error('select diff(value) nmatch "abc" or ceil(value) nmatch "abc" from tb')
tdSql.error('select floor(3.5) nmatch "abc" or round(3.5) nmatch "abc" or ceil(3.5) nmatch "abc" from tb')
#operator: in
tdSql.error('select count(*) in 1 from tb;')
tdSql.error('select avg(value) in (1, 2, 3) from tb;')
tdSql.error('select twa(value) in 1.0 from tb;')
tdSql.error('select sum(value) in (1.0, 2.0, 3.0) from tb;')
tdSql.error('select min(value) in (true, false, true) from tb;')
tdSql.error('select tbname in (\'acd\', \'bce\') from tb;')
tdSql.error('select t in ("acd", "bce") from tb;')
tdSql.error('select top(value, 3) in (1,2,3) and ceil(value) in (1.0,2.0,3.0) or last(*) in ("abc","cde") from tb;')
tdSql.execute('drop database db') tdSql.execute('drop database db')
def stop(self): def stop(self):
......
...@@ -37,12 +37,44 @@ class TDTestCase: ...@@ -37,12 +37,44 @@ class TDTestCase:
tdSql.checkData(0, 0, 8) tdSql.checkData(0, 0, 8)
tdSql.query("select count(*) from db.stb1") tdSql.query("select count(*) from db.stb1")
tdSql.checkData(0, 0, 160) tdSql.checkData(0, 0, 160)
tdSql.query("select distinct(c5) from db.stb1")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c6) from db.stb1")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c7) from db.stb1")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c8) from db.stb1")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c9) from db.stb1")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c10) from db.stb1")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c11) from db.stb1")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c12) from db.stb1")
tdSql.checkData(0, 0, None)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")
tdSql.query("select count(tbname) from db.`stb1-2`") tdSql.query("select count(tbname) from db.`stb1-2`")
tdSql.checkData(0, 0, 8) tdSql.checkData(0, 0, 8)
tdSql.query("select count(*) from db.`stb1-2`") tdSql.query("select count(*) from db.`stb1-2`")
tdSql.checkData(0, 0, 160) tdSql.checkData(0, 0, 160)
tdSql.query("select distinct(c5) from db.`stb1-2`")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c6) from db.`stb1-2`")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c7) from db.`stb1-2`")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c8) from db.`stb1-2`")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c9) from db.`stb1-2`")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c10) from db.`stb1-2`")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c11) from db.`stb1-2`")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c12) from db.`stb1-2`")
tdSql.checkData(0, 0, None)
cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json" cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json"
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
......
...@@ -38,8 +38,6 @@ class TDTestCase: ...@@ -38,8 +38,6 @@ class TDTestCase:
tdSql.execute("use newtest") tdSql.execute("use newtest")
tdSql.query("select count(*) from newtest.meters") tdSql.query("select count(*) from newtest.meters")
tdSql.checkData(0, 0, 20) tdSql.checkData(0, 0, 20)
tdSql.query("select distinct(c0) from newtest.meters")
tdSql.checkRows(7)
tdSql.query("describe meters") tdSql.query("describe meters")
tdSql.checkRows(8) tdSql.checkRows(8)
tdSql.checkData(0, 1, "TIMESTAMP") tdSql.checkData(0, 1, "TIMESTAMP")
...@@ -67,8 +65,6 @@ class TDTestCase: ...@@ -67,8 +65,6 @@ class TDTestCase:
tdSql.checkData(0, 0, 2) tdSql.checkData(0, 0, 2)
tdSql.query("select count(*) from test.meters") tdSql.query("select count(*) from test.meters")
tdSql.checkData(0, 0, 20) tdSql.checkData(0, 0, 20)
tdSql.query("select distinct(c0) from test.meters")
tdSql.checkRows(7)
cmd = "taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 2>&1 | grep sleep | wc -l" cmd = "taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 2>&1 | grep sleep | wc -l"
sleepTimes = subprocess.check_output(cmd, shell=True).decode("utf-8") sleepTimes = subprocess.check_output(cmd, shell=True).decode("utf-8")
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"user": "root", "user": "root",
"password": "taosdata", "password": "taosdata",
"thread_count": 4, "thread_count": 4,
"thread_pool_size": 20, "thread_pool_size": 10,
"result_file": "./insert_res.txt", "result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no", "confirm_parameter_prompt": "no",
"prepared_rand": 100, "prepared_rand": 100,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"confirm_parameter_prompt": "no", "confirm_parameter_prompt": "no",
"databases": "db", "databases": "db",
"query_mode": "rest", "query_mode": "rest",
"thread_pool_size": 20, "thread_pool_size": 10,
"response_buffer": 10000, "response_buffer": 10000,
"specified_table_query": "specified_table_query":
{ {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"user": "root", "user": "root",
"password": "taosdata", "password": "taosdata",
"thread_count": 4, "thread_count": 4,
"thread_pool_size": 20, "thread_pool_size": 10,
"result_file": "./insert_res.txt", "result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no", "confirm_parameter_prompt": "no",
"prepared_rand": 100, "prepared_rand": 100,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"user": "root", "user": "root",
"password": "taosdata", "password": "taosdata",
"thread_count": 4, "thread_count": 4,
"thread_pool_size": 20, "thread_pool_size": 10,
"result_file": "./insert_res.txt", "result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no", "confirm_parameter_prompt": "no",
"prepared_rand": 10, "prepared_rand": 10,
......
{
"filetype": "insert",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"thread_count": 4,
"thread_pool_size": 10,
"result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no",
"prepared_rand": 10,
"chinese": "no",
"insert_interval": 0,
"num_of_records_per_req": 10,
"databases": [{
"dbinfo": {
"name": "db",
"drop": "yes",
"replica": 1,
"days": 10,
"cache": 16,
"blocks": 8,
"precision": "ms",
"keep": 36500,
"minRows": 100,
"maxRows": 4096,
"comp":2,
"walLevel":1,
"cachelast":0,
"quorum":1,
"fsync":3000,
"update": 0
},
"super_tables": [{
"name": "stb1",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb1_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "json",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "BOOL"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb2",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb2_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "json",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "TINYINT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb3",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb3_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "json",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "SMALLINT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb4",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb4_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "json",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "INT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb5",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb5_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "json",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "BIGINT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb6",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb6_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "json",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "FLOAT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb7",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb7_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "json",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "DOUBLE"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb8",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb8_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "json",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "BINARY", "len": 8}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb9",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb9_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "json",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "NCHAR", "len": 8}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}]
}]
}]
}
{
"filetype": "insert",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"thread_count": 4,
"thread_pool_size": 20,
"result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no",
"prepared_rand": 10,
"chinese": "no",
"insert_interval": 0,
"num_of_records_per_req": 10,
"databases": [
{
"dbinfo": {
"name": "db3",
"drop": "yes",
"replica": 1,
"days": 10,
"cache": 16,
"blocks": 8,
"precision": "ms",
"keep": 36500,
"minRows": 100,
"maxRows": 4096,
"comp": 2,
"walLevel": 1,
"cachelast": 0,
"quorum": 1,
"fsync": 3000,
"update": 0
},
"super_tables": [
{
"name": "stb1",
"child_table_exists": "no",
"childtable_count": 8,
"childtable_prefix": "stb1_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml-rest",
"line_protocol": "json",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [
{
"type": "INT"
}
],
"tags": [
{
"type": "INT"
}
]
},{
"name": "stb2",
"child_table_exists": "no",
"childtable_count": 8,
"childtable_prefix": "stb2_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml-rest",
"line_protocol": "json",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 3,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [
{
"type": "INT"
}
],
"tags": [
{
"type": "INT"
}
]
}
]
}
]
}
{
"filetype": "insert",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"thread_count": 4,
"thread_pool_size": 20,
"result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no",
"prepared_rand": 10,
"chinese": "no",
"insert_interval": 0,
"num_of_records_per_req": 10,
"databases": [
{
"dbinfo": {
"name": "db2",
"drop": "yes",
"replica": 1,
"days": 10,
"cache": 16,
"blocks": 8,
"precision": "ms",
"keep": 36500,
"minRows": 100,
"maxRows": 4096,
"comp": 2,
"walLevel": 1,
"cachelast": 0,
"quorum": 1,
"fsync": 3000,
"update": 0
},
"super_tables": [
{
"name": "stb1",
"child_table_exists": "no",
"childtable_count": 8,
"childtable_prefix": "stb1_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml-rest",
"line_protocol": "line",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [
{
"type": "INT"
},
{
"type": "BIGINT"
},
{
"type": "FLOAT"
},
{
"type": "DOUBLE"
},
{
"type": "SMALLINT"
},
{
"type": "TINYINT"
},
{
"type": "BOOL"
},
{
"type": "NCHAR",
"len": 17,
"count": 1
},
{
"type": "UINT"
},
{
"type": "UBIGINT"
},
{
"type": "UTINYINT"
},
{
"type": "USMALLINT"
},
{
"type": "BINARY",
"len": 19,
"count": 1
}
],
"tags": [
{
"type": "INT"
},
{
"type": "BIGINT"
},
{
"type": "FLOAT"
},
{
"type": "DOUBLE"
},
{
"type": "SMALLINT"
},
{
"type": "TINYINT"
},
{
"type": "BOOL"
},
{
"type": "NCHAR",
"len": 17,
"count": 1
},
{
"type": "UINT"
},
{
"type": "UBIGINT"
},
{
"type": "UTINYINT"
},
{
"type": "USMALLINT"
},
{
"type": "BINARY",
"len": 19,
"count": 1
}
]
},{
"name": "stb2",
"child_table_exists": "no",
"childtable_count": 8,
"childtable_prefix": "stb2_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml-rest",
"line_protocol": "line",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 6,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [
{
"type": "INT"
},
{
"type": "BIGINT"
},
{
"type": "FLOAT"
},
{
"type": "DOUBLE"
},
{
"type": "SMALLINT"
},
{
"type": "TINYINT"
},
{
"type": "BOOL"
},
{
"type": "NCHAR",
"len": 17,
"count": 1
},
{
"type": "UINT"
},
{
"type": "UBIGINT"
},
{
"type": "UTINYINT"
},
{
"type": "USMALLINT"
},
{
"type": "BINARY",
"len": 19,
"count": 1
}
],
"tags": [
{
"type": "INT"
},
{
"type": "BIGINT"
},
{
"type": "FLOAT"
},
{
"type": "DOUBLE"
},
{
"type": "SMALLINT"
},
{
"type": "TINYINT"
},
{
"type": "BOOL"
},
{
"type": "NCHAR",
"len": 17,
"count": 1
},
{
"type": "UINT"
},
{
"type": "UBIGINT"
},
{
"type": "UTINYINT"
},
{
"type": "USMALLINT"
},
{
"type": "BINARY",
"len": 19,
"count": 1
}
]
}
]
}
]
}
{
"filetype": "insert",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"thread_count": 4,
"thread_pool_size": 20,
"result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no",
"prepared_rand": 10,
"chinese": "no",
"insert_interval": 0,
"num_of_records_per_req": 10,
"databases": [
{
"dbinfo": {
"name": "db",
"drop": "yes",
"replica": 1,
"days": 10,
"cache": 16,
"blocks": 8,
"precision": "ms",
"keep": 36500,
"minRows": 100,
"maxRows": 4096,
"comp": 2,
"walLevel": 1,
"cachelast": 0,
"quorum": 1,
"fsync": 3000,
"update": 0
},
"super_tables": [
{
"name": "stb1",
"child_table_exists": "no",
"childtable_count": 8,
"childtable_prefix": "stb1_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml-rest",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [
{
"type": "INT"
}
],
"tags": [
{
"type": "INT"
},
{
"type": "BIGINT"
},
{
"type": "FLOAT"
},
{
"type": "DOUBLE"
},
{
"type": "SMALLINT"
},
{
"type": "TINYINT"
},
{
"type": "BOOL"
},
{
"type": "NCHAR",
"len": 17,
"count": 1
},
{
"type": "UINT"
},
{
"type": "UBIGINT"
},
{
"type": "UTINYINT"
},
{
"type": "USMALLINT"
},
{
"type": "BINARY",
"len": 19,
"count": 1
}
]
},{
"name": "stb2",
"child_table_exists": "no",
"childtable_count": 8,
"childtable_prefix": "stb2_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml-rest",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 5,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [
{
"type": "INT"
}
],
"tags": [
{
"type": "INT"
},
{
"type": "BIGINT"
},
{
"type": "FLOAT"
},
{
"type": "DOUBLE"
},
{
"type": "SMALLINT"
},
{
"type": "TINYINT"
},
{
"type": "BOOL"
},
{
"type": "NCHAR",
"len": 17,
"count": 1
},
{
"type": "UINT"
},
{
"type": "UBIGINT"
},
{
"type": "UTINYINT"
},
{
"type": "USMALLINT"
},
{
"type": "BINARY",
"len": 19,
"count": 1
}
]
}
]
}
]
}
{
"filetype": "insert",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"thread_count": 4,
"thread_pool_size": 10,
"result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no",
"prepared_rand": 10,
"chinese": "no",
"insert_interval": 0,
"num_of_records_per_req": 10,
"databases": [{
"dbinfo": {
"name": "db",
"drop": "yes",
"replica": 1,
"days": 10,
"cache": 16,
"blocks": 8,
"precision": "ms",
"keep": 36500,
"minRows": 100,
"maxRows": 4096,
"comp":2,
"walLevel":1,
"cachelast":0,
"quorum":1,
"fsync":3000,
"update": 0
},
"super_tables": [{
"name": "stb1",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb1_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "BOOL"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb2",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb2_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "TINYINT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb3",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb3_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "UTINYINT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb4",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb4_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "SMALLINT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb5",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb5_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "USMALLINT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb6",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb6_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "INT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb7",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb7_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "UINT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb8",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb8_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "BIGINT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb9",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb9_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "UBIGINT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb10",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb10_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "FLOAT"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb11",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb11_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "DOUBLE"}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb12",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb12_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "BINARY", "len": 8}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{
"name": "stb13",
"child_table_exists":"no",
"childtable_count": 8,
"childtable_prefix": "stb13_",
"escape_character": "no",
"auto_create_table": "no",
"batch_create_tbl_num": 10,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet",
"childtable_limit": 0,
"childtable_offset": 0,
"insert_rows": 20,
"insert_interval": 0,
"interlace_rows": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "now",
"sample_file": "",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "NCHAR", "len": 8}],
"tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
}]
}]
}
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"user": "root", "user": "root",
"password": "taosdata", "password": "taosdata",
"thread_count": 4, "thread_count": 4,
"thread_pool_size": 20, "thread_pool_size": 10,
"result_file": "./insert_res.txt", "result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no", "confirm_parameter_prompt": "no",
"prepared_rand": 100, "prepared_rand": 100,
......
{
"filetype": "subscribe",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"databases": "db",
"confirm_parameter_prompt": "no",
"super_table_query": {
"stblname": "stb",
"threads": 1,
"mode": "sync",
"interval": 1000,
"restart": "yes",
"keepProgress": "yes",
"endAfterConsume": 1,
"sqls": [
{
"sql": "select * from xxxx;"
}
]
}
}
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"user": "root", "user": "root",
"password": "taosdata", "password": "taosdata",
"thread_count": 4, "thread_count": 4,
"thread_pool_size": 20, "thread_pool_size": 10,
"result_file": "./insert_res.txt", "result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no", "confirm_parameter_prompt": "no",
"prepared_rand": 100, "prepared_rand": 100,
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"use_sample_ts": "no", "use_sample_ts": "no",
"tags_file": "", "tags_file": "",
"partial_col_num": 5,
"columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], "columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}],
"tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
},{ },{
...@@ -80,6 +81,7 @@ ...@@ -80,6 +81,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"use_sample_ts": "no", "use_sample_ts": "no",
"tags_file": "", "tags_file": "",
"partial_col_num": 5,
"columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], "columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}],
"tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
}] }]
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"use_sample_ts": "no", "use_sample_ts": "no",
"tags_file": "", "tags_file": "",
"partial_col_num": 999,
"columns": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], "columns": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}],
"tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
}] }]
......
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"use_sample_ts": "no", "use_sample_ts": "no",
"tags_file": "", "tags_file": "",
"columns": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], "partial_col_num": 3,
"columns": [{"type": "TIMESTAMP"},{"type": "INT", "len": 0}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}],
"tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}]
}] }]
}] }]
......
...@@ -56,6 +56,30 @@ class TDTestCase: ...@@ -56,6 +56,30 @@ class TDTestCase:
tdSql.checkData(0, 0, 8) tdSql.checkData(0, 0, 8)
tdSql.query("select count(*) from db.stb") tdSql.query("select count(*) from db.stb")
tdSql.checkData(0, 0, 40) tdSql.checkData(0, 0, 40)
tdSql.query("select distinct(c1) from db.stb")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c3) from db.stb")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c4) from db.stb")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c5) from db.stb")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c6) from db.stb")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c7) from db.stb")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c8) from db.stb")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c9) from db.stb")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c10) from db.stb")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c11) from db.stb")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c12) from db.stb")
tdSql.checkData(0, 0, None)
tdSql.query("select distinct(c13) from db.stb")
tdSql.checkData(0, 0, None)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
...@@ -38,9 +38,11 @@ class TDTestCase: ...@@ -38,9 +38,11 @@ class TDTestCase:
tdSql.query("select count(tbname) from db.stb2") tdSql.query("select count(tbname) from db.stb2")
tdSql.checkData(0, 0, 8) tdSql.checkData(0, 0, 8)
tdSql.query("select count(*) from db.stb1") tdSql.query("select count(*) from db.stb1")
tdSql.checkData(0, 0, 160) result = tdSql.getData(0, 0)
assert result <= 160, "result is %s > expect: 160" % result
tdSql.query("select count(*) from db.stb2") tdSql.query("select count(*) from db.stb2")
tdSql.checkData(0, 0, 160) result = tdSql.getData(0, 0)
assert result <= 160, "result is %s > expect: 160" % result
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
...@@ -29,7 +29,7 @@ class TDTestCase: ...@@ -29,7 +29,7 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql) tdSql.init(conn.cursor(), logSql)
def run(self): def run(self):
cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/json_alltypes.json" cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_json_alltypes.json"
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")
......
...@@ -29,7 +29,7 @@ class TDTestCase: ...@@ -29,7 +29,7 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql) tdSql.init(conn.cursor(), logSql)
def run(self): def run(self):
cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/telnet_alltypes.json" cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_telnet_alltypes.json"
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")
......
...@@ -38,8 +38,12 @@ class TDTestCase: ...@@ -38,8 +38,12 @@ class TDTestCase:
tdSql.execute("insert into stb_2 using stb tags (2) values (now, 2)") tdSql.execute("insert into stb_2 using stb tags (2) values (now, 2)")
cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/specified_subscribe.json -g" cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/specified_subscribe.json -g"
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) assert os.system("%s" % cmd) == 0
tdSql.execute("reset query cache")
cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/super_subscribe.json -g"
tdLog.info("%s" % cmd)
assert os.system("%s" % cmd) == 0
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import os
from util.log import *
from util.cases import *
from util.sql import *
from util.dnodes import *
class TDTestCase:
def caseDescription(self):
'''
[TD-11510] taosBenchmark test cases
'''
return
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_rest_telnet.json"
tdLog.info("%s" % cmd)
os.system("%s" % cmd)
tdSql.execute("reset query cache")
tdSql.query("select count(tbname) from db.stb1")
tdSql.checkData(0, 0, 8)
tdSql.query("select count(*) from db.stb1")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(tbname) from db.stb2")
tdSql.checkData(0, 0, 8)
tdSql.query("select count(*) from db.stb2")
tdSql.checkData(0, 0, 160)
cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_rest_line.json"
tdLog.info("%s" % cmd)
os.system("%s" % cmd)
tdSql.execute("reset query cache")
tdSql.query("select count(tbname) from db2.stb1")
tdSql.checkData(0, 0, 8)
tdSql.query("select count(*) from db2.stb1")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(tbname) from db2.stb2")
tdSql.checkData(0, 0, 8)
tdSql.query("select count(*) from db2.stb2")
tdSql.checkData(0, 0, 160)
cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_rest_json.json"
tdLog.info("%s" % cmd)
os.system("%s" % cmd)
tdSql.execute("reset query cache")
tdSql.query("select count(tbname) from db3.stb1")
tdSql.checkData(0, 0, 8)
tdSql.query("select count(*) from db3.stb1")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(tbname) from db3.stb2")
tdSql.checkData(0, 0, 8)
tdSql.query("select count(*) from db3.stb2")
tdSql.checkData(0, 0, 160)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
...@@ -40,6 +40,7 @@ class TDTestCase: ...@@ -40,6 +40,7 @@ class TDTestCase:
else: else:
projPath = selfPath[:selfPath.find("tests")] projPath = selfPath[:selfPath.find("tests")]
buildPath = ""
for root, dirs, files in os.walk(projPath): for root, dirs, files in os.walk(projPath):
if ("taosdump" in files): if ("taosdump" in files):
rootRealPath = os.path.dirname(os.path.realpath(root)) rootRealPath = os.path.dirname(os.path.realpath(root))
...@@ -57,9 +58,20 @@ class TDTestCase: ...@@ -57,9 +58,20 @@ class TDTestCase:
tdSql.execute("use db") tdSql.execute("use db")
tdSql.execute( tdSql.execute(
"create table st(ts timestamp, c1 int) tags(jtag JSON)") "create table st(ts timestamp, c1 int) tags(jtag JSON)")
tdSql.execute("create table t1 using st tags('{\"location\": \"beijing\"}')") tdSql.execute(
"create table t1 using st tags('{\"location\": \"beijing\"}')")
tdSql.execute("insert into t1 values(1500000000000, 1)") tdSql.execute("insert into t1 values(1500000000000, 1)")
tdSql.execute(
"create table t2 using st tags(NULL)")
tdSql.execute("insert into t2 values(1500000000000, NULL)")
tdSql.execute(
"create table t3 using st tags('')")
tdSql.execute("insert into t3 values(1500000000000, 0)")
# sys.exit(1)
buildPath = self.getBuildPath() buildPath = self.getBuildPath()
if (buildPath == ""): if (buildPath == ""):
tdLog.exit("taosdump not found!") tdLog.exit("taosdump not found!")
...@@ -74,11 +86,11 @@ class TDTestCase: ...@@ -74,11 +86,11 @@ class TDTestCase:
os.system("rm -rf %s" % self.tmpdir) os.system("rm -rf %s" % self.tmpdir)
os.makedirs(self.tmpdir) os.makedirs(self.tmpdir)
os.system("%staosdump --databases db -o %s" % (binPath, self.tmpdir)) os.system("%staosdump --databases db -o %s -g" % (binPath, self.tmpdir))
tdSql.execute("drop database db") tdSql.execute("drop database db")
os.system("%staosdump -i %s" % (binPath, self.tmpdir)) os.system("%staosdump -i %s -g" % (binPath, self.tmpdir))
tdSql.query("show databases") tdSql.query("show databases")
tdSql.checkRows(1) tdSql.checkRows(1)
...@@ -89,11 +101,11 @@ class TDTestCase: ...@@ -89,11 +101,11 @@ class TDTestCase:
tdSql.checkData(0, 0, 'st') tdSql.checkData(0, 0, 'st')
tdSql.query("show tables") tdSql.query("show tables")
tdSql.checkRows(1) tdSql.checkRows(3)
tdSql.checkData(0, 0, 't1') tdSql.checkData(0, 0, 't3')
tdSql.query("select jtag->'location' from st") tdSql.query("select jtag->'location' from st")
tdSql.checkRows(1) tdSql.checkRows(3)
tdSql.checkData(0, 0, "\"beijing\"") tdSql.checkData(0, 0, "\"beijing\"")
tdSql.query("select * from st where jtag contains 'location'") tdSql.query("select * from st where jtag contains 'location'")
...@@ -101,6 +113,11 @@ class TDTestCase: ...@@ -101,6 +113,11 @@ class TDTestCase:
tdSql.checkData(0, 1, 1) tdSql.checkData(0, 1, 1)
tdSql.checkData(0, 2, '{\"location\":\"beijing\"}') tdSql.checkData(0, 2, '{\"location\":\"beijing\"}')
tdSql.query("select jtag from st")
tdSql.checkRows(3)
tdSql.checkData(0, 0, "{\"location\":\"beijing\"}")
tdSql.checkData(1, 0, None)
tdSql.checkData(2, 0, None)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册