mirror of
https://github.com/taosdata/TDengine
synced 2026-05-24 10:09:01 +00:00
* fix: windows compile issue * test: add vtable cases (#31829) * fix: windows compile issues * test:add test cases * fix: windows compile issue * case: em-4 stream case submit * test: stream4_sub1 found bug2 * test: submit test_scene_meters_bug2.py * add stream parameters example * feat: [TS-6100] Do not translate const value as column. * Feat/ts 6100 3.0 zlv (#31747) * modify asan exampel * modify asan exampel * add example * add example * modify case example --------- Co-authored-by: zelv01 <1101510017@qq.com> * feat(stream): fix memory leak * modify sliding example * test: update test case. * feat(stream): fix conflicts * fix: add offset case 10a 10s 10m 10h 10d * feat(stream): fix conflicts * chore(stream): rename case name #TS-6100 * add case * modify example * fix: windows compile issues * fix: data null check * feat: [TS-6100] Forbid where when using %%trows (#31827) * feat: [TS-6100] Forbid where when using %%trows * test: update cases * feat: [TS-6100] Fix leaks. --------- Co-authored-by: Simon Guan <guanshengliang@qq.com> * test: reproduce bugs * test: update test case. * test: update test case. * feat: [TS-6100] Fix leaks. * test: add cases * Feat/ts 6100 3.0.pw10 (#31841) * enh: add operator reset func * fix: merge join reset issue * fix: memory issues * fix: add debug assert * fix: memory issues * fix: memory leak * fix: memory issues * fix taos log miss * fix: case issue * fix: case issue * fix: case issues * fix: drop dnode issue * fix: memory issues * fix: memory issues * fix: memory leak issues * fix: recalculate time range issue * fix: add debug log * fix: memory issues * fix: enable case asan * Update streamlist_for_ci.task * fix: case asan issue * fix: stream name issue * fix: external window compile issues * fix: deploy memory issue * fix: ahandle issue * fix: ahandle issue * fix: ahandle issue * fix: virtual table reader list issue * fix: log info * fix: msg error * fix: virtual table addr list issue * fix: memory issues * fix: memory leak issue * fix: memory issues * fix: memory free issues * fix: memory issues * fix: snode deploy issue * fix: mnode reader issue * fix: memory issues * fix: add debug test * enh: add ignore nodata trigger * fix: memory leaks * fix: configuration issue * fix: memory issue * fix: external window issue * fix: external window issues * fix: external window placeholder issue * fix: placeholder function init issues * fix: memory leak issue * fix: add debug log * fix: compile issues * fix: double free issue * fix: runner addr update issue * fix: msg rsp issue * fix: external window reset issue * fix: configuration issue * fix: deploy msg issue * fix: compile issue --------- Co-authored-by: huohong <sallyhuo@taosdata.com> * test: reproduce bugs * fix: add sliding interval combine case * test: add cases * test: add recalc test. * test: reproduce bugs * case : add vt ts is null check * modify case * bug: submit test_idmp_meters_bug3.py * test: add test for recalc. * test: add cases * fix: error code check * test: add cases * fix(stream): scan wal with schema in that version * add case * test: add cases * test: update test case. * fix: windows compile issues * add case * test: add cases (#31845) * modify case * fix: reset interpPrev * test: add test_idmp_meters bug4 and bug3 * add case * fix(stream): opti wal interface * fix: remove test_idmp_meters_bug5.py * test: add cases * fix(stream): fix ts data fetch for virtual tables * cancel asan case * test: update test case. * test: update test case. * add case * test: add cases * test: add cases * test: add case test_idmp_meters_bug5.py * test: update test case. * fix(stream): tmq error * test: add cases * feat: [TS-6100] Restore deleted code in mndSma.c since they are still in use. * fix(stream): optimize val scan logic * test: add test_recalc_expired_time.py to ci. * test: update test case. * test: update test case. * feat: [TS-6100] Fix fill range check * fix(stream): optimize val scan logic * add case * test: modify for partition by %%1 * test: add fun case stream4_sub7 * fix(stream): optimize val scan logic * add case * feat: [TS-6100] Rename OPTIONS to STREAM_OPTIONS. * test: add test for recalc. * test: use stream_options. * fix: some cases error. * test: remove recalc from ci. * fix: ci case issues (#31880) * enh: add operator reset func * fix: merge join reset issue * fix: memory issues * fix: add debug assert * fix: memory issues * fix: memory leak * fix: memory issues * fix taos log miss * fix: case issue * fix: case issue * fix: case issues * fix: drop dnode issue * fix: memory issues * fix: memory issues * fix: memory leak issues * fix: recalculate time range issue * fix: add debug log * fix: memory issues * fix: enable case asan * Update streamlist_for_ci.task * fix: case asan issue * fix: stream name issue * fix: external window compile issues * fix: deploy memory issue * fix: ahandle issue * fix: ahandle issue * fix: ahandle issue * fix: virtual table reader list issue * fix: log info * fix: msg error * fix: virtual table addr list issue * fix: memory issues * fix: memory leak issue * fix: memory issues * fix: memory free issues * fix: memory issues * fix: snode deploy issue * fix: mnode reader issue * fix: memory issues * fix: add debug test * enh: add ignore nodata trigger * fix: memory leaks * fix: configuration issue * fix: memory issue * fix: external window issue * fix: external window issues * fix: external window placeholder issue * fix: placeholder function init issues * fix: memory leak issue * fix: add debug log * fix: compile issues * fix: double free issue * fix: runner addr update issue * fix: msg rsp issue * fix: external window reset issue * fix: configuration issue * fix: deploy msg issue * fix: compile issue * fix: external window idx issue * fix: ci issues --------- Co-authored-by: huohong <sallyhuo@taosdata.com> * fix(stream): fix compilation error * fix(stream): optimize val scan logic * test:add test cases * test: modify case * fix: external agg error * test(stream): tobacco scene testing #TD-36514 * test: add stream cases (#31885) * fix: windows compile issue * fix: calc timerange * fix: windows compile issue * modify case * fix(stream): compile error * test: remove one debug test case file * test: modify * test: add test cases * test: reproduce bugs * test: reproduce bugs * feat: [TS-6100] Placeholder function should only appera in SELECT and… (#31868) * feat: [TS-6100] Placeholder function should only appera in SELECT and WHERE and FROM. * test: update case --------- Co-authored-by: Simon Guan <guanshengliang@qq.com> * add example * add example * modify case example * modify case * test:alter sql * test: add stream5 case * fix(stream): get schema error with version * test: add delete recalc test py. * test: remove bug cases * test: stream5 case test passed * test: add state cases (#31893) * fix(stream): compile error * test: modify case * test: add cases * test: add test. * test: update test case. * chore(test): fix case err * test: update test case. * fix: align data get * fix(stream): fix row index of datablock written into data cache * fix: put align data * test: update test case. * test: add test cases for virtual table * chore(test): fix case err #TD-36514 * add case * test: add test for water mark. * test: add meters bug6 for stream5 * test: add cases (#31903) * test: add test for recalc. * feat: [TS-6100] %%trows can only be used when event type is window close. * test: add precision of database for ms/us/ns * modify case * add case * add case * test: add test to ci. * modify case * fix: ci case issues (#31904) * enh: add operator reset func * fix: merge join reset issue * fix: memory issues * fix: add debug assert * fix: memory issues * fix: memory leak * fix: memory issues * fix taos log miss * fix: case issue * fix: case issue * fix: case issues * fix: drop dnode issue * fix: memory issues * fix: memory issues * fix: memory leak issues * fix: recalculate time range issue * fix: add debug log * fix: memory issues * fix: enable case asan * Update streamlist_for_ci.task * fix: case asan issue * fix: stream name issue * fix: external window compile issues * fix: deploy memory issue * fix: ahandle issue * fix: ahandle issue * fix: ahandle issue * fix: virtual table reader list issue * fix: log info * fix: msg error * fix: virtual table addr list issue * fix: memory issues * fix: memory leak issue * fix: memory issues * fix: memory free issues * fix: memory issues * fix: snode deploy issue * fix: mnode reader issue * fix: memory issues * fix: add debug test * enh: add ignore nodata trigger * fix: memory leaks * fix: configuration issue * fix: memory issue * fix: external window issue * fix: external window issues * fix: external window placeholder issue * fix: placeholder function init issues * fix: memory leak issue * fix: add debug log * fix: compile issues * fix: double free issue * fix: runner addr update issue * fix: msg rsp issue * fix: external window reset issue * fix: configuration issue * fix: deploy msg issue * fix: compile issue * fix: external window idx issue * fix: ci issues * fix: ci case issues * fix: drop dnode issue --------- Co-authored-by: huohong <sallyhuo@taosdata.com> * fix(stream): ci error * test: update test case. * feat: [TS-6100] Disable some failed UT. * feat: [TS-6100] Fix virtual table * test: add bug 5. * test: add test delete recalc to ci. * test: add bug 6. * test(stream): tobacco scene #TD-36514 * fix: reqCids,reqCols memory leak in SSTriggerRealtimeContext Co-authored-by: Tony Zhang <tonyzhang@taosdata.com> * test: add case stream6 * fix(stream): implement some pending features in trigger task * modify case * modify case * fix: case issues * modify case * test: add recalc for warter mark. * fix(stream): fix count window trigger of virtual tables * fix(stream): memory leak * test: fix run err. * test: add stream6 bug7 * fix: adjust format * test(stream): tobacco scene testing #TD-36514 * test: change bug7 with update window1 and 2 * test: add test bug 7. * case: restore write 3 window * fix: windows compile issue * fix: notify * test: add cases * modify case * test: update test case. * test(stream): toobacco scene testing #TD-36514 --------- Co-authored-by: Simon Guan <slguan@taosdata.com> Co-authored-by: plum-lihui <huili@taosdata.com> Co-authored-by: Alex Duan <417921451@qq.com> Co-authored-by: zelv01 <1101510017@qq.com> Co-authored-by: Jing Sima <simondominic9997@outlook.com> Co-authored-by: xiangyang guo <66111494+happyguoxy@users.noreply.github.com> Co-authored-by: wangmm0220 <wangmm0220@gmail.com> Co-authored-by: Haojun Liao <hjliao@taosdata.com> Co-authored-by: zyyang90 <zyyang@taosdata.com> Co-authored-by: Alex Duan <51781608+DuanKuanJun@users.noreply.github.com> Co-authored-by: facetosea <285808407@qq.com> Co-authored-by: Simon Guan <guanshengliang@qq.com> Co-authored-by: huohong <sallyhuo@taosdata.com> Co-authored-by: Li Hui <52318143+plum-lihui@users.noreply.github.com> Co-authored-by: Jinqing Kuang <kuangjinqingcn@gmail.com> Co-authored-by: xiao-77 <berylbao@taosdata.com> Co-authored-by: Zhixiao Bao <62235797+xiao-77@users.noreply.github.com> Co-authored-by: happyguoxy <happy_guoxy@163.com> Co-authored-by: Tony Zhang <34825804+Tony2h@users.noreply.github.com> Co-authored-by: Tony Zhang <tonyzhang@taosdata.com>
1245 lines
59 KiB
C++
1245 lines
59 KiB
C++
/*
|
|
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
|
|
*
|
|
* This program is free software: you can use, redistribute, and/or modify
|
|
* it under the terms of the GNU Affero General Public License, version 3
|
|
* or later ("AGPL"), as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include <gtest/gtest.h>
|
|
#include <iostream>
|
|
#include "streamexecutorInt.h"
|
|
|
|
#pragma GCC diagnostic push
|
|
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
|
#pragma GCC diagnostic ignored "-Wsign-compare"
|
|
#include "os.h"
|
|
|
|
#include "executor.h"
|
|
#include "executorInt.h"
|
|
#include "function.h"
|
|
#include "operator.h"
|
|
#include "taos.h"
|
|
#include "tdatablock.h"
|
|
#include "tdef.h"
|
|
#include "tvariant.h"
|
|
|
|
namespace {
|
|
|
|
enum {
|
|
data_rand = 0x1,
|
|
data_asc = 0x2,
|
|
data_desc = 0x3,
|
|
};
|
|
|
|
TEST(testCase, windowFunctionTest) {
|
|
int64_t tsCol[100000];
|
|
int32_t rows = 100000;
|
|
for (int32_t i = 0; i < rows; i++) {
|
|
tsCol[i] = 1648791213000 + i;
|
|
}
|
|
int32_t ekeyNum = 50000;
|
|
int32_t pos = 40000;
|
|
int64_t ekey = tsCol[ekeyNum];
|
|
int32_t num = getForwardStepsInBlock(rows, binarySearchForKey, ekey, pos, TSDB_ORDER_ASC, tsCol);
|
|
ASSERT_EQ(num, ekeyNum - pos + 1);
|
|
}
|
|
|
|
typedef struct SDummyInputInfo {
|
|
int32_t totalPages; // numOfPages
|
|
int32_t current;
|
|
int32_t startVal;
|
|
int32_t type;
|
|
int32_t numOfRowsPerPage;
|
|
int32_t numOfCols; // number of columns
|
|
int64_t tsStart;
|
|
SSDataBlock* pBlock;
|
|
} SDummyInputInfo;
|
|
|
|
SSDataBlock* getDummyBlock(SOperatorInfo* pOperator) {
|
|
SDummyInputInfo* pInfo = static_cast<SDummyInputInfo*>(pOperator->info);
|
|
if (pInfo->current >= pInfo->totalPages) {
|
|
return NULL;
|
|
}
|
|
|
|
if (pInfo->pBlock == NULL) {
|
|
pInfo->pBlock = NULL;
|
|
int32_t code = createDataBlock(&pInfo->pBlock);
|
|
ASSERT(code == 0);
|
|
|
|
SColumnInfoData colInfo = createColumnInfoData(TSDB_DATA_TYPE_INT, sizeof(int32_t), 1);
|
|
code = blockDataAppendColInfo(pInfo->pBlock, &colInfo);
|
|
ASSERT(code == 0);
|
|
|
|
code = blockDataEnsureCapacity(pInfo->pBlock, pInfo->numOfRowsPerPage);
|
|
ASSERT(code == 0);
|
|
|
|
// SColumnInfoData colInfo1 = {0};
|
|
// colInfo1.info.type = TSDB_DATA_TYPE_BINARY;
|
|
// colInfo1.info.bytes = 40;
|
|
// colInfo1.info.colId = 2;
|
|
//
|
|
// colInfo1.varmeta.allocLen = 0;//numOfRows * sizeof(int32_t);
|
|
// colInfo1.varmeta.length = 0;
|
|
// colInfo1.varmeta.offset = static_cast<int32_t*>(taosMemoryCalloc(1, numOfRows * sizeof(int32_t)));
|
|
//
|
|
// taosArrayPush(pInfo->pBlock->pDataBlock, &colInfo1);
|
|
} else {
|
|
blockDataCleanup(pInfo->pBlock);
|
|
}
|
|
|
|
SSDataBlock* pBlock = pInfo->pBlock;
|
|
|
|
char buf[128] = {0};
|
|
char b1[128] = {0};
|
|
int32_t v = 0;
|
|
for (int32_t i = 0; i < pInfo->numOfRowsPerPage; ++i) {
|
|
SColumnInfoData* pColInfo = static_cast<SColumnInfoData*>(TARRAY_GET_ELEM(pBlock->pDataBlock, 0));
|
|
|
|
if (pInfo->type == data_desc) {
|
|
v = (--pInfo->startVal);
|
|
} else if (pInfo->type == data_asc) {
|
|
v = ++pInfo->startVal;
|
|
} else if (pInfo->type == data_rand) {
|
|
v = taosRand();
|
|
}
|
|
|
|
int32_t code = colDataSetVal(pColInfo, i, reinterpret_cast<const char*>(&v), false);
|
|
ASSERT(code == 0);
|
|
|
|
// tsnprintf(buf, "this is %d row", i);
|
|
// STR_TO_VARSTR(b1, buf);
|
|
//
|
|
// SColumnInfoData* pColInfo2 = static_cast<SColumnInfoData*>(TARRAY_GET_ELEM(pBlock->pDataBlock, 1));
|
|
// colDataSetVal(pColInfo2, i, b1, false);
|
|
}
|
|
|
|
pBlock->info.rows = pInfo->numOfRowsPerPage;
|
|
|
|
pInfo->current += 1;
|
|
return pBlock;
|
|
}
|
|
|
|
SSDataBlock* get2ColsDummyBlock(SOperatorInfo* pOperator) {
|
|
SDummyInputInfo* pInfo = static_cast<SDummyInputInfo*>(pOperator->info);
|
|
if (pInfo->current >= pInfo->totalPages) {
|
|
return NULL;
|
|
}
|
|
|
|
if (pInfo->pBlock == NULL) {
|
|
pInfo->pBlock = NULL;
|
|
|
|
int32_t code = createDataBlock(&pInfo->pBlock);
|
|
ASSERT(code == 0);
|
|
|
|
SColumnInfoData colInfo = createColumnInfoData(TSDB_DATA_TYPE_TIMESTAMP, sizeof(int64_t), 1);
|
|
int32_t code = blockDataAppendColInfo(pInfo->pBlock, &colInfo);
|
|
ASSERT(code == 0);
|
|
|
|
SColumnInfoData colInfo1 = createColumnInfoData(TSDB_DATA_TYPE_INT, 4, 2);
|
|
code = blockDataAppendColInfo(pInfo->pBlock, &colInfo1);
|
|
ASSERT(code == 0);
|
|
|
|
code = blockDataEnsureCapacity(pInfo->pBlock, pInfo->numOfRowsPerPage);
|
|
ASSERT(code == 0);
|
|
} else {
|
|
blockDataCleanup(pInfo->pBlock);
|
|
}
|
|
|
|
SSDataBlock* pBlock = pInfo->pBlock;
|
|
|
|
char buf[128] = {0};
|
|
char b1[128] = {0};
|
|
int64_t ts = 0;
|
|
int32_t v = 0;
|
|
for (int32_t i = 0; i < pInfo->numOfRowsPerPage; ++i) {
|
|
SColumnInfoData* pColInfo = static_cast<SColumnInfoData*>(TARRAY_GET_ELEM(pBlock->pDataBlock, 0));
|
|
|
|
ts = (++pInfo->tsStart);
|
|
int32_t code = colDataSetVal(pColInfo, i, reinterpret_cast<const char*>(&ts), false);
|
|
ASSERT(code == 0);
|
|
|
|
SColumnInfoData* pColInfo1 = static_cast<SColumnInfoData*>(TARRAY_GET_ELEM(pBlock->pDataBlock, 1));
|
|
if (pInfo->type == data_desc) {
|
|
v = (--pInfo->startVal);
|
|
} else if (pInfo->type == data_asc) {
|
|
v = ++pInfo->startVal;
|
|
} else if (pInfo->type == data_rand) {
|
|
v = taosRand();
|
|
}
|
|
|
|
code = colDataSetVal(pColInfo1, i, reinterpret_cast<const char*>(&v), false);
|
|
ASSERT(code == 0);
|
|
|
|
// tsnprintf(buf, "this is %d row", i);
|
|
// STR_TO_VARSTR(b1, buf);
|
|
//
|
|
// SColumnInfoData* pColInfo2 = static_cast<SColumnInfoData*>(TARRAY_GET_ELEM(pBlock->pDataBlock, 1));
|
|
// colDataSetVal(pColInfo2, i, b1, false);
|
|
}
|
|
|
|
pBlock->info.rows = pInfo->numOfRowsPerPage;
|
|
|
|
pInfo->current += 1;
|
|
|
|
pBlock->info.dataLoad = 1;
|
|
int32_t code = blockDataUpdateTsWindow(pBlock, 0);
|
|
return pBlock;
|
|
}
|
|
|
|
SOperatorInfo* createDummyOperator(int32_t startVal, int32_t numOfBlocks, int32_t rowsPerPage, int32_t type,
|
|
int32_t numOfCols) {
|
|
SOperatorInfo* pOperator = static_cast<SOperatorInfo*>(taosMemoryCalloc(1, sizeof(SOperatorInfo)));
|
|
ASSERT(!pOperator);
|
|
pOperator->name = "dummyInputOpertor4Test";
|
|
|
|
if (numOfCols == 1) {
|
|
pOperator->fpSet.getNextFn = getDummyBlock;
|
|
} else {
|
|
pOperator->fpSet.getNextFn = get2ColsDummyBlock;
|
|
}
|
|
|
|
SDummyInputInfo* pInfo = (SDummyInputInfo*)taosMemoryCalloc(1, sizeof(SDummyInputInfo));
|
|
ASSERT(!pInfo);
|
|
pInfo->totalPages = numOfBlocks;
|
|
pInfo->startVal = startVal;
|
|
pInfo->numOfRowsPerPage = rowsPerPage;
|
|
pInfo->type = type;
|
|
pInfo->tsStart = 1620000000000;
|
|
|
|
pOperator->info = pInfo;
|
|
return pOperator;
|
|
}
|
|
} // namespace
|
|
int main(int argc, char** argv) {
|
|
testing::InitGoogleTest(&argc, argv);
|
|
return RUN_ALL_TESTS();
|
|
}
|
|
|
|
TEST(testCase, build_executor_tree_Test) {
|
|
const char* msg =
|
|
"{\n"
|
|
" \"NodeType\": \"48\",\n"
|
|
" \"Name\": \"PhysiSubplan\",\n"
|
|
" \"PhysiSubplan\": {\n"
|
|
" \"Id\": {\n"
|
|
" \"QueryId\": \"0\",\n"
|
|
" \"TemplateId\": \"0\",\n"
|
|
" \"SubplanId\": \"0\"\n"
|
|
" },\n"
|
|
" \"SubplanType\": \"0\",\n"
|
|
" \"MsgType\": \"515\",\n"
|
|
" \"Level\": \"0\",\n"
|
|
" \"NodeAddr\": {\n"
|
|
" \"Id\": \"1\",\n"
|
|
" \"InUse\": \"0\",\n"
|
|
" \"NumOfEps\": \"1\",\n"
|
|
" \"Eps\": [\n"
|
|
" {\n"
|
|
" \"Fqdn\": \"node1\",\n"
|
|
" \"Port\": \"6030\"\n"
|
|
" }\n"
|
|
" ]\n"
|
|
" },\n"
|
|
" \"RootNode\": {\n"
|
|
" \"NodeType\": \"41\",\n"
|
|
" \"Name\": \"PhysiProject\",\n"
|
|
" \"PhysiProject\": {\n"
|
|
" \"OutputDataBlockDesc\": {\n"
|
|
" \"NodeType\": \"19\",\n"
|
|
" \"Name\": \"TupleDesc\",\n"
|
|
" \"TupleDesc\": {\n"
|
|
" \"DataBlockId\": \"1\",\n"
|
|
" \"Slots\": [\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"0\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"9\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": false\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"1\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"4\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"4\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": false\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"2\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"8\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"20\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": false\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"3\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"5\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": false\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"4\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"7\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": false\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"5\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"7\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": false\n"
|
|
" }\n"
|
|
" }\n"
|
|
" ]\n"
|
|
" }\n"
|
|
" },\n"
|
|
" \"Children\": [\n"
|
|
" {\n"
|
|
" \"NodeType\": \"38\",\n"
|
|
" \"Name\": \"PhysiTableScan\",\n"
|
|
" \"PhysiTableScan\": {\n"
|
|
" \"OutputDataBlockDesc\": {\n"
|
|
" \"NodeType\": \"19\",\n"
|
|
" \"Name\": \"TupleDesc\",\n"
|
|
" \"TupleDesc\": {\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"Slots\": [\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"0\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"9\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": true\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"1\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"4\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"4\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": true\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"2\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"8\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"20\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": true\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"3\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"5\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": true\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"4\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"7\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": true\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"5\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"7\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": true\n"
|
|
" }\n"
|
|
" }\n"
|
|
" ]\n"
|
|
" }\n"
|
|
" },\n"
|
|
" \"ScanCols\": [\n"
|
|
" {\n"
|
|
" \"NodeType\": \"18\",\n"
|
|
" \"Name\": \"Target\",\n"
|
|
" \"Target\": {\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"0\",\n"
|
|
" \"Expr\": {\n"
|
|
" \"NodeType\": \"1\",\n"
|
|
" \"Name\": \"Column\",\n"
|
|
" \"Column\": {\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"9\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"AliasName\": \"ts\",\n"
|
|
" \"TableId\": \"0\",\n"
|
|
" \"ColId\": \"1\",\n"
|
|
" \"ColType\": \"1\",\n"
|
|
" \"DbName\": \"test\",\n"
|
|
" \"TableName\": \"t1\",\n"
|
|
" \"TableAlias\": \"t1\",\n"
|
|
" \"ColName\": \"ts\",\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"0\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"18\",\n"
|
|
" \"Name\": \"Target\",\n"
|
|
" \"Target\": {\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"1\",\n"
|
|
" \"Expr\": {\n"
|
|
" \"NodeType\": \"1\",\n"
|
|
" \"Name\": \"Column\",\n"
|
|
" \"Column\": {\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"4\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"4\"\n"
|
|
" },\n"
|
|
" \"AliasName\": \"c1\",\n"
|
|
" \"TableId\": \"0\",\n"
|
|
" \"ColId\": \"2\",\n"
|
|
" \"ColType\": \"1\",\n"
|
|
" \"DbName\": \"test\",\n"
|
|
" \"TableName\": \"t1\",\n"
|
|
" \"TableAlias\": \"t1\",\n"
|
|
" \"ColName\": \"c1\",\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"0\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"18\",\n"
|
|
" \"Name\": \"Target\",\n"
|
|
" \"Target\": {\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"2\",\n"
|
|
" \"Expr\": {\n"
|
|
" \"NodeType\": \"1\",\n"
|
|
" \"Name\": \"Column\",\n"
|
|
" \"Column\": {\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"8\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"20\"\n"
|
|
" },\n"
|
|
" \"AliasName\": \"c2\",\n"
|
|
" \"TableId\": \"0\",\n"
|
|
" \"ColId\": \"3\",\n"
|
|
" \"ColType\": \"1\",\n"
|
|
" \"DbName\": \"test\",\n"
|
|
" \"TableName\": \"t1\",\n"
|
|
" \"TableAlias\": \"t1\",\n"
|
|
" \"ColName\": \"c2\",\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"0\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"18\",\n"
|
|
" \"Name\": \"Target\",\n"
|
|
" \"Target\": {\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"3\",\n"
|
|
" \"Expr\": {\n"
|
|
" \"NodeType\": \"1\",\n"
|
|
" \"Name\": \"Column\",\n"
|
|
" \"Column\": {\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"5\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"AliasName\": \"c3\",\n"
|
|
" \"TableId\": \"0\",\n"
|
|
" \"ColId\": \"4\",\n"
|
|
" \"ColType\": \"1\",\n"
|
|
" \"DbName\": \"test\",\n"
|
|
" \"TableName\": \"t1\",\n"
|
|
" \"TableAlias\": \"t1\",\n"
|
|
" \"ColName\": \"c3\",\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"0\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"18\",\n"
|
|
" \"Name\": \"Target\",\n"
|
|
" \"Target\": {\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"4\",\n"
|
|
" \"Expr\": {\n"
|
|
" \"NodeType\": \"1\",\n"
|
|
" \"Name\": \"Column\",\n"
|
|
" \"Column\": {\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"7\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"AliasName\": \"c4\",\n"
|
|
" \"TableId\": \"0\",\n"
|
|
" \"ColId\": \"5\",\n"
|
|
" \"ColType\": \"1\",\n"
|
|
" \"DbName\": \"test\",\n"
|
|
" \"TableName\": \"t1\",\n"
|
|
" \"TableAlias\": \"t1\",\n"
|
|
" \"ColName\": \"c4\",\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"0\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"18\",\n"
|
|
" \"Name\": \"Target\",\n"
|
|
" \"Target\": {\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"5\",\n"
|
|
" \"Expr\": {\n"
|
|
" \"NodeType\": \"1\",\n"
|
|
" \"Name\": \"Column\",\n"
|
|
" \"Column\": {\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"7\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"AliasName\": \"c5\",\n"
|
|
" \"TableId\": \"0\",\n"
|
|
" \"ColId\": \"6\",\n"
|
|
" \"ColType\": \"1\",\n"
|
|
" \"DbName\": \"test\",\n"
|
|
" \"TableName\": \"t1\",\n"
|
|
" \"TableAlias\": \"t1\",\n"
|
|
" \"ColName\": \"c5\",\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"0\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" ],\n"
|
|
" \"TableId\": \"1\",\n"
|
|
" \"TableType\": \"3\",\n"
|
|
" \"ScanOrder\": \"1\",\n"
|
|
" \"ScanCount\": \"1\",\n"
|
|
" \"ReverseScanCount\": \"0\",\n"
|
|
" \"ScanFlag\": \"0\",\n"
|
|
" \"StartKey\": \"-9223372036854775808\",\n"
|
|
" \"EndKey\": \"9223372036854775807\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" ],\n"
|
|
" \"Projections\": [\n"
|
|
" {\n"
|
|
" \"NodeType\": \"18\",\n"
|
|
" \"Name\": \"Target\",\n"
|
|
" \"Target\": {\n"
|
|
" \"DataBlockId\": \"1\",\n"
|
|
" \"SlotId\": \"0\",\n"
|
|
" \"Expr\": {\n"
|
|
" \"NodeType\": \"1\",\n"
|
|
" \"Name\": \"Column\",\n"
|
|
" \"Column\": {\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"9\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"AliasName\": \"ts\",\n"
|
|
" \"TableId\": \"0\",\n"
|
|
" \"ColId\": \"1\",\n"
|
|
" \"ColType\": \"1\",\n"
|
|
" \"DbName\": \"test\",\n"
|
|
" \"TableName\": \"t1\",\n"
|
|
" \"TableAlias\": \"t1\",\n"
|
|
" \"ColName\": \"ts\",\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"0\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"18\",\n"
|
|
" \"Name\": \"Target\",\n"
|
|
" \"Target\": {\n"
|
|
" \"DataBlockId\": \"1\",\n"
|
|
" \"SlotId\": \"1\",\n"
|
|
" \"Expr\": {\n"
|
|
" \"NodeType\": \"1\",\n"
|
|
" \"Name\": \"Column\",\n"
|
|
" \"Column\": {\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"4\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"4\"\n"
|
|
" },\n"
|
|
" \"AliasName\": \"c1\",\n"
|
|
" \"TableId\": \"0\",\n"
|
|
" \"ColId\": \"2\",\n"
|
|
" \"ColType\": \"1\",\n"
|
|
" \"DbName\": \"test\",\n"
|
|
" \"TableName\": \"t1\",\n"
|
|
" \"TableAlias\": \"t1\",\n"
|
|
" \"ColName\": \"c1\",\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"1\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"18\",\n"
|
|
" \"Name\": \"Target\",\n"
|
|
" \"Target\": {\n"
|
|
" \"DataBlockId\": \"1\",\n"
|
|
" \"SlotId\": \"2\",\n"
|
|
" \"Expr\": {\n"
|
|
" \"NodeType\": \"1\",\n"
|
|
" \"Name\": \"Column\",\n"
|
|
" \"Column\": {\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"8\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"20\"\n"
|
|
" },\n"
|
|
" \"AliasName\": \"c2\",\n"
|
|
" \"TableId\": \"0\",\n"
|
|
" \"ColId\": \"3\",\n"
|
|
" \"ColType\": \"1\",\n"
|
|
" \"DbName\": \"test\",\n"
|
|
" \"TableName\": \"t1\",\n"
|
|
" \"TableAlias\": \"t1\",\n"
|
|
" \"ColName\": \"c2\",\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"2\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"18\",\n"
|
|
" \"Name\": \"Target\",\n"
|
|
" \"Target\": {\n"
|
|
" \"DataBlockId\": \"1\",\n"
|
|
" \"SlotId\": \"3\",\n"
|
|
" \"Expr\": {\n"
|
|
" \"NodeType\": \"1\",\n"
|
|
" \"Name\": \"Column\",\n"
|
|
" \"Column\": {\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"5\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"AliasName\": \"c3\",\n"
|
|
" \"TableId\": \"0\",\n"
|
|
" \"ColId\": \"4\",\n"
|
|
" \"ColType\": \"1\",\n"
|
|
" \"DbName\": \"test\",\n"
|
|
" \"TableName\": \"t1\",\n"
|
|
" \"TableAlias\": \"t1\",\n"
|
|
" \"ColName\": \"c3\",\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"3\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"18\",\n"
|
|
" \"Name\": \"Target\",\n"
|
|
" \"Target\": {\n"
|
|
" \"DataBlockId\": \"1\",\n"
|
|
" \"SlotId\": \"4\",\n"
|
|
" \"Expr\": {\n"
|
|
" \"NodeType\": \"1\",\n"
|
|
" \"Name\": \"Column\",\n"
|
|
" \"Column\": {\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"7\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"AliasName\": \"c4\",\n"
|
|
" \"TableId\": \"0\",\n"
|
|
" \"ColId\": \"5\",\n"
|
|
" \"ColType\": \"1\",\n"
|
|
" \"DbName\": \"test\",\n"
|
|
" \"TableName\": \"t1\",\n"
|
|
" \"TableAlias\": \"t1\",\n"
|
|
" \"ColName\": \"c4\",\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"4\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"18\",\n"
|
|
" \"Name\": \"Target\",\n"
|
|
" \"Target\": {\n"
|
|
" \"DataBlockId\": \"1\",\n"
|
|
" \"SlotId\": \"5\",\n"
|
|
" \"Expr\": {\n"
|
|
" \"NodeType\": \"1\",\n"
|
|
" \"Name\": \"Column\",\n"
|
|
" \"Column\": {\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"7\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"AliasName\": \"c5\",\n"
|
|
" \"TableId\": \"0\",\n"
|
|
" \"ColId\": \"6\",\n"
|
|
" \"ColType\": \"1\",\n"
|
|
" \"DbName\": \"test\",\n"
|
|
" \"TableName\": \"t1\",\n"
|
|
" \"TableAlias\": \"t1\",\n"
|
|
" \"ColName\": \"c5\",\n"
|
|
" \"DataBlockId\": \"0\",\n"
|
|
" \"SlotId\": \"5\"\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" ]\n"
|
|
" }\n"
|
|
" },\n"
|
|
" \"DataSink\": {\n"
|
|
" \"NodeType\": \"46\",\n"
|
|
" \"Name\": \"PhysiDispatch\",\n"
|
|
" \"PhysiDispatch\": {\n"
|
|
" \"InputDataBlockDesc\": {\n"
|
|
" \"NodeType\": \"19\",\n"
|
|
" \"Name\": \"TupleDesc\",\n"
|
|
" \"TupleDesc\": {\n"
|
|
" \"DataBlockId\": \"1\",\n"
|
|
" \"Slots\": [\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"0\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"9\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": false\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"1\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"4\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"4\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": false\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"2\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"8\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"20\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": false\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"3\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"5\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": false\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"4\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"7\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": false\n"
|
|
" }\n"
|
|
" },\n"
|
|
" {\n"
|
|
" \"NodeType\": \"20\",\n"
|
|
" \"Name\": \"SlotDesc\",\n"
|
|
" \"SlotDesc\": {\n"
|
|
" \"SlotId\": \"5\",\n"
|
|
" \"DataType\": {\n"
|
|
" \"Type\": \"7\",\n"
|
|
" \"Precision\": \"0\",\n"
|
|
" \"Scale\": \"0\",\n"
|
|
" \"Bytes\": \"8\"\n"
|
|
" },\n"
|
|
" \"Reserve\": false,\n"
|
|
" \"Output\": false\n"
|
|
" }\n"
|
|
" }\n"
|
|
" ]\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
" }\n"
|
|
"}";
|
|
|
|
SExecTaskInfo* pTaskInfo = nullptr;
|
|
DataSinkHandle sinkHandle = nullptr;
|
|
SReadHandle handle = {reinterpret_cast<void*>(0x1), reinterpret_cast<void*>(0x1), NULL};
|
|
|
|
struct SSubplan* plan = NULL;
|
|
int32_t code = qStringToSubplan(msg, &plan);
|
|
ASSERT_EQ(code, 0);
|
|
|
|
code = qCreateExecTask(&handle, 2, 1, plan, (void**)&pTaskInfo, &sinkHandle, NULL, OPTR_EXEC_MODEL_BATCH);
|
|
ASSERT_EQ(code, 0);
|
|
}
|
|
#if 0
|
|
|
|
TEST(testCase, inMem_sort_Test) {
|
|
SArray* pOrderVal = taosArrayInit(4, sizeof(SOrder));
|
|
SOrder o = {.order = TSDB_ORDER_ASC};
|
|
o.col.info.colId = 1;
|
|
o.col.info.type = TSDB_DATA_TYPE_INT;
|
|
taosArrayPush(pOrderVal, &o);
|
|
|
|
SArray* pExprInfo = taosArrayInit(4, sizeof(SExprInfo));
|
|
SExprInfo *exp = static_cast<SExprInfo*>(taosMemoryCalloc(1, sizeof(SExprInfo)));
|
|
exp->base.resSchema = createSchema(TSDB_DATA_TYPE_INT, sizeof(int32_t), 1, "res");
|
|
taosArrayPush(pExprInfo, &exp);
|
|
|
|
SExprInfo *exp1 = static_cast<SExprInfo*>(taosMemoryCalloc(1, sizeof(SExprInfo)));
|
|
exp1->base.resSchema = createSchema(TSDB_DATA_TYPE_BINARY, 40, 2, "res1");
|
|
taosArrayPush(pExprInfo, &exp1);
|
|
|
|
SOperatorInfo* pOperator = createSortOperatorInfo(createDummyOperator(10000, 5, 1000, data_asc, 1), pExprInfo, pOrderVal, NULL);
|
|
|
|
bool newgroup = false;
|
|
SSDataBlock* pRes = pOperator->getNextFn(pOperator, &newgroup);
|
|
|
|
SColumnInfoData* pCol1 = static_cast<SColumnInfoData*>(taosArrayGet(pRes->pDataBlock, 0));
|
|
SColumnInfoData* pCol2 = static_cast<SColumnInfoData*>(taosArrayGet(pRes->pDataBlock, 1));
|
|
for(int32_t i = 0; i < pRes->info.rows; ++i) {
|
|
char* p = colDataGetData(pCol2, i);
|
|
printf("%d: %d, %s\n", i, ((int32_t*)pCol1->pData)[i], (char*)varDataVal(p));
|
|
}
|
|
}
|
|
|
|
#endif
|
|
|
|
typedef struct su {
|
|
int32_t v;
|
|
char* c;
|
|
} su;
|
|
|
|
int32_t cmp(const void* p1, const void* p2) {
|
|
su* v1 = (su*)p1;
|
|
su* v2 = (su*)p2;
|
|
|
|
int32_t x1 = *(int32_t*)v1->c;
|
|
int32_t x2 = *(int32_t*)v2->c;
|
|
if (x1 == x2) {
|
|
return 0;
|
|
} else {
|
|
return x1 < x2 ? -1 : 1;
|
|
}
|
|
}
|
|
|
|
#if 0
|
|
TEST(testCase, external_sort_Test) {
|
|
#if 0
|
|
su* v = static_cast<su*>(taosMemoryCalloc(1000000, sizeof(su)));
|
|
for(int32_t i = 0; i < 1000000; ++i) {
|
|
v[i].v = taosRand();
|
|
v[i].c = static_cast<char*>(taosMemoryMalloc(4));
|
|
*(int32_t*) v[i].c = i;
|
|
}
|
|
|
|
qsort(v, 1000000, sizeof(su), cmp);
|
|
// for(int32_t i = 0; i < 1000; ++i) {
|
|
// printf("%d ", v[i]);
|
|
// }
|
|
// printf("\n");
|
|
return;
|
|
#endif
|
|
|
|
taosSeedRand(taosGetTimestampSec());
|
|
|
|
SArray* pOrderVal = taosArrayInit(4, sizeof(SOrder));
|
|
SOrder o = {0};
|
|
o.order = TSDB_ORDER_ASC;
|
|
o.col.info.colId = 1;
|
|
o.col.info.type = TSDB_DATA_TYPE_INT;
|
|
taosArrayPush(pOrderVal, &o);
|
|
|
|
SArray* pExprInfo = taosArrayInit(4, sizeof(SExprInfo));
|
|
SExprInfo *exp = static_cast<SExprInfo*>(taosMemoryCalloc(1, sizeof(SExprInfo)));
|
|
exp->base.resSchema = createSchema(TSDB_DATA_TYPE_INT, sizeof(int32_t), 1, "res");
|
|
taosArrayPush(pExprInfo, &exp);
|
|
|
|
SExprInfo *exp1 = static_cast<SExprInfo*>(taosMemoryCalloc(1, sizeof(SExprInfo)));
|
|
exp1->base.resSchema = createSchema(TSDB_DATA_TYPE_BINARY, 40, 2, "res1");
|
|
// taosArrayPush(pExprInfo, &exp1);
|
|
|
|
SOperatorInfo* pOperator = createSortOperatorInfo(createDummyOperator(10000, 1500, 1000, data_desc, 1), pExprInfo, pOrderVal, NULL);
|
|
|
|
bool newgroup = false;
|
|
SSDataBlock* pRes = NULL;
|
|
|
|
int32_t total = 1;
|
|
|
|
int64_t s1 = taosGetTimestampUs();
|
|
int32_t t = 1;
|
|
|
|
while(1) {
|
|
int64_t s = taosGetTimestampUs();
|
|
pRes = pOperator->getNextFn(pOperator, &newgroup);
|
|
|
|
int64_t e = taosGetTimestampUs();
|
|
if (t++ == 1) {
|
|
printf("---------------elapsed:%" PRId64 "\n", e - s);
|
|
}
|
|
|
|
if (pRes == NULL) {
|
|
break;
|
|
}
|
|
|
|
SColumnInfoData* pCol1 = static_cast<SColumnInfoData*>(taosArrayGet(pRes->pDataBlock, 0));
|
|
// SColumnInfoData* pCol2 = static_cast<SColumnInfoData*>(taosArrayGet(pRes->pDataBlock, 1));
|
|
for (int32_t i = 0; i < pRes->info.rows; ++i) {
|
|
// char* p = colDataGetData(pCol2, i);
|
|
printf("%d: %d\n", total++, ((int32_t*)pCol1->pData)[i]);
|
|
// printf("%d: %d, %s\n", total++, ((int32_t*)pCol1->pData)[i], (char*)varDataVal(p));
|
|
}
|
|
}
|
|
|
|
int64_t s2 = taosGetTimestampUs();
|
|
printf("total:%" PRId64 "\n", s2 - s1);
|
|
|
|
pOperator->closeFn(pOperator->info, 2);
|
|
taosMemoryFreeClear(exp);
|
|
taosMemoryFreeClear(exp1);
|
|
taosArrayDestroy(pExprInfo);
|
|
taosArrayDestroy(pOrderVal);
|
|
}
|
|
|
|
TEST(testCase, sorted_merge_Test) {
|
|
taosSeedRand(taosGetTimestampSec());
|
|
|
|
SArray* pOrderVal = taosArrayInit(4, sizeof(SOrder));
|
|
SOrder o = {0};
|
|
o.order = TSDB_ORDER_ASC;
|
|
o.col.info.colId = 1;
|
|
o.col.info.type = TSDB_DATA_TYPE_INT;
|
|
taosArrayPush(pOrderVal, &o);
|
|
|
|
SArray* pExprInfo = taosArrayInit(4, sizeof(SExprInfo));
|
|
SExprInfo *exp = static_cast<SExprInfo*>(taosMemoryCalloc(1, sizeof(SExprInfo)));
|
|
exp->base.resSchema = createSchema(TSDB_DATA_TYPE_BIGINT, sizeof(int64_t), 1, "count_result");
|
|
exp->base.pColumns = static_cast<SColumn*>(taosMemoryCalloc(1, sizeof(SColumn)));
|
|
exp->base.pColumns->flag = TSDB_COL_NORMAL;
|
|
exp->base.pColumns->info = (SColumnInfo) {.colId = 1, .type = TSDB_DATA_TYPE_INT, .bytes = 4};
|
|
exp->base.numOfCols = 1;
|
|
|
|
taosArrayPush(pExprInfo, &exp);
|
|
|
|
SExprInfo *exp1 = static_cast<SExprInfo*>(taosMemoryCalloc(1, sizeof(SExprInfo)));
|
|
exp1->base.resSchema = createSchema(TSDB_DATA_TYPE_BINARY, 40, 2, "res1");
|
|
// taosArrayPush(pExprInfo, &exp1);
|
|
|
|
int32_t numOfSources = 10;
|
|
SOperatorInfo** plist = (SOperatorInfo**) taosMemoryCalloc(numOfSources, sizeof(void*));
|
|
for(int32_t i = 0; i < numOfSources; ++i) {
|
|
plist[i] = createDummyOperator(1, 1, 1, data_asc, 1);
|
|
}
|
|
|
|
SOperatorInfo* pOperator = createSortedMergeOperatorInfo(plist, numOfSources, pExprInfo, pOrderVal, NULL, NULL);
|
|
|
|
bool newgroup = false;
|
|
SSDataBlock* pRes = NULL;
|
|
|
|
int32_t total = 1;
|
|
|
|
int64_t s1 = taosGetTimestampUs();
|
|
int32_t t = 1;
|
|
|
|
while(1) {
|
|
int64_t s = taosGetTimestampUs();
|
|
pRes = pOperator->getNextFn(pOperator, &newgroup);
|
|
|
|
int64_t e = taosGetTimestampUs();
|
|
if (t++ == 1) {
|
|
printf("---------------elapsed:%" PRId64 "\n", e - s);
|
|
}
|
|
|
|
if (pRes == NULL) {
|
|
break;
|
|
}
|
|
|
|
SColumnInfoData* pCol1 = static_cast<SColumnInfoData*>(taosArrayGet(pRes->pDataBlock, 0));
|
|
// SColumnInfoData* pCol2 = static_cast<SColumnInfoData*>(taosArrayGet(pRes->pDataBlock, 1));
|
|
for (int32_t i = 0; i < pRes->info.rows; ++i) {
|
|
// char* p = colDataGetData(pCol2, i);
|
|
printf("%d: %" PRId64 "\n", total++, ((int64_t*)pCol1->pData)[i]);
|
|
// printf("%d: %d, %s\n", total++, ((int32_t*)pCol1->pData)[i], (char*)varDataVal(p));
|
|
}
|
|
}
|
|
|
|
int64_t s2 = taosGetTimestampUs();
|
|
printf("total:%" PRId64 "\n", s2 - s1);
|
|
|
|
pOperator->closeFn(pOperator->info, 2);
|
|
taosMemoryFreeClear(exp);
|
|
taosMemoryFreeClear(exp1);
|
|
taosArrayDestroy(pExprInfo);
|
|
taosArrayDestroy(pOrderVal);
|
|
}
|
|
|
|
TEST(testCase, time_interval_Operator_Test) {
|
|
taosSeedRand(taosGetTimestampSec());
|
|
|
|
SArray* pOrderVal = taosArrayInit(4, sizeof(SOrder));
|
|
SOrder o = {0};
|
|
o.order = TSDB_ORDER_ASC;
|
|
o.col.info.colId = 1;
|
|
o.col.info.type = TSDB_DATA_TYPE_INT;
|
|
taosArrayPush(pOrderVal, &o);
|
|
|
|
SArray* pExprInfo = taosArrayInit(4, sizeof(SExprInfo));
|
|
SExprInfo *exp = static_cast<SExprInfo*>(taosMemoryCalloc(1, sizeof(SExprInfo)));
|
|
exp->base.resSchema = createSchema(TSDB_DATA_TYPE_TIMESTAMP, sizeof(int64_t), 1, "ts");
|
|
exp->base.pColumns = static_cast<SColumn*>(taosMemoryCalloc(1, sizeof(SColumn)));
|
|
exp->base.pColumns->flag = TSDB_COL_NORMAL;
|
|
exp->base.pColumns->info = (SColumnInfo) {.colId = 1, .type = TSDB_DATA_TYPE_TIMESTAMP, .bytes = 8};
|
|
exp->base.numOfCols = 1;
|
|
|
|
taosArrayPush(pExprInfo, &exp);
|
|
|
|
SExprInfo *exp1 = static_cast<SExprInfo*>(taosMemoryCalloc(1, sizeof(SExprInfo)));
|
|
exp1->base.resSchema = createSchema(TSDB_DATA_TYPE_BIGINT, 8, 2, "res1");
|
|
exp1->base.pColumns = static_cast<SColumn*>(taosMemoryCalloc(1, sizeof(SColumn)));
|
|
exp1->base.pColumns->flag = TSDB_COL_NORMAL;
|
|
exp1->base.pColumns->info = (SColumnInfo) {.colId = 1, .type = TSDB_DATA_TYPE_INT, .bytes = 4};
|
|
exp1->base.numOfCols = 1;
|
|
|
|
taosArrayPush(pExprInfo, &exp1);
|
|
|
|
SOperatorInfo* p = createDummyOperator(1, 1, 2000, data_asc, 2);
|
|
|
|
SExecTaskInfo ti = {0};
|
|
SInterval interval = {0};
|
|
interval.sliding = interval.interval = 1000;
|
|
interval.slidingUnit = interval.intervalUnit = 'a';
|
|
|
|
SOperatorInfo* pOperator = createIntervalOperatorInfo(p, pExprInfo, &interval, &ti);
|
|
|
|
bool newgroup = false;
|
|
SSDataBlock* pRes = NULL;
|
|
|
|
int32_t total = 1;
|
|
|
|
int64_t s1 = taosGetTimestampUs();
|
|
int32_t t = 1;
|
|
|
|
while(1) {
|
|
int64_t s = taosGetTimestampUs();
|
|
pRes = pOperator->getNextFn(pOperator, &newgroup);
|
|
|
|
int64_t e = taosGetTimestampUs();
|
|
if (t++ == 1) {
|
|
printf("---------------elapsed:%" PRId64 "\n", e - s);
|
|
}
|
|
|
|
if (pRes == NULL) {
|
|
break;
|
|
}
|
|
|
|
SColumnInfoData* pCol1 = static_cast<SColumnInfoData*>(taosArrayGet(pRes->pDataBlock, 0));
|
|
// SColumnInfoData* pCol2 = static_cast<SColumnInfoData*>(taosArrayGet(pRes->pDataBlock, 1));
|
|
for (int32_t i = 0; i < pRes->info.rows; ++i) {
|
|
// char* p = colDataGetData(pCol2, i);
|
|
printf("%d: %" PRId64 "\n", total++, ((int64_t*)pCol1->pData)[i]);
|
|
// printf("%d: %d, %s\n", total++, ((int32_t*)pCol1->pData)[i], (char*)varDataVal(p));
|
|
}
|
|
}
|
|
|
|
int64_t s2 = taosGetTimestampUs();
|
|
printf("total:%" PRId64 "\n", s2 - s1);
|
|
|
|
pOperator->closeFn(pOperator->info, 2);
|
|
taosMemoryFreeClear(exp);
|
|
taosMemoryFreeClear(exp1);
|
|
taosArrayDestroy(pExprInfo);
|
|
taosArrayDestroy(pOrderVal);
|
|
}
|
|
#endif
|
|
|
|
TEST(streamExecutor, calcOutputTbName) {
|
|
SNode* pNode = NULL;
|
|
nodesMakeValueNodeFromInt64(1, &pNode);
|
|
SValueNode* pVal = (SValueNode*)pNode;
|
|
char tbname[128] = {0};
|
|
ASSERT_EQ(0, streamCalcOutputTbName(pNode, tbname, 0));
|
|
ASSERT_STREQ(tbname, "1");
|
|
}
|
|
|
|
#pragma GCC diagnosti
|