other: merge main.
This commit is contained in:
commit
d7bad3bb51
|
@ -2,7 +2,7 @@
|
||||||
# taosadapter
|
# taosadapter
|
||||||
ExternalProject_Add(taosadapter
|
ExternalProject_Add(taosadapter
|
||||||
GIT_REPOSITORY https://github.com/taosdata/taosadapter.git
|
GIT_REPOSITORY https://github.com/taosdata/taosadapter.git
|
||||||
GIT_TAG 3e08996
|
GIT_TAG db6c843
|
||||||
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter"
|
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter"
|
||||||
BINARY_DIR ""
|
BINARY_DIR ""
|
||||||
#BUILD_IN_SOURCE TRUE
|
#BUILD_IN_SOURCE TRUE
|
||||||
|
|
|
@ -872,9 +872,9 @@ INTERP(expr)
|
||||||
- `INTERP` is used to get the value that matches the specified time slice from a column. If no such value exists an interpolation value will be returned based on `FILL` parameter.
|
- `INTERP` is used to get the value that matches the specified time slice from a column. If no such value exists an interpolation value will be returned based on `FILL` parameter.
|
||||||
- The input data of `INTERP` is the value of the specified column and a `where` clause can be used to filter the original data. If no `where` condition is specified then all original data is the input.
|
- The input data of `INTERP` is the value of the specified column and a `where` clause can be used to filter the original data. If no `where` condition is specified then all original data is the input.
|
||||||
- `INTERP` must be used along with `RANGE`, `EVERY`, `FILL` keywords.
|
- `INTERP` must be used along with `RANGE`, `EVERY`, `FILL` keywords.
|
||||||
- The output time range of `INTERP` is specified by `RANGE(timestamp1,timestamp2)` parameter, with timestamp1<=timestamp2. timestamp1 is the starting point of the output time range and must be specified. timestamp2 is the ending point of the output time range and must be specified.
|
- The output time range of `INTERP` is specified by `RANGE(timestamp1,timestamp2)` parameter, with timestamp1 < timestamp2. timestamp1 is the starting point of the output time range and must be specified. timestamp2 is the ending point of the output time range and must be specified.
|
||||||
- The number of rows in the result set of `INTERP` is determined by the parameter `EVERY`. Starting from timestamp1, one interpolation is performed for every time interval specified `EVERY` parameter. The parameter `EVERY` must be an integer, with no quotes, with a time unit of: b(nanosecond), u(microsecond), a(millisecond)), s(second), m(minute), h(hour), d(day), or w(week). For example, `EVERY(500a)` will interpolate every 500 milliseconds.
|
- The number of rows in the result set of `INTERP` is determined by the parameter `EVERY(time_unit)`. Starting from timestamp1, one interpolation is performed for every time interval specified `time_unit` parameter. The parameter `time_unit` must be an integer, with no quotes, with a time unit of: a(millisecond)), s(second), m(minute), h(hour), d(day), or w(week). For example, `EVERY(500a)` will interpolate every 500 milliseconds.
|
||||||
- Interpolation is performed based on `FILL` parameter.
|
- Interpolation is performed based on `FILL` parameter. For more information about FILL clause, see [FILL Clause](./distinguished/#fill-clause).
|
||||||
- `INTERP` can only be used to interpolate in single timeline. So it must be used with `partition by tbname` when it's used on a STable.
|
- `INTERP` can only be used to interpolate in single timeline. So it must be used with `partition by tbname` when it's used on a STable.
|
||||||
- Pseudo column `_irowts` can be used along with `INTERP` to return the timestamps associated with interpolation points(support after version 3.0.1.4).
|
- Pseudo column `_irowts` can be used along with `INTERP` to return the timestamps associated with interpolation points(support after version 3.0.1.4).
|
||||||
|
|
||||||
|
|
|
@ -875,9 +875,9 @@ INTERP(expr)
|
||||||
- INTERP 用于在指定时间断面获取指定列的记录值,如果该时间断面不存在符合条件的行数据,那么会根据 FILL 参数的设定进行插值。
|
- INTERP 用于在指定时间断面获取指定列的记录值,如果该时间断面不存在符合条件的行数据,那么会根据 FILL 参数的设定进行插值。
|
||||||
- INTERP 的输入数据为指定列的数据,可以通过条件语句(where 子句)来对原始列数据进行过滤,如果没有指定过滤条件则输入为全部数据。
|
- INTERP 的输入数据为指定列的数据,可以通过条件语句(where 子句)来对原始列数据进行过滤,如果没有指定过滤条件则输入为全部数据。
|
||||||
- INTERP 需要同时与 RANGE,EVERY 和 FILL 关键字一起使用。
|
- INTERP 需要同时与 RANGE,EVERY 和 FILL 关键字一起使用。
|
||||||
- INTERP 的输出时间范围根据 RANGE(timestamp1,timestamp2)字段来指定,需满足 timestamp1<=timestamp2。其中 timestamp1(必选值)为输出时间范围的起始值,即如果 timestamp1 时刻符合插值条件则 timestamp1 为输出的第一条记录,timestamp2(必选值)为输出时间范围的结束值,即输出的最后一条记录的 timestamp 不能大于 timestamp2。
|
- INTERP 的输出时间范围根据 RANGE(timestamp1,timestamp2)字段来指定,需满足 timestamp1 < timestamp2。其中 timestamp1(必选值)为输出时间范围的起始值,即如果 timestamp1 时刻符合插值条件则 timestamp1 为输出的第一条记录,timestamp2(必选值)为输出时间范围的结束值,即输出的最后一条记录的 timestamp 不能大于 timestamp2。
|
||||||
- INTERP 根据 EVERY 字段来确定输出时间范围内的结果条数,即从 timestamp1 开始每隔固定长度的时间(EVERY 值)进行插值。
|
- INTERP 根据 EVERY(time_unit) 字段来确定输出时间范围内的结果条数,即从 timestamp1 开始每隔固定长度的时间(time_unit 值)进行插值,time_unit 可取值时间单位:1a(毫秒),1s(秒),1m(分),1h(小时),1d(天),1w(周)。例如 EVERY(500a) 将对于指定数据每500毫秒间隔进行一次插值.
|
||||||
- INTERP 根据 FILL 字段来决定在每个符合输出条件的时刻如何进行插值。
|
- INTERP 根据 FILL 字段来决定在每个符合输出条件的时刻如何进行插值。关于 FILL 子句如何使用请参考 [FILL 子句](./distinguished/#fill-子句)
|
||||||
- INTERP 只能在一个时间序列内进行插值,因此当作用于超级表时必须跟 partition by tbname 一起使用。
|
- INTERP 只能在一个时间序列内进行插值,因此当作用于超级表时必须跟 partition by tbname 一起使用。
|
||||||
- INTERP 可以与伪列 _irowts 一起使用,返回插值点所对应的时间戳(3.0.1.4版本以后支持)。
|
- INTERP 可以与伪列 _irowts 一起使用,返回插值点所对应的时间戳(3.0.1.4版本以后支持)。
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ extern int32_t tMsgDict[];
|
||||||
#define TMSG_INFO(TYPE) \
|
#define TMSG_INFO(TYPE) \
|
||||||
((TYPE) < TDMT_DND_MAX_MSG || (TYPE) < TDMT_MND_MAX_MSG || (TYPE) < TDMT_VND_MAX_MSG || (TYPE) < TDMT_SCH_MAX_MSG || \
|
((TYPE) < TDMT_DND_MAX_MSG || (TYPE) < TDMT_MND_MAX_MSG || (TYPE) < TDMT_VND_MAX_MSG || (TYPE) < TDMT_SCH_MAX_MSG || \
|
||||||
(TYPE) < TDMT_STREAM_MAX_MSG || (TYPE) < TDMT_MON_MAX_MSG || (TYPE) < TDMT_SYNC_MAX_MSG) || \
|
(TYPE) < TDMT_STREAM_MAX_MSG || (TYPE) < TDMT_MON_MAX_MSG || (TYPE) < TDMT_SYNC_MAX_MSG) || \
|
||||||
(TYPE) < TDMT_VND_STREAM_MSG || (TYPE) < TDMT_VND_TMQ_MSG \
|
(TYPE) < TDMT_VND_STREAM_MSG || (TYPE) < TDMT_VND_TMQ_MSG || (TYPE) < TDMT_VND_TMQ_MAX_MSG \
|
||||||
? tMsgInfo[tMsgDict[TMSG_SEG_CODE(TYPE)] + TMSG_SEG_SEQ(TYPE)] \
|
? tMsgInfo[tMsgDict[TMSG_SEG_CODE(TYPE)] + TMSG_SEG_SEQ(TYPE)] \
|
||||||
: 0
|
: 0
|
||||||
|
|
||||||
|
@ -146,10 +146,12 @@ typedef enum _mgmt_table {
|
||||||
|
|
||||||
#define TSDB_FILL_NONE 0
|
#define TSDB_FILL_NONE 0
|
||||||
#define TSDB_FILL_NULL 1
|
#define TSDB_FILL_NULL 1
|
||||||
#define TSDB_FILL_SET_VALUE 2
|
#define TSDB_FILL_NULL_F 2
|
||||||
#define TSDB_FILL_LINEAR 3
|
#define TSDB_FILL_SET_VALUE 3
|
||||||
#define TSDB_FILL_PREV 4
|
#define TSDB_FILL_SET_VALUE_F 4
|
||||||
#define TSDB_FILL_NEXT 5
|
#define TSDB_FILL_LINEAR 5
|
||||||
|
#define TSDB_FILL_PREV 6
|
||||||
|
#define TSDB_FILL_NEXT 7
|
||||||
|
|
||||||
#define TSDB_ALTER_USER_PASSWD 0x1
|
#define TSDB_ALTER_USER_PASSWD 0x1
|
||||||
#define TSDB_ALTER_USER_SUPERUSER 0x2
|
#define TSDB_ALTER_USER_SUPERUSER 0x2
|
||||||
|
|
|
@ -269,74 +269,77 @@
|
||||||
#define TK_SLIDING 251
|
#define TK_SLIDING 251
|
||||||
#define TK_FILL 252
|
#define TK_FILL 252
|
||||||
#define TK_VALUE 253
|
#define TK_VALUE 253
|
||||||
#define TK_NONE 254
|
#define TK_VALUE_F 254
|
||||||
#define TK_PREV 255
|
#define TK_NONE 255
|
||||||
#define TK_LINEAR 256
|
#define TK_PREV 256
|
||||||
#define TK_NEXT 257
|
#define TK_NULL_F 257
|
||||||
#define TK_HAVING 258
|
#define TK_LINEAR 258
|
||||||
#define TK_RANGE 259
|
#define TK_NEXT 259
|
||||||
#define TK_EVERY 260
|
#define TK_HAVING 260
|
||||||
#define TK_ORDER 261
|
#define TK_RANGE 261
|
||||||
#define TK_SLIMIT 262
|
#define TK_EVERY 262
|
||||||
#define TK_SOFFSET 263
|
#define TK_ORDER 263
|
||||||
#define TK_LIMIT 264
|
#define TK_SLIMIT 264
|
||||||
#define TK_OFFSET 265
|
#define TK_SOFFSET 265
|
||||||
#define TK_ASC 266
|
#define TK_LIMIT 266
|
||||||
#define TK_NULLS 267
|
#define TK_OFFSET 267
|
||||||
#define TK_ABORT 268
|
#define TK_ASC 268
|
||||||
#define TK_AFTER 269
|
#define TK_NULLS 269
|
||||||
#define TK_ATTACH 270
|
#define TK_ABORT 270
|
||||||
#define TK_BEFORE 271
|
#define TK_AFTER 271
|
||||||
#define TK_BEGIN 272
|
#define TK_ATTACH 272
|
||||||
#define TK_BITAND 273
|
#define TK_BEFORE 273
|
||||||
#define TK_BITNOT 274
|
#define TK_BEGIN 274
|
||||||
#define TK_BITOR 275
|
#define TK_BITAND 275
|
||||||
#define TK_BLOCKS 276
|
#define TK_BITNOT 276
|
||||||
#define TK_CHANGE 277
|
#define TK_BITOR 277
|
||||||
#define TK_COMMA 278
|
#define TK_BLOCKS 278
|
||||||
#define TK_COMPACT 279
|
#define TK_CHANGE 279
|
||||||
#define TK_CONCAT 280
|
#define TK_COMMA 280
|
||||||
#define TK_CONFLICT 281
|
#define TK_COMPACT 281
|
||||||
#define TK_COPY 282
|
#define TK_CONCAT 282
|
||||||
#define TK_DEFERRED 283
|
#define TK_CONFLICT 283
|
||||||
#define TK_DELIMITERS 284
|
#define TK_COPY 284
|
||||||
#define TK_DETACH 285
|
#define TK_DEFERRED 285
|
||||||
#define TK_DIVIDE 286
|
#define TK_DELIMITERS 286
|
||||||
#define TK_DOT 287
|
#define TK_DETACH 287
|
||||||
#define TK_EACH 288
|
#define TK_DIVIDE 288
|
||||||
#define TK_FAIL 289
|
#define TK_DOT 289
|
||||||
#define TK_FILE 290
|
#define TK_EACH 290
|
||||||
#define TK_FOR 291
|
#define TK_FAIL 291
|
||||||
#define TK_GLOB 292
|
#define TK_FILE 292
|
||||||
#define TK_ID 293
|
#define TK_FOR 293
|
||||||
#define TK_IMMEDIATE 294
|
#define TK_GLOB 294
|
||||||
#define TK_IMPORT 295
|
#define TK_ID 295
|
||||||
#define TK_INITIALLY 296
|
#define TK_IMMEDIATE 296
|
||||||
#define TK_INSTEAD 297
|
#define TK_IMPORT 297
|
||||||
#define TK_ISNULL 298
|
#define TK_INITIALLY 298
|
||||||
#define TK_KEY 299
|
#define TK_INSTEAD 299
|
||||||
#define TK_MODULES 300
|
#define TK_ISNULL 300
|
||||||
#define TK_NK_BITNOT 301
|
#define TK_KEY 301
|
||||||
#define TK_NK_SEMI 302
|
#define TK_MODULES 302
|
||||||
#define TK_NOTNULL 303
|
#define TK_NK_BITNOT 303
|
||||||
#define TK_OF 304
|
#define TK_NK_SEMI 304
|
||||||
#define TK_PLUS 305
|
#define TK_NOTNULL 305
|
||||||
#define TK_PRIVILEGE 306
|
#define TK_OF 306
|
||||||
#define TK_RAISE 307
|
#define TK_PLUS 307
|
||||||
#define TK_REPLACE 308
|
#define TK_PRIVILEGE 308
|
||||||
#define TK_RESTRICT 309
|
#define TK_RAISE 309
|
||||||
#define TK_ROW 310
|
#define TK_REPLACE 310
|
||||||
#define TK_SEMI 311
|
#define TK_RESTRICT 311
|
||||||
#define TK_STAR 312
|
#define TK_ROW 312
|
||||||
#define TK_STATEMENT 313
|
#define TK_SEMI 313
|
||||||
#define TK_STRICT 314
|
#define TK_STAR 314
|
||||||
#define TK_STRING 315
|
#define TK_STATEMENT 315
|
||||||
#define TK_TIMES 316
|
#define TK_STRICT 316
|
||||||
#define TK_UPDATE 317
|
#define TK_STRING 317
|
||||||
#define TK_VALUES 318
|
#define TK_TIMES 318
|
||||||
#define TK_VARIABLE 319
|
#define TK_UPDATE 319
|
||||||
#define TK_VIEW 320
|
#define TK_VALUES 320
|
||||||
#define TK_WAL 321
|
#define TK_VARIABLE 321
|
||||||
|
#define TK_VIEW 322
|
||||||
|
#define TK_WAL 323
|
||||||
|
|
||||||
|
|
||||||
#define TK_NK_SPACE 600
|
#define TK_NK_SPACE 600
|
||||||
#define TK_NK_COMMENT 601
|
#define TK_NK_COMMENT 601
|
||||||
|
|
|
@ -226,8 +226,10 @@ typedef struct SIntervalWindowNode {
|
||||||
typedef enum EFillMode {
|
typedef enum EFillMode {
|
||||||
FILL_MODE_NONE = 1,
|
FILL_MODE_NONE = 1,
|
||||||
FILL_MODE_VALUE,
|
FILL_MODE_VALUE,
|
||||||
|
FILL_MODE_VALUE_F,
|
||||||
FILL_MODE_PREV,
|
FILL_MODE_PREV,
|
||||||
FILL_MODE_NULL,
|
FILL_MODE_NULL,
|
||||||
|
FILL_MODE_NULL_F,
|
||||||
FILL_MODE_LINEAR,
|
FILL_MODE_LINEAR,
|
||||||
FILL_MODE_NEXT
|
FILL_MODE_NEXT
|
||||||
} EFillMode;
|
} EFillMode;
|
||||||
|
|
|
@ -355,6 +355,7 @@ int32_t* taosGetErrno();
|
||||||
#define TSDB_CODE_MND_STREAM_MUST_BE_DELETED TAOS_DEF_ERROR_CODE(0, 0x03F3)
|
#define TSDB_CODE_MND_STREAM_MUST_BE_DELETED TAOS_DEF_ERROR_CODE(0, 0x03F3)
|
||||||
#define TSDB_CODE_MND_STREAM_TASK_DROPPED TAOS_DEF_ERROR_CODE(0, 0x03F4)
|
#define TSDB_CODE_MND_STREAM_TASK_DROPPED TAOS_DEF_ERROR_CODE(0, 0x03F4)
|
||||||
#define TSDB_CODE_MND_MULTI_REPLICA_SOURCE_DB TAOS_DEF_ERROR_CODE(0, 0x03F5)
|
#define TSDB_CODE_MND_MULTI_REPLICA_SOURCE_DB TAOS_DEF_ERROR_CODE(0, 0x03F5)
|
||||||
|
#define TSDB_CODE_MND_TOO_MANY_STREAMS TAOS_DEF_ERROR_CODE(0, 0x03F6)
|
||||||
|
|
||||||
// mnode-sma
|
// mnode-sma
|
||||||
#define TSDB_CODE_MND_SMA_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0480)
|
#define TSDB_CODE_MND_SMA_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0480)
|
||||||
|
|
|
@ -60,6 +60,6 @@ target_link_libraries(
|
||||||
PRIVATE os util common transport nodes parser command planner catalog scheduler function qcom
|
PRIVATE os util common transport nodes parser command planner catalog scheduler function qcom
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${BUILD_TEST})
|
#if(${BUILD_TEST})
|
||||||
ADD_SUBDIRECTORY(test)
|
ADD_SUBDIRECTORY(test)
|
||||||
endif(${BUILD_TEST})
|
#endif(${BUILD_TEST})
|
|
@ -138,6 +138,12 @@ STscObj* taos_connect_internal(const char* ip, const char* user, const char* pas
|
||||||
p->mgmtEp = epSet;
|
p->mgmtEp = epSet;
|
||||||
taosThreadMutexInit(&p->qnodeMutex, NULL);
|
taosThreadMutexInit(&p->qnodeMutex, NULL);
|
||||||
p->pTransporter = openTransporter(user, secretEncrypt, tsNumOfCores / 2);
|
p->pTransporter = openTransporter(user, secretEncrypt, tsNumOfCores / 2);
|
||||||
|
if (p->pTransporter == NULL) {
|
||||||
|
taosThreadMutexUnlock(&appInfo.mutex);
|
||||||
|
taosMemoryFreeClear(key);
|
||||||
|
taosMemoryFree(p);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
p->pAppHbMgr = appHbMgrInit(p, key);
|
p->pAppHbMgr = appHbMgrInit(p, key);
|
||||||
if (NULL == p->pAppHbMgr) {
|
if (NULL == p->pAppHbMgr) {
|
||||||
destroyAppInst(p);
|
destroyAppInst(p);
|
||||||
|
@ -1463,6 +1469,7 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
|
||||||
tscError("failed to sched msg to tsc, tsc ready to quit");
|
tscError("failed to sched msg to tsc, tsc ready to quit");
|
||||||
rpcFreeCont(pMsg->pCont);
|
rpcFreeCont(pMsg->pCont);
|
||||||
taosMemoryFree(arg->pEpset);
|
taosMemoryFree(arg->pEpset);
|
||||||
|
destroySendMsgInfo(pMsg->info.ahandle);
|
||||||
taosMemoryFree(arg);
|
taosMemoryFree(arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ void createNewTable(TAOS* pConn, int32_t index) {
|
||||||
}
|
}
|
||||||
taos_free_result(pRes);
|
taos_free_result(pRes);
|
||||||
|
|
||||||
for(int32_t i = 0; i < 20; i += 20) {
|
for(int32_t i = 0; i < 2000; i += 20) {
|
||||||
char sql[1024] = {0};
|
char sql[1024] = {0};
|
||||||
sprintf(sql,
|
sprintf(sql,
|
||||||
"insert into tu%d values(now+%da, %d)(now+%da, %d)(now+%da, %d)(now+%da, %d)"
|
"insert into tu%d values(now+%da, %d)(now+%da, %d)(now+%da, %d)(now+%da, %d)"
|
||||||
|
@ -692,6 +692,7 @@ TEST(testCase, insert_test) {
|
||||||
taos_free_result(pRes);
|
taos_free_result(pRes);
|
||||||
taos_close(pConn);
|
taos_close(pConn);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST(testCase, projection_query_tables) {
|
TEST(testCase, projection_query_tables) {
|
||||||
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
|
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
|
||||||
|
@ -725,7 +726,7 @@ TEST(testCase, projection_query_tables) {
|
||||||
}
|
}
|
||||||
taos_free_result(pRes);
|
taos_free_result(pRes);
|
||||||
|
|
||||||
for (int32_t i = 0; i < 200000; ++i) {
|
for (int32_t i = 0; i < 2; ++i) {
|
||||||
printf("create table :%d\n", i);
|
printf("create table :%d\n", i);
|
||||||
createNewTable(pConn, i);
|
createNewTable(pConn, i);
|
||||||
}
|
}
|
||||||
|
@ -751,6 +752,7 @@ TEST(testCase, projection_query_tables) {
|
||||||
taos_close(pConn);
|
taos_close(pConn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
TEST(testCase, tsbs_perf_test) {
|
TEST(testCase, tsbs_perf_test) {
|
||||||
TdThread qid[20] = {0};
|
TdThread qid[20] = {0};
|
||||||
|
|
||||||
|
@ -760,8 +762,6 @@ TEST(testCase, tsbs_perf_test) {
|
||||||
getchar();
|
getchar();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
TEST(testCase, projection_query_stables) {
|
TEST(testCase, projection_query_stables) {
|
||||||
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
|
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
|
||||||
ASSERT_NE(pConn, nullptr);
|
ASSERT_NE(pConn, nullptr);
|
||||||
|
@ -790,7 +790,6 @@ TEST(testCase, projection_query_stables) {
|
||||||
taos_close(pConn);
|
taos_close(pConn);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
TEST(testCase, agg_query_tables) {
|
TEST(testCase, agg_query_tables) {
|
||||||
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
|
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
|
||||||
ASSERT_NE(pConn, nullptr);
|
ASSERT_NE(pConn, nullptr);
|
||||||
|
@ -831,7 +830,7 @@ TEST(testCase, async_api_test) {
|
||||||
ASSERT_NE(pConn, nullptr);
|
ASSERT_NE(pConn, nullptr);
|
||||||
|
|
||||||
taos_query(pConn, "use abc1");
|
taos_query(pConn, "use abc1");
|
||||||
#if 0
|
|
||||||
TAOS_RES* pRes = taos_query(pConn, "insert into tu(ts) values('2022-02-27 12:12:61')");
|
TAOS_RES* pRes = taos_query(pConn, "insert into tu(ts) values('2022-02-27 12:12:61')");
|
||||||
if (taos_errno(pRes) != 0) {
|
if (taos_errno(pRes) != 0) {
|
||||||
printf("failed, reason:%s\n", taos_errstr(pRes));
|
printf("failed, reason:%s\n", taos_errstr(pRes));
|
||||||
|
@ -854,7 +853,6 @@ TEST(testCase, async_api_test) {
|
||||||
printf("%s\n", str);
|
printf("%s\n", str);
|
||||||
memset(str, 0, sizeof(str));
|
memset(str, 0, sizeof(str));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
taos_query_a(pConn, "select count(*) from tu", queryCallback, pConn);
|
taos_query_a(pConn, "select count(*) from tu", queryCallback, pConn);
|
||||||
getchar();
|
getchar();
|
||||||
|
|
|
@ -49,7 +49,7 @@ static void mmProcessRpcMsg(SQueueInfo *pInfo, SRpcMsg *pMsg) {
|
||||||
pMsg->info.node = pMgmt->pMnode;
|
pMsg->info.node = pMgmt->pMnode;
|
||||||
|
|
||||||
const STraceId *trace = &pMsg->info.traceId;
|
const STraceId *trace = &pMsg->info.traceId;
|
||||||
dGTrace("msg:%p, get from mnode queue", pMsg);
|
dGTrace("msg:%p, get from mnode queue, type:%s", pMsg, TMSG_INFO(pMsg->msgType));
|
||||||
|
|
||||||
int32_t code = mndProcessRpcMsg(pMsg);
|
int32_t code = mndProcessRpcMsg(pMsg);
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans);
|
||||||
int32_t mndTransProcessRsp(SRpcMsg *pRsp);
|
int32_t mndTransProcessRsp(SRpcMsg *pRsp);
|
||||||
void mndTransPullup(SMnode *pMnode);
|
void mndTransPullup(SMnode *pMnode);
|
||||||
int32_t mndKillTrans(SMnode *pMnode, STrans *pTrans);
|
int32_t mndKillTrans(SMnode *pMnode, STrans *pTrans);
|
||||||
void mndTransExecute(SMnode *pMnode, STrans *pTrans);
|
void mndTransExecute(SMnode *pMnode, STrans *pTrans, bool isLeader);
|
||||||
int32_t mndSetRpcInfoForDbTrans(SMnode *pMnode, SRpcMsg *pMsg, EOperType oper, const char *dbname);
|
int32_t mndSetRpcInfoForDbTrans(SMnode *pMnode, SRpcMsg *pMsg, EOperType oper, const char *dbname);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#define MND_STREAM_VER_NUMBER 2
|
#define MND_STREAM_VER_NUMBER 2
|
||||||
#define MND_STREAM_RESERVE_SIZE 64
|
#define MND_STREAM_RESERVE_SIZE 64
|
||||||
|
|
||||||
|
#define MND_STREAM_MAX_NUM 10
|
||||||
|
|
||||||
static int32_t mndStreamActionInsert(SSdb *pSdb, SStreamObj *pStream);
|
static int32_t mndStreamActionInsert(SSdb *pSdb, SStreamObj *pStream);
|
||||||
static int32_t mndStreamActionDelete(SSdb *pSdb, SStreamObj *pStream);
|
static int32_t mndStreamActionDelete(SSdb *pSdb, SStreamObj *pStream);
|
||||||
static int32_t mndStreamActionUpdate(SSdb *pSdb, SStreamObj *pStream, SStreamObj *pNewStream);
|
static int32_t mndStreamActionUpdate(SSdb *pSdb, SStreamObj *pStream, SStreamObj *pNewStream);
|
||||||
|
@ -625,6 +627,35 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) {
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
int32_t numOfStream = 0;
|
||||||
|
|
||||||
|
SStreamObj *pStream = NULL;
|
||||||
|
void *pIter = NULL;
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
pIter = sdbFetch(pMnode->pSdb, SDB_STREAM, pIter, (void **)&pStream);
|
||||||
|
if (pIter == NULL) {
|
||||||
|
if (numOfStream > MND_STREAM_MAX_NUM) {
|
||||||
|
mError("too many streams, no more than 10 for each database");
|
||||||
|
terrno = TSDB_CODE_MND_TOO_MANY_STREAMS;
|
||||||
|
goto _OVER;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pStream->sourceDbUid == streamObj.sourceDbUid) {
|
||||||
|
++numOfStream;
|
||||||
|
}
|
||||||
|
sdbRelease(pMnode->pSdb, pStream);
|
||||||
|
if (numOfStream > MND_STREAM_MAX_NUM) {
|
||||||
|
mError("too many streams, no more than 10 for each database");
|
||||||
|
terrno = TSDB_CODE_MND_TOO_MANY_STREAMS;
|
||||||
|
goto _OVER;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pDb = mndAcquireDb(pMnode, streamObj.sourceDb);
|
pDb = mndAcquireDb(pMnode, streamObj.sourceDb);
|
||||||
if (pDb->cfg.replications != 1) {
|
if (pDb->cfg.replications != 1) {
|
||||||
mError("stream source db must have only 1 replica, but %s has %d", pDb->name, pDb->cfg.replications);
|
mError("stream source db must have only 1 replica, but %s has %d", pDb->name, pDb->cfg.replications);
|
||||||
|
|
|
@ -114,8 +114,9 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta
|
||||||
taosThreadMutexUnlock(&pMgmt->lock);
|
taosThreadMutexUnlock(&pMgmt->lock);
|
||||||
STrans *pTrans = mndAcquireTrans(pMnode, transId);
|
STrans *pTrans = mndAcquireTrans(pMnode, transId);
|
||||||
if (pTrans != NULL) {
|
if (pTrans != NULL) {
|
||||||
mInfo("trans:%d, execute in mnode which not leader or sync timeout", transId);
|
mInfo("trans:%d, execute in mnode which not leader or sync timeout, createTime:%" PRId64 " saved trans:%d",
|
||||||
mndTransExecute(pMnode, pTrans);
|
transId, pTrans->createdTime, pMgmt->transId);
|
||||||
|
mndTransExecute(pMnode, pTrans, false);
|
||||||
mndReleaseTrans(pMnode, pTrans);
|
mndReleaseTrans(pMnode, pTrans);
|
||||||
// sdbWriteFile(pMnode->pSdb, SDB_WRITE_DELTA);
|
// sdbWriteFile(pMnode->pSdb, SDB_WRITE_DELTA);
|
||||||
} else {
|
} else {
|
||||||
|
@ -372,7 +373,7 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) {
|
||||||
taosThreadMutexLock(&pMgmt->lock);
|
taosThreadMutexLock(&pMgmt->lock);
|
||||||
pMgmt->errCode = 0;
|
pMgmt->errCode = 0;
|
||||||
|
|
||||||
if (pMgmt->transId != 0) {
|
if (pMgmt->transId != 0 /* && pMgmt->transId != transId*/) {
|
||||||
mError("trans:%d, can't be proposed since trans:%d already waiting for confirm", transId, pMgmt->transId);
|
mError("trans:%d, can't be proposed since trans:%d already waiting for confirm", transId, pMgmt->transId);
|
||||||
taosThreadMutexUnlock(&pMgmt->lock);
|
taosThreadMutexUnlock(&pMgmt->lock);
|
||||||
rpcFreeCont(req.pCont);
|
rpcFreeCont(req.pCont);
|
||||||
|
|
|
@ -791,16 +791,18 @@ static int32_t mndTransSync(SMnode *pMnode, STrans *pTrans) {
|
||||||
}
|
}
|
||||||
(void)sdbSetRawStatus(pRaw, SDB_STATUS_READY);
|
(void)sdbSetRawStatus(pRaw, SDB_STATUS_READY);
|
||||||
|
|
||||||
mInfo("trans:%d, sync to other mnodes, stage:%s", pTrans->id, mndTransStr(pTrans->stage));
|
mInfo("trans:%d, sync to other mnodes, stage:%s createTime:%" PRId64, pTrans->id, mndTransStr(pTrans->stage),
|
||||||
|
pTrans->createdTime);
|
||||||
int32_t code = mndSyncPropose(pMnode, pRaw, pTrans->id);
|
int32_t code = mndSyncPropose(pMnode, pRaw, pTrans->id);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
mError("trans:%d, failed to sync, errno:%s code:%s", pTrans->id, terrstr(), tstrerror(code));
|
mError("trans:%d, failed to sync, errno:%s code:%s createTime:%" PRId64 " saved trans:%d", pTrans->id, terrstr(),
|
||||||
|
tstrerror(code), pTrans->createdTime, pMnode->syncMgmt.transId);
|
||||||
sdbFreeRaw(pRaw);
|
sdbFreeRaw(pRaw);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeRaw(pRaw);
|
sdbFreeRaw(pRaw);
|
||||||
mInfo("trans:%d, sync finished", pTrans->id);
|
mInfo("trans:%d, sync finished, createTime:%" PRId64, pTrans->id, pTrans->createdTime);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -903,7 +905,7 @@ int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans) {
|
||||||
pTrans->rpcRsp = NULL;
|
pTrans->rpcRsp = NULL;
|
||||||
pTrans->rpcRspLen = 0;
|
pTrans->rpcRspLen = 0;
|
||||||
|
|
||||||
mndTransExecute(pMnode, pNew);
|
mndTransExecute(pMnode, pNew, true);
|
||||||
mndReleaseTrans(pMnode, pNew);
|
mndReleaseTrans(pMnode, pNew);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1066,7 +1068,7 @@ int32_t mndTransProcessRsp(SRpcMsg *pRsp) {
|
||||||
|
|
||||||
mInfo("trans:%d, %s:%d response is received, code:0x%x, accept:0x%x retry:0x%x", transId, mndTransStr(pAction->stage),
|
mInfo("trans:%d, %s:%d response is received, code:0x%x, accept:0x%x retry:0x%x", transId, mndTransStr(pAction->stage),
|
||||||
action, pRsp->code, pAction->acceptableCode, pAction->retryCode);
|
action, pRsp->code, pAction->acceptableCode, pAction->retryCode);
|
||||||
mndTransExecute(pMnode, pTrans);
|
mndTransExecute(pMnode, pTrans, true);
|
||||||
|
|
||||||
_OVER:
|
_OVER:
|
||||||
mndReleaseTrans(pMnode, pTrans);
|
mndReleaseTrans(pMnode, pTrans);
|
||||||
|
@ -1495,15 +1497,17 @@ static bool mndTransPerfromFinishedStage(SMnode *pMnode, STrans *pTrans) {
|
||||||
mError("trans:%d, failed to write sdb since %s", pTrans->id, terrstr());
|
mError("trans:%d, failed to write sdb since %s", pTrans->id, terrstr());
|
||||||
}
|
}
|
||||||
|
|
||||||
mInfo("trans:%d, execute finished, code:0x%x, failedTimes:%d", pTrans->id, pTrans->code, pTrans->failedTimes);
|
mInfo("trans:%d, execute finished, code:0x%x, failedTimes:%d createTime:%" PRId64, pTrans->id, pTrans->code,
|
||||||
|
pTrans->failedTimes, pTrans->createdTime);
|
||||||
return continueExec;
|
return continueExec;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mndTransExecute(SMnode *pMnode, STrans *pTrans) {
|
void mndTransExecute(SMnode *pMnode, STrans *pTrans, bool isLeader) {
|
||||||
bool continueExec = true;
|
bool continueExec = true;
|
||||||
|
|
||||||
while (continueExec) {
|
while (continueExec) {
|
||||||
mInfo("trans:%d, continue to execute, stage:%s", pTrans->id, mndTransStr(pTrans->stage));
|
mInfo("trans:%d, continue to execute, stage:%s createTime:%" PRId64 " leader:%d", pTrans->id,
|
||||||
|
mndTransStr(pTrans->stage), pTrans->createdTime, isLeader);
|
||||||
pTrans->lastExecTime = taosGetTimestampMs();
|
pTrans->lastExecTime = taosGetTimestampMs();
|
||||||
switch (pTrans->stage) {
|
switch (pTrans->stage) {
|
||||||
case TRN_STAGE_PREPARE:
|
case TRN_STAGE_PREPARE:
|
||||||
|
@ -1513,13 +1517,23 @@ void mndTransExecute(SMnode *pMnode, STrans *pTrans) {
|
||||||
continueExec = mndTransPerformRedoActionStage(pMnode, pTrans);
|
continueExec = mndTransPerformRedoActionStage(pMnode, pTrans);
|
||||||
break;
|
break;
|
||||||
case TRN_STAGE_COMMIT:
|
case TRN_STAGE_COMMIT:
|
||||||
|
if (isLeader) {
|
||||||
continueExec = mndTransPerformCommitStage(pMnode, pTrans);
|
continueExec = mndTransPerformCommitStage(pMnode, pTrans);
|
||||||
|
} else {
|
||||||
|
mInfo("trans:%d, can not commit since not leader", pTrans->id);
|
||||||
|
continueExec = false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TRN_STAGE_COMMIT_ACTION:
|
case TRN_STAGE_COMMIT_ACTION:
|
||||||
continueExec = mndTransPerformCommitActionStage(pMnode, pTrans);
|
continueExec = mndTransPerformCommitActionStage(pMnode, pTrans);
|
||||||
break;
|
break;
|
||||||
case TRN_STAGE_ROLLBACK:
|
case TRN_STAGE_ROLLBACK:
|
||||||
|
if (isLeader) {
|
||||||
continueExec = mndTransPerformRollbackStage(pMnode, pTrans);
|
continueExec = mndTransPerformRollbackStage(pMnode, pTrans);
|
||||||
|
} else {
|
||||||
|
mInfo("trans:%d, can not rollback since not leader", pTrans->id);
|
||||||
|
continueExec = false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TRN_STAGE_UNDO_ACTION:
|
case TRN_STAGE_UNDO_ACTION:
|
||||||
continueExec = mndTransPerformUndoActionStage(pMnode, pTrans);
|
continueExec = mndTransPerformUndoActionStage(pMnode, pTrans);
|
||||||
|
@ -1562,7 +1576,7 @@ int32_t mndKillTrans(SMnode *pMnode, STrans *pTrans) {
|
||||||
pAction->errCode = 0;
|
pAction->errCode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
mndTransExecute(pMnode, pTrans);
|
mndTransExecute(pMnode, pTrans, true);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1620,7 +1634,7 @@ void mndTransPullup(SMnode *pMnode) {
|
||||||
int32_t *pTransId = taosArrayGet(pArray, i);
|
int32_t *pTransId = taosArrayGet(pArray, i);
|
||||||
STrans *pTrans = mndAcquireTrans(pMnode, *pTransId);
|
STrans *pTrans = mndAcquireTrans(pMnode, *pTransId);
|
||||||
if (pTrans != NULL) {
|
if (pTrans != NULL) {
|
||||||
mndTransExecute(pMnode, pTrans);
|
mndTransExecute(pMnode, pTrans, true);
|
||||||
}
|
}
|
||||||
mndReleaseTrans(pMnode, pTrans);
|
mndReleaseTrans(pMnode, pTrans);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1658,12 +1658,18 @@ int32_t convertFillType(int32_t mode) {
|
||||||
case FILL_MODE_NULL:
|
case FILL_MODE_NULL:
|
||||||
type = TSDB_FILL_NULL;
|
type = TSDB_FILL_NULL;
|
||||||
break;
|
break;
|
||||||
|
case FILL_MODE_NULL_F:
|
||||||
|
type = TSDB_FILL_NULL_F;
|
||||||
|
break;
|
||||||
case FILL_MODE_NEXT:
|
case FILL_MODE_NEXT:
|
||||||
type = TSDB_FILL_NEXT;
|
type = TSDB_FILL_NEXT;
|
||||||
break;
|
break;
|
||||||
case FILL_MODE_VALUE:
|
case FILL_MODE_VALUE:
|
||||||
type = TSDB_FILL_SET_VALUE;
|
type = TSDB_FILL_SET_VALUE;
|
||||||
break;
|
break;
|
||||||
|
case FILL_MODE_VALUE_F:
|
||||||
|
type = TSDB_FILL_SET_VALUE_F;
|
||||||
|
break;
|
||||||
case FILL_MODE_LINEAR:
|
case FILL_MODE_LINEAR:
|
||||||
type = TSDB_FILL_LINEAR;
|
type = TSDB_FILL_LINEAR;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -140,7 +140,7 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) {
|
||||||
while (1) {
|
while (1) {
|
||||||
SSDataBlock* pBlock = pDownstream->fpSet.getNextFn(pDownstream);
|
SSDataBlock* pBlock = pDownstream->fpSet.getNextFn(pDownstream);
|
||||||
if (pBlock == NULL) {
|
if (pBlock == NULL) {
|
||||||
if (pInfo->totalInputRows == 0) {
|
if (pInfo->totalInputRows == 0 && (pInfo->pFillInfo->type != TSDB_FILL_NULL_F && pInfo->pFillInfo->type != TSDB_FILL_SET_VALUE_F)) {
|
||||||
setOperatorCompleted(pOperator);
|
setOperatorCompleted(pOperator);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -456,7 +456,8 @@ void* destroyStreamFillLinearInfo(SStreamFillLinearInfo* pFillLinear) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
void* destroyStreamFillInfo(SStreamFillInfo* pFillInfo) {
|
void* destroyStreamFillInfo(SStreamFillInfo* pFillInfo) {
|
||||||
if (pFillInfo->type == TSDB_FILL_SET_VALUE || pFillInfo->type == TSDB_FILL_NULL) {
|
if (pFillInfo->type == TSDB_FILL_SET_VALUE || pFillInfo->type == TSDB_FILL_SET_VALUE_F ||
|
||||||
|
pFillInfo->type == TSDB_FILL_NULL || pFillInfo->type == TSDB_FILL_NULL_F) {
|
||||||
taosMemoryFreeClear(pFillInfo->pResRow->pRowVal);
|
taosMemoryFreeClear(pFillInfo->pResRow->pRowVal);
|
||||||
taosMemoryFreeClear(pFillInfo->pResRow);
|
taosMemoryFreeClear(pFillInfo->pResRow);
|
||||||
}
|
}
|
||||||
|
@ -661,7 +662,9 @@ void setDeleteFillValueInfo(TSKEY start, TSKEY end, SStreamFillSupporter* pFillS
|
||||||
pFillInfo->pos = FILL_POS_INVALID;
|
pFillInfo->pos = FILL_POS_INVALID;
|
||||||
switch (pFillInfo->type) {
|
switch (pFillInfo->type) {
|
||||||
case TSDB_FILL_NULL:
|
case TSDB_FILL_NULL:
|
||||||
|
case TSDB_FILL_NULL_F:
|
||||||
case TSDB_FILL_SET_VALUE:
|
case TSDB_FILL_SET_VALUE:
|
||||||
|
case TSDB_FILL_SET_VALUE_F:
|
||||||
break;
|
break;
|
||||||
case TSDB_FILL_PREV:
|
case TSDB_FILL_PREV:
|
||||||
pFillInfo->pResRow = &pFillSup->prev;
|
pFillInfo->pResRow = &pFillSup->prev;
|
||||||
|
@ -720,7 +723,9 @@ void setFillValueInfo(SSDataBlock* pBlock, TSKEY ts, int32_t rowId, SStreamFillS
|
||||||
pFillInfo->pos = FILL_POS_INVALID;
|
pFillInfo->pos = FILL_POS_INVALID;
|
||||||
switch (pFillInfo->type) {
|
switch (pFillInfo->type) {
|
||||||
case TSDB_FILL_NULL:
|
case TSDB_FILL_NULL:
|
||||||
case TSDB_FILL_SET_VALUE: {
|
case TSDB_FILL_NULL_F:
|
||||||
|
case TSDB_FILL_SET_VALUE:
|
||||||
|
case TSDB_FILL_SET_VALUE_F: {
|
||||||
if (pFillSup->prev.key == pFillInfo->preRowKey) {
|
if (pFillSup->prev.key == pFillInfo->preRowKey) {
|
||||||
resetFillWindow(&pFillSup->prev);
|
resetFillWindow(&pFillSup->prev);
|
||||||
}
|
}
|
||||||
|
@ -1360,7 +1365,8 @@ SStreamFillInfo* initStreamFillInfo(SStreamFillSupporter* pFillSup, SSDataBlock*
|
||||||
pFillInfo->pLinearInfo->winIndex = 0;
|
pFillInfo->pLinearInfo->winIndex = 0;
|
||||||
|
|
||||||
pFillInfo->pResRow = NULL;
|
pFillInfo->pResRow = NULL;
|
||||||
if (pFillSup->type == TSDB_FILL_SET_VALUE || pFillSup->type == TSDB_FILL_NULL) {
|
if (pFillSup->type == TSDB_FILL_SET_VALUE || pFillSup->type == TSDB_FILL_SET_VALUE_F
|
||||||
|
|| pFillSup->type == TSDB_FILL_NULL || pFillSup->type == TSDB_FILL_NULL_F) {
|
||||||
pFillInfo->pResRow = taosMemoryCalloc(1, sizeof(SResultRowData));
|
pFillInfo->pResRow = taosMemoryCalloc(1, sizeof(SResultRowData));
|
||||||
pFillInfo->pResRow->key = INT64_MIN;
|
pFillInfo->pResRow->key = INT64_MIN;
|
||||||
pFillInfo->pResRow->pRowVal = taosMemoryCalloc(1, pFillSup->rowSize);
|
pFillInfo->pResRow->pRowVal = taosMemoryCalloc(1, pFillSup->rowSize);
|
||||||
|
@ -1405,7 +1411,7 @@ SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFi
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pInfo->pFillInfo->type == TSDB_FILL_SET_VALUE) {
|
if (pInfo->pFillInfo->type == TSDB_FILL_SET_VALUE || pInfo->pFillInfo->type == TSDB_FILL_SET_VALUE_F) {
|
||||||
for (int32_t i = 0; i < pInfo->pFillSup->numOfAllCols; ++i) {
|
for (int32_t i = 0; i < pInfo->pFillSup->numOfAllCols; ++i) {
|
||||||
SFillColInfo* pFillCol = pInfo->pFillSup->pAllColInfo + i;
|
SFillColInfo* pFillCol = pInfo->pFillSup->pAllColInfo + i;
|
||||||
int32_t slotId = GET_DEST_SLOT_ID(pFillCol);
|
int32_t slotId = GET_DEST_SLOT_ID(pFillCol);
|
||||||
|
@ -1427,7 +1433,7 @@ SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFi
|
||||||
pCell->isNull = true;
|
pCell->isNull = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (pInfo->pFillInfo->type == TSDB_FILL_NULL) {
|
} else if (pInfo->pFillInfo->type == TSDB_FILL_NULL || pInfo->pFillInfo->type == TSDB_FILL_NULL_F) {
|
||||||
for (int32_t i = 0; i < pInfo->pFillSup->numOfAllCols; ++i) {
|
for (int32_t i = 0; i < pInfo->pFillSup->numOfAllCols; ++i) {
|
||||||
SFillColInfo* pFillCol = pInfo->pFillSup->pAllColInfo + i;
|
SFillColInfo* pFillCol = pInfo->pFillSup->pAllColInfo + i;
|
||||||
int32_t slotId = GET_DEST_SLOT_ID(pFillCol);
|
int32_t slotId = GET_DEST_SLOT_ID(pFillCol);
|
||||||
|
|
|
@ -829,6 +829,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
|
||||||
SPartitionOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SPartitionOperatorInfo));
|
SPartitionOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SPartitionOperatorInfo));
|
||||||
SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo));
|
SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo));
|
||||||
if (pInfo == NULL || pOperator == NULL) {
|
if (pInfo == NULL || pOperator == NULL) {
|
||||||
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
pTaskInfo->code = terrno;
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -841,6 +843,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
|
||||||
SExprInfo* pExprInfo1 = createExprInfo(pPartNode->pExprs, NULL, &num);
|
SExprInfo* pExprInfo1 = createExprInfo(pPartNode->pExprs, NULL, &num);
|
||||||
int32_t code = initExprSupp(&pInfo->scalarSup, pExprInfo1, num);
|
int32_t code = initExprSupp(&pInfo->scalarSup, pExprInfo1, num);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
terrno = code;
|
||||||
|
pTaskInfo->code = terrno;
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -848,6 +852,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
|
||||||
_hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY);
|
_hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY);
|
||||||
pInfo->pGroupSet = taosHashInit(100, hashFn, false, HASH_NO_LOCK);
|
pInfo->pGroupSet = taosHashInit(100, hashFn, false, HASH_NO_LOCK);
|
||||||
if (pInfo->pGroupSet == NULL) {
|
if (pInfo->pGroupSet == NULL) {
|
||||||
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
pTaskInfo->code = terrno;
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -866,6 +872,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
|
||||||
|
|
||||||
int32_t code = createDiskbasedBuf(&pInfo->pBuf, defaultPgsz, defaultBufsz, pTaskInfo->id.str, tsTempDir);
|
int32_t code = createDiskbasedBuf(&pInfo->pBuf, defaultPgsz, defaultBufsz, pTaskInfo->id.str, tsTempDir);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
terrno = code;
|
||||||
|
pTaskInfo->code = code;
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -873,6 +881,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
|
||||||
pInfo->columnOffset = setupColumnOffset(pInfo->binfo.pRes, pInfo->rowCapacity);
|
pInfo->columnOffset = setupColumnOffset(pInfo->binfo.pRes, pInfo->rowCapacity);
|
||||||
code = initGroupOptrInfo(&pInfo->pGroupColVals, &pInfo->groupKeyLen, &pInfo->keyBuf, pInfo->pGroupCols);
|
code = initGroupOptrInfo(&pInfo->pGroupColVals, &pInfo->groupKeyLen, &pInfo->keyBuf, pInfo->pGroupCols);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
terrno = code;
|
||||||
|
pTaskInfo->code = code;
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -885,10 +895,15 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
|
||||||
createOperatorFpSet(optrDummyOpenFn, hashPartition, NULL, destroyPartitionOperatorInfo, optrDefaultBufFn, NULL);
|
createOperatorFpSet(optrDummyOpenFn, hashPartition, NULL, destroyPartitionOperatorInfo, optrDefaultBufFn, NULL);
|
||||||
|
|
||||||
code = appendDownstream(pOperator, &downstream, 1);
|
code = appendDownstream(pOperator, &downstream, 1);
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
terrno = code;
|
||||||
|
pTaskInfo->code = code;
|
||||||
|
goto _error;
|
||||||
|
}
|
||||||
|
|
||||||
return pOperator;
|
return pOperator;
|
||||||
|
|
||||||
_error:
|
_error:
|
||||||
pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
if (pInfo != NULL) {
|
if (pInfo != NULL) {
|
||||||
destroyPartitionOperatorInfo(pInfo);
|
destroyPartitionOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,7 +186,7 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (pFillInfo->type == TSDB_FILL_NULL) { // fill with NULL
|
} else if (pFillInfo->type == TSDB_FILL_NULL || pFillInfo->type == TSDB_FILL_NULL_F) { // fill with NULL
|
||||||
setNullRow(pBlock, pFillInfo, index);
|
setNullRow(pBlock, pFillInfo, index);
|
||||||
} else { // fill with user specified value for each column
|
} else { // fill with user specified value for each column
|
||||||
for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
|
for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
|
||||||
|
@ -349,7 +349,7 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t
|
||||||
bool isNull = colDataIsNull_s(pSrc, pFillInfo->index);
|
bool isNull = colDataIsNull_s(pSrc, pFillInfo->index);
|
||||||
colDataAppend(pDst, index, src, isNull);
|
colDataAppend(pDst, index, src, isNull);
|
||||||
saveColData(pFillInfo->prev.pRowVal, i, src, isNull); // todo:
|
saveColData(pFillInfo->prev.pRowVal, i, src, isNull); // todo:
|
||||||
} else if (pFillInfo->type == TSDB_FILL_NULL) {
|
} else if (pFillInfo->type == TSDB_FILL_NULL || pFillInfo->type == TSDB_FILL_NULL_F) {
|
||||||
colDataAppendNULL(pDst, index);
|
colDataAppendNULL(pDst, index);
|
||||||
} else if (pFillInfo->type == TSDB_FILL_NEXT) {
|
} else if (pFillInfo->type == TSDB_FILL_NEXT) {
|
||||||
SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->next.pRowVal : pFillInfo->prev.pRowVal;
|
SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->next.pRowVal : pFillInfo->prev.pRowVal;
|
||||||
|
@ -546,15 +546,14 @@ bool taosFillHasMoreResults(SFillInfo* pFillInfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t getNumOfResultsAfterFillGap(SFillInfo* pFillInfo, TSKEY ekey, int32_t maxNumOfRows) {
|
int64_t getNumOfResultsAfterFillGap(SFillInfo* pFillInfo, TSKEY ekey, int32_t maxNumOfRows) {
|
||||||
SColumnInfoData* pCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, pFillInfo->srcTsSlotId);
|
|
||||||
|
|
||||||
int64_t* tsList = (int64_t*)pCol->pData;
|
|
||||||
int32_t numOfRows = taosNumOfRemainRows(pFillInfo);
|
int32_t numOfRows = taosNumOfRemainRows(pFillInfo);
|
||||||
|
|
||||||
TSKEY ekey1 = ekey;
|
TSKEY ekey1 = ekey;
|
||||||
|
|
||||||
int64_t numOfRes = -1;
|
int64_t numOfRes = -1;
|
||||||
if (numOfRows > 0) { // still fill gap within current data block, not generating data after the result set.
|
if (numOfRows > 0) { // still fill gap within current data block, not generating data after the result set.
|
||||||
|
SColumnInfoData* pCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, pFillInfo->srcTsSlotId);
|
||||||
|
int64_t* tsList = (int64_t*)pCol->pData;
|
||||||
TSKEY lastKey = tsList[pFillInfo->numOfRows - 1];
|
TSKEY lastKey = tsList[pFillInfo->numOfRows - 1];
|
||||||
numOfRes = taosTimeCountInterval(lastKey, pFillInfo->currentKey, pFillInfo->interval.sliding,
|
numOfRes = taosTimeCountInterval(lastKey, pFillInfo->currentKey, pFillInfo->interval.sliding,
|
||||||
pFillInfo->interval.slidingUnit, pFillInfo->interval.precision);
|
pFillInfo->interval.slidingUnit, pFillInfo->interval.precision);
|
||||||
|
|
|
@ -181,12 +181,14 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
|
||||||
|
|
||||||
int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId;
|
int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId;
|
||||||
switch (pSliceInfo->fillType) {
|
switch (pSliceInfo->fillType) {
|
||||||
case TSDB_FILL_NULL: {
|
case TSDB_FILL_NULL:
|
||||||
|
case TSDB_FILL_NULL_F: {
|
||||||
colDataAppendNULL(pDst, rows);
|
colDataAppendNULL(pDst, rows);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case TSDB_FILL_SET_VALUE: {
|
case TSDB_FILL_SET_VALUE:
|
||||||
|
case TSDB_FILL_SET_VALUE_F: {
|
||||||
SVariant* pVar = &pSliceInfo->pFillColInfo[j].fillVal;
|
SVariant* pVar = &pSliceInfo->pFillColInfo[j].fillVal;
|
||||||
|
|
||||||
if (pDst->info.type == TSDB_DATA_TYPE_FLOAT) {
|
if (pDst->info.type == TSDB_DATA_TYPE_FLOAT) {
|
||||||
|
|
|
@ -1990,10 +1990,14 @@ char* nodesGetFillModeString(EFillMode mode) {
|
||||||
return "none";
|
return "none";
|
||||||
case FILL_MODE_VALUE:
|
case FILL_MODE_VALUE:
|
||||||
return "value";
|
return "value";
|
||||||
|
case FILL_MODE_VALUE_F:
|
||||||
|
return "value_f";
|
||||||
case FILL_MODE_PREV:
|
case FILL_MODE_PREV:
|
||||||
return "prev";
|
return "prev";
|
||||||
case FILL_MODE_NULL:
|
case FILL_MODE_NULL:
|
||||||
return "null";
|
return "null";
|
||||||
|
case FILL_MODE_NULL_F:
|
||||||
|
return "null_f";
|
||||||
case FILL_MODE_LINEAR:
|
case FILL_MODE_LINEAR:
|
||||||
return "linear";
|
return "linear";
|
||||||
case FILL_MODE_NEXT:
|
case FILL_MODE_NEXT:
|
||||||
|
|
|
@ -978,12 +978,14 @@ sliding_opt(A) ::= SLIDING NK_LP duration_literal(B) NK_RP.
|
||||||
fill_opt(A) ::= . { A = NULL; }
|
fill_opt(A) ::= . { A = NULL; }
|
||||||
fill_opt(A) ::= FILL NK_LP fill_mode(B) NK_RP. { A = createFillNode(pCxt, B, NULL); }
|
fill_opt(A) ::= FILL NK_LP fill_mode(B) NK_RP. { A = createFillNode(pCxt, B, NULL); }
|
||||||
fill_opt(A) ::= FILL NK_LP VALUE NK_COMMA literal_list(B) NK_RP. { A = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, B)); }
|
fill_opt(A) ::= FILL NK_LP VALUE NK_COMMA literal_list(B) NK_RP. { A = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, B)); }
|
||||||
|
fill_opt(A) ::= FILL NK_LP VALUE_F NK_COMMA literal_list(B) NK_RP. { A = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, B)); }
|
||||||
|
|
||||||
%type fill_mode { EFillMode }
|
%type fill_mode { EFillMode }
|
||||||
%destructor fill_mode { }
|
%destructor fill_mode { }
|
||||||
fill_mode(A) ::= NONE. { A = FILL_MODE_NONE; }
|
fill_mode(A) ::= NONE. { A = FILL_MODE_NONE; }
|
||||||
fill_mode(A) ::= PREV. { A = FILL_MODE_PREV; }
|
fill_mode(A) ::= PREV. { A = FILL_MODE_PREV; }
|
||||||
fill_mode(A) ::= NULL. { A = FILL_MODE_NULL; }
|
fill_mode(A) ::= NULL. { A = FILL_MODE_NULL; }
|
||||||
|
fill_mode(A) ::= NULL_F. { A = FILL_MODE_NULL_F; }
|
||||||
fill_mode(A) ::= LINEAR. { A = FILL_MODE_LINEAR; }
|
fill_mode(A) ::= LINEAR. { A = FILL_MODE_LINEAR; }
|
||||||
fill_mode(A) ::= NEXT. { A = FILL_MODE_NEXT; }
|
fill_mode(A) ::= NEXT. { A = FILL_MODE_NEXT; }
|
||||||
|
|
||||||
|
|
|
@ -148,6 +148,7 @@ static SKeyword keywordTable[] = {
|
||||||
{"NOT", TK_NOT},
|
{"NOT", TK_NOT},
|
||||||
{"NOW", TK_NOW},
|
{"NOW", TK_NOW},
|
||||||
{"NULL", TK_NULL},
|
{"NULL", TK_NULL},
|
||||||
|
{"NULL_F", TK_NULL_F},
|
||||||
{"NULLS", TK_NULLS},
|
{"NULLS", TK_NULLS},
|
||||||
{"OFFSET", TK_OFFSET},
|
{"OFFSET", TK_OFFSET},
|
||||||
{"ON", TK_ON},
|
{"ON", TK_ON},
|
||||||
|
@ -237,6 +238,7 @@ static SKeyword keywordTable[] = {
|
||||||
{"USERS", TK_USERS},
|
{"USERS", TK_USERS},
|
||||||
{"USING", TK_USING},
|
{"USING", TK_USING},
|
||||||
{"VALUE", TK_VALUE},
|
{"VALUE", TK_VALUE},
|
||||||
|
{"VALUE_F", TK_VALUE_F},
|
||||||
{"VALUES", TK_VALUES},
|
{"VALUES", TK_VALUES},
|
||||||
{"VARCHAR", TK_VARCHAR},
|
{"VARCHAR", TK_VARCHAR},
|
||||||
{"VARIABLES", TK_VARIABLES},
|
{"VARIABLES", TK_VARIABLES},
|
||||||
|
|
|
@ -2817,7 +2817,7 @@ static int32_t convertFillValue(STranslateContext* pCxt, SDataType dt, SNodeList
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t checkFillValues(STranslateContext* pCxt, SFillNode* pFill, SNodeList* pProjectionList) {
|
static int32_t checkFillValues(STranslateContext* pCxt, SFillNode* pFill, SNodeList* pProjectionList) {
|
||||||
if (FILL_MODE_VALUE != pFill->mode) {
|
if (FILL_MODE_VALUE != pFill->mode && FILL_MODE_VALUE_F != pFill->mode) {
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -517,7 +517,7 @@ int32_t qwHandlePostPhaseEvents(QW_FPARAMS_DEF, int8_t phase, SQWPhaseInput *inp
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QW_EVENT_RECEIVED(ctx, QW_EVENT_DROP)) {
|
if (QW_EVENT_RECEIVED(ctx, QW_EVENT_DROP)) {
|
||||||
if (QW_PHASE_POST_FETCH != phase || qwTaskNotInExec(ctx)) {
|
if (QW_PHASE_POST_FETCH != phase || ((!QW_QUERY_RUNNING(ctx)) && qwTaskNotInExec(ctx))) {
|
||||||
QW_ERR_JRET(qwDropTask(QW_FPARAMS()));
|
QW_ERR_JRET(qwDropTask(QW_FPARAMS()));
|
||||||
QW_ERR_JRET(ctx->rspCode);
|
QW_ERR_JRET(ctx->rspCode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -671,7 +671,7 @@ static SCliConn* cliCreateConn(SCliThrd* pThrd) {
|
||||||
conn->stream = (uv_stream_t*)taosMemoryMalloc(sizeof(uv_tcp_t));
|
conn->stream = (uv_stream_t*)taosMemoryMalloc(sizeof(uv_tcp_t));
|
||||||
uv_tcp_init(pThrd->loop, (uv_tcp_t*)(conn->stream));
|
uv_tcp_init(pThrd->loop, (uv_tcp_t*)(conn->stream));
|
||||||
conn->stream->data = conn;
|
conn->stream->data = conn;
|
||||||
transSetConnOption((uv_tcp_t*)conn->stream);
|
// transSetConnOption((uv_tcp_t*)conn->stream);
|
||||||
|
|
||||||
uv_timer_t* timer = taosArrayGetSize(pThrd->timerList) > 0 ? *(uv_timer_t**)taosArrayPop(pThrd->timerList) : NULL;
|
uv_timer_t* timer = taosArrayGetSize(pThrd->timerList) > 0 ? *(uv_timer_t**)taosArrayPop(pThrd->timerList) : NULL;
|
||||||
if (timer == NULL) {
|
if (timer == NULL) {
|
||||||
|
@ -778,7 +778,7 @@ static void cliSendCb(uv_write_t* req, int status) {
|
||||||
SCliMsg* pMsg = !transQueueEmpty(&pConn->cliMsgs) ? transQueueGet(&pConn->cliMsgs, 0) : NULL;
|
SCliMsg* pMsg = !transQueueEmpty(&pConn->cliMsgs) ? transQueueGet(&pConn->cliMsgs, 0) : NULL;
|
||||||
if (pMsg != NULL) {
|
if (pMsg != NULL) {
|
||||||
int64_t cost = taosGetTimestampUs() - pMsg->st;
|
int64_t cost = taosGetTimestampUs() - pMsg->st;
|
||||||
if (cost > 1000) {
|
if (cost > 1000 * 20) {
|
||||||
tWarn("%s conn %p send cost:%dus, send exception", CONN_GET_INST_LABEL(pConn), pConn, (int)cost);
|
tWarn("%s conn %p send cost:%dus, send exception", CONN_GET_INST_LABEL(pConn), pConn, (int)cost);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -800,9 +800,12 @@ static void cliSendCb(uv_write_t* req, int status) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void cliSend(SCliConn* pConn) {
|
void cliSend(SCliConn* pConn) {
|
||||||
bool empty = transQueueEmpty(&pConn->cliMsgs);
|
SCliThrd* pThrd = pConn->hostThrd;
|
||||||
ASSERTS(empty == false, "trans-cli get invalid msg");
|
STrans* pTransInst = pThrd->pTransInst;
|
||||||
if (empty == true) {
|
|
||||||
|
if (transQueueEmpty(&pConn->cliMsgs)) {
|
||||||
|
tError("%s conn %p not msg to send", pTransInst->label, pConn);
|
||||||
|
cliHandleExcept(pConn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -812,9 +815,6 @@ void cliSend(SCliConn* pConn) {
|
||||||
|
|
||||||
STransConnCtx* pCtx = pCliMsg->ctx;
|
STransConnCtx* pCtx = pCliMsg->ctx;
|
||||||
|
|
||||||
SCliThrd* pThrd = pConn->hostThrd;
|
|
||||||
STrans* pTransInst = pThrd->pTransInst;
|
|
||||||
|
|
||||||
STransMsg* pMsg = (STransMsg*)(&pCliMsg->msg);
|
STransMsg* pMsg = (STransMsg*)(&pCliMsg->msg);
|
||||||
if (pMsg->pCont == 0) {
|
if (pMsg->pCont == 0) {
|
||||||
pMsg->pCont = (void*)rpcMallocCont(0);
|
pMsg->pCont = (void*)rpcMallocCont(0);
|
||||||
|
@ -1067,9 +1067,10 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
|
||||||
STransConnCtx* pCtx = pMsg->ctx;
|
STransConnCtx* pCtx = pMsg->ctx;
|
||||||
|
|
||||||
cliMayCvtFqdnToIp(&pCtx->epSet, &pThrd->cvtAddr);
|
cliMayCvtFqdnToIp(&pCtx->epSet, &pThrd->cvtAddr);
|
||||||
|
STraceId* trace = &pMsg->msg.info.traceId;
|
||||||
|
|
||||||
if (!EPSET_IS_VALID(&pCtx->epSet)) {
|
if (!EPSET_IS_VALID(&pCtx->epSet)) {
|
||||||
tError("invalid epset");
|
tGError("%s, msg %s sent with invalid epset", pTransInst->label, TMSG_INFO(pMsg->msg.msgType));
|
||||||
destroyCmsg(pMsg);
|
destroyCmsg(pMsg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1138,10 +1139,29 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
|
||||||
addr.sin_addr.s_addr = ipaddr;
|
addr.sin_addr.s_addr = ipaddr;
|
||||||
addr.sin_port = (uint16_t)htons((uint16_t)conn->port);
|
addr.sin_port = (uint16_t)htons((uint16_t)conn->port);
|
||||||
|
|
||||||
STraceId* trace = &(pMsg->msg.info.traceId);
|
|
||||||
tGTrace("%s conn %p try to connect to %s:%d", pTransInst->label, conn, conn->ip, conn->port);
|
tGTrace("%s conn %p try to connect to %s:%d", pTransInst->label, conn, conn->ip, conn->port);
|
||||||
|
int32_t fd = taosCreateSocketWithTimeout(TRANS_CONN_TIMEOUT * 4);
|
||||||
|
if (fd == -1) {
|
||||||
|
tGError("%s conn %p failed to create socket, reason:%s", transLabel(pTransInst), conn,
|
||||||
|
tstrerror(TAOS_SYSTEM_ERROR(errno)));
|
||||||
|
cliHandleExcept(conn);
|
||||||
|
errno = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int ret = uv_tcp_open((uv_tcp_t*)conn->stream, fd);
|
||||||
|
if (ret != 0) {
|
||||||
|
tGError("%s conn %p failed to set stream, reason:%s", transLabel(pTransInst), conn, uv_err_name(ret));
|
||||||
|
cliHandleExcept(conn);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ret = transSetConnOption((uv_tcp_t*)conn->stream);
|
||||||
|
if (ret != 0) {
|
||||||
|
tGError("%s conn %p failed to set socket opt, reason:%s", transLabel(pTransInst), conn, uv_err_name(ret));
|
||||||
|
cliHandleExcept(conn);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int ret = uv_tcp_connect(&conn->connReq, (uv_tcp_t*)(conn->stream), (const struct sockaddr*)&addr, cliConnCb);
|
ret = uv_tcp_connect(&conn->connReq, (uv_tcp_t*)(conn->stream), (const struct sockaddr*)&addr, cliConnCb);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
tGError("%s conn %p failed to connect to %s:%d, reason:%s", pTransInst->label, conn, conn->ip, conn->port,
|
tGError("%s conn %p failed to connect to %s:%d, reason:%s", pTransInst->label, conn, conn->ip, conn->port,
|
||||||
uv_err_name(ret));
|
uv_err_name(ret));
|
||||||
|
@ -1156,7 +1176,6 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
|
||||||
}
|
}
|
||||||
uv_timer_start(conn->timer, cliConnTimeout, TRANS_CONN_TIMEOUT, 0);
|
uv_timer_start(conn->timer, cliConnTimeout, TRANS_CONN_TIMEOUT, 0);
|
||||||
}
|
}
|
||||||
STraceId* trace = &pMsg->msg.info.traceId;
|
|
||||||
tGTrace("%s conn %p ready", pTransInst->label, conn);
|
tGTrace("%s conn %p ready", pTransInst->label, conn);
|
||||||
}
|
}
|
||||||
static void cliAsyncCb(uv_async_t* handle) {
|
static void cliAsyncCb(uv_async_t* handle) {
|
||||||
|
@ -1292,6 +1311,10 @@ void* transInitClient(uint32_t ip, uint32_t port, char* label, int numOfThreads,
|
||||||
|
|
||||||
for (int i = 0; i < cli->numOfThreads; i++) {
|
for (int i = 0; i < cli->numOfThreads; i++) {
|
||||||
SCliThrd* pThrd = createThrdObj(shandle);
|
SCliThrd* pThrd = createThrdObj(shandle);
|
||||||
|
if (pThrd == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
int err = taosThreadCreate(&pThrd->thread, NULL, cliWorkThread, (void*)(pThrd));
|
int err = taosThreadCreate(&pThrd->thread, NULL, cliWorkThread, (void*)(pThrd));
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
tDebug("success to create tranport-cli thread:%d", i);
|
tDebug("success to create tranport-cli thread:%d", i);
|
||||||
|
@ -1349,9 +1372,23 @@ static SCliThrd* createThrdObj(void* trans) {
|
||||||
taosThreadMutexInit(&pThrd->msgMtx, NULL);
|
taosThreadMutexInit(&pThrd->msgMtx, NULL);
|
||||||
|
|
||||||
pThrd->loop = (uv_loop_t*)taosMemoryMalloc(sizeof(uv_loop_t));
|
pThrd->loop = (uv_loop_t*)taosMemoryMalloc(sizeof(uv_loop_t));
|
||||||
uv_loop_init(pThrd->loop);
|
int err = uv_loop_init(pThrd->loop);
|
||||||
|
if (err != 0) {
|
||||||
|
tError("failed to init uv_loop, reason:%s", uv_err_name(err));
|
||||||
|
taosMemoryFree(pThrd->loop);
|
||||||
|
taosThreadMutexDestroy(&pThrd->msgMtx);
|
||||||
|
taosMemoryFree(pThrd);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
pThrd->asyncPool = transAsyncPoolCreate(pThrd->loop, 8, pThrd, cliAsyncCb);
|
pThrd->asyncPool = transAsyncPoolCreate(pThrd->loop, 8, pThrd, cliAsyncCb);
|
||||||
|
if (pThrd->asyncPool == NULL) {
|
||||||
|
tError("failed to init async pool");
|
||||||
|
uv_loop_close(pThrd->loop);
|
||||||
|
taosMemoryFree(pThrd->loop);
|
||||||
|
taosThreadMutexDestroy(&pThrd->msgMtx);
|
||||||
|
taosMemoryFree(pThrd);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
pThrd->prepare = taosMemoryCalloc(1, sizeof(uv_prepare_t));
|
pThrd->prepare = taosMemoryCalloc(1, sizeof(uv_prepare_t));
|
||||||
uv_prepare_init(pThrd->loop, pThrd->prepare);
|
uv_prepare_init(pThrd->loop, pThrd->prepare);
|
||||||
|
|
|
@ -205,6 +205,10 @@ bool transReadComplete(SConnBuffer* connBuf) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int transSetConnOption(uv_tcp_t* stream) {
|
int transSetConnOption(uv_tcp_t* stream) {
|
||||||
|
#if defined(WINDOWS) || defined(DARWIN)
|
||||||
|
#else
|
||||||
|
uv_tcp_keepalive(stream, 1, 20);
|
||||||
|
#endif
|
||||||
return uv_tcp_nodelay(stream, 1);
|
return uv_tcp_nodelay(stream, 1);
|
||||||
// int ret = uv_tcp_keepalive(stream, 5, 60);
|
// int ret = uv_tcp_keepalive(stream, 5, 60);
|
||||||
}
|
}
|
||||||
|
@ -214,24 +218,37 @@ SAsyncPool* transAsyncPoolCreate(uv_loop_t* loop, int sz, void* arg, AsyncCB cb)
|
||||||
pool->nAsync = sz;
|
pool->nAsync = sz;
|
||||||
pool->asyncs = taosMemoryCalloc(1, sizeof(uv_async_t) * pool->nAsync);
|
pool->asyncs = taosMemoryCalloc(1, sizeof(uv_async_t) * pool->nAsync);
|
||||||
|
|
||||||
for (int i = 0; i < pool->nAsync; i++) {
|
int i = 0, err = 0;
|
||||||
|
for (i = 0; i < pool->nAsync; i++) {
|
||||||
|
uv_async_t* async = &(pool->asyncs[i]);
|
||||||
|
|
||||||
SAsyncItem* item = taosMemoryCalloc(1, sizeof(SAsyncItem));
|
SAsyncItem* item = taosMemoryCalloc(1, sizeof(SAsyncItem));
|
||||||
item->pThrd = arg;
|
item->pThrd = arg;
|
||||||
QUEUE_INIT(&item->qmsg);
|
QUEUE_INIT(&item->qmsg);
|
||||||
taosThreadMutexInit(&item->mtx, NULL);
|
taosThreadMutexInit(&item->mtx, NULL);
|
||||||
|
|
||||||
uv_async_t* async = &(pool->asyncs[i]);
|
|
||||||
uv_async_init(loop, async, cb);
|
|
||||||
async->data = item;
|
async->data = item;
|
||||||
|
err = uv_async_init(loop, async, cb);
|
||||||
|
if (err != 0) {
|
||||||
|
tError("failed to init async, reason:%s", uv_err_name(err));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i != pool->nAsync) {
|
||||||
|
transAsyncPoolDestroy(pool);
|
||||||
|
pool = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return pool;
|
return pool;
|
||||||
}
|
}
|
||||||
|
|
||||||
void transAsyncPoolDestroy(SAsyncPool* pool) {
|
void transAsyncPoolDestroy(SAsyncPool* pool) {
|
||||||
for (int i = 0; i < pool->nAsync; i++) {
|
for (int i = 0; i < pool->nAsync; i++) {
|
||||||
uv_async_t* async = &(pool->asyncs[i]);
|
uv_async_t* async = &(pool->asyncs[i]);
|
||||||
|
|
||||||
SAsyncItem* item = async->data;
|
SAsyncItem* item = async->data;
|
||||||
|
if (item == NULL) continue;
|
||||||
|
|
||||||
taosThreadMutexDestroy(&item->mtx);
|
taosThreadMutexDestroy(&item->mtx);
|
||||||
taosMemoryFree(item);
|
taosMemoryFree(item);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1071,11 +1071,12 @@ int32_t taosCreateSocketWithTimeout(uint32_t timeout) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#elif defined(_TD_DARWIN_64)
|
#elif defined(_TD_DARWIN_64)
|
||||||
uint32_t conn_timeout_ms = timeout * 1000;
|
// invalid config
|
||||||
if (0 != setsockopt(fd, IPPROTO_TCP, TCP_CONNECTIONTIMEOUT, (char *)&conn_timeout_ms, sizeof(conn_timeout_ms))) {
|
// uint32_t conn_timeout_ms = timeout * 1000;
|
||||||
taosCloseSocketNoCheck1(fd);
|
// if (0 != setsockopt(fd, IPPROTO_TCP, TCP_CONNECTIONTIMEOUT, (char *)&conn_timeout_ms, sizeof(conn_timeout_ms))) {
|
||||||
return -1;
|
// taosCloseSocketNoCheck1(fd);
|
||||||
}
|
// return -1;
|
||||||
|
//}
|
||||||
#else // Linux like systems
|
#else // Linux like systems
|
||||||
uint32_t conn_timeout_ms = timeout * 1000;
|
uint32_t conn_timeout_ms = timeout * 1000;
|
||||||
if (0 != setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, (char *)&conn_timeout_ms, sizeof(conn_timeout_ms))) {
|
if (0 != setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, (char *)&conn_timeout_ms, sizeof(conn_timeout_ms))) {
|
||||||
|
|
|
@ -287,6 +287,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_STREAM_NOT_EXIST, "Stream not exist")
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_STREAM_OPTION, "Invalid stream option")
|
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_STREAM_OPTION, "Invalid stream option")
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_MND_STREAM_MUST_BE_DELETED, "Stream must be dropped first")
|
TAOS_DEFINE_ERROR(TSDB_CODE_MND_STREAM_MUST_BE_DELETED, "Stream must be dropped first")
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_MND_MULTI_REPLICA_SOURCE_DB, "Stream temporarily does not support source db having replica > 1")
|
TAOS_DEFINE_ERROR(TSDB_CODE_MND_MULTI_REPLICA_SOURCE_DB, "Stream temporarily does not support source db having replica > 1")
|
||||||
|
TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_STREAMS, "Too many streams")
|
||||||
|
|
||||||
// mnode-sma
|
// mnode-sma
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SMA_ALREADY_EXIST, "SMA already exists")
|
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SMA_ALREADY_EXIST, "SMA already exists")
|
||||||
|
|
|
@ -56,6 +56,9 @@ static int32_t createDiskFile(SDiskbasedBuf* pBuf) {
|
||||||
char path[PATH_MAX] = {0};
|
char path[PATH_MAX] = {0};
|
||||||
taosGetTmpfilePath(pBuf->prefix, "paged-buf", path);
|
taosGetTmpfilePath(pBuf->prefix, "paged-buf", path);
|
||||||
pBuf->path = taosMemoryStrDup(path);
|
pBuf->path = taosMemoryStrDup(path);
|
||||||
|
if (pBuf->path == NULL) {
|
||||||
|
return TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pBuf->pFile =
|
pBuf->pFile =
|
||||||
|
@ -166,6 +169,7 @@ static char* doFlushBufPage(SDiskbasedBuf* pBuf, SPageInfo* pg) {
|
||||||
t = doCompressData(payload, pBuf->pageSize, &size, pBuf);
|
t = doCompressData(payload, pBuf->pageSize, &size, pBuf);
|
||||||
if (size < 0) {
|
if (size < 0) {
|
||||||
uError("failed to compress data when flushing data to disk, %s", pBuf->id);
|
uError("failed to compress data when flushing data to disk, %s", pBuf->id);
|
||||||
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,6 +304,7 @@ static SListNode* getEldestUnrefedPage(SDiskbasedBuf* pBuf) {
|
||||||
static char* evictBufPage(SDiskbasedBuf* pBuf) {
|
static char* evictBufPage(SDiskbasedBuf* pBuf) {
|
||||||
SListNode* pn = getEldestUnrefedPage(pBuf);
|
SListNode* pn = getEldestUnrefedPage(pBuf);
|
||||||
if (pn == NULL) { // no available buffer pages now, return.
|
if (pn == NULL) { // no available buffer pages now, return.
|
||||||
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -396,11 +401,12 @@ static char* doExtractPage(SDiskbasedBuf* pBuf) {
|
||||||
if (NO_IN_MEM_AVAILABLE_PAGES(pBuf)) {
|
if (NO_IN_MEM_AVAILABLE_PAGES(pBuf)) {
|
||||||
availablePage = evictBufPage(pBuf);
|
availablePage = evictBufPage(pBuf);
|
||||||
if (availablePage == NULL) {
|
if (availablePage == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
uWarn("no available buf pages, current:%d, max:%d, reason: %s, %s", listNEles(pBuf->lruList), pBuf->inMemPages,
|
||||||
uWarn("no available buf pages, current:%d, max:%d, %s", listNEles(pBuf->lruList), pBuf->inMemPages, pBuf->id);
|
terrstr(), pBuf->id)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
availablePage = taosMemoryCalloc(1, getAllocPageSize(pBuf->pageSize)); // add extract bytes in case of zipped buffer increased.
|
availablePage =
|
||||||
|
taosMemoryCalloc(1, getAllocPageSize(pBuf->pageSize)); // add extract bytes in case of zipped buffer increased.
|
||||||
if (availablePage == NULL) {
|
if (availablePage == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
@ -548,9 +554,7 @@ void releaseBufPageInfo(SDiskbasedBuf* pBuf, SPageInfo* pi) {
|
||||||
|
|
||||||
size_t getTotalBufSize(const SDiskbasedBuf* pBuf) { return (size_t)pBuf->totalBufSize; }
|
size_t getTotalBufSize(const SDiskbasedBuf* pBuf) { return (size_t)pBuf->totalBufSize; }
|
||||||
|
|
||||||
SArray* getDataBufPagesIdList(SDiskbasedBuf* pBuf) {
|
SArray* getDataBufPagesIdList(SDiskbasedBuf* pBuf) { return pBuf->pIdList; }
|
||||||
return pBuf->pIdList;
|
|
||||||
}
|
|
||||||
|
|
||||||
void destroyDiskbasedBuf(SDiskbasedBuf* pBuf) {
|
void destroyDiskbasedBuf(SDiskbasedBuf* pBuf) {
|
||||||
if (pBuf == NULL) {
|
if (pBuf == NULL) {
|
||||||
|
@ -624,9 +628,7 @@ SPageInfo* getLastPageInfo(SArray* pList) {
|
||||||
return pPgInfo;
|
return pPgInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t getPageId(const SPageInfo* pPgInfo) {
|
int32_t getPageId(const SPageInfo* pPgInfo) { return pPgInfo->pageId; }
|
||||||
return pPgInfo->pageId;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t getBufPageSize(const SDiskbasedBuf* pBuf) { return pBuf->pageSize; }
|
int32_t getBufPageSize(const SDiskbasedBuf* pBuf) { return pBuf->pageSize; }
|
||||||
|
|
||||||
|
|
|
@ -178,6 +178,7 @@
|
||||||
,,y,script,./test.sh -f tsim/query/udf_with_const.sim
|
,,y,script,./test.sh -f tsim/query/udf_with_const.sim
|
||||||
,,y,script,./test.sh -f tsim/query/sys_tbname.sim
|
,,y,script,./test.sh -f tsim/query/sys_tbname.sim
|
||||||
,,y,script,./test.sh -f tsim/query/groupby.sim
|
,,y,script,./test.sh -f tsim/query/groupby.sim
|
||||||
|
,,y,script,./test.sh -f tsim/query/forceFill.sim
|
||||||
,,y,script,./test.sh -f tsim/qnode/basic1.sim
|
,,y,script,./test.sh -f tsim/qnode/basic1.sim
|
||||||
,,y,script,./test.sh -f tsim/snode/basic1.sim
|
,,y,script,./test.sh -f tsim/snode/basic1.sim
|
||||||
,,y,script,./test.sh -f tsim/mnode/basic1.sim
|
,,y,script,./test.sh -f tsim/mnode/basic1.sim
|
||||||
|
|
|
@ -0,0 +1,367 @@
|
||||||
|
system sh/stop_dnodes.sh
|
||||||
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
sql drop database if exists db1;
|
||||||
|
sql create database db1 vgroups 10;
|
||||||
|
sql use db1;
|
||||||
|
sql create stable sta (ts timestamp, f1 double, f2 binary(200)) tags(t1 int);
|
||||||
|
sql create table tba1 using sta tags(1);
|
||||||
|
sql insert into tba1 values ('2022-04-26 15:15:01', 1.0, "a");
|
||||||
|
sql insert into tba1 values ('2022-04-26 15:15:02', 2.0, "b");
|
||||||
|
sql insert into tba1 values ('2022-04-26 15:15:04', 4.0, "b");
|
||||||
|
sql insert into tba1 values ('2022-04-26 15:15:05', 5.0, "b");
|
||||||
|
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:00' and ts <= '2022-04-26 15:15:06' interval(1s) fill(value_f, 8.8);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:00' and ts <= '2022-04-26 15:15:06' interval(1s) fill(value, 8.8);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:00' and ts <= '2022-04-26 15:15:06' interval(1s) fill(null);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:00' and ts <= '2022-04-26 15:15:06' interval(1s) fill(null_f);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:06' and ts <= '2022-04-26 15:15:10' interval(1s) fill(value, 8.8);
|
||||||
|
if $rows != 0 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:06' and ts <= '2022-04-26 15:15:10' interval(1s) fill(value_f, 8.8);
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:06' and ts <= '2022-04-26 15:15:10' interval(1s) fill(null);
|
||||||
|
if $rows != 0 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:06' and ts <= '2022-04-26 15:15:10' interval(1s) fill(null_f);
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:16:00' and ts <= '2022-04-26 19:15:59' interval(1s) fill(value_f, 8.8);
|
||||||
|
if $rows != 14400 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:16:00' and ts <= '2022-04-26 19:15:59' interval(1s) fill(null_f);
|
||||||
|
if $rows != 14400 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:00','2022-04-26 15:15:06') every(1s) fill(value_f, 8.8);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:00','2022-04-26 15:15:06') every(1s) fill(value, 8.8);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:00','2022-04-26 15:15:06') every(1s) fill(null);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:00','2022-04-26 15:15:06') every(1s) fill(null_f);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:06','2022-04-26 15:15:10') every(1s) fill(value, 8.8);
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:06','2022-04-26 15:15:10') every(1s) fill(value_f, 8.8);
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:06','2022-04-26 15:15:10') every(1s) fill(null);
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:06','2022-04-26 15:15:10') every(1s) fill(null_f);
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:16:00','2022-04-26 19:15:59') every(1s) fill(value_f, 8.8);
|
||||||
|
if $rows != 14400 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:16:00','2022-04-26 19:15:59') every(1s) fill(null_f);
|
||||||
|
if $rows != 14400 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -55,62 +55,62 @@ sql create stream stb_asin_stream trigger at_once into output_asin_stb as select
|
||||||
sql create stream ctb_asin_stream trigger at_once into output_asin_ctb as select ts, asin(c1), asin(c2), c3 from scalar_ct1;
|
sql create stream ctb_asin_stream trigger at_once into output_asin_ctb as select ts, asin(c1), asin(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_asin_stream trigger at_once into output_asin_tb as select ts, asin(c1), asin(c2), c3 from scalar_tb;
|
sql create stream tb_asin_stream trigger at_once into output_asin_tb as select ts, asin(c1), asin(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_atan_stream trigger at_once into output_atan_stb as select ts, atan(c1), atan(c2), c3 from scalar_stb partition by tbname;
|
sql create stream stb_atan_stream trigger at_once into output_atan_stb as select ts, atan(c1), atan(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_atan_stream trigger at_once into output_atan_ctb as select ts, atan(c1), atan(c2), c3 from scalar_ct1;
|
# sql create stream ctb_atan_stream trigger at_once into output_atan_ctb as select ts, atan(c1), atan(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_atan_stream trigger at_once into output_atan_tb as select ts, atan(c1), atan(c2), c3 from scalar_tb;
|
# sql create stream tb_atan_stream trigger at_once into output_atan_tb as select ts, atan(c1), atan(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_ceil_stream trigger at_once into output_ceil_stb as select ts, ceil(c1), ceil(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_ceil_stream trigger at_once into output_ceil_stb as select ts, ceil(c1), ceil(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_ceil_stream trigger at_once into output_ceil_ctb as select ts, ceil(c1), ceil(c2), c3 from scalar_ct1;
|
# sql create stream ctb_ceil_stream trigger at_once into output_ceil_ctb as select ts, ceil(c1), ceil(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_ceil_stream trigger at_once into output_ceil_tb as select ts, ceil(c1), ceil(c2), c3 from scalar_tb;
|
# sql create stream tb_ceil_stream trigger at_once into output_ceil_tb as select ts, ceil(c1), ceil(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_cos_stream trigger at_once into output_cos_stb as select ts, cos(c1), cos(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_cos_stream trigger at_once into output_cos_stb as select ts, cos(c1), cos(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_cos_stream trigger at_once into output_cos_ctb as select ts, cos(c1), cos(c2), c3 from scalar_ct1;
|
# sql create stream ctb_cos_stream trigger at_once into output_cos_ctb as select ts, cos(c1), cos(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_cos_stream trigger at_once into output_cos_tb as select ts, cos(c1), cos(c2), c3 from scalar_tb;
|
# sql create stream tb_cos_stream trigger at_once into output_cos_tb as select ts, cos(c1), cos(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_floor_stream trigger at_once into output_floor_stb as select ts, floor(c1), floor(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_floor_stream trigger at_once into output_floor_stb as select ts, floor(c1), floor(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_floor_stream trigger at_once into output_floor_ctb as select ts, floor(c1), floor(c2), c3 from scalar_ct1;
|
# sql create stream ctb_floor_stream trigger at_once into output_floor_ctb as select ts, floor(c1), floor(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_floor_stream trigger at_once into output_floor_tb as select ts, floor(c1), floor(c2), c3 from scalar_tb;
|
# sql create stream tb_floor_stream trigger at_once into output_floor_tb as select ts, floor(c1), floor(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_log_stream trigger at_once into output_log_stb as select ts, log(c1, 2), log(c2, 2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_log_stream trigger at_once into output_log_stb as select ts, log(c1, 2), log(c2, 2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_log_stream trigger at_once into output_log_ctb as select ts, log(c1, 2), log(c2, 2), c3 from scalar_ct1;
|
# sql create stream ctb_log_stream trigger at_once into output_log_ctb as select ts, log(c1, 2), log(c2, 2), c3 from scalar_ct1;
|
||||||
sql create stream tb_log_stream trigger at_once into output_log_tb as select ts, log(c1, 2), log(c2, 2), c3 from scalar_tb;
|
# sql create stream tb_log_stream trigger at_once into output_log_tb as select ts, log(c1, 2), log(c2, 2), c3 from scalar_tb;
|
||||||
sql create stream stb_pow_stream trigger at_once into output_pow_stb as select ts, pow(c1, 2), pow(c2, 2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_pow_stream trigger at_once into output_pow_stb as select ts, pow(c1, 2), pow(c2, 2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_pow_stream trigger at_once into output_pow_ctb as select ts, pow(c1, 2), pow(c2, 2), c3 from scalar_ct1;
|
# sql create stream ctb_pow_stream trigger at_once into output_pow_ctb as select ts, pow(c1, 2), pow(c2, 2), c3 from scalar_ct1;
|
||||||
sql create stream tb_pow_stream trigger at_once into output_pow_tb as select ts, pow(c1, 2), pow(c2, 2), c3 from scalar_tb;
|
# sql create stream tb_pow_stream trigger at_once into output_pow_tb as select ts, pow(c1, 2), pow(c2, 2), c3 from scalar_tb;
|
||||||
sql create stream stb_round_stream trigger at_once into output_round_stb as select ts, round(c1), round(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_round_stream trigger at_once into output_round_stb as select ts, round(c1), round(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_round_stream trigger at_once into output_round_ctb as select ts, round(c1), round(c2), c3 from scalar_ct1;
|
# sql create stream ctb_round_stream trigger at_once into output_round_ctb as select ts, round(c1), round(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_round_stream trigger at_once into output_round_tb as select ts, round(c1), round(c2), c3 from scalar_tb;
|
# sql create stream tb_round_stream trigger at_once into output_round_tb as select ts, round(c1), round(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_sin_stream trigger at_once into output_sin_stb as select ts, sin(c1), sin(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_sin_stream trigger at_once into output_sin_stb as select ts, sin(c1), sin(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_sin_stream trigger at_once into output_sin_ctb as select ts, sin(c1), sin(c2), c3 from scalar_ct1;
|
# sql create stream ctb_sin_stream trigger at_once into output_sin_ctb as select ts, sin(c1), sin(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_sin_stream trigger at_once into output_sin_tb as select ts, sin(c1), sin(c2), c3 from scalar_tb;
|
# sql create stream tb_sin_stream trigger at_once into output_sin_tb as select ts, sin(c1), sin(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_sqrt_stream trigger at_once into output_sqrt_stb as select ts, sqrt(c1), sqrt(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_sqrt_stream trigger at_once into output_sqrt_stb as select ts, sqrt(c1), sqrt(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_sqrt_stream trigger at_once into output_sqrt_ctb as select ts, sqrt(c1), sqrt(c2), c3 from scalar_ct1;
|
# sql create stream ctb_sqrt_stream trigger at_once into output_sqrt_ctb as select ts, sqrt(c1), sqrt(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_sqrt_stream trigger at_once into output_sqrt_tb as select ts, sqrt(c1), sqrt(c2), c3 from scalar_tb;
|
# sql create stream tb_sqrt_stream trigger at_once into output_sqrt_tb as select ts, sqrt(c1), sqrt(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_tan_stream trigger at_once into output_tan_stb as select ts, tan(c1), tan(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_tan_stream trigger at_once into output_tan_stb as select ts, tan(c1), tan(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_tan_stream trigger at_once into output_tan_ctb as select ts, tan(c1), tan(c2), c3 from scalar_ct1;
|
# sql create stream ctb_tan_stream trigger at_once into output_tan_ctb as select ts, tan(c1), tan(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_tan_stream trigger at_once into output_tan_tb as select ts, tan(c1), tan(c2), c3 from scalar_tb;
|
# sql create stream tb_tan_stream trigger at_once into output_tan_tb as select ts, tan(c1), tan(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_char_length_stream into output_char_length_stb as select ts, char_length(c3), char_length(c4), char_length(c5) from scalar_stb partition by tbname;
|
# sql create stream stb_char_length_stream into output_char_length_stb as select ts, char_length(c3), char_length(c4), char_length(c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_char_length_stream into output_char_length_ctb as select ts, char_length(c3), char_length(c4), char_length(c5) from scalar_ct1;
|
# sql create stream ctb_char_length_stream into output_char_length_ctb as select ts, char_length(c3), char_length(c4), char_length(c5) from scalar_ct1;
|
||||||
sql create stream tb_char_length_stream into output_char_length_tb as select ts, char_length(c3), char_length(c4), char_length(c5) from scalar_tb;
|
# sql create stream tb_char_length_stream into output_char_length_tb as select ts, char_length(c3), char_length(c4), char_length(c5) from scalar_tb;
|
||||||
sql create stream stb_concat_stream into output_concat_stb as select ts, concat(c3, c4), concat(c3, c5), concat(c4, c5), concat(c3, c4, c5) from scalar_stb partition by tbname;
|
# sql create stream stb_concat_stream into output_concat_stb as select ts, concat(c3, c4), concat(c3, c5), concat(c4, c5), concat(c3, c4, c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_concat_stream into output_concat_ctb as select ts, concat(c3, c4), concat(c3, c5), concat(c4, c5), concat(c3, c4, c5) from scalar_ct1;
|
# sql create stream ctb_concat_stream into output_concat_ctb as select ts, concat(c3, c4), concat(c3, c5), concat(c4, c5), concat(c3, c4, c5) from scalar_ct1;
|
||||||
sql create stream tb_concat_stream into output_concat_tb as select ts, concat(c3, c4), concat(c3, c5), concat(c4, c5), concat(c3, c4, c5) from scalar_tb;
|
# sql create stream tb_concat_stream into output_concat_tb as select ts, concat(c3, c4), concat(c3, c5), concat(c4, c5), concat(c3, c4, c5) from scalar_tb;
|
||||||
sql create stream stb_concat_ws_stream into output_concat_ws_stb as select ts, concat_ws("aND", c3, c4), concat_ws("and", c3, c5), concat_ws("And", c4, c5), concat_ws("AND", c3, c4, c5) from scalar_stb partition by tbname;
|
# sql create stream stb_concat_ws_stream into output_concat_ws_stb as select ts, concat_ws("aND", c3, c4), concat_ws("and", c3, c5), concat_ws("And", c4, c5), concat_ws("AND", c3, c4, c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_concat_ws_stream into output_concat_ws_ctb as select ts, concat_ws("aND", c3, c4), concat_ws("and", c3, c5), concat_ws("And", c4, c5), concat_ws("AND", c3, c4, c5) from scalar_ct1;
|
# sql create stream ctb_concat_ws_stream into output_concat_ws_ctb as select ts, concat_ws("aND", c3, c4), concat_ws("and", c3, c5), concat_ws("And", c4, c5), concat_ws("AND", c3, c4, c5) from scalar_ct1;
|
||||||
sql create stream tb_concat_ws_stream into output_concat_ws_tb as select ts, concat_ws("aND", c3, c4), concat_ws("and", c3, c5), concat_ws("And", c4, c5), concat_ws("AND", c3, c4, c5) from scalar_tb;
|
# sql create stream tb_concat_ws_stream into output_concat_ws_tb as select ts, concat_ws("aND", c3, c4), concat_ws("and", c3, c5), concat_ws("And", c4, c5), concat_ws("AND", c3, c4, c5) from scalar_tb;
|
||||||
sql create stream stb_length_stream into output_length_stb as select ts, length(c3), length(c4), length(c5) from scalar_stb partition by tbname;
|
# sql create stream stb_length_stream into output_length_stb as select ts, length(c3), length(c4), length(c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_length_stream into output_length_ctb as select ts, length(c3), length(c4), length(c5) from scalar_ct1;
|
# sql create stream ctb_length_stream into output_length_ctb as select ts, length(c3), length(c4), length(c5) from scalar_ct1;
|
||||||
sql create stream tb_length_stream into output_length_tb as select ts, length(c3), length(c4), length(c5) from scalar_tb;
|
# sql create stream tb_length_stream into output_length_tb as select ts, length(c3), length(c4), length(c5) from scalar_tb;
|
||||||
sql create stream stb_lower_stream into output_lower_stb as select ts, lower(c3), lower(c4), lower(c5) from scalar_stb partition by tbname;
|
# sql create stream stb_lower_stream into output_lower_stb as select ts, lower(c3), lower(c4), lower(c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_lower_stream into output_lower_ctb as select ts, lower(c3), lower(c4), lower(c5) from scalar_ct1;
|
# sql create stream ctb_lower_stream into output_lower_ctb as select ts, lower(c3), lower(c4), lower(c5) from scalar_ct1;
|
||||||
sql create stream tb_lower_stream into output_lower_tb as select ts, lower(c3), lower(c4), lower(c5) from scalar_tb;
|
# sql create stream tb_lower_stream into output_lower_tb as select ts, lower(c3), lower(c4), lower(c5) from scalar_tb;
|
||||||
sql create stream stb_ltrim_stream into output_ltrim_stb as select ts, ltrim(c3), ltrim(c4), ltrim(c5) from scalar_stb partition by tbname;
|
# sql create stream stb_ltrim_stream into output_ltrim_stb as select ts, ltrim(c3), ltrim(c4), ltrim(c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_ltrim_stream into output_ltrim_ctb as select ts, ltrim(c3), ltrim(c4), ltrim(c5) from scalar_ct1;
|
# sql create stream ctb_ltrim_stream into output_ltrim_ctb as select ts, ltrim(c3), ltrim(c4), ltrim(c5) from scalar_ct1;
|
||||||
sql create stream tb_ltrim_stream into output_ltrim_tb as select ts, ltrim(c3), ltrim(c4), ltrim(c5) from scalar_tb;
|
# sql create stream tb_ltrim_stream into output_ltrim_tb as select ts, ltrim(c3), ltrim(c4), ltrim(c5) from scalar_tb;
|
||||||
sql create stream stb_rtrim_stream into output_rtrim_stb as select ts, rtrim(c3), rtrim(c4), rtrim(c5) from scalar_stb partition by tbname;
|
# sql create stream stb_rtrim_stream into output_rtrim_stb as select ts, rtrim(c3), rtrim(c4), rtrim(c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_rtrim_stream into output_rtrim_ctb as select ts, rtrim(c3), rtrim(c4), rtrim(c5) from scalar_ct1;
|
# sql create stream ctb_rtrim_stream into output_rtrim_ctb as select ts, rtrim(c3), rtrim(c4), rtrim(c5) from scalar_ct1;
|
||||||
sql create stream tb_rtrim_stream into output_rtrim_tb as select ts, rtrim(c3), rtrim(c4), rtrim(c5) from scalar_tb;
|
# sql create stream tb_rtrim_stream into output_rtrim_tb as select ts, rtrim(c3), rtrim(c4), rtrim(c5) from scalar_tb;
|
||||||
sql create stream stb_substr_stream into output_substr_stb as select ts, substr(c3, 2), substr(c3, 2, 2), substr(c4, 5, 1), substr(c5, 3, 4) from scalar_stb partition by tbname;
|
# sql create stream stb_substr_stream into output_substr_stb as select ts, substr(c3, 2), substr(c3, 2, 2), substr(c4, 5, 1), substr(c5, 3, 4) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_substr_stream into output_substr_ctb as select ts, substr(c3, 2), substr(c3, 2, 2), substr(c4, 5, 1), substr(c5, 3, 4) from scalar_ct1;
|
# sql create stream ctb_substr_stream into output_substr_ctb as select ts, substr(c3, 2), substr(c3, 2, 2), substr(c4, 5, 1), substr(c5, 3, 4) from scalar_ct1;
|
||||||
sql create stream tb_substr_stream into output_substr_tb as select ts, substr(c3, 2), substr(c3, 2, 2), substr(c4, 5, 1), substr(c5, 3, 4) from scalar_tb;
|
# sql create stream tb_substr_stream into output_substr_tb as select ts, substr(c3, 2), substr(c3, 2, 2), substr(c4, 5, 1), substr(c5, 3, 4) from scalar_tb;
|
||||||
sql create stream stb_upper_stream into output_upper_stb as select ts, upper(c3), upper(c4), upper(c5) from scalar_stb partition by tbname;
|
# sql create stream stb_upper_stream into output_upper_stb as select ts, upper(c3), upper(c4), upper(c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_upper_stream into output_upper_ctb as select ts, upper(c3), upper(c4), upper(c5) from scalar_ct1;
|
# sql create stream ctb_upper_stream into output_upper_ctb as select ts, upper(c3), upper(c4), upper(c5) from scalar_ct1;
|
||||||
sql create stream tb_upper_stream into output_upper_tb as select ts, upper(c3), upper(c4), upper(c5) from scalar_tb;
|
# sql create stream tb_upper_stream into output_upper_tb as select ts, upper(c3), upper(c4), upper(c5) from scalar_tb;
|
||||||
sql insert into scalar_ct1 values (1656668180503, 100, 100.1, "beijing", "taos", "Taos");
|
sql insert into scalar_ct1 values (1656668180503, 100, 100.1, "beijing", "taos", "Taos");
|
||||||
sql insert into scalar_ct1 values (1656668180503+1s, -50, -50.1, "tianjin", "taosdata", "Taosdata");
|
sql insert into scalar_ct1 values (1656668180503+1s, -50, -50.1, "tianjin", "taosdata", "Taosdata");
|
||||||
sql insert into scalar_ct1 values (1656668180503+2s, 0, Null, "hebei", "TDengine", Null);
|
sql insert into scalar_ct1 values (1656668180503+2s, 0, Null, "hebei", "TDengine", Null);
|
||||||
|
@ -146,62 +146,62 @@ sql create stream stb_asin_stream trigger at_once into output_asin_stb as select
|
||||||
sql create stream ctb_asin_stream trigger at_once into output_asin_ctb as select ts, asin(c1), asin(c2), c3 from scalar_ct1;
|
sql create stream ctb_asin_stream trigger at_once into output_asin_ctb as select ts, asin(c1), asin(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_asin_stream trigger at_once into output_asin_tb as select ts, asin(c1), asin(c2), c3 from scalar_tb;
|
sql create stream tb_asin_stream trigger at_once into output_asin_tb as select ts, asin(c1), asin(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_atan_stream trigger at_once into output_atan_stb as select ts, atan(c1), atan(c2), c3 from scalar_stb partition by tbname;
|
sql create stream stb_atan_stream trigger at_once into output_atan_stb as select ts, atan(c1), atan(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_atan_stream trigger at_once into output_atan_ctb as select ts, atan(c1), atan(c2), c3 from scalar_ct1;
|
# sql create stream ctb_atan_stream trigger at_once into output_atan_ctb as select ts, atan(c1), atan(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_atan_stream trigger at_once into output_atan_tb as select ts, atan(c1), atan(c2), c3 from scalar_tb;
|
# sql create stream tb_atan_stream trigger at_once into output_atan_tb as select ts, atan(c1), atan(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_ceil_stream trigger at_once into output_ceil_stb as select ts, ceil(c1), ceil(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_ceil_stream trigger at_once into output_ceil_stb as select ts, ceil(c1), ceil(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_ceil_stream trigger at_once into output_ceil_ctb as select ts, ceil(c1), ceil(c2), c3 from scalar_ct1;
|
# sql create stream ctb_ceil_stream trigger at_once into output_ceil_ctb as select ts, ceil(c1), ceil(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_ceil_stream trigger at_once into output_ceil_tb as select ts, ceil(c1), ceil(c2), c3 from scalar_tb;
|
# sql create stream tb_ceil_stream trigger at_once into output_ceil_tb as select ts, ceil(c1), ceil(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_cos_stream trigger at_once into output_cos_stb as select ts, cos(c1), cos(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_cos_stream trigger at_once into output_cos_stb as select ts, cos(c1), cos(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_cos_stream trigger at_once into output_cos_ctb as select ts, cos(c1), cos(c2), c3 from scalar_ct1;
|
# sql create stream ctb_cos_stream trigger at_once into output_cos_ctb as select ts, cos(c1), cos(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_cos_stream trigger at_once into output_cos_tb as select ts, cos(c1), cos(c2), c3 from scalar_tb;
|
# sql create stream tb_cos_stream trigger at_once into output_cos_tb as select ts, cos(c1), cos(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_floor_stream trigger at_once into output_floor_stb as select ts, floor(c1), floor(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_floor_stream trigger at_once into output_floor_stb as select ts, floor(c1), floor(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_floor_stream trigger at_once into output_floor_ctb as select ts, floor(c1), floor(c2), c3 from scalar_ct1;
|
# sql create stream ctb_floor_stream trigger at_once into output_floor_ctb as select ts, floor(c1), floor(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_floor_stream trigger at_once into output_floor_tb as select ts, floor(c1), floor(c2), c3 from scalar_tb;
|
# sql create stream tb_floor_stream trigger at_once into output_floor_tb as select ts, floor(c1), floor(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_log_stream trigger at_once into output_log_stb as select ts, log(c1, 2), log(c2, 2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_log_stream trigger at_once into output_log_stb as select ts, log(c1, 2), log(c2, 2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_log_stream trigger at_once into output_log_ctb as select ts, log(c1, 2), log(c2, 2), c3 from scalar_ct1;
|
# sql create stream ctb_log_stream trigger at_once into output_log_ctb as select ts, log(c1, 2), log(c2, 2), c3 from scalar_ct1;
|
||||||
sql create stream tb_log_stream trigger at_once into output_log_tb as select ts, log(c1, 2), log(c2, 2), c3 from scalar_tb;
|
# sql create stream tb_log_stream trigger at_once into output_log_tb as select ts, log(c1, 2), log(c2, 2), c3 from scalar_tb;
|
||||||
sql create stream stb_pow_stream trigger at_once into output_pow_stb as select ts, pow(c1, 2), pow(c2, 2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_pow_stream trigger at_once into output_pow_stb as select ts, pow(c1, 2), pow(c2, 2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_pow_stream trigger at_once into output_pow_ctb as select ts, pow(c1, 2), pow(c2, 2), c3 from scalar_ct1;
|
# sql create stream ctb_pow_stream trigger at_once into output_pow_ctb as select ts, pow(c1, 2), pow(c2, 2), c3 from scalar_ct1;
|
||||||
sql create stream tb_pow_stream trigger at_once into output_pow_tb as select ts, pow(c1, 2), pow(c2, 2), c3 from scalar_tb;
|
# sql create stream tb_pow_stream trigger at_once into output_pow_tb as select ts, pow(c1, 2), pow(c2, 2), c3 from scalar_tb;
|
||||||
sql create stream stb_round_stream trigger at_once into output_round_stb as select ts, round(c1), round(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_round_stream trigger at_once into output_round_stb as select ts, round(c1), round(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_round_stream trigger at_once into output_round_ctb as select ts, round(c1), round(c2), c3 from scalar_ct1;
|
# sql create stream ctb_round_stream trigger at_once into output_round_ctb as select ts, round(c1), round(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_round_stream trigger at_once into output_round_tb as select ts, round(c1), round(c2), c3 from scalar_tb;
|
# sql create stream tb_round_stream trigger at_once into output_round_tb as select ts, round(c1), round(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_sin_stream trigger at_once into output_sin_stb as select ts, sin(c1), sin(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_sin_stream trigger at_once into output_sin_stb as select ts, sin(c1), sin(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_sin_stream trigger at_once into output_sin_ctb as select ts, sin(c1), sin(c2), c3 from scalar_ct1;
|
# sql create stream ctb_sin_stream trigger at_once into output_sin_ctb as select ts, sin(c1), sin(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_sin_stream trigger at_once into output_sin_tb as select ts, sin(c1), sin(c2), c3 from scalar_tb;
|
# sql create stream tb_sin_stream trigger at_once into output_sin_tb as select ts, sin(c1), sin(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_sqrt_stream trigger at_once into output_sqrt_stb as select ts, sqrt(c1), sqrt(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_sqrt_stream trigger at_once into output_sqrt_stb as select ts, sqrt(c1), sqrt(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_sqrt_stream trigger at_once into output_sqrt_ctb as select ts, sqrt(c1), sqrt(c2), c3 from scalar_ct1;
|
# sql create stream ctb_sqrt_stream trigger at_once into output_sqrt_ctb as select ts, sqrt(c1), sqrt(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_sqrt_stream trigger at_once into output_sqrt_tb as select ts, sqrt(c1), sqrt(c2), c3 from scalar_tb;
|
# sql create stream tb_sqrt_stream trigger at_once into output_sqrt_tb as select ts, sqrt(c1), sqrt(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_tan_stream trigger at_once into output_tan_stb as select ts, tan(c1), tan(c2), c3 from scalar_stb partition by tbname;
|
# sql create stream stb_tan_stream trigger at_once into output_tan_stb as select ts, tan(c1), tan(c2), c3 from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_tan_stream trigger at_once into output_tan_ctb as select ts, tan(c1), tan(c2), c3 from scalar_ct1;
|
# sql create stream ctb_tan_stream trigger at_once into output_tan_ctb as select ts, tan(c1), tan(c2), c3 from scalar_ct1;
|
||||||
sql create stream tb_tan_stream trigger at_once into output_tan_tb as select ts, tan(c1), tan(c2), c3 from scalar_tb;
|
# sql create stream tb_tan_stream trigger at_once into output_tan_tb as select ts, tan(c1), tan(c2), c3 from scalar_tb;
|
||||||
sql create stream stb_char_length_stream into output_char_length_stb as select ts, char_length(c3), char_length(c4), char_length(c5) from scalar_stb partition by tbname;
|
# sql create stream stb_char_length_stream into output_char_length_stb as select ts, char_length(c3), char_length(c4), char_length(c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_char_length_stream into output_char_length_ctb as select ts, char_length(c3), char_length(c4), char_length(c5) from scalar_ct1;
|
# sql create stream ctb_char_length_stream into output_char_length_ctb as select ts, char_length(c3), char_length(c4), char_length(c5) from scalar_ct1;
|
||||||
sql create stream tb_char_length_stream into output_char_length_tb as select ts, char_length(c3), char_length(c4), char_length(c5) from scalar_tb;
|
# sql create stream tb_char_length_stream into output_char_length_tb as select ts, char_length(c3), char_length(c4), char_length(c5) from scalar_tb;
|
||||||
sql create stream stb_concat_stream into output_concat_stb as select ts, concat(c3, c4), concat(c3, c5), concat(c4, c5), concat(c3, c4, c5) from scalar_stb partition by tbname;
|
# sql create stream stb_concat_stream into output_concat_stb as select ts, concat(c3, c4), concat(c3, c5), concat(c4, c5), concat(c3, c4, c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_concat_stream into output_concat_ctb as select ts, concat(c3, c4), concat(c3, c5), concat(c4, c5), concat(c3, c4, c5) from scalar_ct1;
|
# sql create stream ctb_concat_stream into output_concat_ctb as select ts, concat(c3, c4), concat(c3, c5), concat(c4, c5), concat(c3, c4, c5) from scalar_ct1;
|
||||||
sql create stream tb_concat_stream into output_concat_tb as select ts, concat(c3, c4), concat(c3, c5), concat(c4, c5), concat(c3, c4, c5) from scalar_tb;
|
# sql create stream tb_concat_stream into output_concat_tb as select ts, concat(c3, c4), concat(c3, c5), concat(c4, c5), concat(c3, c4, c5) from scalar_tb;
|
||||||
sql create stream stb_concat_ws_stream into output_concat_ws_stb as select ts, concat_ws("aND", c3, c4), concat_ws("and", c3, c5), concat_ws("And", c4, c5), concat_ws("AND", c3, c4, c5) from scalar_stb partition by tbname;
|
# sql create stream stb_concat_ws_stream into output_concat_ws_stb as select ts, concat_ws("aND", c3, c4), concat_ws("and", c3, c5), concat_ws("And", c4, c5), concat_ws("AND", c3, c4, c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_concat_ws_stream into output_concat_ws_ctb as select ts, concat_ws("aND", c3, c4), concat_ws("and", c3, c5), concat_ws("And", c4, c5), concat_ws("AND", c3, c4, c5) from scalar_ct1;
|
# sql create stream ctb_concat_ws_stream into output_concat_ws_ctb as select ts, concat_ws("aND", c3, c4), concat_ws("and", c3, c5), concat_ws("And", c4, c5), concat_ws("AND", c3, c4, c5) from scalar_ct1;
|
||||||
sql create stream tb_concat_ws_stream into output_concat_ws_tb as select ts, concat_ws("aND", c3, c4), concat_ws("and", c3, c5), concat_ws("And", c4, c5), concat_ws("AND", c3, c4, c5) from scalar_tb;
|
# sql create stream tb_concat_ws_stream into output_concat_ws_tb as select ts, concat_ws("aND", c3, c4), concat_ws("and", c3, c5), concat_ws("And", c4, c5), concat_ws("AND", c3, c4, c5) from scalar_tb;
|
||||||
sql create stream stb_length_stream into output_length_stb as select ts, length(c3), length(c4), length(c5) from scalar_stb partition by tbname;
|
# sql create stream stb_length_stream into output_length_stb as select ts, length(c3), length(c4), length(c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_length_stream into output_length_ctb as select ts, length(c3), length(c4), length(c5) from scalar_ct1;
|
# sql create stream ctb_length_stream into output_length_ctb as select ts, length(c3), length(c4), length(c5) from scalar_ct1;
|
||||||
sql create stream tb_length_stream into output_length_tb as select ts, length(c3), length(c4), length(c5) from scalar_tb;
|
# sql create stream tb_length_stream into output_length_tb as select ts, length(c3), length(c4), length(c5) from scalar_tb;
|
||||||
sql create stream stb_lower_stream into output_lower_stb as select ts, lower(c3), lower(c4), lower(c5) from scalar_stb partition by tbname;
|
# sql create stream stb_lower_stream into output_lower_stb as select ts, lower(c3), lower(c4), lower(c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_lower_stream into output_lower_ctb as select ts, lower(c3), lower(c4), lower(c5) from scalar_ct1;
|
# sql create stream ctb_lower_stream into output_lower_ctb as select ts, lower(c3), lower(c4), lower(c5) from scalar_ct1;
|
||||||
sql create stream tb_lower_stream into output_lower_tb as select ts, lower(c3), lower(c4), lower(c5) from scalar_tb;
|
# sql create stream tb_lower_stream into output_lower_tb as select ts, lower(c3), lower(c4), lower(c5) from scalar_tb;
|
||||||
sql create stream stb_ltrim_stream into output_ltrim_stb as select ts, ltrim(c3), ltrim(c4), ltrim(c5) from scalar_stb partition by tbname;
|
# sql create stream stb_ltrim_stream into output_ltrim_stb as select ts, ltrim(c3), ltrim(c4), ltrim(c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_ltrim_stream into output_ltrim_ctb as select ts, ltrim(c3), ltrim(c4), ltrim(c5) from scalar_ct1;
|
# sql create stream ctb_ltrim_stream into output_ltrim_ctb as select ts, ltrim(c3), ltrim(c4), ltrim(c5) from scalar_ct1;
|
||||||
sql create stream tb_ltrim_stream into output_ltrim_tb as select ts, ltrim(c3), ltrim(c4), ltrim(c5) from scalar_tb;
|
# sql create stream tb_ltrim_stream into output_ltrim_tb as select ts, ltrim(c3), ltrim(c4), ltrim(c5) from scalar_tb;
|
||||||
sql create stream stb_rtrim_stream into output_rtrim_stb as select ts, rtrim(c3), rtrim(c4), rtrim(c5) from scalar_stb partition by tbname;
|
# sql create stream stb_rtrim_stream into output_rtrim_stb as select ts, rtrim(c3), rtrim(c4), rtrim(c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_rtrim_stream into output_rtrim_ctb as select ts, rtrim(c3), rtrim(c4), rtrim(c5) from scalar_ct1;
|
# sql create stream ctb_rtrim_stream into output_rtrim_ctb as select ts, rtrim(c3), rtrim(c4), rtrim(c5) from scalar_ct1;
|
||||||
sql create stream tb_rtrim_stream into output_rtrim_tb as select ts, rtrim(c3), rtrim(c4), rtrim(c5) from scalar_tb;
|
# sql create stream tb_rtrim_stream into output_rtrim_tb as select ts, rtrim(c3), rtrim(c4), rtrim(c5) from scalar_tb;
|
||||||
sql create stream stb_substr_stream into output_substr_stb as select ts, substr(c3, 2), substr(c3, 2, 2), substr(c4, 5, 1), substr(c5, 3, 4) from scalar_stb partition by tbname;
|
# sql create stream stb_substr_stream into output_substr_stb as select ts, substr(c3, 2), substr(c3, 2, 2), substr(c4, 5, 1), substr(c5, 3, 4) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_substr_stream into output_substr_ctb as select ts, substr(c3, 2), substr(c3, 2, 2), substr(c4, 5, 1), substr(c5, 3, 4) from scalar_ct1;
|
# sql create stream ctb_substr_stream into output_substr_ctb as select ts, substr(c3, 2), substr(c3, 2, 2), substr(c4, 5, 1), substr(c5, 3, 4) from scalar_ct1;
|
||||||
sql create stream tb_substr_stream into output_substr_tb as select ts, substr(c3, 2), substr(c3, 2, 2), substr(c4, 5, 1), substr(c5, 3, 4) from scalar_tb;
|
# sql create stream tb_substr_stream into output_substr_tb as select ts, substr(c3, 2), substr(c3, 2, 2), substr(c4, 5, 1), substr(c5, 3, 4) from scalar_tb;
|
||||||
sql create stream stb_upper_stream into output_upper_stb as select ts, upper(c3), upper(c4), upper(c5) from scalar_stb partition by tbname;
|
# sql create stream stb_upper_stream into output_upper_stb as select ts, upper(c3), upper(c4), upper(c5) from scalar_stb partition by tbname;
|
||||||
sql create stream ctb_upper_stream into output_upper_ctb as select ts, upper(c3), upper(c4), upper(c5) from scalar_ct1;
|
# sql create stream ctb_upper_stream into output_upper_ctb as select ts, upper(c3), upper(c4), upper(c5) from scalar_ct1;
|
||||||
sql create stream tb_upper_stream into output_upper_tb as select ts, upper(c3), upper(c4), upper(c5) from scalar_tb;
|
# sql create stream tb_upper_stream into output_upper_tb as select ts, upper(c3), upper(c4), upper(c5) from scalar_tb;
|
||||||
sql insert into scalar_ct1 values (1656668180503, 100, 100.1, "beijing", "taos", "Taos");
|
sql insert into scalar_ct1 values (1656668180503, 100, 100.1, "beijing", "taos", "Taos");
|
||||||
sql insert into scalar_ct1 values (1656668180503+1s, -50, -50.1, "tianjin", "taosdata", "Taosdata");
|
sql insert into scalar_ct1 values (1656668180503+1s, -50, -50.1, "tianjin", "taosdata", "Taosdata");
|
||||||
sql insert into scalar_ct1 values (1656668180503+2s, 0, Null, "hebei", "TDengine", Null);
|
sql insert into scalar_ct1 values (1656668180503+2s, 0, Null, "hebei", "TDengine", Null);
|
||||||
|
|
|
@ -14,6 +14,7 @@ sql use test;
|
||||||
|
|
||||||
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));;
|
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));;
|
||||||
sql create stream streams1 trigger at_once into streamt as select _wstart ts, count(*) c1 from t1 where ts > 1648791210000 and ts < 1648791413000 interval(10s) fill(value, 100);
|
sql create stream streams1 trigger at_once into streamt as select _wstart ts, count(*) c1 from t1 where ts > 1648791210000 and ts < 1648791413000 interval(10s) fill(value, 100);
|
||||||
|
sql create stream streams1a trigger at_once into streamta as select _wstart ts, count(*) c1 from t1 where ts > 1648791210000 and ts < 1648791413000 interval(10s) fill(value_f, 100);
|
||||||
sql insert into t1 values(1648791213000,1,2,3,1.0,'aaa');
|
sql insert into t1 values(1648791213000,1,2,3,1.0,'aaa');
|
||||||
sleep 100
|
sleep 100
|
||||||
sql insert into t1 values(1648791233000,1,2,3,1.0,'aaa');
|
sql insert into t1 values(1648791233000,1,2,3,1.0,'aaa');
|
||||||
|
@ -77,6 +78,69 @@ if $data71 != 1 then
|
||||||
goto loop0
|
goto loop0
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
print "force fill vaule"
|
||||||
|
|
||||||
|
$loop_count = 0
|
||||||
|
|
||||||
|
loop0a:
|
||||||
|
sleep 200
|
||||||
|
sql select * from streamta order by ts;
|
||||||
|
|
||||||
|
$loop_count = $loop_count + 1
|
||||||
|
if $loop_count == 10 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $rows != 8 then
|
||||||
|
print =====rows=$rows
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data01 != 1 then
|
||||||
|
print =====data01=$data01
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data11 != 1 then
|
||||||
|
print =====data11=$data11
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data21 != 1 then
|
||||||
|
print =====data21=$data21
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data31 != 100 then
|
||||||
|
print =====data31=$data31
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data41 != 1 then
|
||||||
|
print =====data41=$data41
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data51 != 100 then
|
||||||
|
print =====data01=$data01
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data61 != 100 then
|
||||||
|
print =====data61=$data61
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data71 != 1 then
|
||||||
|
print =====data71=$data71
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sql drop stream if exists streams2;
|
sql drop stream if exists streams2;
|
||||||
sql drop database if exists test2;
|
sql drop database if exists test2;
|
||||||
sql create database test2 vgroups 1;
|
sql create database test2 vgroups 1;
|
||||||
|
@ -408,6 +472,7 @@ sql create table t1 using st tags(1,1,1);
|
||||||
sql create table t2 using st tags(2,2,2);
|
sql create table t2 using st tags(2,2,2);
|
||||||
|
|
||||||
sql create stream streams4 trigger at_once into streamt4 as select _wstart ts, count(*) c1, concat(tbname, 'aaa') as pname, timezone() from st where ts > 1648791000000 and ts < 1648793000000 partition by tbname interval(10s) fill(NULL);
|
sql create stream streams4 trigger at_once into streamt4 as select _wstart ts, count(*) c1, concat(tbname, 'aaa') as pname, timezone() from st where ts > 1648791000000 and ts < 1648793000000 partition by tbname interval(10s) fill(NULL);
|
||||||
|
sql create stream streams4a trigger at_once into streamt4a as select _wstart ts, count(*) c1, concat(tbname, 'aaa') as pname, timezone() from st where ts > 1648791000000 and ts < 1648793000000 partition by tbname interval(10s) fill(NULL_F);
|
||||||
sql insert into t1 values(1648791213000,1,2,3,1.0,'aaa');
|
sql insert into t1 values(1648791213000,1,2,3,1.0,'aaa');
|
||||||
sql insert into t1 values(1648791233000,1,2,3,1.0,'aaa');
|
sql insert into t1 values(1648791233000,1,2,3,1.0,'aaa');
|
||||||
sql insert into t1 values(1648791273000,1,2,3,1.0,'aaa');
|
sql insert into t1 values(1648791273000,1,2,3,1.0,'aaa');
|
||||||
|
@ -512,32 +577,104 @@ if $data[12][3] == NULL then
|
||||||
goto loop4
|
goto loop4
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
print "force fill null"
|
||||||
|
|
||||||
|
|
||||||
|
$loop_count = 0
|
||||||
|
|
||||||
|
loop4a:
|
||||||
|
sleep 200
|
||||||
|
sql select * from streamt4a order by pname, ts;
|
||||||
|
|
||||||
|
print ===> $data[0][0] , $data[0][1] , $data[0][2] , $data[0][3]
|
||||||
|
print ===> $data[1][0] , $data[1][1] , $data[1][2] , $data[1][3]
|
||||||
|
print ===> $data[2][0] , $data[2][1] , $data[2][2] , $data[2][3]
|
||||||
|
print ===> $data[3][0] , $data[3][1] , $data[3][2] , $data[3][3]
|
||||||
|
print ===> $data[4][0] , $data[4][1] , $data[4][2] , $data[4][3]
|
||||||
|
print ===> $data[5][0] , $data[5][1] , $data[5][2] , $data[5][3]
|
||||||
|
print ===> $data[6][0] , $data[6][1] , $data[6][2] , $data[6][3]
|
||||||
|
print ===> $data[7][0] , $data[7][1] , $data[7][2] , $data[7][3]
|
||||||
|
print ===> $data[8][0] , $data[8][1] , $data[8][2] , $data[8][3]
|
||||||
|
print ===> $data[9][0] , $data[9][1] , $data[9][2] , $data[9][3]
|
||||||
|
print ===> $data[10][0] , $data[10][1] , $data[10][2] , $data[10][3]
|
||||||
|
print ===> $data[11][0] , $data[11][1] , $data[11][2] , $data[11][3]
|
||||||
|
print ===> $data[12][0] , $data[12][1] , $data[12][2] , $data[12][3]
|
||||||
|
print ===> $data[13][0] , $data[13][1] , $data[13][2] , $data[13][3]
|
||||||
|
|
||||||
|
$loop_count = $loop_count + 1
|
||||||
|
if $loop_count == 10 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $rows != 14 then
|
||||||
|
print =====rows=$rows
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data11 != NULL then
|
||||||
|
print =====data11=$data11
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data12 != t1aaa then
|
||||||
|
print =====data12=$data12
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data13 == NULL then
|
||||||
|
print =====data13=$data13
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data32 != t1aaa then
|
||||||
|
print =====data32=$data32
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data42 != t1aaa then
|
||||||
|
print =====data42=$data42
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data52 != t1aaa then
|
||||||
|
print =====data52=$data52
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data81 != NULL then
|
||||||
|
print =====data81=$data81
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data82 != t2aaa then
|
||||||
|
print =====data82=$data82
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data83 == NULL then
|
||||||
|
print =====data83=$data83
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data[10][2] != t2aaa then
|
||||||
|
print =====data[10][2]=$data[10][2]
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data[11][2] != t2aaa then
|
||||||
|
print =====data[11][2]=$data[11][2]
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data[12][2] != t2aaa then
|
||||||
|
print =====data[12][2]=$data[12][2]
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data[12][3] == NULL then
|
||||||
|
print =====data[12][3]=$data[12][3]
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue