Merge pull request #28864 from taosdata/merge/mainto3.0

merge: from main to 3.0 branch
This commit is contained in:
Shengliang Guan 2024-11-22 13:37:43 +08:00 committed by GitHub
commit 6186efeca1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
58 changed files with 1699 additions and 117 deletions

5
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,5 @@
# Pull Request Checklist
- [ ] Is the user manual updated?
- [ ] Are the test cases passed and automated?
- [ ] Is there no significant decrease in test coverage?

View File

@ -355,7 +355,7 @@ def pre_test_build_win() {
bat '''
cd %WIN_COMMUNITY_ROOT%/tests/ci
pip3 install taospy==2.7.16
pip3 install taos-ws-py==0.3.3
pip3 install taos-ws-py==0.3.5
xcopy /e/y/i/f %WIN_INTERNAL_ROOT%\\debug\\build\\lib\\taos.dll C:\\Windows\\System32
'''
return 1

View File

@ -41,12 +41,18 @@ We recommend using the latest version of `taospy`, regardless of the version of
|Python Client Library Version|major changes|
|:-------------------:|:----:|
|2.7.16|add subscription configuration (session.timeout.ms, max.poll.interval.ms)|
|2.7.15|added support for VARBINARY and GEOMETRY types|
|2.7.14|fix known issues|
|2.7.13|add TMQ synchronous submission offset interface|
|2.7.12|1. added support for `varbinary` type (STMT does not yet support)<br/> 2. improved query performance (thanks to contributor [hadrianl](https://github.com/taosdata/taos-connector-python/pull/209))|
|2.7.9|support for getting assignment and seek function on subscription|
|2.7.8|add `execute_many` method|
|Python Websocket Connection Version|major changes|
|:----------------------------:|:-----:|
|0.3.5|1. added support for VARBINARY and GEOMETRY types <br/> 2. Fix known issues|
|0.3.2|1. optimize WebSocket SQL query and insertion performance <br/> 2. Fix known issues <br/> 3. Modify the readme and document|
|0.2.9|bugs fixes|
|0.2.5|1. support for getting assignment and seek function on subscription <br/> 2. support schemaless <br/> 3. support STMT|
|0.2.4|support `unsubscribe` on subscription|

View File

@ -27,6 +27,8 @@ Node.js client library needs to be run with Node.js 14 or higher version.
| Node.js connector version | major changes | TDengine 版本 |
| :-----------------------: | :------------------: | :----------------:|
| 3.1.2 | Optimized the data protocol and parsing, resulting in a significant improvement in performance | 3.2.0.0 or later |
| 3.1.1 | Optimized data transmission performance | 3.2.0.0 or later |
| 3.1.0 | new version, supports websocket | 3.2.0.0 or later |
## Supported features

View File

@ -898,4 +898,4 @@ lossyColumns float|double
| 53 | udf | Yes | Yes | |
| 54 | enableCoreFile | Yes | Yes | |
| 55 | ttlChangeOnWrite | No | Yes | |
| 56 | keepTimeOffset | Yes | Yes(discarded since 3.2.0.0) | |
| 56 | keepTimeOffset | Yes | Yes(discarded since 3.2.0.0) | see "KEEP_TIME_OFFSET" |

View File

@ -124,7 +124,7 @@ create stream if not exists count_history_s fill_history 1 into count_history as
窗口关闭是由事件时间决定的,如事件流中断、或持续延迟,此时事件时间无法更新,可能导致无法得到最新的计算结果。
因此,流计算提供了以事件时间结合处理时间计算的 MAX_DELAY 触发模式MAX_DELAY 模式在窗口关闭时会立即触发计算。此外,当数据写入后,计算触发的时间超过 max delay 指定的时间,则立即触发计算。
因此,流计算提供了以事件时间结合处理时间计算的 MAX_DELAY 触发模式MAX_DELAY 模式在窗口关闭时会立即触发计算它的单位可以自行指定具体单位a毫秒、s、m、h小时、d、w。此外,当数据写入后,计算触发的时间超过 MAX_DELAY 指定的时间,则立即触发计算。
### 流计算的窗口关闭

View File

@ -26,6 +26,7 @@ database_option: {
| MAXROWS value
| MINROWS value
| KEEP value
| KEEP_TIME_OFFSET value
| STT_TRIGGER value
| SINGLE_STABLE {0 | 1}
| TABLE_PREFIX value
@ -63,8 +64,8 @@ database_option: {
- DURATION数据文件存储数据的时间跨度。可以使用加单位的表示形式如 DURATION 100h、DURATION 10d 等,支持 m分钟、h小时和 d三个单位。不加时间单位时默认单位为天如 DURATION 50 表示 50 天。
- MAXROWS文件块中记录的最大条数默认为 4096 条。
- MINROWS文件块中记录的最小条数默认为 100 条。
- KEEP表示数据文件保存的天数缺省值为 3650取值范围 [1, 365000]且必须大于或等于3倍的 DURATION 参数值。数据库会自动删除保存时间超过 KEEP 值的数据。KEEP 可以使用加单位的表示形式,如 KEEP 100h、KEEP 10d 等,支持 m分钟、h小时和 d三个单位。也可以不写单位如 KEEP 50此时默认单位为天。企业版支持[多级存储](https://docs.taosdata.com/tdinternal/arch/#%E5%A4%9A%E7%BA%A7%E5%AD%98%E5%82%A8)功能, 因此, 可以设置多个保存时间(多个以英文逗号分隔,最多 3 个,满足 keep 0 \<= keep 1 \<= keep 2如 KEEP 100h,100d,3650d; 社区版不支持多级存储功能(即使配置了多个保存时间, 也不会生效, KEEP 会取最大的保存时间)。了解更多,请点击 [关于主键时间戳](https://docs.taosdata.com/reference/taos-sql/insert/#%E5%85%B3%E4%BA%8E%E4%B8%BB%E9%94%AE%E6%97%B6%E9%97%B4%E6%88%B3)
- KEEP表示数据文件保存的天数缺省值为 3650取值范围 [1, 365000],且必须大于或等于 3 倍的 DURATION 参数值。数据库会自动删除保存时间超过 KEEP 值的数据从而释放存储空间。KEEP 可以使用加单位的表示形式,如 KEEP 100h、KEEP 10d 等,支持 m分钟、h小时和 d三个单位。也可以不写单位如 KEEP 50此时默认单位为天。企业版支持[多级存储](https://docs.taosdata.com/tdinternal/arch/#%E5%A4%9A%E7%BA%A7%E5%AD%98%E5%82%A8)功能, 因此, 可以设置多个保存时间(多个以英文逗号分隔,最多 3 个,满足 keep 0 \<= keep 1 \<= keep 2如 KEEP 100h,100d,3650d; 社区版不支持多级存储功能(即使配置了多个保存时间, 也不会生效, KEEP 会取最大的保存时间)。了解更多,请点击 [关于主键时间戳](https://docs.taosdata.com/reference/taos-sql/insert/)
- KEEP_TIME_OFFSET自 3.2.0.0 版本生效。删除或迁移保存时间超过 KEEP 值的数据的延迟执行时间,默认值为 0 (小时)。在数据文件保存时间超过 KEEP 后,删除或迁移操作不会立即执行,而会额外等待本参数指定的时间间隔,以实现与业务高峰期错开的目的。
- STT_TRIGGER表示落盘文件触发文件合并的个数。开源版本固定为 1企业版本可设置范围为 1 到 16。对于少表高频写入场景此参数建议使用默认配置而对于多表低频写入场景此参数建议配置较大的值。
- SINGLE_STABLE表示此数据库中是否只可以创建一个超级表用于超级表列非常多的情况。
- 0表示可以创建多张超级表。

View File

@ -41,6 +41,7 @@ Python 连接器的源码托管在 [GitHub](https://github.com/taosdata/taos-con
|Python Connector 版本|主要变化|
|:-------------------:|:----:|
|2.7.16|新增订阅配置 (session.timeout.ms, max.poll.interval.ms)|
|2.7.15|新增 VARBINARY 和 GEOMETRY 类型支持|
|2.7.14|修复已知问题|
|2.7.13|新增 tmq 同步提交 offset 接口|
@ -50,6 +51,7 @@ Python 连接器的源码托管在 [GitHub](https://github.com/taosdata/taos-con
|Python WebSocket Connector 版本|主要变化|
|:----------------------------:|:-----:|
|0.3.5|新增 VARBINARY 和 GEOMETRY 类型支持,修复已知问题|
|0.3.2|优化 WebSocket sql 查询和插入性能,修改 readme 和 文档,修复已知问题|
|0.2.9|已知问题修复|
|0.2.5|1. 数据订阅支持获取消费进度和重置消费进度 <br/> 2. 支持 schemaless <br/> 3. 支持 STMT|

View File

@ -26,6 +26,7 @@ Node.js 连接器目前仅支持 WebSocket 连接器, 其通过 taosAdapter
| Node.js 连接器 版本 | 主要变化 | TDengine 版本 |
| :------------------: | :----------------------: | :----------------: |
| 3.1.2 | 对数据协议和解析进行了优化,性能得到大幅提升| 3.3.2.0 及更高版本 |
| 3.1.1 | 优化了数据传输性能 | 3.3.2.0 及更高版本 |
| 3.1.0 | 新版本发布,支持 WebSocket 连接 | 3.2.0.0 及更高版本 |

View File

@ -251,6 +251,7 @@ typedef struct SQueryTableDataCond {
int32_t type; // data block load type:
bool skipRollup;
STimeWindow twindows;
STimeWindow extTwindows[2];
int64_t startVersion;
int64_t endVersion;
bool notLoadData; // response the actual data, not only the rows in the attribute of info.row of ssdatablock

View File

@ -102,6 +102,7 @@ typedef struct SCatalogReq {
bool svrVerRequired;
bool forceUpdate;
bool cloned;
bool forceFetchViewMeta;
} SCatalogReq;
typedef struct SMetaRes {

View File

@ -174,6 +174,7 @@ char* nodesGetNameFromColumnNode(SNode* pNode);
int32_t nodesGetOutputNumFromSlotList(SNodeList* pSlots);
void nodesSortList(SNodeList** pList, int32_t (*)(SNode* pNode1, SNode* pNode2));
void destroyFuncParam(void* pFuncStruct);
int32_t nodesListDeduplicate(SNodeList** pList);
#ifdef __cplusplus
}

View File

@ -186,11 +186,25 @@ static int32_t tBufferGetI16(SBufferReader *reader, int16_t *value) {
}
static int32_t tBufferGetI32(SBufferReader *reader, int32_t *value) {
return tBufferGet(reader, sizeof(*value), value);
if (reader->offset + sizeof(int32_t) > reader->buffer->size) {
return TSDB_CODE_OUT_OF_RANGE;
}
if (value) {
*value = *(int32_t*)BR_PTR(reader);
}
reader->offset += sizeof(int32_t);
return 0;
}
static int32_t tBufferGetI64(SBufferReader *reader, int64_t *value) {
return tBufferGet(reader, sizeof(*value), value);
if (reader->offset + sizeof(int64_t) > reader->buffer->size) {
return TSDB_CODE_OUT_OF_RANGE;
}
if (value) {
*value = *(int64_t*)BR_PTR(reader);
}
reader->offset += sizeof(int64_t);
return 0;
}
static int32_t tBufferGetU8(SBufferReader *reader, uint8_t *value) { return tBufferGet(reader, sizeof(*value), value); }

View File

@ -3032,13 +3032,13 @@ static void fetchCallback(void* pResult, void* param, int32_t code) {
if (code != TSDB_CODE_SUCCESS) {
pRequest->code = code;
taosMemoryFreeClear(pResultInfo->pData);
pRequest->body.fetchFp(((SSyncQueryParam*)pRequest->body.interParam)->userParam, pRequest, 0);
pRequest->body.fetchFp(((SSyncQueryParam*)pRequest->body.interParam)->userParam, pRequest, code);
return;
}
if (pRequest->code != TSDB_CODE_SUCCESS) {
taosMemoryFreeClear(pResultInfo->pData);
pRequest->body.fetchFp(((SSyncQueryParam*)pRequest->body.interParam)->userParam, pRequest, 0);
pRequest->body.fetchFp(((SSyncQueryParam*)pRequest->body.interParam)->userParam, pRequest, pRequest->code);
return;
}

View File

@ -36,14 +36,15 @@ static void smProcessWriteQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numO
dTrace("msg:%p, get from snode-write queue", pMsg);
int32_t code = sndProcessWriteMsg(pMgmt->pSnode, pMsg, NULL);
if (code < 0) {
dGError("snd, msg:%p failed to process write since %s", pMsg, tstrerror(code));
if (pMsg->info.handle != NULL) {
tmsgSendRsp(pMsg);
}
} else {
smSendRsp(pMsg, 0);
}
// if (code < 0) {
// dGError("snd, msg:%p failed to process write since %s", pMsg, tstrerror(code));
// if (pMsg->info.handle != NULL) {
// tmsgSendRsp(pMsg);
// }
// } else {
// smSendRsp(pMsg, 0);
// }
smSendRsp(pMsg, code);
dTrace("msg:%p, is freed", pMsg);
rpcFreeCont(pMsg->pCont);

View File

@ -37,7 +37,9 @@ typedef struct SVnodeMgmt {
SSingleWorker mgmtMultiWorker;
SHashObj *hash;
SHashObj *closedHash;
SHashObj *creatingHash;
TdThreadRwlock lock;
TdThreadMutex mutex;
SVnodesStat state;
STfs *pTfs;
TdThread thread;
@ -96,6 +98,7 @@ SVnodeObj *vmAcquireVnodeImpl(SVnodeMgmt *pMgmt, int32_t vgId, bool strict);
void vmReleaseVnode(SVnodeMgmt *pMgmt, SVnodeObj *pVnode);
int32_t vmOpenVnode(SVnodeMgmt *pMgmt, SWrapperCfg *pCfg, SVnode *pImpl);
void vmCloseVnode(SVnodeMgmt *pMgmt, SVnodeObj *pVnode, bool commitAndRemoveWal, bool keepClosed);
void vmRemoveFromCreatingHash(SVnodeMgmt *pMgmt, int32_t vgId);
// vmHandle.c
SArray *vmGetMsgHandles();
@ -113,6 +116,7 @@ int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t
int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt);
int32_t vmGetVnodeListFromHash(SVnodeMgmt *pMgmt, int32_t *numOfVnodes, SVnodeObj ***ppVnodes);
int32_t vmGetAllVnodeListFromHash(SVnodeMgmt *pMgmt, int32_t *numOfVnodes, SVnodeObj ***ppVnodes);
int32_t vmGetAllVnodeListFromHashWithCreating(SVnodeMgmt *pMgmt, int32_t *numOfVnodes, SVnodeObj ***ppVnodes);
// vmWorker.c
int32_t vmStartWorker(SVnodeMgmt *pMgmt);

View File

@ -67,6 +67,54 @@ int32_t vmGetAllVnodeListFromHash(SVnodeMgmt *pMgmt, int32_t *numOfVnodes, SVnod
return 0;
}
int32_t vmGetAllVnodeListFromHashWithCreating(SVnodeMgmt *pMgmt, int32_t *numOfVnodes, SVnodeObj ***ppVnodes) {
(void)taosThreadRwlockRdlock(&pMgmt->lock);
int32_t num = 0;
int32_t size = taosHashGetSize(pMgmt->hash);
int32_t creatingSize = taosHashGetSize(pMgmt->creatingHash);
size += creatingSize;
SVnodeObj **pVnodes = taosMemoryCalloc(size, sizeof(SVnodeObj *));
if (pVnodes == NULL) {
(void)taosThreadRwlockUnlock(&pMgmt->lock);
return terrno;
}
void *pIter = taosHashIterate(pMgmt->hash, NULL);
while (pIter) {
SVnodeObj **ppVnode = pIter;
SVnodeObj *pVnode = *ppVnode;
if (pVnode && num < size) {
int32_t refCount = atomic_add_fetch_32(&pVnode->refCount, 1);
dTrace("vgId:%d,acquire vnode, vnode:%p, ref:%d", pVnode->vgId, pVnode, refCount);
pVnodes[num++] = (*ppVnode);
pIter = taosHashIterate(pMgmt->hash, pIter);
} else {
taosHashCancelIterate(pMgmt->hash, pIter);
}
}
pIter = taosHashIterate(pMgmt->creatingHash, NULL);
while (pIter) {
SVnodeObj **ppVnode = pIter;
SVnodeObj *pVnode = *ppVnode;
if (pVnode && num < size) {
int32_t refCount = atomic_add_fetch_32(&pVnode->refCount, 1);
dTrace("vgId:%d, acquire vnode, vnode:%p, ref:%d", pVnode->vgId, pVnode, refCount);
pVnodes[num++] = (*ppVnode);
pIter = taosHashIterate(pMgmt->creatingHash, pIter);
} else {
taosHashCancelIterate(pMgmt->creatingHash, pIter);
}
}
(void)taosThreadRwlockUnlock(&pMgmt->lock);
*numOfVnodes = num;
*ppVnodes = pVnodes;
return 0;
}
int32_t vmGetVnodeListFromHash(SVnodeMgmt *pMgmt, int32_t *numOfVnodes, SVnodeObj ***ppVnodes) {
(void)taosThreadRwlockRdlock(&pMgmt->lock);

View File

@ -381,6 +381,7 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
if (vnodeCreate(path, &vnodeCfg, diskPrimary, pMgmt->pTfs) < 0) {
dError("vgId:%d, failed to create vnode since %s", req.vgId, terrstr());
vmReleaseVnode(pMgmt, pVnode);
vmRemoveFromCreatingHash(pMgmt, req.vgId);
(void)tFreeSCreateVnodeReq(&req);
code = terrno != 0 ? terrno : -1;
return code;
@ -422,6 +423,8 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
}
_OVER:
vmRemoveFromCreatingHash(pMgmt, req.vgId);
if (code != 0) {
int32_t r = 0;
r = taosThreadRwlockWrlock(&pMgmt->lock);

View File

@ -16,6 +16,7 @@
#define _DEFAULT_SOURCE
#include "vmInt.h"
#include "libs/function/tudf.h"
#include "osMemory.h"
#include "tfs.h"
#include "vnd.h"
@ -62,10 +63,20 @@ int32_t vmAllocPrimaryDisk(SVnodeMgmt *pMgmt, int32_t vgId) {
int32_t numOfVnodes = 0;
SVnodeObj **ppVnodes = NULL;
code = vmGetVnodeListFromHash(pMgmt, &numOfVnodes, &ppVnodes);
code = taosThreadMutexLock(&pMgmt->mutex);
if (code != 0) {
return code;
}
code = vmGetAllVnodeListFromHashWithCreating(pMgmt, &numOfVnodes, &ppVnodes);
if (code != 0) {
int32_t r = taosThreadMutexUnlock(&pMgmt->mutex);
if (r != 0) {
dError("vgId:%d, failed to unlock mutex since %s", vgId, tstrerror(r));
}
return code;
}
for (int32_t v = 0; v < numOfVnodes; v++) {
SVnodeObj *pVnode = ppVnodes[v];
disks[pVnode->diskPrimary] += 1;
@ -81,6 +92,51 @@ int32_t vmAllocPrimaryDisk(SVnodeMgmt *pMgmt, int32_t vgId) {
}
}
SVnodeObj *pCreatingVnode = taosMemoryCalloc(1, sizeof(SVnodeObj));
if (pCreatingVnode == NULL) {
code = -1;
if (terrno != 0) code = terrno;
dError("failed to alloc vnode since %s", tstrerror(code));
int32_t r = taosThreadMutexUnlock(&pMgmt->mutex);
if (r != 0) {
dError("vgId:%d, failed to unlock mutex since %s", vgId, tstrerror(r));
}
goto _OVER;
}
(void)memset(pCreatingVnode, 0, sizeof(SVnodeObj));
pCreatingVnode->vgId = vgId;
pCreatingVnode->diskPrimary = diskId;
code = taosThreadRwlockWrlock(&pMgmt->lock);
if (code != 0) {
int32_t r = taosThreadMutexUnlock(&pMgmt->mutex);
if (r != 0) {
dError("vgId:%d, failed to unlock mutex since %s", vgId, tstrerror(r));
}
taosMemoryFree(pCreatingVnode);
goto _OVER;
}
dTrace("vgId:%d, put vnode into creating hash, pCreatingVnode:%p", vgId, pCreatingVnode);
code = taosHashPut(pMgmt->creatingHash, &vgId, sizeof(int32_t), &pCreatingVnode, sizeof(SVnodeObj *));
if (code != 0) {
dError("vgId:%d, failed to put vnode to creatingHash", vgId);
taosMemoryFree(pCreatingVnode);
}
int32_t r = taosThreadRwlockUnlock(&pMgmt->lock);
if (r != 0) {
dError("vgId:%d, failed to unlock since %s", vgId, tstrerror(r));
}
code = taosThreadMutexUnlock(&pMgmt->mutex);
if (code != 0) {
goto _OVER;
}
_OVER:
for (int32_t i = 0; i < numOfVnodes; ++i) {
if (ppVnodes == NULL || ppVnodes[i] == NULL) continue;
vmReleaseVnode(pMgmt, ppVnodes[i]);
@ -89,8 +145,13 @@ int32_t vmAllocPrimaryDisk(SVnodeMgmt *pMgmt, int32_t vgId) {
taosMemoryFree(ppVnodes);
}
dInfo("vgId:%d, alloc disk:%d of level 0. ndisk:%d, vnodes: %d", vgId, diskId, ndisk, numOfVnodes);
return diskId;
if (code != 0) {
dError("vgId:%d, failed to alloc disk since %s", vgId, tstrerror(code));
return code;
} else {
dInfo("vgId:%d, alloc disk:%d of level 0. ndisk:%d, vnodes: %d", vgId, diskId, ndisk, numOfVnodes);
return diskId;
}
}
SVnodeObj *vmAcquireVnodeImpl(SVnodeMgmt *pMgmt, int32_t vgId, bool strict) {
@ -216,12 +277,12 @@ void vmCloseVnode(SVnodeMgmt *pMgmt, SVnodeObj *pVnode, bool commitAndRemoveWal,
}
if (keepClosed) {
SVnodeObj *pClosedVnode = taosMemoryCalloc(1, sizeof(SVnodeObj));
(void)memset(pClosedVnode, 0, sizeof(SVnodeObj));
if (pVnode == NULL) {
dError("vgId:%d, failed to alloc vnode since %s", pVnode->vgId, terrstr());
if (pClosedVnode == NULL) {
dError("failed to alloc vnode since %s", terrstr());
(void)taosThreadRwlockUnlock(&pMgmt->lock);
return;
}
(void)memset(pClosedVnode, 0, sizeof(SVnodeObj));
pClosedVnode->vgId = pVnode->vgId;
pClosedVnode->dropped = pVnode->dropped;
@ -427,11 +488,18 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) {
pMgmt->closedHash =
taosHashInit(TSDB_MIN_VNODES, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
if (pMgmt->hash == NULL) {
if (pMgmt->closedHash == NULL) {
dError("failed to init vnode closed hash since %s", terrstr());
return TSDB_CODE_OUT_OF_MEMORY;
}
pMgmt->creatingHash =
taosHashInit(TSDB_MIN_VNODES, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
if (pMgmt->creatingHash == NULL) {
dError("failed to init vnode creatingHash hash since %s", terrstr());
return TSDB_CODE_OUT_OF_MEMORY;
}
SWrapperCfg *pCfgs = NULL;
int32_t numOfVnodes = 0;
if (vmGetVnodeListFromFile(pMgmt, &pCfgs, &numOfVnodes) != 0) {
@ -509,6 +577,32 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) {
return 0;
}
void vmRemoveFromCreatingHash(SVnodeMgmt *pMgmt, int32_t vgId) {
SVnodeObj *pOld = NULL;
(void)taosThreadRwlockWrlock(&pMgmt->lock);
int32_t r = taosHashGetDup(pMgmt->creatingHash, &vgId, sizeof(int32_t), (void *)&pOld);
if (r != 0) {
dError("vgId:%d, failed to get vnode from creating Hash", vgId);
}
dTrace("vgId:%d, remove from creating Hash", vgId);
r = taosHashRemove(pMgmt->creatingHash, &vgId, sizeof(int32_t));
if (r != 0) {
dError("vgId:%d, failed to remove vnode from hash", vgId);
}
(void)taosThreadRwlockUnlock(&pMgmt->lock);
if (pOld) {
dTrace("vgId:%d, free vnode pOld:%p", vgId, &pOld);
vmFreeVnodeObj(&pOld);
}
_OVER:
if (r != 0) {
dError("vgId:%d, failed to remove vnode from creatingHash since %s", vgId, tstrerror(r));
}
}
static void *vmCloseVnodeInThread(void *param) {
SVnodeThread *pThread = param;
SVnodeMgmt *pMgmt = pThread->pMgmt;
@ -614,6 +708,18 @@ static void vmCloseVnodes(SVnodeMgmt *pMgmt) {
pMgmt->closedHash = NULL;
}
pIter = taosHashIterate(pMgmt->creatingHash, NULL);
while (pIter) {
SVnodeObj **ppVnode = pIter;
vmFreeVnodeObj(ppVnode);
pIter = taosHashIterate(pMgmt->creatingHash, pIter);
}
if (pMgmt->creatingHash != NULL) {
taosHashCleanup(pMgmt->creatingHash);
pMgmt->creatingHash = NULL;
}
dInfo("total vnodes:%d are all closed", numOfVnodes);
}
@ -622,6 +728,7 @@ static void vmCleanup(SVnodeMgmt *pMgmt) {
vmStopWorker(pMgmt);
vnodeCleanup();
(void)taosThreadRwlockDestroy(&pMgmt->lock);
(void)taosThreadMutexDestroy(&pMgmt->mutex);
(void)taosThreadMutexDestroy(&pMgmt->fileLock);
taosMemoryFree(pMgmt);
}
@ -714,6 +821,12 @@ static int32_t vmInit(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
goto _OVER;
}
code = taosThreadMutexInit(&pMgmt->mutex, NULL);
if (code != 0) {
code = TAOS_SYSTEM_ERROR(errno);
goto _OVER;
}
code = taosThreadMutexInit(&pMgmt->fileLock, NULL);
if (code != 0) {
code = TAOS_SYSTEM_ERROR(errno);

View File

@ -53,7 +53,7 @@ static inline int32_t mndAcquireRpc(SMnode *pMnode) {
if (pMnode->stopped) {
code = TSDB_CODE_APP_IS_STOPPING;
} else if (!mndIsLeader(pMnode)) {
code = -1;
code = 1;
} else {
#if 1
(void)atomic_add_fetch_32(&pMnode->rpcRef, 1);
@ -1002,8 +1002,12 @@ int64_t mndGenerateUid(const char *name, int32_t len) {
int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgroupInfo *pVgroupInfo,
SMonStbInfo *pStbInfo, SMonGrantInfo *pGrantInfo) {
int32_t code = 0;
TAOS_CHECK_RETURN(mndAcquireRpc(pMnode));
int32_t code = mndAcquireRpc(pMnode);
if (code < 0) {
TAOS_RETURN(code);
} else if (code == 1) {
TAOS_RETURN(TSDB_CODE_SUCCESS);
}
SSdb *pSdb = pMnode->pSdb;
int64_t ms = taosGetTimestampMs();

View File

@ -324,7 +324,11 @@ static int32_t metaGenerateNewMeta(SMeta **ppMeta) {
SMetaEntry me = {0};
tDecoderInit(&dc, value, valueSize);
if (metaDecodeEntry(&dc, &me) == 0) {
if (metaHandleEntry(pNewMeta, &me) != 0) {
if (me.type == TSDB_CHILD_TABLE &&
tdbTbGet(pMeta->pUidIdx, &me.ctbEntry.suid, sizeof(me.ctbEntry.suid), NULL, NULL) != 0) {
metaError("vgId:%d failed to get super table uid:%" PRId64 " for child table uid:%" PRId64,
TD_VID(pVnode), me.ctbEntry.suid, uid);
} else if (metaHandleEntry(pNewMeta, &me) != 0) {
metaError("vgId:%d failed to handle entry, uid:%" PRId64, TD_VID(pVnode), uid);
}
}

View File

@ -972,7 +972,7 @@ static int32_t tsdbDataFileWriteBrinRecord(SDataFileWriter *writer, const SBrinR
break;
}
if ((writer->brinBlock->numOfRecords) >= writer->config->maxRow) {
if ((writer->brinBlock->numOfRecords) >= 256) {
TAOS_CHECK_GOTO(tsdbDataFileWriteBrinBlock(writer), &lino, _exit);
}

View File

@ -836,6 +836,7 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead
pList = &pReader->status.uidList;
int32_t i = 0;
int32_t j = 0;
while (i < TARRAY2_SIZE(pBlkArray)) {
pBrinBlk = &pBlkArray->data[i];
if (pBrinBlk->maxTbid.suid < pReader->info.suid) {
@ -851,7 +852,7 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead
(pBrinBlk->minTbid.suid <= pReader->info.suid) && (pBrinBlk->maxTbid.suid >= pReader->info.suid), code, lino,
_end, TSDB_CODE_INTERNAL_ERROR);
if (pBrinBlk->maxTbid.suid == pReader->info.suid && pBrinBlk->maxTbid.uid < pList->tableUidList[0]) {
if (pBrinBlk->maxTbid.suid == pReader->info.suid && pBrinBlk->maxTbid.uid < pList->tableUidList[j]) {
i += 1;
continue;
}
@ -864,6 +865,14 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead
TSDB_CHECK_NULL(p1, code, lino, _end, terrno);
i += 1;
if (pBrinBlk->maxTbid.suid == pReader->info.suid) {
while (j < numOfTables && pList->tableUidList[j] < pBrinBlk->maxTbid.uid) {
j++;
}
if (j >= numOfTables) {
break;
}
}
}
et2 = taosGetTimestampUs();
@ -1134,7 +1143,12 @@ static int32_t getCurrentBlockInfo(SDataBlockIter* pBlockIter, SFileDataBlockInf
*pInfo = NULL;
size_t num = TARRAY_SIZE(pBlockIter->blockList);
TSDB_CHECK_CONDITION(num != 0, code, lino, _end, TSDB_CODE_INVALID_PARA);
if (num == 0) {
// Some callers would attempt to call this function. Filter out certain normal cases and return directly to avoid
// generating excessive unnecessary error logs.
TSDB_CHECK_CONDITION(num == pBlockIter->numOfBlocks, code, lino, _end, TSDB_CODE_INVALID_PARA);
return TSDB_CODE_INVALID_PARA;
}
*pInfo = taosArrayGet(pBlockIter->blockList, pBlockIter->index);
TSDB_CHECK_NULL(*pInfo, code, lino, _end, TSDB_CODE_INVALID_PARA);
@ -4807,7 +4821,7 @@ static int32_t checkForNeighborFileBlock(STsdbReader* pReader, STableBlockScanIn
pBlockData = &pReader->status.fileBlockData;
asc = ASCENDING_TRAVERSE(pReader->info.order);
pVerRange = &pReader->info.verRange;
ASCENDING_TRAVERSE(pReader->info.order) ? 1 : -1;
step = ASCENDING_TRAVERSE(pReader->info.order) ? 1 : -1;
*state = CHECK_FILEBLOCK_QUIT;
code = loadNeighborIfOverlap(pFBlock, pScanInfo, pReader, &loadNeighbor);
@ -5530,12 +5544,10 @@ int32_t tsdbReaderOpen2(void* pVnode, SQueryTableDataCond* pCond, void* pTableLi
// update the SQueryTableDataCond to create inner reader
int32_t order = pCond->order;
if (order == TSDB_ORDER_ASC) {
pCond->twindows.ekey = window.skey - 1;
pCond->twindows.skey = INT64_MIN;
pCond->twindows = pCond->extTwindows[0];
pCond->order = TSDB_ORDER_DESC;
} else {
pCond->twindows.skey = window.ekey + 1;
pCond->twindows.ekey = INT64_MAX;
pCond->twindows = pCond->extTwindows[1];
pCond->order = TSDB_ORDER_ASC;
}
@ -5544,11 +5556,9 @@ int32_t tsdbReaderOpen2(void* pVnode, SQueryTableDataCond* pCond, void* pTableLi
TSDB_CHECK_CODE(code, lino, _end);
if (order == TSDB_ORDER_ASC) {
pCond->twindows.skey = window.ekey + 1;
pCond->twindows.ekey = INT64_MAX;
pCond->twindows = pCond->extTwindows[1];
} else {
pCond->twindows.skey = INT64_MIN;
pCond->twindows.ekey = window.ekey - 1;
pCond->twindows = pCond->extTwindows[0];
}
pCond->order = order;
@ -6115,7 +6125,7 @@ int32_t tsdbNextDataBlock2(STsdbReader* pReader, bool* hasNext) {
TSDB_CHECK_CODE(code, lino, _end);
}
goto _end;
return code;
}
}
@ -6142,7 +6152,7 @@ int32_t tsdbNextDataBlock2(STsdbReader* pReader, bool* hasNext) {
acquired = false;
TSDB_CHECK_CODE(code, lino, _end);
}
goto _end;
return code;
}
if (pReader->step == EXTERNAL_ROWS_MAIN && pReader->innerReader[1] != NULL) {
@ -6168,7 +6178,7 @@ int32_t tsdbNextDataBlock2(STsdbReader* pReader, bool* hasNext) {
TSDB_CHECK_CODE(code, lino, _end);
}
goto _end;
return code;
}
}

View File

@ -271,6 +271,7 @@ typedef struct SCtgViewsCtx {
SArray* pNames;
SArray* pResList;
SArray* pFetchs;
bool forceFetch;
} SCtgViewsCtx;
typedef enum {

View File

@ -20,6 +20,11 @@
#include "tref.h"
#include "trpc.h"
typedef struct SCtgViewTaskParam {
bool forceFetch;
SArray* pTableReqs;
} SCtgViewTaskParam;
void ctgIsTaskDone(SCtgJob* pJob, CTG_TASK_TYPE type, bool* done) {
SCtgTask* pTask = NULL;
@ -500,7 +505,7 @@ int32_t ctgInitGetTbTagTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
int32_t ctgInitGetViewsTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
SCtgTask task = {0};
SCtgViewTaskParam* p = param;
task.type = CTG_TASK_GET_VIEW;
task.taskId = taskIdx;
task.pJob = pJob;
@ -511,7 +516,8 @@ int32_t ctgInitGetViewsTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
}
SCtgViewsCtx* ctx = task.taskCtx;
ctx->pNames = param;
ctx->pNames = p->pTableReqs;
ctx->forceFetch = p->forceFetch;
ctx->pResList = taosArrayInit(pJob->viewNum, sizeof(SMetaRes));
if (NULL == ctx->pResList) {
qError("QID:0x%" PRIx64 " taosArrayInit %d SMetaRes %d failed", pJob->queryId, pJob->viewNum,
@ -849,13 +855,12 @@ int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgJob** job, const
int32_t tbCfgNum = (int32_t)taosArrayGetSize(pReq->pTableCfg);
int32_t tbTagNum = (int32_t)taosArrayGetSize(pReq->pTableTag);
int32_t viewNum = (int32_t)ctgGetTablesReqNum(pReq->pView);
int32_t tbTsmaNum = (int32_t)taosArrayGetSize(pReq->pTableTSMAs);
int32_t tbTsmaNum = tsQuerySmaOptimize ? (int32_t)taosArrayGetSize(pReq->pTableTSMAs) : 0;
int32_t tsmaNum = (int32_t)taosArrayGetSize(pReq->pTSMAs);
int32_t tbNameNum = (int32_t)ctgGetTablesReqNum(pReq->pTableName);
int32_t taskNum = tbMetaNum + dbVgNum + udfNum + tbHashNum + qnodeNum + dnodeNum + svrVerNum + dbCfgNum + indexNum +
userNum + dbInfoNum + tbIndexNum + tbCfgNum + tbTagNum + viewNum + tbTsmaNum + tbNameNum;
*job = taosMemoryCalloc(1, sizeof(SCtgJob));
if (NULL == *job) {
ctgError("failed to calloc, size:%d,QID:0x%" PRIx64, (int32_t)sizeof(SCtgJob), pConn->requestId);
@ -1014,7 +1019,8 @@ int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgJob** job, const
}
if (viewNum > 0) {
CTG_ERR_JRET(ctgInitTask(pJob, CTG_TASK_GET_VIEW, pReq->pView, NULL));
SCtgViewTaskParam param = {.forceFetch = pReq->forceFetchViewMeta, .pTableReqs = pReq->pView};
CTG_ERR_JRET(ctgInitTask(pJob, CTG_TASK_GET_VIEW, &param, NULL));
}
if (tbTsmaNum > 0) {
CTG_ERR_JRET(ctgInitTask(pJob, CTG_TASK_GET_TB_TSMA, pReq->pTableTSMAs, NULL));
@ -3712,16 +3718,14 @@ int32_t ctgLaunchGetViewsTask(SCtgTask* pTask) {
bool tbMetaDone = false;
SName* pName = NULL;
/*
ctgIsTaskDone(pJob, CTG_TASK_GET_TB_META_BATCH, &tbMetaDone);
if (tbMetaDone) {
CTG_ERR_RET(ctgBuildViewNullRes(pTask, pCtx));
TSWAP(pTask->res, pCtx->pResList);
ctgIsTaskDone(pJob, CTG_TASK_GET_TB_META_BATCH, &tbMetaDone);
if (tbMetaDone && !pCtx->forceFetch) {
CTG_ERR_RET(ctgBuildViewNullRes(pTask, pCtx));
TSWAP(pTask->res, pCtx->pResList);
CTG_ERR_RET(ctgHandleTaskEnd(pTask, 0));
return TSDB_CODE_SUCCESS;
}
*/
CTG_ERR_RET(ctgHandleTaskEnd(pTask, 0));
return TSDB_CODE_SUCCESS;
}
int32_t dbNum = taosArrayGetSize(pCtx->pNames);
int32_t fetchIdx = 0;

View File

@ -3040,7 +3040,6 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock
pBlockInfo->rows, pTaskInfo, &pTableScanInfo->base.metaCache);
// ignore the table not exists error, since this table may have been dropped during the scan procedure.
if (code) {
blockDataFreeRes((SSDataBlock*)pBlock);
QUERY_CHECK_CODE(code, lino, _end);
}

View File

@ -1131,6 +1131,47 @@ static int32_t extractPkColumnFromFuncs(SNodeList* pFuncs, bool* pHasPk, SColumn
return TSDB_CODE_SUCCESS;
}
/**
* @brief Determine the actual time range for reading data based on the RANGE clause and the WHERE conditions.
* @param[in] cond The range specified by WHERE condition.
* @param[in] range The range specified by RANGE clause.
* @param[out] twindow The range to be read in DESC order, and only one record is needed.
* @param[out] extTwindow The external range to read for only one record, which is used for FILL clause.
* @note `cond` and `twindow` may be the same address.
*/
static int32_t getQueryExtWindow(const STimeWindow* cond, const STimeWindow* range, STimeWindow* twindow,
STimeWindow* extTwindows) {
int32_t code = TSDB_CODE_SUCCESS;
int32_t lino = 0;
STimeWindow tempWindow;
if (cond->skey > cond->ekey || range->skey > range->ekey) {
*twindow = extTwindows[0] = extTwindows[1] = TSWINDOW_DESC_INITIALIZER;
return code;
}
if (range->ekey < cond->skey) {
extTwindows[1] = *cond;
*twindow = extTwindows[0] = TSWINDOW_DESC_INITIALIZER;
return code;
}
if (cond->ekey < range->skey) {
extTwindows[0] = *cond;
*twindow = extTwindows[1] = TSWINDOW_DESC_INITIALIZER;
return code;
}
// Only scan data in the time range intersecion.
extTwindows[0] = extTwindows[1] = *cond;
twindow->skey = TMAX(cond->skey, range->skey);
twindow->ekey = TMIN(cond->ekey, range->ekey);
extTwindows[0].ekey = twindow->skey - 1;
extTwindows[1].skey = twindow->ekey + 1;
return code;
}
int32_t createTimeSliceOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, SOperatorInfo** pOptrInfo) {
QRY_PARAM_CHECK(pOptrInfo);
@ -1206,8 +1247,10 @@ int32_t createTimeSliceOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyN
if (downstream->operatorType == QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN) {
STableScanInfo* pScanInfo = (STableScanInfo*)downstream->info;
pScanInfo->base.cond.twindows = pInfo->win;
pScanInfo->base.cond.type = TIMEWINDOW_RANGE_EXTERNAL;
SQueryTableDataCond *cond = &pScanInfo->base.cond;
cond->type = TIMEWINDOW_RANGE_EXTERNAL;
code = getQueryExtWindow(&cond->twindows, &pInfo->win, &cond->twindows, cond->extTwindows);
QUERY_CHECK_CODE(code, lino, _error);
}
setOperatorInfo(pOperator, "TimeSliceOperator", QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC, false, OP_NOT_OPENED, pInfo,

View File

@ -3037,61 +3037,60 @@ int32_t lastRowFunction(SqlFunctionCtx* pCtx) {
TSKEY startKey = getRowPTs(pInput->pPTS, 0);
TSKEY endKey = getRowPTs(pInput->pPTS, pInput->totalRows - 1);
#if 0
int32_t blockDataOrder = (startKey <= endKey) ? TSDB_ORDER_ASC : TSDB_ORDER_DESC;
// the optimized version only valid if all tuples in one block are monotonious increasing or descreasing.
// this assumption is NOT always works if project operator exists in downstream.
if (blockDataOrder == TSDB_ORDER_ASC) {
if (pCtx->order == TSDB_ORDER_ASC && !pCtx->hasPrimaryKey) {
for (int32_t i = pInput->numOfRows + pInput->startRowIndex - 1; i >= pInput->startRowIndex; --i) {
char* data = colDataGetData(pInputCol, i);
bool isNull = colDataIsNull(pInputCol, pInput->numOfRows, i, NULL);
char* data = isNull ? NULL : colDataGetData(pInputCol, i);
TSKEY cts = getRowPTs(pInput->pPTS, i);
numOfElems++;
if (pResInfo->numOfRes == 0 || pInfo->ts < cts) {
doSaveLastrow(pCtx, data, i, cts, pInfo);
int32_t code = doSaveLastrow(pCtx, data, i, cts, pInfo);
if (code != TSDB_CODE_SUCCESS) return code;
}
break;
}
} else { // descending order
} else if (!pCtx->hasPrimaryKey && pCtx->order == TSDB_ORDER_DESC) {
// the optimized version only valid if all tuples in one block are monotonious increasing or descreasing.
// this assumption is NOT always works if project operator exists in downstream.
for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) {
char* data = colDataGetData(pInputCol, i);
bool isNull = colDataIsNull(pInputCol, pInput->numOfRows, i, NULL);
char* data = isNull ? NULL : colDataGetData(pInputCol, i);
TSKEY cts = getRowPTs(pInput->pPTS, i);
numOfElems++;
if (pResInfo->numOfRes == 0 || pInfo->ts < cts) {
doSaveLastrow(pCtx, data, i, cts, pInfo);
int32_t code = doSaveLastrow(pCtx, data, i, cts, pInfo);
if (code != TSDB_CODE_SUCCESS) return code;
}
break;
}
}
#else
} else {
int64_t* pts = (int64_t*)pInput->pPTS->pData;
int from = -1;
int32_t i = -1;
while (funcInputGetNextRowIndex(pInput, from, false, &i, &from)) {
bool isNull = colDataIsNull(pInputCol, pInput->numOfRows, i, NULL);
char* data = isNull ? NULL : colDataGetData(pInputCol, i);
TSKEY cts = pts[i];
int64_t* pts = (int64_t*)pInput->pPTS->pData;
int from = -1;
int32_t i = -1;
while (funcInputGetNextRowIndex(pInput, from, false, &i, &from)) {
bool isNull = colDataIsNull(pInputCol, pInput->numOfRows, i, NULL);
char* data = isNull ? NULL : colDataGetData(pInputCol, i);
TSKEY cts = pts[i];
numOfElems++;
char* pkData = NULL;
if (pCtx->hasPrimaryKey) {
pkData = colDataGetData(pkCol, i);
}
if (pResInfo->numOfRes == 0 || pInfo->ts < cts ||
(pInfo->ts == pts[i] && pkCompareFn && pkCompareFn(pkData, pInfo->pkData) < 0)) {
int32_t code = doSaveLastrow(pCtx, data, i, cts, pInfo);
if (code != TSDB_CODE_SUCCESS) {
return code;
numOfElems++;
char* pkData = NULL;
if (pCtx->hasPrimaryKey) {
pkData = colDataGetData(pkCol, i);
}
if (pResInfo->numOfRes == 0 || pInfo->ts < cts ||
(pInfo->ts == pts[i] && pkCompareFn && pkCompareFn(pkData, pInfo->pkData) < 0)) {
int32_t code = doSaveLastrow(pCtx, data, i, cts, pInfo);
if (code != TSDB_CODE_SUCCESS) {
return code;
}
pResInfo->numOfRes = 1;
}
pResInfo->numOfRes = 1;
}
}
#endif
}
SET_VAL(pResInfo, numOfElems, 1);
return TSDB_CODE_SUCCESS;

View File

@ -153,6 +153,12 @@ static bool caseWhenNodeEqual(const SCaseWhenNode* a, const SCaseWhenNode* b) {
return true;
}
static bool groupingSetNodeEqual(const SGroupingSetNode* a, const SGroupingSetNode* b) {
COMPARE_SCALAR_FIELD(groupingSetType);
COMPARE_NODE_LIST_FIELD(pParameterList);
return true;
}
bool nodesEqualNode(const SNode* a, const SNode* b) {
if (a == b) {
return true;
@ -181,10 +187,11 @@ bool nodesEqualNode(const SNode* a, const SNode* b) {
return whenThenNodeEqual((const SWhenThenNode*)a, (const SWhenThenNode*)b);
case QUERY_NODE_CASE_WHEN:
return caseWhenNodeEqual((const SCaseWhenNode*)a, (const SCaseWhenNode*)b);
case QUERY_NODE_GROUPING_SET:
return groupingSetNodeEqual((const SGroupingSetNode*)a, (const SGroupingSetNode*)b);
case QUERY_NODE_REAL_TABLE:
case QUERY_NODE_TEMP_TABLE:
case QUERY_NODE_JOIN_TABLE:
case QUERY_NODE_GROUPING_SET:
case QUERY_NODE_ORDER_BY_EXPR:
case QUERY_NODE_LIMIT:
return false;

View File

@ -2948,3 +2948,46 @@ void nodesSortList(SNodeList** pList, int32_t (*comp)(SNode* pNode1, SNode* pNod
inSize *= 2;
}
}
static SNode* nodesListFindNode(SNodeList* pList, SNode* pNode) {
SNode* pFound = NULL;
FOREACH(pFound, pList) {
if (nodesEqualNode(pFound, pNode)) {
break;
}
}
return pFound;
}
int32_t nodesListDeduplicate(SNodeList** ppList) {
if (!ppList || LIST_LENGTH(*ppList) <= 1) return TSDB_CODE_SUCCESS;
if (LIST_LENGTH(*ppList) == 2) {
SNode* pNode1 = nodesListGetNode(*ppList, 0);
SNode* pNode2 = nodesListGetNode(*ppList, 1);
if (nodesEqualNode(pNode1, pNode2)) {
SListCell* pCell = nodesListGetCell(*ppList, 1);
(void)nodesListErase(*ppList, pCell);
}
return TSDB_CODE_SUCCESS;
}
SNodeList* pTmp = NULL;
int32_t code = nodesMakeList(&pTmp);
if (TSDB_CODE_SUCCESS == code) {
SNode* pNode = NULL;
FOREACH(pNode, *ppList) {
SNode* pFound = nodesListFindNode(pTmp, pNode);
if (NULL == pFound) {
code = nodesCloneNode(pNode, &pFound);
if (TSDB_CODE_SUCCESS == code) code = nodesListStrictAppend(pTmp, pFound);
if (TSDB_CODE_SUCCESS != code) break;
}
}
}
if (TSDB_CODE_SUCCESS == code) {
nodesDestroyList(*ppList);
*ppList = pTmp;
} else {
nodesDestroyList(pTmp);
}
return code;
}

View File

@ -115,6 +115,7 @@ typedef struct SParseMetaCache {
SHashObj* pTableName; // key is tbFUid, elements is STableMeta*(append with tbName)
SArray* pDnodes; // element is SEpSet
bool dnodeRequired;
bool forceFetchViewMeta;
} SParseMetaCache;
int32_t generateSyntaxErrMsg(SMsgBuf* pBuf, int32_t errCode, ...);

View File

@ -810,7 +810,7 @@ static int32_t collectMetaKeyFromShowCreateView(SCollectMetaKeyCxt* pCxt, SShowC
if (TSDB_CODE_SUCCESS == code) {
code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->viewName, pCxt->pMetaCache);
}
pCxt->pMetaCache->forceFetchViewMeta = true;
return code;
}
@ -888,6 +888,7 @@ static int32_t collectMetaKeyFromCreateViewStmt(SCollectMetaKeyCxt* pCxt, SCreat
static int32_t collectMetaKeyFromDropViewStmt(SCollectMetaKeyCxt* pCxt, SDropViewStmt* pStmt) {
int32_t code = reserveViewUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pStmt->dbName,
pStmt->viewName, AUTH_TYPE_ALTER, pCxt->pMetaCache);
pCxt->pMetaCache->forceFetchViewMeta = true;
return code;
}

View File

@ -336,7 +336,10 @@ static int32_t calcConstGroupBy(SCalcConstContext* pCxt, SSelectStmt* pSelect) {
}
}
}
NODES_DESTORY_LIST(pSelect->pGroupByList);
FOREACH(pNode, pSelect->pGroupByList) {
if (!cell->pPrev) continue;
ERASE_NODE(pSelect->pGroupByList);
}
}
return code;
}

View File

@ -817,6 +817,7 @@ int32_t buildCatalogReq(const SParseMetaCache* pMetaCache, SCatalogReq* pCatalog
}
#endif
pCatalogReq->dNodeRequired = pMetaCache->dnodeRequired;
pCatalogReq->forceFetchViewMeta = pMetaCache->forceFetchViewMeta;
return code;
}

View File

@ -838,8 +838,11 @@ static int32_t createAggLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect,
}
if (NULL != pSelect->pGroupByList) {
pAgg->pGroupKeys = NULL;
code = nodesCloneList(pSelect->pGroupByList, &pAgg->pGroupKeys);
code = nodesListDeduplicate(&pSelect->pGroupByList);
if (TSDB_CODE_SUCCESS == code) {
pAgg->pGroupKeys = NULL;
code = nodesCloneList(pSelect->pGroupByList, &pAgg->pGroupKeys);
}
}
// rewrite the expression in subsequent clauses

View File

@ -204,6 +204,7 @@ static void optSetParentOrder(SLogicNode* pNode, EOrder order, SLogicNode* pNode
// case QUERY_NODE_LOGIC_PLAN_WINDOW:
case QUERY_NODE_LOGIC_PLAN_AGG:
case QUERY_NODE_LOGIC_PLAN_SORT:
case QUERY_NODE_LOGIC_PLAN_FILL:
if (pNode == pNodeForcePropagate) {
pNode->outputTsOrder = order;
break;

View File

@ -385,6 +385,10 @@ int32_t streamProcessCheckpointTriggerBlock(SStreamTask* pTask, SStreamDataBlock
}
}
#if 0
taosMsleep(20*1000);
#endif
if (taskLevel == TASK_LEVEL__SOURCE) {
int8_t type = pTask->outputInfo.type;
pActiveInfo->allUpstreamTriggerRecv = 1;

View File

@ -1170,6 +1170,7 @@ int32_t streamTaskSendCheckpointReadyMsg(SStreamTask* pTask) {
if (taosArrayGetSize(pTask->upstreamInfo.pList) != num) {
stError("s-task:%s invalid number of sent readyMsg:%d to upstream:%d", id, num,
(int32_t)taosArrayGetSize(pTask->upstreamInfo.pList));
streamMutexUnlock(&pActiveInfo->lock);
return TSDB_CODE_STREAM_INTERNAL_ERROR;
}
@ -1412,6 +1413,7 @@ int32_t streamAddCheckpointSourceRspMsg(SStreamCheckpointSourceReq* pReq, SRpcHa
if (size > 0) {
STaskCheckpointReadyInfo* pReady = taosArrayGet(pActiveInfo->pReadyMsgList, 0);
if (pReady == NULL) {
streamMutexUnlock(&pActiveInfo->lock);
return terrno;
}

View File

@ -433,6 +433,7 @@ int32_t streamMetaStopAllTasks(SStreamMeta* pMeta) {
// send hb msg to mnode before closing all tasks.
int32_t code = streamMetaSendMsgBeforeCloseTasks(pMeta, &pTaskList);
if (code != TSDB_CODE_SUCCESS) {
streamMetaRUnLock(pMeta);
return code;
}

View File

@ -376,6 +376,10 @@ static FORCE_INLINE int32_t walCheckAndRoll(SWal *pWal) {
int32_t walBeginSnapshot(SWal *pWal, int64_t ver, int64_t logRetention) {
int32_t code = 0;
if (pWal->cfg.level == TAOS_WAL_SKIP) {
TAOS_RETURN(TSDB_CODE_SUCCESS);
}
if (logRetention < 0) {
TAOS_RETURN(TSDB_CODE_FAILED);
}
@ -404,6 +408,10 @@ _exit:
int32_t walEndSnapshot(SWal *pWal) {
int32_t code = 0, lino = 0;
if (pWal->cfg.level == TAOS_WAL_SKIP) {
TAOS_RETURN(TSDB_CODE_SUCCESS);
}
TAOS_UNUSED(taosThreadRwlockWrlock(&pWal->mutex));
int64_t ver = pWal->vers.verInSnapshotting;

View File

@ -511,3 +511,26 @@ TEST_F(WalSkipLevel, restart) {
SetUp();
}
TEST_F(WalSkipLevel, roll) {
int code;
int i;
for (i = 0; i < 100; i++) {
code = walAppendLog(pWal, i, 0, syncMeta, (void*)ranStr, ranStrLen);
ASSERT_EQ(code, 0);
code = walCommit(pWal, i);
}
walBeginSnapshot(pWal, i - 1, 0);
walEndSnapshot(pWal);
code = walAppendLog(pWal, 5, 0, syncMeta, (void*)ranStr, ranStrLen);
ASSERT_NE(code, 0);
for (; i < 200; i++) {
code = walAppendLog(pWal, i, 0, syncMeta, (void*)ranStr, ranStrLen);
ASSERT_EQ(code, 0);
code = walCommit(pWal, i);
}
code = walBeginSnapshot(pWal, i - 1, 0);
ASSERT_EQ(code, 0);
code = walEndSnapshot(pWal);
ASSERT_EQ(code, 0);
}

View File

@ -113,6 +113,15 @@ class TDTestCase(TBase):
if not result:
raise Exception(f"key:{key} not found")
def checkRows(self, sql, nExpect, nRetry):
for i in range(nRetry):
res = tdSql.getResult(sql)
if len(res) == nExpect:
break
time.sleep(1)
if len(res) != nExpect:
raise Exception(f"rows:{len(res)} != {nExpect}")
def alterBypassFlag(self):
"""Add test case for altering bypassFlag(TD-32907)
"""
@ -151,8 +160,7 @@ class TDTestCase(TBase):
tdSql.query("select * from stb0")
tdSql.checkRows(2)
tdSql.execute("flush database db")
tdSql.query("select * from stb0")
tdSql.checkRows(0)
self.checkRows("select * from stb0", 0, 10)
tdSql.execute("alter all dnodes 'bypassFlag 0'")
self.checkKeyValue(tdSql.getResult("show local variables"), "bypassFlag", "0")
self.checkKeyValue(tdSql.getResult("show dnode 1 variables like 'bypassFlag'"), "bypassFlag", "0", 1, 2)
@ -161,8 +169,9 @@ class TDTestCase(TBase):
tdSql.query("select * from stb0")
tdSql.checkRows(2)
tdSql.execute("flush database db")
tdSql.query("select * from stb0")
tdSql.checkRows(2)
for i in range(5):
self.checkRows("select * from stb0", 2, 1)
time.sleep(1)
# run
def run(self):

View File

@ -366,3 +366,652 @@ taos> select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _i
2020-02-01 00:00:16.000 | td32727 | 10 | 10 | true | 1 |
2020-02-01 00:00:16.000 | td32727 | 15 | 15 | true | 1 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-02 00:00:00' and '2020-01-01 00:00:00' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(null);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-02 00:00:00' and '2020-01-01 00:00:00' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(value, 1);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-02 00:00:00' and '2020-01-01 00:00:00' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(prev);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-02 00:00:00' and '2020-01-01 00:00:00' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(next);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-02 00:00:00' and '2020-01-01 00:00:00' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(linear);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-02 00:00:00' range('2020-01-01 00:00:30', '2020-01-01 00:00:00') every(1s) fill(null);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-02 00:00:00' range('2020-01-01 00:00:30', '2020-01-01 00:00:00') every(1s) fill(value, 1);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-02 00:00:00' range('2020-01-01 00:00:30', '2020-01-01 00:00:00') every(1s) fill(prev);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-02 00:00:00' range('2020-01-01 00:00:30', '2020-01-01 00:00:00') every(1s) fill(next);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-02 00:00:00' range('2020-01-01 00:00:30', '2020-01-01 00:00:00') every(1s) fill(linear);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:20' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(null);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:20' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(value, 1);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:20' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(prev);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:20' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(next);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:20' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(linear);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(null);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:21.000 | false | 21 |
2020-01-01 00:00:22.000 | true | NULL |
2020-01-01 00:00:23.000 | true | NULL |
2020-01-01 00:00:24.000 | true | NULL |
2020-01-01 00:00:25.000 | true | NULL |
2020-01-01 00:00:26.000 | true | NULL |
2020-01-01 00:00:27.000 | true | NULL |
2020-01-01 00:00:28.000 | true | NULL |
2020-01-01 00:00:29.000 | true | NULL |
2020-01-01 00:00:30.000 | true | NULL |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(value, 1);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:21.000 | false | 21 |
2020-01-01 00:00:22.000 | true | 1 |
2020-01-01 00:00:23.000 | true | 1 |
2020-01-01 00:00:24.000 | true | 1 |
2020-01-01 00:00:25.000 | true | 1 |
2020-01-01 00:00:26.000 | true | 1 |
2020-01-01 00:00:27.000 | true | 1 |
2020-01-01 00:00:28.000 | true | 1 |
2020-01-01 00:00:29.000 | true | 1 |
2020-01-01 00:00:30.000 | true | 1 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(prev);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:21.000 | false | 21 |
2020-01-01 00:00:22.000 | true | 21 |
2020-01-01 00:00:23.000 | true | 21 |
2020-01-01 00:00:24.000 | true | 21 |
2020-01-01 00:00:25.000 | true | 21 |
2020-01-01 00:00:26.000 | true | 21 |
2020-01-01 00:00:27.000 | true | 21 |
2020-01-01 00:00:28.000 | true | 21 |
2020-01-01 00:00:29.000 | true | 21 |
2020-01-01 00:00:30.000 | true | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(next);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(linear);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(null);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | NULL |
2020-01-01 00:00:17.000 | true | NULL |
2020-01-01 00:00:18.000 | true | NULL |
2020-01-01 00:00:19.000 | true | NULL |
2020-01-01 00:00:20.000 | true | NULL |
2020-01-01 00:00:21.000 | false | 21 |
2020-01-01 00:00:22.000 | true | NULL |
2020-01-01 00:00:23.000 | true | NULL |
2020-01-01 00:00:24.000 | true | NULL |
2020-01-01 00:00:25.000 | true | NULL |
2020-01-01 00:00:26.000 | true | NULL |
2020-01-01 00:00:27.000 | true | NULL |
2020-01-01 00:00:28.000 | true | NULL |
2020-01-01 00:00:29.000 | true | NULL |
2020-01-01 00:00:30.000 | true | NULL |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(value, 1);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 1 |
2020-01-01 00:00:17.000 | true | 1 |
2020-01-01 00:00:18.000 | true | 1 |
2020-01-01 00:00:19.000 | true | 1 |
2020-01-01 00:00:20.000 | true | 1 |
2020-01-01 00:00:21.000 | false | 21 |
2020-01-01 00:00:22.000 | true | 1 |
2020-01-01 00:00:23.000 | true | 1 |
2020-01-01 00:00:24.000 | true | 1 |
2020-01-01 00:00:25.000 | true | 1 |
2020-01-01 00:00:26.000 | true | 1 |
2020-01-01 00:00:27.000 | true | 1 |
2020-01-01 00:00:28.000 | true | 1 |
2020-01-01 00:00:29.000 | true | 1 |
2020-01-01 00:00:30.000 | true | 1 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(prev);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 15 |
2020-01-01 00:00:17.000 | true | 15 |
2020-01-01 00:00:18.000 | true | 15 |
2020-01-01 00:00:19.000 | true | 15 |
2020-01-01 00:00:20.000 | true | 15 |
2020-01-01 00:00:21.000 | false | 21 |
2020-01-01 00:00:22.000 | true | 21 |
2020-01-01 00:00:23.000 | true | 21 |
2020-01-01 00:00:24.000 | true | 21 |
2020-01-01 00:00:25.000 | true | 21 |
2020-01-01 00:00:26.000 | true | 21 |
2020-01-01 00:00:27.000 | true | 21 |
2020-01-01 00:00:28.000 | true | 21 |
2020-01-01 00:00:29.000 | true | 21 |
2020-01-01 00:00:30.000 | true | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(next);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 21 |
2020-01-01 00:00:17.000 | true | 21 |
2020-01-01 00:00:18.000 | true | 21 |
2020-01-01 00:00:19.000 | true | 21 |
2020-01-01 00:00:20.000 | true | 21 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(linear);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 16 |
2020-01-01 00:00:17.000 | true | 17 |
2020-01-01 00:00:18.000 | true | 18 |
2020-01-01 00:00:19.000 | true | 19 |
2020-01-01 00:00:20.000 | true | 20 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(null);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | false | 0 |
2020-01-01 00:00:01.000 | false | 1 |
2020-01-01 00:00:02.000 | true | NULL |
2020-01-01 00:00:03.000 | false | 3 |
2020-01-01 00:00:04.000 | true | NULL |
2020-01-01 00:00:05.000 | true | NULL |
2020-01-01 00:00:06.000 | false | 6 |
2020-01-01 00:00:07.000 | true | NULL |
2020-01-01 00:00:08.000 | true | NULL |
2020-01-01 00:00:09.000 | true | NULL |
2020-01-01 00:00:10.000 | false | 10 |
2020-01-01 00:00:11.000 | true | NULL |
2020-01-01 00:00:12.000 | true | NULL |
2020-01-01 00:00:13.000 | true | NULL |
2020-01-01 00:00:14.000 | true | NULL |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | NULL |
2020-01-01 00:00:17.000 | true | NULL |
2020-01-01 00:00:18.000 | true | NULL |
2020-01-01 00:00:19.000 | true | NULL |
2020-01-01 00:00:20.000 | true | NULL |
2020-01-01 00:00:21.000 | false | 21 |
2020-01-01 00:00:22.000 | true | NULL |
2020-01-01 00:00:23.000 | true | NULL |
2020-01-01 00:00:24.000 | true | NULL |
2020-01-01 00:00:25.000 | true | NULL |
2020-01-01 00:00:26.000 | true | NULL |
2020-01-01 00:00:27.000 | true | NULL |
2020-01-01 00:00:28.000 | true | NULL |
2020-01-01 00:00:29.000 | true | NULL |
2020-01-01 00:00:30.000 | true | NULL |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(value, 1);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | false | 0 |
2020-01-01 00:00:01.000 | false | 1 |
2020-01-01 00:00:02.000 | true | 1 |
2020-01-01 00:00:03.000 | false | 3 |
2020-01-01 00:00:04.000 | true | 1 |
2020-01-01 00:00:05.000 | true | 1 |
2020-01-01 00:00:06.000 | false | 6 |
2020-01-01 00:00:07.000 | true | 1 |
2020-01-01 00:00:08.000 | true | 1 |
2020-01-01 00:00:09.000 | true | 1 |
2020-01-01 00:00:10.000 | false | 10 |
2020-01-01 00:00:11.000 | true | 1 |
2020-01-01 00:00:12.000 | true | 1 |
2020-01-01 00:00:13.000 | true | 1 |
2020-01-01 00:00:14.000 | true | 1 |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 1 |
2020-01-01 00:00:17.000 | true | 1 |
2020-01-01 00:00:18.000 | true | 1 |
2020-01-01 00:00:19.000 | true | 1 |
2020-01-01 00:00:20.000 | true | 1 |
2020-01-01 00:00:21.000 | false | 21 |
2020-01-01 00:00:22.000 | true | 1 |
2020-01-01 00:00:23.000 | true | 1 |
2020-01-01 00:00:24.000 | true | 1 |
2020-01-01 00:00:25.000 | true | 1 |
2020-01-01 00:00:26.000 | true | 1 |
2020-01-01 00:00:27.000 | true | 1 |
2020-01-01 00:00:28.000 | true | 1 |
2020-01-01 00:00:29.000 | true | 1 |
2020-01-01 00:00:30.000 | true | 1 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(prev);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | false | 0 |
2020-01-01 00:00:01.000 | false | 1 |
2020-01-01 00:00:02.000 | true | 1 |
2020-01-01 00:00:03.000 | false | 3 |
2020-01-01 00:00:04.000 | true | 3 |
2020-01-01 00:00:05.000 | true | 3 |
2020-01-01 00:00:06.000 | false | 6 |
2020-01-01 00:00:07.000 | true | 6 |
2020-01-01 00:00:08.000 | true | 6 |
2020-01-01 00:00:09.000 | true | 6 |
2020-01-01 00:00:10.000 | false | 10 |
2020-01-01 00:00:11.000 | true | 10 |
2020-01-01 00:00:12.000 | true | 10 |
2020-01-01 00:00:13.000 | true | 10 |
2020-01-01 00:00:14.000 | true | 10 |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 15 |
2020-01-01 00:00:17.000 | true | 15 |
2020-01-01 00:00:18.000 | true | 15 |
2020-01-01 00:00:19.000 | true | 15 |
2020-01-01 00:00:20.000 | true | 15 |
2020-01-01 00:00:21.000 | false | 21 |
2020-01-01 00:00:22.000 | true | 21 |
2020-01-01 00:00:23.000 | true | 21 |
2020-01-01 00:00:24.000 | true | 21 |
2020-01-01 00:00:25.000 | true | 21 |
2020-01-01 00:00:26.000 | true | 21 |
2020-01-01 00:00:27.000 | true | 21 |
2020-01-01 00:00:28.000 | true | 21 |
2020-01-01 00:00:29.000 | true | 21 |
2020-01-01 00:00:30.000 | true | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(next);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | false | 0 |
2020-01-01 00:00:01.000 | false | 1 |
2020-01-01 00:00:02.000 | true | 3 |
2020-01-01 00:00:03.000 | false | 3 |
2020-01-01 00:00:04.000 | true | 6 |
2020-01-01 00:00:05.000 | true | 6 |
2020-01-01 00:00:06.000 | false | 6 |
2020-01-01 00:00:07.000 | true | 10 |
2020-01-01 00:00:08.000 | true | 10 |
2020-01-01 00:00:09.000 | true | 10 |
2020-01-01 00:00:10.000 | false | 10 |
2020-01-01 00:00:11.000 | true | 15 |
2020-01-01 00:00:12.000 | true | 15 |
2020-01-01 00:00:13.000 | true | 15 |
2020-01-01 00:00:14.000 | true | 15 |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 21 |
2020-01-01 00:00:17.000 | true | 21 |
2020-01-01 00:00:18.000 | true | 21 |
2020-01-01 00:00:19.000 | true | 21 |
2020-01-01 00:00:20.000 | true | 21 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(linear);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | false | 0 |
2020-01-01 00:00:01.000 | false | 1 |
2020-01-01 00:00:02.000 | true | 2 |
2020-01-01 00:00:03.000 | false | 3 |
2020-01-01 00:00:04.000 | true | 4 |
2020-01-01 00:00:05.000 | true | 5 |
2020-01-01 00:00:06.000 | false | 6 |
2020-01-01 00:00:07.000 | true | 7 |
2020-01-01 00:00:08.000 | true | 8 |
2020-01-01 00:00:09.000 | true | 9 |
2020-01-01 00:00:10.000 | false | 10 |
2020-01-01 00:00:11.000 | true | 11 |
2020-01-01 00:00:12.000 | true | 12 |
2020-01-01 00:00:13.000 | true | 13 |
2020-01-01 00:00:14.000 | true | 14 |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 16 |
2020-01-01 00:00:17.000 | true | 17 |
2020-01-01 00:00:18.000 | true | 18 |
2020-01-01 00:00:19.000 | true | 19 |
2020-01-01 00:00:20.000 | true | 20 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(null);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | false | 0 |
2020-01-01 00:00:01.000 | false | 1 |
2020-01-01 00:00:02.000 | true | NULL |
2020-01-01 00:00:03.000 | false | 3 |
2020-01-01 00:00:04.000 | true | NULL |
2020-01-01 00:00:05.000 | true | NULL |
2020-01-01 00:00:06.000 | false | 6 |
2020-01-01 00:00:07.000 | true | NULL |
2020-01-01 00:00:08.000 | true | NULL |
2020-01-01 00:00:09.000 | true | NULL |
2020-01-01 00:00:10.000 | false | 10 |
2020-01-01 00:00:11.000 | true | NULL |
2020-01-01 00:00:12.000 | true | NULL |
2020-01-01 00:00:13.000 | true | NULL |
2020-01-01 00:00:14.000 | true | NULL |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | NULL |
2020-01-01 00:00:17.000 | true | NULL |
2020-01-01 00:00:18.000 | true | NULL |
2020-01-01 00:00:19.000 | true | NULL |
2020-01-01 00:00:20.000 | true | NULL |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(value, 1);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | false | 0 |
2020-01-01 00:00:01.000 | false | 1 |
2020-01-01 00:00:02.000 | true | 1 |
2020-01-01 00:00:03.000 | false | 3 |
2020-01-01 00:00:04.000 | true | 1 |
2020-01-01 00:00:05.000 | true | 1 |
2020-01-01 00:00:06.000 | false | 6 |
2020-01-01 00:00:07.000 | true | 1 |
2020-01-01 00:00:08.000 | true | 1 |
2020-01-01 00:00:09.000 | true | 1 |
2020-01-01 00:00:10.000 | false | 10 |
2020-01-01 00:00:11.000 | true | 1 |
2020-01-01 00:00:12.000 | true | 1 |
2020-01-01 00:00:13.000 | true | 1 |
2020-01-01 00:00:14.000 | true | 1 |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 1 |
2020-01-01 00:00:17.000 | true | 1 |
2020-01-01 00:00:18.000 | true | 1 |
2020-01-01 00:00:19.000 | true | 1 |
2020-01-01 00:00:20.000 | true | 1 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | false | 0 |
2020-01-01 00:00:01.000 | false | 1 |
2020-01-01 00:00:02.000 | true | 1 |
2020-01-01 00:00:03.000 | false | 3 |
2020-01-01 00:00:04.000 | true | 3 |
2020-01-01 00:00:05.000 | true | 3 |
2020-01-01 00:00:06.000 | false | 6 |
2020-01-01 00:00:07.000 | true | 6 |
2020-01-01 00:00:08.000 | true | 6 |
2020-01-01 00:00:09.000 | true | 6 |
2020-01-01 00:00:10.000 | false | 10 |
2020-01-01 00:00:11.000 | true | 10 |
2020-01-01 00:00:12.000 | true | 10 |
2020-01-01 00:00:13.000 | true | 10 |
2020-01-01 00:00:14.000 | true | 10 |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 15 |
2020-01-01 00:00:17.000 | true | 15 |
2020-01-01 00:00:18.000 | true | 15 |
2020-01-01 00:00:19.000 | true | 15 |
2020-01-01 00:00:20.000 | true | 15 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | false | 0 |
2020-01-01 00:00:01.000 | false | 1 |
2020-01-01 00:00:02.000 | true | 3 |
2020-01-01 00:00:03.000 | false | 3 |
2020-01-01 00:00:04.000 | true | 6 |
2020-01-01 00:00:05.000 | true | 6 |
2020-01-01 00:00:06.000 | false | 6 |
2020-01-01 00:00:07.000 | true | 10 |
2020-01-01 00:00:08.000 | true | 10 |
2020-01-01 00:00:09.000 | true | 10 |
2020-01-01 00:00:10.000 | false | 10 |
2020-01-01 00:00:11.000 | true | 15 |
2020-01-01 00:00:12.000 | true | 15 |
2020-01-01 00:00:13.000 | true | 15 |
2020-01-01 00:00:14.000 | true | 15 |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 21 |
2020-01-01 00:00:17.000 | true | 21 |
2020-01-01 00:00:18.000 | true | 21 |
2020-01-01 00:00:19.000 | true | 21 |
2020-01-01 00:00:20.000 | true | 21 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | false | 0 |
2020-01-01 00:00:01.000 | false | 1 |
2020-01-01 00:00:02.000 | true | 2 |
2020-01-01 00:00:03.000 | false | 3 |
2020-01-01 00:00:04.000 | true | 4 |
2020-01-01 00:00:05.000 | true | 5 |
2020-01-01 00:00:06.000 | false | 6 |
2020-01-01 00:00:07.000 | true | 7 |
2020-01-01 00:00:08.000 | true | 8 |
2020-01-01 00:00:09.000 | true | 9 |
2020-01-01 00:00:10.000 | false | 10 |
2020-01-01 00:00:11.000 | true | 11 |
2020-01-01 00:00:12.000 | true | 12 |
2020-01-01 00:00:13.000 | true | 13 |
2020-01-01 00:00:14.000 | true | 14 |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 16 |
2020-01-01 00:00:17.000 | true | 17 |
2020-01-01 00:00:18.000 | true | 18 |
2020-01-01 00:00:19.000 | true | 19 |
2020-01-01 00:00:20.000 | true | 20 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(null);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | true | NULL |
2020-01-01 00:00:01.000 | true | NULL |
2020-01-01 00:00:02.000 | true | NULL |
2020-01-01 00:00:03.000 | true | NULL |
2020-01-01 00:00:04.000 | true | NULL |
2020-01-01 00:00:05.000 | true | NULL |
2020-01-01 00:00:06.000 | true | NULL |
2020-01-01 00:00:07.000 | true | NULL |
2020-01-01 00:00:08.000 | true | NULL |
2020-01-01 00:00:09.000 | true | NULL |
2020-01-01 00:00:10.000 | true | NULL |
2020-01-01 00:00:11.000 | true | NULL |
2020-01-01 00:00:12.000 | true | NULL |
2020-01-01 00:00:13.000 | true | NULL |
2020-01-01 00:00:14.000 | true | NULL |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | NULL |
2020-01-01 00:00:17.000 | true | NULL |
2020-01-01 00:00:18.000 | true | NULL |
2020-01-01 00:00:19.000 | true | NULL |
2020-01-01 00:00:20.000 | true | NULL |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(value, 1);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | true | 1 |
2020-01-01 00:00:01.000 | true | 1 |
2020-01-01 00:00:02.000 | true | 1 |
2020-01-01 00:00:03.000 | true | 1 |
2020-01-01 00:00:04.000 | true | 1 |
2020-01-01 00:00:05.000 | true | 1 |
2020-01-01 00:00:06.000 | true | 1 |
2020-01-01 00:00:07.000 | true | 1 |
2020-01-01 00:00:08.000 | true | 1 |
2020-01-01 00:00:09.000 | true | 1 |
2020-01-01 00:00:10.000 | true | 1 |
2020-01-01 00:00:11.000 | true | 1 |
2020-01-01 00:00:12.000 | true | 1 |
2020-01-01 00:00:13.000 | true | 1 |
2020-01-01 00:00:14.000 | true | 1 |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 1 |
2020-01-01 00:00:17.000 | true | 1 |
2020-01-01 00:00:18.000 | true | 1 |
2020-01-01 00:00:19.000 | true | 1 |
2020-01-01 00:00:20.000 | true | 1 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 15 |
2020-01-01 00:00:17.000 | true | 15 |
2020-01-01 00:00:18.000 | true | 15 |
2020-01-01 00:00:19.000 | true | 15 |
2020-01-01 00:00:20.000 | true | 15 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | true | 15 |
2020-01-01 00:00:01.000 | true | 15 |
2020-01-01 00:00:02.000 | true | 15 |
2020-01-01 00:00:03.000 | true | 15 |
2020-01-01 00:00:04.000 | true | 15 |
2020-01-01 00:00:05.000 | true | 15 |
2020-01-01 00:00:06.000 | true | 15 |
2020-01-01 00:00:07.000 | true | 15 |
2020-01-01 00:00:08.000 | true | 15 |
2020-01-01 00:00:09.000 | true | 15 |
2020-01-01 00:00:10.000 | true | 15 |
2020-01-01 00:00:11.000 | true | 15 |
2020-01-01 00:00:12.000 | true | 15 |
2020-01-01 00:00:13.000 | true | 15 |
2020-01-01 00:00:14.000 | true | 15 |
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 21 |
2020-01-01 00:00:17.000 | true | 21 |
2020-01-01 00:00:18.000 | true | 21 |
2020-01-01 00:00:19.000 | true | 21 |
2020-01-01 00:00:20.000 | true | 21 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:15.000 | false | 15 |
2020-01-01 00:00:16.000 | true | 16 |
2020-01-01 00:00:17.000 | true | 17 |
2020-01-01 00:00:18.000 | true | 18 |
2020-01-01 00:00:19.000 | true | 19 |
2020-01-01 00:00:20.000 | true | 20 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(null);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | true | NULL |
2020-01-01 00:00:01.000 | true | NULL |
2020-01-01 00:00:02.000 | true | NULL |
2020-01-01 00:00:03.000 | true | NULL |
2020-01-01 00:00:04.000 | true | NULL |
2020-01-01 00:00:05.000 | true | NULL |
2020-01-01 00:00:06.000 | true | NULL |
2020-01-01 00:00:07.000 | true | NULL |
2020-01-01 00:00:08.000 | true | NULL |
2020-01-01 00:00:09.000 | true | NULL |
2020-01-01 00:00:10.000 | true | NULL |
2020-01-01 00:00:11.000 | true | NULL |
2020-01-01 00:00:12.000 | true | NULL |
2020-01-01 00:00:13.000 | true | NULL |
2020-01-01 00:00:14.000 | true | NULL |
2020-01-01 00:00:15.000 | true | NULL |
2020-01-01 00:00:16.000 | true | NULL |
2020-01-01 00:00:17.000 | true | NULL |
2020-01-01 00:00:18.000 | true | NULL |
2020-01-01 00:00:19.000 | true | NULL |
2020-01-01 00:00:20.000 | true | NULL |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(value, 1);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | true | 1 |
2020-01-01 00:00:01.000 | true | 1 |
2020-01-01 00:00:02.000 | true | 1 |
2020-01-01 00:00:03.000 | true | 1 |
2020-01-01 00:00:04.000 | true | 1 |
2020-01-01 00:00:05.000 | true | 1 |
2020-01-01 00:00:06.000 | true | 1 |
2020-01-01 00:00:07.000 | true | 1 |
2020-01-01 00:00:08.000 | true | 1 |
2020-01-01 00:00:09.000 | true | 1 |
2020-01-01 00:00:10.000 | true | 1 |
2020-01-01 00:00:11.000 | true | 1 |
2020-01-01 00:00:12.000 | true | 1 |
2020-01-01 00:00:13.000 | true | 1 |
2020-01-01 00:00:14.000 | true | 1 |
2020-01-01 00:00:15.000 | true | 1 |
2020-01-01 00:00:16.000 | true | 1 |
2020-01-01 00:00:17.000 | true | 1 |
2020-01-01 00:00:18.000 | true | 1 |
2020-01-01 00:00:19.000 | true | 1 |
2020-01-01 00:00:20.000 | true | 1 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:00.000 | true | 21 |
2020-01-01 00:00:01.000 | true | 21 |
2020-01-01 00:00:02.000 | true | 21 |
2020-01-01 00:00:03.000 | true | 21 |
2020-01-01 00:00:04.000 | true | 21 |
2020-01-01 00:00:05.000 | true | 21 |
2020-01-01 00:00:06.000 | true | 21 |
2020-01-01 00:00:07.000 | true | 21 |
2020-01-01 00:00:08.000 | true | 21 |
2020-01-01 00:00:09.000 | true | 21 |
2020-01-01 00:00:10.000 | true | 21 |
2020-01-01 00:00:11.000 | true | 21 |
2020-01-01 00:00:12.000 | true | 21 |
2020-01-01 00:00:13.000 | true | 21 |
2020-01-01 00:00:14.000 | true | 21 |
2020-01-01 00:00:15.000 | true | 21 |
2020-01-01 00:00:16.000 | true | 21 |
2020-01-01 00:00:17.000 | true | 21 |
2020-01-01 00:00:18.000 | true | 21 |
2020-01-01 00:00:19.000 | true | 21 |
2020-01-01 00:00:20.000 | true | 21 |
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);
_irowts | _isfilled | interp(c1) |
====================================================
2020-01-01 00:00:21.000 | false | 21 |
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(null);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(value, 1);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);

1 taos> select _irowts as irowts ,tbname as table_name, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (null) order by irowts;
366 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:20' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(next);
367 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:20' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(linear);
368 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(null);
369 _irowts | _isfilled | interp(c1) |
370 ====================================================
371 2020-01-01 00:00:21.000 | false | 21 |
372 2020-01-01 00:00:22.000 | true | NULL |
373 2020-01-01 00:00:23.000 | true | NULL |
374 2020-01-01 00:00:24.000 | true | NULL |
375 2020-01-01 00:00:25.000 | true | NULL |
376 2020-01-01 00:00:26.000 | true | NULL |
377 2020-01-01 00:00:27.000 | true | NULL |
378 2020-01-01 00:00:28.000 | true | NULL |
379 2020-01-01 00:00:29.000 | true | NULL |
380 2020-01-01 00:00:30.000 | true | NULL |
381 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(value, 1);
382 _irowts | _isfilled | interp(c1) |
383 ====================================================
384 2020-01-01 00:00:21.000 | false | 21 |
385 2020-01-01 00:00:22.000 | true | 1 |
386 2020-01-01 00:00:23.000 | true | 1 |
387 2020-01-01 00:00:24.000 | true | 1 |
388 2020-01-01 00:00:25.000 | true | 1 |
389 2020-01-01 00:00:26.000 | true | 1 |
390 2020-01-01 00:00:27.000 | true | 1 |
391 2020-01-01 00:00:28.000 | true | 1 |
392 2020-01-01 00:00:29.000 | true | 1 |
393 2020-01-01 00:00:30.000 | true | 1 |
394 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(prev);
395 _irowts | _isfilled | interp(c1) |
396 ====================================================
397 2020-01-01 00:00:21.000 | false | 21 |
398 2020-01-01 00:00:22.000 | true | 21 |
399 2020-01-01 00:00:23.000 | true | 21 |
400 2020-01-01 00:00:24.000 | true | 21 |
401 2020-01-01 00:00:25.000 | true | 21 |
402 2020-01-01 00:00:26.000 | true | 21 |
403 2020-01-01 00:00:27.000 | true | 21 |
404 2020-01-01 00:00:28.000 | true | 21 |
405 2020-01-01 00:00:29.000 | true | 21 |
406 2020-01-01 00:00:30.000 | true | 21 |
407 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(next);
408 _irowts | _isfilled | interp(c1) |
409 ====================================================
410 2020-01-01 00:00:21.000 | false | 21 |
411 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(linear);
412 _irowts | _isfilled | interp(c1) |
413 ====================================================
414 2020-01-01 00:00:21.000 | false | 21 |
415 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(null);
416 _irowts | _isfilled | interp(c1) |
417 ====================================================
418 2020-01-01 00:00:15.000 | false | 15 |
419 2020-01-01 00:00:16.000 | true | NULL |
420 2020-01-01 00:00:17.000 | true | NULL |
421 2020-01-01 00:00:18.000 | true | NULL |
422 2020-01-01 00:00:19.000 | true | NULL |
423 2020-01-01 00:00:20.000 | true | NULL |
424 2020-01-01 00:00:21.000 | false | 21 |
425 2020-01-01 00:00:22.000 | true | NULL |
426 2020-01-01 00:00:23.000 | true | NULL |
427 2020-01-01 00:00:24.000 | true | NULL |
428 2020-01-01 00:00:25.000 | true | NULL |
429 2020-01-01 00:00:26.000 | true | NULL |
430 2020-01-01 00:00:27.000 | true | NULL |
431 2020-01-01 00:00:28.000 | true | NULL |
432 2020-01-01 00:00:29.000 | true | NULL |
433 2020-01-01 00:00:30.000 | true | NULL |
434 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(value, 1);
435 _irowts | _isfilled | interp(c1) |
436 ====================================================
437 2020-01-01 00:00:15.000 | false | 15 |
438 2020-01-01 00:00:16.000 | true | 1 |
439 2020-01-01 00:00:17.000 | true | 1 |
440 2020-01-01 00:00:18.000 | true | 1 |
441 2020-01-01 00:00:19.000 | true | 1 |
442 2020-01-01 00:00:20.000 | true | 1 |
443 2020-01-01 00:00:21.000 | false | 21 |
444 2020-01-01 00:00:22.000 | true | 1 |
445 2020-01-01 00:00:23.000 | true | 1 |
446 2020-01-01 00:00:24.000 | true | 1 |
447 2020-01-01 00:00:25.000 | true | 1 |
448 2020-01-01 00:00:26.000 | true | 1 |
449 2020-01-01 00:00:27.000 | true | 1 |
450 2020-01-01 00:00:28.000 | true | 1 |
451 2020-01-01 00:00:29.000 | true | 1 |
452 2020-01-01 00:00:30.000 | true | 1 |
453 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(prev);
454 _irowts | _isfilled | interp(c1) |
455 ====================================================
456 2020-01-01 00:00:15.000 | false | 15 |
457 2020-01-01 00:00:16.000 | true | 15 |
458 2020-01-01 00:00:17.000 | true | 15 |
459 2020-01-01 00:00:18.000 | true | 15 |
460 2020-01-01 00:00:19.000 | true | 15 |
461 2020-01-01 00:00:20.000 | true | 15 |
462 2020-01-01 00:00:21.000 | false | 21 |
463 2020-01-01 00:00:22.000 | true | 21 |
464 2020-01-01 00:00:23.000 | true | 21 |
465 2020-01-01 00:00:24.000 | true | 21 |
466 2020-01-01 00:00:25.000 | true | 21 |
467 2020-01-01 00:00:26.000 | true | 21 |
468 2020-01-01 00:00:27.000 | true | 21 |
469 2020-01-01 00:00:28.000 | true | 21 |
470 2020-01-01 00:00:29.000 | true | 21 |
471 2020-01-01 00:00:30.000 | true | 21 |
472 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(next);
473 _irowts | _isfilled | interp(c1) |
474 ====================================================
475 2020-01-01 00:00:15.000 | false | 15 |
476 2020-01-01 00:00:16.000 | true | 21 |
477 2020-01-01 00:00:17.000 | true | 21 |
478 2020-01-01 00:00:18.000 | true | 21 |
479 2020-01-01 00:00:19.000 | true | 21 |
480 2020-01-01 00:00:20.000 | true | 21 |
481 2020-01-01 00:00:21.000 | false | 21 |
482 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(linear);
483 _irowts | _isfilled | interp(c1) |
484 ====================================================
485 2020-01-01 00:00:15.000 | false | 15 |
486 2020-01-01 00:00:16.000 | true | 16 |
487 2020-01-01 00:00:17.000 | true | 17 |
488 2020-01-01 00:00:18.000 | true | 18 |
489 2020-01-01 00:00:19.000 | true | 19 |
490 2020-01-01 00:00:20.000 | true | 20 |
491 2020-01-01 00:00:21.000 | false | 21 |
492 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(null);
493 _irowts | _isfilled | interp(c1) |
494 ====================================================
495 2020-01-01 00:00:00.000 | false | 0 |
496 2020-01-01 00:00:01.000 | false | 1 |
497 2020-01-01 00:00:02.000 | true | NULL |
498 2020-01-01 00:00:03.000 | false | 3 |
499 2020-01-01 00:00:04.000 | true | NULL |
500 2020-01-01 00:00:05.000 | true | NULL |
501 2020-01-01 00:00:06.000 | false | 6 |
502 2020-01-01 00:00:07.000 | true | NULL |
503 2020-01-01 00:00:08.000 | true | NULL |
504 2020-01-01 00:00:09.000 | true | NULL |
505 2020-01-01 00:00:10.000 | false | 10 |
506 2020-01-01 00:00:11.000 | true | NULL |
507 2020-01-01 00:00:12.000 | true | NULL |
508 2020-01-01 00:00:13.000 | true | NULL |
509 2020-01-01 00:00:14.000 | true | NULL |
510 2020-01-01 00:00:15.000 | false | 15 |
511 2020-01-01 00:00:16.000 | true | NULL |
512 2020-01-01 00:00:17.000 | true | NULL |
513 2020-01-01 00:00:18.000 | true | NULL |
514 2020-01-01 00:00:19.000 | true | NULL |
515 2020-01-01 00:00:20.000 | true | NULL |
516 2020-01-01 00:00:21.000 | false | 21 |
517 2020-01-01 00:00:22.000 | true | NULL |
518 2020-01-01 00:00:23.000 | true | NULL |
519 2020-01-01 00:00:24.000 | true | NULL |
520 2020-01-01 00:00:25.000 | true | NULL |
521 2020-01-01 00:00:26.000 | true | NULL |
522 2020-01-01 00:00:27.000 | true | NULL |
523 2020-01-01 00:00:28.000 | true | NULL |
524 2020-01-01 00:00:29.000 | true | NULL |
525 2020-01-01 00:00:30.000 | true | NULL |
526 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(value, 1);
527 _irowts | _isfilled | interp(c1) |
528 ====================================================
529 2020-01-01 00:00:00.000 | false | 0 |
530 2020-01-01 00:00:01.000 | false | 1 |
531 2020-01-01 00:00:02.000 | true | 1 |
532 2020-01-01 00:00:03.000 | false | 3 |
533 2020-01-01 00:00:04.000 | true | 1 |
534 2020-01-01 00:00:05.000 | true | 1 |
535 2020-01-01 00:00:06.000 | false | 6 |
536 2020-01-01 00:00:07.000 | true | 1 |
537 2020-01-01 00:00:08.000 | true | 1 |
538 2020-01-01 00:00:09.000 | true | 1 |
539 2020-01-01 00:00:10.000 | false | 10 |
540 2020-01-01 00:00:11.000 | true | 1 |
541 2020-01-01 00:00:12.000 | true | 1 |
542 2020-01-01 00:00:13.000 | true | 1 |
543 2020-01-01 00:00:14.000 | true | 1 |
544 2020-01-01 00:00:15.000 | false | 15 |
545 2020-01-01 00:00:16.000 | true | 1 |
546 2020-01-01 00:00:17.000 | true | 1 |
547 2020-01-01 00:00:18.000 | true | 1 |
548 2020-01-01 00:00:19.000 | true | 1 |
549 2020-01-01 00:00:20.000 | true | 1 |
550 2020-01-01 00:00:21.000 | false | 21 |
551 2020-01-01 00:00:22.000 | true | 1 |
552 2020-01-01 00:00:23.000 | true | 1 |
553 2020-01-01 00:00:24.000 | true | 1 |
554 2020-01-01 00:00:25.000 | true | 1 |
555 2020-01-01 00:00:26.000 | true | 1 |
556 2020-01-01 00:00:27.000 | true | 1 |
557 2020-01-01 00:00:28.000 | true | 1 |
558 2020-01-01 00:00:29.000 | true | 1 |
559 2020-01-01 00:00:30.000 | true | 1 |
560 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(prev);
561 _irowts | _isfilled | interp(c1) |
562 ====================================================
563 2020-01-01 00:00:00.000 | false | 0 |
564 2020-01-01 00:00:01.000 | false | 1 |
565 2020-01-01 00:00:02.000 | true | 1 |
566 2020-01-01 00:00:03.000 | false | 3 |
567 2020-01-01 00:00:04.000 | true | 3 |
568 2020-01-01 00:00:05.000 | true | 3 |
569 2020-01-01 00:00:06.000 | false | 6 |
570 2020-01-01 00:00:07.000 | true | 6 |
571 2020-01-01 00:00:08.000 | true | 6 |
572 2020-01-01 00:00:09.000 | true | 6 |
573 2020-01-01 00:00:10.000 | false | 10 |
574 2020-01-01 00:00:11.000 | true | 10 |
575 2020-01-01 00:00:12.000 | true | 10 |
576 2020-01-01 00:00:13.000 | true | 10 |
577 2020-01-01 00:00:14.000 | true | 10 |
578 2020-01-01 00:00:15.000 | false | 15 |
579 2020-01-01 00:00:16.000 | true | 15 |
580 2020-01-01 00:00:17.000 | true | 15 |
581 2020-01-01 00:00:18.000 | true | 15 |
582 2020-01-01 00:00:19.000 | true | 15 |
583 2020-01-01 00:00:20.000 | true | 15 |
584 2020-01-01 00:00:21.000 | false | 21 |
585 2020-01-01 00:00:22.000 | true | 21 |
586 2020-01-01 00:00:23.000 | true | 21 |
587 2020-01-01 00:00:24.000 | true | 21 |
588 2020-01-01 00:00:25.000 | true | 21 |
589 2020-01-01 00:00:26.000 | true | 21 |
590 2020-01-01 00:00:27.000 | true | 21 |
591 2020-01-01 00:00:28.000 | true | 21 |
592 2020-01-01 00:00:29.000 | true | 21 |
593 2020-01-01 00:00:30.000 | true | 21 |
594 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(next);
595 _irowts | _isfilled | interp(c1) |
596 ====================================================
597 2020-01-01 00:00:00.000 | false | 0 |
598 2020-01-01 00:00:01.000 | false | 1 |
599 2020-01-01 00:00:02.000 | true | 3 |
600 2020-01-01 00:00:03.000 | false | 3 |
601 2020-01-01 00:00:04.000 | true | 6 |
602 2020-01-01 00:00:05.000 | true | 6 |
603 2020-01-01 00:00:06.000 | false | 6 |
604 2020-01-01 00:00:07.000 | true | 10 |
605 2020-01-01 00:00:08.000 | true | 10 |
606 2020-01-01 00:00:09.000 | true | 10 |
607 2020-01-01 00:00:10.000 | false | 10 |
608 2020-01-01 00:00:11.000 | true | 15 |
609 2020-01-01 00:00:12.000 | true | 15 |
610 2020-01-01 00:00:13.000 | true | 15 |
611 2020-01-01 00:00:14.000 | true | 15 |
612 2020-01-01 00:00:15.000 | false | 15 |
613 2020-01-01 00:00:16.000 | true | 21 |
614 2020-01-01 00:00:17.000 | true | 21 |
615 2020-01-01 00:00:18.000 | true | 21 |
616 2020-01-01 00:00:19.000 | true | 21 |
617 2020-01-01 00:00:20.000 | true | 21 |
618 2020-01-01 00:00:21.000 | false | 21 |
619 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(linear);
620 _irowts | _isfilled | interp(c1) |
621 ====================================================
622 2020-01-01 00:00:00.000 | false | 0 |
623 2020-01-01 00:00:01.000 | false | 1 |
624 2020-01-01 00:00:02.000 | true | 2 |
625 2020-01-01 00:00:03.000 | false | 3 |
626 2020-01-01 00:00:04.000 | true | 4 |
627 2020-01-01 00:00:05.000 | true | 5 |
628 2020-01-01 00:00:06.000 | false | 6 |
629 2020-01-01 00:00:07.000 | true | 7 |
630 2020-01-01 00:00:08.000 | true | 8 |
631 2020-01-01 00:00:09.000 | true | 9 |
632 2020-01-01 00:00:10.000 | false | 10 |
633 2020-01-01 00:00:11.000 | true | 11 |
634 2020-01-01 00:00:12.000 | true | 12 |
635 2020-01-01 00:00:13.000 | true | 13 |
636 2020-01-01 00:00:14.000 | true | 14 |
637 2020-01-01 00:00:15.000 | false | 15 |
638 2020-01-01 00:00:16.000 | true | 16 |
639 2020-01-01 00:00:17.000 | true | 17 |
640 2020-01-01 00:00:18.000 | true | 18 |
641 2020-01-01 00:00:19.000 | true | 19 |
642 2020-01-01 00:00:20.000 | true | 20 |
643 2020-01-01 00:00:21.000 | false | 21 |
644 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(null);
645 _irowts | _isfilled | interp(c1) |
646 ====================================================
647 2020-01-01 00:00:00.000 | false | 0 |
648 2020-01-01 00:00:01.000 | false | 1 |
649 2020-01-01 00:00:02.000 | true | NULL |
650 2020-01-01 00:00:03.000 | false | 3 |
651 2020-01-01 00:00:04.000 | true | NULL |
652 2020-01-01 00:00:05.000 | true | NULL |
653 2020-01-01 00:00:06.000 | false | 6 |
654 2020-01-01 00:00:07.000 | true | NULL |
655 2020-01-01 00:00:08.000 | true | NULL |
656 2020-01-01 00:00:09.000 | true | NULL |
657 2020-01-01 00:00:10.000 | false | 10 |
658 2020-01-01 00:00:11.000 | true | NULL |
659 2020-01-01 00:00:12.000 | true | NULL |
660 2020-01-01 00:00:13.000 | true | NULL |
661 2020-01-01 00:00:14.000 | true | NULL |
662 2020-01-01 00:00:15.000 | false | 15 |
663 2020-01-01 00:00:16.000 | true | NULL |
664 2020-01-01 00:00:17.000 | true | NULL |
665 2020-01-01 00:00:18.000 | true | NULL |
666 2020-01-01 00:00:19.000 | true | NULL |
667 2020-01-01 00:00:20.000 | true | NULL |
668 2020-01-01 00:00:21.000 | false | 21 |
669 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(value, 1);
670 _irowts | _isfilled | interp(c1) |
671 ====================================================
672 2020-01-01 00:00:00.000 | false | 0 |
673 2020-01-01 00:00:01.000 | false | 1 |
674 2020-01-01 00:00:02.000 | true | 1 |
675 2020-01-01 00:00:03.000 | false | 3 |
676 2020-01-01 00:00:04.000 | true | 1 |
677 2020-01-01 00:00:05.000 | true | 1 |
678 2020-01-01 00:00:06.000 | false | 6 |
679 2020-01-01 00:00:07.000 | true | 1 |
680 2020-01-01 00:00:08.000 | true | 1 |
681 2020-01-01 00:00:09.000 | true | 1 |
682 2020-01-01 00:00:10.000 | false | 10 |
683 2020-01-01 00:00:11.000 | true | 1 |
684 2020-01-01 00:00:12.000 | true | 1 |
685 2020-01-01 00:00:13.000 | true | 1 |
686 2020-01-01 00:00:14.000 | true | 1 |
687 2020-01-01 00:00:15.000 | false | 15 |
688 2020-01-01 00:00:16.000 | true | 1 |
689 2020-01-01 00:00:17.000 | true | 1 |
690 2020-01-01 00:00:18.000 | true | 1 |
691 2020-01-01 00:00:19.000 | true | 1 |
692 2020-01-01 00:00:20.000 | true | 1 |
693 2020-01-01 00:00:21.000 | false | 21 |
694 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
695 _irowts | _isfilled | interp(c1) |
696 ====================================================
697 2020-01-01 00:00:00.000 | false | 0 |
698 2020-01-01 00:00:01.000 | false | 1 |
699 2020-01-01 00:00:02.000 | true | 1 |
700 2020-01-01 00:00:03.000 | false | 3 |
701 2020-01-01 00:00:04.000 | true | 3 |
702 2020-01-01 00:00:05.000 | true | 3 |
703 2020-01-01 00:00:06.000 | false | 6 |
704 2020-01-01 00:00:07.000 | true | 6 |
705 2020-01-01 00:00:08.000 | true | 6 |
706 2020-01-01 00:00:09.000 | true | 6 |
707 2020-01-01 00:00:10.000 | false | 10 |
708 2020-01-01 00:00:11.000 | true | 10 |
709 2020-01-01 00:00:12.000 | true | 10 |
710 2020-01-01 00:00:13.000 | true | 10 |
711 2020-01-01 00:00:14.000 | true | 10 |
712 2020-01-01 00:00:15.000 | false | 15 |
713 2020-01-01 00:00:16.000 | true | 15 |
714 2020-01-01 00:00:17.000 | true | 15 |
715 2020-01-01 00:00:18.000 | true | 15 |
716 2020-01-01 00:00:19.000 | true | 15 |
717 2020-01-01 00:00:20.000 | true | 15 |
718 2020-01-01 00:00:21.000 | false | 21 |
719 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
720 _irowts | _isfilled | interp(c1) |
721 ====================================================
722 2020-01-01 00:00:00.000 | false | 0 |
723 2020-01-01 00:00:01.000 | false | 1 |
724 2020-01-01 00:00:02.000 | true | 3 |
725 2020-01-01 00:00:03.000 | false | 3 |
726 2020-01-01 00:00:04.000 | true | 6 |
727 2020-01-01 00:00:05.000 | true | 6 |
728 2020-01-01 00:00:06.000 | false | 6 |
729 2020-01-01 00:00:07.000 | true | 10 |
730 2020-01-01 00:00:08.000 | true | 10 |
731 2020-01-01 00:00:09.000 | true | 10 |
732 2020-01-01 00:00:10.000 | false | 10 |
733 2020-01-01 00:00:11.000 | true | 15 |
734 2020-01-01 00:00:12.000 | true | 15 |
735 2020-01-01 00:00:13.000 | true | 15 |
736 2020-01-01 00:00:14.000 | true | 15 |
737 2020-01-01 00:00:15.000 | false | 15 |
738 2020-01-01 00:00:16.000 | true | 21 |
739 2020-01-01 00:00:17.000 | true | 21 |
740 2020-01-01 00:00:18.000 | true | 21 |
741 2020-01-01 00:00:19.000 | true | 21 |
742 2020-01-01 00:00:20.000 | true | 21 |
743 2020-01-01 00:00:21.000 | false | 21 |
744 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);
745 _irowts | _isfilled | interp(c1) |
746 ====================================================
747 2020-01-01 00:00:00.000 | false | 0 |
748 2020-01-01 00:00:01.000 | false | 1 |
749 2020-01-01 00:00:02.000 | true | 2 |
750 2020-01-01 00:00:03.000 | false | 3 |
751 2020-01-01 00:00:04.000 | true | 4 |
752 2020-01-01 00:00:05.000 | true | 5 |
753 2020-01-01 00:00:06.000 | false | 6 |
754 2020-01-01 00:00:07.000 | true | 7 |
755 2020-01-01 00:00:08.000 | true | 8 |
756 2020-01-01 00:00:09.000 | true | 9 |
757 2020-01-01 00:00:10.000 | false | 10 |
758 2020-01-01 00:00:11.000 | true | 11 |
759 2020-01-01 00:00:12.000 | true | 12 |
760 2020-01-01 00:00:13.000 | true | 13 |
761 2020-01-01 00:00:14.000 | true | 14 |
762 2020-01-01 00:00:15.000 | false | 15 |
763 2020-01-01 00:00:16.000 | true | 16 |
764 2020-01-01 00:00:17.000 | true | 17 |
765 2020-01-01 00:00:18.000 | true | 18 |
766 2020-01-01 00:00:19.000 | true | 19 |
767 2020-01-01 00:00:20.000 | true | 20 |
768 2020-01-01 00:00:21.000 | false | 21 |
769 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(null);
770 _irowts | _isfilled | interp(c1) |
771 ====================================================
772 2020-01-01 00:00:00.000 | true | NULL |
773 2020-01-01 00:00:01.000 | true | NULL |
774 2020-01-01 00:00:02.000 | true | NULL |
775 2020-01-01 00:00:03.000 | true | NULL |
776 2020-01-01 00:00:04.000 | true | NULL |
777 2020-01-01 00:00:05.000 | true | NULL |
778 2020-01-01 00:00:06.000 | true | NULL |
779 2020-01-01 00:00:07.000 | true | NULL |
780 2020-01-01 00:00:08.000 | true | NULL |
781 2020-01-01 00:00:09.000 | true | NULL |
782 2020-01-01 00:00:10.000 | true | NULL |
783 2020-01-01 00:00:11.000 | true | NULL |
784 2020-01-01 00:00:12.000 | true | NULL |
785 2020-01-01 00:00:13.000 | true | NULL |
786 2020-01-01 00:00:14.000 | true | NULL |
787 2020-01-01 00:00:15.000 | false | 15 |
788 2020-01-01 00:00:16.000 | true | NULL |
789 2020-01-01 00:00:17.000 | true | NULL |
790 2020-01-01 00:00:18.000 | true | NULL |
791 2020-01-01 00:00:19.000 | true | NULL |
792 2020-01-01 00:00:20.000 | true | NULL |
793 2020-01-01 00:00:21.000 | false | 21 |
794 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(value, 1);
795 _irowts | _isfilled | interp(c1) |
796 ====================================================
797 2020-01-01 00:00:00.000 | true | 1 |
798 2020-01-01 00:00:01.000 | true | 1 |
799 2020-01-01 00:00:02.000 | true | 1 |
800 2020-01-01 00:00:03.000 | true | 1 |
801 2020-01-01 00:00:04.000 | true | 1 |
802 2020-01-01 00:00:05.000 | true | 1 |
803 2020-01-01 00:00:06.000 | true | 1 |
804 2020-01-01 00:00:07.000 | true | 1 |
805 2020-01-01 00:00:08.000 | true | 1 |
806 2020-01-01 00:00:09.000 | true | 1 |
807 2020-01-01 00:00:10.000 | true | 1 |
808 2020-01-01 00:00:11.000 | true | 1 |
809 2020-01-01 00:00:12.000 | true | 1 |
810 2020-01-01 00:00:13.000 | true | 1 |
811 2020-01-01 00:00:14.000 | true | 1 |
812 2020-01-01 00:00:15.000 | false | 15 |
813 2020-01-01 00:00:16.000 | true | 1 |
814 2020-01-01 00:00:17.000 | true | 1 |
815 2020-01-01 00:00:18.000 | true | 1 |
816 2020-01-01 00:00:19.000 | true | 1 |
817 2020-01-01 00:00:20.000 | true | 1 |
818 2020-01-01 00:00:21.000 | false | 21 |
819 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
820 _irowts | _isfilled | interp(c1) |
821 ====================================================
822 2020-01-01 00:00:15.000 | false | 15 |
823 2020-01-01 00:00:16.000 | true | 15 |
824 2020-01-01 00:00:17.000 | true | 15 |
825 2020-01-01 00:00:18.000 | true | 15 |
826 2020-01-01 00:00:19.000 | true | 15 |
827 2020-01-01 00:00:20.000 | true | 15 |
828 2020-01-01 00:00:21.000 | false | 21 |
829 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
830 _irowts | _isfilled | interp(c1) |
831 ====================================================
832 2020-01-01 00:00:00.000 | true | 15 |
833 2020-01-01 00:00:01.000 | true | 15 |
834 2020-01-01 00:00:02.000 | true | 15 |
835 2020-01-01 00:00:03.000 | true | 15 |
836 2020-01-01 00:00:04.000 | true | 15 |
837 2020-01-01 00:00:05.000 | true | 15 |
838 2020-01-01 00:00:06.000 | true | 15 |
839 2020-01-01 00:00:07.000 | true | 15 |
840 2020-01-01 00:00:08.000 | true | 15 |
841 2020-01-01 00:00:09.000 | true | 15 |
842 2020-01-01 00:00:10.000 | true | 15 |
843 2020-01-01 00:00:11.000 | true | 15 |
844 2020-01-01 00:00:12.000 | true | 15 |
845 2020-01-01 00:00:13.000 | true | 15 |
846 2020-01-01 00:00:14.000 | true | 15 |
847 2020-01-01 00:00:15.000 | false | 15 |
848 2020-01-01 00:00:16.000 | true | 21 |
849 2020-01-01 00:00:17.000 | true | 21 |
850 2020-01-01 00:00:18.000 | true | 21 |
851 2020-01-01 00:00:19.000 | true | 21 |
852 2020-01-01 00:00:20.000 | true | 21 |
853 2020-01-01 00:00:21.000 | false | 21 |
854 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);
855 _irowts | _isfilled | interp(c1) |
856 ====================================================
857 2020-01-01 00:00:15.000 | false | 15 |
858 2020-01-01 00:00:16.000 | true | 16 |
859 2020-01-01 00:00:17.000 | true | 17 |
860 2020-01-01 00:00:18.000 | true | 18 |
861 2020-01-01 00:00:19.000 | true | 19 |
862 2020-01-01 00:00:20.000 | true | 20 |
863 2020-01-01 00:00:21.000 | false | 21 |
864 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(null);
865 _irowts | _isfilled | interp(c1) |
866 ====================================================
867 2020-01-01 00:00:00.000 | true | NULL |
868 2020-01-01 00:00:01.000 | true | NULL |
869 2020-01-01 00:00:02.000 | true | NULL |
870 2020-01-01 00:00:03.000 | true | NULL |
871 2020-01-01 00:00:04.000 | true | NULL |
872 2020-01-01 00:00:05.000 | true | NULL |
873 2020-01-01 00:00:06.000 | true | NULL |
874 2020-01-01 00:00:07.000 | true | NULL |
875 2020-01-01 00:00:08.000 | true | NULL |
876 2020-01-01 00:00:09.000 | true | NULL |
877 2020-01-01 00:00:10.000 | true | NULL |
878 2020-01-01 00:00:11.000 | true | NULL |
879 2020-01-01 00:00:12.000 | true | NULL |
880 2020-01-01 00:00:13.000 | true | NULL |
881 2020-01-01 00:00:14.000 | true | NULL |
882 2020-01-01 00:00:15.000 | true | NULL |
883 2020-01-01 00:00:16.000 | true | NULL |
884 2020-01-01 00:00:17.000 | true | NULL |
885 2020-01-01 00:00:18.000 | true | NULL |
886 2020-01-01 00:00:19.000 | true | NULL |
887 2020-01-01 00:00:20.000 | true | NULL |
888 2020-01-01 00:00:21.000 | false | 21 |
889 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(value, 1);
890 _irowts | _isfilled | interp(c1) |
891 ====================================================
892 2020-01-01 00:00:00.000 | true | 1 |
893 2020-01-01 00:00:01.000 | true | 1 |
894 2020-01-01 00:00:02.000 | true | 1 |
895 2020-01-01 00:00:03.000 | true | 1 |
896 2020-01-01 00:00:04.000 | true | 1 |
897 2020-01-01 00:00:05.000 | true | 1 |
898 2020-01-01 00:00:06.000 | true | 1 |
899 2020-01-01 00:00:07.000 | true | 1 |
900 2020-01-01 00:00:08.000 | true | 1 |
901 2020-01-01 00:00:09.000 | true | 1 |
902 2020-01-01 00:00:10.000 | true | 1 |
903 2020-01-01 00:00:11.000 | true | 1 |
904 2020-01-01 00:00:12.000 | true | 1 |
905 2020-01-01 00:00:13.000 | true | 1 |
906 2020-01-01 00:00:14.000 | true | 1 |
907 2020-01-01 00:00:15.000 | true | 1 |
908 2020-01-01 00:00:16.000 | true | 1 |
909 2020-01-01 00:00:17.000 | true | 1 |
910 2020-01-01 00:00:18.000 | true | 1 |
911 2020-01-01 00:00:19.000 | true | 1 |
912 2020-01-01 00:00:20.000 | true | 1 |
913 2020-01-01 00:00:21.000 | false | 21 |
914 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
915 _irowts | _isfilled | interp(c1) |
916 ====================================================
917 2020-01-01 00:00:21.000 | false | 21 |
918 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
919 _irowts | _isfilled | interp(c1) |
920 ====================================================
921 2020-01-01 00:00:00.000 | true | 21 |
922 2020-01-01 00:00:01.000 | true | 21 |
923 2020-01-01 00:00:02.000 | true | 21 |
924 2020-01-01 00:00:03.000 | true | 21 |
925 2020-01-01 00:00:04.000 | true | 21 |
926 2020-01-01 00:00:05.000 | true | 21 |
927 2020-01-01 00:00:06.000 | true | 21 |
928 2020-01-01 00:00:07.000 | true | 21 |
929 2020-01-01 00:00:08.000 | true | 21 |
930 2020-01-01 00:00:09.000 | true | 21 |
931 2020-01-01 00:00:10.000 | true | 21 |
932 2020-01-01 00:00:11.000 | true | 21 |
933 2020-01-01 00:00:12.000 | true | 21 |
934 2020-01-01 00:00:13.000 | true | 21 |
935 2020-01-01 00:00:14.000 | true | 21 |
936 2020-01-01 00:00:15.000 | true | 21 |
937 2020-01-01 00:00:16.000 | true | 21 |
938 2020-01-01 00:00:17.000 | true | 21 |
939 2020-01-01 00:00:18.000 | true | 21 |
940 2020-01-01 00:00:19.000 | true | 21 |
941 2020-01-01 00:00:20.000 | true | 21 |
942 2020-01-01 00:00:21.000 | false | 21 |
943 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);
944 _irowts | _isfilled | interp(c1) |
945 ====================================================
946 2020-01-01 00:00:21.000 | false | 21 |
947 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(null);
948 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(value, 1);
949 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
950 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
951 taos> select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017

View File

@ -13,3 +13,53 @@ select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfille
select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (prev) order by irowts, c2, c3;
select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (linear) order by irowts, c2, c3;
select _irowts as irowts ,tbname as table_name, c2 as c_c2, c3 as c_c3, _isfilled as isfilled , interp(c1) as intp_c1 from test.td32727 partition by tbname,c2,c3 range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill (value, 1) order by irowts, c2, c3;
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-02 00:00:00' and '2020-01-01 00:00:00' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(null);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-02 00:00:00' and '2020-01-01 00:00:00' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(value, 1);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-02 00:00:00' and '2020-01-01 00:00:00' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(prev);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-02 00:00:00' and '2020-01-01 00:00:00' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(next);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-02 00:00:00' and '2020-01-01 00:00:00' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(linear);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-02 00:00:00' range('2020-01-01 00:00:30', '2020-01-01 00:00:00') every(1s) fill(null);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-02 00:00:00' range('2020-01-01 00:00:30', '2020-01-01 00:00:00') every(1s) fill(value, 1);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-02 00:00:00' range('2020-01-01 00:00:30', '2020-01-01 00:00:00') every(1s) fill(prev);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-02 00:00:00' range('2020-01-01 00:00:30', '2020-01-01 00:00:00') every(1s) fill(next);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-02 00:00:00' range('2020-01-01 00:00:30', '2020-01-01 00:00:00') every(1s) fill(linear);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:20' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(null);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:20' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(value, 1);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:20' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(prev);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:20' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(next);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:20' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(linear);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(null);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(value, 1);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(prev);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(next);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:21', '2020-01-01 00:00:30') every(1s) fill(linear);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(null);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(value, 1);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(prev);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(next);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:15', '2020-01-01 00:00:30') every(1s) fill(linear);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(null);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(value, 1);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(prev);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(next);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:21' range('2020-01-01 00:00:00', '2020-01-01 00:00:30') every(1s) fill(linear);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(null);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(value, 1);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:00' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(null);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(value, 1);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:15' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(null);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(value, 1);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:21' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(null);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(value, 1);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(prev);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(next);
select _irowts, _isfilled, interp(c1) from test.td32861 where ts between '2020-01-01 00:00:22' and '2020-01-01 00:00:30' range('2020-01-01 00:00:00', '2020-01-01 00:00:21') every(1s) fill(linear);

View File

@ -38,6 +38,7 @@ class TDTestCase(TBase):
(ts timestamp, c0 tinyint, c1 smallint, c2 int, c3 bigint, c4 double, c5 float, c6 bool, c7 varchar(10), c8 nchar(10), c9 tinyint unsigned, c10 smallint unsigned, c11 int unsigned, c12 bigint unsigned)
'''
)
tdSql.execute("create table if not exists test.td32861(ts timestamp, c1 int);")
tdLog.printNoPrefix("==========step2:insert data")
@ -45,6 +46,16 @@ class TDTestCase(TBase):
tdSql.execute(f"insert into test.td32727 values ('2020-02-01 00:00:10', 10, 10, 10, 10, 10.0, 10.0, true, 'varchar', 'nchar', 10, 10, 10, 10)")
tdSql.execute(f"insert into test.td32727 values ('2020-02-01 00:00:15', 15, 15, 15, 15, 15.0, 15.0, true, 'varchar', 'nchar', 15, 15, 15, 15)")
tdSql.execute(
"""insert into test.td32861 values
('2020-01-01 00:00:00', 0),
('2020-01-01 00:00:01', 1),
('2020-01-01 00:00:03', 3),
('2020-01-01 00:00:06', 6),
('2020-01-01 00:00:10', 10),
('2020-01-01 00:00:15', 15),
('2020-01-01 00:00:21', 21);"""
)
def test_normal_query_new(self, testCase):
# read sql from .sql file and execute

View File

@ -7,7 +7,7 @@ RUN apt-get install -y locales psmisc sudo tree libgeos-dev libgflags2.2 libgfl
RUN sed -i 's/# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen && locale-gen
RUN pip3 config set global.index-url http://admin:123456@192.168.0.212:3141/admin/dev/+simple/
RUN pip3 config set global.trusted-host 192.168.0.212
RUN pip3 install taospy==2.7.16 taos-ws-py==0.3.3 pandas psutil fabric2 requests faker simplejson toml pexpect tzlocal distro decorator loguru hyperloglog
RUN pip3 install taospy==2.7.16 taos-ws-py==0.3.5 pandas psutil fabric2 requests faker simplejson toml pexpect tzlocal distro decorator loguru hyperloglog
ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'

View File

@ -130,7 +130,7 @@ pip3 install kafka-python
python3 kafka_example_consumer.py
# 21
pip3 install taos-ws-py==0.3.3
pip3 install taos-ws-py==0.3.5
python3 conn_websocket_pandas.py
# 22

View File

@ -232,6 +232,14 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/agg_group_NotReturnValue.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/td-32548.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stddev_test.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stddev_test.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stddev_test.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stddev_test.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 8-stream/checkpoint_info.py -N 4
,,y,system-test,./pytest.sh python3 ./test.py -f 8-stream/checkpoint_info2.py -N 4
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/test_multi_insert.py
,,y,system-test,./pytest.sh python3 ./test.py -f 3-enterprise/restore/restoreDnode.py -N 5 -M 3 -i False
,,y,system-test,./pytest.sh python3 ./test.py -f 3-enterprise/restore/restoreVnode.py -N 5 -M 3 -i False
,,y,system-test,./pytest.sh python3 ./test.py -f 3-enterprise/restore/restoreMnode.py -N 5 -M 3 -i False
@ -353,6 +361,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/user_privilege_all.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/fsync.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/multilevel.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/multilevel_createdb.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/ttl.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/ttlChangeOnWrite.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/compress_tsz1.py

View File

@ -76,9 +76,9 @@ ulimit -c unlimited
md5sum /usr/lib/libtaos.so.1
md5sum /home/TDinternal/debug/build/lib/libtaos.so
#get python connector and update: taospy 2.7.16 taos-ws-py 0.3.3
#get python connector and update: taospy 2.7.16 taos-ws-py 0.3.5
pip3 install taospy==2.7.16
pip3 install taos-ws-py==0.3.3
pip3 install taos-ws-py==0.3.5
$TIMEOUT_CMD $cmd
RET=$?
echo "cmd exit code: $RET"

View File

@ -843,9 +843,10 @@ class TDSql:
tdSql.query("select * from information_schema.ins_vnodes")
#result: dnode_id|vgroup_id|db_name|status|role_time|start_time|restored|
results = list(tdSql.queryResult)
for vnode_group_id in db_vgroups_list:
print(tdSql.queryResult)
for result in tdSql.queryResult:
for result in results:
print(f'result[2] is {result[2]}, db_name is {db_name}, result[1] is {result[1]}, vnode_group_id is {vnode_group_id}')
if result[2] == db_name and result[1] == vnode_group_id:
tdLog.debug(f"dbname: {db_name}, vgroup :{vnode_group_id}, dnode is {result[0]}")
print(useful_trans_dnodes_list)

View File

@ -0,0 +1,89 @@
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
from util.log import *
from util.cases import *
from util.sql import *
from util.common import *
from util.sqlset import *
import glob
def scanFiles(pattern):
res = []
for f in glob.iglob(pattern):
res += [f]
return res
def checkFiles(pattern, state):
res = scanFiles(pattern)
tdLog.info(res)
num = len(res)
if num:
if state:
tdLog.info("%s: %d files exist. expect: files exist" % (pattern, num))
else:
tdLog.exit("%s: %d files exist. expect: files not exist." % (pattern, num))
else:
if state:
tdLog.exit("%s: %d files exist. expect: files exist" % (pattern, num))
else:
tdLog.info("%s: %d files exist. expect: files not exist." % (pattern, num))
class TDTestCase:
def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar)
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor())
self.setsql = TDSetSql()
def basic(self):
tdLog.info("============== basic test ===============")
cfg={
'/mnt/data1 0 1 0' : 'dataDir',
'/mnt/data2 0 0 0' : 'dataDir',
'/mnt/data3 0 0 0' : 'dataDir',
'/mnt/data4 0 0 0' : 'dataDir'
}
tdSql.createDir('/mnt/data1')
tdSql.createDir('/mnt/data2')
tdSql.createDir('/mnt/data3')
tdSql.createDir('/mnt/data4')
tdDnodes.stop(1)
tdDnodes.deploy(1,cfg)
tdDnodes.start(1)
checkFiles(r'/mnt/data1/*/*',1)
checkFiles(r'/mnt/data2/*/*',0)
tdSql.execute('create database nws vgroups 20 stt_trigger 1 wal_level 1 wal_retention_period 0')
checkFiles(r'/mnt/data1/vnode/*/wal',5)
checkFiles(r'/mnt/data2/vnode/*/wal',5)
checkFiles(r'/mnt/data3/vnode/*/wal',5)
checkFiles(r'/mnt/data4/vnode/*/wal',5)
def run(self):
self.basic()
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())

View File

@ -0,0 +1,32 @@
from util.sql import *
from util.common import *
import taos
taos.taos_connect
class TDTestCase:
def init(self, conn, logSql, replicaVar = 1):
self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}")
self.conn = conn
tdSql.init(conn.cursor(), logSql)
def initdb(self):
tdSql.execute("drop database if exists d0")
tdSql.execute("create database d0")
tdSql.execute("use d0")
tdSql.execute("create stable stb0 (ts timestamp, w_ts timestamp, opc nchar(100), quality int) tags(t0 int)")
tdSql.execute("create table t0 using stb0 tags(1)")
tdSql.execute("create table t1 using stb0 tags(2)")
def multi_insert(self):
for i in range(5):
tdSql.execute(f"insert into t1 values(1721265436000, now() + {i + 1}s, '0', 12) t1(opc, quality, ts) values ('opc2', 192, now()+ {i + 2}s) t1(ts, opc, quality) values(now() + {i + 3}s, 'opc4', 10) t1 values(1721265436000, now() + {i + 4}s, '1', 191) t1(opc, quality, ts) values('opc5', 192, now() + {i + 5}s) t1 values(now(), now() + {i + 6}s, '2', 192)")
tdSql.execute("insert into t0 values(1721265436000,now(),'0',192) t0(quality,w_ts,ts) values(192,now(),1721265326000) t0(quality,w_t\
s,ts) values(190,now()+1s,1721265326000) t0 values(1721265436000,now()+2s,'1',191) t0(quality,w_ts,ts) values(192,now()+3s,\
1721265326002) t0(ts,w_ts,opc,quality) values(1721265436003,now()+4s,'3',193) t0 values(now(), now() + 4s , '2', 192)")
def run(self):
self.initdb()
self.multi_insert()
def stop(self):
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
tdCases.addLinux(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase())

View File

@ -422,21 +422,36 @@ class TDTestCase:
def test_TS5567(self):
tdSql.query(f"select const_col from (select 1 as const_col from {self.dbname}.{self.stable}) t group by const_col")
tdSql.checkRows(50)
tdSql.checkRows(1)
tdSql.query(f"select const_col from (select 1 as const_col from {self.dbname}.{self.stable}) t partition by const_col")
tdSql.checkRows(50)
tdSql.query(f"select const_col from (select 1 as const_col, count(c1) from {self.dbname}.{self.stable} t group by c1) group by const_col")
tdSql.checkRows(10)
tdSql.checkRows(1)
tdSql.query(f"select const_col from (select 1 as const_col, count(c1) from {self.dbname}.{self.stable} t group by c1) partition by const_col")
tdSql.checkRows(10)
tdSql.query(f"select const_col as c_c from (select 1 as const_col from {self.dbname}.{self.stable}) t group by c_c")
tdSql.checkRows(50)
tdSql.checkRows(1)
tdSql.query(f"select const_col as c_c from (select 1 as const_col from {self.dbname}.{self.stable}) t partition by c_c")
tdSql.checkRows(50)
tdSql.query(f"select const_col from (select 1 as const_col, count(c1) from {self.dbname}.{self.stable} t group by c1) group by 1")
tdSql.checkRows(10)
tdSql.checkRows(1)
tdSql.query(f"select const_col from (select 1 as const_col, count(c1) from {self.dbname}.{self.stable} t group by c1) partition by 1")
tdSql.checkRows(10)
def test_TD_32883(self):
sql = "select avg(c1), t9 from db.stb group by t9,t9, tbname"
tdSql.query(sql, queryTimes=1)
tdSql.checkRows(5)
sql = "select avg(c1), t10 from db.stb group by t10,t10, tbname"
tdSql.query(sql, queryTimes=1)
tdSql.checkRows(5)
sql = "select avg(c1), t10 from db.stb partition by t10,t10, tbname"
tdSql.query(sql, queryTimes=1)
tdSql.checkRows(5)
sql = "select avg(c1), concat(t9,t10) from db.stb group by concat(t9,t10), concat(t9,t10),tbname"
tdSql.query(sql, queryTimes=1)
tdSql.checkRows(5)
def run(self):
tdSql.prepare()
self.prepare_db()
@ -470,6 +485,7 @@ class TDTestCase:
self.test_event_window(nonempty_tb_num)
self.test_TS5567()
self.test_TD_32883()
## test old version before changed
# self.test_groupby('group', 0, 0)

View File

@ -314,6 +314,20 @@ class TDTestCase:
self.prepare_and_query_and_compare(sqls, order_by_list, compare_what=COMPARE_LEN)
def test_tsdb_read(self):
tdSql.execute('delete from t0')
tdSql.execute('flush database test')
for i in range(0, 4096):
tdSql.execute(f"insert into test.t0 values({1537146000000 + i}, 1,1,1,1,1,1,1,'a','1')")
tdSql.execute("flush database test")
tdSql.execute(f"insert into t0 values({1537146000000 + 4095}, 1,1,1,1,1,1,1,'a','1')")
for i in range(4095, 4096*2 + 100):
tdSql.execute(f"insert into test.t0 values({1537146000000 + i}, 1,1,1,1,1,1,1,'a','1')")
tdSql.execute("flush database test")
time.sleep(5)
tdSql.query('select first(ts), last(ts) from t0', queryTimes=1)
tdSql.checkRows(1)
def run(self):
self.prepareTestEnv()
@ -323,6 +337,8 @@ class TDTestCase:
self.test_sort_for_partition_res()
self.test_sort_for_partition_interval()
self.test_sort_for_partition_no_agg_limit()
self.test_tsdb_read()
def stop(self):
tdSql.close()

View File

@ -0,0 +1,54 @@
import numpy as np
from util.log import *
from util.cases import *
from util.sql import *
from util.common import *
from util.sqlset import *
'''
Test case for TS-5150
'''
class TDTestCase:
def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar)
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor())
self.ts = 1537146000000
def initdabase(self):
tdSql.execute('create database if not exists db_test vgroups 2 buffer 10')
tdSql.execute('use db_test')
tdSql.execute('create stable stb(ts timestamp, delay int) tags(groupid int)')
tdSql.execute('create table t1 using stb tags(1)')
tdSql.execute('create table t2 using stb tags(2)')
tdSql.execute('create table t3 using stb tags(3)')
tdSql.execute('create table t4 using stb tags(4)')
tdSql.execute('create table t5 using stb tags(5)')
tdSql.execute('create table t6 using stb tags(6)')
def insert_data(self):
for i in range(5000):
tdSql.execute(f"insert into t1 values({self.ts + i * 1000}, {i%5})")
tdSql.execute(f"insert into t2 values({self.ts + i * 1000}, {i%5})")
tdSql.execute(f"insert into t3 values({self.ts + i * 1000}, {i%5})")
def verify_stddev(self):
for i in range(20):
tdSql.query(f'SELECT MAX(CASE WHEN delay != 0 THEN delay ELSE NULL END) AS maxDelay,\
MIN(CASE WHEN delay != 0 THEN delay ELSE NULL END) AS minDelay,\
AVG(CASE WHEN delay != 0 THEN delay ELSE NULL END) AS avgDelay,\
STDDEV(CASE WHEN delay != 0 THEN delay ELSE NULL END) AS jitter,\
COUNT(CASE WHEN delay = 0 THEN 1 ELSE NULL END) AS timeoutCount,\
COUNT(*) AS totalCount from stb where ts between {1537146000000 + i * 1000} and {1537146000000 + (i+10) * 1000}')
res = tdSql.queryResult[0][3]
assert res > 0.8
def run(self):
self.initdabase()
self.insert_data()
self.verify_stddev()
def stop(self):
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
tdCases.addLinux(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase())

View File

@ -0,0 +1,140 @@
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
from util.log import *
from util.cases import *
from util.sql import *
from util.common import *
from util.sqlset import *
from util.cluster import *
import threading
# should be used by -N option
class TDTestCase:
#updatecfgDict = {'checkpointInterval': 60 ,}
def init(self, conn, logSql, replicaVar=1):
print("========init========")
self.replicaVar = int(replicaVar)
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def find_checkpoint_info_file(self, dirpath, checkpointid, task_id):
for root, dirs, files in os.walk(dirpath):
if f'checkpoint{checkpointid}' in dirs:
info_path = os.path.join(root, f'checkpoint{checkpointid}', 'info')
if os.path.exists(info_path):
if task_id in info_path:
return info_path
else:
continue
else:
return None
def get_dnode_info(self):
'''
get a dict from vnode to dnode
'''
self.vnode_dict = {}
sql = 'select dnode_id, vgroup_id from information_schema.ins_vnodes'
result = tdSql.getResult(sql)
for (dnode,vnode) in result:
self.vnode_dict[vnode] = dnode
def print_time_info(self):
'''
sometimes, we need to wait for a while to check the info (for example, the checkpoint info file won't be created immediately after the redistribute)
'''
times= 0
while(True):
if(self.check_info()):
tdLog.success(f'Time to finish is {times}')
return
else:
if times > 200:
tdLog.exit("time out")
times += 10
time.sleep(10)
def check_info(self):
'''
first, check if the vnode is restored
'''
while(True):
if(self.check_vnodestate()):
break
sql = 'select task_id, node_id, checkpoint_id, checkpoint_ver from information_schema.ins_stream_tasks where `level` = "source" or `level` = "agg" and node_type == "vnode"'
for task_id, vnode, checkpoint_id, checkpoint_ver in tdSql.getResult(sql):
dirpath = f"{cluster.dnodes[self.vnode_dict[vnode]-1].dataDir}/vnode/vnode{vnode}/"
info_path = self.find_checkpoint_info_file(dirpath, checkpoint_id, task_id)
if info_path is None:
return False
with open(info_path, 'r') as f:
info_id, info_ver = f.read().split()
if int(info_id) != int(checkpoint_id) or int(info_ver) != int(checkpoint_ver):
return False
return True
def restart_stream(self):
tdLog.debug("========restart stream========")
time.sleep(10)
for i in range(5):
tdSql.execute("pause stream s1")
time.sleep(2)
tdSql.execute("resume stream s1")
def initstream(self):
tdLog.debug("========case1 start========")
os.system("nohup taosBenchmark -y -B 1 -t 4 -S 500 -n 1000 -v 3 > /dev/null 2>&1 &")
time.sleep(5)
tdSql.execute("create snode on dnode 1")
tdSql.execute("use test")
tdSql.execute("create stream if not exists s1 trigger at_once ignore expired 0 ignore update 0 fill_history 1 into st1 as select _wstart,sum(voltage),groupid from meters partition by groupid interval(1s)")
tdLog.debug("========create stream using snode and insert data ok========")
self.get_dnode_info()
def redistribute_vnode(self):
tdLog.debug("========redistribute vnode========")
tdSql.redistribute_db_all_vgroups()
self.get_dnode_info()
def replicate_db(self):
tdLog.debug("========replicate db========")
while True:
res = tdSql.getResult("SHOW TRANSACTIONS")
if res == []:
tdLog.debug("========== no transaction, begin to replicate db =========")
tdSql.execute("alter database test replica 3")
return
else:
time.sleep(5)
continue
def check_vnodestate(self):
sql = 'select distinct restored from information_schema.ins_vnodes'
if tdSql.getResult(sql) != [(True,)]:
tdLog.debug(f"vnode not restored, wait 5s")
time.sleep(5)
return False
else:
return True
def run(self):
print("========run========")
self.initstream()
self.restart_stream()
time.sleep(60)
self.print_time_info()
self.redistribute_vnode()
self.restart_stream()
time.sleep(60)
self.print_time_info()
def stop(self):
print("========stop========")
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
tdCases.addLinux(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase())

View File

@ -0,0 +1,141 @@
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
from util.log import *
from util.cases import *
from util.sql import *
from util.common import *
from util.sqlset import *
from util.cluster import *
# should be used by -N option
class TDTestCase:
updatecfgDict = {'checkpointInterval': 60 ,
}
def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar)
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), True)
def find_checkpoint_info_file(self, dirpath, checkpointid, task_id):
for root, dirs, files in os.walk(dirpath):
if f'checkpoint{checkpointid}' in dirs:
info_path = os.path.join(root, f'checkpoint{checkpointid}', 'info')
if os.path.exists(info_path):
if task_id in info_path:
tdLog.info(f"info file found in {info_path}")
return info_path
else:
continue
else:
tdLog.info(f"info file not found in {info_path}")
return None
else:
tdLog.info(f"no checkpoint{checkpointid} in {dirpath}")
def get_dnode_info(self):
'''
get a dict from vnode to dnode
'''
self.vnode_dict = {}
sql = 'select dnode_id, vgroup_id from information_schema.ins_vnodes where status = "leader"'
result = tdSql.getResult(sql)
for (dnode,vnode) in result:
self.vnode_dict[vnode] = dnode
def print_time_info(self):
'''
sometimes, we need to wait for a while to check the info (for example, the checkpoint info file won't be created immediately after the redistribute)
'''
times= 0
while(True):
if(self.check_info()):
tdLog.success(f'Time to finish is {times}')
return
else:
if times > 400:
tdLog.exit("time out")
times += 10
time.sleep(10)
def check_info(self):
'''
first, check if the vnode is restored
'''
while(True):
if(self.check_vnodestate()):
break
self.get_dnode_info()
sql = 'select task_id, node_id, checkpoint_id, checkpoint_ver from information_schema.ins_stream_tasks where `level` = "source" or `level` = "agg" and node_type == "vnode"'
for task_id, vnode, checkpoint_id, checkpoint_ver in tdSql.getResult(sql):
dirpath = f"{cluster.dnodes[self.vnode_dict[vnode]-1].dataDir}/vnode/vnode{vnode}/"
info_path = self.find_checkpoint_info_file(dirpath, checkpoint_id, task_id)
if info_path is None:
tdLog.info(f"info path: {dirpath} is null")
return False
with open(info_path, 'r') as f:
info_id, info_ver = f.read().split()
if int(info_id) != int(checkpoint_id) or int(info_ver) != int(checkpoint_ver):
tdLog.info(f"infoId: {info_id}, checkpointId: {checkpoint_id}, infoVer: {info_ver}, checkpointVer: {checkpoint_ver}")
return False
return True
def restart_stream(self):
tdLog.debug("========restart stream========")
for i in range(5):
tdSql.execute("pause stream s1")
time.sleep(2)
tdSql.execute("resume stream s1")
def initstream(self):
tdLog.debug("========case1 start========")
os.system("nohup taosBenchmark -y -B 1 -t 4 -S 500 -n 1000 -v 3 > /dev/null 2>&1 &")
time.sleep(5)
tdSql.execute("create snode on dnode 1")
tdSql.execute("use test")
tdSql.execute("create stream if not exists s1 trigger at_once ignore expired 0 ignore update 0 fill_history 1 into st1 as select _wstart,sum(voltage),groupid from meters partition by groupid interval(1s)")
tdLog.debug("========create stream using snode and insert data ok========")
self.get_dnode_info()
def redistribute_vnode(self):
tdLog.debug("========redistribute vnode========")
tdSql.redistribute_db_all_vgroups()
self.get_dnode_info()
def replicate_db(self):
tdLog.debug("========replicate db========")
while True:
res = tdSql.getResult("SHOW TRANSACTIONS")
if res == []:
tdLog.debug("========== no transaction, begin to replicate db =========")
tdSql.execute("alter database test replica 3")
return
else:
time.sleep(5)
continue
def check_vnodestate(self):
sql = 'select distinct restored from information_schema.ins_vnodes'
if tdSql.getResult(sql) != [(True,)]:
tdLog.debug(f"vnode not restored, wait 5s")
time.sleep(5)
return False
else:
return True
def run(self):
self.initstream()
self.replicate_db()
self.print_time_info()
self.restart_stream()
time.sleep(60)
self.print_time_info()
def stop(self):
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
tdCases.addLinux(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase())