提交 4b2a9605 编写于 作者: D dapan1121

add interp test case

上级 406e9a56
......@@ -83,6 +83,11 @@ typedef struct SJoinSupporter {
int32_t totalLen;
int32_t num;
SArray* pVgroupTables;
int16_t fillType; // final result fill type
int64_t * fillVal; // default value for fill
int32_t numOfFillVal; // fill value size
} SJoinSupporter;
......
......@@ -3217,6 +3217,7 @@ static int16_t doGetColumnIndex(SQueryInfo* pQueryInfo, int32_t index, SStrToken
char tmpTokenBuf[TSDB_MAX_BYTES_PER_ROW] = {0}; // create tmp buf to avoid alter orginal sqlstr
strncpy(tmpTokenBuf, pToken->z, pToken->n);
pToken->z = tmpTokenBuf;
if (pToken->type == TK_ID) {
......@@ -5641,14 +5642,14 @@ int32_t validateFillNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSqlNo
const char* msg3 = "top/bottom/sample not support fill";
const char* msg4 = "illegal value or data overflow";
const char* msg5 = "fill only available for interval query";
const char* msg6 = "not supported function now";
const char* msg7 = "join query not supported fill operation";
bool pointInterp = tscIsPointInterpQuery(pQueryInfo);
if ((!isTimeWindowQuery(pQueryInfo)) && (!pointInterp)) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg5);
}
if(QUERY_IS_JOIN_QUERY(pQueryInfo->type)) {
if (QUERY_IS_JOIN_QUERY(pQueryInfo->type) && (!pointInterp)) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg7);
}
......@@ -7510,6 +7511,10 @@ int32_t doFunctionsCompatibleCheck(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, char*
int32_t validateFunctionFromUpstream(SQueryInfo* pQueryInfo, char* msg) {
const char* msg1 = "TWA/Diff/Derivative/Irate are not allowed to apply to super table without group by tbname";
const char* msg2 = "group by not supported in nested interp query";
const char* msg3 = "order by not supported in nested interp query";
const char* msg4 = "first column should be timestamp for interp query";
const char* msg5 = "interp input may be invalid";
int32_t numOfExprs = (int32_t)tscNumOfExprs(pQueryInfo);
size_t upNum = taosArrayGetSize(pQueryInfo->pUpstream);
......@@ -7529,6 +7534,50 @@ int32_t validateFunctionFromUpstream(SQueryInfo* pQueryInfo, char* msg) {
}
return invalidOperationMsg(msg, msg1);
} else if (f == TSDB_FUNC_INTERP) {
if (pQueryInfo->groupbyExpr.columnInfo) {
return invalidOperationMsg(msg, msg2);
}
if (pQueryInfo->order.order == TSDB_ORDER_DESC || (pQueryInfo->order.orderColId != INT32_MIN && pQueryInfo->order.orderColId != PRIMARYKEY_TIMESTAMP_COL_INDEX)) {
return invalidOperationMsg(msg, msg3);
}
for (int32_t j = 0; j < upNum; ++j) {
SQueryInfo* pUp = taosArrayGetP(pQueryInfo->pUpstream, j);
if (pUp->groupbyExpr.columnInfo) {
return invalidOperationMsg(msg, msg2);
}
if (pUp->order.order == TSDB_ORDER_DESC || (pUp->order.orderColId != INT32_MIN && pUp->order.orderColId != PRIMARYKEY_TIMESTAMP_COL_INDEX)) {
return invalidOperationMsg(msg, msg3);
}
int32_t exprNum = (int32_t)taosArrayGetSize(pUp->exprList);
if (exprNum > 0) {
SSqlExpr* expr = taosArrayGetP(pUp->exprList, 0);
if (expr->resType != TSDB_DATA_TYPE_TIMESTAMP) {
return invalidOperationMsg(msg, msg4);
}
STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pUp, 0);
bool isSTable = UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo);
if (!isSTable) {
continue;
}
for (int32_t n = 0; n < exprNum; ++n) {
expr = taosArrayGetP(pUp->exprList, n);
if (expr->functionId == TSDB_FUNC_TOP ||
expr->functionId == TSDB_FUNC_BOTTOM ||
expr->functionId == TSDB_FUNC_SAMPLE) {
if (expr->param[0].i64 > 1) {
return invalidOperationMsg(msg, msg5);
}
}
}
}
}
}
}
......@@ -9057,7 +9106,7 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
for (int32_t i = 0; i < tscNumOfExprs(pQueryInfo); ++i) {
SExprInfo* pExpr = tscExprGet(pQueryInfo, i);
int32_t f = pExpr->base.functionId;
if (f == TSDB_FUNC_STDDEV || f == TSDB_FUNC_PERCT || f == TSDB_FUNC_INTERP) {
if (f == TSDB_FUNC_STDDEV || f == TSDB_FUNC_PERCT) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6);
}
......
......@@ -394,6 +394,12 @@ SJoinSupporter* tscCreateJoinSupporter(SSqlObj* pSql, int32_t index) {
memcpy(&pSupporter->interval, &pQueryInfo->interval, sizeof(pSupporter->interval));
pSupporter->limit = pQueryInfo->limit;
if (tscIsPointInterpQuery(pQueryInfo)) {
pSupporter->fillType = pQueryInfo->fillType;
pSupporter->fillVal = pQueryInfo->fillVal;
pSupporter->numOfFillVal = pQueryInfo->numOfFillVal;
}
STableMetaInfo* pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, index);
pSupporter->uid = pTableMetaInfo->pTableMeta->id.uid;
assert (pSupporter->uid != 0);
......@@ -579,6 +585,13 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
pQueryInfo->fieldsInfo = pSupporter->fieldsInfo;
pQueryInfo->groupbyExpr = pSupporter->groupInfo;
pQueryInfo->pUpstream = taosArrayInit(4, sizeof(POINTER_BYTES));
if (tscIsPointInterpQuery(pQueryInfo)) {
pQueryInfo->fillType = pSupporter->fillType;
pQueryInfo->numOfFillVal = pSupporter->numOfFillVal;
pQueryInfo->fillVal = malloc(pQueryInfo->numOfFillVal * sizeof(*pSupporter->fillVal));
memcpy(pQueryInfo->fillVal, pSupporter->fillVal, sizeof(*pSupporter->fillVal) * pQueryInfo->numOfFillVal);
}
assert(pNew->subState.numOfSub == 0 && pQueryInfo->numOfTables == 1);
......
......@@ -5347,4 +5347,3 @@ char* cloneCurrentDBName(SSqlObj* pSql) {
return p;
}
......@@ -94,6 +94,8 @@ typedef struct SSessionWindow {
} SSessionWindow;
int64_t taosTimeAdd(int64_t t, int64_t duration, char unit, int32_t precision);
int64_t taosTimeSub(int64_t t, int64_t duration, char unit, int32_t precision);
int64_t taosTimeTruncate(int64_t t, const SInterval* pInterval, int32_t precision);
int32_t taosTimeCountInterval(int64_t skey, int64_t ekey, int64_t interval, char unit, int32_t precision);
......
......@@ -533,6 +533,27 @@ int64_t taosTimeAdd(int64_t t, int64_t duration, char unit, int32_t precision) {
return (int64_t)(mktime(&tm) * TSDB_TICK_PER_SECOND(precision));
}
int64_t taosTimeSub(int64_t t, int64_t duration, char unit, int32_t precision) {
if (duration == 0) {
return t;
}
if (unit == 'y') {
duration *= 12;
} else if (unit != 'n') {
return t - duration;
}
struct tm tm;
time_t tt = (time_t)(t / TSDB_TICK_PER_SECOND(precision));
localtime_r(&tt, &tm);
int mon = tm.tm_year * 12 + tm.tm_mon - (int)duration;
tm.tm_year = mon / 12;
tm.tm_mon = mon % 12;
return (int64_t)(mktime(&tm) * TSDB_TICK_PER_SECOND(precision));
}
int32_t taosTimeCountInterval(int64_t skey, int64_t ekey, int64_t interval, char unit, int32_t precision) {
if (ekey < skey) {
int64_t tmp = ekey;
......
......@@ -43,6 +43,8 @@ typedef int32_t (*__block_search_fn_t)(char* data, int32_t num, int64_t key, int
#define GET_NUM_OF_RESULTS(_r) (((_r)->outputBuf) == NULL? 0:((_r)->outputBuf)->info.rows)
#define RESET_NUM_OF_RESULTS(_r) (((_r)->outputBuf) == NULL? 0:(((_r)->outputBuf)->info.rows = 0))
#define NEEDTO_COMPRESS_QUERY(size) ((size) > tsCompressColData? 1 : 0)
enum {
......@@ -400,6 +402,7 @@ typedef struct SQInfo {
int32_t dataReady; // denote if query result is ready or not
void* rspContext; // response context
int64_t startExecTs; // start to exec timestamp
int64_t lastRetrieveTs; // last retrieve timestamp
char* sql; // query sql string
SQueryCostInfo summary;
} SQInfo;
......@@ -483,18 +486,20 @@ typedef struct SProjectOperatorInfo {
SSDataBlock *existDataBlock;
} SProjectOperatorInfo;
typedef struct STableEveryOperatorInfo {
typedef struct STimeEveryOperatorInfo {
SOptrBasicInfo binfo;
int32_t bufCapacity;
uint32_t seed;
int64_t tableEndKey;
SSDataBlock *lastBlock;
SHashObj *rangeStart;
int32_t lastGroupIdx;
bool groupDone;
bool allDone;
SSDataBlock *existDataBlock;
} STableEveryOperatorInfo;
} STimeEveryOperatorInfo;
typedef struct SLimitOperatorInfo {
int64_t limit;
......
此差异已折叠。
......@@ -538,9 +538,9 @@ SArray* createTableScanPlan(SQueryAttr* pQueryAttr) {
} else {
if (pQueryAttr->queryBlockDist) {
op = OP_TableBlockInfoScan;
} else if (pQueryAttr->tsCompQuery || pQueryAttr->pointInterpQuery || pQueryAttr->diffQuery) {
} else if (pQueryAttr->tsCompQuery || pQueryAttr->diffQuery) {
op = OP_TableSeqScan;
} else if (pQueryAttr->needReverseScan) {
} else if (pQueryAttr->needReverseScan || pQueryAttr->pointInterpQuery) {
op = OP_DataBlocksOptScan;
} else {
op = OP_TableScan;
......
......@@ -272,8 +272,10 @@ bool qTableQuery(qinfo_t qinfo, uint64_t *qId) {
}
*qId = pQInfo->qId;
if(pQInfo->startExecTs == 0)
if(pQInfo->startExecTs == 0) {
pQInfo->startExecTs = taosGetTimestampMs();
pQInfo->lastRetrieveTs = pQInfo->startExecTs;
}
if (isQueryKilled(pQInfo)) {
qDebug("QInfo:0x%"PRIx64" it is already killed, abort", pQInfo->qId);
......@@ -412,6 +414,9 @@ int32_t qDumpRetrieveResult(qinfo_t qinfo, SRetrieveTableRsp **pRsp, int32_t *co
setQueryStatus(pRuntimeEnv, QUERY_OVER);
}
RESET_NUM_OF_RESULTS(&(pQInfo->runtimeEnv));
pQInfo->lastRetrieveTs = taosGetTimestampMs();
if ((*pRsp)->compressed && compLen != 0) {
int32_t numOfCols = pQueryAttr->pExpr2 ? pQueryAttr->numOfExpr2 : pQueryAttr->numOfOutput;
int32_t origSize = pQueryAttr->resultRowSize * s;
......
......@@ -130,7 +130,7 @@ run general/parser/limit2.sim
run general/parser/slimit.sim
run general/parser/fill.sim
run general/parser/fill_stb.sim
run general/parser/interp.sim
run general/parser/interp_full.sim
run general/parser/where.sim
run general/parser/join.sim
run general/parser/join_multivnode.sim
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
$dbPrefix = intp_db
$tbPrefix = intp_tb
$stbPrefix = intp_stb
$tbNum = 4
$rowNum = 10000
$totalNum = $tbNum * $rowNum
$ts0 = 1537146000000
$delta = 600000
print ========== interp.sim
$i = 0
$db = $dbPrefix . $i
$stb = $stbPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
print ====== create tables
sql use $db
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int)
$i = 0
$ts = $ts0
$halfNum = $tbNum / 2
while $i < $halfNum
$tbId = $i + $halfNum
$tb = $tbPrefix . $i
$tb1 = $tbPrefix . $tbId
sql create table $tb using $stb tags( $i )
sql create table $tb1 using $stb tags( $tbId )
$x = 0
while $x < $rowNum
$xs = $x * $delta
$ts = $ts0 + $xs
$c = $x / 10
$c = $c * 10
$c = $x - $c
$binary = 'binary . $c
$binary = $binary . '
$nchar = 'nchar . $c
$nchar = $nchar . '
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar ) $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
$x = $x + 1
endw
$i = $i + 1
endw
print ====== tables created
sql create table ap1 (ts timestamp, pav float);
sql INSERT INTO ap1 VALUES ('2021-07-25 02:19:54.100',1) ('2021-07-25 02:19:54.200',2) ('2021-07-25 02:19:54.300',3) ('2021-07-25 02:19:56.500',4) ('2021-07-25 02:19:57.500',5) ('2021-07-25 02:19:57.600',6) ('2021-07-25 02:19:57.900',7) ('2021-07-25 02:19:58.100',8) ('2021-07-25 02:19:58.300',9) ('2021-07-25 02:19:59.100',10) ('2021-07-25 02:19:59.300',11) ('2021-07-25 02:19:59.500',12) ('2021-07-25 02:19:59.700',13) ('2021-07-25 02:19:59.900',14) ('2021-07-25 02:20:05.000', 20) ('2021-07-25 02:25:00.000', 10000);
run general/parser/interp_test.sim
print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 500
system sh/exec.sh -n dnode1 -s start
print ================== server restart completed
run general/parser/interp_test.sim
print ================= TD-5931
sql create stable st5931(ts timestamp, f int) tags(t int)
sql create table ct5931 using st5931 tags(1)
sql create table nt5931(ts timestamp, f int)
sql select interp(*) from nt5931 where ts=now
sql select interp(*) from st5931 where ts=now
sql select interp(*) from ct5931 where ts=now
if $rows != 0 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -136,6 +136,8 @@ sql insert into tb4_0 values ('2021-10-20 10:04:55',55,55.0,55,55,55,55.0,false,
run general/parser/interp_full_test1.sim
run general/parser/interp_full_test2.sim
run general/parser/interp_full_test3.sim
run general/parser/interp_full_test4.sim
#print ================== restart server to commit data into disk
#system sh/exec.sh -n dnode1 -s stop -x SIGINT
......
......@@ -26,6 +26,16 @@ sql_error SELECT avg(c1) FROM tb1 every(1s);
sql_error SELECT avg(c1) FROM tb1 range(0,1);
sql_error SELECT INTERP(c1) FROM tb1 STATE_WINDOW(c1);
sql_error SELECT INTERP(c1) FROM tb1 SESSION(ts,100s);
sql_error SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:11','2021-10-20 10:00:10');
sql_error SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:11','2021-10-20 10:00:10') ORDER BY ts DESC;
sql_error SELECT INTERP(ts) FROM tb1;
sql_error select interp(c1) from tb1 EVERY(1s) sliding(1s);
sql_error select interp(c1) from (select ts,c1 from tb1 order by ts desc);
sql_error select interp(a) from (select top(c1,3) as a from stb1 group by tbname);
sql_error select interp(c1) from (select c1 from tb1 order by ts);
sql_error select interp(c1) from (select c1,ts from tb1 order by ts);
sql_error select interp(a) from (select top(c1,3) as a from stb1 order by ts);
sql_error select interp(a) from (select top(c1,3) as a from tb1 order by ts desc);
sql SELECT INTERP(c1) FROM tb1;
if $rows != 1 then
......
......@@ -1082,7 +1082,7 @@ if $data51 != 15 then
endi
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:11' RANGE('2021-10-20 10:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(LINEAR);
if $rows != 6 then
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 10:00:10.000@ then
......@@ -1548,19 +1548,813 @@ if $rows != 0 then
return -1
endi
sql SELECT INTERP(c2) FROM tb4 RANGE('2021-10-20 10:00:00','2021-10-20 12:00:00') FILL(NULL);
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 ORDER BY ts DESC;
sql SELECT INTERP(c2) FROM tb4 RANGE('2021-10-20 10:00:00','2021-10-20 12:00:00') EVERY(1s) FILL(NULL);
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c2) FROM tb4 RANGE('2021-10-20 10:00:00','2021-10-20 12:00:00') EVERY(1s) FILL(LINEAR);
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c2) FROM tb4 RANGE('2021-10-20 10:00:00','2021-10-20 12:00:00') EVERY(1s) FILL(PREV);
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c2) FROM tb4 RANGE('2021-10-20 10:00:00','2021-10-20 12:00:00') EVERY(1s) FILL(NEXT);
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c2) FROM tb4 RANGE('2021-10-20 10:00:00','2021-10-20 12:00:00') EVERY(1s) FILL(VALUE,100);
if $rows != 0 then
return -1
endi
print ================== start DESC test
sql SELECT INTERP(c2) FROM tb4 RANGE('2021-10-20 10:00:00','2021-10-20 12:00:00') FILL(NULL);
sql SELECT INTERP(c1) FROM tb1 ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
sql SELECT ts,INTERP(c1) FROM tb1 ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data01 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data02 != 0 then
return -1
endi
#67
#sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') EVERY(1s) FILL(LINEAR) ORDER BY ts DESC;
sql SELECT INTERP(c1) FROM tb1 where ts > '2021-10-20 10:00:03' ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data01 != 6 then
return -1
endi
sql SELECT INTERP(c1,c2,c3,c4,c6,c5) FROM tb1 every(1s) ORDER BY ts DESC;
if $rows != 7 then
return -1
endi
if $data00 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data01 != 21 then
return -1
endi
if $data02 != 21.00000 then
return -1
endi
if $data03 != 21 then
return -1
endi
if $data04 != 21 then
return -1
endi
if $data05 != 21.000000000 then
return -1
endi
if $data06 != 21 then
return -1
endi
if $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data12 != 15.00000 then
return -1
endi
if $data13 != 15 then
return -1
endi
if $data14 != 15 then
return -1
endi
if $data15 != 15.000000000 then
return -1
endi
if $data16 != 15 then
return -1
endi
if $data20 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data22 != 10.00000 then
return -1
endi
if $data23 != 10 then
return -1
endi
if $data24 != 10 then
return -1
endi
if $data25 != 10.000000000 then
return -1
endi
if $data26 != 10 then
return -1
endi
if $data30 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data32 != 6.00000 then
return -1
endi
if $data33 != 6 then
return -1
endi
if $data34 != 6 then
return -1
endi
if $data35 != 6.000000000 then
return -1
endi
if $data36 != 6 then
return -1
endi
if $data40 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data41 != 3 then
return -1
endi
if $data42 != 3.00000 then
return -1
endi
if $data43 != 3 then
return -1
endi
if $data44 != 3 then
return -1
endi
if $data45 != 3.000000000 then
return -1
endi
if $data46 != 3 then
return -1
endi
if $data50 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data51 != 1 then
return -1
endi
if $data52 != 1.00000 then
return -1
endi
if $data53 != 1 then
return -1
endi
if $data54 != 1 then
return -1
endi
if $data55 != 1.000000000 then
return -1
endi
if $data56 != 1 then
return -1
endi
if $data60 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data61 != 0 then
return -1
endi
if $data62 != 0.00000 then
return -1
endi
if $data63 != 0 then
return -1
endi
if $data64 != 0 then
return -1
endi
if $data65 != 0.000000000 then
return -1
endi
if $data66 != 0 then
return -1
endi
#73
#sql sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') EVERY(1s) FILL(NEXT) ORDER BY ts DESC;
sql SELECT INTERP(c1),interp(c2),interp(c3) FROM tb1 every(1s) ORDER BY ts DESC;
if $rows != 7 then
return -1
endi
if $data60 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data61 != 0 then
return -1
endi
if $data62 != 0.00000 then
return -1
endi
if $data63 != 0 then
return -1
endi
if $data50 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data51 != 1 then
return -1
endi
if $data52 != 1.00000 then
return -1
endi
if $data53 != 1 then
return -1
endi
if $data40 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data41 != 3 then
return -1
endi
if $data42 != 3.00000 then
return -1
endi
if $data43 != 3 then
return -1
endi
if $data30 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data32 != 6.00000 then
return -1
endi
if $data33 != 6 then
return -1
endi
if $data20 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data22 != 10.00000 then
return -1
endi
if $data23 != 10 then
return -1
endi
if $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data12 != 15.00000 then
return -1
endi
if $data13 != 15 then
return -1
endi
if $data00 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data01 != 21 then
return -1
endi
if $data02 != 21.00000 then
return -1
endi
if $data03 != 21 then
return -1
endi
#79
#sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') EVERY(1s) FILL(PREV) ORDER BY ts DESC;
\ No newline at end of file
sql SELECT INTERP(c1),ts FROM tb1 every(1s) ORDER BY ts DESC;
if $rows != 7 then
return -1
endi
if $data60 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data61 != 0 then
return -1
endi
if $data62 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data50 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data51 != 1 then
return -1
endi
if $data52 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data40 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data41 != 3 then
return -1
endi
if $data42 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data30 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data32 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data20 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data22 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data12 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data00 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data01 != 21 then
return -1
endi
if $data02 != @21-10-20 10:00:21.000@ then
return -1
endi
sql SELECT INTERP(c1) FROM stb1 every(1s) group by tbname ORDER BY ts DESC;
if $rows != 21 then
return -1
endi
if $data60 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data61 != 0 then
return -1
endi
if $data62 != tb1 then
return -1
endi
if $data50 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data51 != 1 then
return -1
endi
if $data52 != tb1 then
return -1
endi
if $data40 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data41 != 3 then
return -1
endi
if $data42 != tb1 then
return -1
endi
if $data30 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data32 != tb1 then
return -1
endi
if $data20 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data22 != tb1 then
return -1
endi
if $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data12 != tb1 then
return -1
endi
if $data00 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data01 != 21 then
return -1
endi
if $data02 != tb1 then
return -1
endi
if $data70 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data71 != 14 then
return -1
endi
if $data72 != tb2 then
return -1
endi
if $data80 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data81 != 12 then
return -1
endi
if $data82 != tb2 then
return -1
endi
if $data90 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data91 != 10 then
return -1
endi
if $data92 != tb2 then
return -1
endi
sql SELECT INTERP(c1) FROM stb1 every(1s) group by tbname ORDER BY ts DESC limit 5;
if $rows != 15 then
return -1
endi
sql SELECT INTERP(c1) FROM stb1 every(1s) group by tbname ORDER BY ts DESC limit 3;
if $rows != 9 then
return -1
endi
if $data00 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data01 != 21 then
return -1
endi
if $data02 != tb1 then
return -1
endi
if $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data12 != tb1 then
return -1
endi
if $data20 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data22 != tb1 then
return -1
endi
if $data30 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data31 != 14 then
return -1
endi
if $data32 != tb2 then
return -1
endi
if $data40 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data41 != 12 then
return -1
endi
if $data42 != tb2 then
return -1
endi
if $data50 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data51 != 10 then
return -1
endi
if $data52 != tb2 then
return -1
endi
if $data60 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data61 != 21 then
return -1
endi
if $data62 != tb3 then
return -1
endi
if $data70 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data71 != 18 then
return -1
endi
if $data72 != tb3 then
return -1
endi
if $data80 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data81 != 10 then
return -1
endi
if $data82 != tb3 then
return -1
endi
sql SELECT INTERP(c1) FROM stb1 every(1s) group by tbname ORDER BY ts DESC limit 3 offset 6;
if $rows != 3 then
return -1
endi
if $data00 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != tb1 then
return -1
endi
if $data10 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data11 != 0 then
return -1
endi
if $data12 != tb2 then
return -1
endi
if $data20 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data21 != 0 then
return -1
endi
if $data22 != tb3 then
return -1
endi
sql SELECT INTERP(c1),t1,interp(c2),t2,interp(c3) FROM stb1 every(1s) group by tbname ORDER BY ts DESC;
if $rows != 21 then
return -1
endi
if $data00 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data01 != 21 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data03 != 21.00000 then
return -1
endi
if $data04 != 1 then
return -1
endi
if $data05 != 21 then
return -1
endi
if $data06 != tb1 then
return -1
endi
if $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data12 != 1 then
return -1
endi
if $data13 != 15.00000 then
return -1
endi
if $data14 != 1 then
return -1
endi
if $data15 != 15 then
return -1
endi
if $data16 != tb1 then
return -1
endi
if $data20 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data22 != 1 then
return -1
endi
if $data23 != 10.00000 then
return -1
endi
if $data24 != 1 then
return -1
endi
if $data25 != 10 then
return -1
endi
if $data26 != tb1 then
return -1
endi
if $data30 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data32 != 1 then
return -1
endi
if $data33 != 6.00000 then
return -1
endi
if $data34 != 1 then
return -1
endi
if $data35 != 6 then
return -1
endi
if $data36 != tb1 then
return -1
endi
if $data40 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data41 != 3 then
return -1
endi
if $data42 != 1 then
return -1
endi
if $data43 != 3.00000 then
return -1
endi
if $data44 != 1 then
return -1
endi
if $data45 != 3 then
return -1
endi
if $data46 != tb1 then
return -1
endi
if $data50 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data51 != 1 then
return -1
endi
if $data52 != 1 then
return -1
endi
if $data53 != 1.00000 then
return -1
endi
if $data54 != 1 then
return -1
endi
if $data55 != 1 then
return -1
endi
if $data56 != tb1 then
return -1
endi
if $data60 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data61 != 0 then
return -1
endi
if $data62 != 1 then
return -1
endi
if $data63 != 0.00000 then
return -1
endi
if $data64 != 1 then
return -1
endi
if $data65 != 0 then
return -1
endi
if $data66 != tb1 then
return -1
endi
if $data70 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data71 != 14 then
return -1
endi
if $data72 != 2 then
return -1
endi
if $data73 != 14.00000 then
return -1
endi
if $data74 != 2 then
return -1
endi
if $data75 != 14 then
return -1
endi
if $data76 != tb2 then
return -1
endi
if $data80 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data81 != 12 then
return -1
endi
if $data82 != 2 then
return -1
endi
if $data83 != 12.00000 then
return -1
endi
if $data84 != 2 then
return -1
endi
if $data85 != 12 then
return -1
endi
if $data86 != tb2 then
return -1
endi
if $data90 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data91 != 10 then
return -1
endi
if $data92 != 2 then
return -1
endi
if $data93 != 10.00000 then
return -1
endi
if $data94 != 2 then
return -1
endi
if $data95 != 10 then
return -1
endi
if $data96 != tb2 then
return -1
endi
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -20,7 +20,7 @@ run general/parser/import_commit3.sim
run general/parser/import_file.sim
run general/parser/insert_tb.sim
run general/parser/tags_dynamically_specifiy.sim
run general/parser/interp.sim
run general/parser/interp_full.sim
run general/parser/lastrow.sim
run general/parser/limit.sim
run general/parser/limit1.sim
......
......@@ -75,7 +75,7 @@ cd ../../../debug; make
./test.sh -f general/parser/where.sim
./test.sh -f general/parser/slimit.sim
./test.sh -f general/parser/select_with_tags.sim
./test.sh -f general/parser/interp.sim
./test.sh -f general/parser/interp_full.sim
./test.sh -f general/parser/tags_dynamically_specifiy.sim
./test.sh -f general/parser/groupby.sim
./test.sh -f general/parser/set_tag_vals.sim
......
......@@ -138,7 +138,7 @@ cd ../../../debug; make
./test.sh -f general/parser/where.sim
./test.sh -f general/parser/slimit.sim
./test.sh -f general/parser/select_with_tags.sim
./test.sh -f general/parser/interp.sim
./test.sh -f general/parser/interp_full.sim
./test.sh -f general/parser/tags_dynamically_specifiy.sim
./test.sh -f general/parser/groupby.sim
./test.sh -f general/parser/set_tag_vals.sim
......
......@@ -143,7 +143,7 @@ wtest.bat -f general/parser/fill_stb.sim
wtest.bat -f general/parser/where.sim
wtest.bat -f general/parser/slimit.sim
wtest.bat -f general/parser/select_with_tags.sim
wtest.bat -f general/parser/interp.sim
wtest.bat -f general/parser/interp_full.sim
wtest.bat -f general/parser/tags_dynamically_specifiy.sim
wtest.bat -f general/parser/groupby.sim
wtest.bat -f general/parser/set_tag_vals.sim
......
......@@ -129,7 +129,7 @@ run general/parser/limit2.sim
run general/parser/slimit.sim
run general/parser/fill.sim
run general/parser/fill_stb.sim
run general/parser/interp.sim
run general/parser/interp_full.sim
run general/parser/where.sim
run general/parser/join.sim
run general/parser/join_multivnode.sim
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册