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

add interp test case

上级 406e9a56
...@@ -83,6 +83,11 @@ typedef struct SJoinSupporter { ...@@ -83,6 +83,11 @@ typedef struct SJoinSupporter {
int32_t totalLen; int32_t totalLen;
int32_t num; int32_t num;
SArray* pVgroupTables; SArray* pVgroupTables;
int16_t fillType; // final result fill type
int64_t * fillVal; // default value for fill
int32_t numOfFillVal; // fill value size
} SJoinSupporter; } SJoinSupporter;
......
...@@ -3217,6 +3217,7 @@ static int16_t doGetColumnIndex(SQueryInfo* pQueryInfo, int32_t index, SStrToken ...@@ -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 char tmpTokenBuf[TSDB_MAX_BYTES_PER_ROW] = {0}; // create tmp buf to avoid alter orginal sqlstr
strncpy(tmpTokenBuf, pToken->z, pToken->n); strncpy(tmpTokenBuf, pToken->z, pToken->n);
pToken->z = tmpTokenBuf; pToken->z = tmpTokenBuf;
if (pToken->type == TK_ID) { if (pToken->type == TK_ID) {
...@@ -5641,14 +5642,14 @@ int32_t validateFillNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSqlNo ...@@ -5641,14 +5642,14 @@ int32_t validateFillNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSqlNo
const char* msg3 = "top/bottom/sample not support fill"; const char* msg3 = "top/bottom/sample not support fill";
const char* msg4 = "illegal value or data overflow"; const char* msg4 = "illegal value or data overflow";
const char* msg5 = "fill only available for interval query"; 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"; const char* msg7 = "join query not supported fill operation";
bool pointInterp = tscIsPointInterpQuery(pQueryInfo); bool pointInterp = tscIsPointInterpQuery(pQueryInfo);
if ((!isTimeWindowQuery(pQueryInfo)) && (!pointInterp)) { if ((!isTimeWindowQuery(pQueryInfo)) && (!pointInterp)) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg5); 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); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg7);
} }
...@@ -7510,6 +7511,10 @@ int32_t doFunctionsCompatibleCheck(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, char* ...@@ -7510,6 +7511,10 @@ int32_t doFunctionsCompatibleCheck(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, char*
int32_t validateFunctionFromUpstream(SQueryInfo* pQueryInfo, char* msg) { 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* 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); int32_t numOfExprs = (int32_t)tscNumOfExprs(pQueryInfo);
size_t upNum = taosArrayGetSize(pQueryInfo->pUpstream); size_t upNum = taosArrayGetSize(pQueryInfo->pUpstream);
...@@ -7529,6 +7534,50 @@ int32_t validateFunctionFromUpstream(SQueryInfo* pQueryInfo, char* msg) { ...@@ -7529,6 +7534,50 @@ int32_t validateFunctionFromUpstream(SQueryInfo* pQueryInfo, char* msg) {
} }
return invalidOperationMsg(msg, msg1); 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 ...@@ -9057,7 +9106,7 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
for (int32_t i = 0; i < tscNumOfExprs(pQueryInfo); ++i) { for (int32_t i = 0; i < tscNumOfExprs(pQueryInfo); ++i) {
SExprInfo* pExpr = tscExprGet(pQueryInfo, i); SExprInfo* pExpr = tscExprGet(pQueryInfo, i);
int32_t f = pExpr->base.functionId; 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); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6);
} }
......
...@@ -394,6 +394,12 @@ SJoinSupporter* tscCreateJoinSupporter(SSqlObj* pSql, int32_t index) { ...@@ -394,6 +394,12 @@ SJoinSupporter* tscCreateJoinSupporter(SSqlObj* pSql, int32_t index) {
memcpy(&pSupporter->interval, &pQueryInfo->interval, sizeof(pSupporter->interval)); memcpy(&pSupporter->interval, &pQueryInfo->interval, sizeof(pSupporter->interval));
pSupporter->limit = pQueryInfo->limit; 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); STableMetaInfo* pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, index);
pSupporter->uid = pTableMetaInfo->pTableMeta->id.uid; pSupporter->uid = pTableMetaInfo->pTableMeta->id.uid;
assert (pSupporter->uid != 0); assert (pSupporter->uid != 0);
...@@ -579,6 +585,13 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) { ...@@ -579,6 +585,13 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
pQueryInfo->fieldsInfo = pSupporter->fieldsInfo; pQueryInfo->fieldsInfo = pSupporter->fieldsInfo;
pQueryInfo->groupbyExpr = pSupporter->groupInfo; pQueryInfo->groupbyExpr = pSupporter->groupInfo;
pQueryInfo->pUpstream = taosArrayInit(4, sizeof(POINTER_BYTES)); 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); assert(pNew->subState.numOfSub == 0 && pQueryInfo->numOfTables == 1);
......
...@@ -5347,4 +5347,3 @@ char* cloneCurrentDBName(SSqlObj* pSql) { ...@@ -5347,4 +5347,3 @@ char* cloneCurrentDBName(SSqlObj* pSql) {
return p; return p;
} }
...@@ -94,6 +94,8 @@ typedef struct SSessionWindow { ...@@ -94,6 +94,8 @@ typedef struct SSessionWindow {
} SSessionWindow; } SSessionWindow;
int64_t taosTimeAdd(int64_t t, int64_t duration, char unit, int32_t precision); 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); 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); 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) { ...@@ -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)); 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) { int32_t taosTimeCountInterval(int64_t skey, int64_t ekey, int64_t interval, char unit, int32_t precision) {
if (ekey < skey) { if (ekey < skey) {
int64_t tmp = ekey; int64_t tmp = ekey;
......
...@@ -43,6 +43,8 @@ typedef int32_t (*__block_search_fn_t)(char* data, int32_t num, int64_t key, int ...@@ -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 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) #define NEEDTO_COMPRESS_QUERY(size) ((size) > tsCompressColData? 1 : 0)
enum { enum {
...@@ -400,6 +402,7 @@ typedef struct SQInfo { ...@@ -400,6 +402,7 @@ typedef struct SQInfo {
int32_t dataReady; // denote if query result is ready or not int32_t dataReady; // denote if query result is ready or not
void* rspContext; // response context void* rspContext; // response context
int64_t startExecTs; // start to exec timestamp int64_t startExecTs; // start to exec timestamp
int64_t lastRetrieveTs; // last retrieve timestamp
char* sql; // query sql string char* sql; // query sql string
SQueryCostInfo summary; SQueryCostInfo summary;
} SQInfo; } SQInfo;
...@@ -483,18 +486,20 @@ typedef struct SProjectOperatorInfo { ...@@ -483,18 +486,20 @@ typedef struct SProjectOperatorInfo {
SSDataBlock *existDataBlock; SSDataBlock *existDataBlock;
} SProjectOperatorInfo; } SProjectOperatorInfo;
typedef struct STableEveryOperatorInfo { typedef struct STimeEveryOperatorInfo {
SOptrBasicInfo binfo; SOptrBasicInfo binfo;
int32_t bufCapacity; int32_t bufCapacity;
uint32_t seed; uint32_t seed;
int64_t tableEndKey; int64_t tableEndKey;
SSDataBlock *lastBlock; SSDataBlock *lastBlock;
SHashObj *rangeStart;
int32_t lastGroupIdx;
bool groupDone; bool groupDone;
bool allDone; bool allDone;
SSDataBlock *existDataBlock; SSDataBlock *existDataBlock;
} STableEveryOperatorInfo; } STimeEveryOperatorInfo;
typedef struct SLimitOperatorInfo { typedef struct SLimitOperatorInfo {
int64_t limit; int64_t limit;
......
...@@ -1277,7 +1277,11 @@ void doTimeWindowInterpolation(SOperatorInfo* pOperator, SOptrBasicInfo* pInfo, ...@@ -1277,7 +1277,11 @@ void doTimeWindowInterpolation(SOperatorInfo* pOperator, SOptrBasicInfo* pInfo,
} }
} else { } else {
GET_TYPED_DATA(v2, double, pColInfo->info.type, (char *)pColInfo->pData + curRowIndex * pColInfo->info.bytes); if (curRowIndex == -1) {
GET_TYPED_DATA(v2, double, pColInfo->info.type, (char *)pRuntimeEnv->prevRow[index]);
} else {
GET_TYPED_DATA(v2, double, pColInfo->info.type, (char *)pColInfo->pData + curRowIndex * pColInfo->info.bytes);
}
pCtx[k].end.key = curTs; pCtx[k].end.key = curTs;
pCtx[k].end.val = v2; pCtx[k].end.val = v2;
...@@ -2277,7 +2281,7 @@ bool isQueryKilled(SQInfo *pQInfo) { ...@@ -2277,7 +2281,7 @@ bool isQueryKilled(SQInfo *pQInfo) {
// query has been executed more than tsShellActivityTimer, and the retrieve has not arrived // query has been executed more than tsShellActivityTimer, and the retrieve has not arrived
// abort current query execution. // abort current query execution.
if (pQInfo->owner != 0 && ((taosGetTimestampSec() - pQInfo->startExecTs/1000) > getMaximumIdleDurationSec()) && if (pQInfo->owner != 0 && ((taosGetTimestampSec() - pQInfo->lastRetrieveTs/1000) > getMaximumIdleDurationSec()) &&
(!needBuildResAfterQueryComplete(pQInfo))) { (!needBuildResAfterQueryComplete(pQInfo))) {
assert(pQInfo->startExecTs != 0); assert(pQInfo->startExecTs != 0);
...@@ -2540,12 +2544,23 @@ static void updateDataCheckOrder(SQInfo *pQInfo, SQueryTableMsg* pQueryMsg, bool ...@@ -2540,12 +2544,23 @@ static void updateDataCheckOrder(SQInfo *pQInfo, SQueryTableMsg* pQueryMsg, bool
if (!QUERY_IS_ASC_QUERY(pQueryAttr)) { if (!QUERY_IS_ASC_QUERY(pQueryAttr)) {
qDebug(msg, pQInfo->qId, "interp", pQueryAttr->order.order, TSDB_ORDER_ASC, pQueryAttr->window.skey, pQueryAttr->window.ekey, pQueryAttr->window.ekey, pQueryAttr->window.skey); qDebug(msg, pQInfo->qId, "interp", pQueryAttr->order.order, TSDB_ORDER_ASC, pQueryAttr->window.skey, pQueryAttr->window.ekey, pQueryAttr->window.ekey, pQueryAttr->window.skey);
SWAP(pQueryAttr->window.skey, pQueryAttr->window.ekey, TSKEY); SWAP(pQueryAttr->window.skey, pQueryAttr->window.ekey, TSKEY);
doUpdateLastKey(pQueryAttr);
} }
pQueryAttr->order.order = TSDB_ORDER_ASC; pQueryAttr->order.order = TSDB_ORDER_ASC;
return; return;
} }
if (pQueryAttr->pointInterpQuery && pQueryAttr->interval.interval > 0 && (!QUERY_IS_ASC_QUERY(pQueryAttr)) && pQueryAttr->range.skey == INT64_MIN) {
qDebug(msg, pQInfo->qId, "interp", pQueryAttr->order.order, TSDB_ORDER_ASC, pQueryAttr->window.skey, pQueryAttr->window.ekey, pQueryAttr->window.ekey, pQueryAttr->window.skey);
SWAP(pQueryAttr->window.skey, pQueryAttr->window.ekey, TSKEY);
pQueryAttr->order.order = TSDB_ORDER_ASC;
doUpdateLastKey(pQueryAttr);
pQueryAttr->needReverseScan = true;
return;
}
if (pQueryAttr->interval.interval == 0) { if (pQueryAttr->interval.interval == 0) {
if (onlyFirstQuery(pQueryAttr)) { if (onlyFirstQuery(pQueryAttr)) {
if (!QUERY_IS_ASC_QUERY(pQueryAttr)) { if (!QUERY_IS_ASC_QUERY(pQueryAttr)) {
...@@ -3004,7 +3019,7 @@ int32_t loadDataBlockOnDemand(SQueryRuntimeEnv* pRuntimeEnv, STableScanInfo* pTa ...@@ -3004,7 +3019,7 @@ int32_t loadDataBlockOnDemand(SQueryRuntimeEnv* pRuntimeEnv, STableScanInfo* pTa
if ((*status) != BLK_DATA_ALL_NEEDED) { if ((*status) != BLK_DATA_ALL_NEEDED) {
// the pCtx[i] result is belonged to previous time window since the outputBuf has not been set yet, // the pCtx[i] result is belonged to previous time window since the outputBuf has not been set yet,
// the filter result may be incorrect. So in case of interval query, we need to set the correct time output buffer // the filter result may be incorrect. So in case of interval query, we need to set the correct time output buffer
if (QUERY_IS_INTERVAL_QUERY(pQueryAttr)) { if (QUERY_IS_INTERVAL_QUERY(pQueryAttr) && (!pQueryAttr->pointInterpQuery)) {
SResultRow* pResult = NULL; SResultRow* pResult = NULL;
bool masterScan = IS_MASTER_SCAN(pRuntimeEnv); bool masterScan = IS_MASTER_SCAN(pRuntimeEnv);
...@@ -3016,7 +3031,7 @@ int32_t loadDataBlockOnDemand(SQueryRuntimeEnv* pRuntimeEnv, STableScanInfo* pTa ...@@ -3016,7 +3031,7 @@ int32_t loadDataBlockOnDemand(SQueryRuntimeEnv* pRuntimeEnv, STableScanInfo* pTa
pTableScanInfo->rowCellInfoOffset) != TSDB_CODE_SUCCESS) { pTableScanInfo->rowCellInfoOffset) != TSDB_CODE_SUCCESS) {
longjmp(pRuntimeEnv->env, TSDB_CODE_QRY_OUT_OF_MEMORY); longjmp(pRuntimeEnv->env, TSDB_CODE_QRY_OUT_OF_MEMORY);
} }
} else if (pQueryAttr->stableQuery && (!pQueryAttr->tsCompQuery) && (!pQueryAttr->diffQuery)) { // stable aggregate, not interval aggregate or normal column aggregate } else if (pQueryAttr->stableQuery && (!pQueryAttr->tsCompQuery) && (!pQueryAttr->diffQuery) && (!pQueryAttr->pointInterpQuery)) { // stable aggregate, not interval aggregate or normal column aggregate
doSetTableGroupOutputBuf(pRuntimeEnv, pTableScanInfo->pResultRowInfo, pTableScanInfo->pCtx, doSetTableGroupOutputBuf(pRuntimeEnv, pTableScanInfo->pResultRowInfo, pTableScanInfo->pCtx,
pTableScanInfo->rowCellInfoOffset, pTableScanInfo->numOfOutput, pTableScanInfo->rowCellInfoOffset, pTableScanInfo->numOfOutput,
pRuntimeEnv->current->groupIndex); pRuntimeEnv->current->groupIndex);
...@@ -4645,7 +4660,7 @@ static int32_t setupQueryHandle(void* tsdb, SQueryRuntimeEnv* pRuntimeEnv, int64 ...@@ -4645,7 +4660,7 @@ static int32_t setupQueryHandle(void* tsdb, SQueryRuntimeEnv* pRuntimeEnv, int64
STsdbQueryCond cond = createTsdbQueryCond(pQueryAttr, &pQueryAttr->window); STsdbQueryCond cond = createTsdbQueryCond(pQueryAttr, &pQueryAttr->window);
if (pQueryAttr->tsCompQuery || pQueryAttr->pointInterpQuery) { if (pQueryAttr->tsCompQuery || pQueryAttr->pointInterpQuery) {
cond.type = BLOCK_LOAD_TABLE_SEQ_ORDER; cond.type = BLOCK_LOAD_TABLE_SEQ_ORDER;
} }
if (!isSTableQuery if (!isSTableQuery
...@@ -4772,7 +4787,9 @@ int32_t doInitQInfo(SQInfo* pQInfo, STSBuf* pTsBuf, void* tsdb, void* sourceOptr ...@@ -4772,7 +4787,9 @@ int32_t doInitQInfo(SQInfo* pQInfo, STSBuf* pTsBuf, void* tsdb, void* sourceOptr
if (pTsBuf != NULL) { if (pTsBuf != NULL) {
int16_t order = (pQueryAttr->order.order == pRuntimeEnv->pTsBuf->tsOrder) ? TSDB_ORDER_ASC : TSDB_ORDER_DESC; int16_t order = (pQueryAttr->order.order == pRuntimeEnv->pTsBuf->tsOrder) ? TSDB_ORDER_ASC : TSDB_ORDER_DESC;
tsBufResetPos(pRuntimeEnv->pTsBuf);
tsBufSetTraverseOrder(pRuntimeEnv->pTsBuf, order); tsBufSetTraverseOrder(pRuntimeEnv->pTsBuf, order);
tsBufNextPos(pTsBuf);
} }
int32_t ps = DEFAULT_PAGE_SIZE; int32_t ps = DEFAULT_PAGE_SIZE;
...@@ -5107,7 +5124,6 @@ SOperatorInfo* createTableSeqScanOperator(void* pTsdbQueryHandle, SQueryRuntimeE ...@@ -5107,7 +5124,6 @@ SOperatorInfo* createTableSeqScanOperator(void* pTsdbQueryHandle, SQueryRuntimeE
pOperator->numOfOutput = pRuntimeEnv->pQueryAttr->numOfCols; pOperator->numOfOutput = pRuntimeEnv->pQueryAttr->numOfCols;
pOperator->pRuntimeEnv = pRuntimeEnv; pOperator->pRuntimeEnv = pRuntimeEnv;
pOperator->exec = doTableScanImpl; pOperator->exec = doTableScanImpl;
pOperator->notify = notifyTableScan;
return pOperator; return pOperator;
} }
...@@ -5156,7 +5172,7 @@ void setTableScanFilterOperatorInfo(STableScanInfo* pTableScanInfo, SOperatorInf ...@@ -5156,7 +5172,7 @@ void setTableScanFilterOperatorInfo(STableScanInfo* pTableScanInfo, SOperatorInf
pTableScanInfo->pResultRowInfo = &pIntervalInfo->resultRowInfo; pTableScanInfo->pResultRowInfo = &pIntervalInfo->resultRowInfo;
pTableScanInfo->rowCellInfoOffset = pIntervalInfo->rowCellInfoOffset; pTableScanInfo->rowCellInfoOffset = pIntervalInfo->rowCellInfoOffset;
} else if (pDownstream->operatorType == OP_TimeEvery) { } else if (pDownstream->operatorType == OP_TimeEvery) {
STableEveryOperatorInfo *pEveryInfo = pDownstream->info; STimeEveryOperatorInfo *pEveryInfo = pDownstream->info;
pTableScanInfo->pCtx = pEveryInfo->binfo.pCtx; pTableScanInfo->pCtx = pEveryInfo->binfo.pCtx;
pTableScanInfo->pResultRowInfo = &pEveryInfo->binfo.resultRowInfo; pTableScanInfo->pResultRowInfo = &pEveryInfo->binfo.resultRowInfo;
...@@ -5208,6 +5224,10 @@ SOperatorInfo* createDataBlocksOptScanInfo(void* pTsdbQueryHandle, SQueryRuntime ...@@ -5208,6 +5224,10 @@ SOperatorInfo* createDataBlocksOptScanInfo(void* pTsdbQueryHandle, SQueryRuntime
pInfo->current = 0; pInfo->current = 0;
pInfo->order = pRuntimeEnv->pQueryAttr->order.order; pInfo->order = pRuntimeEnv->pQueryAttr->order.order;
if (pRuntimeEnv->pQueryAttr->pointInterpQuery) {
pRuntimeEnv->enableGroupData = true;
}
SOperatorInfo* pOptr = calloc(1, sizeof(SOperatorInfo)); SOperatorInfo* pOptr = calloc(1, sizeof(SOperatorInfo));
pOptr->name = "DataBlocksOptimizedScanOperator"; pOptr->name = "DataBlocksOptimizedScanOperator";
pOptr->operatorType = OP_DataBlocksOptScan; pOptr->operatorType = OP_DataBlocksOptScan;
...@@ -5215,6 +5235,7 @@ SOperatorInfo* createDataBlocksOptScanInfo(void* pTsdbQueryHandle, SQueryRuntime ...@@ -5215,6 +5235,7 @@ SOperatorInfo* createDataBlocksOptScanInfo(void* pTsdbQueryHandle, SQueryRuntime
pOptr->blockingOptr = false; pOptr->blockingOptr = false;
pOptr->info = pInfo; pOptr->info = pInfo;
pOptr->exec = doTableScan; pOptr->exec = doTableScan;
pOptr->notify = notifyTableScan;
return pOptr; return pOptr;
} }
...@@ -5918,10 +5939,40 @@ static void everyApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SQLFunctionCtx *p ...@@ -5918,10 +5939,40 @@ static void everyApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SQLFunctionCtx *p
} }
} }
static int64_t getEveryStartTs(bool ascQuery, STimeWindow *range, STimeWindow *blockWin, SQueryAttr *pQueryAttr) {
int64_t startTs = range->skey, ekey = 0;
assert(range->skey != INT64_MIN);
if (ascQuery) {
return startTs;
}
if (range->ekey != INT64_MIN) {
ekey = range->ekey;
} else {
ekey = blockWin->ekey;
}
if (pQueryAttr->interval.interval > 0) {
if (pQueryAttr->interval.intervalUnit == 'n' || pQueryAttr->interval.intervalUnit == 'y') {
int64_t lastTs = startTs;
while (startTs < ekey) {
lastTs = startTs;
startTs = taosTimeAdd(startTs, pQueryAttr->interval.interval, pQueryAttr->interval.intervalUnit, pQueryAttr->precision);
}
startTs = lastTs;
} else {
startTs = startTs + (ekey - startTs)/pQueryAttr->interval.interval * pQueryAttr->interval.interval;
}
}
return startTs;
}
static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlock, bool *needApply) { static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlock, bool *needApply) {
SQueryRuntimeEnv* pRuntimeEnv = pOperatorInfo->pRuntimeEnv; SQueryRuntimeEnv* pRuntimeEnv = pOperatorInfo->pRuntimeEnv;
STableEveryOperatorInfo* pEveryInfo = (STableEveryOperatorInfo*)pOperatorInfo->info; STimeEveryOperatorInfo* pEveryInfo = (STimeEveryOperatorInfo*)pOperatorInfo->info;
SQueryAttr* pQueryAttr = pRuntimeEnv->pQueryAttr; SQueryAttr* pQueryAttr = pRuntimeEnv->pQueryAttr;
bool ascQuery = QUERY_IS_ASC_QUERY(pQueryAttr); bool ascQuery = QUERY_IS_ASC_QUERY(pQueryAttr);
int32_t gidx = pRuntimeEnv->current->groupIndex; int32_t gidx = pRuntimeEnv->current->groupIndex;
...@@ -5951,8 +6002,7 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo ...@@ -5951,8 +6002,7 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo
if (pBlock && pBlock->pDataBlock != NULL) { if (pBlock && pBlock->pDataBlock != NULL) {
SColumnInfoData* pColDataInfo = taosArrayGet(pBlock->pDataBlock, 0); SColumnInfoData* pColDataInfo = taosArrayGet(pBlock->pDataBlock, 0);
tsCols = (int64_t*) pColDataInfo->pData; tsCols = (int64_t*) pColDataInfo->pData;
assert(tsCols[0] == pBlock->info.window.skey && assert(tsCols[0] == pBlock->info.window.skey && tsCols[pBlock->info.rows - 1] == pBlock->info.window.ekey);
tsCols[pBlock->info.rows - 1] == pBlock->info.window.ekey);
} }
if (pCtx->startTs == INT64_MIN) { if (pCtx->startTs == INT64_MIN) {
...@@ -5961,21 +6011,47 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo ...@@ -5961,21 +6011,47 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo
goto group_finished_exit; goto group_finished_exit;
} }
pCtx->startTs = tsCols[0]; if (ascQuery) {
if (pQueryAttr->needReverseScan) {
assert(pEveryInfo->rangeStart);
taosHashPut(pEveryInfo->rangeStart, &pBlock->info.tid, sizeof(pBlock->info.tid), tsCols, sizeof(*tsCols));
goto group_finished_exit;
} else {
pCtx->startTs = tsCols[0];
}
} else {
assert(pEveryInfo->rangeStart);
TSKEY * rstart = taosHashGet(pEveryInfo->rangeStart, &pBlock->info.tid, sizeof(pBlock->info.tid));
if (rstart) {
pQueryAttr->range.skey = *rstart;
pCtx->startTs = getEveryStartTs(ascQuery, &pQueryAttr->range, &pBlock->info.window, pQueryAttr);
} else {
goto group_finished_exit;
}
}
} else { } else {
pCtx->startTs = pQueryAttr->range.skey; pCtx->startTs = getEveryStartTs(ascQuery, &pQueryAttr->range, &pBlock->info.window, pQueryAttr);
} }
pCtx->endTs = INT64_MIN; pCtx->endTs = INT64_MIN;
} else if (pCtx->endTs == pCtx->startTs) { } else if (pCtx->endTs == pCtx->startTs) {
if (pQueryAttr->interval.interval > 0) { if (pQueryAttr->interval.interval > 0) {
if (pQueryAttr->interval.intervalUnit == 'n' || pQueryAttr->interval.intervalUnit == 'y') { if (pQueryAttr->interval.intervalUnit == 'n' || pQueryAttr->interval.intervalUnit == 'y') {
pCtx->startTs = taosTimeAdd(pCtx->startTs, pQueryAttr->interval.interval, pQueryAttr->interval.intervalUnit, pQueryAttr->precision); if (ascQuery) {
pCtx->startTs = taosTimeAdd(pCtx->startTs, pQueryAttr->interval.interval, pQueryAttr->interval.intervalUnit, pQueryAttr->precision);
} else {
pCtx->startTs = taosTimeSub(pCtx->startTs, pQueryAttr->interval.interval, pQueryAttr->interval.intervalUnit, pQueryAttr->precision);
}
} else { } else {
pCtx->startTs = pCtx->startTs + pQueryAttr->interval.interval; pCtx->startTs = ascQuery ? pCtx->startTs + pQueryAttr->interval.interval : pCtx->startTs - pQueryAttr->interval.interval;
} }
if (pQueryAttr->range.ekey != INT64_MIN && pCtx->startTs > pQueryAttr->range.ekey) { if (ascQuery && pQueryAttr->range.ekey != INT64_MIN && pCtx->startTs > pQueryAttr->range.ekey) {
goto group_finished_exit;
}
if ((!ascQuery) && pQueryAttr->range.skey != INT64_MIN && pCtx->startTs < pQueryAttr->range.skey) {
goto group_finished_exit; goto group_finished_exit;
} }
} else { } else {
...@@ -5985,22 +6061,30 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo ...@@ -5985,22 +6061,30 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo
pCtx->endTs = INT64_MIN; pCtx->endTs = INT64_MIN;
} }
if (tsCols == NULL && pCtx->startTs > pEveryInfo->tableEndKey && ascQuery) { if (tsCols == NULL && ((ascQuery && pCtx->startTs > pEveryInfo->tableEndKey) || ((!ascQuery) && pCtx->startTs < pEveryInfo->tableEndKey))) {
if (pQueryAttr->range.ekey == INT64_MIN) { if ((ascQuery && pQueryAttr->range.ekey == INT64_MIN) || ((!ascQuery) && pQueryAttr->range.skey == INT64_MIN)) {
goto group_finished_exit; goto group_finished_exit;
} }
if (pQueryAttr->fillType == TSDB_FILL_NONE || pQueryAttr->fillType == TSDB_FILL_LINEAR || pQueryAttr->fillType == TSDB_FILL_NEXT) { if (pQueryAttr->fillType == TSDB_FILL_NONE || pQueryAttr->fillType == TSDB_FILL_LINEAR
|| ((ascQuery && pQueryAttr->fillType == TSDB_FILL_NEXT) || ((!ascQuery) && pQueryAttr->fillType == TSDB_FILL_PREV))) {
goto group_finished_exit; goto group_finished_exit;
} }
if (pQueryAttr->fillType == TSDB_FILL_PREV) { if (ascQuery && pQueryAttr->fillType == TSDB_FILL_PREV) {
TSKEY lastTs = *(TSKEY *) pRuntimeEnv->prevRow[0]; TSKEY lastTs = *(TSKEY *) pRuntimeEnv->prevRow[0];
if (lastTs != INT64_MIN) { if (lastTs != INT64_MIN) {
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pEveryInfo->binfo.pRes->pDataBlock, lastTs, -1, INT64_MIN, 0, 0, RESULT_ROW_START_INTERP); doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pEveryInfo->binfo.pRes->pDataBlock, lastTs, -1, INT64_MIN, 0, 0, RESULT_ROW_START_INTERP);
} else { } else {
goto group_finished_exit; goto group_finished_exit;
} }
} else if ((!ascQuery) && pQueryAttr->fillType == TSDB_FILL_NEXT) {
TSKEY lastTs = *(TSKEY *) pRuntimeEnv->prevRow[0];
if (lastTs != INT64_MIN) {
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pEveryInfo->binfo.pRes->pDataBlock, INT64_MIN, 0, lastTs, -1, 0, RESULT_ROW_END_INTERP);
} else {
goto group_finished_exit;
}
} }
*needApply = true; *needApply = true;
...@@ -6013,46 +6097,78 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo ...@@ -6013,46 +6097,78 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo
} }
int32_t startPos = binarySearchForKey((char *)tsCols, pBlock->info.rows, pCtx->startTs, TSDB_ORDER_ASC); int32_t startPos = binarySearchForKey((char *)tsCols, pBlock->info.rows, pCtx->startTs, pQueryAttr->order.order);
if (pQueryAttr->fillType != TSDB_FILL_NEXT && pCtx->start.key == INT64_MIN) { if (ascQuery && pQueryAttr->fillType != TSDB_FILL_NEXT && pCtx->start.key == INT64_MIN) {
if (ascQuery) { if (startPos < 0) {
if (startPos < 0) { saveDataBlockLastRow(pRuntimeEnv, &pBlock->info, pBlock->pDataBlock, pBlock->info.rows - 1);
saveDataBlockLastRow(pRuntimeEnv, &pBlock->info, pBlock->pDataBlock, pBlock->info.rows - 1); return true;
return true; } else if (startPos == 0) {
} else if (startPos == 0) { if (tsCols[startPos] == pCtx->startTs) {
if (tsCols[startPos] == pCtx->startTs) { doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, pCtx->startTs, startPos, INT64_MIN, 0, 0, RESULT_ROW_START_INTERP);
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, pCtx->startTs, startPos, INT64_MIN, 0, 0, RESULT_ROW_START_INTERP);
} else {
TSKEY lastTs = *(TSKEY *) pRuntimeEnv->prevRow[0];
if (lastTs != INT64_MIN) {
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, lastTs, -1, INT64_MIN, 0, 0, RESULT_ROW_START_INTERP);
}
}
} else { } else {
if (tsCols[startPos] == pCtx->startTs) { TSKEY lastTs = *(TSKEY *) pRuntimeEnv->prevRow[0];
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, pCtx->startTs, startPos, INT64_MIN, 0, 0, RESULT_ROW_START_INTERP); if (lastTs != INT64_MIN) {
} else { doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, lastTs, -1, INT64_MIN, 0, 0, RESULT_ROW_START_INTERP);
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, tsCols[startPos - 1], startPos - 1, INT64_MIN, 0, 0, RESULT_ROW_START_INTERP);
} }
} }
} else {
if (pQueryAttr->fillType != TSDB_FILL_LINEAR) { if (tsCols[startPos] == pCtx->startTs) {
*needApply = true; doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, pCtx->startTs, startPos, INT64_MIN, 0, 0, RESULT_ROW_START_INTERP);
} } else {
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, tsCols[startPos - 1], startPos - 1, INT64_MIN, 0, 0, RESULT_ROW_START_INTERP);
}
} }
if (pQueryAttr->fillType != TSDB_FILL_LINEAR) {
*needApply = true;
}
} }
if ((pQueryAttr->fillType == TSDB_FILL_LINEAR || pQueryAttr->fillType == TSDB_FILL_NEXT) && pCtx->end.key == INT64_MIN) { if ((!ascQuery) && (pQueryAttr->fillType == TSDB_FILL_LINEAR || pQueryAttr->fillType == TSDB_FILL_NEXT) && pCtx->end.key == INT64_MIN) {
if (ascQuery) { if (startPos < 0) {
if (startPos < 0) { saveDataBlockLastRow(pRuntimeEnv, &pBlock->info, pBlock->pDataBlock, 0);
return true; return true;
} else if (startPos == (pBlock->info.rows - 1)) {
if (tsCols[startPos] == pCtx->startTs) {
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, INT64_MIN, 0, pCtx->startTs, startPos, 0, RESULT_ROW_END_INTERP);
} else {
TSKEY lastTs = *(TSKEY *) pRuntimeEnv->prevRow[0];
if (lastTs != INT64_MIN) {
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, INT64_MIN, 0, lastTs, -1, 0, RESULT_ROW_END_INTERP);
}
} }
} else {
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, INT64_MIN, 0, tsCols[startPos], startPos, 0, RESULT_ROW_END_INTERP); if (tsCols[startPos] == pCtx->startTs) {
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, INT64_MIN, 0, pCtx->startTs, startPos, 0, RESULT_ROW_END_INTERP);
} else {
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, INT64_MIN, 0, tsCols[startPos + 1], startPos + 1, 0, RESULT_ROW_END_INTERP);
}
}
if (pQueryAttr->fillType != TSDB_FILL_LINEAR) {
*needApply = true; *needApply = true;
}
}
if (ascQuery && (pQueryAttr->fillType == TSDB_FILL_LINEAR || pQueryAttr->fillType == TSDB_FILL_NEXT) && pCtx->end.key == INT64_MIN) {
if (startPos < 0) {
return true;
} }
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, INT64_MIN, 0, tsCols[startPos], startPos, 0, RESULT_ROW_END_INTERP);
*needApply = true;
}
if ((!ascQuery) && pQueryAttr->fillType != TSDB_FILL_NEXT && pCtx->start.key == INT64_MIN) {
if (startPos < 0) {
return true;
}
doTimeWindowInterpolation(pOperatorInfo, pOperatorInfo->info, pBlock->pDataBlock, tsCols[startPos], startPos, INT64_MIN, 0, 0, RESULT_ROW_START_INTERP);
*needApply = true;
} }
if (*needApply) { if (*needApply) {
...@@ -6066,6 +6182,10 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo ...@@ -6066,6 +6182,10 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo
group_finished_exit: group_finished_exit:
qDebug("group idx[%d] interp finished", gidx); qDebug("group idx[%d] interp finished", gidx);
if (pQueryAttr->needReverseScan) {
pQueryAttr->range.skey = INT64_MIN;
}
pEveryInfo->groupDone = true; pEveryInfo->groupDone = true;
...@@ -6079,7 +6199,7 @@ group_finished_exit: ...@@ -6079,7 +6199,7 @@ group_finished_exit:
static void doTimeEveryImpl(SOperatorInfo* pOperator, SQLFunctionCtx *pCtx, SSDataBlock* pBlock, bool newgroup) { static void doTimeEveryImpl(SOperatorInfo* pOperator, SQLFunctionCtx *pCtx, SSDataBlock* pBlock, bool newgroup) {
STableEveryOperatorInfo* pEveryInfo = (STableEveryOperatorInfo*) pOperator->info; STimeEveryOperatorInfo* pEveryInfo = (STimeEveryOperatorInfo*) pOperator->info;
SQueryRuntimeEnv *pRuntimeEnv = pOperator->pRuntimeEnv; SQueryRuntimeEnv *pRuntimeEnv = pOperator->pRuntimeEnv;
int32_t numOfOutput = pOperator->numOfOutput; int32_t numOfOutput = pOperator->numOfOutput;
SQueryAttr* pQueryAttr = pRuntimeEnv->pQueryAttr; SQueryAttr* pQueryAttr = pRuntimeEnv->pQueryAttr;
...@@ -6088,12 +6208,16 @@ static void doTimeEveryImpl(SOperatorInfo* pOperator, SQLFunctionCtx *pCtx, SSDa ...@@ -6088,12 +6208,16 @@ static void doTimeEveryImpl(SOperatorInfo* pOperator, SQLFunctionCtx *pCtx, SSDa
SSDataBlock* pRes = pEveryInfo->binfo.pRes; SSDataBlock* pRes = pEveryInfo->binfo.pRes;
TSKEY* tsCols = NULL; TSKEY* tsCols = NULL;
if (newgroup) {
}
if (pBlock && pBlock->pDataBlock != NULL) { if (pBlock && pBlock->pDataBlock != NULL) {
SColumnInfoData* pColDataInfo = taosArrayGet(pBlock->pDataBlock, 0); SColumnInfoData* pColDataInfo = taosArrayGet(pBlock->pDataBlock, 0);
if (pColDataInfo->info.type != TSDB_DATA_TYPE_TIMESTAMP) {
qError("no ts input for interp, error quit");
pEveryInfo->allDone = true;
pEveryInfo->groupDone = true;
setQueryStatus(pRuntimeEnv, QUERY_COMPLETED);
return;
}
tsCols = (int64_t*) pColDataInfo->pData; tsCols = (int64_t*) pColDataInfo->pData;
assert(tsCols[0] == pBlock->info.window.skey && assert(tsCols[0] == pBlock->info.window.skey &&
tsCols[pBlock->info.rows - 1] == pBlock->info.window.ekey); tsCols[pBlock->info.rows - 1] == pBlock->info.window.ekey);
...@@ -6124,7 +6248,7 @@ static void doTimeEveryImpl(SOperatorInfo* pOperator, SQLFunctionCtx *pCtx, SSDa ...@@ -6124,7 +6248,7 @@ static void doTimeEveryImpl(SOperatorInfo* pOperator, SQLFunctionCtx *pCtx, SSDa
static SSDataBlock* doTimeEvery(void* param, bool* newgroup) { static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
SOperatorInfo* pOperator = (SOperatorInfo*) param; SOperatorInfo* pOperator = (SOperatorInfo*) param;
STableEveryOperatorInfo* pEveryInfo = pOperator->info; STimeEveryOperatorInfo* pEveryInfo = pOperator->info;
SQueryRuntimeEnv* pRuntimeEnv = pOperator->pRuntimeEnv; SQueryRuntimeEnv* pRuntimeEnv = pOperator->pRuntimeEnv;
SOptrBasicInfo *pInfo = &pEveryInfo->binfo; SOptrBasicInfo *pInfo = &pEveryInfo->binfo;
...@@ -6178,7 +6302,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) { ...@@ -6178,7 +6302,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, pBlock->info.rows); updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, pBlock->info.rows);
doTimeEveryImpl(pOperator, pInfo->pCtx, pBlock, *newgroup); doTimeEveryImpl(pOperator, pInfo->pCtx, pBlock, *newgroup);
if (pEveryInfo->groupDone) { if (pEveryInfo->groupDone && pOperator->upstream[0]->notify) {
qDebug("5"); qDebug("5");
pOperator->upstream[0]->notify(pOperator->upstream[0], OPTION_SWITCH_TABLE); pOperator->upstream[0]->notify(pOperator->upstream[0], OPTION_SWITCH_TABLE);
...@@ -6195,7 +6319,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) { ...@@ -6195,7 +6319,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
} }
} }
while(1) { while(!pEveryInfo->allDone) {
bool prevVal = *newgroup; bool prevVal = *newgroup;
// The upstream exec may change the value of the newgroup, so use a local variable instead. // The upstream exec may change the value of the newgroup, so use a local variable instead.
...@@ -6273,6 +6397,11 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) { ...@@ -6273,6 +6397,11 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
STableQueryInfo* pTableQueryInfo = pRuntimeEnv->current; STableQueryInfo* pTableQueryInfo = pRuntimeEnv->current;
if (pEveryInfo->groupDone && pTableQueryInfo->groupIndex == pEveryInfo->lastGroupIdx) {
assert(pOperator->upstream[0]->notify == NULL);
continue;
}
// todo dynamic set tags // todo dynamic set tags
if (pTableQueryInfo != NULL) { if (pTableQueryInfo != NULL) {
setTagValue(pOperator, pTableQueryInfo->pTable, pInfo->pCtx, pOperator->numOfOutput); setTagValue(pOperator, pTableQueryInfo->pTable, pInfo->pCtx, pOperator->numOfOutput);
...@@ -6286,7 +6415,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) { ...@@ -6286,7 +6415,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
pEveryInfo->groupDone = false; pEveryInfo->groupDone = false;
doTimeEveryImpl(pOperator, pInfo->pCtx, pBlock, *newgroup); doTimeEveryImpl(pOperator, pInfo->pCtx, pBlock, *newgroup);
if (pEveryInfo->groupDone) { if (pEveryInfo->groupDone && pOperator->upstream[0]->notify) {
qDebug("21"); qDebug("21");
pOperator->upstream[0]->notify(pOperator->upstream[0], OPTION_SWITCH_TABLE); pOperator->upstream[0]->notify(pOperator->upstream[0], OPTION_SWITCH_TABLE);
...@@ -6837,6 +6966,13 @@ static void destroyProjectOperatorInfo(void* param, int32_t numOfOutput) { ...@@ -6837,6 +6966,13 @@ static void destroyProjectOperatorInfo(void* param, int32_t numOfOutput) {
doDestroyBasicInfo(&pInfo->binfo, numOfOutput); doDestroyBasicInfo(&pInfo->binfo, numOfOutput);
} }
static void destroyTimeEveryOperatorInfo(void* param, int32_t numOfOutput) {
STimeEveryOperatorInfo* pInfo = (STimeEveryOperatorInfo*) param;
doDestroyBasicInfo(&pInfo->binfo, numOfOutput);
taosHashCleanup(pInfo->rangeStart);
}
static void destroyTagScanOperatorInfo(void* param, int32_t numOfOutput) { static void destroyTagScanOperatorInfo(void* param, int32_t numOfOutput) {
STagScanInfo* pInfo = (STagScanInfo*) param; STagScanInfo* pInfo = (STagScanInfo*) param;
pInfo->pRes = destroyOutputBuf(pInfo->pRes); pInfo->pRes = destroyOutputBuf(pInfo->pRes);
...@@ -7014,16 +7150,22 @@ SOperatorInfo* createTimeIntervalOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOp ...@@ -7014,16 +7150,22 @@ SOperatorInfo* createTimeIntervalOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOp
SOperatorInfo* createTimeEveryOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, int32_t numOfOutput) { SOperatorInfo* createTimeEveryOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, int32_t numOfOutput) {
STableEveryOperatorInfo* pInfo = calloc(1, sizeof(STableEveryOperatorInfo)); STimeEveryOperatorInfo* pInfo = calloc(1, sizeof(STimeEveryOperatorInfo));
SQueryAttr* pQueryAttr = pRuntimeEnv->pQueryAttr;
pInfo->seed = rand(); pInfo->seed = rand();
pInfo->bufCapacity = pRuntimeEnv->resultInfo.capacity; pInfo->bufCapacity = pRuntimeEnv->resultInfo.capacity;
pInfo->groupDone = true; pInfo->groupDone = true;
pInfo->lastGroupIdx = -1;
SOptrBasicInfo* pBInfo = &pInfo->binfo; SOptrBasicInfo* pBInfo = &pInfo->binfo;
pBInfo->pRes = createOutputBuf(pExpr, numOfOutput, pInfo->bufCapacity); pBInfo->pRes = createOutputBuf(pExpr, numOfOutput, pInfo->bufCapacity);
pBInfo->pCtx = createSQLFunctionCtx(pRuntimeEnv, pExpr, numOfOutput, &pBInfo->rowCellInfoOffset); pBInfo->pCtx = createSQLFunctionCtx(pRuntimeEnv, pExpr, numOfOutput, &pBInfo->rowCellInfoOffset);
if (pQueryAttr->needReverseScan) {
pInfo->rangeStart = taosHashInit(256, taosGetDefaultHashFunction(TSDB_DATA_TYPE_TIMESTAMP), false, false);
}
initResultRowInfo(&pBInfo->resultRowInfo, 8, TSDB_DATA_TYPE_INT); initResultRowInfo(&pBInfo->resultRowInfo, 8, TSDB_DATA_TYPE_INT);
setDefaultOutputBuf(pRuntimeEnv, pBInfo, pInfo->seed, MASTER_SCAN); setDefaultOutputBuf(pRuntimeEnv, pBInfo, pInfo->seed, MASTER_SCAN);
...@@ -7038,7 +7180,7 @@ SOperatorInfo* createTimeEveryOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOpera ...@@ -7038,7 +7180,7 @@ SOperatorInfo* createTimeEveryOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOpera
pOperator->pRuntimeEnv = pRuntimeEnv; pOperator->pRuntimeEnv = pRuntimeEnv;
pOperator->exec = doTimeEvery; pOperator->exec = doTimeEvery;
pOperator->cleanup = destroyProjectOperatorInfo; pOperator->cleanup = destroyTimeEveryOperatorInfo;
appendUpstream(pOperator, upstream); appendUpstream(pOperator, upstream);
return pOperator; return pOperator;
......
...@@ -538,9 +538,9 @@ SArray* createTableScanPlan(SQueryAttr* pQueryAttr) { ...@@ -538,9 +538,9 @@ SArray* createTableScanPlan(SQueryAttr* pQueryAttr) {
} else { } else {
if (pQueryAttr->queryBlockDist) { if (pQueryAttr->queryBlockDist) {
op = OP_TableBlockInfoScan; op = OP_TableBlockInfoScan;
} else if (pQueryAttr->tsCompQuery || pQueryAttr->pointInterpQuery || pQueryAttr->diffQuery) { } else if (pQueryAttr->tsCompQuery || pQueryAttr->diffQuery) {
op = OP_TableSeqScan; op = OP_TableSeqScan;
} else if (pQueryAttr->needReverseScan) { } else if (pQueryAttr->needReverseScan || pQueryAttr->pointInterpQuery) {
op = OP_DataBlocksOptScan; op = OP_DataBlocksOptScan;
} else { } else {
op = OP_TableScan; op = OP_TableScan;
......
...@@ -272,8 +272,10 @@ bool qTableQuery(qinfo_t qinfo, uint64_t *qId) { ...@@ -272,8 +272,10 @@ bool qTableQuery(qinfo_t qinfo, uint64_t *qId) {
} }
*qId = pQInfo->qId; *qId = pQInfo->qId;
if(pQInfo->startExecTs == 0) if(pQInfo->startExecTs == 0) {
pQInfo->startExecTs = taosGetTimestampMs(); pQInfo->startExecTs = taosGetTimestampMs();
pQInfo->lastRetrieveTs = pQInfo->startExecTs;
}
if (isQueryKilled(pQInfo)) { if (isQueryKilled(pQInfo)) {
qDebug("QInfo:0x%"PRIx64" it is already killed, abort", pQInfo->qId); 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 ...@@ -412,6 +414,9 @@ int32_t qDumpRetrieveResult(qinfo_t qinfo, SRetrieveTableRsp **pRsp, int32_t *co
setQueryStatus(pRuntimeEnv, QUERY_OVER); setQueryStatus(pRuntimeEnv, QUERY_OVER);
} }
RESET_NUM_OF_RESULTS(&(pQInfo->runtimeEnv));
pQInfo->lastRetrieveTs = taosGetTimestampMs();
if ((*pRsp)->compressed && compLen != 0) { if ((*pRsp)->compressed && compLen != 0) {
int32_t numOfCols = pQueryAttr->pExpr2 ? pQueryAttr->numOfExpr2 : pQueryAttr->numOfOutput; int32_t numOfCols = pQueryAttr->pExpr2 ? pQueryAttr->numOfExpr2 : pQueryAttr->numOfOutput;
int32_t origSize = pQueryAttr->resultRowSize * s; int32_t origSize = pQueryAttr->resultRowSize * s;
......
...@@ -130,7 +130,7 @@ run general/parser/limit2.sim ...@@ -130,7 +130,7 @@ run general/parser/limit2.sim
run general/parser/slimit.sim run general/parser/slimit.sim
run general/parser/fill.sim run general/parser/fill.sim
run general/parser/fill_stb.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/where.sim
run general/parser/join.sim run general/parser/join.sim
run general/parser/join_multivnode.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, ...@@ -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_test1.sim
run general/parser/interp_full_test2.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 #print ================== restart server to commit data into disk
#system sh/exec.sh -n dnode1 -s stop -x SIGINT #system sh/exec.sh -n dnode1 -s stop -x SIGINT
......
...@@ -26,6 +26,16 @@ sql_error SELECT avg(c1) FROM tb1 every(1s); ...@@ -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 avg(c1) FROM tb1 range(0,1);
sql_error SELECT INTERP(c1) FROM tb1 STATE_WINDOW(c1); 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 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; sql SELECT INTERP(c1) FROM tb1;
if $rows != 1 then if $rows != 1 then
......
...@@ -1082,7 +1082,7 @@ if $data51 != 15 then ...@@ -1082,7 +1082,7 @@ if $data51 != 15 then
endi 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); 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 return -1
endi endi
if $data00 != @21-10-20 10:00:10.000@ then if $data00 != @21-10-20 10:00:10.000@ then
...@@ -1548,19 +1548,813 @@ if $rows != 0 then ...@@ -1548,19 +1548,813 @@ if $rows != 0 then
return -1 return -1
endi 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 where ts > '2021-10-20 10:00:03' ORDER BY ts DESC;
#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; 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 SELECT INTERP(c1),interp(c2),interp(c3) FROM tb1 every(1s) ORDER BY ts DESC;
#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; 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),ts FROM tb1 every(1s) ORDER BY ts DESC;
#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; if $rows != 7 then
\ No newline at end of file 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
sleep 100
sql connect
sql use db;
sql SELECT tbname,INTERP(c1),t1,interp(c2),t2,interp(c3) FROM stb1 every(4s) group by tbname ORDER BY ts DESC;
if $rows != 5 then
return -1
endi
if $data00 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data01 != tb1 then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 1 then
return -1
endi
if $data04 != 0.00000 then
return -1
endi
if $data05 != 1 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != tb1 then
return -1
endi
if $data30 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data31 != tb2 then
return -1
endi
if $data32 != 0 then
return -1
endi
if $data33 != 2 then
return -1
endi
if $data34 != 0.00000 then
return -1
endi
if $data35 != 2 then
return -1
endi
if $data36 != 0 then
return -1
endi
if $data37 != tb2 then
return -1
endi
if $data20 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data21 != tb2 then
return -1
endi
if $data22 != 4 then
return -1
endi
if $data23 != 2 then
return -1
endi
if $data24 != 4.00000 then
return -1
endi
if $data25 != 2 then
return -1
endi
if $data26 != 4 then
return -1
endi
if $data27 != tb2 then
return -1
endi
if $data10 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data11 != tb2 then
return -1
endi
if $data12 != 12 then
return -1
endi
if $data13 != 2 then
return -1
endi
if $data14 != 12.00000 then
return -1
endi
if $data15 != 2 then
return -1
endi
if $data16 != 12 then
return -1
endi
if $data17 != tb2 then
return -1
endi
if $data40 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data41 != tb3 then
return -1
endi
if $data42 != 0 then
return -1
endi
if $data43 != 3 then
return -1
endi
if $data44 != 0.00000 then
return -1
endi
if $data45 != 3 then
return -1
endi
if $data46 != 0 then
return -1
endi
if $data47 != tb3 then
return -1
endi
sql SELECT INTERP(c1) FROM stb1 range('2021-10-20 10:00:00.000','2021-10-20 10:00:40.000') every(1s) fill(linear) group by tbname ORDER BY ts DESC;
if $rows != 59 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:20.000@ then
return -1
endi
if $data11 != 20 then
return -1
endi
if $data12 != tb1 then
return -1
endi
if $data20 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data21 != 19 then
return -1
endi
if $data22 != tb1 then
return -1
endi
if $data30 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data31 != 18 then
return -1
endi
if $data32 != tb1 then
return -1
endi
if $data40 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data41 != 17 then
return -1
endi
if $data42 != tb1 then
return -1
endi
if $data50 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data51 != 16 then
return -1
endi
if $data52 != tb1 then
return -1
endi
if $data60 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data61 != 15 then
return -1
endi
if $data62 != 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 != tb1 then
return -1
endi
if $data80 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data81 != 13 then
return -1
endi
if $data82 != tb1 then
return -1
endi
if $data90 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data91 != 12 then
return -1
endi
if $data92 != tb1 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 14:00:00') 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 INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 FILL(LINEAR) 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 INTERP(c1) FROM tb1 FILL(NEXT) 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 INTERP(c1) FROM tb1 FILL(PREV) 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 INTERP(c1) FROM tb1 FILL(VALUE, 100) 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 INTERP(c1) FROM tb1 FILL(NULL) 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 INTERP(c1) 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 $data50 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data51 != 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 $data30 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data31 != 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 $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 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
sql SELECT INTERP(c1) FROM tb1 every(2s) ORDER BY ts DESC;
if $rows != 3 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 $data10 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data11 != 6 then
return -1
endi
if $data00 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data01 != 10 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 every(5s) ORDER BY ts DESC;
if $rows != 3 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 $data10 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data11 != 10 then
return -1
endi
if $data00 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data01 != 15 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 every(100s) 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 INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') FILL(LINEAR) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') FILL(LINEAR) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 10:00:00') FILL(LINEAR) 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 INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') FILL(LINEAR) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data01 != 4 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') FILL(LINEAR) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') FILL(NEXT) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 09:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') FILL(NEXT) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 09:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 12:00:00') FILL(NEXT) 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 INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') FILL(NEXT) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data01 != 6 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') FILL(NEXT) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') FILL(PREV) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') FILL(PREV) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 12:00:00') FILL(PREV) 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 INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') FILL(PREV) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data01 != 3 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') FILL(PREV) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 11:00:00.000@ then
return -1
endi
if $data01 != 21 then
return -1
endi
sql SELECT INTERP(c2) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') FILL(VALUE,100) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 09:00:00.000@ then
return -1
endi
if $data01 != 100.00000 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') FILL(VALUE,100) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 09:00:00.000@ then
return -1
endi
if $data01 != 100 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 12:00:00') FILL(VALUE,100) 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 INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') FILL(VALUE,100) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data01 != 100 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') FILL(VALUE,100) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 11:00:00.000@ then
return -1
endi
if $data01 != 100 then
return -1
endi
sql SELECT INTERP(c2) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') FILL(NULL) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 09:00:00.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
sql SELECT INTERP(c2) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') FILL(NULL) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 09:00:00.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
sql SELECT INTERP(c2) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 12:00:00') FILL(NULL) 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.00000 then
return -1
endi
sql SELECT INTERP(c2) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') FILL(NULL) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
sql SELECT INTERP(c2) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') FILL(NULL) ORDER BY ts DESC;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 11:00:00.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') 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 $data50 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data51 != 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 $data30 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data31 != 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 $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 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
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') EVERY(1s) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 10:00:00') EVERY(1s) 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 INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') EVERY(1s) ORDER BY ts DESC;
if $rows != 4 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 $data20 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data21 != 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 $data00 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data01 != 21 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') EVERY(1s) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') EVERY(2s) ORDER BY ts DESC;
if $rows != 3 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 $data10 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data11 != 6 then
return -1
endi
if $data00 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data01 != 10 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') EVERY(2s) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 10:00:00') EVERY(2s) 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 INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') EVERY(2s) ORDER BY ts DESC;
if $rows != 2 then
return -1
endi
if $data10 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data11 != 6 then
return -1
endi
if $data00 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data01 != 10 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') EVERY(2s) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(1s) FILL(LINEAR) ORDER BY ts DESC;
if $rows != 22 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 $data10 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data11 != 20 then
return -1
endi
if $data20 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data21 != 19 then
return -1
endi
if $data80 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data81 != 13 then
return -1
endi
if $data90 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data91 != 12 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(1s) FILL(NEXT) ORDER BY ts DESC;
if $rows != 22 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 $data10 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data11 != 21 then
return -1
endi
if $data20 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data21 != 21 then
return -1
endi
if $data30 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data31 != 21 then
return -1
endi
if $data40 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data41 != 21 then
return -1
endi
if $data50 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data51 != 21 then
return -1
endi
if $data60 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data61 != 15 then
return -1
endi
if $data70 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data71 != 15 then
return -1
endi
if $data80 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data81 != 15 then
return -1
endi
if $data90 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data91 != 15 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(1s) FILL(NEXT) ORDER BY ts DESC limit 10 offset 10;
if $rows != 10 then
return -1
endi
if $data00 != @21-10-20 10:00:11.000@ then
return -1
endi
if $data01 != 15 then
return -1
endi
if $data10 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data11 != 10 then
return -1
endi
if $data20 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data30 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data31 != 10 then
return -1
endi
if $data40 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data41 != 10 then
return -1
endi
if $data50 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data51 != 6 then
return -1
endi
if $data60 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data61 != 6 then
return -1
endi
if $data70 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data71 != 6 then
return -1
endi
if $data80 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data81 != 3 then
return -1
endi
if $data90 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data91 != 3 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(1s) FILL(PREV) ORDER BY ts DESC;
if $rows != 22 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 $data10 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data20 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data21 != 15 then
return -1
endi
if $data30 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data31 != 15 then
return -1
endi
if $data40 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data41 != 15 then
return -1
endi
if $data50 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data51 != 15 then
return -1
endi
if $data60 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data61 != 15 then
return -1
endi
if $data70 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data71 != 10 then
return -1
endi
if $data80 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data81 != 10 then
return -1
endi
if $data90 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data91 != 10 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(1s) FILL(PREV) ORDER BY ts DESC limit 10 offset 10;
if $rows != 10 then
return -1
endi
if $data00 != @21-10-20 10:00:11.000@ then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data10 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data11 != 10 then
return -1
endi
if $data20 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data21 != 6 then
return -1
endi
if $data30 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data40 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data41 != 6 then
return -1
endi
if $data50 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data51 != 6 then
return -1
endi
if $data60 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data70 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data71 != 3 then
return -1
endi
if $data80 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data81 != 3 then
return -1
endi
if $data90 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data91 != 1 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(1s) FILL(PREV) ORDER BY ts DESC limit 10 offset 20;
if $rows != 2 then
return -1
endi
if $data00 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data10 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data11 != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(1s) FILL(VALUE,100) ORDER BY ts DESC;
if $rows != 22 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 $data10 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data11 != 100 then
return -1
endi
if $data20 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data21 != 100 then
return -1
endi
if $data30 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data31 != 100 then
return -1
endi
if $data40 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data41 != 100 then
return -1
endi
if $data50 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data51 != 100 then
return -1
endi
if $data60 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data61 != 15 then
return -1
endi
if $data70 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data71 != 100 then
return -1
endi
if $data80 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data81 != 100 then
return -1
endi
if $data90 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data91 != 100 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(1s) FILL(NULL) ORDER BY ts DESC;
if $rows != 22 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 $data10 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data11 != NULL then
return -1
endi
if $data20 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data21 != NULL then
return -1
endi
if $data30 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data31 != NULL then
return -1
endi
if $data40 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data41 != NULL then
return -1
endi
if $data50 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data51 != NULL then
return -1
endi
if $data60 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data61 != 15 then
return -1
endi
if $data70 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data71 != NULL then
return -1
endi
if $data80 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data81 != NULL then
return -1
endi
if $data90 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data91 != NULL then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(5s) FILL(LINEAR) ORDER BY ts DESC;
if $rows != 5 then
return -1
endi
if $data40 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data41 != 0 then
return -1
endi
if $data30 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data31 != 5 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 $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data00 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data01 != 20 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(5s) FILL(NEXT) ORDER BY ts DESC;
if $rows != 5 then
return -1
endi
if $data40 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data41 != 0 then
return -1
endi
if $data30 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data31 != 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 $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data00 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data01 != 21 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(5s) FILL(PREV) ORDER BY ts DESC;
if $rows != 5 then
return -1
endi
if $data40 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data41 != 0 then
return -1
endi
if $data30 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data31 != 3 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 $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data00 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data01 != 15 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(5s) FILL(VALUE,100) ORDER BY ts DESC;
if $rows != 5 then
return -1
endi
if $data40 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data41 != 0 then
return -1
endi
if $data30 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data31 != 100 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 $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data00 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data01 != 100 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 EVERY(5s) FILL(NULL) ORDER BY ts DESC;
if $rows != 5 then
return -1
endi
if $data40 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data41 != 0 then
return -1
endi
if $data30 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data31 != NULL 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 $data10 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data00 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(LINEAR) ORDER BY ts DESC;
if $rows != 22 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 $data10 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data11 != 20 then
return -1
endi
if $data20 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data21 != 19 then
return -1
endi
if $data30 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data31 != 18 then
return -1
endi
if $data40 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data41 != 17 then
return -1
endi
if $data50 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data51 != 16 then
return -1
endi
if $data60 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data61 != 15 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 $data80 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data81 != 13 then
return -1
endi
if $data90 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data91 != 12 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(LINEAR) ORDER BY ts DESC limit 20 offset 10;
if $rows != 12 then
return -1
endi
if $data00 != @21-10-20 10:00:11.000@ then
return -1
endi
if $data01 != 11 then
return -1
endi
if $data10 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data11 != 10 then
return -1
endi
if $data20 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data21 != 9 then
return -1
endi
if $data30 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data31 != 8 then
return -1
endi
if $data40 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data41 != 7 then
return -1
endi
if $data50 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data51 != 6 then
return -1
endi
if $data60 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data61 != 5 then
return -1
endi
if $data70 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data71 != 4 then
return -1
endi
if $data80 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data81 != 3 then
return -1
endi
if $data90 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data91 != 2 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') EVERY(1s) FILL(LINEAR) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 10:00:00') EVERY(1s) FILL(LINEAR) 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 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;
if $rows != 18 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 $data10 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data11 != 20 then
return -1
endi
if $data20 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data21 != 19 then
return -1
endi
if $data30 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data31 != 18 then
return -1
endi
if $data40 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data41 != 17 then
return -1
endi
if $data50 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data51 != 16 then
return -1
endi
if $data60 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data61 != 15 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 $data80 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data81 != 13 then
return -1
endi
if $data90 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data91 != 12 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(LINEAR) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(NEXT) ORDER BY ts DESC;
if $rows != 3622 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 $data10 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data11 != 21 then
return -1
endi
if $data20 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data21 != 21 then
return -1
endi
if $data30 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data31 != 21 then
return -1
endi
if $data40 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data41 != 21 then
return -1
endi
if $data50 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data51 != 21 then
return -1
endi
if $data60 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data61 != 15 then
return -1
endi
if $data70 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data71 != 15 then
return -1
endi
if $data80 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data81 != 15 then
return -1
endi
if $data90 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data91 != 15 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(NEXT) ORDER BY ts DESC limit 20 offset 10 ;
if $rows != 20 then
return -1
endi
if $data00 != @21-10-20 10:00:11.000@ then
return -1
endi
if $data01 != 15 then
return -1
endi
if $data10 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data11 != 10 then
return -1
endi
if $data20 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data30 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data31 != 10 then
return -1
endi
if $data40 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data41 != 10 then
return -1
endi
if $data50 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data51 != 6 then
return -1
endi
if $data60 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data61 != 6 then
return -1
endi
if $data70 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data71 != 6 then
return -1
endi
if $data80 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data81 != 3 then
return -1
endi
if $data90 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data91 != 3 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(NEXT) ORDER BY ts DESC limit 20 offset 20 ;
if $rows != 20 then
return -1
endi
if $data00 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data01 != 1 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 $data20 != @21-10-20 09:59:59.000@ then
return -1
endi
if $data21 != 0 then
return -1
endi
if $data30 != @21-10-20 09:59:58.000@ then
return -1
endi
if $data31 != 0 then
return -1
endi
if $data40 != @21-10-20 09:59:57.000@ then
return -1
endi
if $data41 != 0 then
return -1
endi
if $data50 != @21-10-20 09:59:56.000@ then
return -1
endi
if $data51 != 0 then
return -1
endi
if $data60 != @21-10-20 09:59:55.000@ then
return -1
endi
if $data61 != 0 then
return -1
endi
if $data70 != @21-10-20 09:59:54.000@ then
return -1
endi
if $data71 != 0 then
return -1
endi
if $data80 != @21-10-20 09:59:53.000@ then
return -1
endi
if $data81 != 0 then
return -1
endi
if $data90 != @21-10-20 09:59:52.000@ then
return -1
endi
if $data91 != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') EVERY(1s) FILL(NEXT) ORDER BY ts DESC;
if $rows != 2 then
return -1
endi
if $data00 != @21-10-20 09:00:01.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data10 != @21-10-20 09:00:00.000@ then
return -1
endi
if $data11 != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 10:00:00') EVERY(1s) FILL(NEXT) 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 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;
if $rows != 18 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 $data10 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data11 != 21 then
return -1
endi
if $data20 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data21 != 21 then
return -1
endi
if $data30 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data31 != 21 then
return -1
endi
if $data40 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data41 != 21 then
return -1
endi
if $data50 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data51 != 21 then
return -1
endi
if $data60 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data61 != 15 then
return -1
endi
if $data70 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data71 != 15 then
return -1
endi
if $data80 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data81 != 15 then
return -1
endi
if $data90 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data91 != 15 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(NEXT) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(PREV) ORDER BY ts DESC;
if $rows != 14401 then
return -1
endi
if $data00 != @21-10-20 14:00:00.000@ then
return -1
endi
if $data01 != 21 then
return -1
endi
if $data10 != @21-10-20 13:59:59.000@ then
return -1
endi
if $data11 != 21 then
return -1
endi
if $data20 != @21-10-20 13:59:58.000@ then
return -1
endi
if $data21 != 21 then
return -1
endi
if $data30 != @21-10-20 13:59:57.000@ then
return -1
endi
if $data31 != 21 then
return -1
endi
if $data40 != @21-10-20 13:59:56.000@ then
return -1
endi
if $data41 != 21 then
return -1
endi
if $data50 != @21-10-20 13:59:55.000@ then
return -1
endi
if $data51 != 21 then
return -1
endi
if $data60 != @21-10-20 13:59:54.000@ then
return -1
endi
if $data61 != 21 then
return -1
endi
if $data70 != @21-10-20 13:59:53.000@ then
return -1
endi
if $data71 != 21 then
return -1
endi
if $data80 != @21-10-20 13:59:52.000@ then
return -1
endi
if $data81 != 21 then
return -1
endi
if $data90 != @21-10-20 13:59:51.000@ then
return -1
endi
if $data91 != 21 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(PREV) ORDER BY ts DESC limit 30 offset 14379;
if $rows != 22 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 $data10 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data11 != 15 then
return -1
endi
if $data20 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data21 != 15 then
return -1
endi
if $data30 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data31 != 15 then
return -1
endi
if $data40 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data41 != 15 then
return -1
endi
if $data50 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data51 != 15 then
return -1
endi
if $data60 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data61 != 15 then
return -1
endi
if $data70 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data71 != 10 then
return -1
endi
if $data80 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data81 != 10 then
return -1
endi
if $data90 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data91 != 10 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') EVERY(1s) FILL(PREV) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 10:00:00') EVERY(1s) FILL(PREV) 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 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;
if $rows != 14397 then
return -1
endi
if $data00 != @21-10-20 14:00:00.000@ then
return -1
endi
if $data01 != 21 then
return -1
endi
if $data10 != @21-10-20 13:59:59.000@ then
return -1
endi
if $data11 != 21 then
return -1
endi
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 limit 20 offset 14387;
if $rows != 10 then
return -1
endi
if $data00 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data10 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data11 != 10 then
return -1
endi
if $data20 != @21-10-20 10:00:11.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data30 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data31 != 10 then
return -1
endi
if $data40 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data41 != 6 then
return -1
endi
if $data50 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data51 != 6 then
return -1
endi
if $data60 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data61 != 6 then
return -1
endi
if $data70 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data71 != 6 then
return -1
endi
if $data80 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data81 != 3 then
return -1
endi
if $data90 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data91 != 3 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(PREV);
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(VALUE,100);
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(VALUE,100) limit 20 offset 3600;
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') EVERY(1s) FILL(VALUE,100);
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 10:00:00') EVERY(1s) FILL(VALUE,100);
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') EVERY(1s) FILL(VALUE,100);
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(VALUE,100);
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(NULL);
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(NULL) limit 20 offset 3600;
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 09:00:00','2021-10-20 09:00:01') EVERY(1s) FILL(NULL);
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:00','2021-10-20 10:00:00') EVERY(1s) FILL(NULL);
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:04','2021-10-20 14:00:00') EVERY(1s) FILL(NULL);
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 11:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(NULL);
sql SELECT INTERP(c1) FROM tb1 RANGE('2021-10-20 10:00:03.500','2021-10-20 14:00:00') EVERY(1s) FILL(LINEAR);
sql SELECT INTERP(c2) FROM tb1 RANGE('2021-10-20 10:00:03.500','2021-10-20 14:00:00') EVERY(1s) FILL(LINEAR);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:15' RANGE('2021-10-20 10:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(LINEAR);
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);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:15' RANGE('2021-10-20 10:00:00','2021-10-20 14:00:00') EVERY(1s) FILL(NEXT);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:15' RANGE('2021-10-20 09:00:00','2021-10-20 09:00:10') EVERY(1s) FILL(LINEAR);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:20' RANGE('2021-10-20 10:00:05','2021-10-20 10:00:16') EVERY(1s) FILL(LINEAR);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:20' RANGE('2021-10-20 10:00:15','2021-10-20 10:00:25') EVERY(1s) FILL(LINEAR);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:20' RANGE('2021-10-20 10:00:21','2021-10-20 10:00:30') EVERY(1s) FILL(LINEAR);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:15' RANGE('2021-10-20 09:00:00','2021-10-20 09:00:10') EVERY(1s) FILL(PREV);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:20' RANGE('2021-10-20 10:00:05','2021-10-20 10:00:16') EVERY(1s) FILL(PREV);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:20' RANGE('2021-10-20 10:00:15','2021-10-20 10:00:25') EVERY(1s) FILL(PREV);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:20' RANGE('2021-10-20 10:00:21','2021-10-20 10:00:30') EVERY(1s) FILL(PREV);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:15' RANGE('2021-10-20 09:00:00','2021-10-20 09:00:10') EVERY(1s) FILL(NEXT);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:20' RANGE('2021-10-20 10:00:05','2021-10-20 10:00:16') EVERY(1s) FILL(NEXT);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:20' RANGE('2021-10-20 10:00:15','2021-10-20 10:00:25') EVERY(1s) FILL(NEXT);
sql SELECT INTERP(c1) FROM tb1 WHERE ts BETWEEN '2021-10-20 10:00:10' AND '2021-10-20 10:00:20' RANGE('2021-10-20 10:00:21','2021-10-20 10:00:30') EVERY(1s) FILL(NEXT);
sql SELECT INTERP(c2) FROM tb4 RANGE('2021-10-20 10:00:00','2021-10-20 12:00:00') FILL(NULL) ORDER BY ts DESC;
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(NULL) ORDER BY ts DESC;
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) ORDER BY ts DESC;
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) ORDER BY ts DESC;
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) ORDER BY ts DESC;
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) ORDER BY ts DESC;
if $rows != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM stb1 RANGE('2021-10-20 10:00:00','2021-10-20 10:00:30') EVERY(1s) FILL(LINEAR) GROUP BY TBNAME ORDER BY TBNAME desc;
if $rows != 59 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 != tb3 then
return -1
endi
if $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data12 != tb3 then
return -1
endi
if $data20 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data21 != 2 then
return -1
endi
if $data22 != tb3 then
return -1
endi
if $data30 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data31 != 3 then
return -1
endi
if $data32 != tb3 then
return -1
endi
if $data40 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data41 != 4 then
return -1
endi
if $data42 != tb3 then
return -1
endi
if $data50 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data51 != 5 then
return -1
endi
if $data52 != tb3 then
return -1
endi
if $data60 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data61 != 6 then
return -1
endi
if $data62 != tb3 then
return -1
endi
if $data70 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data71 != 7 then
return -1
endi
if $data72 != tb3 then
return -1
endi
if $data80 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data81 != 8 then
return -1
endi
if $data82 != tb3 then
return -1
endi
if $data90 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data91 != 9 then
return -1
endi
if $data92 != tb3 then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts;
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 interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30');
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 interp(c1) from tb1,tb2 where tb1.ts=tb2.ts every(1s);
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 $data10 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data11 != 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
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts fill(linear);
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 interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') fill(next);
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 interp(c1) from tb1,tb2 where tb1.ts=tb2.ts every(1s) fill(prev);
if $rows != 11 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 $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != 0 then
return -1
endi
if $data20 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data21 != 0 then
return -1
endi
if $data30 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data31 != 0 then
return -1
endi
if $data40 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data41 != 0 then
return -1
endi
if $data50 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data51 != 0 then
return -1
endi
if $data60 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data61 != 6 then
return -1
endi
if $data70 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data71 != 6 then
return -1
endi
if $data80 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data81 != 6 then
return -1
endi
if $data90 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data91 != 6 then
return -1
endi
sleep 100
sql connect
sql use db;
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts every(1s) fill(prev) order by ts desc;
if $rows != 11 then
return -1
endi
if $data00 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data10 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data11 != 6 then
return -1
endi
if $data20 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data21 != 6 then
return -1
endi
if $data30 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data40 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data41 != 6 then
return -1
endi
if $data50 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data51 != 0 then
return -1
endi
if $data60 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data61 != 0 then
return -1
endi
if $data70 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data71 != 0 then
return -1
endi
if $data80 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data81 != 0 then
return -1
endi
if $data90 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data91 != 0 then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s);
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 $data10 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data11 != 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
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(linear);
if $rows != 11 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 $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data20 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data21 != 2 then
return -1
endi
if $data30 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data31 != 3 then
return -1
endi
if $data40 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data41 != 4 then
return -1
endi
if $data50 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data51 != 5 then
return -1
endi
if $data60 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data61 != 6 then
return -1
endi
if $data70 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data71 != 7 then
return -1
endi
if $data80 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data81 != 8 then
return -1
endi
if $data90 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data91 != 9 then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(linear) order by ts desc;
if $rows != 11 then
return -1
endi
if $data00 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data10 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data11 != 9 then
return -1
endi
if $data20 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data21 != 8 then
return -1
endi
if $data30 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data31 != 7 then
return -1
endi
if $data40 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data41 != 6 then
return -1
endi
if $data50 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data51 != 5 then
return -1
endi
if $data60 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data61 != 4 then
return -1
endi
if $data70 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data71 != 3 then
return -1
endi
if $data80 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data81 != 2 then
return -1
endi
if $data90 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data91 != 1 then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(prev);
if $rows != 31 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 $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != 0 then
return -1
endi
if $data20 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data21 != 0 then
return -1
endi
if $data30 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data31 != 0 then
return -1
endi
if $data40 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data41 != 0 then
return -1
endi
if $data50 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data51 != 0 then
return -1
endi
if $data60 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data61 != 6 then
return -1
endi
if $data70 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data71 != 6 then
return -1
endi
if $data80 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data81 != 6 then
return -1
endi
if $data90 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data91 != 6 then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(prev) limit 30 offset 10;
if $rows != 21 then
return -1
endi
if $data00 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data10 != @21-10-20 10:00:11.000@ then
return -1
endi
if $data11 != 10 then
return -1
endi
if $data20 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data30 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data31 != 10 then
return -1
endi
if $data40 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data41 != 10 then
return -1
endi
if $data50 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data51 != 10 then
return -1
endi
if $data60 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data61 != 10 then
return -1
endi
if $data70 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data71 != 10 then
return -1
endi
if $data80 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data81 != 10 then
return -1
endi
if $data90 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data91 != 10 then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(prev) order by ts desc;
if $rows != 31 then
return -1
endi
if $data00 != @21-10-20 10:00:30.000@ then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data10 != @21-10-20 10:00:29.000@ then
return -1
endi
if $data11 != 10 then
return -1
endi
if $data20 != @21-10-20 10:00:28.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data30 != @21-10-20 10:00:27.000@ then
return -1
endi
if $data31 != 10 then
return -1
endi
if $data40 != @21-10-20 10:00:26.000@ then
return -1
endi
if $data41 != 10 then
return -1
endi
if $data50 != @21-10-20 10:00:25.000@ then
return -1
endi
if $data51 != 10 then
return -1
endi
if $data60 != @21-10-20 10:00:24.000@ then
return -1
endi
if $data61 != 10 then
return -1
endi
if $data70 != @21-10-20 10:00:23.000@ then
return -1
endi
if $data71 != 10 then
return -1
endi
if $data80 != @21-10-20 10:00:22.000@ then
return -1
endi
if $data81 != 10 then
return -1
endi
if $data90 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data91 != 10 then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(prev) order by ts desc limit 10 offset 21;
if $rows != 10 then
return -1
endi
if $data00 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data01 != 6 then
return -1
endi
if $data10 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data11 != 6 then
return -1
endi
if $data20 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data21 != 6 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 $data40 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data41 != 0 then
return -1
endi
if $data50 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data51 != 0 then
return -1
endi
if $data60 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data61 != 0 then
return -1
endi
if $data70 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data71 != 0 then
return -1
endi
if $data80 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data81 != 0 then
return -1
endi
if $data90 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data91 != 0 then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(next);
if $rows != 11 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 $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != 6 then
return -1
endi
if $data20 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data21 != 6 then
return -1
endi
if $data30 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data40 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data41 != 6 then
return -1
endi
if $data50 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data51 != 6 then
return -1
endi
if $data60 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data61 != 6 then
return -1
endi
if $data70 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data71 != 10 then
return -1
endi
if $data80 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data81 != 10 then
return -1
endi
if $data90 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data91 != 10 then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(next) order by ts desc;
if $rows != 11 then
return -1
endi
if $data00 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data10 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data11 != 10 then
return -1
endi
if $data20 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data30 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data31 != 10 then
return -1
endi
if $data40 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data41 != 6 then
return -1
endi
if $data50 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data51 != 6 then
return -1
endi
if $data60 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data61 != 6 then
return -1
endi
if $data70 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data71 != 6 then
return -1
endi
if $data80 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data81 != 6 then
return -1
endi
if $data90 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data91 != 6 then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(NULL);
if $rows != 31 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 $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != NULL then
return -1
endi
if $data20 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data21 != NULL then
return -1
endi
if $data30 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data31 != NULL then
return -1
endi
if $data40 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data41 != NULL then
return -1
endi
if $data50 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data51 != NULL then
return -1
endi
if $data60 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data61 != 6 then
return -1
endi
if $data70 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data71 != NULL then
return -1
endi
if $data80 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data81 != NULL then
return -1
endi
if $data90 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data91 != NULL then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(NULL) order by ts desc;
if $rows != 31 then
return -1
endi
if $data00 != @21-10-20 10:00:30.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-10-20 10:00:29.000@ then
return -1
endi
if $data11 != NULL then
return -1
endi
if $data20 != @21-10-20 10:00:28.000@ then
return -1
endi
if $data21 != NULL then
return -1
endi
if $data30 != @21-10-20 10:00:27.000@ then
return -1
endi
if $data31 != NULL then
return -1
endi
if $data40 != @21-10-20 10:00:26.000@ then
return -1
endi
if $data41 != NULL then
return -1
endi
if $data50 != @21-10-20 10:00:25.000@ then
return -1
endi
if $data51 != NULL then
return -1
endi
if $data60 != @21-10-20 10:00:24.000@ then
return -1
endi
if $data61 != NULL then
return -1
endi
if $data70 != @21-10-20 10:00:23.000@ then
return -1
endi
if $data71 != NULL then
return -1
endi
if $data80 != @21-10-20 10:00:22.000@ then
return -1
endi
if $data81 != NULL then
return -1
endi
if $data90 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data91 != NULL then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(NULL) order by ts desc limit 10 offset 21;
if $rows != 10 then
return -1
endi
if $data00 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data11 != NULL then
return -1
endi
if $data20 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data21 != NULL 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 $data40 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data41 != NULL then
return -1
endi
if $data50 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data51 != NULL then
return -1
endi
if $data60 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data61 != NULL then
return -1
endi
if $data70 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data71 != NULL then
return -1
endi
if $data80 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data81 != NULL then
return -1
endi
if $data90 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data91 != 0 then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(VALUE,100);
if $rows != 31 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 $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != 100 then
return -1
endi
if $data20 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data21 != 100 then
return -1
endi
if $data30 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data31 != 100 then
return -1
endi
if $data40 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data41 != 100 then
return -1
endi
if $data50 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data51 != 100 then
return -1
endi
if $data60 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data61 != 6 then
return -1
endi
if $data70 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data71 != 100 then
return -1
endi
if $data80 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data81 != 100 then
return -1
endi
if $data90 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data91 != 100 then
return -1
endi
sql select interp(c1) from tb1,tb2 where tb1.ts=tb2.ts range('2021-10-20 10:00:00','2021-10-20 10:00:30') every(1s) fill(VALUE,100) order by ts desc limit 20 offset 20;
if $rows != 11 then
return -1
endi
if $data00 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data10 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data11 != 100 then
return -1
endi
if $data20 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data21 != 100 then
return -1
endi
if $data30 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data31 != 100 then
return -1
endi
if $data40 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data41 != 6 then
return -1
endi
if $data50 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data51 != 100 then
return -1
endi
if $data60 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data61 != 100 then
return -1
endi
if $data70 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data71 != 100 then
return -1
endi
if $data80 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data81 != 100 then
return -1
endi
if $data90 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data91 != 100 then
return -1
endi
sql select interp(c1) from (select ts,c1 from tb1);
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 interp(c1) from (select ts,c1 from tb1 order by ts);
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 interp(a) from (select sum(c1) as a from stb1 interval(1s));
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 interp(a) from (select top(c1,3) as a from tb1 order by ts) every(1s) fill(prev);
if $rows != 12 then
return -1
endi
if $data00 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data10 != @21-10-20 10:00:11.000@ then
return -1
endi
if $data11 != 10 then
return -1
endi
if $data20 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data30 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data31 != 10 then
return -1
endi
if $data40 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data41 != 10 then
return -1
endi
if $data50 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data51 != 15 then
return -1
endi
if $data60 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data61 != 15 then
return -1
endi
if $data70 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data71 != 15 then
return -1
endi
if $data80 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data81 != 15 then
return -1
endi
if $data90 != @21-10-20 10:00:19.000@ then
return -1
endi
if $data91 != 15 then
return -1
endi
sql select interp(a) from (select max(c1) as a from tb1 interval(6s)) every(1s) fill(next);
if $rows != 19 then
return -1
endi
if $data00 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data01 != 3 then
return -1
endi
if $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != 10 then
return -1
endi
if $data20 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data21 != 10 then
return -1
endi
if $data30 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data31 != 10 then
return -1
endi
if $data40 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data41 != 10 then
return -1
endi
if $data50 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data51 != 10 then
return -1
endi
if $data60 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data61 != 10 then
return -1
endi
if $data70 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data71 != 15 then
return -1
endi
if $data80 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data81 != 15 then
return -1
endi
if $data90 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data91 != 15 then
return -1
endi
sql select interp(a) from (select diff(c2) as a from tb1) every(1s) fill(linear);
if $rows != 21 then
return -1
endi
if $data00 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data01 != 1.00000 then
return -1
endi
if $data10 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data11 != 1.50000 then
return -1
endi
if $data20 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data21 != 2.00000 then
return -1
endi
if $data30 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data31 != 2.33333 then
return -1
endi
if $data40 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data41 != 2.66667 then
return -1
endi
if $data50 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data51 != 3.00000 then
return -1
endi
if $data60 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data61 != 3.25000 then
return -1
endi
if $data70 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data71 != 3.50000 then
return -1
endi
if $data80 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data81 != 3.75000 then
return -1
endi
if $data90 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data91 != 4.00000 then
return -1
endi
sql select interp(a) from (select sum(c2) as a from stb1 interval(6s)) RANGE('2021-10-20 10:00:05.000','2021-10-20 10:00:20.000') every(1s) fill(linear);
if $rows != 14 then
return -1
endi
if $data00 != @21-10-20 10:00:05.000@ then
return -1
endi
if $data01 != 42.166666667 then
return -1
endi
if $data10 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data11 != 48.000000000 then
return -1
endi
if $data20 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data21 != 46.833333333 then
return -1
endi
if $data30 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data31 != 45.666666667 then
return -1
endi
if $data40 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data41 != 44.500000000 then
return -1
endi
if $data50 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data51 != 43.333333333 then
return -1
endi
if $data60 != @21-10-20 10:00:11.000@ then
return -1
endi
if $data61 != 42.166666667 then
return -1
endi
if $data70 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data71 != 41.000000000 then
return -1
endi
if $data80 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data81 != 44.166666667 then
return -1
endi
if $data90 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data91 != 47.333333333 then
return -1
endi
sql select interp(a) from (select interp(c1) b,interp(c2) a from tb1 where ts < '2021-10-20 10:00:15.000' range('2021-10-20 10:00:05.000','2021-10-20 10:00:20.000') every(3s) fill(prev)) where ts between '2021-10-20 10:00:06.000' and '2021-10-20 10:00:18.000' range('2021-10-20 10:00:00.000','2021-10-20 10:00:25.000') every(1s) fill(linear);
if $rows != 10 then
return -1
endi
if $data00 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data01 != 6.00000 then
return -1
endi
if $data10 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data11 != 7.33333 then
return -1
endi
if $data20 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data21 != 8.66667 then
return -1
endi
if $data30 != @21-10-20 10:00:11.000@ then
return -1
endi
if $data31 != 10.00000 then
return -1
endi
if $data40 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data41 != 10.00000 then
return -1
endi
if $data50 != @21-10-20 10:00:13.000@ then
return -1
endi
if $data51 != 10.00000 then
return -1
endi
if $data60 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data61 != 10.00000 then
return -1
endi
if $data70 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data71 != 10.00000 then
return -1
endi
if $data80 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data81 != 10.00000 then
return -1
endi
if $data90 != @21-10-20 10:00:17.000@ then
return -1
endi
if $data91 != 10.00000 then
return -1
endi
sql select interp(a) from (select interp(c4) a from tb1,tb4_0 where tb1.ts=tb4_0.ts every(3s) fill(linear)) every(4s) fill(prev);
if $rows != 6 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 $data10 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data11 != 3 then
return -1
endi
if $data20 != @21-10-20 10:00:08.000@ then
return -1
endi
if $data21 != 6 then
return -1
endi
if $data30 != @21-10-20 10:00:12.000@ then
return -1
endi
if $data31 != 12 then
return -1
endi
if $data40 != @21-10-20 10:00:16.000@ then
return -1
endi
if $data41 != 15 then
return -1
endi
if $data50 != @21-10-20 10:00:20.000@ then
return -1
endi
if $data51 != 18 then
return -1
endi
sql select interp(c4) from tb1 every(7s) fill(linear) union all select interp(c4) from tb4_0 every(33s) fill(prev);
if $rows != 13 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 $data10 != @21-10-20 10:00:07.000@ then
return -1
endi
if $data11 != 7 then
return -1
endi
if $data20 != @21-10-20 10:00:14.000@ then
return -1
endi
if $data21 != 14 then
return -1
endi
if $data30 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data31 != 21 then
return -1
endi
if $data40 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data41 != 0 then
return -1
endi
if $data50 != @21-10-20 10:00:33.000@ then
return -1
endi
if $data51 != 28 then
return -1
endi
if $data60 != @21-10-20 10:01:06.000@ then
return -1
endi
if $data61 != 6 then
return -1
endi
if $data70 != @21-10-20 10:01:39.000@ then
return -1
endi
if $data71 != 36 then
return -1
endi
if $data80 != @21-10-20 10:02:12.000@ then
return -1
endi
if $data81 != 10 then
return -1
endi
if $data90 != @21-10-20 10:02:45.000@ then
return -1
endi
if $data91 != 45 then
return -1
endi
sql select interp(c3) from tb4_0 every(3s) fill(linear);
if $rows != 99 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 $data10 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data11 != 3 then
return -1
endi
if $data20 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data21 != 6 then
return -1
endi
if $data30 != @21-10-20 10:00:09.000@ then
return -1
endi
if $data31 != 9 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 $data50 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data51 != 15 then
return -1
endi
if $data60 != @21-10-20 10:00:18.000@ then
return -1
endi
if $data61 != 18 then
return -1
endi
if $data70 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data71 != 21 then
return -1
endi
if $data80 != @21-10-20 10:00:24.000@ then
return -1
endi
if $data81 != 24 then
return -1
endi
if $data90 != @21-10-20 10:00:27.000@ then
return -1
endi
if $data91 != 27 then
return -1
endi
sql select interp(c3) from tb4_0 every(5s) fill(linear) order by ts desc;
if $rows != 60 then
return -1
endi
sql select interp(c3) from tb4_0 where ts > '2021-10-20 10:04:15.000' and ts < '2021-10-20 10:04:55.000' every(5s) fill(linear) order by ts desc;
if $rows != 5 then
return -1
endi
if $data00 != @21-10-20 10:04:41.000@ then
return -1
endi
if $data01 != 41 then
return -1
endi
if $data10 != @21-10-20 10:04:36.000@ then
return -1
endi
if $data11 != 36 then
return -1
endi
if $data20 != @21-10-20 10:04:31.000@ then
return -1
endi
if $data21 != 31 then
return -1
endi
if $data30 != @21-10-20 10:04:26.000@ then
return -1
endi
if $data31 != 26 then
return -1
endi
if $data40 != @21-10-20 10:04:21.000@ then
return -1
endi
if $data41 != 21 then
return -1
endi
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 ========== intp_test.sim
$i = 0
$db = $dbPrefix . $i
$stb = $stbPrefix . $i
$tsu = $rowNum * $delta
$tsu = $tsu - $delta
$tsu = $tsu + $ts0
print ====== use db
sql use $db
##### select interp from table
print ====== select intp from table
$tb = $tbPrefix . 0
## interp(*) from tb
sql select interp(*) from $tb where ts = $ts0
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0 then
return -1
endi
## interp + limit offset
sql select interp(*) from $tb where ts = $ts0 limit 5 offset 1
if $rows != 0 then
return -1
endi
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 0.00000 then
return -1
endi
if $data04 != 0.000000000 then
return -1
endi
if $data05 != 0 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 1 then
return -1
endi
if $data08 != binary0 then
return -1
endi
if $data09 != nchar0 then
return -1
endi
## intp + aggregation functions
$t = $ts0 + $delta
$t = $t + $delta
sql_error select interp(ts), max(c1), min(c2), count(c3), sum(c4), avg(c5), stddev(c6), first(c7), last(c8), interp(c9) from $tb where ts = $t
sql_error select interp(ts) from $tb where ts=$ts0 interval(1s)
### illegal queries on a table
sql_error select interp(ts), c1 from $tb where ts = $ts0
sql_error select interp(ts) from $tb where ts >= $ts0
sql_error select interp(ts), max(c1), min(c2), count(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(NULL)
### interp from tb + fill
$t = $ts0 + 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t
if $rows != 0 then
return -1
endi
## fill(none)
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none)
if $rows != 0 then
return -1
endi
$t = $tsu + 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none)
if $rows != 0 then
return -1
endi
## fill(NULL)
$t = $tsu - 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, NULL) order by ts asc
if $rows != 1 then
return -1
endi
if $data00 != @18-11-25 19:29:59.000@ then
return -1
endi
if $data01 != NULL then
print expect NULL, actual $data01
return -1
endi
if $data02 != NULL then
return -1
endi
if $data03 != NULL then
return -1
endi
if $data04 != NULL then
return -1
endi
if $data05 != NULL then
return -1
endi
if $data06 != NULL then
return -1
endi
if $data07 != NULL then
return -1
endi
if $data08 != NULL then
return -1
endi
if $data09 != NULL then
return -1
endi
$t = $tsu + 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none)
if $rows != 0 then
return -1
endi
## fill(prev)
$t = $ts0 + 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev)
if $rows != 1 then
return -1
endi
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(prev)
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 0.00000 then
return -1
endi
if $data04 != 0.000000000 then
return -1
endi
if $data05 != 0 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 1 then
return -1
endi
if $data08 != binary0 then
return -1
endi
if $data09 != nchar0 then
return -1
endi
$t = $ts0 - 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev)
if $rows != 0 then
return -1
endi
$t = $ts0 + 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $t fill(prev)
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:01.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != NULL then
return -1
endi
if $data03 != 0.00000 then
print expect 0.00000, actual:$data03
return -1
endi
# if $data04 != NULL then
# return -1
# endi
$t = $tsu + 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev)
if $rows != 0 then
return -1
endi
## fill(linear)
$t = $ts0 + 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear)
print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:01.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0 then
return -1
endi
print $data03
if $data03 != 0.00167 then
return -1
endi
if $data04 != 0.001666667 then
return -1
endi
if $data05 != 0 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != NULL then
return -1
endi
if $data08 != NULL then
return -1
endi
if $data09 != NULL then
return -1
endi
# columns contain NULL values
$t = $ts0 + 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $t fill(linear)
print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:01.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != NULL then
return -1
endi
if $data03 != 0.00167 then
return -1
endi
if $data04 != NULL then
return -1
endi
if $data05 != 0 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != NULL then
return -1
endi
if $data08 != NULL then
return -1
endi
if $data09 != NULL then
return -1
endi
print select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(linear)
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(linear)
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 0.00000 then
return -1
endi
if $data04 != 0.000000000 then
return -1
endi
if $data05 != 0 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 1 then
return -1
endi
if $data08 != binary0 then
return -1
endi
if $data09 != nchar0 then
return -1
endi
# columns contain NULL values
print select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(linear)
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(linear)
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != NULL then
return -1
endi
if $data03 != 0.00000 then
return -1
endi
if $data04 != NULL then
return -1
endi
if $data05 != 0 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 1 then
return -1
endi
if $data08 != binary0 then
return -1
endi
if $data09 != nchar0 then
return -1
endi
$t = $ts0 - 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear)
if $rows != 0 then
return -1
endi
$t = $tsu + 1000
print select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear)
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear)
if $rows != 0 then
return -1
endi
## fill(value)
$t = $ts0 + 1000
print 91
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2)
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:01.000@ then
return -1
endi
if $data01 != -2 then
return -1
endi
if $data02 != -2 then
return -1
endi
if $data03 != -2.00000 then
return -1
endi
if $data04 != -2.000000000 then
return -1
endi
if $data05 != -2 then
return -1
endi
if $data06 != -2 then
return -1
endi
if $data07 != 1 then
return -1
endi
if $data08 != NULL then
return -1
endi
if $data09 != NULL then
return -1
endi
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(value, -1, -2, -3)
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 0.00000 then
return -1
endi
if $data04 != 0.000000000 then
return -1
endi
if $data05 != 0 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 1 then
return -1
endi
if $data08 != binary0 then
return -1
endi
if $data09 != nchar0 then
return -1
endi
# table has NULL columns
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(value, -1, -2, -3)
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != NULL then
return -1
endi
if $data03 != 0.00000 then
return -1
endi
if $data04 != NULL then
return -1
endi
$t = $ts0 - 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2)
if $rows != 0 then
return -1
endi
$t = $tsu + 1000
sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2)
if $rows != 0 then
return -1
endi
### select interp from stable
## interp(*) from stb
print select interp(*) from $stb where ts = $ts0
sql select interp(*) from $stb where ts = $ts0
if $rows != 1 then
return -1
endi
$t = $ts0 + 1000
print 92
sql select interp(*) from $stb where ts = $t
if $rows != 0 then
return -1
endi
## interp(*) from stb + group by
sql select interp(ts, c1, c2, c3, c4, c5, c7, c9) from $stb where ts = $ts0 group by tbname order by tbname asc
print ====== select interp(ts, c1, c2, c3, c4, c5, c7, c9) from $stb where ts = $ts0 group by tbname order by tbname asc
print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09
print ====== 0:$data20, 1:$data21, 2:$data22, 3:$data23, 4:$data24, 5:$data25, 6:$data26, 7:$data27, 8:$data28, 9:$data29
if $rows != $tbNum then
return -1
endi
if $data00 != @18-09-17 09:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data04 != 0.000000000 then
return -1
endi
if $data08 != intp_tb0 then
return -1
endi
if $data22 != NULL then
return -1
endi
if $data24 != NULL then
return -1
endi
if $data28 != intp_tb2 then
return -1
endi
## interp(*) from stb + group by + limit offset
sql select interp(*) from $stb where ts = $ts0 group by tbname limit 0
if $rows != 0 then
return -1
endi
sql select interp(*) from $stb where ts = $ts0 group by tbname limit 0 offset 1
## interp(*) from stb + group by + fill(none)
$t = $ts0 + 1000
sql select interp(*) from $stb where ts = $t fill(none) group by tbname
if $rows != 0 then
return -1
endi
sql select interp(*) from $stb where ts = $ts0 fill(none) group by tbname
if $rows != 4 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data21 != 0 then
return -1
endi
if $data22 != NULL then
return -1
endi
if $data24 != NULL then
return -1
endi
## interp(*) from stb + group by + fill(none)
$t = $ts0 + 1000
sql select interp(*) from $stb where ts = $t fill(NULL) group by tbname
if $rows != $tbNum then
return -1
endi
if $data00 != @18-09-17 09:00:01.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data12 != NULL then
return -1
endi
if $data23 != NULL then
return -1
endi
if $data34 != NULL then
return -1
endi
if $data05 != NULL then
return -1
endi
if $data16 != NULL then
return -1
endi
if $data27 != NULL then
return -1
endi
if $data38 != NULL then
return -1
endi
if $data09 != NULL then
return -1
endi
sql select interp(*) from $stb where ts = $ts0 fill(NULL) group by tbname
print $rows
if $rows != 4 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data21 != 0 then
return -1
endi
if $data22 != NULL then
return -1
endi
if $data24 != NULL then
return -1
endi
## interp(*) from stb + group by + fill(prev)
$t = $ts0 + 1000
sql select interp(*) from $stb where ts = $t fill(prev) group by tbname
print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09
print ====== 0:$data20, 1:$data21, 2:$data22, 3:$data23, 4:$data24, 5:$data25, 6:$data26, 7:$data27, 8:$data28, 9:$data29
if $rows != $tbNum then
return -1
endi
if $data00 != @18-09-17 09:00:01.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 0.00000 then
return -1
endi
if $data04 != 0.000000000 then
return -1
endi
if $data05 != 0 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != 1 then
return -1
endi
if $data08 != binary0 then
return -1
endi
if $data09 != nchar0 then
return -1
endi
if $data20 != @18-09-17 09:00:01.000@ then
return -1
endi
if $data21 != 0 then
return -1
endi
if $data22 != NULL then
return -1
endi
if $data23 != 0.00000 then
return -1
endi
if $data24 != NULL then
return -1
endi
if $data25 != 0 then
return -1
endi
if $data26 != 0 then
return -1
endi
if $data27 != 1 then
return -1
endi
if $data28 != binary0 then
return -1
endi
if $data29 != nchar0 then
return -1
endi
## interp(*) from stb + group by + fill(linear)
$t = $ts0 + 1000
sql select interp(*) from $stb where ts = $t fill(linear) group by tbname
print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09
print ====== 0:$data20, 1:$data21, 2:$data22, 3:$data23, 4:$data24, 5:$data25, 6:$data26, 7:$data27, 8:$data28, 9:$data29
if $rows != $tbNum then
return -1
endi
if $data00 != @18-09-17 09:00:01.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 0.00167 then
return -1
endi
if $data04 != 0.001666667 then
return -1
endi
if $data05 != 0 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data07 != NULL then
return -1
endi
if $data08 != NULL then
return -1
endi
if $data09 != NULL then
return -1
endi
if $data20 != @18-09-17 09:00:01.000@ then
return -1
endi
if $data21 != 0 then
return -1
endi
if $data22 != NULL then
return -1
endi
if $data23 != 0.00167 then
return -1
endi
if $data24 != NULL then
return -1
endi
if $data25 != 0 then
return -1
endi
if $data26 != 0 then
return -1
endi
if $data27 != NULL then
return -1
endi
if $data28 != NULL then
return -1
endi
if $data29 != NULL then
return -1
endi
## interp(*) from stb + group by + fill(value)
$t = $ts0 + 1000
sql select interp(*) from $stb where ts = $t fill(value, -1, -2) group by tbname
print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09
print ====== 0:$data20, 1:$data21, 2:$data22, 3:$data23, 4:$data24, 5:$data25, 6:$data26, 7:$data27, 8:$data28, 9:$data29
if $rows != $tbNum then
return -1
endi
if $data00 != @18-09-17 09:00:01.000@ then
return -1
endi
if $data01 != -2 then
return -1
endi
if $data02 != -2 then
return -1
endi
if $data03 != -2.00000 then
return -1
endi
if $data04 != -2.000000000 then
return -1
endi
if $data05 != -2 then
return -1
endi
if $data06 != -2 then
return -1
endi
if $data07 != 1 then
return -1
endi
if $data08 != NULL then
return -1
endi
if $data09 != NULL then
return -1
endi
if $data20 != @18-09-17 09:00:01.000@ then
return -1
endi
if $data21 != -2 then
return -1
endi
if $data22 != -2 then
return -1
endi
if $data23 != -2.00000 then
return -1
endi
if $data24 != -2.000000000 then
return -1
endi
if $data25 != -2 then
return -1
endi
if $data26 != -2 then
return -1
endi
if $data27 != 1 then
return -1
endi
if $data28 != NULL then
return -1
endi
if $data29 != NULL then
return -1
endi
sql_error select interp(ts,c1) from intp_tb0 where ts>'2018-11-25 19:19:00' and ts<'2018-11-25 19:19:12';
sql select interp(ts,c1) from intp_tb0 where ts>'2018-11-25 19:19:00' and ts<'2018-11-25 19:19:12' every(1s) fill(linear);
if $rows != 0 then
return -1
endi
sql select interp(c1) from intp_tb0 where ts>'2018-11-25 18:09:00' and ts<'2018-11-25 19:20:12' every(18m);
if $rows != 1 then
return -1
endi
if $data00 != @18-11-25 18:30:00.000@ then
return -1
endi
if $data01 != 3 then
return -1
endi
sql select interp(c1,c3,c4,ts) from intp_tb0 where ts>'2018-11-25 18:09:00' and ts<'2018-11-25 19:20:12' every(18m) fill(linear)
if $rows != 5 then
return -1
endi
if $data00 != @18-11-25 17:54:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0.00000 then
return -1
endi
if $data03 != 0.000000000 then
return -1
endi
if $data04 != @18-11-25 17:54:00.000@ then
return -1
endi
if $data10 != @18-11-25 18:12:00.000@ then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data12 != 1.20000 then
return -1
endi
if $data13 != 1.200000000 then
return -1
endi
if $data14 != @18-11-25 18:12:00.000@ then
return -1
endi
if $data40 != @18-11-25 19:06:00.000@ then
return -1
endi
if $data41 != 6 then
return -1
endi
if $data42 != 6.60000 then
return -1
endi
if $data43 != 6.600000000 then
return -1
endi
if $data44 != @18-11-25 19:06:00.000@ then
return -1
endi
sql select interp(c1) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:42:00.000' every(1m) fill(linear);
if $rows != 8 then
return -1
endi
if $data00 != @18-09-17 20:35:00.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @18-09-17 20:36:00.000@ then
return -1
endi
if $data11 != NULL then
return -1
endi
if $data20 != @18-09-17 20:37:00.000@ then
return -1
endi
if $data21 != NULL then
return -1
endi
if $data30 != @18-09-17 20:38:00.000@ then
return -1
endi
if $data31 != NULL then
return -1
endi
if $data40 != @18-09-17 20:39:00.000@ then
return -1
endi
if $data41 != NULL then
return -1
endi
if $data50 != @18-09-17 20:40:00.000@ then
return -1
endi
if $data51 != 0 then
return -1
endi
if $data60 != @18-09-17 20:41:00.000@ then
return -1
endi
if $data61 != NULL then
return -1
endi
if $data70 != @18-09-17 20:42:00.000@ then
return -1
endi
if $data71 != NULL then
return -1
endi
sql select interp(c1) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:42:00.000' every(1m) fill(linear) order by ts desc;
if $rows != 8 then
return -1
endi
if $data00 != @18-09-17 20:42:00.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @18-09-17 20:41:00.000@ then
return -1
endi
if $data11 != NULL then
return -1
endi
if $data20 != @18-09-17 20:40:00.000@ then
return -1
endi
if $data21 != 0 then
return -1
endi
if $data30 != @18-09-17 20:39:00.000@ then
return -1
endi
if $data31 != NULL then
return -1
endi
if $data40 != @18-09-17 20:38:00.000@ then
return -1
endi
if $data41 != NULL then
return -1
endi
if $data50 != @18-09-17 20:37:00.000@ then
return -1
endi
if $data51 != NULL then
return -1
endi
if $data60 != @18-09-17 20:36:00.000@ then
return -1
endi
if $data61 != NULL then
return -1
endi
if $data70 != @18-09-17 20:35:00.000@ then
return -1
endi
if $data71 != NULL then
return -1
endi
sql select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' every(2m) fill(linear) order by ts;
if $rows != 9 then
return -1
endi
if $data00 != @18-09-17 20:34:00.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @18-09-17 20:36:00.000@ then
return -1
endi
if $data11 != NULL then
return -1
endi
if $data20 != @18-09-17 20:38:00.000@ then
return -1
endi
if $data21 != NULL then
return -1
endi
if $data30 != @18-09-17 20:40:00.000@ then
return -1
endi
if $data31 != 0.00000 then
return -1
endi
if $data40 != @18-09-17 20:42:00.000@ then
return -1
endi
if $data41 != 0.20000 then
return -1
endi
if $data50 != @18-09-17 20:44:00.000@ then
return -1
endi
if $data51 != 0.40000 then
return -1
endi
if $data60 != @18-09-17 20:46:00.000@ then
return -1
endi
if $data61 != 0.60000 then
return -1
endi
if $data70 != @18-09-17 20:48:00.000@ then
return -1
endi
if $data71 != 0.80000 then
return -1
endi
if $data80 != @18-09-17 20:50:00.000@ then
return -1
endi
if $data81 != 1.00000 then
return -1
endi
sql select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' every(3m) fill(linear) order by ts;
if $rows != 6 then
return -1
endi
if $data00 != @18-09-17 20:33:00.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @18-09-17 20:36:00.000@ then
return -1
endi
if $data11 != NULL then
return -1
endi
if $data20 != @18-09-17 20:39:00.000@ then
return -1
endi
if $data21 != NULL then
return -1
endi
if $data30 != @18-09-17 20:42:00.000@ then
return -1
endi
if $data31 != 0.20000 then
return -1
endi
if $data40 != @18-09-17 20:45:00.000@ then
return -1
endi
if $data41 != 0.50000 then
return -1
endi
if $data50 != @18-09-17 20:48:00.000@ then
return -1
endi
if $data51 != 0.80000 then
return -1
endi
sql select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' every(3m) fill(linear) order by ts desc;
if $rows != 6 then
return -1
endi
if $data00 != @18-09-17 20:48:00.000@ then
return -1
endi
if $data01 != 0.80000 then
return -1
endi
if $data10 != @18-09-17 20:45:00.000@ then
return -1
endi
if $data11 != 0.50000 then
return -1
endi
if $data20 != @18-09-17 20:42:00.000@ then
return -1
endi
if $data21 != 0.20000 then
return -1
endi
if $data30 != @18-09-17 20:39:00.000@ then
return -1
endi
if $data31 != NULL then
return -1
endi
if $data40 != @18-09-17 20:36:00.000@ then
return -1
endi
if $data41 != NULL then
return -1
endi
if $data50 != @18-09-17 20:33:00.000@ then
return -1
endi
if $data51 != NULL then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(linear);
if $rows != 6 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.31818 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.77273 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 4.50000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 7.50000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 9.87500 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(value, 1);
if $rows != 6 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != 1.00000 then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 1.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 1.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 1.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 1.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 1.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(NULL);
if $rows != 6 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != NULL then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != NULL then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != NULL then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != NULL then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != NULL then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(prev);
if $rows != 6 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 4.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 7.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 9.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(next);
if $rows != 6 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != 1.00000 then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 4.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 4.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 5.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 8.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 10.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' every(1s) fill(linear);
if $rows != 0 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' every(1s) fill(prev);
if $rows != 2 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' every(1s) fill(next);
if $rows != 2 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != 1.00000 then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != NULL then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' every(1s) fill(linear);
if $rows != 3 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.31818 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.77273 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' every(1s) fill(prev);
if $rows != 3 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' every(1s) fill(next);
if $rows != 3 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != 1.00000 then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 4.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 4.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' every(1s) fill(linear);
if $rows != 10 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.31818 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.77273 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 4.50000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 7.50000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 9.87500 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != NULL then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != NULL then
return -1
endi
if $data80 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data81 != NULL then
return -1
endi
if $data90 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data91 != NULL then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' every(1s) fill(prev);
if $rows != 10 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 4.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 7.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 9.00000 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 14.00000 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 14.00000 then
return -1
endi
if $data80 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data81 != 14.00000 then
return -1
endi
if $data90 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data91 != 14.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' every(1s) fill(next);
if $rows != 10 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != 1.00000 then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 4.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 4.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 5.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 8.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 10.00000 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != NULL then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != NULL then
return -1
endi
if $data80 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data81 != NULL then
return -1
endi
if $data90 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data91 != NULL then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' every(1s) fill(linear);
if $rows != 12 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.31818 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.77273 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 4.50000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 7.50000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 9.87500 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 14.11765 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 15.29412 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' every(1s) fill(prev);
if $rows != 12 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 4.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 7.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 9.00000 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 14.00000 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 14.00000 then
return -1
endi
if $data80 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data81 != 14.00000 then
return -1
endi
if $data90 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data91 != 14.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' every(1s) fill(next);
if $rows != 12 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != 1.00000 then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 4.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 4.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 5.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 8.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 10.00000 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 20.00000 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 20.00000 then
return -1
endi
if $data80 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data81 != 20.00000 then
return -1
endi
if $data90 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data91 != 20.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:20:02' and ts<='2021-07-25 02:20:05' every(1s) fill(value, 1);
if $rows != 4 then
return -1
endi
if $data00 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data01 != 1.00000 then
return -1
endi
if $data10 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data11 != 1.00000 then
return -1
endi
if $data20 != @21-07-25 02:20:04.000@ then
return -1
endi
if $data21 != 1.00000 then
return -1
endi
if $data30 != @21-07-25 02:20:05.000@ then
return -1
endi
if $data31 != 20.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:20:02' and ts<='2021-07-25 02:20:05' every(1s) fill(null);
if $rows != 4 then
return -1
endi
if $data00 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data11 != NULL then
return -1
endi
if $data20 != @21-07-25 02:20:04.000@ then
return -1
endi
if $data21 != NULL then
return -1
endi
if $data30 != @21-07-25 02:20:05.000@ then
return -1
endi
if $data31 != 20.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' every(1s) fill(linear);
if $rows != 32 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.31818 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.77273 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 4.50000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 7.50000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 9.87500 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 14.11765 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 15.29412 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' every(1s) fill(prev);
if $rows != 32 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 4.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 7.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 9.00000 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 14.00000 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 14.00000 then
return -1
endi
if $data80 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data81 != 14.00000 then
return -1
endi
if $data90 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data91 != 14.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' every(1s) fill(next);
if $rows != 32 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != 1.00000 then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 4.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 4.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 5.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 8.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 10.00000 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 20.00000 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 20.00000 then
return -1
endi
if $data80 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data81 != 20.00000 then
return -1
endi
if $data90 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data91 != 20.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' every(1s) fill(linear);
if $rows != 307 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.31818 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.77273 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 4.50000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 7.50000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 9.87500 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 14.11765 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 15.29412 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' every(1s) fill(prev);
if $rows != 307 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 4.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 7.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 9.00000 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 14.00000 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 14.00000 then
return -1
endi
if $data80 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data81 != 14.00000 then
return -1
endi
if $data90 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data91 != 14.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' every(1s) fill(next);
if $rows != 307 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != 1.00000 then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 4.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 4.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 5.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 8.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 10.00000 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 20.00000 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 20.00000 then
return -1
endi
if $data80 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data81 != 20.00000 then
return -1
endi
if $data90 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data91 != 20.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' every(1s) fill(linear);
if $rows != 3907 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.31818 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.77273 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 4.50000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 7.50000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 9.87500 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 14.11765 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 15.29412 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' every(1s) fill(prev);
if $rows != 3907 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 3.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 3.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 4.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 7.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 9.00000 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 14.00000 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 14.00000 then
return -1
endi
if $data80 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data81 != 14.00000 then
return -1
endi
if $data90 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data91 != 14.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' every(1s) fill(next);
if $rows != 3907 then
return -1
endi
if $data00 != @21-07-25 02:19:54.000@ then
return -1
endi
if $data01 != 1.00000 then
return -1
endi
if $data10 != @21-07-25 02:19:55.000@ then
return -1
endi
if $data11 != 4.00000 then
return -1
endi
if $data20 != @21-07-25 02:19:56.000@ then
return -1
endi
if $data21 != 4.00000 then
return -1
endi
if $data30 != @21-07-25 02:19:57.000@ then
return -1
endi
if $data31 != 5.00000 then
return -1
endi
if $data40 != @21-07-25 02:19:58.000@ then
return -1
endi
if $data41 != 8.00000 then
return -1
endi
if $data50 != @21-07-25 02:19:59.000@ then
return -1
endi
if $data51 != 10.00000 then
return -1
endi
if $data60 != @21-07-25 02:20:00.000@ then
return -1
endi
if $data61 != 20.00000 then
return -1
endi
if $data70 != @21-07-25 02:20:01.000@ then
return -1
endi
if $data71 != 20.00000 then
return -1
endi
if $data80 != @21-07-25 02:20:02.000@ then
return -1
endi
if $data81 != 20.00000 then
return -1
endi
if $data90 != @21-07-25 02:20:03.000@ then
return -1
endi
if $data91 != 20.00000 then
return -1
endi
sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:07' every(1s);
if $rows != 1 then
return -1
endi
if $data00 != @21-07-25 02:20:05.000@ then
return -1
endi
if $data01 != 20.00000 then
return -1
endi
...@@ -20,7 +20,7 @@ run general/parser/import_commit3.sim ...@@ -20,7 +20,7 @@ run general/parser/import_commit3.sim
run general/parser/import_file.sim run general/parser/import_file.sim
run general/parser/insert_tb.sim run general/parser/insert_tb.sim
run general/parser/tags_dynamically_specifiy.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/lastrow.sim
run general/parser/limit.sim run general/parser/limit.sim
run general/parser/limit1.sim run general/parser/limit1.sim
......
...@@ -75,7 +75,7 @@ cd ../../../debug; make ...@@ -75,7 +75,7 @@ cd ../../../debug; make
./test.sh -f general/parser/where.sim ./test.sh -f general/parser/where.sim
./test.sh -f general/parser/slimit.sim ./test.sh -f general/parser/slimit.sim
./test.sh -f general/parser/select_with_tags.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/tags_dynamically_specifiy.sim
./test.sh -f general/parser/groupby.sim ./test.sh -f general/parser/groupby.sim
./test.sh -f general/parser/set_tag_vals.sim ./test.sh -f general/parser/set_tag_vals.sim
......
...@@ -138,7 +138,7 @@ cd ../../../debug; make ...@@ -138,7 +138,7 @@ cd ../../../debug; make
./test.sh -f general/parser/where.sim ./test.sh -f general/parser/where.sim
./test.sh -f general/parser/slimit.sim ./test.sh -f general/parser/slimit.sim
./test.sh -f general/parser/select_with_tags.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/tags_dynamically_specifiy.sim
./test.sh -f general/parser/groupby.sim ./test.sh -f general/parser/groupby.sim
./test.sh -f general/parser/set_tag_vals.sim ./test.sh -f general/parser/set_tag_vals.sim
......
...@@ -143,7 +143,7 @@ wtest.bat -f general/parser/fill_stb.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/where.sim
wtest.bat -f general/parser/slimit.sim wtest.bat -f general/parser/slimit.sim
wtest.bat -f general/parser/select_with_tags.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/tags_dynamically_specifiy.sim
wtest.bat -f general/parser/groupby.sim wtest.bat -f general/parser/groupby.sim
wtest.bat -f general/parser/set_tag_vals.sim wtest.bat -f general/parser/set_tag_vals.sim
......
...@@ -129,7 +129,7 @@ run general/parser/limit2.sim ...@@ -129,7 +129,7 @@ run general/parser/limit2.sim
run general/parser/slimit.sim run general/parser/slimit.sim
run general/parser/fill.sim run general/parser/fill.sim
run general/parser/fill_stb.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/where.sim
run general/parser/join.sim run general/parser/join.sim
run general/parser/join_multivnode.sim run general/parser/join_multivnode.sim
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册