From cfb9b0e14df3624e2a63ff85e02fa2fe7a5ad07b Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 22 Nov 2022 15:18:29 +0800 Subject: [PATCH 01/23] test:add testcase of enterprise installPackages --- packaging/testpackage.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packaging/testpackage.sh b/packaging/testpackage.sh index 846c8d160f..dbc46b8e55 100755 --- a/packaging/testpackage.sh +++ b/packaging/testpackage.sh @@ -206,6 +206,10 @@ else fi +if [[ ${packgeName} =~ "server" ]] ;then + echoColor BD " pkill -9 taosd " + pkill -9 taosd +fi echoColor G "===== new workroom path =====" From b883929c54dd7b0eab93e259dc597737769a0050 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 22 Nov 2022 21:38:13 +0800 Subject: [PATCH 02/23] test:add testcase of enterprise installPackages --- packaging/MPtestJenkinsfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packaging/MPtestJenkinsfile b/packaging/MPtestJenkinsfile index dad5b7f129..c8b0fdbf5d 100644 --- a/packaging/MPtestJenkinsfile +++ b/packaging/MPtestJenkinsfile @@ -274,9 +274,8 @@ pipeline { do cd ${TDENGINE_ROOT_DIR}/packaging bash testpackage.sh -f server -m ${verModeSin} -f client -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar - python3 checkPackageRuning.py + python3 checkPackageRuning.py 192.168.0.21 done - python3 checkPackageRuning.py 192.168.0.21 ''' } } @@ -289,7 +288,6 @@ pipeline { verModeList=community cd ${TDENGINE_ROOT_DIR}/packaging bash testpackage.sh -f server -m ${verModeSin} -f client -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar - python3 checkPackageRuning.py python3 checkPackageRuning.py 192.168.0.24 ''' } @@ -310,9 +308,8 @@ pipeline { do cd ${TDENGINE_ROOT_DIR}/packaging bash testpackage.sh -f server -m ${verModeSin} -f client -l false -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar - python3 checkPackageRuning.py + python3 checkPackageRuning.py 192.168.0.21 done - python3 checkPackageRuning.py 192.168.0.21 ''' } } From 305e580366a65a0616ea8cd560e2984abbe77ad5 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 22 Nov 2022 21:48:45 +0800 Subject: [PATCH 03/23] test:add testcase of enterprise installPackages --- packaging/MPtestJenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packaging/MPtestJenkinsfile b/packaging/MPtestJenkinsfile index c8b0fdbf5d..2e19bd56ee 100644 --- a/packaging/MPtestJenkinsfile +++ b/packaging/MPtestJenkinsfile @@ -285,9 +285,8 @@ pipeline { steps { timeout(time: 30, unit: 'MINUTES'){ sh ''' - verModeList=community cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f client -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -f server -m community -f client -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py 192.168.0.24 ''' } From 45e1ac3a0ae0aad4508057e504c69aea0eb6fd52 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 23 Nov 2022 12:47:17 +0800 Subject: [PATCH 04/23] test:add testcase of enterprise installPackages --- packaging/MPtestJenkinsfile | 32 ++++++++++++++++---------------- packaging/testpackage.sh | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packaging/MPtestJenkinsfile b/packaging/MPtestJenkinsfile index 2e19bd56ee..0570bae191 100644 --- a/packaging/MPtestJenkinsfile +++ b/packaging/MPtestJenkinsfile @@ -120,20 +120,20 @@ pipeline { for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py done ''' sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py ''' sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb + bash testpackage.sh -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb python3 checkPackageRuning.py ''' } @@ -152,20 +152,20 @@ pipeline { for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py done ''' sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py ''' sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb + bash testpackage.sh -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb python3 checkPackageRuning.py dpkg -r tdengine ''' @@ -185,20 +185,20 @@ pipeline { for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py done ''' sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py ''' sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm + bash testpackage.sh -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm python3 checkPackageRuning.py ''' } @@ -217,20 +217,20 @@ pipeline { for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py done ''' sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py ''' sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm + bash testpackage.sh -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm python3 checkPackageRuning.py sudo rpm -e tdengine ''' @@ -250,7 +250,7 @@ pipeline { for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -m ${verModeSin} -f server -l false -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py done ''' @@ -273,7 +273,7 @@ pipeline { for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f client -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -m ${verModeSin} -f client -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py 192.168.0.21 done ''' @@ -286,7 +286,7 @@ pipeline { timeout(time: 30, unit: 'MINUTES'){ sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m community -f client -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -m community -f client -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py 192.168.0.24 ''' } @@ -306,7 +306,7 @@ pipeline { for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f client -l false -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -m ${verModeSin} -f client -l false -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py 192.168.0.21 done ''' diff --git a/packaging/testpackage.sh b/packaging/testpackage.sh index dbc46b8e55..78d5043b0c 100755 --- a/packaging/testpackage.sh +++ b/packaging/testpackage.sh @@ -338,7 +338,7 @@ elif ([[ ${packgeName} =~ "arm64" ]] && [[ ${packgeName} =~ "client" ]]);then echoColor G "===== install taos-tools arm when package is arm64-client =====" cd ${installPath} if [ ! -f "taosTools-2.1.3-Linux-x64.tar.gz " ];then - wgetFile taosTools-2.1.3-Linux-x64.tar.gz v2.1.3 web + wgetFile taosTools-2.1.3-Linux-arm64.tar.gz v2.1.3 web tar xf taosTools-2.1.3-Linux-arm64.tar.gz fi From 2e3d15d6cfc6e2e835884d1d811e5eab0dfe8742 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 23 Nov 2022 16:57:59 +0800 Subject: [PATCH 05/23] ci:update ci server --- Jenkinsfile2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile2 b/Jenkinsfile2 index 33c3ef55c9..ac36f0e69e 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -361,7 +361,7 @@ pipeline { } parallel { stage('check docs') { - agent{label " worker03 || slave215 || slave217 || slave219 || Mac_catalina "} + agent{label " slave1_47 "} steps { check_docs() } @@ -407,7 +407,7 @@ pipeline { } } stage('linux test') { - agent{label " worker03 || slave215 || slave217 || slave219 "} + agent{label " slave1_47 "} options { skipDefaultCheckout() } when { changeRequest() From 5a4b7e95ebf0341c3b341512dae96f4b96a2e4f1 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 23 Nov 2022 21:56:12 +0800 Subject: [PATCH 06/23] ci:test ci --- Jenkinsfile2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile2 b/Jenkinsfile2 index ac599aa3a6..3e953dc4e0 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -361,7 +361,7 @@ pipeline { } parallel { stage('check docs') { - agent{label " slave1_47 "} + agent{label " slave1_48 "} steps { check_docs() } @@ -407,7 +407,7 @@ pipeline { } } stage('linux test') { - agent{label " slave1_47 "} + agent{label " slave1_48 "} options { skipDefaultCheckout() } when { changeRequest() From 54e6d72c2d6e4e0891fde2f011f7317b77d5ccf2 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Sun, 27 Nov 2022 18:01:07 +0800 Subject: [PATCH 07/23] test:add win testcase in ci --- tests/system-test/test-all.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system-test/test-all.bat b/tests/system-test/test-all.bat index 22b10fa01f..dd1ec6deab 100644 --- a/tests/system-test/test-all.bat +++ b/tests/system-test/test-all.bat @@ -90,7 +90,7 @@ goto :eof :CheckSkipCase set skipCase=false -if "%*" == "python3 ./test.py -f 1-insert/insertWithMoreVgroup.py" ( set skipCase=true ) -if "%*" == "python3 ./test.py -f 2-query/queryQnode.py" ( set skipCase=true ) +if "%*" == "python3 ./test.py -f 1-insert/insertWithMoreVgroup.py" ( set skipCase=false ) +if "%*" == "python3 ./test.py -f 2-query/queryQnode.py" ( set skipCase=false ) echo %* | grep "\-R" && set skipCase=true :goto eof \ No newline at end of file From 74f83a362bb85d241054ffc222dbb8286e1e98a6 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sun, 27 Nov 2022 22:23:40 +0800 Subject: [PATCH 08/23] fix: memory while use taosx --- source/dnode/mnode/impl/src/mndStream.c | 1 + source/dnode/mnode/impl/src/mndTopic.c | 1 + 2 files changed, 2 insertions(+) diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index 62247f2c2a..d8cf7a837e 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -525,6 +525,7 @@ static int32_t mndCreateStbForStream(SMnode *pMnode, STrans *pTrans, const SStre tFreeSMCreateStbReq(&createReq); mndFreeStb(&stbObj); + mndReleaseStb(pMnode, pStb); mndReleaseDb(pMnode, pDb); return 0; diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index f1db6a12fc..6412761f0b 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -434,6 +434,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq * return -1; } topicObj.stbUid = pStb->uid; + mndReleaseStb(pMnode, pStb); } /*} else if (pCreate->subType == TOPIC_SUB_TYPE__DB) {*/ /*topicObj.ast = NULL;*/ From fd65b8935b34ee3cb080c9838d8871e45d82368e Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sun, 27 Nov 2022 22:24:28 +0800 Subject: [PATCH 09/23] test: add asan case --- tests/parallel_test/cases.task | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index f99005af2d..1b554f928c 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -702,7 +702,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py -,,,system-test,python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py +,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDnodeRestart.py @@ -723,12 +723,12 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/stbTagFilter-1ctb.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dataFromTsdbNWal.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dataFromTsdbNWal-multiCtb.py -,,,system-test,python3 ./test.py -f 7-tmq/tmq_taosx.py +,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_taosx.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/stbTagFilter-multiCtb.py ,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-19201.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqSubscribeStb-r3.py -N 5 -,,,system-test,python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3 -,,,system-test,python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3 -n 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3 -n 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distinct.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/varchar.py -Q 2 From b0ee829db25f0ee6921c0359ddb4b25e74fbb16a Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 28 Nov 2022 00:27:49 +0800 Subject: [PATCH 10/23] refactor: do some internal refactor. --- source/libs/executor/inc/executil.h | 2 +- source/libs/executor/inc/executorimpl.h | 159 +--- source/libs/executor/src/cachescanoperator.c | 2 +- source/libs/executor/src/exchangeoperator.c | 2 +- source/libs/executor/src/executil.c | 2 +- source/libs/executor/src/executorimpl.c | 19 +- source/libs/executor/src/groupoperator.c | 10 +- source/libs/executor/src/joinoperator.c | 2 +- source/libs/executor/src/projectoperator.c | 4 +- source/libs/executor/src/scanoperator.c | 15 +- source/libs/executor/src/sortoperator.c | 8 +- source/libs/executor/src/sysscanoperator.c | 4 +- source/libs/executor/src/tfill.c | 6 +- source/libs/executor/src/timewindowoperator.c | 618 +----------- source/libs/function/src/builtinsimpl.c | 893 ------------------ 15 files changed, 141 insertions(+), 1605 deletions(-) diff --git a/source/libs/executor/inc/executil.h b/source/libs/executor/inc/executil.h index fd8a357a8b..d5366f1b7a 100644 --- a/source/libs/executor/inc/executil.h +++ b/source/libs/executor/inc/executil.h @@ -140,7 +140,7 @@ bool hasRemainResults(SGroupResInfo* pGroupResInfo); int32_t getNumOfTotalRes(SGroupResInfo* pGroupResInfo); -SSDataBlock* createResDataBlock(SDataBlockDescNode* pNode); +SSDataBlock* createDataBlockFromDescNode(SDataBlockDescNode* pNode); EDealRes doTranslateTagExpr(SNode** pNode, void* pContext); int32_t getGroupIdFromTagsVal(void* pMeta, uint64_t uid, SNodeList* pGroupNode, char* keyBuf, uint64_t* pGroupId); diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index b9d622a4c3..bd4472327c 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -537,15 +537,6 @@ typedef struct SStreamIntervalOperatorInfo { SWinKey delKey; } SStreamIntervalOperatorInfo; -typedef struct SAggOperatorInfo { - SOptrBasicInfo binfo; - SAggSupporter aggSup; - STableQueryInfo* current; - uint64_t groupId; - SGroupResInfo groupResInfo; - SExprSupp scalarExprSup; -} SAggOperatorInfo; - typedef struct SFillOperatorInfo { struct SFillInfo* pFillInfo; SSDataBlock* pRes; @@ -577,18 +568,6 @@ typedef struct SWindowRowsSup { uint64_t groupId; } SWindowRowsSup; -typedef struct SSessionAggOperatorInfo { - SOptrBasicInfo binfo; - SAggSupporter aggSup; - - SGroupResInfo groupResInfo; - SWindowRowsSup winSup; - bool reptScan; // next round scan - int64_t gap; // session window gap - int32_t tsSlotId; // primary timestamp slot id - STimeWindowAggSupp twAggSup; -} SSessionAggOperatorInfo; - typedef struct SResultWindowInfo { void* pOutputBuf; SSessionKey sessionWin; @@ -681,37 +660,6 @@ typedef struct SStreamFillOperatorInfo { SStreamFillInfo* pFillInfo; } SStreamFillOperatorInfo; -typedef struct STimeSliceOperatorInfo { - SSDataBlock* pRes; - STimeWindow win; - SInterval interval; - int64_t current; - SArray* pPrevRow; // SArray - SArray* pNextRow; // SArray - SArray* pLinearInfo; // SArray - bool isPrevRowSet; - bool isNextRowSet; - int32_t fillType; // fill type - SColumn tsCol; // primary timestamp column - SExprSupp scalarSup; // scalar calculation - struct SFillColInfo* pFillColInfo; // fill column info -} STimeSliceOperatorInfo; - -typedef struct SStateWindowOperatorInfo { - // SOptrBasicInfo should be first, SAggSupporter should be second for stream encode - SOptrBasicInfo binfo; - SAggSupporter aggSup; - SExprSupp scalarSup; - - SGroupResInfo groupResInfo; - SWindowRowsSup winSup; - SColumn stateCol; // start row index - bool hasKey; - SStateKeys stateKey; - int32_t tsSlotId; // primary timestamp column slot id - STimeWindowAggSupp twAggSup; -} SStateWindowOperatorInfo; - #define OPTR_IS_OPENED(_optr) (((_optr)->status & OP_OPENED) == OP_OPENED) #define OPTR_SET_OPENED(_optr) ((_optr)->status |= OP_OPENED) @@ -726,6 +674,7 @@ void cleanupBasicInfo(SOptrBasicInfo* pInfo); int32_t initExprSupp(SExprSupp* pSup, SExprInfo* pExprInfo, int32_t numOfExpr); void cleanupExprSupp(SExprSupp* pSup); void destroyExprInfo(SExprInfo* pExpr, int32_t numOfExprs); + int32_t initAggInfo(SExprSupp* pSup, SAggSupporter* pAggSup, SExprInfo* pExprInfo, int32_t numOfCols, size_t keyBufSize, const char* pkey); void initResultSizeInfo(SResultInfo* pResultInfo, int32_t numOfRows); @@ -735,12 +684,12 @@ void doBuildStreamResBlock(SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SGr void doBuildResultDatablock(SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SGroupResInfo* pGroupResInfo, SDiskbasedBuf* pBuf); -bool hasLimitOffsetInfo(SLimitInfo* pLimitInfo); -void initLimitInfo(const SNode* pLimit, const SNode* pSLimit, SLimitInfo* pLimitInfo); +bool hasLimitOffsetInfo(SLimitInfo* pLimitInfo); +void initLimitInfo(const SNode* pLimit, const SNode* pSLimit, SLimitInfo* pLimitInfo); void applyLimitOffset(SLimitInfo* pLimitInfo, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo, SOperatorInfo* pOperator); -void doApplyFunctions(SExecTaskInfo* taskInfo, SqlFunctionCtx* pCtx, SColumnInfoData* pTimeWindowData, int32_t offset, - int32_t forwardStep, int32_t numOfTotal, int32_t numOfOutput); +void applyAggFunctionOnPartialTuples(SExecTaskInfo* taskInfo, SqlFunctionCtx* pCtx, SColumnInfoData* pTimeWindowData, + int32_t offset, int32_t forwardStep, int32_t numOfTotal, int32_t numOfOutput); int32_t extractDataBlockFromFetchRsp(SSDataBlock* pRes, char* pData, SArray* pColList, char** pNextStart); void updateLoadRemoteInfo(SLoadRemoteDataInfo* pInfo, int32_t numOfRows, int32_t dataLen, int64_t startTs, @@ -751,7 +700,7 @@ STimeWindow getFirstQualifiedTimeWindow(int64_t ts, STimeWindow* pWindow, SInter int32_t getTableScanInfo(SOperatorInfo* pOperator, int32_t* order, int32_t* scanFlag); int32_t getBufferPgSize(int32_t rowSize, uint32_t* defaultPgsz, uint32_t* defaultBufsz); -void doDestroyExchangeOperatorInfo(void* param); +extern void doDestroyExchangeOperatorInfo(void* param); void setOperatorCompleted(SOperatorInfo* pOperator); void setOperatorInfo(SOperatorInfo* pOperator, const char* name, int32_t type, bool blocking, int32_t status, @@ -764,79 +713,73 @@ void cleanupAggSup(SAggSupporter* pAggSup); void appendOneRowToDataBlock(SSDataBlock* pBlock, STupleHandle* pTupleHandle); void setTbNameColData(const SSDataBlock* pBlock, SColumnInfoData* pColInfoData, int32_t functionId, const char* name); -SSDataBlock* loadNextDataBlock(void* param); - void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset); SResultRow* doSetResultOutBufByKey(SDiskbasedBuf* pResultBuf, SResultRowInfo* pResultRowInfo, char* pData, int16_t bytes, bool masterscan, uint64_t groupId, SExecTaskInfo* pTaskInfo, bool isIntervalQuery, SAggSupporter* pSup); - +// operator creater functions +// clang-format off SOperatorInfo* createExchangeOperatorInfo(void* pTransporter, SExchangePhysiNode* pExNode, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode, SReadHandle* pHandle, - SExecTaskInfo* pTaskInfo); -SOperatorInfo* createTagScanOperatorInfo(SReadHandle* pReadHandle, STagScanPhysiNode* pPhyNode, - STableListInfo* pTableListInfo, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScanPhysiNode* pScanPhyNode, - const char* pUser, SExecTaskInfo* pTaskInfo); +SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode, SReadHandle* pHandle, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createTagScanOperatorInfo(SReadHandle* pReadHandle, STagScanPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScanPhysiNode* pScanPhyNode, const char* pUser, SExecTaskInfo* pTaskInfo); SOperatorInfo* createAggregateOperatorInfo(SOperatorInfo* downstream, SAggPhysiNode* pNode, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createIndefinitOutputOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pNode, - SExecTaskInfo* pTaskInfo); -SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhysiNode* pProjPhyNode, - SExecTaskInfo* pTaskInfo); +SOperatorInfo* createIndefinitOutputOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhysiNode* pProjPhyNode, SExecTaskInfo* pTaskInfo); + SOperatorInfo* createSortOperatorInfo(SOperatorInfo* downstream, SSortPhysiNode* pSortNode, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createMultiwayMergeOperatorInfo(SOperatorInfo** dowStreams, size_t numStreams, - SMergePhysiNode* pMergePhysiNode, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createCacherowsScanOperator(SLastRowScanPhysiNode* pTableScanNode, SReadHandle* readHandle, - SExecTaskInfo* pTaskInfo); -SOperatorInfo* createIntervalOperatorInfo(SOperatorInfo* downstream, SIntervalPhysiNode* pPhyNode, - SExecTaskInfo* pTaskInfo, bool isStream); -SOperatorInfo* createMergeIntervalOperatorInfo(SOperatorInfo* downstream, SMergeIntervalPhysiNode* pIntervalPhyNode, - SExecTaskInfo* pTaskInfo); -SOperatorInfo* createMergeAlignedIntervalOperatorInfo(SOperatorInfo* downstream, SMergeAlignedIntervalPhysiNode* pNode, - SExecTaskInfo* pTaskInfo); -SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, - SExecTaskInfo* pTaskInfo, int32_t numOfChild); -SOperatorInfo* createSessionAggOperatorInfo(SOperatorInfo* downstream, SSessionWinodwPhysiNode* pSessionNode, - SExecTaskInfo* pTaskInfo); +SOperatorInfo* createMultiwayMergeOperatorInfo(SOperatorInfo** dowStreams, size_t numStreams, SMergePhysiNode* pMergePhysiNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createCacherowsScanOperator(SLastRowScanPhysiNode* pTableScanNode, SReadHandle* readHandle, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createIntervalOperatorInfo(SOperatorInfo* downstream, SIntervalPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, bool isStream); + +SOperatorInfo* createMergeIntervalOperatorInfo(SOperatorInfo* downstream, SMergeIntervalPhysiNode* pIntervalPhyNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createMergeAlignedIntervalOperatorInfo(SOperatorInfo* downstream, SMergeAlignedIntervalPhysiNode* pNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, int32_t numOfChild); + +SOperatorInfo* createSessionAggOperatorInfo(SOperatorInfo* downstream, SSessionWinodwPhysiNode* pSessionNode, SExecTaskInfo* pTaskInfo); + SOperatorInfo* createGroupOperatorInfo(SOperatorInfo* downstream, SAggPhysiNode* pAggNode, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createDataBlockInfoScanOperator(SReadHandle* readHandle, SBlockDistScanPhysiNode* pBlockScanNode, - SExecTaskInfo* pTaskInfo); -SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhysiNode* pTableScanNode, SNode* pTagCond, - SExecTaskInfo* pTaskInfo); +SOperatorInfo* createDataBlockInfoScanOperator(SReadHandle* readHandle, SBlockDistScanPhysiNode* pBlockScanNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhysiNode* pTableScanNode, SNode* pTagCond, SExecTaskInfo* pTaskInfo); SOperatorInfo* createRawScanOperatorInfo(SReadHandle* pHandle, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createFillOperatorInfo(SOperatorInfo* downstream, SFillPhysiNode* pPhyFillNode, - SExecTaskInfo* pTaskInfo); -SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SStateWinodwPhysiNode* pStateNode, - SExecTaskInfo* pTaskInfo); -SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartitionPhysiNode* pPartNode, - SExecTaskInfo* pTaskInfo); +SOperatorInfo* createFillOperatorInfo(SOperatorInfo* downstream, SFillPhysiNode* pPhyFillNode, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createStreamPartitionOperatorInfo(SOperatorInfo* downstream, SStreamPartitionPhysiNode* pPartNode, - SExecTaskInfo* pTaskInfo); +SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SStateWinodwPhysiNode* pStateNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartitionPhysiNode* pPartNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createStreamPartitionOperatorInfo(SOperatorInfo* downstream, SStreamPartitionPhysiNode* pPartNode, SExecTaskInfo* pTaskInfo); SOperatorInfo* createTimeSliceOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pNode, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createMergeJoinOperatorInfo(SOperatorInfo** pDownstream, int32_t numOfDownstream, - SSortMergeJoinPhysiNode* pJoinNode, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, - SExecTaskInfo* pTaskInfo); -SOperatorInfo* createStreamFinalSessionAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, - SExecTaskInfo* pTaskInfo, int32_t numOfChild); -SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, - SExecTaskInfo* pTaskInfo); +SOperatorInfo* createMergeJoinOperatorInfo(SOperatorInfo** pDownstream, int32_t numOfDownstream, SSortMergeJoinPhysiNode* pJoinNode, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, - SExecTaskInfo* pTaskInfo); -SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFillPhysiNode* pPhyFillNode, - SExecTaskInfo* pTaskInfo); +SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createStreamFinalSessionAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, int32_t numOfChild); + +SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFillPhysiNode* pPhyFillNode, SExecTaskInfo* pTaskInfo); +// clang-format on int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBlock* pSrcBlock, SqlFunctionCtx* pCtx, int32_t numOfOutput, SArray* pPseudoList); diff --git a/source/libs/executor/src/cachescanoperator.c b/source/libs/executor/src/cachescanoperator.c index 873089023a..cdd744bded 100644 --- a/source/libs/executor/src/cachescanoperator.c +++ b/source/libs/executor/src/cachescanoperator.c @@ -59,7 +59,7 @@ SOperatorInfo* createCacherowsScanOperator(SLastRowScanPhysiNode* pScanNode, SRe pInfo->readHandle = *readHandle; SDataBlockDescNode* pDescNode = pScanNode->scan.node.pOutputDataBlockDesc; - pInfo->pRes = createResDataBlock(pDescNode); + pInfo->pRes = createDataBlockFromDescNode(pDescNode); int32_t numOfCols = 0; code = diff --git a/source/libs/executor/src/exchangeoperator.c b/source/libs/executor/src/exchangeoperator.c index d8c85c5ffb..280880c077 100644 --- a/source/libs/executor/src/exchangeoperator.c +++ b/source/libs/executor/src/exchangeoperator.c @@ -303,7 +303,7 @@ SOperatorInfo* createExchangeOperatorInfo(void* pTransporter, SExchangePhysiNode } tsem_init(&pInfo->ready, 0, 0); - pInfo->pDummyBlock = createResDataBlock(pExNode->node.pOutputDataBlockDesc); + pInfo->pDummyBlock = createDataBlockFromDescNode(pExNode->node.pOutputDataBlockDesc); pInfo->pResultBlockList = taosArrayInit(64, POINTER_BYTES); pInfo->pRecycledBlocks = taosArrayInit(64, POINTER_BYTES); diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 65937ae1bc..08e6e4792b 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -208,7 +208,7 @@ SArray* createSortInfo(SNodeList* pNodeList) { return pList; } -SSDataBlock* createResDataBlock(SDataBlockDescNode* pNode) { +SSDataBlock* createDataBlockFromDescNode(SDataBlockDescNode* pNode) { int32_t numOfCols = LIST_LENGTH(pNode->pSlots); SSDataBlock* pBlock = createDataBlock(); diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 7d8c7da78d..5eaa8ba8dd 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -76,6 +76,15 @@ static UNUSED_FUNC void* u_realloc(void* p, size_t __size) { #define CLEAR_QUERY_STATUS(q, st) ((q)->status &= (~(st))) #define QUERY_IS_INTERVAL_QUERY(_q) ((_q)->interval.interval > 0) +typedef struct SAggOperatorInfo { + SOptrBasicInfo binfo; + SAggSupporter aggSup; + STableQueryInfo* current; + uint64_t groupId; + SGroupResInfo groupResInfo; + SExprSupp scalarExprSup; +} SAggOperatorInfo; + int32_t getMaximumIdleDurationSec() { return tsShellActivityTimer * 2; } static void setBlockSMAInfo(SqlFunctionCtx* pCtx, SExprInfo* pExpr, SSDataBlock* pBlock); @@ -316,8 +325,8 @@ static void functionCtxRestore(SqlFunctionCtx* pCtx, SFunctionCtxStatus* pStatus pCtx->input.startRowIndex = pStatus->startOffset; } -void doApplyFunctions(SExecTaskInfo* taskInfo, SqlFunctionCtx* pCtx, SColumnInfoData* pTimeWindowData, int32_t offset, - int32_t forwardStep, int32_t numOfTotal, int32_t numOfOutput) { +void applyAggFunctionOnPartialTuples(SExecTaskInfo* taskInfo, SqlFunctionCtx* pCtx, SColumnInfoData* pTimeWindowData, + int32_t offset, int32_t forwardStep, int32_t numOfTotal, int32_t numOfOutput) { for (int32_t k = 0; k < numOfOutput; ++k) { // keep it temporarily SFunctionCtxStatus status = {0}; @@ -2039,7 +2048,7 @@ SOperatorInfo* createAggregateOperatorInfo(SOperatorInfo* downstream, SAggPhysiN goto _error; } - SSDataBlock* pResBlock = createResDataBlock(pAggNode->node.pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pAggNode->node.pOutputDataBlockDesc); initBasicInfo(&pInfo->binfo, pResBlock); size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; @@ -2213,7 +2222,7 @@ SOperatorInfo* createFillOperatorInfo(SOperatorInfo* downstream, SFillPhysiNode* goto _error; } - pInfo->pRes = createResDataBlock(pPhyFillNode->node.pOutputDataBlockDesc); + pInfo->pRes = createDataBlockFromDescNode(pPhyFillNode->node.pOutputDataBlockDesc); SExprInfo* pExprInfo = createExprInfo(pPhyFillNode->pFillExprs, NULL, &pInfo->numOfExpr); pOperator->exprSupp.pExprInfo = pExprInfo; @@ -2512,7 +2521,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo return NULL; } - pOperator = createTagScanOperatorInfo(pHandle, pScanPhyNode, pTableListInfo, pTaskInfo); + pOperator = createTagScanOperatorInfo(pHandle, pScanPhyNode, pTaskInfo); } else if (QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN == type) { SBlockDistScanPhysiNode* pBlockNode = (SBlockDistScanPhysiNode*)pPhyNode; diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index 8fd37c3b14..bbf9bd2a27 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -314,7 +314,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) { } int32_t rowIndex = j - num; - doApplyFunctions(pTaskInfo, pCtx, NULL, rowIndex, num, pBlock->info.rows, pOperator->exprSupp.numOfExprs); + applyAggFunctionOnPartialTuples(pTaskInfo, pCtx, NULL, rowIndex, num, pBlock->info.rows, pOperator->exprSupp.numOfExprs); // assign the group keys or user input constant values if required doAssignGroupKeys(pCtx, pOperator->exprSupp.numOfExprs, pBlock->info.rows, rowIndex); @@ -331,7 +331,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) { } int32_t rowIndex = pBlock->info.rows - num; - doApplyFunctions(pTaskInfo, pCtx, NULL, rowIndex, num, pBlock->info.rows, pOperator->exprSupp.numOfExprs); + applyAggFunctionOnPartialTuples(pTaskInfo, pCtx, NULL, rowIndex, num, pBlock->info.rows, pOperator->exprSupp.numOfExprs); doAssignGroupKeys(pCtx, pOperator->exprSupp.numOfExprs, pBlock->info.rows, rowIndex); } } @@ -431,7 +431,7 @@ SOperatorInfo* createGroupOperatorInfo(SOperatorInfo* downstream, SAggPhysiNode* goto _error; } - SSDataBlock* pResBlock = createResDataBlock(pAggNode->node.pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pAggNode->node.pOutputDataBlockDesc); initBasicInfo(&pInfo->binfo, pResBlock); int32_t numOfScalarExpr = 0; @@ -823,7 +823,7 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition uint32_t defaultPgsz = 0; uint32_t defaultBufsz = 0; - pInfo->binfo.pRes = createResDataBlock(pPartNode->node.pOutputDataBlockDesc); + pInfo->binfo.pRes = createDataBlockFromDescNode(pPartNode->node.pOutputDataBlockDesc); getBufferPgSize(pInfo->binfo.pRes->info.rowSize, &defaultPgsz, &defaultBufsz); if (!osTempSpaceAvailable()) { @@ -1119,7 +1119,7 @@ SOperatorInfo* createStreamPartitionOperatorInfo(SOperatorInfo* downstream, SStr } pInfo->partitionSup.needCalc = true; - pInfo->binfo.pRes = createResDataBlock(pPartNode->part.node.pOutputDataBlockDesc); + pInfo->binfo.pRes = createDataBlockFromDescNode(pPartNode->part.node.pOutputDataBlockDesc); if (pInfo->binfo.pRes == NULL) { goto _error; } diff --git a/source/libs/executor/src/joinoperator.c b/source/libs/executor/src/joinoperator.c index a1b44307d4..3839af9913 100644 --- a/source/libs/executor/src/joinoperator.c +++ b/source/libs/executor/src/joinoperator.c @@ -87,7 +87,7 @@ SOperatorInfo* createMergeJoinOperatorInfo(SOperatorInfo** pDownstream, int32_t } int32_t numOfCols = 0; - SSDataBlock* pResBlock = createResDataBlock(pJoinNode->node.pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pJoinNode->node.pOutputDataBlockDesc); SExprInfo* pExprInfo = createExprInfo(pJoinNode->pTargets, NULL, &numOfCols); initResultSizeInfo(&pOperator->resultInfo, 4096); diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c index ada7964c67..819997c521 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -85,7 +85,7 @@ SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhys int32_t numOfCols = 0; SExprInfo* pExprInfo = createExprInfo(pProjPhyNode->pProjections, NULL, &numOfCols); - SSDataBlock* pResBlock = createResDataBlock(pProjPhyNode->node.pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pProjPhyNode->node.pOutputDataBlockDesc); initLimitInfo(pProjPhyNode->node.pLimit, pProjPhyNode->node.pSlimit, &pInfo->limitInfo); pInfo->binfo.pRes = pResBlock; @@ -385,7 +385,7 @@ SOperatorInfo* createIndefinitOutputOperatorInfo(SOperatorInfo* downstream, SPhy } } - SSDataBlock* pResBlock = createResDataBlock(pPhyNode->node.pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pPhyNode->node.pOutputDataBlockDesc); int32_t numOfRows = 4096; size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 7988c555e9..c0bea731bd 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -885,7 +885,7 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode, pInfo->base.dataBlockLoadFlag = pTableScanNode->dataRequired; initResultSizeInfo(&pOperator->resultInfo, 4096); - pInfo->pResBlock = createResDataBlock(pDescNode); + pInfo->pResBlock = createDataBlockFromDescNode(pDescNode); blockDataEnsureCapacity(pInfo->pResBlock, pOperator->resultInfo.capacity); code = filterInitFromNode((SNode*)pTableScanNode->scan.node.pConditions, &pOperator->exprSupp.pFilterInfo, 0); @@ -2352,7 +2352,7 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys goto _error; } - pInfo->pRes = createResDataBlock(pDescNode); + pInfo->pRes = createDataBlockFromDescNode(pDescNode); pInfo->pUpdateRes = createSpecialDataBlock(STREAM_CLEAR); pInfo->scanMode = STREAM_SCAN_FROM_READERHANDLE; pInfo->windowSup = (SWindowSupporter){.pStreamAggSup = NULL, .gap = -1, .parentType = QUERY_NODE_PHYSICAL_PLAN}; @@ -2476,8 +2476,7 @@ static void destroyTagScanOperatorInfo(void* param) { taosMemoryFreeClear(param); } -SOperatorInfo* createTagScanOperatorInfo(SReadHandle* pReadHandle, STagScanPhysiNode* pPhyNode, - STableListInfo* pTableListInfo, SExecTaskInfo* pTaskInfo) { +SOperatorInfo* createTagScanOperatorInfo(SReadHandle* pReadHandle, STagScanPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo) { STagScanInfo* pInfo = taosMemoryCalloc(1, sizeof(STagScanInfo)); SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); if (pInfo == NULL || pOperator == NULL) { @@ -2499,7 +2498,7 @@ SOperatorInfo* createTagScanOperatorInfo(SReadHandle* pReadHandle, STagScanPhysi goto _error; } - pInfo->pRes = createResDataBlock(pDescNode); + pInfo->pRes = createDataBlockFromDescNode(pDescNode); pInfo->readHandle = *pReadHandle; pInfo->curPos = 0; @@ -2613,7 +2612,7 @@ SArray* generateSortByTsInfo(SArray* colMatchInfo, int32_t order) { return pList; } -int32_t dumpSQueryTableCond(const SQueryTableDataCond* src, SQueryTableDataCond* dst) { +int32_t dumpQueryTableCond(const SQueryTableDataCond* src, SQueryTableDataCond* dst) { memcpy((void*)dst, (void*)src, sizeof(SQueryTableDataCond)); dst->colList = taosMemoryCalloc(src->numOfCols, sizeof(SColumnInfo)); for (int i = 0; i < src->numOfCols; i++) { @@ -2664,7 +2663,7 @@ int32_t startGroupTableMergeScan(SOperatorInfo* pOperator) { taosArrayPush(pInfo->sortSourceParams, ¶m); SQueryTableDataCond cond; - dumpSQueryTableCond(&pInfo->base.cond, &cond); + dumpQueryTableCond(&pInfo->base.cond, &cond); taosArrayPush(pInfo->queryConds, &cond); } @@ -2900,7 +2899,7 @@ SOperatorInfo* createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanN } initResultSizeInfo(&pOperator->resultInfo, 1024); - pInfo->pResBlock = createResDataBlock(pDescNode); + pInfo->pResBlock = createDataBlockFromDescNode(pDescNode); blockDataEnsureCapacity(pInfo->pResBlock, pOperator->resultInfo.capacity); pInfo->sortSourceParams = taosArrayInit(64, sizeof(STableMergeScanSortSourceParam)); diff --git a/source/libs/executor/src/sortoperator.c b/source/libs/executor/src/sortoperator.c index 02cd0fe696..f2c8dc5083 100644 --- a/source/libs/executor/src/sortoperator.c +++ b/source/libs/executor/src/sortoperator.c @@ -47,7 +47,7 @@ SOperatorInfo* createSortOperatorInfo(SOperatorInfo* downstream, SSortPhysiNode* SDataBlockDescNode* pDescNode = pSortNode->node.pOutputDataBlockDesc; int32_t numOfCols = 0; - SSDataBlock* pResBlock = createResDataBlock(pDescNode); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pDescNode); SExprInfo* pExprInfo = createExprInfo(pSortNode->pExprs, NULL, &numOfCols); int32_t numOfOutputCols = 0; @@ -509,7 +509,7 @@ SOperatorInfo* createGroupSortOperatorInfo(SOperatorInfo* downstream, SGroupSort initResultSizeInfo(&pOperator->resultInfo, 1024); pOperator->exprSupp.pCtx = createSqlFunctionCtx(pExprInfo, numOfCols, &pOperator->exprSupp.rowEntryInfoOffset); - pInfo->binfo.pRes = createResDataBlock(pDescNode); + pInfo->binfo.pRes = createDataBlockFromDescNode(pDescNode); blockDataEnsureCapacity(pInfo->binfo.pRes, pOperator->resultInfo.capacity); int32_t numOfOutputCols = 0; @@ -766,7 +766,7 @@ SOperatorInfo* createMultiwayMergeOperatorInfo(SOperatorInfo** downStreams, size } initLimitInfo(pMergePhyNode->node.pLimit, pMergePhyNode->node.pSlimit, &pInfo->limitInfo); - pInfo->binfo.pRes = createResDataBlock(pDescNode); + pInfo->binfo.pRes = createDataBlockFromDescNode(pDescNode); int32_t rowSize = pInfo->binfo.pRes->info.rowSize; ASSERT(rowSize < 100 * 1024 * 1024); @@ -779,7 +779,7 @@ SOperatorInfo* createMultiwayMergeOperatorInfo(SOperatorInfo** downStreams, size } SPhysiNode* pChildNode = (SPhysiNode*)nodesListGetNode(pPhyNode->pChildren, 0); - SSDataBlock* pInputBlock = createResDataBlock(pChildNode->pOutputDataBlockDesc); + SSDataBlock* pInputBlock = createDataBlockFromDescNode(pChildNode->pOutputDataBlockDesc); initResultSizeInfo(&pOperator->resultInfo, 4096); blockDataEnsureCapacity(pInfo->binfo.pRes, pOperator->resultInfo.capacity); diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index eea2549a42..7ef2668804 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -1411,7 +1411,7 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScan pInfo->pUser = taosMemoryStrDup((void*)pUser); pInfo->sysInfo = pScanPhyNode->sysInfo; pInfo->showRewrite = pScanPhyNode->showRewrite; - pInfo->pRes = createResDataBlock(pDescNode); + pInfo->pRes = createDataBlockFromDescNode(pDescNode); pInfo->pCondition = pScanNode->node.pConditions; code = filterInitFromNode(pScanNode->node.pConditions, &pOperator->exprSupp.pFilterInfo, 0); @@ -1928,7 +1928,7 @@ SOperatorInfo* createDataBlockInfoScanOperator(SReadHandle* readHandle, SBlockDi pInfo->readHandle = *readHandle; pInfo->uid = pBlockScanNode->suid; - pInfo->pResBlock = createResDataBlock(pBlockScanNode->node.pOutputDataBlockDesc); + pInfo->pResBlock = createDataBlockFromDescNode(pBlockScanNode->node.pOutputDataBlockDesc); blockDataEnsureCapacity(pInfo->pResBlock, 1); int32_t numOfCols = 0; diff --git a/source/libs/executor/src/tfill.c b/source/libs/executor/src/tfill.c index 7674b9e479..ba826a23d2 100644 --- a/source/libs/executor/src/tfill.c +++ b/source/libs/executor/src/tfill.c @@ -1651,9 +1651,9 @@ SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFi } initResultSizeInfo(&pOperator->resultInfo, 4096); - pInfo->pRes = createResDataBlock(pPhyFillNode->node.pOutputDataBlockDesc); - pInfo->pSrcBlock = createResDataBlock(pPhyFillNode->node.pOutputDataBlockDesc); - pInfo->pPrevSrcBlock = createResDataBlock(pPhyFillNode->node.pOutputDataBlockDesc); + pInfo->pRes = createDataBlockFromDescNode(pPhyFillNode->node.pOutputDataBlockDesc); + pInfo->pSrcBlock = createDataBlockFromDescNode(pPhyFillNode->node.pOutputDataBlockDesc); + pInfo->pPrevSrcBlock = createDataBlockFromDescNode(pPhyFillNode->node.pOutputDataBlockDesc); blockDataEnsureCapacity(pInfo->pRes, pOperator->resultInfo.capacity); blockDataEnsureCapacity(pInfo->pSrcBlock, pOperator->resultInfo.capacity); blockDataEnsureCapacity(pInfo->pPrevSrcBlock, pOperator->resultInfo.capacity); diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 013b8d39de..80c3c1c454 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -22,13 +22,37 @@ #include "tfill.h" #include "ttime.h" +#define IS_FINAL_OP(op) ((op)->isFinal) + +typedef struct SSessionAggOperatorInfo { + SOptrBasicInfo binfo; + SAggSupporter aggSup; + SGroupResInfo groupResInfo; + SWindowRowsSup winSup; + bool reptScan; // next round scan + int64_t gap; // session window gap + int32_t tsSlotId; // primary timestamp slot id + STimeWindowAggSupp twAggSup; +} SSessionAggOperatorInfo; + +typedef struct SStateWindowOperatorInfo { + SOptrBasicInfo binfo; + SAggSupporter aggSup; + SExprSupp scalarSup; + SGroupResInfo groupResInfo; + SWindowRowsSup winSup; + SColumn stateCol; // start row index + bool hasKey; + SStateKeys stateKey; + int32_t tsSlotId; // primary timestamp column slot id + STimeWindowAggSupp twAggSup; +} SStateWindowOperatorInfo; + typedef enum SResultTsInterpType { RESULT_ROW_START_INTERP = 1, RESULT_ROW_END_INTERP = 2, } SResultTsInterpType; -#define IS_FINAL_OP(op) ((op)->isFinal) - typedef struct SPullWindowInfo { STimeWindow window; uint64_t groupId; @@ -640,7 +664,7 @@ static void doInterpUnclosedTimeWindow(SOperatorInfo* pOperatorInfo, int32_t num setNotInterpoWindowKey(pSup->pCtx, numOfExprs, RESULT_ROW_START_INTERP); updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &w, true); - doApplyFunctions(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, startPos, 0, pBlock->info.rows, + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, startPos, 0, pBlock->info.rows, numOfExprs); if (isResultRowInterpolated(pResult, RESULT_ROW_END_INTERP)) { @@ -937,7 +961,7 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul } updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &win, true); - doApplyFunctions(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, startPos, forwardRows, pBlock->info.rows, + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, startPos, forwardRows, pBlock->info.rows, numOfOutput); doCloseWindow(pResultRowInfo, pInfo, pResult); @@ -972,7 +996,7 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul } #endif updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &nextWin, true); - doApplyFunctions(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, startPos, forwardRows, pBlock->info.rows, + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, startPos, forwardRows, pBlock->info.rows, numOfOutput); doCloseWindow(pResultRowInfo, pInfo, pResult); } @@ -1140,7 +1164,7 @@ static void doStateWindowAggImpl(SOperatorInfo* pOperator, SStateWindowOperatorI } updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &window, false); - doApplyFunctions(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, pRowSup->numOfRows, pBlock->info.rows, numOfOutput); // here we start a new session window @@ -1165,7 +1189,7 @@ static void doStateWindowAggImpl(SOperatorInfo* pOperator, SStateWindowOperatorI } updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pRowSup->win, false); - doApplyFunctions(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, pRowSup->numOfRows, + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, pRowSup->numOfRows, pBlock->info.rows, numOfOutput); } @@ -1706,7 +1730,7 @@ SOperatorInfo* createIntervalOperatorInfo(SOperatorInfo* downstream, SIntervalPh goto _error; } - SSDataBlock* pResBlock = createResDataBlock(pPhyNode->window.node.pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pPhyNode->window.node.pOutputDataBlockDesc); initBasicInfo(&pInfo->binfo, pResBlock); SExprSupp* pSup = &pOperator->exprSupp; @@ -1845,7 +1869,7 @@ static void doSessionWindowAggImpl(SOperatorInfo* pOperator, SSessionAggOperator // pInfo->numOfRows data belong to the current session window updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &window, false); - doApplyFunctions(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, pRowSup->numOfRows, pBlock->info.rows, numOfOutput); // here we start a new session window @@ -1863,7 +1887,7 @@ static void doSessionWindowAggImpl(SOperatorInfo* pOperator, SSessionAggOperator } updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pRowSup->win, false); - doApplyFunctions(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, pRowSup->numOfRows, + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, pRowSup->numOfRows, pBlock->info.rows, numOfOutput); } @@ -1938,552 +1962,6 @@ static SSDataBlock* doSessionWindowAgg(SOperatorInfo* pOperator) { return (pBInfo->pRes->info.rows == 0) ? NULL : pBInfo->pRes; } -static void doKeepPrevRows(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlock* pBlock, int32_t rowIndex) { - int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); - for (int32_t i = 0; i < numOfCols; ++i) { - SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); - - SGroupKeys* pkey = taosArrayGet(pSliceInfo->pPrevRow, i); - if (!colDataIsNull_s(pColInfoData, rowIndex)) { - pkey->isNull = false; - char* val = colDataGetData(pColInfoData, rowIndex); - if (!IS_VAR_DATA_TYPE(pkey->type)) { - memcpy(pkey->pData, val, pkey->bytes); - } else { - memcpy(pkey->pData, val, varDataLen(val)); - } - } else { - pkey->isNull = true; - } - } - - pSliceInfo->isPrevRowSet = true; -} - -static void doKeepNextRows(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlock* pBlock, int32_t rowIndex) { - int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); - for (int32_t i = 0; i < numOfCols; ++i) { - SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); - - SGroupKeys* pkey = taosArrayGet(pSliceInfo->pNextRow, i); - if (!colDataIsNull_s(pColInfoData, rowIndex)) { - pkey->isNull = false; - char* val = colDataGetData(pColInfoData, rowIndex); - if (!IS_VAR_DATA_TYPE(pkey->type)) { - memcpy(pkey->pData, val, pkey->bytes); - } else { - memcpy(pkey->pData, val, varDataLen(val)); - } - } else { - pkey->isNull = true; - } - } - - pSliceInfo->isNextRowSet = true; -} - -static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlock* pBlock, int32_t rowIndex) { - int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); - for (int32_t i = 0; i < numOfCols; ++i) { - SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); - SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, pSliceInfo->tsCol.slotId); - SFillLinearInfo* pLinearInfo = taosArrayGet(pSliceInfo->pLinearInfo, i); - - // null value is represented by using key = INT64_MIN for now. - // TODO: optimize to ignore null values for linear interpolation. - if (!pLinearInfo->isStartSet) { - if (!colDataIsNull_s(pColInfoData, rowIndex)) { - pLinearInfo->start.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); - memcpy(pLinearInfo->start.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); - } - pLinearInfo->isStartSet = true; - } else if (!pLinearInfo->isEndSet) { - if (!colDataIsNull_s(pColInfoData, rowIndex)) { - pLinearInfo->end.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); - memcpy(pLinearInfo->end.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); - } - pLinearInfo->isEndSet = true; - } else { - pLinearInfo->start.key = pLinearInfo->end.key; - memcpy(pLinearInfo->start.val, pLinearInfo->end.val, pLinearInfo->bytes); - - if (!colDataIsNull_s(pColInfoData, rowIndex)) { - pLinearInfo->end.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); - memcpy(pLinearInfo->end.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); - } else { - pLinearInfo->end.key = INT64_MIN; - } - } - } - -} - -static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp* pExprSup, SSDataBlock* pResBlock, bool beforeTs) { - int32_t rows = pResBlock->info.rows; - blockDataEnsureCapacity(pResBlock, rows + 1); - // todo set the correct primary timestamp column - - // output the result - bool hasInterp = true; - for (int32_t j = 0; j < pExprSup->numOfExprs; ++j) { - SExprInfo* pExprInfo = &pExprSup->pExprInfo[j]; - - int32_t dstSlot = pExprInfo->base.resSchema.slotId; - SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot); - - if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) { - colDataAppend(pDst, rows, (char*)&pSliceInfo->current, false); - continue; - } - - int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; - switch (pSliceInfo->fillType) { - case TSDB_FILL_NULL: { - colDataAppendNULL(pDst, rows); - break; - } - - case TSDB_FILL_SET_VALUE: { - SVariant* pVar = &pSliceInfo->pFillColInfo[j].fillVal; - - if (pDst->info.type == TSDB_DATA_TYPE_FLOAT) { - float v = 0; - GET_TYPED_DATA(v, float, pVar->nType, &pVar->i); - colDataAppend(pDst, rows, (char*)&v, false); - } else if (pDst->info.type == TSDB_DATA_TYPE_DOUBLE) { - double v = 0; - GET_TYPED_DATA(v, double, pVar->nType, &pVar->i); - colDataAppend(pDst, rows, (char*)&v, false); - } else if (IS_SIGNED_NUMERIC_TYPE(pDst->info.type)) { - int64_t v = 0; - GET_TYPED_DATA(v, int64_t, pVar->nType, &pVar->i); - colDataAppend(pDst, rows, (char*)&v, false); - } - break; - } - - case TSDB_FILL_LINEAR: { - SFillLinearInfo* pLinearInfo = taosArrayGet(pSliceInfo->pLinearInfo, srcSlot); - - SPoint start = pLinearInfo->start; - SPoint end = pLinearInfo->end; - SPoint current = {.key = pSliceInfo->current}; - - // do not interpolate before ts range, only increate pSliceInfo->current - if (beforeTs && !pLinearInfo->isEndSet) { - return true; - } - - if (!pLinearInfo->isStartSet || !pLinearInfo->isEndSet) { - hasInterp = false; - break; - } - - if (start.key == INT64_MIN || end.key == INT64_MIN) { - colDataAppendNULL(pDst, rows); - break; - } - - current.val = taosMemoryCalloc(pLinearInfo->bytes, 1); - taosGetLinearInterpolationVal(¤t, pLinearInfo->type, &start, &end, pLinearInfo->type); - colDataAppend(pDst, rows, (char*)current.val, false); - - taosMemoryFree(current.val); - break; - } - case TSDB_FILL_PREV: { - if (!pSliceInfo->isPrevRowSet) { - hasInterp = false; - break; - } - - SGroupKeys* pkey = taosArrayGet(pSliceInfo->pPrevRow, srcSlot); - if (pkey->isNull == false) { - colDataAppend(pDst, rows, pkey->pData, false); - } else { - colDataAppendNULL(pDst, rows); - } - break; - } - - case TSDB_FILL_NEXT: { - if (!pSliceInfo->isNextRowSet) { - hasInterp = false; - break; - } - - SGroupKeys* pkey = taosArrayGet(pSliceInfo->pNextRow, srcSlot); - if (pkey->isNull == false) { - colDataAppend(pDst, rows, pkey->pData, false); - } else { - colDataAppendNULL(pDst, rows); - } - break; - } - - case TSDB_FILL_NONE: - default: - break; - } - } - - if (hasInterp) { - pResBlock->info.rows += 1; - } - - return hasInterp; -} - -static void addCurrentRowToResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp* pExprSup, SSDataBlock* pResBlock, - SSDataBlock* pSrcBlock, int32_t index) { - blockDataEnsureCapacity(pResBlock, pResBlock->info.rows + 1); - for (int32_t j = 0; j < pExprSup->numOfExprs; ++j) { - SExprInfo* pExprInfo = &pExprSup->pExprInfo[j]; - - int32_t dstSlot = pExprInfo->base.resSchema.slotId; - SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot); - - if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) { - colDataAppend(pDst, pResBlock->info.rows, (char*)&pSliceInfo->current, false); - } else { - int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; - SColumnInfoData* pSrc = taosArrayGet(pSrcBlock->pDataBlock, srcSlot); - - if (colDataIsNull_s(pSrc, index)) { - colDataAppendNULL(pDst, pResBlock->info.rows); - continue; - } - - char* v = colDataGetData(pSrc, index); - colDataAppend(pDst, pResBlock->info.rows, v, false); - } - } - - pResBlock->info.rows += 1; - return; -} - - -static int32_t initPrevRowsKeeper(STimeSliceOperatorInfo* pInfo, SSDataBlock* pBlock) { - if (pInfo->pPrevRow != NULL) { - return TSDB_CODE_SUCCESS; - } - - pInfo->pPrevRow = taosArrayInit(4, sizeof(SGroupKeys)); - if (pInfo->pPrevRow == NULL) { - return TSDB_CODE_OUT_OF_MEMORY; - } - - int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); - for (int32_t i = 0; i < numOfCols; ++i) { - SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, i); - - SGroupKeys key = {0}; - key.bytes = pColInfo->info.bytes; - key.type = pColInfo->info.type; - key.isNull = false; - key.pData = taosMemoryCalloc(1, pColInfo->info.bytes); - taosArrayPush(pInfo->pPrevRow, &key); - } - - pInfo->isPrevRowSet = false; - - return TSDB_CODE_SUCCESS; -} - -static int32_t initNextRowsKeeper(STimeSliceOperatorInfo* pInfo, SSDataBlock* pBlock) { - if (pInfo->pNextRow != NULL) { - return TSDB_CODE_SUCCESS; - } - - pInfo->pNextRow = taosArrayInit(4, sizeof(SGroupKeys)); - if (pInfo->pNextRow == NULL) { - return TSDB_CODE_OUT_OF_MEMORY; - } - - int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); - for (int32_t i = 0; i < numOfCols; ++i) { - SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, i); - - SGroupKeys key = {0}; - key.bytes = pColInfo->info.bytes; - key.type = pColInfo->info.type; - key.isNull = false; - key.pData = taosMemoryCalloc(1, pColInfo->info.bytes); - taosArrayPush(pInfo->pNextRow, &key); - } - - pInfo->isNextRowSet = false; - - return TSDB_CODE_SUCCESS; -} - -static int32_t initFillLinearInfo(STimeSliceOperatorInfo* pInfo, SSDataBlock* pBlock) { - if (pInfo->pLinearInfo != NULL) { - return TSDB_CODE_SUCCESS; - } - - pInfo->pLinearInfo = taosArrayInit(4, sizeof(SFillLinearInfo)); - if (pInfo->pLinearInfo == NULL) { - return TSDB_CODE_OUT_OF_MEMORY; - } - - int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); - for (int32_t i = 0; i < numOfCols; ++i) { - SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, i); - - SFillLinearInfo linearInfo = {0}; - linearInfo.start.key = INT64_MIN; - linearInfo.end.key = INT64_MIN; - linearInfo.start.val = taosMemoryCalloc(1, pColInfo->info.bytes); - linearInfo.end.val = taosMemoryCalloc(1, pColInfo->info.bytes); - linearInfo.isStartSet = false; - linearInfo.isEndSet = false; - linearInfo.type = pColInfo->info.type; - linearInfo.bytes = pColInfo->info.bytes; - taosArrayPush(pInfo->pLinearInfo, &linearInfo); - } - - return TSDB_CODE_SUCCESS; -} - -static int32_t initKeeperInfo(STimeSliceOperatorInfo* pInfo, SSDataBlock* pBlock) { - int32_t code; - code = initPrevRowsKeeper(pInfo, pBlock); - if (code != TSDB_CODE_SUCCESS) { - return TSDB_CODE_FAILED; - } - - code = initNextRowsKeeper(pInfo, pBlock); - if (code != TSDB_CODE_SUCCESS) { - return TSDB_CODE_FAILED; - } - - code = initFillLinearInfo(pInfo, pBlock); - if (code != TSDB_CODE_SUCCESS) { - return TSDB_CODE_FAILED; - } - - return TSDB_CODE_SUCCESS; -} - -static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) { - if (pOperator->status == OP_EXEC_DONE) { - return NULL; - } - - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - - STimeSliceOperatorInfo* pSliceInfo = pOperator->info; - SSDataBlock* pResBlock = pSliceInfo->pRes; - SExprSupp* pSup = &pOperator->exprSupp; - - int32_t order = TSDB_ORDER_ASC; - SInterval* pInterval = &pSliceInfo->interval; - SOperatorInfo* downstream = pOperator->pDownstream[0]; - - blockDataCleanup(pResBlock); - - while (1) { - SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream); - if (pBlock == NULL) { - break; - } - - int32_t code = initKeeperInfo(pSliceInfo, pBlock); - if (code != TSDB_CODE_SUCCESS) { - T_LONG_JMP(pTaskInfo->env, code); - } - - // the pDataBlock are always the same one, no need to call this again - setInputDataBlock(pSup, pBlock, order, MAIN_SCAN, true); - - SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, pSliceInfo->tsCol.slotId); - for (int32_t i = 0; i < pBlock->info.rows; ++i) { - int64_t ts = *(int64_t*)colDataGetData(pTsCol, i); - - if (pSliceInfo->current > pSliceInfo->win.ekey) { - setOperatorCompleted(pOperator); - break; - } - - if (ts == pSliceInfo->current) { - addCurrentRowToResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i); - - doKeepPrevRows(pSliceInfo, pBlock, i); - doKeepLinearInfo(pSliceInfo, pBlock, i); - - pSliceInfo->current = - taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); - if (pSliceInfo->current > pSliceInfo->win.ekey) { - setOperatorCompleted(pOperator); - break; - } - } else if (ts < pSliceInfo->current) { - // in case of interpolation window starts and ends between two datapoints, fill(prev) need to interpolate - doKeepPrevRows(pSliceInfo, pBlock, i); - doKeepLinearInfo(pSliceInfo, pBlock, i); - - if (i < pBlock->info.rows - 1) { - // in case of interpolation window starts and ends between two datapoints, fill(next) need to interpolate - doKeepNextRows(pSliceInfo, pBlock, i + 1); - int64_t nextTs = *(int64_t*)colDataGetData(pTsCol, i + 1); - if (nextTs > pSliceInfo->current) { - while (pSliceInfo->current < nextTs && pSliceInfo->current <= pSliceInfo->win.ekey) { - if (!genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, false) && pSliceInfo->fillType == TSDB_FILL_LINEAR) { - break; - } else { - pSliceInfo->current = - taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); - } - } - - if (pSliceInfo->current > pSliceInfo->win.ekey) { - setOperatorCompleted(pOperator); - break; - } - } else { - // ignore current row, and do nothing - } - } else { // it is the last row of current block - doKeepPrevRows(pSliceInfo, pBlock, i); - } - } else { // ts > pSliceInfo->current - // in case of interpolation window starts and ends between two datapoints, fill(next) need to interpolate - doKeepNextRows(pSliceInfo, pBlock, i); - doKeepLinearInfo(pSliceInfo, pBlock, i); - - while (pSliceInfo->current < ts && pSliceInfo->current <= pSliceInfo->win.ekey) { - if (!genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, true) && pSliceInfo->fillType == TSDB_FILL_LINEAR) { - break; - } else { - pSliceInfo->current = - taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); - } - } - - // add current row if timestamp match - if (ts == pSliceInfo->current && pSliceInfo->current <= pSliceInfo->win.ekey) { - addCurrentRowToResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i); - doKeepPrevRows(pSliceInfo, pBlock, i); - - pSliceInfo->current = - taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); - } - - if (pSliceInfo->current > pSliceInfo->win.ekey) { - setOperatorCompleted(pOperator); - break; - } - } - } - } - - // check if need to interpolate after last datablock - // except for fill(next), fill(linear) - while (pSliceInfo->current <= pSliceInfo->win.ekey && pSliceInfo->fillType != TSDB_FILL_NEXT && - pSliceInfo->fillType != TSDB_FILL_LINEAR) { - genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, false); - pSliceInfo->current = - taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); - } - - // restore the value - setTaskStatus(pOperator->pTaskInfo, TASK_COMPLETED); - if (pResBlock->info.rows == 0) { - pOperator->status = OP_EXEC_DONE; - } - - return pResBlock->info.rows == 0 ? NULL : pResBlock; -} - -void destroyTimeSliceOperatorInfo(void* param) { - STimeSliceOperatorInfo* pInfo = (STimeSliceOperatorInfo*)param; - - pInfo->pRes = blockDataDestroy(pInfo->pRes); - - for (int32_t i = 0; i < taosArrayGetSize(pInfo->pPrevRow); ++i) { - SGroupKeys* pKey = taosArrayGet(pInfo->pPrevRow, i); - taosMemoryFree(pKey->pData); - } - taosArrayDestroy(pInfo->pPrevRow); - - for (int32_t i = 0; i < taosArrayGetSize(pInfo->pNextRow); ++i) { - SGroupKeys* pKey = taosArrayGet(pInfo->pNextRow, i); - taosMemoryFree(pKey->pData); - } - taosArrayDestroy(pInfo->pNextRow); - - for (int32_t i = 0; i < taosArrayGetSize(pInfo->pLinearInfo); ++i) { - SFillLinearInfo* pKey = taosArrayGet(pInfo->pLinearInfo, i); - taosMemoryFree(pKey->start.val); - taosMemoryFree(pKey->end.val); - } - taosArrayDestroy(pInfo->pLinearInfo); - - taosMemoryFree(pInfo->pFillColInfo); - taosMemoryFreeClear(param); -} - -SOperatorInfo* createTimeSliceOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo) { - STimeSliceOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(STimeSliceOperatorInfo)); - SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); - if (pOperator == NULL || pInfo == NULL) { - goto _error; - } - - SInterpFuncPhysiNode* pInterpPhyNode = (SInterpFuncPhysiNode*)pPhyNode; - SExprSupp* pSup = &pOperator->exprSupp; - - int32_t numOfExprs = 0; - SExprInfo* pExprInfo = createExprInfo(pInterpPhyNode->pFuncs, NULL, &numOfExprs); - int32_t code = initExprSupp(pSup, pExprInfo, numOfExprs); - if (code != TSDB_CODE_SUCCESS) { - goto _error; - } - - if (pInterpPhyNode->pExprs != NULL) { - int32_t num = 0; - SExprInfo* pScalarExprInfo = createExprInfo(pInterpPhyNode->pExprs, NULL, &num); - code = initExprSupp(&pInfo->scalarSup, pScalarExprInfo, num); - if (code != TSDB_CODE_SUCCESS) { - goto _error; - } - } - - pInfo->tsCol = extractColumnFromColumnNode((SColumnNode*)pInterpPhyNode->pTimeSeries); - pInfo->fillType = convertFillType(pInterpPhyNode->fillMode); - initResultSizeInfo(&pOperator->resultInfo, 4096); - - pInfo->pFillColInfo = createFillColInfo(pExprInfo, numOfExprs, NULL, 0, (SNodeListNode*)pInterpPhyNode->pFillValues); - pInfo->pLinearInfo = NULL; - pInfo->pRes = createResDataBlock(pPhyNode->pOutputDataBlockDesc); - pInfo->win = pInterpPhyNode->timeRange; - pInfo->interval.interval = pInterpPhyNode->interval; - pInfo->current = pInfo->win.skey; - - 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; - } - - setOperatorInfo(pOperator, "TimeSliceOperator", QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC, false, OP_NOT_OPENED, pInfo, - pTaskInfo); - pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, doTimeslice, NULL, destroyTimeSliceOperatorInfo, NULL); - - blockDataEnsureCapacity(pInfo->pRes, pOperator->resultInfo.capacity); - - code = appendDownstream(pOperator, &downstream, 1); - return pOperator; - -_error: - taosMemoryFree(pInfo); - taosMemoryFree(pOperator); - pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY; - return NULL; -} - SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SStateWinodwPhysiNode* pStateNode, SExecTaskInfo* pTaskInfo) { SStateWindowOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SStateWindowOperatorInfo)); @@ -2528,7 +2006,7 @@ SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SStateWi goto _error; } - SSDataBlock* pResBlock = createResDataBlock(pStateNode->window.node.pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pStateNode->window.node.pOutputDataBlockDesc); initBasicInfo(&pInfo->binfo, pResBlock); initResultRowInfo(&pInfo->binfo.resultRowInfo); @@ -2588,7 +2066,7 @@ SOperatorInfo* createSessionAggOperatorInfo(SOperatorInfo* downstream, SSessionW int32_t numOfCols = 0; SExprInfo* pExprInfo = createExprInfo(pSessionNode->window.pFuncs, NULL, &numOfCols); - SSDataBlock* pResBlock = createResDataBlock(pSessionNode->window.node.pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pSessionNode->window.node.pOutputDataBlockDesc); initBasicInfo(&pInfo->binfo, pResBlock); int32_t code = initAggInfo(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); @@ -2975,7 +2453,7 @@ static void doStreamIntervalAggImpl(SOperatorInfo* pOperatorInfo, SSDataBlock* p tSimpleHashPut(pInfo->aggSup.pResultRowHashTable, &key, sizeof(SWinKey), NULL, 0); } updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &nextWin, true); - doApplyFunctions(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, startPos, forwardRows, + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, startPos, forwardRows, pSDataBlock->info.rows, numOfOutput); SWinKey key = { .ts = nextWin.skey, @@ -3226,7 +2704,7 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, int32_t numOfCols = 0; SExprInfo* pExprInfo = createExprInfo(pIntervalPhyNode->window.pFuncs, NULL, &numOfCols); - SSDataBlock* pResBlock = createResDataBlock(pPhyNode->pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pPhyNode->pOutputDataBlockDesc); initBasicInfo(&pInfo->binfo, pResBlock); int32_t code = initAggInfo(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); @@ -3551,7 +3029,7 @@ static int32_t doOneWindowAggImpl(SColumnInfoData* pTimeWindowData, SResultWindo return TSDB_CODE_QRY_OUT_OF_MEMORY; } updateTimeWindowInfo(pTimeWindowData, &pCurWin->sessionWin.win, false); - doApplyFunctions(pTaskInfo, pSup->pCtx, pTimeWindowData, startIndex, winRows, rows, numOutput); + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, pTimeWindowData, startIndex, winRows, rows, numOutput); return TSDB_CODE_SUCCESS; } @@ -4066,7 +3544,7 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh SExprSupp* pSup = &pOperator->exprSupp; SExprInfo* pExprInfo = createExprInfo(pSessionNode->window.pFuncs, NULL, &numOfCols); - SSDataBlock* pResBlock = createResDataBlock(pPhyNode->pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pPhyNode->pOutputDataBlockDesc); code = initBasicInfoEx(&pInfo->binfo, pSup, pExprInfo, numOfCols, pResBlock); if (code != TSDB_CODE_SUCCESS) { goto _error; @@ -4586,7 +4064,7 @@ SOperatorInfo* createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhys SExprSupp* pSup = &pOperator->exprSupp; int32_t numOfCols = 0; SExprInfo* pExprInfo = createExprInfo(pStateNode->window.pFuncs, NULL, &numOfCols); - SSDataBlock* pResBlock = createResDataBlock(pPhyNode->pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pPhyNode->pOutputDataBlockDesc); code = initBasicInfoEx(&pInfo->binfo, pSup, pExprInfo, numOfCols, pResBlock); if (code != TSDB_CODE_SUCCESS) { goto _error; @@ -4695,7 +4173,7 @@ static void doMergeAlignedIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultR } updateTimeWindowInfo(&iaInfo->twAggSup.timeWindowData, &currWin, true); - doApplyFunctions(pTaskInfo, pSup->pCtx, &iaInfo->twAggSup.timeWindowData, startPos, currPos - startPos, + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &iaInfo->twAggSup.timeWindowData, startPos, currPos - startPos, pBlock->info.rows, pSup->numOfExprs); finalizeResultRows(iaInfo->aggSup.pResultBuf, &pResultRowInfo->cur, pSup, pResultBlock, pTaskInfo); @@ -4715,7 +4193,7 @@ static void doMergeAlignedIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultR } updateTimeWindowInfo(&iaInfo->twAggSup.timeWindowData, &currWin, true); - doApplyFunctions(pTaskInfo, pSup->pCtx, &iaInfo->twAggSup.timeWindowData, startPos, currPos - startPos, + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &iaInfo->twAggSup.timeWindowData, startPos, currPos - startPos, pBlock->info.rows, pSup->numOfExprs); } @@ -4873,7 +4351,7 @@ SOperatorInfo* createMergeAlignedIntervalOperatorInfo(SOperatorInfo* downstream, goto _error; } - SSDataBlock* pResBlock = createResDataBlock(pNode->window.node.pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pNode->window.node.pOutputDataBlockDesc); initBasicInfo(&iaInfo->binfo, pResBlock); initExecTimeWindowInfo(&iaInfo->twAggSup.timeWindowData, &iaInfo->win); @@ -5022,7 +4500,7 @@ static void doMergeIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultRowInfo* } updateTimeWindowInfo(&iaInfo->twAggSup.timeWindowData, &win, true); - doApplyFunctions(pTaskInfo, pExprSup->pCtx, &iaInfo->twAggSup.timeWindowData, startPos, forwardRows, + applyAggFunctionOnPartialTuples(pTaskInfo, pExprSup->pCtx, &iaInfo->twAggSup.timeWindowData, startPos, forwardRows, pBlock->info.rows, numOfOutput); doCloseWindow(pResultRowInfo, iaInfo, pResult); @@ -5054,7 +4532,7 @@ static void doMergeIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultRowInfo* doWindowBorderInterpolation(iaInfo, pBlock, pResult, &nextWin, startPos, forwardRows, pExprSup); updateTimeWindowInfo(&iaInfo->twAggSup.timeWindowData, &nextWin, true); - doApplyFunctions(pTaskInfo, pExprSup->pCtx, &iaInfo->twAggSup.timeWindowData, startPos, forwardRows, + applyAggFunctionOnPartialTuples(pTaskInfo, pExprSup->pCtx, &iaInfo->twAggSup.timeWindowData, startPos, forwardRows, pBlock->info.rows, numOfOutput); doCloseWindow(pResultRowInfo, iaInfo, pResult); @@ -5178,7 +4656,7 @@ SOperatorInfo* createMergeIntervalOperatorInfo(SOperatorInfo* downstream, SMerge goto _error; } - SSDataBlock* pResBlock = createResDataBlock(pIntervalPhyNode->window.node.pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pIntervalPhyNode->window.node.pOutputDataBlockDesc); initBasicInfo(&pIntervalInfo->binfo, pResBlock); initExecTimeWindowInfo(&pIntervalInfo->twAggSup.timeWindowData, &pIntervalInfo->win); @@ -5334,7 +4812,7 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys SExprInfo* pExprInfo = createExprInfo(pIntervalPhyNode->window.pFuncs, NULL, &numOfCols); ASSERT(numOfCols > 0); - SSDataBlock* pResBlock = createResDataBlock(pPhyNode->pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pPhyNode->pOutputDataBlockDesc); SInterval interval = { .interval = pIntervalPhyNode->interval, .sliding = pIntervalPhyNode->sliding, diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 640baf4f94..e572ce7a40 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -729,375 +729,6 @@ bool getSumFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { return true; } -//int32_t getAvgInfoSize() { return (int32_t)sizeof(SAvgRes); } -// -//bool getAvgFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { -// pEnv->calcMemSize = sizeof(SAvgRes); -// return true; -//} -// -//bool avgFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { -// if (!functionSetup(pCtx, pResultInfo)) { -// return false; -// } -// -// SAvgRes* pRes = GET_ROWCELL_INTERBUF(pResultInfo); -// memset(pRes, 0, sizeof(SAvgRes)); -// return true; -//} - -//int32_t avgFunction(SqlFunctionCtx* pCtx) { -// int32_t numOfElem = 0; -// -// SInputColumnInfoData* pInput = &pCtx->input; -// SColumnDataAgg* pAgg = pInput->pColumnDataAgg[0]; -// int32_t type = pInput->pData[0]->info.type; -// -// SAvgRes* pAvgRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); -// pAvgRes->type = type; -// -// // computing based on the true data block -// SColumnInfoData* pCol = pInput->pData[0]; -// -// int32_t start = pInput->startRowIndex; -// int32_t numOfRows = pInput->numOfRows; -// -// if (IS_NULL_TYPE(type)) { -// numOfElem = 0; -// goto _avg_over; -// } -// -// if (pInput->colDataSMAIsSet) { -// numOfElem = numOfRows - pAgg->numOfNull; -// ASSERT(numOfElem >= 0); -// -// pAvgRes->count += numOfElem; -// if (IS_SIGNED_NUMERIC_TYPE(type)) { -// pAvgRes->sum.isum += pAgg->sum; -// } else if (IS_UNSIGNED_NUMERIC_TYPE(type)) { -// pAvgRes->sum.usum += pAgg->sum; -// } else if (IS_FLOAT_TYPE(type)) { -// pAvgRes->sum.dsum += GET_DOUBLE_VAL((const char*)&(pAgg->sum)); -// } -// } else { // computing based on the true data block -// switch (type) { -// case TSDB_DATA_TYPE_TINYINT: { -// int8_t* plist = (int8_t*)pCol->pData; -// for (int32_t i = start; i < numOfRows + pInput->startRowIndex; ++i) { -// if (pCol->hasNull && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// numOfElem += 1; -// pAvgRes->count += 1; -// pAvgRes->sum.isum += plist[i]; -// } -// -// break; -// } -// -// case TSDB_DATA_TYPE_SMALLINT: { -// int16_t* plist = (int16_t*)pCol->pData; -// for (int32_t i = start; i < numOfRows + pInput->startRowIndex; ++i) { -// if (pCol->hasNull && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// numOfElem += 1; -// pAvgRes->count += 1; -// pAvgRes->sum.isum += plist[i]; -// } -// break; -// } -// -// case TSDB_DATA_TYPE_INT: { -// int32_t* plist = (int32_t*)pCol->pData; -// for (int32_t i = start; i < numOfRows + pInput->startRowIndex; ++i) { -// if (pCol->hasNull && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// numOfElem += 1; -// pAvgRes->count += 1; -// pAvgRes->sum.isum += plist[i]; -// } -// -// break; -// } -// -// case TSDB_DATA_TYPE_BIGINT: { -// int64_t* plist = (int64_t*)pCol->pData; -// for (int32_t i = start; i < numOfRows + pInput->startRowIndex; ++i) { -// if (pCol->hasNull && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// numOfElem += 1; -// pAvgRes->count += 1; -// pAvgRes->sum.isum += plist[i]; -// } -// break; -// } -// -// case TSDB_DATA_TYPE_UTINYINT: { -// uint8_t* plist = (uint8_t*)pCol->pData; -// for (int32_t i = start; i < numOfRows + pInput->startRowIndex; ++i) { -// if (pCol->hasNull && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// numOfElem += 1; -// pAvgRes->count += 1; -// pAvgRes->sum.usum += plist[i]; -// } -// -// break; -// } -// -// case TSDB_DATA_TYPE_USMALLINT: { -// uint16_t* plist = (uint16_t*)pCol->pData; -// for (int32_t i = start; i < numOfRows + pInput->startRowIndex; ++i) { -// if (pCol->hasNull && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// numOfElem += 1; -// pAvgRes->count += 1; -// pAvgRes->sum.usum += plist[i]; -// } -// break; -// } -// -// case TSDB_DATA_TYPE_UINT: { -// uint32_t* plist = (uint32_t*)pCol->pData; -// for (int32_t i = start; i < numOfRows + pInput->startRowIndex; ++i) { -// if (pCol->hasNull && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// numOfElem += 1; -// pAvgRes->count += 1; -// pAvgRes->sum.usum += plist[i]; -// } -// -// break; -// } -// -// case TSDB_DATA_TYPE_UBIGINT: { -// uint64_t* plist = (uint64_t*)pCol->pData; -// for (int32_t i = start; i < numOfRows + pInput->startRowIndex; ++i) { -// if (pCol->hasNull && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// numOfElem += 1; -// pAvgRes->count += 1; -// pAvgRes->sum.usum += plist[i]; -// } -// break; -// } -// -// case TSDB_DATA_TYPE_FLOAT: { -// float* plist = (float*)pCol->pData; -//// float val = 0; -// for (int32_t i = start; i < numOfRows + pInput->startRowIndex; ++i) { -// if (pCol->hasNull && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// numOfElem += 1; -// pAvgRes->count += 1; -// pAvgRes->sum.dsum += plist[i]; -// } -//// pAvgRes->sum.dsum = val; -// break; -// } -// -// case TSDB_DATA_TYPE_DOUBLE: { -// double* plist = (double*)pCol->pData; -// for (int32_t i = start; i < numOfRows + pInput->startRowIndex; ++i) { -// if (pCol->hasNull && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// numOfElem += 1; -// pAvgRes->count += 1; -// pAvgRes->sum.dsum += plist[i]; -// } -// break; -// } -// -// default: -// break; -// } -// } -// -//_avg_over: -// // data in the check operation are all null, not output -// SET_VAL(GET_RES_INFO(pCtx), numOfElem, 1); -// return TSDB_CODE_SUCCESS; -//} - -//static void avgTransferInfo(SAvgRes* pInput, SAvgRes* pOutput) { -// pOutput->type = pInput->type; -// if (IS_SIGNED_NUMERIC_TYPE(pOutput->type)) { -// pOutput->sum.isum += pInput->sum.isum; -// } else if (IS_UNSIGNED_NUMERIC_TYPE(pOutput->type)) { -// pOutput->sum.usum += pInput->sum.usum; -// } else { -// pOutput->sum.dsum += pInput->sum.dsum; -// } -// -// pOutput->count += pInput->count; -// -// return; -//} -// -//int32_t avgFunctionMerge(SqlFunctionCtx* pCtx) { -// SInputColumnInfoData* pInput = &pCtx->input; -// SColumnInfoData* pCol = pInput->pData[0]; -// ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY); -// -// SAvgRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); -// -// int32_t start = pInput->startRowIndex; -// -// for (int32_t i = start; i < start + pInput->numOfRows; ++i) { -// char* data = colDataGetData(pCol, i); -// SAvgRes* pInputInfo = (SAvgRes*)varDataVal(data); -// avgTransferInfo(pInputInfo, pInfo); -// } -// -// SET_VAL(GET_RES_INFO(pCtx), 1, 1); -// -// return TSDB_CODE_SUCCESS; -//} -// -//int32_t avgInvertFunction(SqlFunctionCtx* pCtx) { -// int32_t numOfElem = 0; -// -// // Only the pre-computing information loaded and actual data does not loaded -// SInputColumnInfoData* pInput = &pCtx->input; -// int32_t type = pInput->pData[0]->info.type; -// -// SAvgRes* pAvgRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); -// -// // computing based on the true data block -// SColumnInfoData* pCol = pInput->pData[0]; -// -// int32_t start = pInput->startRowIndex; -// int32_t numOfRows = pInput->numOfRows; -// -// switch (type) { -// case TSDB_DATA_TYPE_TINYINT: { -// LIST_AVG_N(pAvgRes->sum.isum, int8_t); -// break; -// } -// case TSDB_DATA_TYPE_SMALLINT: { -// LIST_AVG_N(pAvgRes->sum.isum, int16_t); -// break; -// } -// case TSDB_DATA_TYPE_INT: { -// LIST_AVG_N(pAvgRes->sum.isum, int32_t); -// break; -// } -// case TSDB_DATA_TYPE_BIGINT: { -// LIST_AVG_N(pAvgRes->sum.isum, int64_t); -// break; -// } -// case TSDB_DATA_TYPE_UTINYINT: { -// LIST_AVG_N(pAvgRes->sum.usum, uint8_t); -// break; -// } -// case TSDB_DATA_TYPE_USMALLINT: { -// LIST_AVG_N(pAvgRes->sum.usum, uint16_t); -// break; -// } -// case TSDB_DATA_TYPE_UINT: { -// LIST_AVG_N(pAvgRes->sum.usum, uint32_t); -// break; -// } -// case TSDB_DATA_TYPE_UBIGINT: { -// LIST_AVG_N(pAvgRes->sum.usum, uint64_t); -// break; -// } -// case TSDB_DATA_TYPE_FLOAT: { -// LIST_AVG_N(pAvgRes->sum.dsum, float); -// break; -// } -// case TSDB_DATA_TYPE_DOUBLE: { -// LIST_AVG_N(pAvgRes->sum.dsum, double); -// break; -// } -// default: -// break; -// } -// -// // data in the check operation are all null, not output -// SET_VAL(GET_RES_INFO(pCtx), numOfElem, 1); -// return TSDB_CODE_SUCCESS; -//} -// -//int32_t avgCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { -// SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); -// SAvgRes* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); -// -// SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); -// SAvgRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); -// int16_t type = pDBuf->type == TSDB_DATA_TYPE_NULL ? pSBuf->type : pDBuf->type; -// -// if (IS_SIGNED_NUMERIC_TYPE(type)) { -// pDBuf->sum.isum += pSBuf->sum.isum; -// } else if (IS_UNSIGNED_NUMERIC_TYPE(type)) { -// pDBuf->sum.usum += pSBuf->sum.usum; -// } else { -// pDBuf->sum.dsum += pSBuf->sum.dsum; -// } -// pDBuf->count += pSBuf->count; -// -// return TSDB_CODE_SUCCESS; -//} -// -//int32_t avgFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { -// SInputColumnInfoData* pInput = &pCtx->input; -// -// SAvgRes* pAvgRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); -// int32_t type = pAvgRes->type; -// -// if (IS_SIGNED_NUMERIC_TYPE(type)) { -// pAvgRes->result = pAvgRes->sum.isum / ((double)pAvgRes->count); -// } else if (IS_UNSIGNED_NUMERIC_TYPE(type)) { -// pAvgRes->result = pAvgRes->sum.usum / ((double)pAvgRes->count); -// } else { -// pAvgRes->result = pAvgRes->sum.dsum / ((double)pAvgRes->count); -// } -// -// // check for overflow -// if (isinf(pAvgRes->result) || isnan(pAvgRes->result)) { -// GET_RES_INFO(pCtx)->numOfRes = 0; -// } -// -// return functionFinalize(pCtx, pBlock); -//} -// -//int32_t avgPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { -// SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); -// SAvgRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); -// int32_t resultBytes = getAvgInfoSize(); -// char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); -// -// memcpy(varDataVal(res), pInfo, resultBytes); -// varDataSetLen(res, resultBytes); -// -// int32_t slotId = pCtx->pExpr->base.resSchema.slotId; -// SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, slotId); -// -// colDataAppend(pCol, pBlock->info.rows, res, false); -// -// taosMemoryFree(res); -// return pResInfo->numOfRes; -//} - EFuncDataRequired statisDataRequired(SFunctionNode* pFunc, STimeWindow* pTimeWindow) { return FUNC_DATA_REQUIRED_SMA_LOAD; } @@ -1121,530 +752,6 @@ bool getMinmaxFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { return true; } -//static STuplePos saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pSrcBlock, -// const STupleKey* pKey); -//static int32_t updateTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pSrcBlock, STuplePos* pPos); -//static const char* loadTupleData(SqlFunctionCtx* pCtx, const STuplePos* pPos); - -//static int32_t findRowIndex(int32_t start, int32_t num, SColumnInfoData* pCol, const char* tval) { -// // the data is loaded, not only the block SMA value -// for (int32_t i = start; i < num + start; ++i) { -// char* p = colDataGetData(pCol, i); -// if (memcmp((void*)tval, p, pCol->info.bytes) == 0) { -// return i; -// } -// } -// -// // if reach here means real data of block SMA is not set in pCtx->input. -// return -1; -//} - -//int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) { -// int32_t numOfElems = 0; -// -// SInputColumnInfoData* pInput = &pCtx->input; -// SColumnDataAgg* pAgg = pInput->pColumnDataAgg[0]; -// -// SColumnInfoData* pCol = pInput->pData[0]; -// int32_t type = pCol->info.type; -// -// SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); -// SMinmaxResInfo* pBuf = GET_ROWCELL_INTERBUF(pResInfo); -// pBuf->type = type; -// -// if (IS_NULL_TYPE(type)) { -// numOfElems = 0; -// goto _min_max_over; -// } -// -// // data in current data block are qualified to the query -// if (pInput->colDataSMAIsSet) { -// numOfElems = pInput->numOfRows - pAgg->numOfNull; -// ASSERT(pInput->numOfRows == pInput->totalRows && numOfElems >= 0); -// if (numOfElems == 0) { -// return numOfElems; -// } -// -// void* tval = NULL; -// int16_t index = 0; -// -// if (isMinFunc) { -// tval = &pInput->pColumnDataAgg[0]->min; -// } else { -// tval = &pInput->pColumnDataAgg[0]->max; -// } -// -// if (!pBuf->assign) { -// pBuf->v = *(int64_t*)tval; -// if (pCtx->subsidiaries.num > 0) { -// index = findRowIndex(pInput->startRowIndex, pInput->numOfRows, pCol, tval); -// if (index >= 0) { -// pBuf->tuplePos = saveTupleData(pCtx, index, pCtx->pSrcBlock, NULL); -// } -// } -// } else { -// if (IS_SIGNED_NUMERIC_TYPE(type)) { -// int64_t prev = 0; -// GET_TYPED_DATA(prev, int64_t, type, &pBuf->v); -// -// int64_t val = GET_INT64_VAL(tval); -// if ((prev < val) ^ isMinFunc) { -// *(int64_t*)&pBuf->v = val; -// if (pCtx->subsidiaries.num > 0) { -// index = findRowIndex(pInput->startRowIndex, pInput->numOfRows, pCol, tval); -// if (index >= 0) { -// pBuf->tuplePos = saveTupleData(pCtx, index, pCtx->pSrcBlock, NULL); -// } -// } -// } -// } else if (IS_UNSIGNED_NUMERIC_TYPE(type)) { -// uint64_t prev = 0; -// GET_TYPED_DATA(prev, uint64_t, type, &pBuf->v); -// -// uint64_t val = GET_UINT64_VAL(tval); -// if ((prev < val) ^ isMinFunc) { -// *(uint64_t*)&pBuf->v = val; -// if (pCtx->subsidiaries.num > 0) { -// index = findRowIndex(pInput->startRowIndex, pInput->numOfRows, pCol, tval); -// if (index >= 0) { -// pBuf->tuplePos = saveTupleData(pCtx, index, pCtx->pSrcBlock, NULL); -// } -// } -// } -// } else if (type == TSDB_DATA_TYPE_DOUBLE) { -// double prev = 0; -// GET_TYPED_DATA(prev, double, type, &pBuf->v); -// -// double val = GET_DOUBLE_VAL(tval); -// if ((prev < val) ^ isMinFunc) { -// *(double*)&pBuf->v = val; -// if (pCtx->subsidiaries.num > 0) { -// index = findRowIndex(pInput->startRowIndex, pInput->numOfRows, pCol, tval); -// if (index >= 0) { -// pBuf->tuplePos = saveTupleData(pCtx, index, pCtx->pSrcBlock, NULL); -// } -// } -// } -// } else if (type == TSDB_DATA_TYPE_FLOAT) { -// float prev = 0; -// GET_TYPED_DATA(prev, float, type, &pBuf->v); -// -// float val = GET_DOUBLE_VAL(tval); -// if ((prev < val) ^ isMinFunc) { -// *(float*)&pBuf->v = val; -// } -// -// if (pCtx->subsidiaries.num > 0) { -// index = findRowIndex(pInput->startRowIndex, pInput->numOfRows, pCol, tval); -// if (index >= 0) { -// pBuf->tuplePos = saveTupleData(pCtx, index, pCtx->pSrcBlock, NULL); -// } -// } -// } -// } -// -// pBuf->assign = true; -// return numOfElems; -// } -// -// int32_t start = pInput->startRowIndex; -// int32_t numOfRows = pInput->numOfRows; -// -// if (IS_SIGNED_NUMERIC_TYPE(type) || type == TSDB_DATA_TYPE_BOOL) { -// if (type == TSDB_DATA_TYPE_TINYINT || type == TSDB_DATA_TYPE_BOOL) { -// int8_t* pData = (int8_t*)pCol->pData; -// int8_t* val = (int8_t*)&pBuf->v; -// -// for (int32_t i = start; i < start + numOfRows; ++i) { -// if ((pCol->hasNull) && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// if (!pBuf->assign) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// pBuf->tuplePos = saveTupleData(pCtx, i, pCtx->pSrcBlock, NULL); -// } -// pBuf->assign = true; -// } else { -// // ignore the equivalent data value -// // NOTE: An faster version to avoid one additional comparison with FPU. -// if (isMinFunc) { // min -// if (*val > pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } else { // max -// if (*val < pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } -// } -// -// numOfElems += 1; -// } -// } else if (type == TSDB_DATA_TYPE_SMALLINT) { -// int16_t* pData = (int16_t*)pCol->pData; -// int16_t* val = (int16_t*)&pBuf->v; -// -// for (int32_t i = start; i < start + numOfRows; ++i) { -// if ((pCol->hasNull) && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// if (!pBuf->assign) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// pBuf->tuplePos = saveTupleData(pCtx, i, pCtx->pSrcBlock, NULL); -// } -// pBuf->assign = true; -// } else { -// // ignore the equivalent data value -// // NOTE: An faster version to avoid one additional comparison with FPU. -// if (isMinFunc) { // min -// if (*val > pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } else { // max -// if (*val < pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } -// } -// -// numOfElems += 1; -// } -// } else if (type == TSDB_DATA_TYPE_INT) { -// int32_t* pData = (int32_t*)pCol->pData; -// int32_t* val = (int32_t*)&pBuf->v; -// -// for (int32_t i = start; i < start + numOfRows; ++i) { -// if ((pCol->hasNull) && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// if (!pBuf->assign) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// pBuf->tuplePos = saveTupleData(pCtx, i, pCtx->pSrcBlock, NULL); -// } -// pBuf->assign = true; -// } else { -// // ignore the equivalent data value -// // NOTE: An faster version to avoid one additional comparison with FPU. -// if (isMinFunc) { // min -// if (*val > pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } else { // max -// if (*val < pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } -// } -// -// numOfElems += 1; -// } -// } else if (type == TSDB_DATA_TYPE_BIGINT) { -// int64_t* pData = (int64_t*)pCol->pData; -// int64_t* val = (int64_t*)&pBuf->v; -// -// for (int32_t i = start; i < start + numOfRows; ++i) { -// if ((pCol->hasNull) && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// if (!pBuf->assign) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// pBuf->tuplePos = saveTupleData(pCtx, i, pCtx->pSrcBlock, NULL); -// } -// pBuf->assign = true; -// } else { -// // ignore the equivalent data value -// // NOTE: An faster version to avoid one additional comparison with FPU. -// if (isMinFunc) { // min -// if (*val > pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } else { // max -// if (*val < pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } -// } -// -// numOfElems += 1; -// } -// } -// } else if (IS_UNSIGNED_NUMERIC_TYPE(type)) { -// if (type == TSDB_DATA_TYPE_UTINYINT) { -// uint8_t* pData = (uint8_t*)pCol->pData; -// uint8_t* val = (uint8_t*)&pBuf->v; -// -// for (int32_t i = start; i < start + numOfRows; ++i) { -// if ((pCol->hasNull) && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// if (!pBuf->assign) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// pBuf->tuplePos = saveTupleData(pCtx, i, pCtx->pSrcBlock, NULL); -// } -// pBuf->assign = true; -// } else { -// // ignore the equivalent data value -// // NOTE: An faster version to avoid one additional comparison with FPU. -// if (isMinFunc) { // min -// if (*val > pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } else { // max -// if (*val < pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } -// } -// -// numOfElems += 1; -// } -// } else if (type == TSDB_DATA_TYPE_USMALLINT) { -// uint16_t* pData = (uint16_t*)pCol->pData; -// uint16_t* val = (uint16_t*)&pBuf->v; -// -// for (int32_t i = start; i < start + numOfRows; ++i) { -// if ((pCol->hasNull) && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// if (!pBuf->assign) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// pBuf->tuplePos = saveTupleData(pCtx, i, pCtx->pSrcBlock, NULL); -// } -// pBuf->assign = true; -// } else { -// // ignore the equivalent data value -// // NOTE: An faster version to avoid one additional comparison with FPU. -// if (isMinFunc) { // min -// if (*val > pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } else { // max -// if (*val < pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } -// } -// -// numOfElems += 1; -// } -// } else if (type == TSDB_DATA_TYPE_UINT) { -// uint32_t* pData = (uint32_t*)pCol->pData; -// uint32_t* val = (uint32_t*)&pBuf->v; -// -// for (int32_t i = start; i < start + numOfRows; ++i) { -// if ((pCol->hasNull) && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// if (!pBuf->assign) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// pBuf->tuplePos = saveTupleData(pCtx, i, pCtx->pSrcBlock, NULL); -// } -// pBuf->assign = true; -// } else { -// // ignore the equivalent data value -// // NOTE: An faster version to avoid one additional comparison with FPU. -// if (isMinFunc) { // min -// if (*val > pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } else { // max -// if (*val < pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } -// } -// -// numOfElems += 1; -// } -// } else if (type == TSDB_DATA_TYPE_UBIGINT) { -// uint64_t* pData = (uint64_t*)pCol->pData; -// uint64_t* val = (uint64_t*)&pBuf->v; -// -// for (int32_t i = start; i < start + numOfRows; ++i) { -// if ((pCol->hasNull) && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// if (!pBuf->assign) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// pBuf->tuplePos = saveTupleData(pCtx, i, pCtx->pSrcBlock, NULL); -// } -// pBuf->assign = true; -// } else { -// // ignore the equivalent data value -// // NOTE: An faster version to avoid one additional comparison with FPU. -// if (isMinFunc) { // min -// if (*val > pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } else { // max -// if (*val < pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } -// } -// -// numOfElems += 1; -// } -// } -// } else if (type == TSDB_DATA_TYPE_DOUBLE) { -// double* pData = (double*)pCol->pData; -// double* val = (double*)&pBuf->v; -// -// for (int32_t i = start; i < start + numOfRows; ++i) { -// if ((pCol->hasNull) && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// if (!pBuf->assign) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// pBuf->tuplePos = saveTupleData(pCtx, i, pCtx->pSrcBlock, NULL); -// } -// pBuf->assign = true; -// } else { -// // ignore the equivalent data value -// // NOTE: An faster version to avoid one additional comparison with FPU. -// if (isMinFunc) { // min -// if (*val > pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } else { // max -// if (*val < pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } -// } -// -// numOfElems += 1; -// } -// } else if (type == TSDB_DATA_TYPE_FLOAT) { -// float* pData = (float*)pCol->pData; -// float* val = (float*)&pBuf->v; -// -// for (int32_t i = start; i < start + numOfRows; ++i) { -// if ((pCol->hasNull) && colDataIsNull_f(pCol->nullbitmap, i)) { -// continue; -// } -// -// if (!pBuf->assign) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// pBuf->tuplePos = saveTupleData(pCtx, i, pCtx->pSrcBlock, NULL); -// } -// pBuf->assign = true; -// } else { -//#if 0 -// if ((*val) == pData[i]) { -// continue; -// } -// -// if ((*val < pData[i]) ^ isMinFunc) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -//#endif -// // NOTE: An faster version to avoid one additional comparison with FPU. -// if (isMinFunc) { // min -// if (*val > pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } else { // max -// if (*val < pData[i]) { -// *val = pData[i]; -// if (pCtx->subsidiaries.num > 0) { -// updateTupleData(pCtx, i, pCtx->pSrcBlock, &pBuf->tuplePos); -// } -// } -// } -// } -// -// numOfElems += 1; -// } -// } -// -//_min_max_over: -// if (numOfElems == 0 && pCtx->subsidiaries.num > 0 && !pBuf->nullTupleSaved) { -// pBuf->nullTuplePos = saveTupleData(pCtx, pInput->startRowIndex, pCtx->pSrcBlock, NULL); -// pBuf->nullTupleSaved = true; -// } -// return numOfElems; -//} - int32_t minFunction(SqlFunctionCtx* pCtx) { int32_t numOfElems = doMinMaxHelper(pCtx, 1); SET_VAL(GET_RES_INFO(pCtx), numOfElems, 1); From 87d9836a756d154e78501076174cb206aaf57009 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 28 Nov 2022 00:28:29 +0800 Subject: [PATCH 11/23] refactor: do some internal refactor. --- source/libs/executor/src/timesliceoperator.c | 587 +++++++++++++++++++ 1 file changed, 587 insertions(+) create mode 100644 source/libs/executor/src/timesliceoperator.c diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c new file mode 100644 index 0000000000..d8cef86971 --- /dev/null +++ b/source/libs/executor/src/timesliceoperator.c @@ -0,0 +1,587 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * 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 . + */ +#include "executorimpl.h" +#include "filter.h" +#include "function.h" +#include "functionMgt.h" +#include "tcommon.h" +#include "tcompare.h" +#include "tdatablock.h" +#include "tfill.h" +#include "ttime.h" + +typedef struct STimeSliceOperatorInfo { + SSDataBlock* pRes; + STimeWindow win; + SInterval interval; + int64_t current; + SArray* pPrevRow; // SArray + SArray* pNextRow; // SArray + SArray* pLinearInfo; // SArray + bool isPrevRowSet; + bool isNextRowSet; + int32_t fillType; // fill type + SColumn tsCol; // primary timestamp column + SExprSupp scalarSup; // scalar calculation + struct SFillColInfo* pFillColInfo; // fill column info +} STimeSliceOperatorInfo; + +static void destroyTimeSliceOperatorInfo(void* param); + +static void doKeepPrevRows(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlock* pBlock, int32_t rowIndex) { + int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); + for (int32_t i = 0; i < numOfCols; ++i) { + SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); + + SGroupKeys* pkey = taosArrayGet(pSliceInfo->pPrevRow, i); + if (!colDataIsNull_s(pColInfoData, rowIndex)) { + pkey->isNull = false; + char* val = colDataGetData(pColInfoData, rowIndex); + if (!IS_VAR_DATA_TYPE(pkey->type)) { + memcpy(pkey->pData, val, pkey->bytes); + } else { + memcpy(pkey->pData, val, varDataLen(val)); + } + } else { + pkey->isNull = true; + } + } + + pSliceInfo->isPrevRowSet = true; +} + +static void doKeepNextRows(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlock* pBlock, int32_t rowIndex) { + int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); + for (int32_t i = 0; i < numOfCols; ++i) { + SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); + + SGroupKeys* pkey = taosArrayGet(pSliceInfo->pNextRow, i); + if (!colDataIsNull_s(pColInfoData, rowIndex)) { + pkey->isNull = false; + char* val = colDataGetData(pColInfoData, rowIndex); + if (!IS_VAR_DATA_TYPE(pkey->type)) { + memcpy(pkey->pData, val, pkey->bytes); + } else { + memcpy(pkey->pData, val, varDataLen(val)); + } + } else { + pkey->isNull = true; + } + } + + pSliceInfo->isNextRowSet = true; +} + +static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlock* pBlock, int32_t rowIndex) { + int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); + for (int32_t i = 0; i < numOfCols; ++i) { + SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); + SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, pSliceInfo->tsCol.slotId); + SFillLinearInfo* pLinearInfo = taosArrayGet(pSliceInfo->pLinearInfo, i); + + // null value is represented by using key = INT64_MIN for now. + // TODO: optimize to ignore null values for linear interpolation. + if (!pLinearInfo->isStartSet) { + if (!colDataIsNull_s(pColInfoData, rowIndex)) { + pLinearInfo->start.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); + memcpy(pLinearInfo->start.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); + } + pLinearInfo->isStartSet = true; + } else if (!pLinearInfo->isEndSet) { + if (!colDataIsNull_s(pColInfoData, rowIndex)) { + pLinearInfo->end.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); + memcpy(pLinearInfo->end.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); + } + pLinearInfo->isEndSet = true; + } else { + pLinearInfo->start.key = pLinearInfo->end.key; + memcpy(pLinearInfo->start.val, pLinearInfo->end.val, pLinearInfo->bytes); + + if (!colDataIsNull_s(pColInfoData, rowIndex)) { + pLinearInfo->end.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); + memcpy(pLinearInfo->end.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); + } else { + pLinearInfo->end.key = INT64_MIN; + } + } + } + +} + +static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp* pExprSup, SSDataBlock* pResBlock, bool beforeTs) { + int32_t rows = pResBlock->info.rows; + blockDataEnsureCapacity(pResBlock, rows + 1); + // todo set the correct primary timestamp column + + // output the result + bool hasInterp = true; + for (int32_t j = 0; j < pExprSup->numOfExprs; ++j) { + SExprInfo* pExprInfo = &pExprSup->pExprInfo[j]; + + int32_t dstSlot = pExprInfo->base.resSchema.slotId; + SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot); + + if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) { + colDataAppend(pDst, rows, (char*)&pSliceInfo->current, false); + continue; + } + + int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; + switch (pSliceInfo->fillType) { + case TSDB_FILL_NULL: { + colDataAppendNULL(pDst, rows); + break; + } + + case TSDB_FILL_SET_VALUE: { + SVariant* pVar = &pSliceInfo->pFillColInfo[j].fillVal; + + if (pDst->info.type == TSDB_DATA_TYPE_FLOAT) { + float v = 0; + GET_TYPED_DATA(v, float, pVar->nType, &pVar->i); + colDataAppend(pDst, rows, (char*)&v, false); + } else if (pDst->info.type == TSDB_DATA_TYPE_DOUBLE) { + double v = 0; + GET_TYPED_DATA(v, double, pVar->nType, &pVar->i); + colDataAppend(pDst, rows, (char*)&v, false); + } else if (IS_SIGNED_NUMERIC_TYPE(pDst->info.type)) { + int64_t v = 0; + GET_TYPED_DATA(v, int64_t, pVar->nType, &pVar->i); + colDataAppend(pDst, rows, (char*)&v, false); + } + break; + } + + case TSDB_FILL_LINEAR: { + SFillLinearInfo* pLinearInfo = taosArrayGet(pSliceInfo->pLinearInfo, srcSlot); + + SPoint start = pLinearInfo->start; + SPoint end = pLinearInfo->end; + SPoint current = {.key = pSliceInfo->current}; + + // do not interpolate before ts range, only increate pSliceInfo->current + if (beforeTs && !pLinearInfo->isEndSet) { + return true; + } + + if (!pLinearInfo->isStartSet || !pLinearInfo->isEndSet) { + hasInterp = false; + break; + } + + if (start.key == INT64_MIN || end.key == INT64_MIN) { + colDataAppendNULL(pDst, rows); + break; + } + + current.val = taosMemoryCalloc(pLinearInfo->bytes, 1); + taosGetLinearInterpolationVal(¤t, pLinearInfo->type, &start, &end, pLinearInfo->type); + colDataAppend(pDst, rows, (char*)current.val, false); + + taosMemoryFree(current.val); + break; + } + case TSDB_FILL_PREV: { + if (!pSliceInfo->isPrevRowSet) { + hasInterp = false; + break; + } + + SGroupKeys* pkey = taosArrayGet(pSliceInfo->pPrevRow, srcSlot); + if (pkey->isNull == false) { + colDataAppend(pDst, rows, pkey->pData, false); + } else { + colDataAppendNULL(pDst, rows); + } + break; + } + + case TSDB_FILL_NEXT: { + if (!pSliceInfo->isNextRowSet) { + hasInterp = false; + break; + } + + SGroupKeys* pkey = taosArrayGet(pSliceInfo->pNextRow, srcSlot); + if (pkey->isNull == false) { + colDataAppend(pDst, rows, pkey->pData, false); + } else { + colDataAppendNULL(pDst, rows); + } + break; + } + + case TSDB_FILL_NONE: + default: + break; + } + } + + if (hasInterp) { + pResBlock->info.rows += 1; + } + + return hasInterp; +} + +static void addCurrentRowToResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp* pExprSup, SSDataBlock* pResBlock, + SSDataBlock* pSrcBlock, int32_t index) { + blockDataEnsureCapacity(pResBlock, pResBlock->info.rows + 1); + for (int32_t j = 0; j < pExprSup->numOfExprs; ++j) { + SExprInfo* pExprInfo = &pExprSup->pExprInfo[j]; + + int32_t dstSlot = pExprInfo->base.resSchema.slotId; + SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot); + + if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) { + colDataAppend(pDst, pResBlock->info.rows, (char*)&pSliceInfo->current, false); + } else { + int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; + SColumnInfoData* pSrc = taosArrayGet(pSrcBlock->pDataBlock, srcSlot); + + if (colDataIsNull_s(pSrc, index)) { + colDataAppendNULL(pDst, pResBlock->info.rows); + continue; + } + + char* v = colDataGetData(pSrc, index); + colDataAppend(pDst, pResBlock->info.rows, v, false); + } + } + + pResBlock->info.rows += 1; + return; +} + + +static int32_t initPrevRowsKeeper(STimeSliceOperatorInfo* pInfo, SSDataBlock* pBlock) { + if (pInfo->pPrevRow != NULL) { + return TSDB_CODE_SUCCESS; + } + + pInfo->pPrevRow = taosArrayInit(4, sizeof(SGroupKeys)); + if (pInfo->pPrevRow == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); + for (int32_t i = 0; i < numOfCols; ++i) { + SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, i); + + SGroupKeys key = {0}; + key.bytes = pColInfo->info.bytes; + key.type = pColInfo->info.type; + key.isNull = false; + key.pData = taosMemoryCalloc(1, pColInfo->info.bytes); + taosArrayPush(pInfo->pPrevRow, &key); + } + + pInfo->isPrevRowSet = false; + + return TSDB_CODE_SUCCESS; +} + +static int32_t initNextRowsKeeper(STimeSliceOperatorInfo* pInfo, SSDataBlock* pBlock) { + if (pInfo->pNextRow != NULL) { + return TSDB_CODE_SUCCESS; + } + + pInfo->pNextRow = taosArrayInit(4, sizeof(SGroupKeys)); + if (pInfo->pNextRow == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); + for (int32_t i = 0; i < numOfCols; ++i) { + SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, i); + + SGroupKeys key = {0}; + key.bytes = pColInfo->info.bytes; + key.type = pColInfo->info.type; + key.isNull = false; + key.pData = taosMemoryCalloc(1, pColInfo->info.bytes); + taosArrayPush(pInfo->pNextRow, &key); + } + + pInfo->isNextRowSet = false; + + return TSDB_CODE_SUCCESS; +} + +static int32_t initFillLinearInfo(STimeSliceOperatorInfo* pInfo, SSDataBlock* pBlock) { + if (pInfo->pLinearInfo != NULL) { + return TSDB_CODE_SUCCESS; + } + + pInfo->pLinearInfo = taosArrayInit(4, sizeof(SFillLinearInfo)); + if (pInfo->pLinearInfo == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); + for (int32_t i = 0; i < numOfCols; ++i) { + SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, i); + + SFillLinearInfo linearInfo = {0}; + linearInfo.start.key = INT64_MIN; + linearInfo.end.key = INT64_MIN; + linearInfo.start.val = taosMemoryCalloc(1, pColInfo->info.bytes); + linearInfo.end.val = taosMemoryCalloc(1, pColInfo->info.bytes); + linearInfo.isStartSet = false; + linearInfo.isEndSet = false; + linearInfo.type = pColInfo->info.type; + linearInfo.bytes = pColInfo->info.bytes; + taosArrayPush(pInfo->pLinearInfo, &linearInfo); + } + + return TSDB_CODE_SUCCESS; +} + +static int32_t initKeeperInfo(STimeSliceOperatorInfo* pInfo, SSDataBlock* pBlock) { + int32_t code; + code = initPrevRowsKeeper(pInfo, pBlock); + if (code != TSDB_CODE_SUCCESS) { + return TSDB_CODE_FAILED; + } + + code = initNextRowsKeeper(pInfo, pBlock); + if (code != TSDB_CODE_SUCCESS) { + return TSDB_CODE_FAILED; + } + + code = initFillLinearInfo(pInfo, pBlock); + if (code != TSDB_CODE_SUCCESS) { + return TSDB_CODE_FAILED; + } + + return TSDB_CODE_SUCCESS; +} + +static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) { + if (pOperator->status == OP_EXEC_DONE) { + return NULL; + } + + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + + STimeSliceOperatorInfo* pSliceInfo = pOperator->info; + SSDataBlock* pResBlock = pSliceInfo->pRes; + SExprSupp* pSup = &pOperator->exprSupp; + + int32_t order = TSDB_ORDER_ASC; + SInterval* pInterval = &pSliceInfo->interval; + SOperatorInfo* downstream = pOperator->pDownstream[0]; + + blockDataCleanup(pResBlock); + + while (1) { + SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream); + if (pBlock == NULL) { + break; + } + + int32_t code = initKeeperInfo(pSliceInfo, pBlock); + if (code != TSDB_CODE_SUCCESS) { + T_LONG_JMP(pTaskInfo->env, code); + } + + // the pDataBlock are always the same one, no need to call this again + setInputDataBlock(pSup, pBlock, order, MAIN_SCAN, true); + + SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, pSliceInfo->tsCol.slotId); + for (int32_t i = 0; i < pBlock->info.rows; ++i) { + int64_t ts = *(int64_t*)colDataGetData(pTsCol, i); + + if (pSliceInfo->current > pSliceInfo->win.ekey) { + setOperatorCompleted(pOperator); + break; + } + + if (ts == pSliceInfo->current) { + addCurrentRowToResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i); + + doKeepPrevRows(pSliceInfo, pBlock, i); + doKeepLinearInfo(pSliceInfo, pBlock, i); + + pSliceInfo->current = + taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); + if (pSliceInfo->current > pSliceInfo->win.ekey) { + setOperatorCompleted(pOperator); + break; + } + } else if (ts < pSliceInfo->current) { + // in case of interpolation window starts and ends between two datapoints, fill(prev) need to interpolate + doKeepPrevRows(pSliceInfo, pBlock, i); + doKeepLinearInfo(pSliceInfo, pBlock, i); + + if (i < pBlock->info.rows - 1) { + // in case of interpolation window starts and ends between two datapoints, fill(next) need to interpolate + doKeepNextRows(pSliceInfo, pBlock, i + 1); + int64_t nextTs = *(int64_t*)colDataGetData(pTsCol, i + 1); + if (nextTs > pSliceInfo->current) { + while (pSliceInfo->current < nextTs && pSliceInfo->current <= pSliceInfo->win.ekey) { + if (!genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, false) && pSliceInfo->fillType == TSDB_FILL_LINEAR) { + break; + } else { + pSliceInfo->current = + taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); + } + } + + if (pSliceInfo->current > pSliceInfo->win.ekey) { + setOperatorCompleted(pOperator); + break; + } + } else { + // ignore current row, and do nothing + } + } else { // it is the last row of current block + doKeepPrevRows(pSliceInfo, pBlock, i); + } + } else { // ts > pSliceInfo->current + // in case of interpolation window starts and ends between two datapoints, fill(next) need to interpolate + doKeepNextRows(pSliceInfo, pBlock, i); + doKeepLinearInfo(pSliceInfo, pBlock, i); + + while (pSliceInfo->current < ts && pSliceInfo->current <= pSliceInfo->win.ekey) { + if (!genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, true) && pSliceInfo->fillType == TSDB_FILL_LINEAR) { + break; + } else { + pSliceInfo->current = + taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); + } + } + + // add current row if timestamp match + if (ts == pSliceInfo->current && pSliceInfo->current <= pSliceInfo->win.ekey) { + addCurrentRowToResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i); + doKeepPrevRows(pSliceInfo, pBlock, i); + + pSliceInfo->current = + taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); + } + + if (pSliceInfo->current > pSliceInfo->win.ekey) { + setOperatorCompleted(pOperator); + break; + } + } + } + } + + // check if need to interpolate after last datablock + // except for fill(next), fill(linear) + while (pSliceInfo->current <= pSliceInfo->win.ekey && pSliceInfo->fillType != TSDB_FILL_NEXT && + pSliceInfo->fillType != TSDB_FILL_LINEAR) { + genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, false); + pSliceInfo->current = + taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); + } + + // restore the value + setTaskStatus(pOperator->pTaskInfo, TASK_COMPLETED); + if (pResBlock->info.rows == 0) { + pOperator->status = OP_EXEC_DONE; + } + + return pResBlock->info.rows == 0 ? NULL : pResBlock; +} + +SOperatorInfo* createTimeSliceOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo) { + STimeSliceOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(STimeSliceOperatorInfo)); + SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); + if (pOperator == NULL || pInfo == NULL) { + goto _error; + } + + SInterpFuncPhysiNode* pInterpPhyNode = (SInterpFuncPhysiNode*)pPhyNode; + SExprSupp* pSup = &pOperator->exprSupp; + + int32_t numOfExprs = 0; + SExprInfo* pExprInfo = createExprInfo(pInterpPhyNode->pFuncs, NULL, &numOfExprs); + int32_t code = initExprSupp(pSup, pExprInfo, numOfExprs); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + + if (pInterpPhyNode->pExprs != NULL) { + int32_t num = 0; + SExprInfo* pScalarExprInfo = createExprInfo(pInterpPhyNode->pExprs, NULL, &num); + code = initExprSupp(&pInfo->scalarSup, pScalarExprInfo, num); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + } + + pInfo->tsCol = extractColumnFromColumnNode((SColumnNode*)pInterpPhyNode->pTimeSeries); + pInfo->fillType = convertFillType(pInterpPhyNode->fillMode); + initResultSizeInfo(&pOperator->resultInfo, 4096); + + pInfo->pFillColInfo = createFillColInfo(pExprInfo, numOfExprs, NULL, 0, (SNodeListNode*)pInterpPhyNode->pFillValues); + pInfo->pLinearInfo = NULL; + pInfo->pRes = createDataBlockFromDescNode(pPhyNode->pOutputDataBlockDesc); + pInfo->win = pInterpPhyNode->timeRange; + pInfo->interval.interval = pInterpPhyNode->interval; + pInfo->current = pInfo->win.skey; + + 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; + } + + setOperatorInfo(pOperator, "TimeSliceOperator", QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC, false, OP_NOT_OPENED, pInfo, + pTaskInfo); + pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, doTimeslice, NULL, destroyTimeSliceOperatorInfo, NULL); + + blockDataEnsureCapacity(pInfo->pRes, pOperator->resultInfo.capacity); + + code = appendDownstream(pOperator, &downstream, 1); + return pOperator; + + _error: + taosMemoryFree(pInfo); + taosMemoryFree(pOperator); + pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY; + return NULL; +} + +void destroyTimeSliceOperatorInfo(void* param) { + STimeSliceOperatorInfo* pInfo = (STimeSliceOperatorInfo*)param; + + pInfo->pRes = blockDataDestroy(pInfo->pRes); + + for (int32_t i = 0; i < taosArrayGetSize(pInfo->pPrevRow); ++i) { + SGroupKeys* pKey = taosArrayGet(pInfo->pPrevRow, i); + taosMemoryFree(pKey->pData); + } + taosArrayDestroy(pInfo->pPrevRow); + + for (int32_t i = 0; i < taosArrayGetSize(pInfo->pNextRow); ++i) { + SGroupKeys* pKey = taosArrayGet(pInfo->pNextRow, i); + taosMemoryFree(pKey->pData); + } + taosArrayDestroy(pInfo->pNextRow); + + for (int32_t i = 0; i < taosArrayGetSize(pInfo->pLinearInfo); ++i) { + SFillLinearInfo* pKey = taosArrayGet(pInfo->pLinearInfo, i); + taosMemoryFree(pKey->start.val); + taosMemoryFree(pKey->end.val); + } + taosArrayDestroy(pInfo->pLinearInfo); + + taosMemoryFree(pInfo->pFillColInfo); + taosMemoryFreeClear(param); +} From d8da10f2bb697dddb79bcdf9958521d1e8e5114e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 28 Nov 2022 00:51:18 +0800 Subject: [PATCH 12/23] refactor: do some internal refactor. --- source/libs/executor/inc/executil.h | 30 ++--- source/libs/executor/inc/executorimpl.h | 61 ++++------- source/libs/executor/src/executor.c | 17 +-- source/libs/executor/src/executorimpl.c | 103 +----------------- source/libs/executor/src/groupoperator.c | 2 +- source/libs/executor/src/projectoperator.c | 4 +- source/libs/executor/src/timewindowoperator.c | 35 ++---- 7 files changed, 56 insertions(+), 196 deletions(-) diff --git a/source/libs/executor/inc/executil.h b/source/libs/executor/inc/executil.h index d5366f1b7a..875528576d 100644 --- a/source/libs/executor/inc/executil.h +++ b/source/libs/executor/inc/executil.h @@ -38,16 +38,7 @@ memcpy((_k) + sizeof(uint64_t), (_ori), (_len)); \ } while (0) -#define SET_RES_EXT_WINDOW_KEY(_k, _ori, _len, _uid, _buf) \ - do { \ - assert(sizeof(_uid) == sizeof(uint64_t)); \ - *(void**)(_k) = (_buf); \ - *(uint64_t*)((_k) + POINTER_BYTES) = (_uid); \ - memcpy((_k) + POINTER_BYTES + sizeof(uint64_t), (_ori), (_len)); \ - } while (0) - #define GET_RES_WINDOW_KEY_LEN(_l) ((_l) + sizeof(uint64_t)) -#define GET_RES_EXT_WINDOW_KEY_LEN(_l) ((_l) + sizeof(uint64_t) + POINTER_BYTES) #define GET_TASKID(_t) (((SExecTaskInfo*)(_t))->id.str) @@ -104,16 +95,17 @@ int32_t createScanTableListInfo(SScanPhysiNode* pScanNode, SNodeList* pGroupTags STableListInfo* pTableListInfo, SNode* pTagCond, SNode* pTagIndexCond, SExecTaskInfo* pTaskInfo); STableListInfo* tableListCreate(); -void* tableListDestroy(STableListInfo* pTableListInfo); -void tableListClear(STableListInfo* pTableListInfo); -int32_t tableListGetOutputGroups(const STableListInfo* pTableList); -bool oneTableForEachGroup(const STableListInfo* pTableList); -uint64_t getTableGroupId(const STableListInfo* pTableList, uint64_t tableUid); -int32_t tableListAddTableInfo(STableListInfo* pTableList, uint64_t uid, uint64_t gid); -int32_t tableListGetGroupList(const STableListInfo* pTableList, int32_t ordinalIndex, STableKeyInfo** pKeyInfo, int32_t* num); -uint64_t tableListGetSize(const STableListInfo* pTableList); -uint64_t tableListGetSuid(const STableListInfo* pTableList); -STableKeyInfo* tableListGetInfo(const STableListInfo* pTableList, int32_t index); +void* tableListDestroy(STableListInfo* pTableListInfo); +void tableListClear(STableListInfo* pTableListInfo); +int32_t tableListGetOutputGroups(const STableListInfo* pTableList); +bool oneTableForEachGroup(const STableListInfo* pTableList); +uint64_t getTableGroupId(const STableListInfo* pTableList, uint64_t tableUid); +int32_t tableListAddTableInfo(STableListInfo* pTableList, uint64_t uid, uint64_t gid); +int32_t tableListGetGroupList(const STableListInfo* pTableList, int32_t ordinalIndex, STableKeyInfo** pKeyInfo, + int32_t* num); +uint64_t tableListGetSize(const STableListInfo* pTableList); +uint64_t tableListGetSuid(const STableListInfo* pTableList); +STableKeyInfo* tableListGetInfo(const STableListInfo* pTableList, int32_t index); size_t getResultRowSize(struct SqlFunctionCtx* pCtx, int32_t numOfOutput); void initResultRowInfo(SResultRowInfo* pResultRowInfo); diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index bd4472327c..8163217039 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -665,18 +665,25 @@ typedef struct SStreamFillOperatorInfo { SOperatorFpSet createOperatorFpSet(__optr_open_fn_t openFn, __optr_fn_t nextFn, __optr_fn_t cleanup, __optr_close_fn_t closeFn, __optr_explain_fn_t explain); - -int32_t operatorDummyOpenFn(SOperatorInfo* pOperator); -int32_t appendDownstream(SOperatorInfo* p, SOperatorInfo** pDownstream, int32_t num); +int32_t operatorDummyOpenFn(SOperatorInfo* pOperator); +int32_t appendDownstream(SOperatorInfo* p, SOperatorInfo** pDownstream, int32_t num); +void setOperatorCompleted(SOperatorInfo* pOperator); +void setOperatorInfo(SOperatorInfo* pOperator, const char* name, int32_t type, bool blocking, int32_t status, + void* pInfo, SExecTaskInfo* pTaskInfo); +void destroyOperatorInfo(SOperatorInfo* pOperator); void initBasicInfo(SOptrBasicInfo* pInfo, SSDataBlock* pBlock); void cleanupBasicInfo(SOptrBasicInfo* pInfo); + int32_t initExprSupp(SExprSupp* pSup, SExprInfo* pExprInfo, int32_t numOfExpr); void cleanupExprSupp(SExprSupp* pSup); + void destroyExprInfo(SExprInfo* pExpr, int32_t numOfExprs); -int32_t initAggInfo(SExprSupp* pSup, SAggSupporter* pAggSup, SExprInfo* pExprInfo, int32_t numOfCols, size_t keyBufSize, - const char* pkey); +int32_t initAggSup(SExprSupp* pSup, SAggSupporter* pAggSup, SExprInfo* pExprInfo, int32_t numOfCols, size_t keyBufSize, + const char* pkey); +void cleanupAggSup(SAggSupporter* pAggSup); + void initResultSizeInfo(SResultInfo* pResultInfo, int32_t numOfRows); void doBuildStreamResBlock(SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SGroupResInfo* pGroupResInfo, @@ -702,14 +709,10 @@ int32_t getBufferPgSize(int32_t rowSize, uint32_t* defaultPgsz, uint32_t* defaul extern void doDestroyExchangeOperatorInfo(void* param); -void setOperatorCompleted(SOperatorInfo* pOperator); -void setOperatorInfo(SOperatorInfo* pOperator, const char* name, int32_t type, bool blocking, int32_t status, - void* pInfo, SExecTaskInfo* pTaskInfo); void doFilter(SSDataBlock* pBlock, SFilterInfo* pFilterInfo, SColMatchInfo* pColMatchInfo); int32_t addTagPseudoColumnData(SReadHandle* pHandle, const SExprInfo* pExpr, int32_t numOfExpr, SSDataBlock* pBlock, int32_t rows, const char* idStr, STableMetaCacheInfo* pCache); -void cleanupAggSup(SAggSupporter* pAggSup); void appendOneRowToDataBlock(SSDataBlock* pBlock, STupleHandle* pTupleHandle); void setTbNameColData(const SSDataBlock* pBlock, SColumnInfoData* pColInfoData, int32_t functionId, const char* name); @@ -724,6 +727,8 @@ SOperatorInfo* createExchangeOperatorInfo(void* pTransporter, SExchangePhysiNode SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode, SReadHandle* pHandle, SExecTaskInfo* pTaskInfo); +SOperatorInfo* createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanNode, SReadHandle* readHandle, SExecTaskInfo* pTaskInfo); + SOperatorInfo* createTagScanOperatorInfo(SReadHandle* pReadHandle, STagScanPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo); SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScanPhysiNode* pScanPhyNode, const char* pUser, SExecTaskInfo* pTaskInfo); @@ -779,6 +784,8 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys SOperatorInfo* createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo); SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFillPhysiNode* pPhyFillNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createGroupSortOperatorInfo(SOperatorInfo* downstream, SGroupSortPhysiNode* pSortPhyNode, SExecTaskInfo* pTaskInfo); // clang-format on int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBlock* pSrcBlock, SqlFunctionCtx* pCtx, @@ -786,38 +793,22 @@ int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBloc void setInputDataBlock(SExprSupp* pExprSupp, SSDataBlock* pBlock, int32_t order, int32_t scanFlag, bool createDummyCol); -bool isTaskKilled(SExecTaskInfo* pTaskInfo); int32_t checkForQueryBuf(size_t numOfTables); +bool isTaskKilled(SExecTaskInfo* pTaskInfo); void setTaskKilled(SExecTaskInfo* pTaskInfo); -void queryCostStatis(SExecTaskInfo* pTaskInfo); void doDestroyTask(SExecTaskInfo* pTaskInfo); -void destroyOperatorInfo(SOperatorInfo* pOperator); -int32_t getMaximumIdleDurationSec(); - -/* - * ops: root operator - * data: *data save the result of encode, need to be freed by caller - * length: *length save the length of *data - * nOptrWithVal: *nOptrWithVal save the number of optr with value - * return: result code, 0 means success - */ -int32_t encodeOperator(SOperatorInfo* ops, char** data, int32_t* length, int32_t* nOptrWithVal); - -/* - * ops: root operator, created by caller - * data: save the result of decode - * length: the length of data - * return: result code, 0 means success - */ -int32_t decodeOperator(SOperatorInfo* ops, const char* data, int32_t length); - void setTaskStatus(SExecTaskInfo* pTaskInfo, int8_t status); + int32_t createExecTaskInfoImpl(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHandle* pHandle, uint64_t taskId, char* sql, EOPTR_EXEC_MODEL model); int32_t createDataSinkParam(SDataSinkNode* pNode, void** pParam, qTaskInfo_t* pTaskInfo, SReadHandle* readHandle); int32_t getOperatorExplainExecInfo(SOperatorInfo* operatorInfo, SArray* pExecInfoList); +void printTaskExecCostInLog(SExecTaskInfo* pTaskInfo); + +int32_t getMaximumIdleDurationSec(); + STimeWindow getActiveTimeWindow(SDiskbasedBuf* pBuf, SResultRowInfo* pResultRowInfo, int64_t ts, SInterval* pInterval, int32_t order); int32_t getNumOfRowsInTimeWindow(SDataBlockInfo* pDataBlockInfo, TSKEY* pPrimaryColumn, int32_t startPos, TSKEY ekey, @@ -840,15 +831,7 @@ void calBlockTbName(SStreamScanInfo* pInfo, SSDataBlock* pBlock); int32_t finalizeResultRows(SDiskbasedBuf* pBuf, SResultRowPosition* resultRowPosition, SExprSupp* pSup, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createGroupSortOperatorInfo(SOperatorInfo* downstream, SGroupSortPhysiNode* pSortPhyNode, - SExecTaskInfo* pTaskInfo); -SOperatorInfo* createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanNode, SReadHandle* readHandle, - SExecTaskInfo* pTaskInfo); - -void copyUpdateDataBlock(SSDataBlock* pDest, SSDataBlock* pSource, int32_t tsColIndex); - bool groupbyTbname(SNodeList* pGroupList); -void* destroySqlFunctionCtx(SqlFunctionCtx* pCtx, int32_t numOfOutput); int32_t buildDataBlockFromGroupRes(SOperatorInfo* pOperator, SStreamState* pState, SSDataBlock* pBlock, SExprSupp* pSup, SGroupResInfo* pGroupResInfo); int32_t saveSessionDiscBuf(SStreamState* pState, SSessionKey* key, void* buf, int32_t size); diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index 9b3bd1d808..34bd9cf8ca 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -712,7 +712,7 @@ void qDestroyTask(qTaskInfo_t qTaskHandle) { qDebug("%s execTask completed, numOfRows:%" PRId64, GET_TASKID(pTaskInfo), pTaskInfo->pRoot->resultInfo.totalRows); - queryCostStatis(pTaskInfo); // print the query cost summary + printTaskExecCostInLog(pTaskInfo); // print the query cost summary doDestroyTask(pTaskInfo); } @@ -728,12 +728,12 @@ int32_t qSerializeTaskStatus(qTaskInfo_t tinfo, char** pOutput, int32_t* len) { } int32_t nOptrWithVal = 0; - int32_t code = encodeOperator(pTaskInfo->pRoot, pOutput, len, &nOptrWithVal); - if ((code == TSDB_CODE_SUCCESS) && (nOptrWithVal == 0)) { - taosMemoryFreeClear(*pOutput); - *len = 0; - } - return code; +// int32_t code = encodeOperator(pTaskInfo->pRoot, pOutput, len, &nOptrWithVal); +// if ((code == TSDB_CODE_SUCCESS) && (nOptrWithVal == 0)) { +// taosMemoryFreeClear(*pOutput); +// *len = 0; +// } + return 0; } int32_t qDeserializeTaskStatus(qTaskInfo_t tinfo, const char* pInput, int32_t len) { @@ -743,7 +743,8 @@ int32_t qDeserializeTaskStatus(qTaskInfo_t tinfo, const char* pInput, int32_t le return TSDB_CODE_INVALID_PARA; } - return decodeOperator(pTaskInfo->pRoot, pInput, len); + return 0; +// return decodeOperator(pTaskInfo->pRoot, pInput, len); } int32_t qExtractStreamScanner(qTaskInfo_t tinfo, void** scanner) { diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 5eaa8ba8dd..5abde1be85 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1335,7 +1335,7 @@ void doBuildResultDatablock(SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SG } } -void queryCostStatis(SExecTaskInfo* pTaskInfo) { +void printTaskExecCostInLog(SExecTaskInfo* pTaskInfo) { STaskCostInfo* pSummary = &pTaskInfo->cost; SFileBlockLoadRecorder* pRecorder = pSummary->pRecoder; @@ -1958,7 +1958,7 @@ void cleanupAggSup(SAggSupporter* pAggSup) { destroyDiskbasedBuf(pAggSup->pResultBuf); } -int32_t initAggInfo(SExprSupp* pSup, SAggSupporter* pAggSup, SExprInfo* pExprInfo, int32_t numOfCols, size_t keyBufSize, +int32_t initAggSup(SExprSupp* pSup, SAggSupporter* pAggSup, SExprInfo* pExprInfo, int32_t numOfCols, size_t keyBufSize, const char* pkey) { int32_t code = initExprSupp(pSup, pExprInfo, numOfCols); if (code != TSDB_CODE_SUCCESS) { @@ -2056,7 +2056,7 @@ SOperatorInfo* createAggregateOperatorInfo(SOperatorInfo* downstream, SAggPhysiN int32_t num = 0; SExprInfo* pExprInfo = createExprInfo(pAggNode->pAggFuncs, pAggNode->pGroupKeys, &num); - int32_t code = initAggInfo(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); + int32_t code = initAggSup(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -2734,103 +2734,6 @@ int32_t rebuildReader(SOperatorInfo* pOperator, SSubplan* plan, SReadHandle* pHa } #endif -int32_t encodeOperator(SOperatorInfo* ops, char** result, int32_t* length, int32_t* nOptrWithVal) { - int32_t code = TDB_CODE_SUCCESS; - char* pCurrent = NULL; - int32_t currLength = 0; - if (ops->fpSet.encodeResultRow) { - if (result == NULL || length == NULL || nOptrWithVal == NULL) { - return TSDB_CODE_TSC_INVALID_INPUT; - } - code = ops->fpSet.encodeResultRow(ops, &pCurrent, &currLength); - - if (code != TDB_CODE_SUCCESS) { - if (*result != NULL) { - taosMemoryFree(*result); - *result = NULL; - } - return code; - } else if (currLength == 0) { - ASSERT(!pCurrent); - goto _downstream; - } - - ++(*nOptrWithVal); - - ASSERT(currLength >= 0); - - if (*result == NULL) { - *result = (char*)taosMemoryCalloc(1, currLength + sizeof(int32_t)); - if (*result == NULL) { - taosMemoryFree(pCurrent); - return TSDB_CODE_OUT_OF_MEMORY; - } - memcpy(*result + sizeof(int32_t), pCurrent, currLength); - *(int32_t*)(*result) = currLength + sizeof(int32_t); - } else { - int32_t sizePre = *(int32_t*)(*result); - char* tmp = (char*)taosMemoryRealloc(*result, sizePre + currLength); - if (tmp == NULL) { - taosMemoryFree(pCurrent); - taosMemoryFree(*result); - *result = NULL; - return TSDB_CODE_OUT_OF_MEMORY; - } - *result = tmp; - memcpy(*result + sizePre, pCurrent, currLength); - *(int32_t*)(*result) += currLength; - } - taosMemoryFree(pCurrent); - *length = *(int32_t*)(*result); - } - -_downstream: - for (int32_t i = 0; i < ops->numOfDownstream; ++i) { - code = encodeOperator(ops->pDownstream[i], result, length, nOptrWithVal); - if (code != TDB_CODE_SUCCESS) { - return code; - } - } - return TDB_CODE_SUCCESS; -} - -int32_t decodeOperator(SOperatorInfo* ops, const char* result, int32_t length) { - int32_t code = TDB_CODE_SUCCESS; - if (ops->fpSet.decodeResultRow) { - if (result == NULL) { - return TSDB_CODE_TSC_INVALID_INPUT; - } - - ASSERT(length == *(int32_t*)result); - - const char* data = result + sizeof(int32_t); - code = ops->fpSet.decodeResultRow(ops, (char*)data); - if (code != TDB_CODE_SUCCESS) { - return code; - } - - int32_t totalLength = *(int32_t*)result; - int32_t dataLength = *(int32_t*)data; - - if (totalLength == dataLength + sizeof(int32_t)) { // the last data - result = NULL; - length = 0; - } else { - result += dataLength; - *(int32_t*)(result) = totalLength - dataLength; - length = totalLength - dataLength; - } - } - - for (int32_t i = 0; i < ops->numOfDownstream; ++i) { - code = decodeOperator(ops->pDownstream[i], result, length); - if (code != TDB_CODE_SUCCESS) { - return code; - } - } - return TDB_CODE_SUCCESS; -} - int32_t createDataSinkParam(SDataSinkNode* pNode, void** pParam, qTaskInfo_t* pTaskInfo, SReadHandle* readHandle) { SExecTaskInfo* pTask = *(SExecTaskInfo**)pTaskInfo; diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index bbf9bd2a27..6dc8818900 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -456,7 +456,7 @@ SOperatorInfo* createGroupOperatorInfo(SOperatorInfo* downstream, SAggPhysiNode* int32_t num = 0; SExprInfo* pExprInfo = createExprInfo(pAggNode->pAggFuncs, pAggNode->pGroupKeys, &num); - code = initAggInfo(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, pInfo->groupKeyLen, pTaskInfo->id.str); + code = initAggSup(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, pInfo->groupKeyLen, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c index 819997c521..4bba3a72e1 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -102,7 +102,7 @@ SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhys } initResultSizeInfo(&pOperator->resultInfo, numOfRows); - code = initAggInfo(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); + code = initAggSup(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -400,7 +400,7 @@ SOperatorInfo* createIndefinitOutputOperatorInfo(SOperatorInfo* downstream, SPhy initResultSizeInfo(&pOperator->resultInfo, numOfRows); blockDataEnsureCapacity(pResBlock, numOfRows); - int32_t code = initAggInfo(pSup, &pInfo->aggSup, pExprInfo, numOfExpr, keyBufSize, pTaskInfo->id.str); + int32_t code = initAggSup(pSup, &pInfo->aggSup, pExprInfo, numOfExpr, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 80c3c1c454..0e0ec5b339 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -1741,7 +1741,7 @@ SOperatorInfo* createIntervalOperatorInfo(SOperatorInfo* downstream, SIntervalPh int32_t num = 0; SExprInfo* pExprInfo = createExprInfo(pPhyNode->window.pFuncs, NULL, &num); - int32_t code = initAggInfo(pSup, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); + int32_t code = initAggSup(pSup, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -2001,7 +2001,7 @@ SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SStateWi SExprInfo* pExprInfo = createExprInfo(pStateNode->window.pFuncs, NULL, &num); initResultSizeInfo(&pOperator->resultInfo, 4096); - code = initAggInfo(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); + code = initAggSup(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -2069,7 +2069,7 @@ SOperatorInfo* createSessionAggOperatorInfo(SOperatorInfo* downstream, SSessionW SSDataBlock* pResBlock = createDataBlockFromDescNode(pSessionNode->window.node.pOutputDataBlockDesc); initBasicInfo(&pInfo->binfo, pResBlock); - int32_t code = initAggInfo(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); + int32_t code = initAggSup(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -2243,26 +2243,6 @@ static void clearSpecialDataBlock(SSDataBlock* pBlock) { blockDataCleanup(pBlock); } -void copyUpdateDataBlock(SSDataBlock* pDest, SSDataBlock* pSource, int32_t tsColIndex) { - // ASSERT(pDest->info.capacity >= pSource->info.rows); - blockDataEnsureCapacity(pDest, pSource->info.rows); - clearSpecialDataBlock(pDest); - SColumnInfoData* pDestCol = taosArrayGet(pDest->pDataBlock, 0); - SColumnInfoData* pSourceCol = taosArrayGet(pSource->pDataBlock, tsColIndex); - - // copy timestamp column - colDataAssign(pDestCol, pSourceCol, pSource->info.rows, &pDest->info); - for (int32_t i = 1; i < taosArrayGetSize(pDest->pDataBlock); i++) { - SColumnInfoData* pCol = taosArrayGet(pDest->pDataBlock, i); - colDataAppendNNULL(pCol, 0, pSource->info.rows); - } - - pDest->info.rows = pSource->info.rows; - pDest->info.groupId = pSource->info.groupId; - pDest->info.type = pSource->info.type; - blockDataUpdateTsWindow(pDest, 0); -} - static void doBuildPullDataBlock(SArray* array, int32_t* pIndex, SSDataBlock* pBlock) { clearSpecialDataBlock(pBlock); int32_t size = taosArrayGetSize(array); @@ -2707,7 +2687,7 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, SSDataBlock* pResBlock = createDataBlockFromDescNode(pPhyNode->pOutputDataBlockDesc); initBasicInfo(&pInfo->binfo, pResBlock); - int32_t code = initAggInfo(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); + int32_t code = initAggSup(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -4346,7 +4326,7 @@ SOperatorInfo* createMergeAlignedIntervalOperatorInfo(SOperatorInfo* downstream, int32_t num = 0; SExprInfo* pExprInfo = createExprInfo(pNode->window.pFuncs, NULL, &num); - code = initAggInfo(&pOperator->exprSupp, &iaInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); + code = initAggSup(&pOperator->exprSupp, &iaInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -4651,7 +4631,7 @@ SOperatorInfo* createMergeIntervalOperatorInfo(SOperatorInfo* downstream, SMerge size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; initResultSizeInfo(&pOperator->resultInfo, 4096); - int32_t code = initAggInfo(pExprSupp, &pIntervalInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); + int32_t code = initAggSup(pExprSupp, &pIntervalInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -4847,7 +4827,7 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys initResultSizeInfo(&pOperator->resultInfo, 4096); size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; - code = initAggInfo(pSup, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); + code = initAggSup(pSup, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -4901,3 +4881,4 @@ _error: pTaskInfo->code = code; return NULL; } + From bdfef853e5ca6d797e1d33fc85fbef3eaf1aa0a2 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Mon, 28 Nov 2022 09:37:56 +0800 Subject: [PATCH 13/23] fix: memory leak --- source/dnode/vnode/src/tq/tqExec.c | 2 +- source/dnode/vnode/src/tq/tqOffset.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c index 3887f72740..8108be0730 100644 --- a/source/dnode/vnode/src/tq/tqExec.c +++ b/source/dnode/vnode/src/tq/tqExec.c @@ -299,7 +299,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SSubmitReq* pReq, STaosxRsp taosArrayDestroyP(pSchemas, (FDelete)tDeleteSSchemaWrapper); pBlocks = taosArrayInit(0, sizeof(SSDataBlock)); pSchemas = taosArrayInit(0, sizeof(void*)); - return -1; + continue; } } if (pHandle->fetchMeta) { diff --git a/source/dnode/vnode/src/tq/tqOffset.c b/source/dnode/vnode/src/tq/tqOffset.c index a7f816bb1b..dd56c165fd 100644 --- a/source/dnode/vnode/src/tq/tqOffset.c +++ b/source/dnode/vnode/src/tq/tqOffset.c @@ -61,6 +61,7 @@ int32_t tqOffsetRestoreFromFile(STqOffsetStore* pStore, const char* fname) { ASSERT(0); // TODO } + taosMemoryFree(memBuf); } taosCloseFile(&pFile); From 11071348248979d75eefc6a00906d82626121869 Mon Sep 17 00:00:00 2001 From: wade zhang <95411902+gccgdb1234@users.noreply.github.com> Date: Mon, 28 Nov 2022 09:53:28 +0800 Subject: [PATCH 14/23] Update 10-function.md --- docs/zh/12-taos-sql/10-function.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/12-taos-sql/10-function.md b/docs/zh/12-taos-sql/10-function.md index 68c7fe6f30..a8a1edc9a6 100644 --- a/docs/zh/12-taos-sql/10-function.md +++ b/docs/zh/12-taos-sql/10-function.md @@ -1249,4 +1249,4 @@ SELECT SERVER_VERSION(); SELECT SERVER_STATUS(); ``` -**说明**:返回服务端当前的状态。 +**说明**:检测服务端是否所有 dnode 都在线,如果是则返回成功,否则返回无法建立连接的错误。 From 099b80906fc605fa72588fcf86a059fa8f254a57 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 28 Nov 2022 11:19:02 +0800 Subject: [PATCH 15/23] test: adjust cluster case for asan mode --- tests/parallel_test/cases.task | 72 +++++++++---------- tests/pytest/util/dnodes.py | 3 + tests/system-test/0-others/udf_cluster.py | 2 + tests/system-test/6-cluster/5dnode1mnode.py | 3 + .../system-test/6-cluster/5dnode3mnodeDrop.py | 2 + .../6-cluster/5dnode3mnodeDropInsert.py | 2 + .../6-cluster/5dnode3mnodeStopInsert.py | 2 + 7 files changed, 50 insertions(+), 36 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 1b554f928c..7dacb2369e 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -90,7 +90,7 @@ ,,y,script,./test.sh -f tsim/parser/auto_create_tb.sim ,,y,script,./test.sh -f tsim/parser/between_and.sim ,,y,script,./test.sh -f tsim/parser/binary_escapeCharacter.sim -,,y,script,./test.sh -f tsim/parser/col_arithmetic_operation.sim +,,y,script,./test.sh -f tsim/parser/col_arithmetic_operation.sim ,,y,script,./test.sh -f tsim/parser/columnValue_bigint.sim ,,y,script,./test.sh -f tsim/parser/columnValue_bool.sim ,,y,script,./test.sh -f tsim/parser/columnValue_double.sim @@ -633,41 +633,41 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/csum.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_diff.py ,,n,system-test,python3 ./test.py -f 2-query/queryQnode.py -,,,system-test,python3 ./test.py -f 6-cluster/5dnode1mnode.py -,,,system-test,python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 -i False -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 -i False -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 6 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 6 -M 3 -n 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 6 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 6 -M 3 -n 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 6 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 6 -M 3 -n 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 6 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 6 -M 3 -n 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 6 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 6 -M 3 -n 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 6 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 6 -M 3 -n 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 6 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 6 -M 3 -n 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 6 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 6 -M 3 -n 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 -n 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode1mnode.py +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 -i False +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 -i False +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 6 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 6 -M 3 -n 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 6 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 6 -M 3 -n 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 6 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 6 -M 3 -n 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 6 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 6 -M 3 -n 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 6 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 6 -M 3 -n 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 6 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 6 -M 3 -n 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 6 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 6 -M 3 -n 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 6 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 6 -M 3 -n 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 -n 3 ,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeRecreateMnode.py -N 5 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStopFollowerLeader.py -N 5 -M 3 -,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 -,,,system-test,python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_createDb_replica1.py -N 4 -M 1 -,,,system-test,python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas.py -N 4 -M 1 -,,,system-test,python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas_querys.py -N 4 -M 1 -,,,system-test,python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas.py -N 4 -M 1 -,,,system-test,python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py -N 4 -M 1 -,,,system-test,python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py -N 4 -M 1 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRecreateMnode.py -N 5 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStopFollowerLeader.py -N 5 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_createDb_replica1.py -N 4 -M 1 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas.py -N 4 -M 1 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas_querys.py -N 4 -M 1 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas.py -N 4 -M 1 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py -N 4 -M 1 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py -N 4 -M 1 ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/create_wrong_topic.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dropDbR3ConflictTransaction.py -N 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/basic5.py @@ -729,7 +729,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqSubscribeStb-r3.py -N 5 ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3 -n 3 -,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distinct.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/varchar.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ltrim.py -Q 2 diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py index ee09130368..6c71c5cea7 100644 --- a/tests/pytest/util/dnodes.py +++ b/tests/pytest/util/dnodes.py @@ -823,5 +823,8 @@ class TDDnodes: def addSimExtraCfg(self, option, value): self.sim.addExtraCfg(option, value) + def getAsan(self): + return self.asan + tdDnodes = TDDnodes() diff --git a/tests/system-test/0-others/udf_cluster.py b/tests/system-test/0-others/udf_cluster.py index 90b6df16ff..9253be4ea3 100644 --- a/tests/system-test/0-others/udf_cluster.py +++ b/tests/system-test/0-others/udf_cluster.py @@ -259,6 +259,8 @@ class TDTestCase: self.TDDnodes.init("") self.TDDnodes.setTestCluster(testCluster) self.TDDnodes.setValgrind(valgrind) + + self.TDDnodes.setAsan(tdDnodes.getAsan()) self.TDDnodes.stopAll() for dnode in self.TDDnodes.dnodes: self.TDDnodes.deploy(dnode.index,{}) diff --git a/tests/system-test/6-cluster/5dnode1mnode.py b/tests/system-test/6-cluster/5dnode1mnode.py index f2c0bf9902..b576b37a4d 100644 --- a/tests/system-test/6-cluster/5dnode1mnode.py +++ b/tests/system-test/6-cluster/5dnode1mnode.py @@ -7,6 +7,7 @@ import os from util.log import * from util.sql import * from util.cases import * +from util.dnodes import * from util.dnodes import TDDnodes from util.dnodes import TDDnode import time @@ -68,6 +69,8 @@ class TDTestCase: self.TDDnodes.init("") self.TDDnodes.setTestCluster(testCluster) self.TDDnodes.setValgrind(valgrind) + + self.TDDnodes.setAsan(tdDnodes.getAsan()) self.TDDnodes.stopAll() for dnode in self.TDDnodes.dnodes: self.TDDnodes.deploy(dnode.index,{}) diff --git a/tests/system-test/6-cluster/5dnode3mnodeDrop.py b/tests/system-test/6-cluster/5dnode3mnodeDrop.py index 73c19b8cea..76684f36ae 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeDrop.py +++ b/tests/system-test/6-cluster/5dnode3mnodeDrop.py @@ -94,6 +94,8 @@ class TDTestCase: self.TDDnodes.init("") self.TDDnodes.setTestCluster(testCluster) self.TDDnodes.setValgrind(valgrind) + + self.TDDnodes.setAsan(tdDnodes.getAsan()) self.TDDnodes.stopAll() for dnode in self.TDDnodes.dnodes: self.TDDnodes.deploy(dnode.index,{}) diff --git a/tests/system-test/6-cluster/5dnode3mnodeDropInsert.py b/tests/system-test/6-cluster/5dnode3mnodeDropInsert.py index 2b013704f2..01d08ee839 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeDropInsert.py +++ b/tests/system-test/6-cluster/5dnode3mnodeDropInsert.py @@ -159,6 +159,8 @@ class TDTestCase: self.TDDnodes.init("") self.TDDnodes.setTestCluster(testCluster) self.TDDnodes.setValgrind(valgrind) + + self.TDDnodes.setAsan(tdDnodes.getAsan()) self.TDDnodes.stopAll() for dnode in self.TDDnodes.dnodes: self.TDDnodes.deploy(dnode.index,{}) diff --git a/tests/system-test/6-cluster/5dnode3mnodeStopInsert.py b/tests/system-test/6-cluster/5dnode3mnodeStopInsert.py index 780255604d..d08ce79a9b 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeStopInsert.py +++ b/tests/system-test/6-cluster/5dnode3mnodeStopInsert.py @@ -117,6 +117,8 @@ class TDTestCase: self.TDDnodes.init("") self.TDDnodes.setTestCluster(testCluster) self.TDDnodes.setValgrind(valgrind) + + self.TDDnodes.setAsan(tdDnodes.getAsan()) self.TDDnodes.stopAll() for dnode in self.TDDnodes.dnodes: self.TDDnodes.deploy(dnode.index,{}) From f34e166f490c42ed13163d58d3dde755eb3c622b Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Mon, 28 Nov 2022 11:22:11 +0800 Subject: [PATCH 16/23] fix: select null error --- source/libs/command/src/command.c | 24 +- source/libs/parser/inc/sql.y | 2 +- source/libs/parser/src/parCalcConst.c | 32 +- source/libs/parser/src/sql.c | 2743 ++++++++++++------------- 4 files changed, 1372 insertions(+), 1429 deletions(-) diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c index 64fec145ef..d58c4dc6d3 100644 --- a/source/libs/command/src/command.c +++ b/source/libs/command/src/command.c @@ -270,10 +270,10 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, S "CREATE DATABASE `%s` BUFFER %d CACHESIZE %d CACHEMODEL '%s' COMP %d DURATION %dm " "WAL_FSYNC_PERIOD %d MAXROWS %d MINROWS %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d " "STRICT '%s' WAL_LEVEL %d VGROUPS %d SINGLE_STABLE %d", - dbFName, pCfg->buffer, pCfg->cacheSize, cacheModelStr(pCfg->cacheLast), pCfg->compression, pCfg->daysPerFile, pCfg->walFsyncPeriod, - pCfg->maxRows, pCfg->minRows, pCfg->daysToKeep0, pCfg->daysToKeep1, pCfg->daysToKeep2, pCfg->pages, - pCfg->pageSize, prec, pCfg->replications, strictStr(pCfg->strict), pCfg->walLevel, pCfg->numOfVgroups, - 1 == pCfg->numOfStables); + dbFName, pCfg->buffer, pCfg->cacheSize, cacheModelStr(pCfg->cacheLast), pCfg->compression, pCfg->daysPerFile, + pCfg->walFsyncPeriod, pCfg->maxRows, pCfg->minRows, pCfg->daysToKeep0, pCfg->daysToKeep1, pCfg->daysToKeep2, + pCfg->pages, pCfg->pageSize, prec, pCfg->replications, strictStr(pCfg->strict), pCfg->walLevel, + pCfg->numOfVgroups, 1 == pCfg->numOfStables); if (retentions) { len += sprintf(buf2 + VARSTR_HEADER_SIZE + len, " RETENTIONS %s", retentions); @@ -500,8 +500,8 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, SDbCfgInfo* p terrno = TSDB_CODE_TSC_OUT_OF_MEMORY; return terrno; } - - int32_t len = 0; + + int32_t len = 0; if (TSDB_SUPER_TABLE == pCfg->tableType) { len += sprintf(buf2 + VARSTR_HEADER_SIZE, "CREATE STABLE `%s` (", tbName); @@ -533,7 +533,7 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, SDbCfgInfo* p colDataAppend(pCol2, 0, buf2, false); taosMemoryFree(buf2); - + return TSDB_CODE_SUCCESS; } @@ -691,9 +691,15 @@ static int32_t createSelectResultDataBlock(SNodeList* pProjects, SSDataBlock** p SNode* pProj = NULL; FOREACH(pProj, pProjects) { + SExprNode* pExpr = (SExprNode*)pProj; SColumnInfoData infoData = {0}; - infoData.info.type = ((SExprNode*)pProj)->resType.type; - infoData.info.bytes = ((SExprNode*)pProj)->resType.bytes; + if (TSDB_DATA_TYPE_NULL == pExpr->resType.type) { + infoData.info.type = TSDB_DATA_TYPE_VARCHAR; + infoData.info.bytes = 0; + } else { + infoData.info.type = pExpr->resType.type; + infoData.info.bytes = pExpr->resType.bytes; + } blockDataAppendColInfo(pBlock, &infoData); } *pOutput = pBlock; diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index ec5bb765db..eb4f834096 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -654,7 +654,7 @@ cgroup_name(A) ::= NK_ID(B). /************************************************ expression **********************************************************/ expr_or_subquery(A) ::= expression(B). { A = B; } -expr_or_subquery(A) ::= subquery(B). { A = B; } +//expr_or_subquery(A) ::= subquery(B). { A = createTempTableNode(pCxt, releaseRawExprNode(pCxt, B), NULL); } expression(A) ::= literal(B). { A = B; } expression(A) ::= pseudo_column(B). { A = B; } diff --git a/source/libs/parser/src/parCalcConst.c b/source/libs/parser/src/parCalcConst.c index efc9d77e67..d0d58ee038 100644 --- a/source/libs/parser/src/parCalcConst.c +++ b/source/libs/parser/src/parCalcConst.c @@ -372,14 +372,42 @@ static bool isEmptyResultQuery(SNode* pStmt) { return isEmptyResult; } +static void resetProjectNullTypeImpl(SNodeList* pProjects) { + SNode* pProj = NULL; + FOREACH(pProj, pProjects) { + SExprNode* pExpr = (SExprNode*)pProj; + if (TSDB_DATA_TYPE_NULL == pExpr->resType.type) { + pExpr->resType.type = TSDB_DATA_TYPE_VARCHAR; + pExpr->resType.bytes = 0; + } + } +} + +static void resetProjectNullType(SNode* pStmt) { + switch (nodeType(pStmt)) { + case QUERY_NODE_SELECT_STMT: + resetProjectNullTypeImpl(((SSelectStmt*)pStmt)->pProjectionList); + break; + case QUERY_NODE_SET_OPERATOR: { + resetProjectNullTypeImpl(((SSetOperator*)pStmt)->pProjectionList); + break; + } + default: + break; + } +} + int32_t calculateConstant(SParseContext* pParseCxt, SQuery* pQuery) { SCalcConstContext cxt = {.pParseCxt = pParseCxt, .msgBuf.buf = pParseCxt->pMsg, .msgBuf.len = pParseCxt->msgLen, .code = TSDB_CODE_SUCCESS}; int32_t code = calcConstQuery(&cxt, pQuery->pRoot, false); - if (TSDB_CODE_SUCCESS == code && isEmptyResultQuery(pQuery->pRoot)) { - pQuery->execMode = QUERY_EXEC_MODE_EMPTY_RESULT; + if (TSDB_CODE_SUCCESS == code) { + resetProjectNullType(pQuery->pRoot); + if (isEmptyResultQuery(pQuery->pRoot)) { + pQuery->execMode = QUERY_EXEC_MODE_EMPTY_RESULT; + } } return code; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index a8044fa848..cfca98d191 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 705 -#define YYNRULE 536 +#define YYNSTATE 704 +#define YYNRULE 535 #define YYNTOKEN 319 -#define YY_MAX_SHIFT 704 -#define YY_MIN_SHIFTREDUCE 1046 -#define YY_MAX_SHIFTREDUCE 1581 -#define YY_ERROR_ACTION 1582 -#define YY_ACCEPT_ACTION 1583 -#define YY_NO_ACTION 1584 -#define YY_MIN_REDUCE 1585 -#define YY_MAX_REDUCE 2120 +#define YY_MAX_SHIFT 703 +#define YY_MIN_SHIFTREDUCE 1044 +#define YY_MAX_SHIFTREDUCE 1578 +#define YY_ERROR_ACTION 1579 +#define YY_ACCEPT_ACTION 1580 +#define YY_NO_ACTION 1581 +#define YY_MIN_REDUCE 1582 +#define YY_MAX_REDUCE 2116 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,821 +216,733 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (3135) +#define YY_ACTTAB_COUNT (2619) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 454, 1936, 455, 1620, 1832, 168, 363, 594, 556, 1783, - /* 10 */ 1785, 556, 44, 42, 462, 182, 455, 1620, 1790, 1922, - /* 20 */ 358, 121, 1362, 1585, 52, 326, 329, 1836, 492, 453, - /* 30 */ 1918, 1954, 457, 1442, 1788, 1360, 1819, 134, 1738, 611, - /* 40 */ 158, 1738, 95, 1727, 1904, 1691, 610, 120, 119, 118, - /* 50 */ 117, 116, 115, 114, 113, 112, 129, 1437, 513, 1914, - /* 60 */ 1920, 346, 17, 1079, 1730, 582, 62, 344, 597, 1368, - /* 70 */ 612, 604, 1388, 523, 1970, 156, 122, 99, 357, 1937, - /* 80 */ 614, 1939, 1940, 609, 1740, 604, 1096, 225, 1095, 40, - /* 90 */ 39, 38, 2023, 439, 2091, 1, 321, 2019, 271, 2031, - /* 100 */ 593, 516, 592, 1083, 1084, 2091, 510, 2091, 397, 581, - /* 110 */ 174, 224, 34, 274, 2092, 583, 1097, 701, 1608, 403, - /* 120 */ 581, 174, 581, 174, 538, 2092, 583, 2092, 583, 37, - /* 130 */ 36, 1444, 1445, 43, 41, 40, 39, 38, 58, 234, - /* 140 */ 47, 1390, 556, 46, 44, 42, 1512, 597, 64, 190, - /* 150 */ 189, 63, 358, 2091, 1362, 179, 58, 58, 317, 1418, - /* 160 */ 1427, 1904, 508, 507, 506, 1442, 1165, 1360, 2097, 174, - /* 170 */ 128, 502, 1738, 2092, 583, 501, 500, 58, 1363, 82, - /* 180 */ 1361, 499, 505, 1247, 1248, 420, 1790, 498, 1387, 1437, - /* 190 */ 597, 37, 36, 345, 17, 43, 41, 40, 39, 38, - /* 200 */ 1167, 1368, 1788, 1366, 1367, 1586, 1417, 1420, 1421, 1422, - /* 210 */ 1423, 1424, 1425, 1426, 606, 602, 1435, 1436, 1438, 1439, - /* 220 */ 1440, 1441, 1443, 1446, 3, 78, 111, 1, 541, 110, - /* 230 */ 109, 108, 107, 106, 105, 104, 103, 102, 396, 127, - /* 240 */ 395, 316, 177, 1385, 538, 1784, 1785, 1387, 1733, 701, - /* 250 */ 433, 111, 65, 444, 110, 109, 108, 107, 106, 105, - /* 260 */ 104, 103, 102, 1444, 1445, 46, 2096, 1790, 542, 582, - /* 270 */ 417, 471, 445, 2091, 362, 419, 44, 42, 343, 1548, - /* 280 */ 1607, 1847, 250, 1788, 358, 177, 1362, 177, 2097, 174, - /* 290 */ 177, 1418, 1427, 2092, 583, 2091, 1388, 1442, 2091, 1360, - /* 300 */ 73, 37, 36, 177, 177, 43, 41, 40, 39, 38, - /* 310 */ 1363, 2095, 1361, 581, 174, 2092, 2094, 330, 2092, 583, - /* 320 */ 572, 1437, 58, 1904, 177, 1387, 17, 1299, 1300, 407, - /* 330 */ 13, 12, 159, 1368, 1597, 1366, 1367, 233, 1417, 1420, - /* 340 */ 1421, 1422, 1423, 1424, 1425, 1426, 606, 602, 1435, 1436, - /* 350 */ 1438, 1439, 1440, 1441, 1443, 1446, 3, 443, 577, 1, - /* 360 */ 438, 437, 436, 435, 432, 431, 430, 429, 428, 424, - /* 370 */ 423, 422, 421, 331, 414, 413, 412, 81, 409, 408, - /* 380 */ 328, 701, 37, 36, 1371, 371, 43, 41, 40, 39, - /* 390 */ 38, 212, 1096, 170, 1095, 1444, 1445, 461, 2096, 392, - /* 400 */ 457, 538, 361, 578, 573, 163, 1777, 211, 44, 42, - /* 410 */ 156, 488, 484, 480, 476, 209, 358, 26, 1362, 1740, - /* 420 */ 394, 390, 1097, 1418, 1427, 1485, 30, 2091, 647, 1442, - /* 430 */ 2091, 1360, 37, 36, 226, 1583, 43, 41, 40, 39, - /* 440 */ 38, 78, 1363, 2095, 1361, 2097, 174, 2092, 2093, 364, - /* 450 */ 2092, 583, 79, 1437, 1954, 207, 1386, 156, 17, 1538, - /* 460 */ 504, 503, 576, 1578, 1734, 1368, 1740, 1366, 1367, 177, - /* 470 */ 1417, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 606, 602, - /* 480 */ 1435, 1436, 1438, 1439, 1440, 1441, 1443, 1446, 3, 522, - /* 490 */ 11, 1, 80, 319, 1083, 1084, 546, 2096, 544, 373, - /* 500 */ 1606, 594, 520, 575, 518, 2038, 370, 569, 1536, 1537, - /* 510 */ 1539, 1540, 1516, 701, 1389, 538, 645, 526, 1387, 239, - /* 520 */ 206, 200, 538, 205, 459, 1605, 467, 1444, 1445, 1374, - /* 530 */ 1385, 134, 2035, 538, 1716, 147, 146, 642, 641, 640, - /* 540 */ 44, 42, 198, 1904, 2091, 556, 1604, 168, 358, 1715, - /* 550 */ 1362, 2091, 558, 639, 1995, 1418, 1427, 1577, 401, 2097, - /* 560 */ 174, 1442, 2091, 1360, 2092, 583, 2097, 174, 1904, 1837, - /* 570 */ 132, 2092, 583, 1452, 1363, 1738, 1361, 2097, 174, 1387, - /* 580 */ 1339, 1340, 2092, 583, 1713, 1437, 1389, 1729, 1603, 1904, - /* 590 */ 1571, 596, 172, 2031, 2032, 471, 2036, 1368, 1918, 1366, - /* 600 */ 1367, 1602, 1417, 1420, 1421, 1422, 1423, 1424, 1425, 1426, - /* 610 */ 606, 602, 1435, 1436, 1438, 1439, 1440, 1441, 1443, 1446, - /* 620 */ 3, 186, 1601, 8, 11, 1850, 9, 1914, 1920, 37, - /* 630 */ 36, 1904, 11, 43, 41, 40, 39, 38, 1473, 604, - /* 640 */ 32, 1600, 88, 1891, 1904, 701, 37, 36, 672, 670, - /* 650 */ 43, 41, 40, 39, 38, 273, 645, 1419, 75, 1444, - /* 660 */ 1445, 74, 37, 36, 1731, 1904, 43, 41, 40, 39, - /* 670 */ 38, 2038, 44, 42, 1447, 147, 146, 642, 641, 640, - /* 680 */ 358, 1923, 1362, 322, 1904, 1936, 556, 1418, 1427, 1790, - /* 690 */ 380, 645, 1918, 1442, 556, 1360, 37, 36, 2034, 402, - /* 700 */ 43, 41, 40, 39, 38, 1789, 1363, 411, 1361, 31, - /* 710 */ 147, 146, 642, 641, 640, 1954, 1738, 1437, 1419, 1478, - /* 720 */ 1368, 1914, 1920, 598, 1738, 1471, 659, 273, 1904, 1368, - /* 730 */ 610, 1366, 1367, 604, 1417, 1420, 1421, 1422, 1423, 1424, - /* 740 */ 1425, 1426, 606, 602, 1435, 1436, 1438, 1439, 1440, 1441, - /* 750 */ 1443, 1446, 3, 1509, 1934, 8, 1599, 145, 1970, 1596, - /* 760 */ 1832, 98, 1935, 1937, 614, 1939, 1940, 609, 1714, 604, - /* 770 */ 177, 184, 227, 334, 171, 1768, 2023, 701, 1595, 1472, - /* 780 */ 351, 2019, 37, 36, 1528, 1594, 43, 41, 40, 39, - /* 790 */ 38, 1444, 1445, 176, 43, 41, 40, 39, 38, 1904, - /* 800 */ 556, 2049, 1904, 556, 44, 42, 1832, 560, 2038, 1995, - /* 810 */ 51, 556, 358, 425, 1362, 155, 121, 188, 556, 1418, - /* 820 */ 1427, 1904, 1390, 497, 426, 1442, 2095, 1360, 1904, 647, - /* 830 */ 1738, 469, 556, 1738, 335, 2033, 333, 332, 1363, 494, - /* 840 */ 1361, 1738, 1390, 496, 1846, 470, 312, 1387, 1738, 1437, - /* 850 */ 33, 355, 1466, 1467, 1468, 1469, 1470, 1474, 1475, 1476, - /* 860 */ 1477, 1368, 1738, 1366, 1367, 495, 1417, 1420, 1421, 1422, - /* 870 */ 1423, 1424, 1425, 1426, 606, 602, 1435, 1436, 1438, 1439, - /* 880 */ 1440, 1441, 1443, 1446, 3, 240, 241, 8, 1205, 636, - /* 890 */ 635, 634, 1209, 633, 1211, 1212, 632, 1214, 629, 1593, - /* 900 */ 1220, 626, 1222, 1223, 623, 620, 542, 156, 556, 701, - /* 910 */ 1592, 2043, 1505, 556, 1922, 1845, 1741, 312, 404, 1848, - /* 920 */ 7, 1735, 1591, 1444, 1445, 1918, 139, 660, 556, 1708, - /* 930 */ 1590, 405, 1589, 1588, 556, 45, 44, 42, 1738, 48, - /* 940 */ 4, 534, 1904, 1738, 358, 319, 1362, 539, 546, 556, - /* 950 */ 544, 1418, 1427, 1904, 1914, 1920, 352, 1442, 1738, 1360, - /* 960 */ 1652, 556, 244, 183, 1738, 1904, 604, 496, 643, 238, - /* 970 */ 1363, 1781, 1361, 1904, 552, 1904, 1904, 130, 533, 1738, - /* 980 */ 1994, 1437, 644, 249, 286, 1781, 1419, 1768, 1310, 495, - /* 990 */ 586, 1738, 1508, 1368, 1723, 1366, 1367, 1936, 1417, 1420, - /* 1000 */ 1421, 1422, 1423, 1424, 1425, 1426, 606, 602, 1435, 1436, - /* 1010 */ 1438, 1439, 1440, 1441, 1443, 1446, 3, 556, 140, 1, - /* 1020 */ 137, 123, 242, 556, 508, 507, 506, 1954, 594, 589, - /* 1030 */ 554, 217, 128, 502, 215, 598, 555, 501, 500, 556, - /* 1040 */ 1904, 701, 610, 499, 505, 219, 1639, 1738, 218, 498, - /* 1050 */ 144, 221, 275, 1738, 220, 1444, 1445, 223, 134, 556, - /* 1060 */ 222, 145, 50, 60, 254, 60, 1934, 537, 509, 1738, - /* 1070 */ 1970, 549, 365, 98, 1935, 1937, 614, 1939, 1940, 609, - /* 1080 */ 1370, 604, 585, 1418, 1427, 1649, 171, 1632, 2023, 1738, - /* 1090 */ 1630, 601, 351, 2019, 1580, 1581, 2096, 132, 94, 13, - /* 1100 */ 12, 45, 1363, 246, 1361, 1725, 1721, 230, 91, 511, - /* 1110 */ 605, 638, 514, 2050, 1198, 2063, 1535, 257, 1479, 173, - /* 1120 */ 2031, 2032, 1505, 2036, 1692, 268, 1598, 1366, 1367, 1925, - /* 1130 */ 1417, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 606, 602, - /* 1140 */ 1435, 1436, 1438, 1439, 1440, 1441, 1443, 1446, 3, 678, - /* 1150 */ 677, 676, 675, 368, 1428, 674, 673, 135, 668, 667, - /* 1160 */ 666, 665, 664, 663, 662, 661, 149, 657, 656, 655, - /* 1170 */ 367, 366, 652, 651, 650, 649, 648, 157, 1927, 570, - /* 1180 */ 45, 618, 292, 144, 1936, 145, 124, 144, 1362, 1571, - /* 1190 */ 653, 654, 1125, 1626, 210, 262, 290, 67, 594, 1955, - /* 1200 */ 66, 1360, 369, 1841, 1621, 1778, 2053, 595, 587, 270, - /* 1210 */ 267, 5, 1145, 1143, 1954, 2, 379, 194, 450, 448, - /* 1220 */ 1326, 327, 611, 374, 282, 1373, 1126, 1904, 134, 610, - /* 1230 */ 187, 406, 1463, 285, 1226, 1368, 1230, 1390, 1237, 1235, - /* 1240 */ 148, 696, 1842, 415, 410, 1385, 441, 427, 1834, 590, - /* 1250 */ 434, 447, 440, 1934, 58, 442, 446, 1970, 191, 449, - /* 1260 */ 98, 1935, 1937, 614, 1939, 1940, 609, 132, 604, 451, - /* 1270 */ 1391, 131, 452, 143, 1994, 2023, 1393, 460, 463, 351, - /* 1280 */ 2019, 1392, 464, 701, 197, 199, 465, 1394, 468, 175, - /* 1290 */ 2031, 2032, 97, 2036, 466, 1936, 202, 204, 472, 76, - /* 1300 */ 77, 208, 1099, 489, 490, 491, 493, 1728, 214, 1724, - /* 1310 */ 1881, 216, 100, 318, 525, 527, 283, 228, 528, 529, - /* 1320 */ 340, 150, 151, 231, 535, 1954, 1726, 540, 1722, 72, - /* 1330 */ 71, 400, 152, 611, 181, 153, 550, 235, 1904, 85, - /* 1340 */ 610, 568, 543, 284, 1363, 87, 1361, 571, 2045, 580, - /* 1350 */ 1936, 6, 315, 1880, 532, 388, 1852, 386, 382, 378, - /* 1360 */ 375, 372, 565, 141, 1934, 547, 342, 2054, 1970, 1366, - /* 1370 */ 1367, 98, 1935, 1937, 614, 1939, 1940, 609, 551, 604, - /* 1380 */ 1954, 564, 566, 142, 2111, 1739, 2023, 252, 611, 2064, - /* 1390 */ 351, 2019, 567, 1904, 562, 610, 347, 256, 574, 348, - /* 1400 */ 2057, 177, 563, 591, 2114, 1505, 1936, 588, 266, 133, - /* 1410 */ 1389, 57, 2004, 2069, 89, 616, 1782, 1709, 697, 1934, - /* 1420 */ 700, 287, 278, 1970, 698, 264, 98, 1935, 1937, 614, - /* 1430 */ 1939, 1940, 609, 2068, 604, 2039, 1954, 311, 49, 2111, - /* 1440 */ 299, 2023, 164, 263, 611, 351, 2019, 261, 310, 1904, - /* 1450 */ 289, 610, 309, 291, 265, 2085, 1898, 1897, 69, 1896, - /* 1460 */ 2090, 1936, 1895, 70, 1892, 376, 377, 1354, 1355, 180, - /* 1470 */ 269, 381, 1890, 383, 384, 1934, 385, 1889, 387, 1970, - /* 1480 */ 1936, 1888, 98, 1935, 1937, 614, 1939, 1940, 609, 389, - /* 1490 */ 604, 1954, 1887, 391, 1886, 2111, 393, 2023, 1329, 611, - /* 1500 */ 1328, 351, 2019, 1863, 1904, 1862, 610, 398, 399, 1861, - /* 1510 */ 1954, 2042, 1860, 1290, 1827, 1826, 1824, 136, 611, 1823, - /* 1520 */ 1822, 1825, 1821, 1904, 1820, 610, 1818, 1817, 1816, 185, - /* 1530 */ 612, 416, 1815, 418, 1970, 1814, 1813, 301, 357, 1937, - /* 1540 */ 614, 1939, 1940, 609, 1812, 604, 1811, 1810, 1809, 1934, - /* 1550 */ 1808, 1807, 1806, 1970, 1805, 1804, 98, 1935, 1937, 614, - /* 1560 */ 1939, 1940, 609, 1803, 604, 1802, 1801, 2091, 1173, 1998, - /* 1570 */ 1800, 2023, 138, 1799, 1798, 351, 2019, 1936, 1797, 1796, - /* 1580 */ 354, 353, 581, 174, 1795, 1794, 1292, 2092, 583, 1086, - /* 1590 */ 1376, 1793, 1792, 1791, 1654, 192, 1653, 193, 1936, 1651, - /* 1600 */ 1617, 1442, 169, 1369, 195, 1616, 125, 1954, 126, 1085, - /* 1610 */ 1876, 1870, 1859, 203, 1858, 611, 196, 456, 458, 201, - /* 1620 */ 1904, 1844, 610, 1717, 1118, 1437, 1650, 1648, 1954, 474, - /* 1630 */ 1646, 1644, 473, 477, 478, 482, 611, 1368, 1642, 481, - /* 1640 */ 475, 1904, 479, 610, 485, 483, 1934, 487, 1629, 486, - /* 1650 */ 1970, 1628, 1613, 98, 1935, 1937, 614, 1939, 1940, 609, - /* 1660 */ 1719, 604, 59, 1241, 1240, 1718, 1996, 1934, 2023, 1164, - /* 1670 */ 1163, 1970, 351, 2019, 98, 1935, 1937, 614, 1939, 1940, - /* 1680 */ 609, 1162, 604, 1936, 1161, 600, 669, 559, 213, 2023, - /* 1690 */ 1160, 1155, 1157, 351, 2019, 1640, 671, 1156, 1154, 336, - /* 1700 */ 1633, 337, 1631, 512, 338, 515, 1612, 1611, 517, 519, - /* 1710 */ 1610, 521, 101, 1954, 1346, 25, 1875, 53, 1335, 1869, - /* 1720 */ 154, 611, 1857, 530, 1855, 1856, 1904, 18, 610, 237, - /* 1730 */ 1851, 1344, 2096, 1854, 1853, 545, 243, 1843, 531, 1343, - /* 1740 */ 83, 86, 84, 248, 232, 91, 1377, 15, 1372, 646, - /* 1750 */ 536, 339, 1934, 27, 19, 20, 1970, 1550, 56, 99, - /* 1760 */ 1935, 1937, 614, 1939, 1940, 609, 1454, 604, 1936, 245, - /* 1770 */ 10, 1380, 1382, 251, 2023, 259, 253, 548, 2022, 2019, - /* 1780 */ 1532, 255, 1453, 602, 1435, 1436, 1438, 1439, 1440, 1441, - /* 1790 */ 1534, 260, 1925, 162, 258, 29, 61, 22, 1954, 21, - /* 1800 */ 28, 1565, 1564, 349, 1527, 1570, 611, 1569, 90, 1568, - /* 1810 */ 1571, 1904, 350, 610, 1502, 272, 1501, 1924, 55, 165, - /* 1820 */ 12, 1378, 1464, 1973, 1936, 166, 178, 1432, 1410, 613, - /* 1830 */ 603, 617, 1430, 35, 1171, 1429, 14, 1934, 23, 360, - /* 1840 */ 1402, 1970, 621, 24, 99, 1935, 1937, 614, 1939, 1940, - /* 1850 */ 609, 1227, 604, 1936, 1954, 615, 54, 619, 622, 2023, - /* 1860 */ 1224, 16, 608, 599, 2019, 624, 1221, 1904, 627, 610, - /* 1870 */ 1219, 625, 630, 1204, 1215, 1218, 628, 1217, 1213, 631, - /* 1880 */ 1216, 92, 1936, 1954, 93, 1236, 68, 276, 1232, 1116, - /* 1890 */ 637, 611, 1151, 1934, 1150, 1149, 1904, 1970, 610, 1148, - /* 1900 */ 307, 1935, 1937, 614, 1939, 1940, 609, 607, 604, 557, - /* 1910 */ 1988, 1936, 1954, 1147, 1146, 1144, 1142, 1141, 1140, 658, - /* 1920 */ 611, 1138, 1934, 1137, 1136, 1904, 1970, 610, 277, 160, - /* 1930 */ 1935, 1937, 614, 1939, 1940, 609, 1135, 604, 1134, 1133, - /* 1940 */ 1132, 1954, 1131, 1168, 1166, 1128, 1127, 1124, 1123, 611, - /* 1950 */ 1122, 1934, 1121, 1647, 1904, 1970, 610, 679, 161, 1935, - /* 1960 */ 1937, 614, 1939, 1940, 609, 680, 604, 1645, 681, 683, - /* 1970 */ 561, 2060, 684, 1643, 685, 687, 689, 688, 1936, 1641, - /* 1980 */ 1934, 691, 693, 692, 1970, 1627, 695, 99, 1935, 1937, - /* 1990 */ 614, 1939, 1940, 609, 1936, 604, 1076, 1609, 280, 699, - /* 2000 */ 1584, 702, 2023, 1364, 288, 1584, 703, 2020, 1954, 1584, - /* 2010 */ 584, 2112, 1584, 341, 1584, 1584, 611, 1584, 1584, 1584, - /* 2020 */ 1584, 1904, 1584, 610, 1954, 1584, 1584, 1584, 1584, 1584, - /* 2030 */ 1584, 1584, 608, 1584, 1584, 1584, 1584, 1904, 1584, 610, - /* 2040 */ 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1934, 1584, 1936, - /* 2050 */ 1584, 1970, 1584, 1584, 308, 1935, 1937, 614, 1939, 1940, - /* 2060 */ 609, 1584, 604, 1934, 1584, 1584, 1584, 1970, 1584, 1936, - /* 2070 */ 307, 1935, 1937, 614, 1939, 1940, 609, 1584, 604, 1954, - /* 2080 */ 1989, 1584, 1584, 1584, 1584, 1584, 1584, 611, 1584, 1584, - /* 2090 */ 1584, 1584, 1904, 1584, 610, 1584, 1584, 1584, 1584, 1954, - /* 2100 */ 1584, 1584, 1584, 1584, 1584, 1584, 1584, 611, 1584, 1584, - /* 2110 */ 1584, 1584, 1904, 1584, 610, 1584, 1584, 1584, 1934, 1584, - /* 2120 */ 1584, 1584, 1970, 1584, 1584, 160, 1935, 1937, 614, 1939, - /* 2130 */ 1940, 609, 1584, 604, 1936, 1584, 1584, 1584, 1934, 1584, - /* 2140 */ 1584, 1584, 1970, 1584, 1584, 303, 1935, 1937, 614, 1939, - /* 2150 */ 1940, 609, 1584, 604, 1584, 1584, 1584, 1584, 1584, 1584, - /* 2160 */ 1584, 1584, 1584, 1584, 1954, 1584, 1584, 2061, 1584, 1584, - /* 2170 */ 1584, 1584, 611, 1584, 1584, 1584, 1584, 1904, 1584, 610, - /* 2180 */ 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 579, - /* 2190 */ 1584, 1584, 1936, 1584, 1584, 1584, 1584, 1584, 1584, 1584, - /* 2200 */ 1584, 1584, 1584, 1934, 1584, 1584, 1936, 1970, 1584, 1584, - /* 2210 */ 161, 1935, 1937, 614, 1939, 1940, 609, 1584, 604, 1584, - /* 2220 */ 1584, 1584, 1954, 1584, 1584, 1584, 1584, 356, 1584, 1584, - /* 2230 */ 611, 1584, 1584, 1584, 1584, 1904, 1954, 610, 1584, 1584, - /* 2240 */ 1584, 359, 1584, 1584, 611, 1584, 1584, 1584, 1584, 1904, - /* 2250 */ 1584, 610, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, - /* 2260 */ 1584, 1934, 1584, 2113, 1936, 1970, 1584, 1584, 308, 1935, - /* 2270 */ 1937, 614, 1939, 1940, 609, 1934, 604, 1584, 1936, 1970, - /* 2280 */ 1584, 1584, 308, 1935, 1937, 614, 1939, 1940, 609, 1584, - /* 2290 */ 604, 1584, 1584, 1584, 1954, 1584, 1584, 1584, 1584, 1584, - /* 2300 */ 1584, 1584, 611, 1584, 1584, 1584, 1584, 1904, 1954, 610, - /* 2310 */ 1584, 1584, 1584, 1584, 1584, 1584, 611, 1584, 1584, 1584, - /* 2320 */ 1584, 1904, 1584, 610, 1584, 1584, 1584, 1584, 1584, 1584, - /* 2330 */ 1584, 1936, 1584, 524, 1584, 1584, 1584, 1970, 1584, 1584, - /* 2340 */ 301, 1935, 1937, 614, 1939, 1940, 609, 1934, 604, 1584, - /* 2350 */ 1584, 1970, 1584, 1584, 293, 1935, 1937, 614, 1939, 1940, - /* 2360 */ 609, 1954, 604, 1584, 1584, 1584, 1584, 1584, 1584, 611, - /* 2370 */ 1584, 1584, 1584, 1584, 1904, 1584, 610, 1584, 1584, 1584, - /* 2380 */ 1584, 1584, 1584, 1584, 1584, 1584, 1936, 1584, 1584, 1584, - /* 2390 */ 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, - /* 2400 */ 1934, 1584, 1936, 1584, 1970, 1584, 1584, 294, 1935, 1937, - /* 2410 */ 614, 1939, 1940, 609, 1584, 604, 1954, 1584, 1584, 1584, - /* 2420 */ 1584, 1584, 1584, 1584, 611, 1584, 1584, 1584, 1584, 1904, - /* 2430 */ 1584, 610, 1954, 1584, 1584, 1584, 1584, 1584, 1584, 1584, - /* 2440 */ 611, 1584, 1584, 1584, 1584, 1904, 1584, 610, 1584, 1584, - /* 2450 */ 1584, 1584, 1584, 1584, 1584, 1934, 1584, 1936, 1584, 1970, - /* 2460 */ 1584, 1584, 295, 1935, 1937, 614, 1939, 1940, 609, 1584, - /* 2470 */ 604, 1934, 1584, 1936, 1584, 1970, 1584, 1584, 302, 1935, - /* 2480 */ 1937, 614, 1939, 1940, 609, 1584, 604, 1954, 1584, 1584, - /* 2490 */ 1584, 1584, 1584, 1584, 1584, 611, 1584, 1584, 1584, 1584, - /* 2500 */ 1904, 1584, 610, 1954, 1584, 1584, 1584, 1584, 1584, 1584, - /* 2510 */ 1584, 611, 1584, 1584, 1584, 1584, 1904, 1584, 610, 1584, - /* 2520 */ 1584, 1584, 1584, 1584, 1584, 1584, 1934, 1584, 1584, 1936, - /* 2530 */ 1970, 1584, 1584, 304, 1935, 1937, 614, 1939, 1940, 609, - /* 2540 */ 1584, 604, 1934, 1584, 1584, 1936, 1970, 1584, 1584, 296, - /* 2550 */ 1935, 1937, 614, 1939, 1940, 609, 1584, 604, 1584, 1954, - /* 2560 */ 1584, 1584, 1584, 1584, 1584, 1584, 1584, 611, 1584, 1584, - /* 2570 */ 1584, 1584, 1904, 1584, 610, 1954, 1584, 1584, 1584, 1584, - /* 2580 */ 1584, 1584, 1584, 611, 1584, 1584, 1584, 1584, 1904, 1584, - /* 2590 */ 610, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1934, 1584, - /* 2600 */ 1584, 1936, 1970, 1584, 1584, 305, 1935, 1937, 614, 1939, - /* 2610 */ 1940, 609, 1584, 604, 1934, 1584, 1584, 1936, 1970, 1584, - /* 2620 */ 1584, 297, 1935, 1937, 614, 1939, 1940, 609, 1584, 604, - /* 2630 */ 1584, 1954, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 611, - /* 2640 */ 1584, 1584, 1584, 1584, 1904, 1584, 610, 1954, 1584, 1584, - /* 2650 */ 1584, 1584, 1584, 1584, 1584, 611, 1584, 1584, 1584, 1584, - /* 2660 */ 1904, 1584, 610, 1584, 1584, 1584, 1584, 1584, 1584, 1584, - /* 2670 */ 1934, 1584, 1584, 1584, 1970, 1584, 1584, 306, 1935, 1937, - /* 2680 */ 614, 1939, 1940, 609, 1936, 604, 1934, 1584, 1584, 1584, - /* 2690 */ 1970, 1584, 1584, 298, 1935, 1937, 614, 1939, 1940, 609, - /* 2700 */ 1584, 604, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1936, - /* 2710 */ 1584, 1584, 1584, 1584, 1954, 1584, 1584, 1584, 1584, 1584, - /* 2720 */ 1584, 1584, 611, 1584, 1584, 1584, 1584, 1904, 1584, 610, - /* 2730 */ 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1954, - /* 2740 */ 1584, 1584, 1584, 1584, 1584, 1584, 1584, 611, 1584, 1584, - /* 2750 */ 1584, 1584, 1904, 1934, 610, 1584, 1584, 1970, 1584, 1584, - /* 2760 */ 313, 1935, 1937, 614, 1939, 1940, 609, 704, 604, 1584, - /* 2770 */ 1936, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1934, 1584, - /* 2780 */ 1584, 281, 1970, 1584, 1584, 314, 1935, 1937, 614, 1939, - /* 2790 */ 1940, 609, 1584, 604, 1584, 167, 1584, 1584, 1584, 1584, - /* 2800 */ 1954, 694, 690, 686, 682, 279, 1584, 1584, 611, 1584, - /* 2810 */ 1584, 1584, 1584, 1904, 1584, 610, 1584, 1584, 1584, 1584, - /* 2820 */ 1584, 1584, 1584, 1936, 1584, 1584, 1584, 1584, 1584, 1584, - /* 2830 */ 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1934, - /* 2840 */ 1584, 1936, 96, 1970, 1584, 247, 1948, 1935, 1937, 614, - /* 2850 */ 1939, 1940, 609, 1954, 604, 1584, 1584, 1584, 1584, 1584, - /* 2860 */ 1584, 611, 1584, 1584, 1584, 1584, 1904, 1584, 610, 1584, - /* 2870 */ 1584, 1954, 1584, 1584, 1584, 1584, 1584, 1584, 553, 611, - /* 2880 */ 1584, 1584, 1584, 1584, 1904, 1584, 610, 1584, 1584, 1584, - /* 2890 */ 1584, 1584, 1934, 1584, 1584, 1584, 1970, 1936, 1584, 1947, - /* 2900 */ 1935, 1937, 614, 1939, 1940, 609, 1584, 604, 1584, 1584, - /* 2910 */ 1934, 1936, 1584, 236, 1970, 1584, 1584, 1946, 1935, 1937, - /* 2920 */ 614, 1939, 1940, 609, 1584, 604, 1584, 1954, 1584, 1584, - /* 2930 */ 1333, 1584, 229, 1584, 1584, 611, 1584, 1584, 1584, 1584, - /* 2940 */ 1904, 1954, 610, 1584, 1584, 1584, 1584, 1584, 1584, 611, - /* 2950 */ 1584, 1584, 1584, 1584, 1904, 1584, 610, 1584, 1584, 1584, - /* 2960 */ 1584, 1584, 1584, 1584, 1584, 1584, 1934, 1936, 1584, 1584, - /* 2970 */ 1970, 1584, 1584, 323, 1935, 1937, 614, 1939, 1940, 609, - /* 2980 */ 1934, 604, 1584, 1936, 1970, 1584, 1584, 324, 1935, 1937, - /* 2990 */ 614, 1939, 1940, 609, 1584, 604, 1584, 1954, 1584, 1584, - /* 3000 */ 1584, 1584, 1584, 1584, 1584, 611, 1584, 1584, 1584, 1584, - /* 3010 */ 1904, 1584, 610, 1954, 1584, 1584, 1584, 1584, 1584, 1584, - /* 3020 */ 1584, 611, 1584, 1584, 1584, 1584, 1904, 1584, 610, 1584, - /* 3030 */ 1584, 1584, 1584, 1584, 1584, 1584, 1934, 1584, 1584, 1584, - /* 3040 */ 1970, 1584, 1584, 320, 1935, 1937, 614, 1939, 1940, 609, - /* 3050 */ 1936, 604, 1934, 1584, 1584, 1584, 1970, 1584, 1584, 325, - /* 3060 */ 1935, 1937, 614, 1939, 1940, 609, 1584, 604, 1584, 1584, - /* 3070 */ 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, - /* 3080 */ 1954, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 611, 1584, - /* 3090 */ 1584, 1584, 1584, 1904, 1584, 610, 1584, 1584, 1584, 1584, - /* 3100 */ 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, - /* 3110 */ 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1934, - /* 3120 */ 1584, 1584, 1584, 1970, 1584, 1584, 300, 1935, 1937, 614, - /* 3130 */ 1939, 1940, 609, 1584, 604, + /* 0 */ 2034, 453, 1932, 454, 1617, 576, 158, 461, 1919, 454, + /* 10 */ 1617, 1688, 43, 41, 1509, 348, 1847, 557, 1844, 1915, + /* 20 */ 357, 2087, 1360, 36, 35, 1932, 2031, 42, 40, 39, + /* 30 */ 38, 37, 1950, 1439, 2092, 1358, 556, 174, 1386, 95, + /* 40 */ 572, 2088, 558, 1385, 168, 1901, 1077, 609, 1911, 1917, + /* 50 */ 340, 1387, 2092, 132, 593, 1950, 2087, 1434, 1094, 603, + /* 60 */ 1093, 1727, 16, 610, 1649, 329, 1833, 121, 1901, 1366, + /* 70 */ 609, 1931, 2091, 211, 491, 1966, 2088, 2090, 98, 1933, + /* 80 */ 613, 1935, 1936, 608, 1735, 603, 1081, 1082, 1095, 592, + /* 90 */ 171, 592, 2019, 62, 1931, 12, 351, 2015, 1966, 349, + /* 100 */ 1605, 98, 1933, 613, 1935, 1936, 608, 156, 603, 58, + /* 110 */ 176, 134, 1604, 143, 1990, 2019, 1737, 700, 2045, 351, + /* 120 */ 2015, 42, 40, 39, 38, 37, 593, 1568, 507, 506, + /* 130 */ 505, 1441, 1442, 39, 38, 37, 128, 501, 593, 121, + /* 140 */ 438, 500, 499, 1901, 43, 41, 496, 498, 504, 1245, + /* 150 */ 1246, 52, 357, 497, 1360, 1901, 1735, 1932, 362, 1415, + /* 160 */ 1424, 1780, 1782, 2091, 46, 1439, 111, 1358, 1735, 110, + /* 170 */ 109, 108, 107, 106, 105, 104, 103, 102, 1361, 159, + /* 180 */ 1359, 1594, 1297, 1298, 58, 1575, 402, 1950, 1726, 1434, + /* 190 */ 470, 395, 257, 394, 16, 572, 190, 189, 646, 1915, + /* 200 */ 1901, 1366, 609, 1364, 1365, 1603, 1414, 1417, 1418, 1419, + /* 210 */ 1420, 1421, 1422, 1423, 605, 601, 1432, 1433, 1435, 1436, + /* 220 */ 1437, 1438, 1440, 1443, 2, 317, 1931, 12, 1911, 1917, + /* 230 */ 1966, 33, 274, 98, 1933, 613, 1935, 1936, 608, 603, + /* 240 */ 603, 316, 552, 1383, 1385, 171, 168, 2019, 1901, 700, + /* 250 */ 432, 351, 2015, 443, 36, 35, 177, 78, 42, 40, + /* 260 */ 39, 38, 37, 1441, 1442, 258, 1388, 1919, 1834, 1386, + /* 270 */ 416, 127, 444, 2046, 1920, 418, 43, 41, 1915, 1574, + /* 280 */ 1730, 507, 506, 505, 357, 1915, 1360, 1888, 58, 128, + /* 290 */ 501, 1415, 1424, 569, 500, 499, 360, 1439, 1163, 1358, + /* 300 */ 498, 504, 592, 58, 156, 83, 497, 1911, 1917, 352, + /* 310 */ 1361, 177, 1359, 1737, 1911, 1917, 458, 330, 603, 58, + /* 320 */ 363, 1434, 1383, 131, 1513, 603, 16, 1385, 156, 406, + /* 330 */ 1385, 177, 1165, 1366, 379, 1364, 1365, 1737, 1414, 1417, + /* 340 */ 1418, 1419, 1420, 1421, 1422, 1423, 605, 601, 1432, 1433, + /* 350 */ 1435, 1436, 1437, 1438, 1440, 1443, 2, 442, 9, 12, + /* 360 */ 437, 436, 435, 434, 431, 430, 429, 428, 427, 423, + /* 370 */ 422, 421, 420, 331, 413, 412, 411, 46, 408, 407, + /* 380 */ 328, 700, 571, 172, 2027, 2028, 1449, 129, 2032, 1384, + /* 390 */ 593, 212, 1385, 36, 35, 1441, 1442, 42, 40, 39, + /* 400 */ 38, 37, 2092, 179, 593, 163, 2087, 235, 43, 41, + /* 410 */ 1444, 487, 483, 479, 475, 209, 357, 400, 1360, 560, + /* 420 */ 1735, 2034, 2091, 1415, 1424, 547, 2088, 2089, 25, 1439, + /* 430 */ 1787, 1358, 1582, 1787, 1735, 177, 638, 350, 1787, 1712, + /* 440 */ 361, 9, 1361, 7, 1359, 326, 1785, 2030, 47, 1785, + /* 450 */ 177, 9, 79, 1434, 1785, 207, 120, 119, 118, 117, + /* 460 */ 116, 115, 114, 113, 112, 1366, 177, 1364, 1365, 1416, + /* 470 */ 1414, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 605, 601, + /* 480 */ 1432, 1433, 1435, 1436, 1437, 1438, 1440, 1443, 2, 11, + /* 490 */ 10, 44, 1781, 1782, 265, 266, 512, 36, 35, 1950, + /* 500 */ 1602, 42, 40, 39, 38, 37, 593, 551, 553, 548, + /* 510 */ 557, 522, 452, 700, 2087, 456, 391, 264, 1366, 401, + /* 520 */ 206, 200, 1094, 205, 1093, 225, 466, 1441, 1442, 556, + /* 530 */ 174, 1416, 593, 658, 2088, 558, 1735, 393, 389, 515, + /* 540 */ 43, 41, 198, 1901, 509, 410, 644, 550, 357, 224, + /* 550 */ 1360, 322, 1095, 1932, 319, 1415, 1424, 582, 569, 580, + /* 560 */ 593, 1439, 1735, 1358, 593, 147, 146, 641, 640, 639, + /* 570 */ 595, 569, 1991, 424, 1361, 1470, 1359, 425, 1337, 1338, + /* 580 */ 503, 502, 1601, 1950, 1482, 1434, 64, 186, 131, 63, + /* 590 */ 1735, 607, 1535, 1468, 1735, 177, 1901, 1366, 609, 1364, + /* 600 */ 1365, 131, 1414, 1417, 1418, 1419, 1420, 1421, 1422, 1423, + /* 610 */ 605, 601, 1432, 1433, 1435, 1436, 1437, 1438, 1440, 1443, + /* 620 */ 2, 569, 1931, 44, 75, 1901, 1966, 74, 1724, 307, + /* 630 */ 1933, 613, 1935, 1936, 608, 606, 603, 594, 1984, 1387, + /* 640 */ 544, 1533, 1534, 1536, 1537, 700, 30, 1469, 173, 2027, + /* 650 */ 2028, 131, 129, 2032, 460, 133, 1475, 456, 1990, 1441, + /* 660 */ 1442, 255, 2027, 568, 1600, 122, 567, 1599, 593, 2087, + /* 670 */ 36, 35, 43, 41, 42, 40, 39, 38, 37, 593, + /* 680 */ 357, 364, 1360, 89, 556, 174, 576, 1415, 1424, 2088, + /* 690 */ 558, 227, 468, 1439, 1765, 1358, 36, 35, 1735, 1845, + /* 700 */ 42, 40, 39, 38, 37, 1728, 1361, 1901, 1359, 1735, + /* 710 */ 1901, 175, 2027, 2028, 1598, 129, 2032, 1434, 32, 355, + /* 720 */ 1463, 1464, 1465, 1466, 1467, 1471, 1472, 1473, 1474, 1366, + /* 730 */ 1720, 1364, 1365, 1932, 1414, 1417, 1418, 1419, 1420, 1421, + /* 740 */ 1422, 1423, 605, 601, 1432, 1433, 1435, 1436, 1437, 1438, + /* 750 */ 1440, 1443, 2, 1597, 29, 12, 170, 1901, 1545, 593, + /* 760 */ 36, 35, 78, 1950, 42, 40, 39, 38, 37, 1774, + /* 770 */ 1360, 610, 469, 593, 1506, 593, 1901, 700, 609, 1829, + /* 780 */ 257, 1596, 403, 1358, 1525, 1731, 1732, 31, 139, 1735, + /* 790 */ 182, 1441, 1442, 36, 35, 404, 1901, 42, 40, 39, + /* 800 */ 38, 37, 1931, 1735, 1829, 1735, 1966, 671, 669, 99, + /* 810 */ 1933, 613, 1935, 1936, 608, 184, 603, 1366, 1593, 1415, + /* 820 */ 1424, 1646, 521, 2019, 1901, 36, 35, 2018, 2015, 42, + /* 830 */ 40, 39, 38, 37, 597, 519, 1991, 517, 1361, 1722, + /* 840 */ 1359, 1203, 635, 634, 633, 1207, 632, 1209, 1210, 631, + /* 850 */ 1212, 628, 1718, 1218, 625, 1220, 1221, 622, 619, 230, + /* 860 */ 1843, 1901, 312, 1364, 1365, 700, 1414, 1417, 1418, 1419, + /* 870 */ 1420, 1421, 1422, 1423, 605, 601, 1432, 1433, 1435, 1436, + /* 880 */ 1437, 1438, 1440, 1443, 2, 677, 676, 675, 674, 367, + /* 890 */ 1385, 673, 672, 135, 667, 666, 665, 664, 663, 662, + /* 900 */ 661, 660, 149, 656, 655, 654, 366, 365, 651, 650, + /* 910 */ 649, 648, 647, 157, 593, 1713, 1592, 604, 292, 396, + /* 920 */ 1932, 1388, 1787, 1591, 1590, 1589, 1361, 533, 1359, 1588, + /* 930 */ 2034, 1587, 290, 67, 1586, 1842, 66, 312, 1786, 1585, + /* 940 */ 637, 36, 35, 1932, 1735, 42, 40, 39, 38, 37, + /* 950 */ 1950, 1364, 1365, 194, 449, 447, 2029, 593, 610, 1901, + /* 960 */ 537, 6, 593, 1901, 2087, 609, 1901, 1901, 1901, 1711, + /* 970 */ 573, 1388, 1901, 1950, 1901, 269, 470, 1901, 155, 2093, + /* 980 */ 174, 610, 1901, 1829, 2088, 558, 1901, 1735, 609, 1931, + /* 990 */ 58, 334, 1735, 1966, 188, 561, 98, 1933, 613, 1935, + /* 1000 */ 1936, 608, 156, 603, 593, 659, 642, 1705, 2107, 1778, + /* 1010 */ 2019, 1738, 1931, 1505, 351, 2015, 1966, 588, 1816, 98, + /* 1020 */ 1933, 613, 1935, 1936, 608, 2053, 603, 564, 97, 1416, + /* 1030 */ 646, 2107, 1710, 2019, 1735, 354, 353, 351, 2015, 643, + /* 1040 */ 226, 1932, 1778, 286, 532, 1374, 1765, 593, 2081, 1081, + /* 1050 */ 1082, 593, 335, 644, 333, 332, 1439, 493, 1367, 65, + /* 1060 */ 590, 495, 183, 495, 591, 72, 71, 399, 2039, 1502, + /* 1070 */ 181, 1950, 147, 146, 641, 640, 639, 1735, 1369, 610, + /* 1080 */ 1434, 1735, 1689, 494, 1901, 494, 609, 1636, 315, 48, + /* 1090 */ 3, 387, 1366, 385, 381, 377, 374, 371, 80, 319, + /* 1100 */ 1932, 233, 582, 593, 580, 137, 123, 73, 600, 508, + /* 1110 */ 1931, 145, 234, 60, 1966, 1595, 275, 98, 1933, 613, + /* 1120 */ 1935, 1936, 608, 1583, 603, 1577, 1578, 11, 10, 2107, + /* 1130 */ 1950, 2019, 239, 1735, 1629, 351, 2015, 177, 610, 644, + /* 1140 */ 599, 81, 1368, 1901, 111, 609, 2038, 110, 109, 108, + /* 1150 */ 107, 106, 105, 104, 103, 102, 510, 45, 147, 146, + /* 1160 */ 641, 640, 639, 1502, 51, 217, 1532, 419, 215, 1931, + /* 1170 */ 1627, 219, 221, 1966, 218, 220, 98, 1933, 613, 1935, + /* 1180 */ 1936, 608, 262, 603, 223, 241, 1932, 222, 1994, 652, + /* 1190 */ 2019, 50, 513, 140, 351, 2015, 536, 144, 145, 60, + /* 1200 */ 1123, 1375, 2059, 1370, 45, 1922, 653, 252, 1580, 545, + /* 1210 */ 1308, 1143, 210, 562, 246, 1932, 1950, 45, 617, 1951, + /* 1220 */ 144, 368, 145, 1372, 610, 124, 1378, 1380, 1141, 1901, + /* 1230 */ 144, 609, 1838, 1618, 1124, 267, 1775, 2049, 601, 1432, + /* 1240 */ 1433, 1435, 1436, 1437, 1438, 1950, 585, 565, 570, 1460, + /* 1250 */ 271, 1196, 1476, 610, 1924, 1931, 254, 1425, 1901, 1966, + /* 1260 */ 609, 251, 98, 1933, 613, 1935, 1936, 608, 1623, 603, + /* 1270 */ 285, 1224, 372, 1228, 1992, 1235, 2019, 1932, 1233, 94, + /* 1280 */ 351, 2015, 1, 148, 1931, 4, 378, 1371, 1966, 91, + /* 1290 */ 373, 98, 1933, 613, 1935, 1936, 608, 327, 603, 282, + /* 1300 */ 1324, 187, 405, 596, 1932, 2019, 1388, 1950, 414, 351, + /* 1310 */ 2015, 1839, 409, 537, 1383, 610, 695, 2087, 440, 426, + /* 1320 */ 1901, 1831, 609, 445, 446, 191, 448, 450, 439, 433, + /* 1330 */ 441, 1932, 2093, 174, 1950, 1389, 451, 2088, 558, 459, + /* 1340 */ 1391, 197, 610, 463, 1390, 199, 1931, 1901, 1932, 609, + /* 1350 */ 1966, 462, 464, 99, 1933, 613, 1935, 1936, 608, 1392, + /* 1360 */ 603, 1950, 465, 202, 204, 467, 76, 2019, 77, 610, + /* 1370 */ 471, 598, 2015, 611, 1901, 490, 609, 1966, 1950, 1097, + /* 1380 */ 99, 1933, 613, 1935, 1936, 608, 610, 603, 208, 488, + /* 1390 */ 489, 1901, 100, 609, 2019, 524, 575, 492, 321, 2015, + /* 1400 */ 1931, 1725, 1932, 318, 1966, 283, 214, 160, 1933, 613, + /* 1410 */ 1935, 1936, 608, 1721, 603, 1878, 216, 1931, 527, 546, + /* 1420 */ 534, 1966, 528, 150, 161, 1933, 613, 1935, 1936, 608, + /* 1430 */ 151, 603, 1950, 228, 1723, 1719, 152, 537, 153, 231, + /* 1440 */ 610, 2087, 526, 531, 2050, 1901, 579, 609, 538, 2056, + /* 1450 */ 370, 2065, 2060, 541, 2064, 5, 2093, 174, 1932, 543, + /* 1460 */ 341, 2088, 558, 549, 369, 555, 542, 540, 248, 237, + /* 1470 */ 240, 1931, 2041, 245, 539, 1966, 559, 2108, 99, 1933, + /* 1480 */ 613, 1935, 1936, 608, 342, 603, 250, 249, 1950, 164, + /* 1490 */ 566, 537, 2019, 247, 563, 2087, 610, 2016, 1502, 1387, + /* 1500 */ 130, 1901, 1932, 609, 345, 537, 2035, 141, 525, 2087, + /* 1510 */ 2093, 174, 2110, 574, 259, 2088, 558, 577, 1932, 142, + /* 1520 */ 586, 2086, 578, 1877, 2093, 174, 1736, 1931, 1849, 2088, + /* 1530 */ 558, 1966, 1950, 583, 160, 1933, 613, 1935, 1936, 608, + /* 1540 */ 610, 603, 253, 347, 86, 1901, 284, 609, 1950, 537, + /* 1550 */ 88, 57, 2000, 2087, 90, 1779, 610, 615, 1706, 278, + /* 1560 */ 696, 1901, 587, 609, 301, 697, 287, 699, 2093, 174, + /* 1570 */ 311, 1931, 291, 2088, 558, 1966, 2057, 49, 300, 1933, + /* 1580 */ 613, 1935, 1936, 608, 310, 603, 1932, 1931, 309, 289, + /* 1590 */ 1895, 1966, 1894, 69, 161, 1933, 613, 1935, 1936, 608, + /* 1600 */ 1893, 603, 1892, 1932, 70, 1889, 375, 376, 1352, 1353, + /* 1610 */ 180, 380, 1887, 382, 383, 384, 1950, 1886, 386, 1885, + /* 1620 */ 388, 346, 554, 1884, 610, 390, 1883, 1327, 392, 1901, + /* 1630 */ 1326, 609, 1860, 1950, 1859, 397, 398, 1858, 1857, 1824, + /* 1640 */ 1288, 607, 415, 136, 1820, 1819, 1901, 2109, 609, 1823, + /* 1650 */ 1821, 1822, 1818, 1817, 1815, 1931, 1814, 1932, 1813, 1966, + /* 1660 */ 185, 1812, 308, 1933, 613, 1935, 1936, 608, 417, 603, + /* 1670 */ 1811, 1810, 1931, 1932, 1809, 1808, 1966, 1807, 1806, 307, + /* 1680 */ 1933, 613, 1935, 1936, 608, 1805, 603, 1950, 1985, 1804, + /* 1690 */ 1803, 1802, 356, 1801, 1800, 610, 125, 138, 1796, 1795, + /* 1700 */ 1901, 1799, 609, 1950, 1798, 1797, 1794, 1793, 358, 1792, + /* 1710 */ 1290, 610, 169, 455, 1171, 1651, 1901, 1932, 609, 1791, + /* 1720 */ 1790, 1789, 1788, 192, 1650, 193, 1931, 1648, 1614, 195, + /* 1730 */ 1966, 1084, 1083, 308, 1933, 613, 1935, 1936, 608, 1613, + /* 1740 */ 603, 457, 1931, 196, 1932, 1873, 1966, 1950, 1867, 308, + /* 1750 */ 1933, 613, 1935, 1936, 608, 610, 603, 1856, 203, 1855, + /* 1760 */ 1901, 1841, 609, 1714, 126, 201, 1647, 1645, 472, 474, + /* 1770 */ 473, 1932, 1643, 1116, 1950, 476, 477, 478, 1641, 480, + /* 1780 */ 482, 481, 610, 485, 484, 486, 523, 1901, 1639, 609, + /* 1790 */ 1966, 1626, 1625, 303, 1933, 613, 1935, 1936, 608, 1610, + /* 1800 */ 603, 1950, 1716, 1239, 59, 1715, 1238, 1160, 1162, 610, + /* 1810 */ 213, 1161, 1159, 1931, 1901, 1932, 609, 1966, 668, 1153, + /* 1820 */ 293, 1933, 613, 1935, 1936, 608, 1637, 603, 1158, 670, + /* 1830 */ 1155, 1154, 1630, 1152, 336, 337, 511, 1628, 338, 514, + /* 1840 */ 1931, 1609, 516, 1608, 1966, 1950, 518, 294, 1933, 613, + /* 1850 */ 1935, 1936, 608, 610, 603, 1607, 520, 24, 1901, 1932, + /* 1860 */ 609, 1344, 101, 1872, 1333, 1866, 529, 154, 1854, 1852, + /* 1870 */ 2092, 17, 53, 14, 530, 26, 236, 232, 1547, 1932, + /* 1880 */ 61, 56, 243, 535, 1931, 238, 1531, 18, 1966, 1950, + /* 1890 */ 1524, 295, 1933, 613, 1935, 1936, 608, 610, 603, 244, + /* 1900 */ 28, 162, 1901, 339, 609, 1922, 15, 19, 1562, 1950, + /* 1910 */ 242, 1561, 27, 82, 343, 1567, 1568, 610, 1566, 1565, + /* 1920 */ 344, 1499, 1901, 1498, 609, 55, 256, 165, 1931, 1853, + /* 1930 */ 1851, 1850, 1966, 581, 1342, 299, 1933, 613, 1935, 1936, + /* 1940 */ 608, 20, 603, 261, 1932, 1529, 263, 1341, 1931, 1848, + /* 1950 */ 1840, 268, 1966, 84, 85, 304, 1933, 613, 1935, 1936, + /* 1960 */ 608, 87, 603, 1921, 1932, 584, 91, 273, 21, 10, + /* 1970 */ 270, 54, 1451, 1376, 1950, 1407, 1450, 8, 166, 178, + /* 1980 */ 614, 1969, 610, 1429, 602, 636, 1427, 1901, 34, 609, + /* 1990 */ 1426, 13, 22, 616, 1950, 359, 1399, 23, 620, 1225, + /* 2000 */ 618, 621, 610, 1461, 1222, 1219, 623, 1901, 612, 609, + /* 2010 */ 1213, 624, 626, 1931, 627, 629, 1211, 1966, 1932, 630, + /* 2020 */ 296, 1933, 613, 1935, 1936, 608, 1217, 603, 1202, 1216, + /* 2030 */ 1215, 92, 1214, 1931, 1932, 93, 1234, 1966, 68, 276, + /* 2040 */ 305, 1933, 613, 1935, 1936, 608, 1230, 603, 1950, 1114, + /* 2050 */ 645, 1149, 1148, 1147, 1146, 1145, 610, 1144, 1142, 1169, + /* 2060 */ 1140, 1901, 1139, 609, 1950, 1138, 657, 1136, 1135, 277, + /* 2070 */ 1134, 1133, 610, 1132, 1131, 1130, 1129, 1901, 1932, 609, + /* 2080 */ 1166, 1164, 1126, 1120, 1125, 1122, 1644, 1931, 1121, 1119, + /* 2090 */ 678, 1966, 679, 1642, 297, 1933, 613, 1935, 1936, 608, + /* 2100 */ 682, 603, 680, 1931, 1640, 1932, 683, 1966, 1950, 684, + /* 2110 */ 306, 1933, 613, 1935, 1936, 608, 610, 603, 686, 687, + /* 2120 */ 688, 1901, 1638, 609, 690, 691, 692, 1624, 1606, 694, + /* 2130 */ 1074, 280, 1932, 698, 701, 1950, 1362, 288, 702, 1581, + /* 2140 */ 1581, 1581, 1581, 610, 1581, 1581, 1581, 1931, 1901, 1581, + /* 2150 */ 609, 1966, 1581, 1581, 298, 1933, 613, 1935, 1936, 608, + /* 2160 */ 1581, 603, 1950, 1581, 1581, 1581, 1581, 1581, 1581, 1581, + /* 2170 */ 610, 1581, 1581, 1581, 1931, 1901, 1932, 609, 1966, 1581, + /* 2180 */ 1581, 313, 1933, 613, 1935, 1936, 608, 1581, 603, 1581, + /* 2190 */ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, + /* 2200 */ 1581, 1931, 1581, 1581, 1581, 1966, 1950, 1581, 314, 1933, + /* 2210 */ 613, 1935, 1936, 608, 610, 603, 1581, 1581, 1581, 1901, + /* 2220 */ 1932, 609, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, + /* 2230 */ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, + /* 2240 */ 1932, 1581, 1581, 1581, 1581, 1931, 1581, 1581, 1581, 1966, + /* 2250 */ 1950, 1581, 1944, 1933, 613, 1935, 1936, 608, 610, 603, + /* 2260 */ 1581, 1581, 1581, 1901, 1581, 609, 1581, 1581, 1581, 1581, + /* 2270 */ 1950, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 610, 1581, + /* 2280 */ 1581, 1581, 1581, 1901, 1581, 609, 1581, 1581, 1581, 1931, + /* 2290 */ 1581, 1581, 1581, 1966, 1581, 1581, 1943, 1933, 613, 1935, + /* 2300 */ 1936, 608, 1581, 603, 1581, 1932, 1581, 1581, 1581, 1931, + /* 2310 */ 1581, 1581, 1581, 1966, 1581, 1581, 1942, 1933, 613, 1935, + /* 2320 */ 1936, 608, 1581, 603, 1581, 1932, 1581, 1581, 1581, 1581, + /* 2330 */ 1581, 1581, 1581, 1581, 1581, 1950, 1581, 1581, 1581, 1581, + /* 2340 */ 1581, 1581, 1581, 610, 1581, 1581, 1581, 1581, 1901, 1581, + /* 2350 */ 609, 1581, 1581, 1581, 1581, 1950, 1581, 1581, 1581, 1581, + /* 2360 */ 1581, 1581, 1581, 610, 1581, 1581, 1581, 1581, 1901, 1581, + /* 2370 */ 609, 1581, 1581, 1581, 1931, 1581, 1581, 1581, 1966, 1932, + /* 2380 */ 1581, 323, 1933, 613, 1935, 1936, 608, 1581, 603, 1581, + /* 2390 */ 1581, 1581, 1581, 1581, 1931, 1932, 1581, 1581, 1966, 1581, + /* 2400 */ 1581, 324, 1933, 613, 1935, 1936, 608, 1581, 603, 1950, + /* 2410 */ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 610, 1581, 1581, + /* 2420 */ 1581, 1581, 1901, 1581, 609, 1950, 1581, 1581, 1581, 1581, + /* 2430 */ 1581, 1581, 1581, 610, 1581, 1581, 1581, 1581, 1901, 1932, + /* 2440 */ 609, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1931, 1581, + /* 2450 */ 1581, 1581, 1966, 703, 1581, 320, 1933, 613, 1935, 1936, + /* 2460 */ 608, 1581, 603, 1581, 1931, 1581, 1932, 281, 1966, 1950, + /* 2470 */ 1581, 325, 1933, 613, 1935, 1936, 608, 610, 603, 1581, + /* 2480 */ 1581, 167, 1901, 1581, 609, 1581, 1581, 693, 689, 685, + /* 2490 */ 681, 279, 1581, 1581, 1581, 1581, 1950, 1581, 1581, 1581, + /* 2500 */ 1581, 1581, 1581, 1581, 610, 1581, 1581, 1581, 611, 1901, + /* 2510 */ 1581, 609, 1966, 1581, 1581, 303, 1933, 613, 1935, 1936, + /* 2520 */ 608, 1581, 603, 1581, 1581, 1581, 1581, 1581, 96, 1581, + /* 2530 */ 1581, 272, 1581, 1581, 1581, 1931, 1581, 1581, 1581, 1966, + /* 2540 */ 1581, 1581, 302, 1933, 613, 1935, 1936, 608, 1581, 603, + /* 2550 */ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, + /* 2560 */ 1581, 1581, 1581, 1581, 589, 1581, 1581, 1581, 1581, 1581, + /* 2570 */ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, + /* 2580 */ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, + /* 2590 */ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 260, + /* 2600 */ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, + /* 2610 */ 1581, 1581, 1581, 1581, 1581, 1581, 1331, 1581, 229, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 326, 322, 328, 329, 360, 352, 363, 330, 330, 366, - /* 10 */ 367, 330, 12, 13, 326, 371, 328, 329, 352, 354, - /* 20 */ 20, 343, 22, 0, 343, 359, 373, 374, 350, 327, - /* 30 */ 365, 352, 330, 33, 368, 35, 0, 360, 360, 360, - /* 40 */ 336, 360, 333, 353, 365, 341, 367, 24, 25, 26, - /* 50 */ 27, 28, 29, 30, 31, 32, 347, 57, 4, 394, - /* 60 */ 395, 396, 62, 4, 355, 399, 4, 344, 20, 69, - /* 70 */ 391, 406, 20, 19, 395, 352, 399, 398, 399, 400, - /* 80 */ 401, 402, 403, 404, 361, 406, 20, 33, 22, 14, - /* 90 */ 15, 16, 413, 79, 428, 95, 417, 418, 421, 422, - /* 100 */ 423, 47, 425, 44, 45, 428, 52, 428, 383, 443, - /* 110 */ 444, 57, 414, 415, 448, 449, 50, 117, 322, 330, - /* 120 */ 443, 444, 443, 444, 399, 448, 449, 448, 449, 8, - /* 130 */ 9, 131, 132, 12, 13, 14, 15, 16, 95, 57, - /* 140 */ 95, 20, 330, 95, 12, 13, 14, 20, 94, 135, - /* 150 */ 136, 97, 20, 428, 22, 343, 95, 95, 369, 159, - /* 160 */ 160, 365, 64, 65, 66, 33, 35, 35, 443, 444, - /* 170 */ 72, 73, 360, 448, 449, 77, 78, 95, 178, 97, - /* 180 */ 180, 83, 84, 131, 132, 149, 352, 89, 20, 57, - /* 190 */ 20, 8, 9, 359, 62, 12, 13, 14, 15, 16, - /* 200 */ 69, 69, 368, 203, 204, 0, 206, 207, 208, 209, + /* 0 */ 397, 326, 322, 328, 329, 367, 336, 326, 354, 328, + /* 10 */ 329, 341, 12, 13, 14, 377, 0, 424, 380, 365, + /* 20 */ 20, 428, 22, 8, 9, 322, 423, 12, 13, 14, + /* 30 */ 15, 16, 352, 33, 3, 35, 443, 444, 20, 333, + /* 40 */ 360, 448, 449, 20, 352, 365, 4, 367, 394, 395, + /* 50 */ 396, 20, 424, 347, 330, 352, 428, 57, 20, 405, + /* 60 */ 22, 355, 62, 360, 0, 373, 374, 343, 365, 69, + /* 70 */ 367, 391, 444, 35, 350, 395, 448, 449, 398, 399, + /* 80 */ 400, 401, 402, 403, 360, 405, 44, 45, 50, 20, + /* 90 */ 410, 20, 412, 4, 391, 95, 416, 417, 395, 344, + /* 100 */ 322, 398, 399, 400, 401, 402, 403, 352, 405, 95, + /* 110 */ 430, 408, 322, 410, 411, 412, 361, 117, 438, 416, + /* 120 */ 417, 12, 13, 14, 15, 16, 330, 96, 64, 65, + /* 130 */ 66, 131, 132, 14, 15, 16, 72, 73, 330, 343, + /* 140 */ 79, 77, 78, 365, 12, 13, 350, 83, 84, 131, + /* 150 */ 132, 343, 20, 89, 22, 365, 360, 322, 363, 159, + /* 160 */ 160, 366, 367, 3, 95, 33, 21, 35, 360, 24, + /* 170 */ 25, 26, 27, 28, 29, 30, 31, 32, 178, 321, + /* 180 */ 180, 323, 159, 160, 95, 170, 330, 352, 354, 57, + /* 190 */ 61, 177, 161, 179, 62, 360, 135, 136, 61, 365, + /* 200 */ 365, 69, 367, 203, 204, 322, 206, 207, 208, 209, /* 210 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 220 */ 220, 221, 222, 223, 224, 335, 21, 95, 383, 24, - /* 230 */ 25, 26, 27, 28, 29, 30, 31, 32, 177, 349, - /* 240 */ 179, 18, 242, 20, 399, 366, 367, 20, 358, 117, - /* 250 */ 27, 21, 106, 30, 24, 25, 26, 27, 28, 29, - /* 260 */ 30, 31, 32, 131, 132, 95, 399, 352, 367, 399, - /* 270 */ 47, 61, 49, 428, 359, 52, 12, 13, 377, 96, - /* 280 */ 322, 380, 161, 368, 20, 242, 22, 242, 443, 444, - /* 290 */ 242, 159, 160, 448, 449, 428, 20, 33, 428, 35, - /* 300 */ 154, 8, 9, 242, 242, 12, 13, 14, 15, 16, - /* 310 */ 178, 444, 180, 443, 444, 448, 449, 94, 448, 449, - /* 320 */ 164, 57, 95, 365, 242, 20, 62, 159, 160, 106, - /* 330 */ 1, 2, 321, 69, 323, 203, 204, 57, 206, 207, + /* 220 */ 220, 221, 222, 223, 224, 369, 391, 95, 394, 395, + /* 230 */ 395, 413, 414, 398, 399, 400, 401, 402, 403, 405, + /* 240 */ 405, 18, 20, 20, 20, 410, 352, 412, 365, 117, + /* 250 */ 27, 416, 417, 30, 8, 9, 242, 335, 12, 13, + /* 260 */ 14, 15, 16, 131, 132, 57, 20, 354, 374, 20, + /* 270 */ 47, 349, 49, 438, 354, 52, 12, 13, 365, 264, + /* 280 */ 358, 64, 65, 66, 20, 365, 22, 0, 95, 72, + /* 290 */ 73, 159, 160, 330, 77, 78, 344, 33, 35, 35, + /* 300 */ 83, 84, 20, 95, 352, 97, 89, 394, 395, 396, + /* 310 */ 178, 242, 180, 361, 394, 395, 14, 94, 405, 95, + /* 320 */ 344, 57, 20, 360, 14, 405, 62, 20, 352, 106, + /* 330 */ 20, 242, 69, 69, 47, 203, 204, 361, 206, 207, /* 340 */ 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - /* 350 */ 218, 219, 220, 221, 222, 223, 224, 134, 20, 95, + /* 350 */ 218, 219, 220, 221, 222, 223, 224, 134, 226, 95, /* 360 */ 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - /* 370 */ 147, 148, 149, 150, 151, 152, 153, 97, 155, 156, - /* 380 */ 157, 117, 8, 9, 35, 383, 12, 13, 14, 15, - /* 390 */ 16, 33, 20, 351, 22, 131, 132, 327, 399, 173, - /* 400 */ 330, 399, 344, 247, 248, 47, 364, 35, 12, 13, - /* 410 */ 352, 53, 54, 55, 56, 57, 20, 43, 22, 361, - /* 420 */ 194, 195, 50, 159, 160, 96, 2, 428, 61, 33, - /* 430 */ 428, 35, 8, 9, 127, 319, 12, 13, 14, 15, - /* 440 */ 16, 335, 178, 444, 180, 443, 444, 448, 449, 344, - /* 450 */ 448, 449, 94, 57, 352, 97, 20, 352, 62, 203, - /* 460 */ 338, 339, 360, 170, 358, 69, 361, 203, 204, 242, + /* 370 */ 147, 148, 149, 150, 151, 152, 153, 95, 155, 156, + /* 380 */ 157, 117, 419, 420, 421, 422, 14, 424, 425, 20, + /* 390 */ 330, 33, 20, 8, 9, 131, 132, 12, 13, 14, + /* 400 */ 15, 16, 424, 343, 330, 47, 428, 161, 12, 13, + /* 410 */ 14, 53, 54, 55, 56, 57, 20, 343, 22, 259, + /* 420 */ 360, 397, 444, 159, 160, 164, 448, 449, 43, 33, + /* 430 */ 352, 35, 0, 352, 360, 242, 106, 359, 352, 0, + /* 440 */ 359, 226, 178, 228, 180, 359, 368, 423, 95, 368, + /* 450 */ 242, 226, 94, 57, 368, 97, 24, 25, 26, 27, + /* 460 */ 28, 29, 30, 31, 32, 69, 242, 203, 204, 159, /* 470 */ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - /* 480 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 21, - /* 490 */ 226, 95, 185, 186, 44, 45, 189, 3, 191, 383, - /* 500 */ 322, 330, 34, 401, 36, 397, 383, 251, 252, 253, - /* 510 */ 254, 255, 14, 117, 20, 399, 107, 383, 20, 126, - /* 520 */ 162, 163, 399, 165, 14, 322, 168, 131, 132, 180, - /* 530 */ 20, 360, 424, 399, 0, 126, 127, 128, 129, 130, - /* 540 */ 12, 13, 184, 365, 428, 330, 322, 352, 20, 0, - /* 550 */ 22, 428, 410, 106, 412, 159, 160, 264, 343, 443, - /* 560 */ 444, 33, 428, 35, 448, 449, 443, 444, 365, 374, - /* 570 */ 399, 448, 449, 14, 178, 360, 180, 443, 444, 20, - /* 580 */ 187, 188, 448, 449, 0, 57, 20, 354, 322, 365, - /* 590 */ 96, 420, 421, 422, 423, 61, 425, 69, 365, 203, - /* 600 */ 204, 322, 206, 207, 208, 209, 210, 211, 212, 213, + /* 480 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 1, + /* 490 */ 2, 95, 366, 367, 126, 127, 4, 8, 9, 352, + /* 500 */ 322, 12, 13, 14, 15, 16, 330, 360, 247, 248, + /* 510 */ 424, 19, 327, 117, 428, 330, 173, 126, 69, 343, + /* 520 */ 162, 163, 20, 165, 22, 33, 168, 131, 132, 443, + /* 530 */ 444, 159, 330, 69, 448, 449, 360, 194, 195, 47, + /* 540 */ 12, 13, 184, 365, 52, 343, 107, 400, 20, 57, + /* 550 */ 22, 62, 50, 322, 186, 159, 160, 189, 330, 191, + /* 560 */ 330, 33, 360, 35, 330, 126, 127, 128, 129, 130, + /* 570 */ 409, 330, 411, 343, 178, 158, 180, 343, 187, 188, + /* 580 */ 338, 339, 322, 352, 96, 57, 94, 57, 360, 97, + /* 590 */ 360, 360, 203, 104, 360, 242, 365, 69, 367, 203, + /* 600 */ 204, 360, 206, 207, 208, 209, 210, 211, 212, 213, /* 610 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - /* 620 */ 224, 57, 322, 95, 226, 0, 228, 394, 395, 8, - /* 630 */ 9, 365, 226, 12, 13, 14, 15, 16, 158, 406, - /* 640 */ 2, 322, 333, 0, 365, 117, 8, 9, 338, 339, - /* 650 */ 12, 13, 14, 15, 16, 161, 107, 159, 94, 131, - /* 660 */ 132, 97, 8, 9, 355, 365, 12, 13, 14, 15, - /* 670 */ 16, 397, 12, 13, 14, 126, 127, 128, 129, 130, - /* 680 */ 20, 354, 22, 62, 365, 322, 330, 159, 160, 352, - /* 690 */ 47, 107, 365, 33, 330, 35, 8, 9, 424, 343, - /* 700 */ 12, 13, 14, 15, 16, 368, 178, 343, 180, 229, - /* 710 */ 126, 127, 128, 129, 130, 352, 360, 57, 159, 239, - /* 720 */ 69, 394, 395, 360, 360, 104, 69, 161, 365, 69, - /* 730 */ 367, 203, 204, 406, 206, 207, 208, 209, 210, 211, + /* 620 */ 224, 330, 391, 95, 94, 365, 395, 97, 353, 398, + /* 630 */ 399, 400, 401, 402, 403, 404, 405, 406, 407, 20, + /* 640 */ 251, 252, 253, 254, 255, 117, 229, 158, 420, 421, + /* 650 */ 422, 360, 424, 425, 327, 408, 239, 330, 411, 131, + /* 660 */ 132, 420, 421, 422, 322, 424, 425, 322, 330, 428, + /* 670 */ 8, 9, 12, 13, 12, 13, 14, 15, 16, 330, + /* 680 */ 20, 343, 22, 333, 443, 444, 367, 159, 160, 448, + /* 690 */ 449, 345, 343, 33, 348, 35, 8, 9, 360, 380, + /* 700 */ 12, 13, 14, 15, 16, 355, 178, 365, 180, 360, + /* 710 */ 365, 420, 421, 422, 322, 424, 425, 57, 229, 230, + /* 720 */ 231, 232, 233, 234, 235, 236, 237, 238, 239, 69, + /* 730 */ 353, 203, 204, 322, 206, 207, 208, 209, 210, 211, /* 740 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 750 */ 222, 223, 224, 4, 391, 95, 322, 43, 395, 322, - /* 760 */ 360, 398, 399, 400, 401, 402, 403, 404, 0, 406, - /* 770 */ 242, 371, 345, 37, 411, 348, 413, 117, 322, 158, - /* 780 */ 417, 418, 8, 9, 96, 322, 12, 13, 14, 15, - /* 790 */ 16, 131, 132, 430, 12, 13, 14, 15, 16, 365, - /* 800 */ 330, 438, 365, 330, 12, 13, 360, 410, 397, 412, - /* 810 */ 96, 330, 20, 343, 22, 161, 343, 371, 330, 159, - /* 820 */ 160, 365, 20, 350, 343, 33, 3, 35, 365, 61, - /* 830 */ 360, 343, 330, 360, 98, 424, 100, 101, 178, 103, - /* 840 */ 180, 360, 20, 107, 379, 343, 381, 20, 360, 57, - /* 850 */ 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - /* 860 */ 239, 69, 360, 203, 204, 129, 206, 207, 208, 209, + /* 750 */ 222, 223, 224, 322, 2, 95, 351, 365, 96, 330, + /* 760 */ 8, 9, 335, 352, 12, 13, 14, 15, 16, 364, + /* 770 */ 22, 360, 343, 330, 4, 330, 365, 117, 367, 360, + /* 780 */ 161, 322, 22, 35, 96, 358, 343, 2, 343, 360, + /* 790 */ 371, 131, 132, 8, 9, 35, 365, 12, 13, 14, + /* 800 */ 15, 16, 391, 360, 360, 360, 395, 338, 339, 398, + /* 810 */ 399, 400, 401, 402, 403, 371, 405, 69, 322, 159, + /* 820 */ 160, 0, 21, 412, 365, 8, 9, 416, 417, 12, + /* 830 */ 13, 14, 15, 16, 409, 34, 411, 36, 178, 353, + /* 840 */ 180, 108, 109, 110, 111, 112, 113, 114, 115, 116, + /* 850 */ 117, 118, 353, 120, 121, 122, 123, 124, 125, 353, + /* 860 */ 379, 365, 381, 203, 204, 117, 206, 207, 208, 209, /* 870 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 880 */ 220, 221, 222, 223, 224, 126, 127, 95, 108, 109, - /* 890 */ 110, 111, 112, 113, 114, 115, 116, 117, 118, 322, - /* 900 */ 120, 121, 122, 123, 124, 125, 367, 352, 330, 117, - /* 910 */ 322, 240, 241, 330, 354, 379, 361, 381, 22, 380, - /* 920 */ 39, 343, 322, 131, 132, 365, 343, 340, 330, 342, - /* 930 */ 322, 35, 322, 322, 330, 43, 12, 13, 360, 42, - /* 940 */ 43, 343, 365, 360, 20, 186, 22, 343, 189, 330, - /* 950 */ 191, 159, 160, 365, 394, 395, 396, 33, 360, 35, - /* 960 */ 0, 330, 343, 161, 360, 365, 406, 107, 362, 43, - /* 970 */ 178, 365, 180, 365, 343, 365, 365, 409, 387, 360, - /* 980 */ 412, 57, 362, 161, 345, 365, 159, 348, 96, 129, - /* 990 */ 43, 360, 243, 69, 353, 203, 204, 322, 206, 207, - /* 1000 */ 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - /* 1010 */ 218, 219, 220, 221, 222, 223, 224, 330, 43, 95, - /* 1020 */ 42, 43, 96, 330, 64, 65, 66, 352, 330, 43, - /* 1030 */ 343, 99, 72, 73, 102, 360, 343, 77, 78, 330, - /* 1040 */ 365, 117, 367, 83, 84, 99, 0, 360, 102, 89, - /* 1050 */ 43, 99, 343, 360, 102, 131, 132, 99, 360, 330, - /* 1060 */ 102, 43, 161, 43, 43, 43, 391, 166, 22, 360, - /* 1070 */ 395, 96, 343, 398, 399, 400, 401, 402, 403, 404, - /* 1080 */ 35, 406, 259, 159, 160, 0, 411, 0, 413, 360, - /* 1090 */ 0, 62, 417, 418, 131, 132, 3, 399, 95, 1, - /* 1100 */ 2, 43, 178, 96, 180, 353, 353, 353, 105, 22, - /* 1110 */ 353, 353, 22, 438, 96, 375, 96, 96, 96, 421, - /* 1120 */ 422, 423, 241, 425, 341, 452, 323, 203, 204, 46, - /* 1130 */ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - /* 1140 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 64, - /* 1150 */ 65, 66, 67, 68, 96, 70, 71, 72, 73, 74, - /* 1160 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - /* 1170 */ 85, 86, 87, 88, 89, 90, 91, 18, 95, 441, - /* 1180 */ 43, 43, 23, 43, 322, 43, 43, 43, 22, 96, - /* 1190 */ 13, 13, 35, 0, 331, 435, 37, 38, 330, 352, - /* 1200 */ 41, 35, 331, 375, 329, 364, 375, 426, 261, 445, - /* 1210 */ 419, 244, 35, 35, 352, 429, 47, 58, 59, 60, - /* 1220 */ 176, 392, 360, 393, 385, 180, 69, 365, 360, 367, - /* 1230 */ 42, 372, 203, 96, 96, 69, 96, 20, 96, 96, - /* 1240 */ 96, 48, 375, 370, 372, 20, 158, 330, 330, 263, - /* 1250 */ 372, 337, 370, 391, 95, 370, 93, 395, 330, 330, - /* 1260 */ 398, 399, 400, 401, 402, 403, 404, 399, 406, 330, - /* 1270 */ 20, 409, 324, 411, 412, 413, 20, 324, 389, 417, - /* 1280 */ 418, 20, 367, 117, 335, 335, 382, 20, 382, 421, - /* 1290 */ 422, 423, 133, 425, 384, 322, 335, 335, 330, 335, - /* 1300 */ 335, 335, 51, 332, 332, 324, 352, 352, 352, 352, - /* 1310 */ 365, 352, 330, 324, 192, 390, 389, 333, 183, 388, - /* 1320 */ 382, 352, 352, 333, 330, 352, 352, 330, 352, 170, - /* 1330 */ 171, 172, 352, 360, 175, 352, 163, 333, 365, 333, - /* 1340 */ 367, 249, 365, 348, 178, 333, 180, 250, 437, 169, - /* 1350 */ 322, 256, 193, 365, 367, 196, 365, 198, 199, 200, - /* 1360 */ 201, 202, 258, 378, 391, 365, 365, 375, 395, 203, - /* 1370 */ 204, 398, 399, 400, 401, 402, 403, 404, 376, 406, - /* 1380 */ 352, 365, 365, 378, 411, 360, 413, 378, 360, 375, - /* 1390 */ 417, 418, 365, 365, 245, 367, 365, 378, 365, 265, - /* 1400 */ 427, 242, 257, 262, 453, 241, 322, 260, 393, 360, - /* 1410 */ 20, 95, 416, 434, 95, 356, 365, 342, 36, 391, - /* 1420 */ 324, 330, 333, 395, 325, 432, 398, 399, 400, 401, - /* 1430 */ 402, 403, 404, 434, 406, 397, 352, 381, 386, 411, - /* 1440 */ 346, 413, 434, 433, 360, 417, 418, 436, 346, 365, - /* 1450 */ 334, 367, 346, 320, 431, 427, 0, 0, 185, 0, - /* 1460 */ 447, 322, 0, 42, 0, 35, 197, 35, 35, 35, - /* 1470 */ 446, 197, 0, 35, 35, 391, 197, 0, 197, 395, - /* 1480 */ 322, 0, 398, 399, 400, 401, 402, 403, 404, 35, - /* 1490 */ 406, 352, 0, 22, 0, 411, 35, 413, 180, 360, - /* 1500 */ 178, 417, 418, 0, 365, 0, 367, 174, 173, 0, - /* 1510 */ 352, 427, 0, 46, 0, 0, 0, 42, 360, 0, - /* 1520 */ 0, 0, 0, 365, 0, 367, 0, 0, 0, 149, - /* 1530 */ 391, 35, 0, 149, 395, 0, 0, 398, 399, 400, - /* 1540 */ 401, 402, 403, 404, 0, 406, 0, 0, 0, 391, - /* 1550 */ 0, 0, 0, 395, 0, 0, 398, 399, 400, 401, - /* 1560 */ 402, 403, 404, 0, 406, 0, 0, 428, 35, 411, - /* 1570 */ 0, 413, 42, 0, 0, 417, 418, 322, 0, 0, - /* 1580 */ 12, 13, 443, 444, 0, 0, 22, 448, 449, 14, - /* 1590 */ 22, 0, 0, 0, 0, 57, 0, 57, 322, 0, - /* 1600 */ 0, 33, 43, 35, 42, 0, 39, 352, 39, 14, - /* 1610 */ 0, 0, 0, 169, 0, 360, 40, 46, 46, 39, - /* 1620 */ 365, 0, 367, 0, 63, 57, 0, 0, 352, 47, - /* 1630 */ 0, 0, 35, 35, 47, 47, 360, 69, 0, 35, - /* 1640 */ 39, 365, 39, 367, 35, 39, 391, 39, 0, 47, - /* 1650 */ 395, 0, 0, 398, 399, 400, 401, 402, 403, 404, - /* 1660 */ 0, 406, 104, 35, 22, 0, 411, 391, 413, 35, - /* 1670 */ 35, 395, 417, 418, 398, 399, 400, 401, 402, 403, - /* 1680 */ 404, 22, 406, 322, 35, 117, 43, 411, 102, 413, - /* 1690 */ 35, 22, 35, 417, 418, 0, 43, 35, 35, 22, - /* 1700 */ 0, 22, 0, 49, 22, 35, 0, 0, 35, 35, - /* 1710 */ 0, 22, 20, 352, 96, 95, 0, 161, 35, 0, - /* 1720 */ 181, 360, 0, 22, 0, 0, 365, 95, 367, 96, - /* 1730 */ 0, 35, 3, 0, 0, 190, 95, 0, 161, 35, - /* 1740 */ 95, 95, 39, 46, 163, 105, 178, 246, 180, 62, - /* 1750 */ 167, 161, 391, 95, 43, 43, 395, 96, 43, 398, - /* 1760 */ 399, 400, 401, 402, 403, 404, 225, 406, 322, 162, - /* 1770 */ 227, 203, 204, 95, 413, 43, 96, 164, 417, 418, - /* 1780 */ 96, 95, 225, 215, 216, 217, 218, 219, 220, 221, - /* 1790 */ 96, 46, 46, 95, 95, 43, 3, 43, 352, 246, - /* 1800 */ 95, 35, 35, 35, 96, 96, 360, 35, 95, 35, - /* 1810 */ 96, 365, 35, 367, 96, 46, 96, 46, 43, 46, - /* 1820 */ 2, 22, 203, 95, 322, 46, 46, 96, 22, 205, - /* 1830 */ 95, 35, 96, 95, 69, 96, 95, 391, 95, 35, - /* 1840 */ 96, 395, 35, 95, 398, 399, 400, 401, 402, 403, - /* 1850 */ 404, 96, 406, 322, 352, 106, 240, 95, 95, 413, - /* 1860 */ 96, 246, 360, 417, 418, 35, 96, 365, 35, 367, - /* 1870 */ 119, 95, 35, 22, 96, 119, 95, 119, 96, 95, - /* 1880 */ 119, 95, 322, 352, 95, 35, 95, 43, 22, 63, - /* 1890 */ 107, 360, 35, 391, 35, 35, 365, 395, 367, 35, - /* 1900 */ 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - /* 1910 */ 408, 322, 352, 35, 35, 35, 35, 35, 35, 92, - /* 1920 */ 360, 35, 391, 35, 22, 365, 395, 367, 43, 398, - /* 1930 */ 399, 400, 401, 402, 403, 404, 35, 406, 22, 35, - /* 1940 */ 35, 352, 35, 69, 35, 35, 35, 35, 35, 360, - /* 1950 */ 22, 391, 35, 0, 365, 395, 367, 35, 398, 399, - /* 1960 */ 400, 401, 402, 403, 404, 47, 406, 0, 39, 35, - /* 1970 */ 439, 440, 47, 0, 39, 35, 39, 47, 322, 0, - /* 1980 */ 391, 35, 39, 47, 395, 0, 35, 398, 399, 400, - /* 1990 */ 401, 402, 403, 404, 322, 406, 35, 0, 22, 21, - /* 2000 */ 454, 21, 413, 22, 22, 454, 20, 418, 352, 454, - /* 2010 */ 450, 451, 454, 357, 454, 454, 360, 454, 454, 454, - /* 2020 */ 454, 365, 454, 367, 352, 454, 454, 454, 454, 454, - /* 2030 */ 454, 454, 360, 454, 454, 454, 454, 365, 454, 367, - /* 2040 */ 454, 454, 454, 454, 454, 454, 454, 391, 454, 322, - /* 2050 */ 454, 395, 454, 454, 398, 399, 400, 401, 402, 403, - /* 2060 */ 404, 454, 406, 391, 454, 454, 454, 395, 454, 322, - /* 2070 */ 398, 399, 400, 401, 402, 403, 404, 454, 406, 352, - /* 2080 */ 408, 454, 454, 454, 454, 454, 454, 360, 454, 454, - /* 2090 */ 454, 454, 365, 454, 367, 454, 454, 454, 454, 352, - /* 2100 */ 454, 454, 454, 454, 454, 454, 454, 360, 454, 454, - /* 2110 */ 454, 454, 365, 454, 367, 454, 454, 454, 391, 454, - /* 2120 */ 454, 454, 395, 454, 454, 398, 399, 400, 401, 402, - /* 2130 */ 403, 404, 454, 406, 322, 454, 454, 454, 391, 454, - /* 2140 */ 454, 454, 395, 454, 454, 398, 399, 400, 401, 402, - /* 2150 */ 403, 404, 454, 406, 454, 454, 454, 454, 454, 454, - /* 2160 */ 454, 454, 454, 454, 352, 454, 454, 440, 454, 454, - /* 2170 */ 454, 454, 360, 454, 454, 454, 454, 365, 454, 367, - /* 2180 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 442, - /* 2190 */ 454, 454, 322, 454, 454, 454, 454, 454, 454, 454, - /* 2200 */ 454, 454, 454, 391, 454, 454, 322, 395, 454, 454, - /* 2210 */ 398, 399, 400, 401, 402, 403, 404, 454, 406, 454, - /* 2220 */ 454, 454, 352, 454, 454, 454, 454, 357, 454, 454, - /* 2230 */ 360, 454, 454, 454, 454, 365, 352, 367, 454, 454, - /* 2240 */ 454, 357, 454, 454, 360, 454, 454, 454, 454, 365, - /* 2250 */ 454, 367, 454, 454, 454, 454, 454, 454, 454, 454, - /* 2260 */ 454, 391, 454, 451, 322, 395, 454, 454, 398, 399, - /* 2270 */ 400, 401, 402, 403, 404, 391, 406, 454, 322, 395, - /* 2280 */ 454, 454, 398, 399, 400, 401, 402, 403, 404, 454, - /* 2290 */ 406, 454, 454, 454, 352, 454, 454, 454, 454, 454, - /* 2300 */ 454, 454, 360, 454, 454, 454, 454, 365, 352, 367, - /* 2310 */ 454, 454, 454, 454, 454, 454, 360, 454, 454, 454, - /* 2320 */ 454, 365, 454, 367, 454, 454, 454, 454, 454, 454, - /* 2330 */ 454, 322, 454, 391, 454, 454, 454, 395, 454, 454, - /* 2340 */ 398, 399, 400, 401, 402, 403, 404, 391, 406, 454, - /* 2350 */ 454, 395, 454, 454, 398, 399, 400, 401, 402, 403, - /* 2360 */ 404, 352, 406, 454, 454, 454, 454, 454, 454, 360, - /* 2370 */ 454, 454, 454, 454, 365, 454, 367, 454, 454, 454, - /* 2380 */ 454, 454, 454, 454, 454, 454, 322, 454, 454, 454, - /* 2390 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, - /* 2400 */ 391, 454, 322, 454, 395, 454, 454, 398, 399, 400, - /* 2410 */ 401, 402, 403, 404, 454, 406, 352, 454, 454, 454, - /* 2420 */ 454, 454, 454, 454, 360, 454, 454, 454, 454, 365, - /* 2430 */ 454, 367, 352, 454, 454, 454, 454, 454, 454, 454, - /* 2440 */ 360, 454, 454, 454, 454, 365, 454, 367, 454, 454, - /* 2450 */ 454, 454, 454, 454, 454, 391, 454, 322, 454, 395, - /* 2460 */ 454, 454, 398, 399, 400, 401, 402, 403, 404, 454, - /* 2470 */ 406, 391, 454, 322, 454, 395, 454, 454, 398, 399, - /* 2480 */ 400, 401, 402, 403, 404, 454, 406, 352, 454, 454, - /* 2490 */ 454, 454, 454, 454, 454, 360, 454, 454, 454, 454, - /* 2500 */ 365, 454, 367, 352, 454, 454, 454, 454, 454, 454, - /* 2510 */ 454, 360, 454, 454, 454, 454, 365, 454, 367, 454, - /* 2520 */ 454, 454, 454, 454, 454, 454, 391, 454, 454, 322, - /* 2530 */ 395, 454, 454, 398, 399, 400, 401, 402, 403, 404, - /* 2540 */ 454, 406, 391, 454, 454, 322, 395, 454, 454, 398, - /* 2550 */ 399, 400, 401, 402, 403, 404, 454, 406, 454, 352, - /* 2560 */ 454, 454, 454, 454, 454, 454, 454, 360, 454, 454, - /* 2570 */ 454, 454, 365, 454, 367, 352, 454, 454, 454, 454, - /* 2580 */ 454, 454, 454, 360, 454, 454, 454, 454, 365, 454, - /* 2590 */ 367, 454, 454, 454, 454, 454, 454, 454, 391, 454, - /* 2600 */ 454, 322, 395, 454, 454, 398, 399, 400, 401, 402, - /* 2610 */ 403, 404, 454, 406, 391, 454, 454, 322, 395, 454, - /* 2620 */ 454, 398, 399, 400, 401, 402, 403, 404, 454, 406, - /* 2630 */ 454, 352, 454, 454, 454, 454, 454, 454, 454, 360, - /* 2640 */ 454, 454, 454, 454, 365, 454, 367, 352, 454, 454, - /* 2650 */ 454, 454, 454, 454, 454, 360, 454, 454, 454, 454, - /* 2660 */ 365, 454, 367, 454, 454, 454, 454, 454, 454, 454, - /* 2670 */ 391, 454, 454, 454, 395, 454, 454, 398, 399, 400, - /* 2680 */ 401, 402, 403, 404, 322, 406, 391, 454, 454, 454, - /* 2690 */ 395, 454, 454, 398, 399, 400, 401, 402, 403, 404, - /* 2700 */ 454, 406, 454, 454, 454, 454, 454, 454, 454, 322, - /* 2710 */ 454, 454, 454, 454, 352, 454, 454, 454, 454, 454, - /* 2720 */ 454, 454, 360, 454, 454, 454, 454, 365, 454, 367, - /* 2730 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 352, - /* 2740 */ 454, 454, 454, 454, 454, 454, 454, 360, 454, 454, - /* 2750 */ 454, 454, 365, 391, 367, 454, 454, 395, 454, 454, - /* 2760 */ 398, 399, 400, 401, 402, 403, 404, 19, 406, 454, - /* 2770 */ 322, 454, 454, 454, 454, 454, 454, 454, 391, 454, - /* 2780 */ 454, 33, 395, 454, 454, 398, 399, 400, 401, 402, - /* 2790 */ 403, 404, 454, 406, 454, 47, 454, 454, 454, 454, - /* 2800 */ 352, 53, 54, 55, 56, 57, 454, 454, 360, 454, - /* 2810 */ 454, 454, 454, 365, 454, 367, 454, 454, 454, 454, - /* 2820 */ 454, 454, 454, 322, 454, 454, 454, 454, 454, 454, - /* 2830 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 391, - /* 2840 */ 454, 322, 94, 395, 454, 97, 398, 399, 400, 401, - /* 2850 */ 402, 403, 404, 352, 406, 454, 454, 454, 454, 454, - /* 2860 */ 454, 360, 454, 454, 454, 454, 365, 454, 367, 454, - /* 2870 */ 454, 352, 454, 454, 454, 454, 454, 454, 130, 360, - /* 2880 */ 454, 454, 454, 454, 365, 454, 367, 454, 454, 454, - /* 2890 */ 454, 454, 391, 454, 454, 454, 395, 322, 454, 398, - /* 2900 */ 399, 400, 401, 402, 403, 404, 454, 406, 454, 454, - /* 2910 */ 391, 322, 454, 165, 395, 454, 454, 398, 399, 400, - /* 2920 */ 401, 402, 403, 404, 454, 406, 454, 352, 454, 454, - /* 2930 */ 182, 454, 184, 454, 454, 360, 454, 454, 454, 454, - /* 2940 */ 365, 352, 367, 454, 454, 454, 454, 454, 454, 360, - /* 2950 */ 454, 454, 454, 454, 365, 454, 367, 454, 454, 454, - /* 2960 */ 454, 454, 454, 454, 454, 454, 391, 322, 454, 454, - /* 2970 */ 395, 454, 454, 398, 399, 400, 401, 402, 403, 404, - /* 2980 */ 391, 406, 454, 322, 395, 454, 454, 398, 399, 400, - /* 2990 */ 401, 402, 403, 404, 454, 406, 454, 352, 454, 454, - /* 3000 */ 454, 454, 454, 454, 454, 360, 454, 454, 454, 454, - /* 3010 */ 365, 454, 367, 352, 454, 454, 454, 454, 454, 454, - /* 3020 */ 454, 360, 454, 454, 454, 454, 365, 454, 367, 454, - /* 3030 */ 454, 454, 454, 454, 454, 454, 391, 454, 454, 454, - /* 3040 */ 395, 454, 454, 398, 399, 400, 401, 402, 403, 404, - /* 3050 */ 322, 406, 391, 454, 454, 454, 395, 454, 454, 398, - /* 3060 */ 399, 400, 401, 402, 403, 404, 454, 406, 454, 454, - /* 3070 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, - /* 3080 */ 352, 454, 454, 454, 454, 454, 454, 454, 360, 454, - /* 3090 */ 454, 454, 454, 365, 454, 367, 454, 454, 454, 454, - /* 3100 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, - /* 3110 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 391, - /* 3120 */ 454, 454, 454, 395, 454, 454, 398, 399, 400, 401, - /* 3130 */ 402, 403, 404, 454, 406, + /* 880 */ 220, 221, 222, 223, 224, 64, 65, 66, 67, 68, + /* 890 */ 20, 70, 71, 72, 73, 74, 75, 76, 77, 78, + /* 900 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + /* 910 */ 89, 90, 91, 18, 330, 0, 322, 353, 23, 383, + /* 920 */ 322, 20, 352, 322, 322, 322, 178, 343, 180, 322, + /* 930 */ 397, 322, 37, 38, 322, 379, 41, 381, 368, 322, + /* 940 */ 353, 8, 9, 322, 360, 12, 13, 14, 15, 16, + /* 950 */ 352, 203, 204, 58, 59, 60, 423, 330, 360, 365, + /* 960 */ 424, 39, 330, 365, 428, 367, 365, 365, 365, 0, + /* 970 */ 343, 20, 365, 352, 365, 343, 61, 365, 161, 443, + /* 980 */ 444, 360, 365, 360, 448, 449, 365, 360, 367, 391, + /* 990 */ 95, 37, 360, 395, 371, 43, 398, 399, 400, 401, + /* 1000 */ 402, 403, 352, 405, 330, 340, 362, 342, 410, 365, + /* 1010 */ 412, 361, 391, 243, 416, 417, 395, 343, 0, 398, + /* 1020 */ 399, 400, 401, 402, 403, 427, 405, 43, 133, 159, + /* 1030 */ 61, 410, 0, 412, 360, 12, 13, 416, 417, 362, + /* 1040 */ 127, 322, 365, 345, 387, 22, 348, 330, 427, 44, + /* 1050 */ 45, 330, 98, 107, 100, 101, 33, 103, 35, 106, + /* 1060 */ 343, 107, 161, 107, 343, 170, 171, 172, 240, 241, + /* 1070 */ 175, 352, 126, 127, 128, 129, 130, 360, 35, 360, + /* 1080 */ 57, 360, 341, 129, 365, 129, 367, 0, 193, 42, + /* 1090 */ 43, 196, 69, 198, 199, 200, 201, 202, 185, 186, + /* 1100 */ 322, 57, 189, 330, 191, 42, 43, 154, 62, 22, + /* 1110 */ 391, 43, 161, 43, 395, 323, 343, 398, 399, 400, + /* 1120 */ 401, 402, 403, 0, 405, 131, 132, 1, 2, 410, + /* 1130 */ 352, 412, 43, 360, 0, 416, 417, 242, 360, 107, + /* 1140 */ 117, 97, 35, 365, 21, 367, 427, 24, 25, 26, + /* 1150 */ 27, 28, 29, 30, 31, 32, 22, 43, 126, 127, + /* 1160 */ 128, 129, 130, 241, 96, 99, 96, 149, 102, 391, + /* 1170 */ 0, 99, 99, 395, 102, 102, 398, 399, 400, 401, + /* 1180 */ 402, 403, 43, 405, 99, 96, 322, 102, 410, 13, + /* 1190 */ 412, 161, 22, 43, 416, 417, 166, 43, 43, 43, + /* 1200 */ 35, 178, 375, 180, 43, 46, 13, 452, 319, 441, + /* 1210 */ 96, 35, 331, 261, 435, 322, 352, 43, 43, 352, + /* 1220 */ 43, 331, 43, 180, 360, 43, 203, 204, 35, 365, + /* 1230 */ 43, 367, 375, 329, 69, 96, 364, 375, 215, 216, + /* 1240 */ 217, 218, 219, 220, 221, 352, 96, 263, 426, 203, + /* 1250 */ 96, 96, 96, 360, 95, 391, 445, 96, 365, 395, + /* 1260 */ 367, 418, 398, 399, 400, 401, 402, 403, 0, 405, + /* 1270 */ 96, 96, 383, 96, 410, 96, 412, 322, 96, 95, + /* 1280 */ 416, 417, 429, 96, 391, 244, 47, 180, 395, 105, + /* 1290 */ 393, 398, 399, 400, 401, 402, 403, 392, 405, 385, + /* 1300 */ 176, 42, 372, 410, 322, 412, 20, 352, 370, 416, + /* 1310 */ 417, 375, 372, 424, 20, 360, 48, 428, 158, 330, + /* 1320 */ 365, 330, 367, 93, 337, 330, 330, 330, 370, 372, + /* 1330 */ 370, 322, 443, 444, 352, 20, 324, 448, 449, 324, + /* 1340 */ 20, 335, 360, 367, 20, 335, 391, 365, 322, 367, + /* 1350 */ 395, 389, 382, 398, 399, 400, 401, 402, 403, 20, + /* 1360 */ 405, 352, 384, 335, 335, 382, 335, 412, 335, 360, + /* 1370 */ 330, 416, 417, 391, 365, 324, 367, 395, 352, 51, + /* 1380 */ 398, 399, 400, 401, 402, 403, 360, 405, 335, 332, + /* 1390 */ 332, 365, 330, 367, 412, 192, 383, 352, 416, 417, + /* 1400 */ 391, 352, 322, 324, 395, 389, 352, 398, 399, 400, + /* 1410 */ 401, 402, 403, 352, 405, 365, 352, 391, 183, 250, + /* 1420 */ 330, 395, 388, 352, 398, 399, 400, 401, 402, 403, + /* 1430 */ 352, 405, 352, 333, 352, 352, 352, 424, 352, 333, + /* 1440 */ 360, 428, 390, 367, 375, 365, 249, 367, 439, 440, + /* 1450 */ 383, 434, 375, 365, 434, 256, 443, 444, 322, 365, + /* 1460 */ 365, 448, 449, 365, 383, 169, 258, 257, 432, 378, + /* 1470 */ 378, 391, 437, 436, 245, 395, 450, 451, 398, 399, + /* 1480 */ 400, 401, 402, 403, 265, 405, 393, 431, 352, 434, + /* 1490 */ 262, 424, 412, 433, 260, 428, 360, 417, 241, 20, + /* 1500 */ 360, 365, 322, 367, 382, 424, 397, 378, 383, 428, + /* 1510 */ 443, 444, 453, 330, 333, 448, 449, 365, 322, 378, + /* 1520 */ 163, 447, 365, 365, 443, 444, 360, 391, 365, 448, + /* 1530 */ 449, 395, 352, 365, 398, 399, 400, 401, 402, 403, + /* 1540 */ 360, 405, 446, 365, 333, 365, 348, 367, 352, 424, + /* 1550 */ 333, 95, 415, 428, 95, 365, 360, 356, 342, 333, + /* 1560 */ 36, 365, 376, 367, 346, 325, 330, 324, 443, 444, + /* 1570 */ 381, 391, 320, 448, 449, 395, 440, 386, 398, 399, + /* 1580 */ 400, 401, 402, 403, 346, 405, 322, 391, 346, 334, + /* 1590 */ 0, 395, 0, 185, 398, 399, 400, 401, 402, 403, + /* 1600 */ 0, 405, 0, 322, 42, 0, 35, 197, 35, 35, + /* 1610 */ 35, 197, 0, 35, 35, 197, 352, 0, 197, 0, + /* 1620 */ 35, 357, 442, 0, 360, 22, 0, 180, 35, 365, + /* 1630 */ 178, 367, 0, 352, 0, 174, 173, 0, 0, 0, + /* 1640 */ 46, 360, 35, 42, 0, 0, 365, 451, 367, 0, + /* 1650 */ 0, 0, 0, 0, 0, 391, 0, 322, 0, 395, + /* 1660 */ 149, 0, 398, 399, 400, 401, 402, 403, 149, 405, + /* 1670 */ 0, 0, 391, 322, 0, 0, 395, 0, 0, 398, + /* 1680 */ 399, 400, 401, 402, 403, 0, 405, 352, 407, 0, + /* 1690 */ 0, 0, 357, 0, 0, 360, 39, 42, 0, 0, + /* 1700 */ 365, 0, 367, 352, 0, 0, 0, 0, 357, 0, + /* 1710 */ 22, 360, 43, 46, 35, 0, 365, 322, 367, 0, + /* 1720 */ 0, 0, 0, 57, 0, 57, 391, 0, 0, 42, + /* 1730 */ 395, 14, 14, 398, 399, 400, 401, 402, 403, 0, + /* 1740 */ 405, 46, 391, 40, 322, 0, 395, 352, 0, 398, + /* 1750 */ 399, 400, 401, 402, 403, 360, 405, 0, 169, 0, + /* 1760 */ 365, 0, 367, 0, 39, 39, 0, 0, 35, 39, + /* 1770 */ 47, 322, 0, 63, 352, 35, 47, 39, 0, 35, + /* 1780 */ 39, 47, 360, 47, 35, 39, 391, 365, 0, 367, + /* 1790 */ 395, 0, 0, 398, 399, 400, 401, 402, 403, 0, + /* 1800 */ 405, 352, 0, 35, 104, 0, 22, 22, 35, 360, + /* 1810 */ 102, 35, 35, 391, 365, 322, 367, 395, 43, 22, + /* 1820 */ 398, 399, 400, 401, 402, 403, 0, 405, 35, 43, + /* 1830 */ 35, 35, 0, 35, 22, 22, 49, 0, 22, 35, + /* 1840 */ 391, 0, 35, 0, 395, 352, 35, 398, 399, 400, + /* 1850 */ 401, 402, 403, 360, 405, 0, 22, 95, 365, 322, + /* 1860 */ 367, 96, 20, 0, 35, 0, 22, 181, 0, 0, + /* 1870 */ 3, 43, 161, 246, 161, 95, 95, 163, 96, 322, + /* 1880 */ 3, 43, 43, 167, 391, 96, 96, 246, 395, 352, + /* 1890 */ 96, 398, 399, 400, 401, 402, 403, 360, 405, 46, + /* 1900 */ 43, 95, 365, 161, 367, 46, 246, 43, 35, 352, + /* 1910 */ 95, 35, 95, 95, 35, 96, 96, 360, 35, 35, + /* 1920 */ 35, 96, 365, 96, 367, 43, 46, 46, 391, 0, + /* 1930 */ 0, 0, 395, 190, 35, 398, 399, 400, 401, 402, + /* 1940 */ 403, 95, 405, 96, 322, 96, 95, 35, 391, 0, + /* 1950 */ 0, 95, 395, 95, 39, 398, 399, 400, 401, 402, + /* 1960 */ 403, 95, 405, 46, 322, 164, 105, 46, 43, 2, + /* 1970 */ 162, 240, 225, 22, 352, 22, 225, 227, 46, 46, + /* 1980 */ 106, 95, 360, 96, 95, 107, 96, 365, 95, 367, + /* 1990 */ 96, 95, 95, 35, 352, 35, 96, 95, 35, 96, + /* 2000 */ 95, 95, 360, 203, 96, 96, 35, 365, 205, 367, + /* 2010 */ 96, 95, 35, 391, 95, 35, 96, 395, 322, 95, + /* 2020 */ 398, 399, 400, 401, 402, 403, 119, 405, 22, 119, + /* 2030 */ 119, 95, 119, 391, 322, 95, 35, 395, 95, 43, + /* 2040 */ 398, 399, 400, 401, 402, 403, 22, 405, 352, 63, + /* 2050 */ 62, 35, 35, 35, 35, 35, 360, 35, 35, 69, + /* 2060 */ 35, 365, 35, 367, 352, 35, 92, 35, 35, 43, + /* 2070 */ 22, 35, 360, 22, 35, 35, 35, 365, 322, 367, + /* 2080 */ 69, 35, 35, 22, 35, 35, 0, 391, 35, 35, + /* 2090 */ 35, 395, 47, 0, 398, 399, 400, 401, 402, 403, + /* 2100 */ 35, 405, 39, 391, 0, 322, 47, 395, 352, 39, + /* 2110 */ 398, 399, 400, 401, 402, 403, 360, 405, 35, 47, + /* 2120 */ 39, 365, 0, 367, 35, 47, 39, 0, 0, 35, + /* 2130 */ 35, 22, 322, 21, 21, 352, 22, 22, 20, 454, + /* 2140 */ 454, 454, 454, 360, 454, 454, 454, 391, 365, 454, + /* 2150 */ 367, 395, 454, 454, 398, 399, 400, 401, 402, 403, + /* 2160 */ 454, 405, 352, 454, 454, 454, 454, 454, 454, 454, + /* 2170 */ 360, 454, 454, 454, 391, 365, 322, 367, 395, 454, + /* 2180 */ 454, 398, 399, 400, 401, 402, 403, 454, 405, 454, + /* 2190 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2200 */ 454, 391, 454, 454, 454, 395, 352, 454, 398, 399, + /* 2210 */ 400, 401, 402, 403, 360, 405, 454, 454, 454, 365, + /* 2220 */ 322, 367, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2230 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2240 */ 322, 454, 454, 454, 454, 391, 454, 454, 454, 395, + /* 2250 */ 352, 454, 398, 399, 400, 401, 402, 403, 360, 405, + /* 2260 */ 454, 454, 454, 365, 454, 367, 454, 454, 454, 454, + /* 2270 */ 352, 454, 454, 454, 454, 454, 454, 454, 360, 454, + /* 2280 */ 454, 454, 454, 365, 454, 367, 454, 454, 454, 391, + /* 2290 */ 454, 454, 454, 395, 454, 454, 398, 399, 400, 401, + /* 2300 */ 402, 403, 454, 405, 454, 322, 454, 454, 454, 391, + /* 2310 */ 454, 454, 454, 395, 454, 454, 398, 399, 400, 401, + /* 2320 */ 402, 403, 454, 405, 454, 322, 454, 454, 454, 454, + /* 2330 */ 454, 454, 454, 454, 454, 352, 454, 454, 454, 454, + /* 2340 */ 454, 454, 454, 360, 454, 454, 454, 454, 365, 454, + /* 2350 */ 367, 454, 454, 454, 454, 352, 454, 454, 454, 454, + /* 2360 */ 454, 454, 454, 360, 454, 454, 454, 454, 365, 454, + /* 2370 */ 367, 454, 454, 454, 391, 454, 454, 454, 395, 322, + /* 2380 */ 454, 398, 399, 400, 401, 402, 403, 454, 405, 454, + /* 2390 */ 454, 454, 454, 454, 391, 322, 454, 454, 395, 454, + /* 2400 */ 454, 398, 399, 400, 401, 402, 403, 454, 405, 352, + /* 2410 */ 454, 454, 454, 454, 454, 454, 454, 360, 454, 454, + /* 2420 */ 454, 454, 365, 454, 367, 352, 454, 454, 454, 454, + /* 2430 */ 454, 454, 454, 360, 454, 454, 454, 454, 365, 322, + /* 2440 */ 367, 454, 454, 454, 454, 454, 454, 454, 391, 454, + /* 2450 */ 454, 454, 395, 19, 454, 398, 399, 400, 401, 402, + /* 2460 */ 403, 454, 405, 454, 391, 454, 322, 33, 395, 352, + /* 2470 */ 454, 398, 399, 400, 401, 402, 403, 360, 405, 454, + /* 2480 */ 454, 47, 365, 454, 367, 454, 454, 53, 54, 55, + /* 2490 */ 56, 57, 454, 454, 454, 454, 352, 454, 454, 454, + /* 2500 */ 454, 454, 454, 454, 360, 454, 454, 454, 391, 365, + /* 2510 */ 454, 367, 395, 454, 454, 398, 399, 400, 401, 402, + /* 2520 */ 403, 454, 405, 454, 454, 454, 454, 454, 94, 454, + /* 2530 */ 454, 97, 454, 454, 454, 391, 454, 454, 454, 395, + /* 2540 */ 454, 454, 398, 399, 400, 401, 402, 403, 454, 405, + /* 2550 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2560 */ 454, 454, 454, 454, 130, 454, 454, 454, 454, 454, + /* 2570 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2580 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2590 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 165, + /* 2600 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2610 */ 454, 454, 454, 454, 454, 454, 182, 454, 184, 454, + /* 2620 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2630 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2640 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2650 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2660 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2670 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2680 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2690 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2700 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2710 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2720 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2730 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2740 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2750 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2760 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + /* 2770 */ 454, 454, 454, }; -#define YY_SHIFT_COUNT (704) +#define YY_SHIFT_COUNT (703) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2748) +#define YY_SHIFT_MAX (2434) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 1159, 0, 132, 264, 132, 396, 396, 396, 528, 396, - /* 10 */ 396, 396, 396, 396, 660, 792, 792, 924, 792, 792, - /* 20 */ 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - /* 30 */ 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - /* 40 */ 792, 792, 792, 792, 792, 792, 48, 227, 170, 61, - /* 50 */ 82, 43, 45, 43, 170, 170, 1568, 1568, 43, 1568, - /* 60 */ 1568, 62, 43, 127, 127, 168, 59, 59, 52, 127, - /* 70 */ 127, 127, 127, 127, 127, 127, 127, 127, 127, 210, - /* 80 */ 127, 127, 127, 276, 127, 127, 305, 127, 127, 305, - /* 90 */ 338, 127, 305, 305, 305, 127, 367, 223, 621, 621, - /* 100 */ 98, 230, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, - /* 110 */ 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, - /* 120 */ 1166, 736, 494, 168, 52, 510, 510, 534, 131, 768, - /* 130 */ 398, 398, 566, 566, 566, 131, 436, 436, 436, 447, - /* 140 */ 276, 625, 625, 406, 305, 305, 651, 651, 447, 657, - /* 150 */ 780, 780, 780, 780, 780, 780, 780, 2748, 960, 205, - /* 160 */ 121, 293, 256, 372, 156, 498, 559, 66, 802, 450, - /* 170 */ 860, 822, 671, 881, 823, 671, 897, 749, 827, 967, - /* 180 */ 1169, 1044, 1188, 1217, 1188, 1088, 1225, 1225, 1188, 1088, - /* 190 */ 1088, 1163, 1225, 1225, 1225, 1250, 1250, 1256, 210, 276, - /* 200 */ 210, 1261, 1267, 210, 1261, 210, 210, 210, 1225, 210, - /* 210 */ 1251, 1251, 1250, 305, 305, 305, 305, 305, 305, 305, - /* 220 */ 305, 305, 305, 305, 1225, 1250, 651, 1122, 1256, 367, - /* 230 */ 1135, 276, 367, 1225, 1225, 1261, 367, 1092, 651, 651, - /* 240 */ 651, 651, 1092, 651, 1173, 367, 447, 367, 436, 1217, - /* 250 */ 1217, 651, 1097, 1092, 651, 651, 1097, 1092, 651, 651, - /* 260 */ 305, 1095, 1180, 1097, 1104, 1145, 1149, 967, 1134, 1141, - /* 270 */ 1147, 1164, 436, 1390, 1316, 1319, 651, 657, 1225, 367, - /* 280 */ 1382, 1250, 3135, 3135, 3135, 3135, 3135, 3135, 3135, 1085, - /* 290 */ 358, 23, 54, 183, 374, 688, 424, 638, 654, 549, - /* 300 */ 774, 774, 774, 774, 774, 774, 774, 774, 774, 584, - /* 310 */ 409, 307, 759, 782, 782, 226, 564, 14, 468, 393, - /* 320 */ 75, 329, 480, 75, 75, 75, 714, 643, 896, 978, - /* 330 */ 146, 36, 932, 946, 952, 958, 1046, 1087, 1090, 280, - /* 340 */ 901, 892, 926, 975, 1007, 1018, 1020, 1021, 963, 947, - /* 350 */ 986, 1098, 1022, 349, 1045, 1029, 1058, 1093, 1083, 1137, - /* 360 */ 1138, 1140, 1142, 1143, 1144, 1003, 1177, 1178, 1157, 1193, - /* 370 */ 1456, 1457, 1273, 1459, 1462, 1421, 1464, 1430, 1269, 1432, - /* 380 */ 1433, 1434, 1274, 1472, 1438, 1439, 1279, 1477, 1281, 1481, - /* 390 */ 1454, 1492, 1471, 1494, 1461, 1318, 1322, 1503, 1505, 1333, - /* 400 */ 1335, 1509, 1512, 1467, 1514, 1515, 1516, 1475, 1519, 1520, - /* 410 */ 1521, 1522, 1524, 1526, 1527, 1528, 1380, 1496, 1532, 1384, - /* 420 */ 1535, 1536, 1544, 1546, 1547, 1548, 1550, 1551, 1552, 1554, - /* 430 */ 1555, 1563, 1565, 1566, 1570, 1530, 1573, 1574, 1578, 1579, - /* 440 */ 1584, 1564, 1585, 1591, 1592, 1593, 1533, 1594, 1538, 1596, - /* 450 */ 1540, 1599, 1600, 1562, 1567, 1559, 1575, 1571, 1595, 1572, - /* 460 */ 1605, 1576, 1569, 1610, 1611, 1612, 1580, 1444, 1614, 1621, - /* 470 */ 1623, 1561, 1626, 1627, 1597, 1582, 1601, 1630, 1598, 1587, - /* 480 */ 1603, 1631, 1604, 1588, 1606, 1638, 1609, 1602, 1608, 1648, - /* 490 */ 1651, 1652, 1660, 1558, 1586, 1628, 1642, 1665, 1634, 1635, - /* 500 */ 1659, 1649, 1655, 1643, 1653, 1657, 1662, 1669, 1663, 1695, - /* 510 */ 1677, 1700, 1679, 1654, 1702, 1682, 1670, 1706, 1673, 1707, - /* 520 */ 1674, 1710, 1689, 1692, 1618, 1620, 1716, 1556, 1683, 1719, - /* 530 */ 1539, 1701, 1577, 1581, 1722, 1724, 1590, 1583, 1729, 1725, - /* 540 */ 1733, 1734, 1632, 1633, 1696, 1704, 1545, 1730, 1641, 1613, - /* 550 */ 1645, 1737, 1703, 1607, 1646, 1640, 1697, 1711, 1541, 1543, - /* 560 */ 1557, 1712, 1501, 1658, 1661, 1678, 1680, 1684, 1686, 1715, - /* 570 */ 1694, 1698, 1699, 1705, 1708, 1732, 1745, 1746, 1713, 1752, - /* 580 */ 1553, 1709, 1714, 1793, 1754, 1615, 1766, 1767, 1768, 1772, - /* 590 */ 1774, 1777, 1718, 1720, 1769, 1616, 1775, 1771, 1773, 1818, - /* 600 */ 1799, 1619, 1728, 1731, 1735, 1736, 1738, 1739, 1779, 1741, - /* 610 */ 1743, 1780, 1744, 1806, 1624, 1748, 1749, 1755, 1796, 1804, - /* 620 */ 1762, 1764, 1807, 1763, 1770, 1830, 1776, 1778, 1833, 1781, - /* 630 */ 1782, 1837, 1784, 1751, 1756, 1758, 1761, 1851, 1783, 1786, - /* 640 */ 1789, 1850, 1791, 1844, 1844, 1866, 1826, 1687, 1857, 1859, - /* 650 */ 1860, 1864, 1878, 1879, 1880, 1881, 1882, 1883, 1765, 1827, - /* 660 */ 1885, 1886, 1888, 1902, 1901, 1916, 1904, 1905, 1907, 1874, - /* 670 */ 1643, 1909, 1653, 1910, 1911, 1912, 1913, 1928, 1917, 1953, - /* 680 */ 1922, 1918, 1929, 1967, 1934, 1925, 1935, 1973, 1940, 1930, - /* 690 */ 1937, 1979, 1946, 1936, 1943, 1985, 1951, 1961, 1997, 1976, - /* 700 */ 1978, 1981, 1982, 1980, 1986, + /* 0 */ 895, 0, 132, 0, 264, 264, 264, 264, 264, 264, + /* 10 */ 264, 264, 264, 396, 528, 528, 660, 528, 528, 528, + /* 20 */ 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + /* 30 */ 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + /* 40 */ 528, 528, 528, 528, 528, 528, 69, 224, 282, 14, + /* 50 */ 208, 193, 353, 193, 282, 282, 1023, 1023, 193, 1023, + /* 60 */ 1023, 89, 193, 71, 71, 23, 42, 42, 18, 71, + /* 70 */ 71, 71, 71, 71, 71, 71, 71, 71, 71, 129, + /* 80 */ 71, 71, 222, 71, 249, 71, 71, 307, 71, 71, + /* 90 */ 307, 71, 307, 307, 307, 71, 137, 223, 489, 489, + /* 100 */ 217, 145, 748, 748, 748, 748, 748, 748, 748, 748, + /* 110 */ 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, + /* 120 */ 748, 954, 31, 23, 18, 302, 302, 915, 263, 619, + /* 130 */ 619, 619, 969, 215, 215, 263, 369, 369, 369, 330, + /* 140 */ 249, 16, 16, 225, 307, 307, 449, 449, 330, 464, + /* 150 */ 733, 733, 733, 733, 733, 733, 733, 2434, 64, 1123, + /* 160 */ 246, 15, 389, 38, 261, 310, 372, 502, 901, 1005, + /* 170 */ 956, 951, 828, 922, 160, 828, 1047, 770, 870, 1041, + /* 180 */ 1239, 1124, 1259, 1286, 1259, 1160, 1294, 1294, 1259, 1160, + /* 190 */ 1160, 1230, 1294, 1294, 1294, 1315, 1315, 1320, 129, 249, + /* 200 */ 129, 1324, 1339, 129, 1324, 129, 129, 129, 1294, 129, + /* 210 */ 1328, 1328, 1315, 307, 307, 307, 307, 307, 307, 307, + /* 220 */ 307, 307, 307, 307, 1294, 1315, 449, 1203, 1320, 137, + /* 230 */ 1235, 249, 137, 1294, 1286, 1286, 449, 1169, 1197, 449, + /* 240 */ 1169, 1197, 449, 449, 307, 1199, 1296, 1169, 1208, 1210, + /* 250 */ 1229, 1041, 1219, 1228, 1234, 1257, 369, 1479, 1294, 1324, + /* 260 */ 137, 1197, 449, 449, 449, 449, 449, 1197, 449, 1357, + /* 270 */ 137, 330, 137, 369, 1456, 1459, 449, 464, 1294, 137, + /* 280 */ 1524, 1315, 2619, 2619, 2619, 2619, 2619, 2619, 2619, 821, + /* 290 */ 358, 432, 492, 662, 385, 688, 752, 785, 817, 933, + /* 300 */ 933, 439, 933, 933, 933, 933, 933, 933, 933, 1032, + /* 310 */ 946, 913, 368, 109, 109, 343, 530, 61, 801, 391, + /* 320 */ 119, 488, 417, 119, 119, 119, 1068, 287, 760, 1063, + /* 330 */ 953, 1018, 1066, 1072, 1073, 1085, 1087, 1134, 1170, 1044, + /* 340 */ 1070, 1089, 994, 952, 984, 1030, 1114, 1139, 1150, 1154, + /* 350 */ 1155, 1126, 1156, 1043, 1107, 1046, 1161, 1159, 1174, 1175, + /* 360 */ 1177, 1179, 1182, 1187, 1184, 1176, 1193, 1165, 1268, 1590, + /* 370 */ 1592, 1408, 1600, 1602, 1562, 1605, 1571, 1410, 1573, 1574, + /* 380 */ 1575, 1414, 1612, 1578, 1579, 1418, 1617, 1421, 1619, 1585, + /* 390 */ 1623, 1603, 1626, 1593, 1447, 1452, 1632, 1634, 1461, 1463, + /* 400 */ 1637, 1638, 1594, 1639, 1649, 1650, 1601, 1644, 1645, 1651, + /* 410 */ 1652, 1653, 1654, 1656, 1658, 1511, 1607, 1661, 1519, 1670, + /* 420 */ 1671, 1674, 1675, 1677, 1678, 1685, 1689, 1690, 1691, 1693, + /* 430 */ 1694, 1701, 1704, 1705, 1655, 1698, 1699, 1706, 1707, 1709, + /* 440 */ 1688, 1719, 1720, 1721, 1722, 1679, 1715, 1666, 1724, 1668, + /* 450 */ 1727, 1728, 1687, 1657, 1669, 1717, 1667, 1718, 1695, 1739, + /* 460 */ 1703, 1725, 1745, 1748, 1757, 1726, 1589, 1759, 1761, 1763, + /* 470 */ 1710, 1766, 1767, 1733, 1723, 1730, 1772, 1740, 1729, 1738, + /* 480 */ 1778, 1744, 1734, 1741, 1788, 1749, 1736, 1746, 1791, 1792, + /* 490 */ 1799, 1802, 1700, 1708, 1768, 1784, 1805, 1773, 1776, 1785, + /* 500 */ 1777, 1793, 1775, 1786, 1795, 1796, 1797, 1798, 1826, 1812, + /* 510 */ 1832, 1813, 1787, 1837, 1816, 1804, 1841, 1807, 1843, 1811, + /* 520 */ 1855, 1834, 1842, 1765, 1762, 1863, 1711, 1829, 1865, 1686, + /* 530 */ 1844, 1713, 1714, 1868, 1869, 1742, 1716, 1867, 1828, 1627, + /* 540 */ 1780, 1782, 1781, 1789, 1838, 1790, 1806, 1815, 1817, 1794, + /* 550 */ 1839, 1853, 1859, 1818, 1857, 1641, 1819, 1820, 1877, 1864, + /* 560 */ 1660, 1873, 1876, 1879, 1883, 1884, 1885, 1825, 1827, 1880, + /* 570 */ 1731, 1882, 1881, 1929, 1930, 1931, 1846, 1847, 1849, 1851, + /* 580 */ 1899, 1912, 1743, 1949, 1856, 1801, 1858, 1950, 1915, 1808, + /* 590 */ 1866, 1861, 1917, 1921, 1925, 1747, 1750, 1751, 1967, 1951, + /* 600 */ 1800, 1886, 1887, 1889, 1890, 1893, 1894, 1932, 1896, 1897, + /* 610 */ 1933, 1900, 1953, 1803, 1902, 1874, 1903, 1958, 1960, 1905, + /* 620 */ 1908, 1963, 1906, 1909, 1971, 1916, 1914, 1977, 1919, 1920, + /* 630 */ 1980, 1924, 1907, 1910, 1911, 1913, 2006, 1878, 1936, 1940, + /* 640 */ 2001, 1943, 1996, 1996, 2024, 1986, 1988, 2016, 2017, 2018, + /* 650 */ 2019, 2020, 2022, 2023, 2025, 2027, 2030, 1990, 1974, 2026, + /* 660 */ 2032, 2033, 2048, 2036, 2051, 2039, 2040, 2041, 2011, 1775, + /* 670 */ 2046, 1786, 2047, 2049, 2050, 2053, 2061, 2054, 2086, 2055, + /* 680 */ 2045, 2063, 2093, 2065, 2059, 2070, 2104, 2083, 2072, 2081, + /* 690 */ 2122, 2089, 2078, 2087, 2127, 2094, 2095, 2128, 2109, 2112, + /* 700 */ 2114, 2115, 2113, 2118, }; #define YY_REDUCE_COUNT (288) -#define YY_REDUCE_MIN (-357) -#define YY_REDUCE_MAX (2728) +#define YY_REDUCE_MIN (-407) +#define YY_REDUCE_MAX (2144) static const short yy_reduce_ofst[] = { - /* 0 */ 116, -321, 363, 862, 675, 973, 1028, 1084, 1139, 1158, - /* 10 */ 1255, 1276, 1361, 1446, 1502, 1531, 1560, 1589, 1656, 1672, - /* 20 */ 1727, 1747, 1812, 1870, 1884, 1942, 1956, 2009, 2064, 2080, - /* 30 */ 2135, 2151, 2207, 2223, 2279, 2295, 2362, 2387, 2448, 2501, - /* 40 */ 2519, 2575, 2589, 2645, 2661, 2728, -323, -334, 171, -275, - /* 50 */ -155, 2, 123, 134, 698, 868, -335, 560, -130, 233, - /* 60 */ 327, -133, -1, -322, 473, -347, -326, -312, -357, -319, - /* 70 */ -188, 215, 356, 364, 470, 481, 488, 502, 578, -110, - /* 80 */ 583, 598, 604, -99, 619, 631, -277, 687, 693, -166, - /* 90 */ 102, 709, 58, -85, 105, 729, -291, -211, -302, -302, - /* 100 */ -296, 11, -204, -42, 178, 203, 224, 266, 279, 300, - /* 110 */ 319, 434, 437, 456, 463, 577, 588, 600, 608, 610, - /* 120 */ 611, 42, 108, 195, -121, -298, 70, 106, 122, 309, - /* 130 */ 142, 397, 108, 274, 411, 310, -356, 400, 446, 427, - /* 140 */ 539, 465, 536, 568, 555, 337, 606, 620, 639, 587, - /* 150 */ -310, 641, 752, 753, 754, 757, 758, 591, 783, 803, - /* 160 */ 740, 673, 738, 863, 760, 847, 847, 871, 828, 875, - /* 170 */ 841, 831, 781, 781, 764, 781, 791, 786, 847, 830, - /* 180 */ 829, 839, 859, 867, 872, 873, 917, 918, 878, 882, - /* 190 */ 885, 914, 928, 929, 939, 948, 953, 889, 949, 915, - /* 200 */ 950, 904, 910, 961, 906, 962, 964, 965, 968, 966, - /* 210 */ 971, 972, 981, 954, 955, 956, 957, 959, 969, 970, - /* 220 */ 974, 976, 980, 983, 982, 989, 945, 925, 927, 984, - /* 230 */ 931, 987, 990, 994, 997, 938, 1004, 985, 977, 988, - /* 240 */ 991, 1000, 1005, 1001, 1002, 1006, 995, 1012, 1025, 992, - /* 250 */ 1014, 1016, 979, 1009, 1017, 1027, 999, 1019, 1031, 1033, - /* 260 */ 847, 911, 1011, 1008, 1010, 993, 1023, 1015, 951, 1013, - /* 270 */ 1024, 781, 1049, 1038, 996, 1059, 1051, 1075, 1091, 1089, - /* 280 */ 1099, 1096, 1052, 1056, 1094, 1102, 1106, 1116, 1133, + /* 0 */ 889, -320, -297, -165, 598, 621, 719, 778, 864, 893, + /* 10 */ 411, 955, 982, 231, 1009, 1026, 1080, 1136, 1180, 1196, + /* 20 */ 1264, 1281, 1335, 1351, 1395, 1422, 1449, 1493, 1537, 1557, + /* 30 */ 1622, 1642, 1696, 1712, 1756, 1783, 1810, 1854, 1898, 1918, + /* 40 */ 1983, 2003, 2057, 2073, 2117, 2144, 241, 86, -37, 536, + /* 50 */ 1013, 1067, 1081, 1125, 228, 291, -346, -87, -407, -166, + /* 60 */ -80, -372, -22, -276, -204, -308, -325, -319, -205, -192, + /* 70 */ 60, 74, 176, 202, 230, 234, 349, 429, 443, -78, + /* 80 */ 445, 584, 147, 627, -362, 632, 674, -245, 717, 721, + /* 90 */ 78, 773, -48, 81, -24, 338, -294, -144, -182, -182, + /* 100 */ -330, -142, -222, -210, -117, 178, 260, 342, 345, 392, + /* 110 */ 431, 459, 496, 594, 601, 602, 603, 607, 609, 612, + /* 120 */ 617, 405, -397, -106, 126, 185, 327, 427, 242, -397, + /* 130 */ 24, 533, 350, 161, 425, 469, 419, 444, 623, 346, + /* 140 */ 319, 481, 556, 247, 650, 570, 644, 677, 698, 665, + /* 150 */ 275, 377, 486, 499, 506, 564, 587, 657, 741, 792, + /* 160 */ 827, 755, 768, 881, 779, 867, 867, 890, 857, 904, + /* 170 */ 872, 862, 822, 822, 811, 822, 843, 853, 867, 897, + /* 180 */ 905, 914, 930, 936, 940, 938, 989, 991, 957, 958, + /* 190 */ 960, 987, 995, 996, 997, 1012, 1015, 962, 1006, 976, + /* 200 */ 1010, 970, 978, 1028, 983, 1029, 1031, 1033, 1040, 1053, + /* 210 */ 1057, 1058, 1051, 1045, 1049, 1054, 1061, 1064, 1071, 1078, + /* 220 */ 1082, 1083, 1084, 1086, 1062, 1079, 1050, 1052, 1016, 1100, + /* 230 */ 1034, 1076, 1106, 1090, 1069, 1077, 1088, 1017, 1091, 1094, + /* 240 */ 1020, 1092, 1095, 1098, 867, 1035, 1037, 1055, 1060, 1036, + /* 250 */ 1056, 1093, 1059, 1074, 1096, 822, 1140, 1109, 1183, 1122, + /* 260 */ 1181, 1129, 1152, 1157, 1158, 1163, 1168, 1141, 1178, 1186, + /* 270 */ 1211, 1198, 1217, 1166, 1137, 1201, 1190, 1216, 1236, 1226, + /* 280 */ 1240, 1243, 1191, 1189, 1218, 1238, 1242, 1255, 1252, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 10 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 20 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 30 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 40 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 50 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 60 */ 1582, 1582, 1582, 1582, 1582, 1835, 1582, 1582, 1582, 1582, - /* 70 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1658, - /* 80 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 90 */ 1582, 1582, 1582, 1582, 1582, 1582, 1656, 1828, 2025, 1582, - /* 100 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 110 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 120 */ 1582, 1582, 2037, 1582, 1582, 1582, 1582, 1658, 1582, 1656, - /* 130 */ 1997, 1997, 2037, 2037, 2037, 1582, 1582, 1582, 1582, 1767, - /* 140 */ 1582, 1877, 1877, 1582, 1582, 1582, 1582, 1582, 1767, 1582, - /* 150 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1871, 1582, 1582, - /* 160 */ 2062, 2115, 1582, 1582, 2065, 1582, 1582, 1582, 1840, 1582, - /* 170 */ 1720, 2052, 2029, 2043, 2099, 2030, 2027, 2046, 1582, 2056, - /* 180 */ 1582, 1864, 1833, 1582, 1833, 1830, 1582, 1582, 1833, 1830, - /* 190 */ 1830, 1711, 1582, 1582, 1582, 1582, 1582, 1582, 1658, 1582, - /* 200 */ 1658, 1582, 1582, 1658, 1582, 1658, 1658, 1658, 1582, 1658, - /* 210 */ 1637, 1637, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 220 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1884, 1582, 1656, - /* 230 */ 1873, 1582, 1656, 1582, 1582, 1582, 1656, 2070, 1582, 1582, - /* 240 */ 1582, 1582, 2070, 1582, 1582, 1656, 1582, 1656, 1582, 1582, - /* 250 */ 1582, 1582, 2072, 2070, 1582, 1582, 2072, 2070, 1582, 1582, - /* 260 */ 1582, 2084, 2080, 2072, 2088, 2086, 2058, 2056, 2118, 2105, - /* 270 */ 2101, 2043, 1582, 1582, 1582, 1736, 1582, 1582, 1582, 1656, - /* 280 */ 1614, 1582, 1866, 1877, 1770, 1770, 1770, 1659, 1587, 1582, - /* 290 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 300 */ 1953, 1582, 2083, 2082, 2001, 2000, 1999, 1990, 1952, 1582, - /* 310 */ 1732, 1582, 1582, 1951, 1950, 1582, 1582, 1582, 1582, 1582, - /* 320 */ 1944, 1582, 1582, 1945, 1943, 1942, 1582, 1582, 1582, 1582, - /* 330 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 340 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 2102, - /* 350 */ 2106, 2026, 1582, 1582, 1582, 1582, 1582, 1935, 1926, 1582, - /* 360 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 370 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 380 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 390 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 400 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 410 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 420 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 430 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 440 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 450 */ 1582, 1582, 1582, 1582, 1582, 1619, 1582, 1582, 1582, 1582, - /* 460 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 470 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 480 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 490 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 500 */ 1582, 1582, 1582, 1698, 1697, 1582, 1582, 1582, 1582, 1582, - /* 510 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 520 */ 1582, 1582, 1582, 1582, 1934, 1582, 1582, 1582, 1582, 1582, - /* 530 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 2098, 1582, - /* 540 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1881, 1582, 1582, - /* 550 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1987, 1582, 1582, - /* 560 */ 1582, 2059, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 570 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1926, 1582, 2081, - /* 580 */ 1582, 1582, 2096, 1582, 2100, 1582, 1582, 1582, 1582, 1582, - /* 590 */ 1582, 1582, 2036, 2032, 1582, 1582, 2028, 1925, 1582, 2021, - /* 600 */ 1582, 1582, 1972, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 610 */ 1582, 1582, 1934, 1582, 1938, 1582, 1582, 1582, 1582, 1582, - /* 620 */ 1764, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 630 */ 1582, 1582, 1582, 1749, 1747, 1746, 1745, 1582, 1742, 1582, - /* 640 */ 1582, 1582, 1582, 1773, 1772, 1582, 1582, 1582, 1582, 1582, - /* 650 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 660 */ 1678, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 670 */ 1669, 1582, 1668, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 680 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 690 */ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, - /* 700 */ 1582, 1582, 1582, 1582, 1582, + /* 0 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 10 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 20 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 30 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 40 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 50 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 60 */ 1579, 1579, 1579, 1579, 1579, 1832, 1579, 1579, 1579, 1579, + /* 70 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1655, + /* 80 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 90 */ 1579, 1579, 1579, 1579, 1579, 1579, 1653, 1825, 2021, 1579, + /* 100 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 110 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 120 */ 1579, 1579, 2033, 1579, 1579, 1579, 1579, 1655, 1579, 2033, + /* 130 */ 2033, 2033, 1653, 1993, 1993, 1579, 1579, 1579, 1579, 1764, + /* 140 */ 1579, 1874, 1874, 1579, 1579, 1579, 1579, 1579, 1764, 1579, + /* 150 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1868, 1579, 1579, + /* 160 */ 2058, 2111, 1579, 1579, 2061, 1579, 1579, 1579, 1837, 1579, + /* 170 */ 1717, 2048, 2025, 2039, 2095, 2026, 2023, 2042, 1579, 2052, + /* 180 */ 1579, 1861, 1830, 1579, 1830, 1827, 1579, 1579, 1830, 1827, + /* 190 */ 1827, 1708, 1579, 1579, 1579, 1579, 1579, 1579, 1655, 1579, + /* 200 */ 1655, 1579, 1579, 1655, 1579, 1655, 1655, 1655, 1579, 1655, + /* 210 */ 1634, 1634, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 220 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1881, 1579, 1653, + /* 230 */ 1870, 1579, 1653, 1579, 1579, 1579, 1579, 2068, 2066, 1579, + /* 240 */ 2068, 2066, 1579, 1579, 1579, 2080, 2076, 2068, 2084, 2082, + /* 250 */ 2054, 2052, 2114, 2101, 2097, 2039, 1579, 1579, 1579, 1579, + /* 260 */ 1653, 2066, 1579, 1579, 1579, 1579, 1579, 2066, 1579, 1579, + /* 270 */ 1653, 1579, 1653, 1579, 1579, 1733, 1579, 1579, 1579, 1653, + /* 280 */ 1611, 1579, 1863, 1874, 1767, 1767, 1767, 1656, 1584, 1579, + /* 290 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 2079, + /* 300 */ 2078, 1579, 1949, 1579, 1997, 1996, 1995, 1986, 1948, 1579, + /* 310 */ 1729, 1579, 1579, 1947, 1946, 1579, 1579, 1579, 1579, 1579, + /* 320 */ 1940, 1579, 1579, 1941, 1939, 1938, 1579, 1579, 1579, 1579, + /* 330 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 340 */ 1579, 1579, 1579, 2098, 2102, 1579, 1579, 1579, 1579, 1579, + /* 350 */ 1579, 2022, 1579, 1579, 1579, 1579, 1579, 1923, 1579, 1579, + /* 360 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 370 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 380 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 390 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 400 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 410 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 420 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 430 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 440 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 450 */ 1579, 1579, 1579, 1579, 1616, 1579, 1579, 1579, 1579, 1579, + /* 460 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 470 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 480 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 490 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 500 */ 1579, 1579, 1695, 1694, 1579, 1579, 1579, 1579, 1579, 1579, + /* 510 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 520 */ 1579, 1579, 1579, 1931, 1579, 1579, 1579, 1579, 1579, 1579, + /* 530 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 2094, 2055, 1579, + /* 540 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 550 */ 1579, 1579, 1923, 1579, 2077, 1579, 1579, 2092, 1579, 2096, + /* 560 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 2032, 2028, 1579, + /* 570 */ 1579, 2024, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 580 */ 1579, 1579, 1579, 1878, 1579, 1579, 1579, 1579, 1579, 1579, + /* 590 */ 1579, 1579, 1922, 1579, 1983, 1579, 1579, 1579, 2017, 1579, + /* 600 */ 1579, 1968, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 610 */ 1579, 1931, 1579, 1934, 1579, 1579, 1579, 1579, 1579, 1761, + /* 620 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 630 */ 1579, 1579, 1746, 1744, 1743, 1742, 1579, 1739, 1579, 1579, + /* 640 */ 1579, 1579, 1770, 1769, 1579, 1579, 1579, 1579, 1579, 1579, + /* 650 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1675, + /* 660 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1666, + /* 670 */ 1579, 1665, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 680 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 690 */ 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + /* 700 */ 1579, 1579, 1579, 1579, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1855,32 +1767,32 @@ static const char *const yyTokenName[] = { /* 396 */ "literal_list", /* 397 */ "table_alias", /* 398 */ "expr_or_subquery", - /* 399 */ "subquery", - /* 400 */ "pseudo_column", - /* 401 */ "column_reference", - /* 402 */ "function_expression", - /* 403 */ "case_when_expression", - /* 404 */ "star_func", - /* 405 */ "star_func_para_list", - /* 406 */ "noarg_func", - /* 407 */ "other_para_list", - /* 408 */ "star_func_para", - /* 409 */ "when_then_list", - /* 410 */ "case_when_else_opt", - /* 411 */ "common_expression", - /* 412 */ "when_then_expr", - /* 413 */ "predicate", - /* 414 */ "compare_op", - /* 415 */ "in_op", - /* 416 */ "in_predicate_value", - /* 417 */ "boolean_value_expression", - /* 418 */ "boolean_primary", - /* 419 */ "from_clause_opt", - /* 420 */ "table_reference_list", - /* 421 */ "table_reference", - /* 422 */ "table_primary", - /* 423 */ "joined_table", - /* 424 */ "alias_opt", + /* 399 */ "pseudo_column", + /* 400 */ "column_reference", + /* 401 */ "function_expression", + /* 402 */ "case_when_expression", + /* 403 */ "star_func", + /* 404 */ "star_func_para_list", + /* 405 */ "noarg_func", + /* 406 */ "other_para_list", + /* 407 */ "star_func_para", + /* 408 */ "when_then_list", + /* 409 */ "case_when_else_opt", + /* 410 */ "common_expression", + /* 411 */ "when_then_expr", + /* 412 */ "predicate", + /* 413 */ "compare_op", + /* 414 */ "in_op", + /* 415 */ "in_predicate_value", + /* 416 */ "boolean_value_expression", + /* 417 */ "boolean_primary", + /* 418 */ "from_clause_opt", + /* 419 */ "table_reference_list", + /* 420 */ "table_reference", + /* 421 */ "table_primary", + /* 422 */ "joined_table", + /* 423 */ "alias_opt", + /* 424 */ "subquery", /* 425 */ "parenthesized_joined_table", /* 426 */ "join_type", /* 427 */ "search_condition", @@ -2267,192 +2179,191 @@ static const char *const yyRuleName[] = { /* 347 */ "stream_name ::= NK_ID", /* 348 */ "cgroup_name ::= NK_ID", /* 349 */ "expr_or_subquery ::= expression", - /* 350 */ "expr_or_subquery ::= subquery", - /* 351 */ "expression ::= literal", - /* 352 */ "expression ::= pseudo_column", - /* 353 */ "expression ::= column_reference", - /* 354 */ "expression ::= function_expression", - /* 355 */ "expression ::= case_when_expression", - /* 356 */ "expression ::= NK_LP expression NK_RP", - /* 357 */ "expression ::= NK_PLUS expr_or_subquery", - /* 358 */ "expression ::= NK_MINUS expr_or_subquery", - /* 359 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 360 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 361 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 362 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 363 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 364 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 365 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 366 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 367 */ "expression_list ::= expr_or_subquery", - /* 368 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 369 */ "column_reference ::= column_name", - /* 370 */ "column_reference ::= table_name NK_DOT column_name", - /* 371 */ "pseudo_column ::= ROWTS", - /* 372 */ "pseudo_column ::= TBNAME", - /* 373 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 374 */ "pseudo_column ::= QSTART", - /* 375 */ "pseudo_column ::= QEND", - /* 376 */ "pseudo_column ::= QDURATION", - /* 377 */ "pseudo_column ::= WSTART", - /* 378 */ "pseudo_column ::= WEND", - /* 379 */ "pseudo_column ::= WDURATION", - /* 380 */ "pseudo_column ::= IROWTS", - /* 381 */ "pseudo_column ::= QTAGS", - /* 382 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 383 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 384 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 385 */ "function_expression ::= literal_func", - /* 386 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 387 */ "literal_func ::= NOW", - /* 388 */ "noarg_func ::= NOW", - /* 389 */ "noarg_func ::= TODAY", - /* 390 */ "noarg_func ::= TIMEZONE", - /* 391 */ "noarg_func ::= DATABASE", - /* 392 */ "noarg_func ::= CLIENT_VERSION", - /* 393 */ "noarg_func ::= SERVER_VERSION", - /* 394 */ "noarg_func ::= SERVER_STATUS", - /* 395 */ "noarg_func ::= CURRENT_USER", - /* 396 */ "noarg_func ::= USER", - /* 397 */ "star_func ::= COUNT", - /* 398 */ "star_func ::= FIRST", - /* 399 */ "star_func ::= LAST", - /* 400 */ "star_func ::= LAST_ROW", - /* 401 */ "star_func_para_list ::= NK_STAR", - /* 402 */ "star_func_para_list ::= other_para_list", - /* 403 */ "other_para_list ::= star_func_para", - /* 404 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 405 */ "star_func_para ::= expr_or_subquery", - /* 406 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 407 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 408 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 409 */ "when_then_list ::= when_then_expr", - /* 410 */ "when_then_list ::= when_then_list when_then_expr", - /* 411 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 412 */ "case_when_else_opt ::=", - /* 413 */ "case_when_else_opt ::= ELSE common_expression", - /* 414 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 415 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 416 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 417 */ "predicate ::= expr_or_subquery IS NULL", - /* 418 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 419 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 420 */ "compare_op ::= NK_LT", - /* 421 */ "compare_op ::= NK_GT", - /* 422 */ "compare_op ::= NK_LE", - /* 423 */ "compare_op ::= NK_GE", - /* 424 */ "compare_op ::= NK_NE", - /* 425 */ "compare_op ::= NK_EQ", - /* 426 */ "compare_op ::= LIKE", - /* 427 */ "compare_op ::= NOT LIKE", - /* 428 */ "compare_op ::= MATCH", - /* 429 */ "compare_op ::= NMATCH", - /* 430 */ "compare_op ::= CONTAINS", - /* 431 */ "in_op ::= IN", - /* 432 */ "in_op ::= NOT IN", - /* 433 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 434 */ "boolean_value_expression ::= boolean_primary", - /* 435 */ "boolean_value_expression ::= NOT boolean_primary", - /* 436 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 437 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 438 */ "boolean_primary ::= predicate", - /* 439 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 440 */ "common_expression ::= expr_or_subquery", - /* 441 */ "common_expression ::= boolean_value_expression", - /* 442 */ "from_clause_opt ::=", - /* 443 */ "from_clause_opt ::= FROM table_reference_list", - /* 444 */ "table_reference_list ::= table_reference", - /* 445 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 446 */ "table_reference ::= table_primary", - /* 447 */ "table_reference ::= joined_table", - /* 448 */ "table_primary ::= table_name alias_opt", - /* 449 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 450 */ "table_primary ::= subquery alias_opt", - /* 451 */ "table_primary ::= parenthesized_joined_table", - /* 452 */ "alias_opt ::=", - /* 453 */ "alias_opt ::= table_alias", - /* 454 */ "alias_opt ::= AS table_alias", - /* 455 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 456 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 457 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 458 */ "join_type ::=", - /* 459 */ "join_type ::= INNER", - /* 460 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 461 */ "set_quantifier_opt ::=", - /* 462 */ "set_quantifier_opt ::= DISTINCT", - /* 463 */ "set_quantifier_opt ::= ALL", - /* 464 */ "select_list ::= select_item", - /* 465 */ "select_list ::= select_list NK_COMMA select_item", - /* 466 */ "select_item ::= NK_STAR", - /* 467 */ "select_item ::= common_expression", - /* 468 */ "select_item ::= common_expression column_alias", - /* 469 */ "select_item ::= common_expression AS column_alias", - /* 470 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 471 */ "where_clause_opt ::=", - /* 472 */ "where_clause_opt ::= WHERE search_condition", - /* 473 */ "partition_by_clause_opt ::=", - /* 474 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 475 */ "partition_list ::= partition_item", - /* 476 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 477 */ "partition_item ::= expr_or_subquery", - /* 478 */ "partition_item ::= expr_or_subquery column_alias", - /* 479 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 480 */ "twindow_clause_opt ::=", - /* 481 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 482 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 483 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 484 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 485 */ "sliding_opt ::=", - /* 486 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 487 */ "fill_opt ::=", - /* 488 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 489 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 490 */ "fill_mode ::= NONE", - /* 491 */ "fill_mode ::= PREV", - /* 492 */ "fill_mode ::= NULL", - /* 493 */ "fill_mode ::= LINEAR", - /* 494 */ "fill_mode ::= NEXT", - /* 495 */ "group_by_clause_opt ::=", - /* 496 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 497 */ "group_by_list ::= expr_or_subquery", - /* 498 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 499 */ "having_clause_opt ::=", - /* 500 */ "having_clause_opt ::= HAVING search_condition", - /* 501 */ "range_opt ::=", - /* 502 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 503 */ "every_opt ::=", - /* 504 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 505 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 506 */ "query_simple ::= query_specification", - /* 507 */ "query_simple ::= union_query_expression", - /* 508 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 509 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 510 */ "query_simple_or_subquery ::= query_simple", - /* 511 */ "query_simple_or_subquery ::= subquery", - /* 512 */ "query_or_subquery ::= query_expression", - /* 513 */ "query_or_subquery ::= subquery", - /* 514 */ "order_by_clause_opt ::=", - /* 515 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 516 */ "slimit_clause_opt ::=", - /* 517 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 518 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 519 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 520 */ "limit_clause_opt ::=", - /* 521 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 522 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 523 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 524 */ "subquery ::= NK_LP query_expression NK_RP", - /* 525 */ "subquery ::= NK_LP subquery NK_RP", - /* 526 */ "search_condition ::= common_expression", - /* 527 */ "sort_specification_list ::= sort_specification", - /* 528 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 529 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 530 */ "ordering_specification_opt ::=", - /* 531 */ "ordering_specification_opt ::= ASC", - /* 532 */ "ordering_specification_opt ::= DESC", - /* 533 */ "null_ordering_opt ::=", - /* 534 */ "null_ordering_opt ::= NULLS FIRST", - /* 535 */ "null_ordering_opt ::= NULLS LAST", + /* 350 */ "expression ::= literal", + /* 351 */ "expression ::= pseudo_column", + /* 352 */ "expression ::= column_reference", + /* 353 */ "expression ::= function_expression", + /* 354 */ "expression ::= case_when_expression", + /* 355 */ "expression ::= NK_LP expression NK_RP", + /* 356 */ "expression ::= NK_PLUS expr_or_subquery", + /* 357 */ "expression ::= NK_MINUS expr_or_subquery", + /* 358 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 359 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 360 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 361 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 362 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 363 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 364 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 365 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 366 */ "expression_list ::= expr_or_subquery", + /* 367 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 368 */ "column_reference ::= column_name", + /* 369 */ "column_reference ::= table_name NK_DOT column_name", + /* 370 */ "pseudo_column ::= ROWTS", + /* 371 */ "pseudo_column ::= TBNAME", + /* 372 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 373 */ "pseudo_column ::= QSTART", + /* 374 */ "pseudo_column ::= QEND", + /* 375 */ "pseudo_column ::= QDURATION", + /* 376 */ "pseudo_column ::= WSTART", + /* 377 */ "pseudo_column ::= WEND", + /* 378 */ "pseudo_column ::= WDURATION", + /* 379 */ "pseudo_column ::= IROWTS", + /* 380 */ "pseudo_column ::= QTAGS", + /* 381 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 382 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 383 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 384 */ "function_expression ::= literal_func", + /* 385 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 386 */ "literal_func ::= NOW", + /* 387 */ "noarg_func ::= NOW", + /* 388 */ "noarg_func ::= TODAY", + /* 389 */ "noarg_func ::= TIMEZONE", + /* 390 */ "noarg_func ::= DATABASE", + /* 391 */ "noarg_func ::= CLIENT_VERSION", + /* 392 */ "noarg_func ::= SERVER_VERSION", + /* 393 */ "noarg_func ::= SERVER_STATUS", + /* 394 */ "noarg_func ::= CURRENT_USER", + /* 395 */ "noarg_func ::= USER", + /* 396 */ "star_func ::= COUNT", + /* 397 */ "star_func ::= FIRST", + /* 398 */ "star_func ::= LAST", + /* 399 */ "star_func ::= LAST_ROW", + /* 400 */ "star_func_para_list ::= NK_STAR", + /* 401 */ "star_func_para_list ::= other_para_list", + /* 402 */ "other_para_list ::= star_func_para", + /* 403 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 404 */ "star_func_para ::= expr_or_subquery", + /* 405 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 406 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 407 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 408 */ "when_then_list ::= when_then_expr", + /* 409 */ "when_then_list ::= when_then_list when_then_expr", + /* 410 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 411 */ "case_when_else_opt ::=", + /* 412 */ "case_when_else_opt ::= ELSE common_expression", + /* 413 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 414 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 415 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 416 */ "predicate ::= expr_or_subquery IS NULL", + /* 417 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 418 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 419 */ "compare_op ::= NK_LT", + /* 420 */ "compare_op ::= NK_GT", + /* 421 */ "compare_op ::= NK_LE", + /* 422 */ "compare_op ::= NK_GE", + /* 423 */ "compare_op ::= NK_NE", + /* 424 */ "compare_op ::= NK_EQ", + /* 425 */ "compare_op ::= LIKE", + /* 426 */ "compare_op ::= NOT LIKE", + /* 427 */ "compare_op ::= MATCH", + /* 428 */ "compare_op ::= NMATCH", + /* 429 */ "compare_op ::= CONTAINS", + /* 430 */ "in_op ::= IN", + /* 431 */ "in_op ::= NOT IN", + /* 432 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 433 */ "boolean_value_expression ::= boolean_primary", + /* 434 */ "boolean_value_expression ::= NOT boolean_primary", + /* 435 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 436 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 437 */ "boolean_primary ::= predicate", + /* 438 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 439 */ "common_expression ::= expr_or_subquery", + /* 440 */ "common_expression ::= boolean_value_expression", + /* 441 */ "from_clause_opt ::=", + /* 442 */ "from_clause_opt ::= FROM table_reference_list", + /* 443 */ "table_reference_list ::= table_reference", + /* 444 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 445 */ "table_reference ::= table_primary", + /* 446 */ "table_reference ::= joined_table", + /* 447 */ "table_primary ::= table_name alias_opt", + /* 448 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 449 */ "table_primary ::= subquery alias_opt", + /* 450 */ "table_primary ::= parenthesized_joined_table", + /* 451 */ "alias_opt ::=", + /* 452 */ "alias_opt ::= table_alias", + /* 453 */ "alias_opt ::= AS table_alias", + /* 454 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 455 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 456 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 457 */ "join_type ::=", + /* 458 */ "join_type ::= INNER", + /* 459 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 460 */ "set_quantifier_opt ::=", + /* 461 */ "set_quantifier_opt ::= DISTINCT", + /* 462 */ "set_quantifier_opt ::= ALL", + /* 463 */ "select_list ::= select_item", + /* 464 */ "select_list ::= select_list NK_COMMA select_item", + /* 465 */ "select_item ::= NK_STAR", + /* 466 */ "select_item ::= common_expression", + /* 467 */ "select_item ::= common_expression column_alias", + /* 468 */ "select_item ::= common_expression AS column_alias", + /* 469 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 470 */ "where_clause_opt ::=", + /* 471 */ "where_clause_opt ::= WHERE search_condition", + /* 472 */ "partition_by_clause_opt ::=", + /* 473 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 474 */ "partition_list ::= partition_item", + /* 475 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 476 */ "partition_item ::= expr_or_subquery", + /* 477 */ "partition_item ::= expr_or_subquery column_alias", + /* 478 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 479 */ "twindow_clause_opt ::=", + /* 480 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 481 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 482 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 483 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 484 */ "sliding_opt ::=", + /* 485 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 486 */ "fill_opt ::=", + /* 487 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 488 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 489 */ "fill_mode ::= NONE", + /* 490 */ "fill_mode ::= PREV", + /* 491 */ "fill_mode ::= NULL", + /* 492 */ "fill_mode ::= LINEAR", + /* 493 */ "fill_mode ::= NEXT", + /* 494 */ "group_by_clause_opt ::=", + /* 495 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 496 */ "group_by_list ::= expr_or_subquery", + /* 497 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 498 */ "having_clause_opt ::=", + /* 499 */ "having_clause_opt ::= HAVING search_condition", + /* 500 */ "range_opt ::=", + /* 501 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 502 */ "every_opt ::=", + /* 503 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 504 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 505 */ "query_simple ::= query_specification", + /* 506 */ "query_simple ::= union_query_expression", + /* 507 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 508 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 509 */ "query_simple_or_subquery ::= query_simple", + /* 510 */ "query_simple_or_subquery ::= subquery", + /* 511 */ "query_or_subquery ::= query_expression", + /* 512 */ "query_or_subquery ::= subquery", + /* 513 */ "order_by_clause_opt ::=", + /* 514 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 515 */ "slimit_clause_opt ::=", + /* 516 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 517 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 518 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 519 */ "limit_clause_opt ::=", + /* 520 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 521 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 522 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 523 */ "subquery ::= NK_LP query_expression NK_RP", + /* 524 */ "subquery ::= NK_LP subquery NK_RP", + /* 525 */ "search_condition ::= common_expression", + /* 526 */ "sort_specification_list ::= sort_specification", + /* 527 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 528 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 529 */ "ordering_specification_opt ::=", + /* 530 */ "ordering_specification_opt ::= ASC", + /* 531 */ "ordering_specification_opt ::= DESC", + /* 532 */ "null_ordering_opt ::=", + /* 533 */ "null_ordering_opt ::= NULLS FIRST", + /* 534 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2613,24 +2524,24 @@ static void yy_destructor( case 394: /* signed */ case 395: /* literal_func */ case 398: /* expr_or_subquery */ - case 399: /* subquery */ - case 400: /* pseudo_column */ - case 401: /* column_reference */ - case 402: /* function_expression */ - case 403: /* case_when_expression */ - case 408: /* star_func_para */ - case 410: /* case_when_else_opt */ - case 411: /* common_expression */ - case 412: /* when_then_expr */ - case 413: /* predicate */ - case 416: /* in_predicate_value */ - case 417: /* boolean_value_expression */ - case 418: /* boolean_primary */ - case 419: /* from_clause_opt */ - case 420: /* table_reference_list */ - case 421: /* table_reference */ - case 422: /* table_primary */ - case 423: /* joined_table */ + case 399: /* pseudo_column */ + case 400: /* column_reference */ + case 401: /* function_expression */ + case 402: /* case_when_expression */ + case 407: /* star_func_para */ + case 409: /* case_when_else_opt */ + case 410: /* common_expression */ + case 411: /* when_then_expr */ + case 412: /* predicate */ + case 415: /* in_predicate_value */ + case 416: /* boolean_value_expression */ + case 417: /* boolean_primary */ + case 418: /* from_clause_opt */ + case 419: /* table_reference_list */ + case 420: /* table_reference */ + case 421: /* table_primary */ + case 422: /* joined_table */ + case 424: /* subquery */ case 425: /* parenthesized_joined_table */ case 427: /* search_condition */ case 428: /* query_specification */ @@ -2673,9 +2584,9 @@ static void yy_destructor( case 384: /* cgroup_name */ case 389: /* stream_name */ case 397: /* table_alias */ - case 404: /* star_func */ - case 406: /* noarg_func */ - case 424: /* alias_opt */ + case 403: /* star_func */ + case 405: /* noarg_func */ + case 423: /* alias_opt */ { } @@ -2719,9 +2630,9 @@ static void yy_destructor( case 377: /* func_list */ case 392: /* dnode_list */ case 396: /* literal_list */ - case 405: /* star_func_para_list */ - case 407: /* other_para_list */ - case 409: /* when_then_list */ + case 404: /* star_func_para_list */ + case 406: /* other_para_list */ + case 408: /* when_then_list */ case 430: /* select_list */ case 431: /* partition_by_clause_opt */ case 436: /* group_by_clause_opt */ @@ -2744,8 +2655,8 @@ static void yy_destructor( } break; - case 414: /* compare_op */ - case 415: /* in_op */ + case 413: /* compare_op */ + case 414: /* in_op */ { } @@ -3414,192 +3325,191 @@ static const struct { { 389, -1 }, /* (347) stream_name ::= NK_ID */ { 384, -1 }, /* (348) cgroup_name ::= NK_ID */ { 398, -1 }, /* (349) expr_or_subquery ::= expression */ - { 398, -1 }, /* (350) expr_or_subquery ::= subquery */ - { 391, -1 }, /* (351) expression ::= literal */ - { 391, -1 }, /* (352) expression ::= pseudo_column */ - { 391, -1 }, /* (353) expression ::= column_reference */ - { 391, -1 }, /* (354) expression ::= function_expression */ - { 391, -1 }, /* (355) expression ::= case_when_expression */ - { 391, -3 }, /* (356) expression ::= NK_LP expression NK_RP */ - { 391, -2 }, /* (357) expression ::= NK_PLUS expr_or_subquery */ - { 391, -2 }, /* (358) expression ::= NK_MINUS expr_or_subquery */ - { 391, -3 }, /* (359) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - { 391, -3 }, /* (360) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - { 391, -3 }, /* (361) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - { 391, -3 }, /* (362) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - { 391, -3 }, /* (363) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - { 391, -3 }, /* (364) expression ::= column_reference NK_ARROW NK_STRING */ - { 391, -3 }, /* (365) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - { 391, -3 }, /* (366) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - { 357, -1 }, /* (367) expression_list ::= expr_or_subquery */ - { 357, -3 }, /* (368) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - { 401, -1 }, /* (369) column_reference ::= column_name */ - { 401, -3 }, /* (370) column_reference ::= table_name NK_DOT column_name */ - { 400, -1 }, /* (371) pseudo_column ::= ROWTS */ - { 400, -1 }, /* (372) pseudo_column ::= TBNAME */ - { 400, -3 }, /* (373) pseudo_column ::= table_name NK_DOT TBNAME */ - { 400, -1 }, /* (374) pseudo_column ::= QSTART */ - { 400, -1 }, /* (375) pseudo_column ::= QEND */ - { 400, -1 }, /* (376) pseudo_column ::= QDURATION */ - { 400, -1 }, /* (377) pseudo_column ::= WSTART */ - { 400, -1 }, /* (378) pseudo_column ::= WEND */ - { 400, -1 }, /* (379) pseudo_column ::= WDURATION */ - { 400, -1 }, /* (380) pseudo_column ::= IROWTS */ - { 400, -1 }, /* (381) pseudo_column ::= QTAGS */ - { 402, -4 }, /* (382) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 402, -4 }, /* (383) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 402, -6 }, /* (384) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - { 402, -1 }, /* (385) function_expression ::= literal_func */ - { 395, -3 }, /* (386) literal_func ::= noarg_func NK_LP NK_RP */ - { 395, -1 }, /* (387) literal_func ::= NOW */ - { 406, -1 }, /* (388) noarg_func ::= NOW */ - { 406, -1 }, /* (389) noarg_func ::= TODAY */ - { 406, -1 }, /* (390) noarg_func ::= TIMEZONE */ - { 406, -1 }, /* (391) noarg_func ::= DATABASE */ - { 406, -1 }, /* (392) noarg_func ::= CLIENT_VERSION */ - { 406, -1 }, /* (393) noarg_func ::= SERVER_VERSION */ - { 406, -1 }, /* (394) noarg_func ::= SERVER_STATUS */ - { 406, -1 }, /* (395) noarg_func ::= CURRENT_USER */ - { 406, -1 }, /* (396) noarg_func ::= USER */ - { 404, -1 }, /* (397) star_func ::= COUNT */ - { 404, -1 }, /* (398) star_func ::= FIRST */ - { 404, -1 }, /* (399) star_func ::= LAST */ - { 404, -1 }, /* (400) star_func ::= LAST_ROW */ - { 405, -1 }, /* (401) star_func_para_list ::= NK_STAR */ - { 405, -1 }, /* (402) star_func_para_list ::= other_para_list */ - { 407, -1 }, /* (403) other_para_list ::= star_func_para */ - { 407, -3 }, /* (404) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 408, -1 }, /* (405) star_func_para ::= expr_or_subquery */ - { 408, -3 }, /* (406) star_func_para ::= table_name NK_DOT NK_STAR */ - { 403, -4 }, /* (407) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - { 403, -5 }, /* (408) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - { 409, -1 }, /* (409) when_then_list ::= when_then_expr */ - { 409, -2 }, /* (410) when_then_list ::= when_then_list when_then_expr */ - { 412, -4 }, /* (411) when_then_expr ::= WHEN common_expression THEN common_expression */ - { 410, 0 }, /* (412) case_when_else_opt ::= */ - { 410, -2 }, /* (413) case_when_else_opt ::= ELSE common_expression */ - { 413, -3 }, /* (414) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - { 413, -5 }, /* (415) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - { 413, -6 }, /* (416) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - { 413, -3 }, /* (417) predicate ::= expr_or_subquery IS NULL */ - { 413, -4 }, /* (418) predicate ::= expr_or_subquery IS NOT NULL */ - { 413, -3 }, /* (419) predicate ::= expr_or_subquery in_op in_predicate_value */ - { 414, -1 }, /* (420) compare_op ::= NK_LT */ - { 414, -1 }, /* (421) compare_op ::= NK_GT */ - { 414, -1 }, /* (422) compare_op ::= NK_LE */ - { 414, -1 }, /* (423) compare_op ::= NK_GE */ - { 414, -1 }, /* (424) compare_op ::= NK_NE */ - { 414, -1 }, /* (425) compare_op ::= NK_EQ */ - { 414, -1 }, /* (426) compare_op ::= LIKE */ - { 414, -2 }, /* (427) compare_op ::= NOT LIKE */ - { 414, -1 }, /* (428) compare_op ::= MATCH */ - { 414, -1 }, /* (429) compare_op ::= NMATCH */ - { 414, -1 }, /* (430) compare_op ::= CONTAINS */ - { 415, -1 }, /* (431) in_op ::= IN */ - { 415, -2 }, /* (432) in_op ::= NOT IN */ - { 416, -3 }, /* (433) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 417, -1 }, /* (434) boolean_value_expression ::= boolean_primary */ - { 417, -2 }, /* (435) boolean_value_expression ::= NOT boolean_primary */ - { 417, -3 }, /* (436) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 417, -3 }, /* (437) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 418, -1 }, /* (438) boolean_primary ::= predicate */ - { 418, -3 }, /* (439) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 411, -1 }, /* (440) common_expression ::= expr_or_subquery */ - { 411, -1 }, /* (441) common_expression ::= boolean_value_expression */ - { 419, 0 }, /* (442) from_clause_opt ::= */ - { 419, -2 }, /* (443) from_clause_opt ::= FROM table_reference_list */ - { 420, -1 }, /* (444) table_reference_list ::= table_reference */ - { 420, -3 }, /* (445) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 421, -1 }, /* (446) table_reference ::= table_primary */ - { 421, -1 }, /* (447) table_reference ::= joined_table */ - { 422, -2 }, /* (448) table_primary ::= table_name alias_opt */ - { 422, -4 }, /* (449) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 422, -2 }, /* (450) table_primary ::= subquery alias_opt */ - { 422, -1 }, /* (451) table_primary ::= parenthesized_joined_table */ - { 424, 0 }, /* (452) alias_opt ::= */ - { 424, -1 }, /* (453) alias_opt ::= table_alias */ - { 424, -2 }, /* (454) alias_opt ::= AS table_alias */ - { 425, -3 }, /* (455) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 425, -3 }, /* (456) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 423, -6 }, /* (457) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 426, 0 }, /* (458) join_type ::= */ - { 426, -1 }, /* (459) join_type ::= INNER */ - { 428, -12 }, /* (460) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - { 429, 0 }, /* (461) set_quantifier_opt ::= */ - { 429, -1 }, /* (462) set_quantifier_opt ::= DISTINCT */ - { 429, -1 }, /* (463) set_quantifier_opt ::= ALL */ - { 430, -1 }, /* (464) select_list ::= select_item */ - { 430, -3 }, /* (465) select_list ::= select_list NK_COMMA select_item */ - { 438, -1 }, /* (466) select_item ::= NK_STAR */ - { 438, -1 }, /* (467) select_item ::= common_expression */ - { 438, -2 }, /* (468) select_item ::= common_expression column_alias */ - { 438, -3 }, /* (469) select_item ::= common_expression AS column_alias */ - { 438, -3 }, /* (470) select_item ::= table_name NK_DOT NK_STAR */ - { 393, 0 }, /* (471) where_clause_opt ::= */ - { 393, -2 }, /* (472) where_clause_opt ::= WHERE search_condition */ - { 431, 0 }, /* (473) partition_by_clause_opt ::= */ - { 431, -3 }, /* (474) partition_by_clause_opt ::= PARTITION BY partition_list */ - { 439, -1 }, /* (475) partition_list ::= partition_item */ - { 439, -3 }, /* (476) partition_list ::= partition_list NK_COMMA partition_item */ - { 440, -1 }, /* (477) partition_item ::= expr_or_subquery */ - { 440, -2 }, /* (478) partition_item ::= expr_or_subquery column_alias */ - { 440, -3 }, /* (479) partition_item ::= expr_or_subquery AS column_alias */ - { 435, 0 }, /* (480) twindow_clause_opt ::= */ - { 435, -6 }, /* (481) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 435, -4 }, /* (482) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - { 435, -6 }, /* (483) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 435, -8 }, /* (484) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 378, 0 }, /* (485) sliding_opt ::= */ - { 378, -4 }, /* (486) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 434, 0 }, /* (487) fill_opt ::= */ - { 434, -4 }, /* (488) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 434, -6 }, /* (489) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 441, -1 }, /* (490) fill_mode ::= NONE */ - { 441, -1 }, /* (491) fill_mode ::= PREV */ - { 441, -1 }, /* (492) fill_mode ::= NULL */ - { 441, -1 }, /* (493) fill_mode ::= LINEAR */ - { 441, -1 }, /* (494) fill_mode ::= NEXT */ - { 436, 0 }, /* (495) group_by_clause_opt ::= */ - { 436, -3 }, /* (496) group_by_clause_opt ::= GROUP BY group_by_list */ - { 442, -1 }, /* (497) group_by_list ::= expr_or_subquery */ - { 442, -3 }, /* (498) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - { 437, 0 }, /* (499) having_clause_opt ::= */ - { 437, -2 }, /* (500) having_clause_opt ::= HAVING search_condition */ - { 432, 0 }, /* (501) range_opt ::= */ - { 432, -6 }, /* (502) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - { 433, 0 }, /* (503) every_opt ::= */ - { 433, -4 }, /* (504) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 443, -4 }, /* (505) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 444, -1 }, /* (506) query_simple ::= query_specification */ - { 444, -1 }, /* (507) query_simple ::= union_query_expression */ - { 448, -4 }, /* (508) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - { 448, -3 }, /* (509) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - { 449, -1 }, /* (510) query_simple_or_subquery ::= query_simple */ - { 449, -1 }, /* (511) query_simple_or_subquery ::= subquery */ - { 383, -1 }, /* (512) query_or_subquery ::= query_expression */ - { 383, -1 }, /* (513) query_or_subquery ::= subquery */ - { 445, 0 }, /* (514) order_by_clause_opt ::= */ - { 445, -3 }, /* (515) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 446, 0 }, /* (516) slimit_clause_opt ::= */ - { 446, -2 }, /* (517) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 446, -4 }, /* (518) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 446, -4 }, /* (519) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 447, 0 }, /* (520) limit_clause_opt ::= */ - { 447, -2 }, /* (521) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 447, -4 }, /* (522) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 447, -4 }, /* (523) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 399, -3 }, /* (524) subquery ::= NK_LP query_expression NK_RP */ - { 399, -3 }, /* (525) subquery ::= NK_LP subquery NK_RP */ - { 427, -1 }, /* (526) search_condition ::= common_expression */ - { 450, -1 }, /* (527) sort_specification_list ::= sort_specification */ - { 450, -3 }, /* (528) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 451, -3 }, /* (529) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - { 452, 0 }, /* (530) ordering_specification_opt ::= */ - { 452, -1 }, /* (531) ordering_specification_opt ::= ASC */ - { 452, -1 }, /* (532) ordering_specification_opt ::= DESC */ - { 453, 0 }, /* (533) null_ordering_opt ::= */ - { 453, -2 }, /* (534) null_ordering_opt ::= NULLS FIRST */ - { 453, -2 }, /* (535) null_ordering_opt ::= NULLS LAST */ + { 391, -1 }, /* (350) expression ::= literal */ + { 391, -1 }, /* (351) expression ::= pseudo_column */ + { 391, -1 }, /* (352) expression ::= column_reference */ + { 391, -1 }, /* (353) expression ::= function_expression */ + { 391, -1 }, /* (354) expression ::= case_when_expression */ + { 391, -3 }, /* (355) expression ::= NK_LP expression NK_RP */ + { 391, -2 }, /* (356) expression ::= NK_PLUS expr_or_subquery */ + { 391, -2 }, /* (357) expression ::= NK_MINUS expr_or_subquery */ + { 391, -3 }, /* (358) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + { 391, -3 }, /* (359) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + { 391, -3 }, /* (360) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + { 391, -3 }, /* (361) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + { 391, -3 }, /* (362) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + { 391, -3 }, /* (363) expression ::= column_reference NK_ARROW NK_STRING */ + { 391, -3 }, /* (364) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + { 391, -3 }, /* (365) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + { 357, -1 }, /* (366) expression_list ::= expr_or_subquery */ + { 357, -3 }, /* (367) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + { 400, -1 }, /* (368) column_reference ::= column_name */ + { 400, -3 }, /* (369) column_reference ::= table_name NK_DOT column_name */ + { 399, -1 }, /* (370) pseudo_column ::= ROWTS */ + { 399, -1 }, /* (371) pseudo_column ::= TBNAME */ + { 399, -3 }, /* (372) pseudo_column ::= table_name NK_DOT TBNAME */ + { 399, -1 }, /* (373) pseudo_column ::= QSTART */ + { 399, -1 }, /* (374) pseudo_column ::= QEND */ + { 399, -1 }, /* (375) pseudo_column ::= QDURATION */ + { 399, -1 }, /* (376) pseudo_column ::= WSTART */ + { 399, -1 }, /* (377) pseudo_column ::= WEND */ + { 399, -1 }, /* (378) pseudo_column ::= WDURATION */ + { 399, -1 }, /* (379) pseudo_column ::= IROWTS */ + { 399, -1 }, /* (380) pseudo_column ::= QTAGS */ + { 401, -4 }, /* (381) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 401, -4 }, /* (382) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 401, -6 }, /* (383) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + { 401, -1 }, /* (384) function_expression ::= literal_func */ + { 395, -3 }, /* (385) literal_func ::= noarg_func NK_LP NK_RP */ + { 395, -1 }, /* (386) literal_func ::= NOW */ + { 405, -1 }, /* (387) noarg_func ::= NOW */ + { 405, -1 }, /* (388) noarg_func ::= TODAY */ + { 405, -1 }, /* (389) noarg_func ::= TIMEZONE */ + { 405, -1 }, /* (390) noarg_func ::= DATABASE */ + { 405, -1 }, /* (391) noarg_func ::= CLIENT_VERSION */ + { 405, -1 }, /* (392) noarg_func ::= SERVER_VERSION */ + { 405, -1 }, /* (393) noarg_func ::= SERVER_STATUS */ + { 405, -1 }, /* (394) noarg_func ::= CURRENT_USER */ + { 405, -1 }, /* (395) noarg_func ::= USER */ + { 403, -1 }, /* (396) star_func ::= COUNT */ + { 403, -1 }, /* (397) star_func ::= FIRST */ + { 403, -1 }, /* (398) star_func ::= LAST */ + { 403, -1 }, /* (399) star_func ::= LAST_ROW */ + { 404, -1 }, /* (400) star_func_para_list ::= NK_STAR */ + { 404, -1 }, /* (401) star_func_para_list ::= other_para_list */ + { 406, -1 }, /* (402) other_para_list ::= star_func_para */ + { 406, -3 }, /* (403) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 407, -1 }, /* (404) star_func_para ::= expr_or_subquery */ + { 407, -3 }, /* (405) star_func_para ::= table_name NK_DOT NK_STAR */ + { 402, -4 }, /* (406) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + { 402, -5 }, /* (407) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + { 408, -1 }, /* (408) when_then_list ::= when_then_expr */ + { 408, -2 }, /* (409) when_then_list ::= when_then_list when_then_expr */ + { 411, -4 }, /* (410) when_then_expr ::= WHEN common_expression THEN common_expression */ + { 409, 0 }, /* (411) case_when_else_opt ::= */ + { 409, -2 }, /* (412) case_when_else_opt ::= ELSE common_expression */ + { 412, -3 }, /* (413) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + { 412, -5 }, /* (414) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + { 412, -6 }, /* (415) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + { 412, -3 }, /* (416) predicate ::= expr_or_subquery IS NULL */ + { 412, -4 }, /* (417) predicate ::= expr_or_subquery IS NOT NULL */ + { 412, -3 }, /* (418) predicate ::= expr_or_subquery in_op in_predicate_value */ + { 413, -1 }, /* (419) compare_op ::= NK_LT */ + { 413, -1 }, /* (420) compare_op ::= NK_GT */ + { 413, -1 }, /* (421) compare_op ::= NK_LE */ + { 413, -1 }, /* (422) compare_op ::= NK_GE */ + { 413, -1 }, /* (423) compare_op ::= NK_NE */ + { 413, -1 }, /* (424) compare_op ::= NK_EQ */ + { 413, -1 }, /* (425) compare_op ::= LIKE */ + { 413, -2 }, /* (426) compare_op ::= NOT LIKE */ + { 413, -1 }, /* (427) compare_op ::= MATCH */ + { 413, -1 }, /* (428) compare_op ::= NMATCH */ + { 413, -1 }, /* (429) compare_op ::= CONTAINS */ + { 414, -1 }, /* (430) in_op ::= IN */ + { 414, -2 }, /* (431) in_op ::= NOT IN */ + { 415, -3 }, /* (432) in_predicate_value ::= NK_LP literal_list NK_RP */ + { 416, -1 }, /* (433) boolean_value_expression ::= boolean_primary */ + { 416, -2 }, /* (434) boolean_value_expression ::= NOT boolean_primary */ + { 416, -3 }, /* (435) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 416, -3 }, /* (436) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 417, -1 }, /* (437) boolean_primary ::= predicate */ + { 417, -3 }, /* (438) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 410, -1 }, /* (439) common_expression ::= expr_or_subquery */ + { 410, -1 }, /* (440) common_expression ::= boolean_value_expression */ + { 418, 0 }, /* (441) from_clause_opt ::= */ + { 418, -2 }, /* (442) from_clause_opt ::= FROM table_reference_list */ + { 419, -1 }, /* (443) table_reference_list ::= table_reference */ + { 419, -3 }, /* (444) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 420, -1 }, /* (445) table_reference ::= table_primary */ + { 420, -1 }, /* (446) table_reference ::= joined_table */ + { 421, -2 }, /* (447) table_primary ::= table_name alias_opt */ + { 421, -4 }, /* (448) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 421, -2 }, /* (449) table_primary ::= subquery alias_opt */ + { 421, -1 }, /* (450) table_primary ::= parenthesized_joined_table */ + { 423, 0 }, /* (451) alias_opt ::= */ + { 423, -1 }, /* (452) alias_opt ::= table_alias */ + { 423, -2 }, /* (453) alias_opt ::= AS table_alias */ + { 425, -3 }, /* (454) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 425, -3 }, /* (455) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 422, -6 }, /* (456) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 426, 0 }, /* (457) join_type ::= */ + { 426, -1 }, /* (458) join_type ::= INNER */ + { 428, -12 }, /* (459) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { 429, 0 }, /* (460) set_quantifier_opt ::= */ + { 429, -1 }, /* (461) set_quantifier_opt ::= DISTINCT */ + { 429, -1 }, /* (462) set_quantifier_opt ::= ALL */ + { 430, -1 }, /* (463) select_list ::= select_item */ + { 430, -3 }, /* (464) select_list ::= select_list NK_COMMA select_item */ + { 438, -1 }, /* (465) select_item ::= NK_STAR */ + { 438, -1 }, /* (466) select_item ::= common_expression */ + { 438, -2 }, /* (467) select_item ::= common_expression column_alias */ + { 438, -3 }, /* (468) select_item ::= common_expression AS column_alias */ + { 438, -3 }, /* (469) select_item ::= table_name NK_DOT NK_STAR */ + { 393, 0 }, /* (470) where_clause_opt ::= */ + { 393, -2 }, /* (471) where_clause_opt ::= WHERE search_condition */ + { 431, 0 }, /* (472) partition_by_clause_opt ::= */ + { 431, -3 }, /* (473) partition_by_clause_opt ::= PARTITION BY partition_list */ + { 439, -1 }, /* (474) partition_list ::= partition_item */ + { 439, -3 }, /* (475) partition_list ::= partition_list NK_COMMA partition_item */ + { 440, -1 }, /* (476) partition_item ::= expr_or_subquery */ + { 440, -2 }, /* (477) partition_item ::= expr_or_subquery column_alias */ + { 440, -3 }, /* (478) partition_item ::= expr_or_subquery AS column_alias */ + { 435, 0 }, /* (479) twindow_clause_opt ::= */ + { 435, -6 }, /* (480) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 435, -4 }, /* (481) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + { 435, -6 }, /* (482) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 435, -8 }, /* (483) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 378, 0 }, /* (484) sliding_opt ::= */ + { 378, -4 }, /* (485) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 434, 0 }, /* (486) fill_opt ::= */ + { 434, -4 }, /* (487) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 434, -6 }, /* (488) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 441, -1 }, /* (489) fill_mode ::= NONE */ + { 441, -1 }, /* (490) fill_mode ::= PREV */ + { 441, -1 }, /* (491) fill_mode ::= NULL */ + { 441, -1 }, /* (492) fill_mode ::= LINEAR */ + { 441, -1 }, /* (493) fill_mode ::= NEXT */ + { 436, 0 }, /* (494) group_by_clause_opt ::= */ + { 436, -3 }, /* (495) group_by_clause_opt ::= GROUP BY group_by_list */ + { 442, -1 }, /* (496) group_by_list ::= expr_or_subquery */ + { 442, -3 }, /* (497) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + { 437, 0 }, /* (498) having_clause_opt ::= */ + { 437, -2 }, /* (499) having_clause_opt ::= HAVING search_condition */ + { 432, 0 }, /* (500) range_opt ::= */ + { 432, -6 }, /* (501) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + { 433, 0 }, /* (502) every_opt ::= */ + { 433, -4 }, /* (503) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 443, -4 }, /* (504) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 444, -1 }, /* (505) query_simple ::= query_specification */ + { 444, -1 }, /* (506) query_simple ::= union_query_expression */ + { 448, -4 }, /* (507) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + { 448, -3 }, /* (508) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + { 449, -1 }, /* (509) query_simple_or_subquery ::= query_simple */ + { 449, -1 }, /* (510) query_simple_or_subquery ::= subquery */ + { 383, -1 }, /* (511) query_or_subquery ::= query_expression */ + { 383, -1 }, /* (512) query_or_subquery ::= subquery */ + { 445, 0 }, /* (513) order_by_clause_opt ::= */ + { 445, -3 }, /* (514) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 446, 0 }, /* (515) slimit_clause_opt ::= */ + { 446, -2 }, /* (516) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 446, -4 }, /* (517) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 446, -4 }, /* (518) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 447, 0 }, /* (519) limit_clause_opt ::= */ + { 447, -2 }, /* (520) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 447, -4 }, /* (521) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 447, -4 }, /* (522) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 424, -3 }, /* (523) subquery ::= NK_LP query_expression NK_RP */ + { 424, -3 }, /* (524) subquery ::= NK_LP subquery NK_RP */ + { 427, -1 }, /* (525) search_condition ::= common_expression */ + { 450, -1 }, /* (526) sort_specification_list ::= sort_specification */ + { 450, -3 }, /* (527) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 451, -3 }, /* (528) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + { 452, 0 }, /* (529) ordering_specification_opt ::= */ + { 452, -1 }, /* (530) ordering_specification_opt ::= ASC */ + { 452, -1 }, /* (531) ordering_specification_opt ::= DESC */ + { 453, 0 }, /* (532) null_ordering_opt ::= */ + { 453, -2 }, /* (533) null_ordering_opt ::= NULLS FIRST */ + { 453, -2 }, /* (534) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3825,19 +3735,19 @@ static YYACTIONTYPE yy_reduce( case 346: /* topic_name ::= NK_ID */ yytestcase(yyruleno==346); case 347: /* stream_name ::= NK_ID */ yytestcase(yyruleno==347); case 348: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==348); - case 388: /* noarg_func ::= NOW */ yytestcase(yyruleno==388); - case 389: /* noarg_func ::= TODAY */ yytestcase(yyruleno==389); - case 390: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==390); - case 391: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==391); - case 392: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==392); - case 393: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==393); - case 394: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==394); - case 395: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==395); - case 396: /* noarg_func ::= USER */ yytestcase(yyruleno==396); - case 397: /* star_func ::= COUNT */ yytestcase(yyruleno==397); - case 398: /* star_func ::= FIRST */ yytestcase(yyruleno==398); - case 399: /* star_func ::= LAST */ yytestcase(yyruleno==399); - case 400: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==400); + case 387: /* noarg_func ::= NOW */ yytestcase(yyruleno==387); + case 388: /* noarg_func ::= TODAY */ yytestcase(yyruleno==388); + case 389: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==389); + case 390: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==390); + case 391: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==391); + case 392: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==392); + case 393: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==393); + case 394: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==394); + case 395: /* noarg_func ::= USER */ yytestcase(yyruleno==395); + case 396: /* star_func ::= COUNT */ yytestcase(yyruleno==396); + case 397: /* star_func ::= FIRST */ yytestcase(yyruleno==397); + case 398: /* star_func ::= LAST */ yytestcase(yyruleno==398); + case 399: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==399); { yylhsminor.yy593 = yymsp[0].minor.yy0; } yymsp[0].minor.yy593 = yylhsminor.yy593; break; @@ -3846,13 +3756,13 @@ static YYACTIONTYPE yy_reduce( case 73: /* exists_opt ::= */ yytestcase(yyruleno==73); case 279: /* analyze_opt ::= */ yytestcase(yyruleno==279); case 286: /* agg_func_opt ::= */ yytestcase(yyruleno==286); - case 461: /* set_quantifier_opt ::= */ yytestcase(yyruleno==461); + case 460: /* set_quantifier_opt ::= */ yytestcase(yyruleno==460); { yymsp[1].minor.yy193 = false; } break; case 53: /* force_opt ::= FORCE */ case 280: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==280); case 287: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==287); - case 462: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==462); + case 461: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==461); { yymsp[0].minor.yy193 = true; } break; case 54: /* cmd ::= ALTER LOCAL NK_STRING */ @@ -4103,11 +4013,11 @@ static YYACTIONTYPE yy_reduce( case 251: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==251); case 262: /* func_list ::= func */ yytestcase(yyruleno==262); case 337: /* literal_list ::= signed_literal */ yytestcase(yyruleno==337); - case 403: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==403); - case 409: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==409); - case 464: /* select_list ::= select_item */ yytestcase(yyruleno==464); - case 475: /* partition_list ::= partition_item */ yytestcase(yyruleno==475); - case 527: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==527); + case 402: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==402); + case 408: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==408); + case 463: /* select_list ::= select_item */ yytestcase(yyruleno==463); + case 474: /* partition_list ::= partition_item */ yytestcase(yyruleno==474); + case 526: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==526); { yylhsminor.yy648 = createNodeList(pCxt, yymsp[0].minor.yy164); } yymsp[0].minor.yy648 = yylhsminor.yy648; break; @@ -4118,10 +4028,10 @@ static YYACTIONTYPE yy_reduce( case 252: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==252); case 263: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==263); case 338: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==338); - case 404: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==404); - case 465: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==465); - case 476: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==476); - case 528: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==528); + case 403: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==403); + case 464: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==464); + case 475: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==475); + case 527: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==527); { yylhsminor.yy648 = addNodeToList(pCxt, yymsp[-2].minor.yy648, yymsp[0].minor.yy164); } yymsp[-2].minor.yy648 = yylhsminor.yy648; break; @@ -4199,7 +4109,7 @@ static YYACTIONTYPE yy_reduce( break; case 146: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 149: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==149); - case 410: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==410); + case 409: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==409); { yylhsminor.yy648 = addNodeToList(pCxt, yymsp[-1].minor.yy648, yymsp[0].minor.yy164); } yymsp[-1].minor.yy648 = yylhsminor.yy648; break; @@ -4214,9 +4124,9 @@ static YYACTIONTYPE yy_reduce( case 151: /* specific_cols_opt ::= */ case 182: /* tags_def_opt ::= */ yytestcase(yyruleno==182); case 250: /* tag_list_opt ::= */ yytestcase(yyruleno==250); - case 473: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==473); - case 495: /* group_by_clause_opt ::= */ yytestcase(yyruleno==495); - case 514: /* order_by_clause_opt ::= */ yytestcase(yyruleno==514); + case 472: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==472); + case 494: /* group_by_clause_opt ::= */ yytestcase(yyruleno==494); + case 513: /* order_by_clause_opt ::= */ yytestcase(yyruleno==513); { yymsp[1].minor.yy648 = NULL; } break; case 152: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ @@ -4306,7 +4216,7 @@ static YYACTIONTYPE yy_reduce( { yymsp[-5].minor.yy720 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 183: /* tags_def_opt ::= tags_def */ - case 402: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==402); + case 401: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==401); { yylhsminor.yy648 = yymsp[0].minor.yy648; } yymsp[0].minor.yy648 = yylhsminor.yy648; break; @@ -4355,12 +4265,12 @@ static YYACTIONTYPE yy_reduce( { yymsp[-1].minor.yy213.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy213.val = yymsp[0].minor.yy0; } break; case 196: /* duration_list ::= duration_literal */ - case 367: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==367); + case 366: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==366); { yylhsminor.yy648 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy164)); } yymsp[0].minor.yy648 = yylhsminor.yy648; break; case 197: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 368: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==368); + case 367: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==367); { yylhsminor.yy648 = addNodeToList(pCxt, yymsp[-2].minor.yy648, releaseRawExprNode(pCxt, yymsp[0].minor.yy164)); } yymsp[-2].minor.yy648 = yylhsminor.yy648; break; @@ -4496,17 +4406,17 @@ static YYACTIONTYPE yy_reduce( break; case 245: /* like_pattern_opt ::= */ case 299: /* subtable_opt ::= */ yytestcase(yyruleno==299); - case 412: /* case_when_else_opt ::= */ yytestcase(yyruleno==412); - case 442: /* from_clause_opt ::= */ yytestcase(yyruleno==442); - case 471: /* where_clause_opt ::= */ yytestcase(yyruleno==471); - case 480: /* twindow_clause_opt ::= */ yytestcase(yyruleno==480); - case 485: /* sliding_opt ::= */ yytestcase(yyruleno==485); - case 487: /* fill_opt ::= */ yytestcase(yyruleno==487); - case 499: /* having_clause_opt ::= */ yytestcase(yyruleno==499); - case 501: /* range_opt ::= */ yytestcase(yyruleno==501); - case 503: /* every_opt ::= */ yytestcase(yyruleno==503); - case 516: /* slimit_clause_opt ::= */ yytestcase(yyruleno==516); - case 520: /* limit_clause_opt ::= */ yytestcase(yyruleno==520); + case 411: /* case_when_else_opt ::= */ yytestcase(yyruleno==411); + case 441: /* from_clause_opt ::= */ yytestcase(yyruleno==441); + case 470: /* where_clause_opt ::= */ yytestcase(yyruleno==470); + case 479: /* twindow_clause_opt ::= */ yytestcase(yyruleno==479); + case 484: /* sliding_opt ::= */ yytestcase(yyruleno==484); + case 486: /* fill_opt ::= */ yytestcase(yyruleno==486); + case 498: /* having_clause_opt ::= */ yytestcase(yyruleno==498); + case 500: /* range_opt ::= */ yytestcase(yyruleno==500); + case 502: /* every_opt ::= */ yytestcase(yyruleno==502); + case 515: /* slimit_clause_opt ::= */ yytestcase(yyruleno==515); + case 519: /* limit_clause_opt ::= */ yytestcase(yyruleno==519); { yymsp[1].minor.yy164 = NULL; } break; case 246: /* like_pattern_opt ::= LIKE NK_STRING */ @@ -4635,8 +4545,8 @@ static YYACTIONTYPE yy_reduce( yymsp[-2].minor.yy164 = yylhsminor.yy164; break; case 300: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 486: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==486); - case 504: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==504); + case 485: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==485); + case 503: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==503); { yymsp[-3].minor.yy164 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy164); } break; case 301: /* cmd ::= KILL CONNECTION NK_INTEGER */ @@ -4695,25 +4605,24 @@ static YYACTIONTYPE yy_reduce( case 319: /* literal ::= duration_literal */ case 329: /* signed_literal ::= signed */ yytestcase(yyruleno==329); case 349: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==349); - case 350: /* expr_or_subquery ::= subquery */ yytestcase(yyruleno==350); - case 351: /* expression ::= literal */ yytestcase(yyruleno==351); - case 352: /* expression ::= pseudo_column */ yytestcase(yyruleno==352); - case 353: /* expression ::= column_reference */ yytestcase(yyruleno==353); - case 354: /* expression ::= function_expression */ yytestcase(yyruleno==354); - case 355: /* expression ::= case_when_expression */ yytestcase(yyruleno==355); - case 385: /* function_expression ::= literal_func */ yytestcase(yyruleno==385); - case 434: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==434); - case 438: /* boolean_primary ::= predicate */ yytestcase(yyruleno==438); - case 440: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==440); - case 441: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==441); - case 444: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==444); - case 446: /* table_reference ::= table_primary */ yytestcase(yyruleno==446); - case 447: /* table_reference ::= joined_table */ yytestcase(yyruleno==447); - case 451: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==451); - case 506: /* query_simple ::= query_specification */ yytestcase(yyruleno==506); - case 507: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==507); - case 510: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==510); - case 512: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==512); + case 350: /* expression ::= literal */ yytestcase(yyruleno==350); + case 351: /* expression ::= pseudo_column */ yytestcase(yyruleno==351); + case 352: /* expression ::= column_reference */ yytestcase(yyruleno==352); + case 353: /* expression ::= function_expression */ yytestcase(yyruleno==353); + case 354: /* expression ::= case_when_expression */ yytestcase(yyruleno==354); + case 384: /* function_expression ::= literal_func */ yytestcase(yyruleno==384); + case 433: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==433); + case 437: /* boolean_primary ::= predicate */ yytestcase(yyruleno==437); + case 439: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==439); + case 440: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==440); + case 443: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==443); + case 445: /* table_reference ::= table_primary */ yytestcase(yyruleno==445); + case 446: /* table_reference ::= joined_table */ yytestcase(yyruleno==446); + case 450: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==450); + case 505: /* query_simple ::= query_specification */ yytestcase(yyruleno==505); + case 506: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==506); + case 509: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==509); + case 511: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==511); { yylhsminor.yy164 = yymsp[0].minor.yy164; } yymsp[0].minor.yy164 = yylhsminor.yy164; break; @@ -4772,12 +4681,12 @@ static YYACTIONTYPE yy_reduce( break; case 333: /* signed_literal ::= duration_literal */ case 335: /* signed_literal ::= literal_func */ yytestcase(yyruleno==335); - case 405: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==405); - case 467: /* select_item ::= common_expression */ yytestcase(yyruleno==467); - case 477: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==477); - case 511: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==511); - case 513: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==513); - case 526: /* search_condition ::= common_expression */ yytestcase(yyruleno==526); + case 404: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==404); + case 466: /* select_item ::= common_expression */ yytestcase(yyruleno==466); + case 476: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==476); + case 510: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==510); + case 512: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==512); + case 525: /* search_condition ::= common_expression */ yytestcase(yyruleno==525); { yylhsminor.yy164 = releaseRawExprNode(pCxt, yymsp[0].minor.yy164); } yymsp[0].minor.yy164 = yylhsminor.yy164; break; @@ -4789,27 +4698,27 @@ static YYACTIONTYPE yy_reduce( { yylhsminor.yy164 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } yymsp[0].minor.yy164 = yylhsminor.yy164; break; - case 356: /* expression ::= NK_LP expression NK_RP */ - case 439: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==439); - case 525: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==525); + case 355: /* expression ::= NK_LP expression NK_RP */ + case 438: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==438); + case 524: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==524); { yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy164)); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 357: /* expression ::= NK_PLUS expr_or_subquery */ + case 356: /* expression ::= NK_PLUS expr_or_subquery */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy164)); } yymsp[-1].minor.yy164 = yylhsminor.yy164; break; - case 358: /* expression ::= NK_MINUS expr_or_subquery */ + case 357: /* expression ::= NK_MINUS expr_or_subquery */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy164), NULL)); } yymsp[-1].minor.yy164 = yylhsminor.yy164; break; - case 359: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 358: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy164); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); @@ -4817,7 +4726,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 360: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 359: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy164); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); @@ -4825,7 +4734,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 361: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 360: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy164); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); @@ -4833,7 +4742,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 362: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 361: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy164); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); @@ -4841,7 +4750,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 363: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 362: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy164); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); @@ -4849,14 +4758,14 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 364: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 363: /* expression ::= column_reference NK_ARROW NK_STRING */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy164); yylhsminor.yy164 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy164), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 365: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 364: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy164); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); @@ -4864,7 +4773,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 366: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 365: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy164); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); @@ -4872,70 +4781,70 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 369: /* column_reference ::= column_name */ + case 368: /* column_reference ::= column_name */ { yylhsminor.yy164 = createRawExprNode(pCxt, &yymsp[0].minor.yy593, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy593)); } yymsp[0].minor.yy164 = yylhsminor.yy164; break; - case 370: /* column_reference ::= table_name NK_DOT column_name */ + case 369: /* column_reference ::= table_name NK_DOT column_name */ { yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy593, &yymsp[0].minor.yy593, createColumnNode(pCxt, &yymsp[-2].minor.yy593, &yymsp[0].minor.yy593)); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 371: /* pseudo_column ::= ROWTS */ - case 372: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==372); - case 374: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==374); - case 375: /* pseudo_column ::= QEND */ yytestcase(yyruleno==375); - case 376: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==376); - case 377: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==377); - case 378: /* pseudo_column ::= WEND */ yytestcase(yyruleno==378); - case 379: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==379); - case 380: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==380); - case 381: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==381); - case 387: /* literal_func ::= NOW */ yytestcase(yyruleno==387); + case 370: /* pseudo_column ::= ROWTS */ + case 371: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==371); + case 373: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==373); + case 374: /* pseudo_column ::= QEND */ yytestcase(yyruleno==374); + case 375: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==375); + case 376: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==376); + case 377: /* pseudo_column ::= WEND */ yytestcase(yyruleno==377); + case 378: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==378); + case 379: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==379); + case 380: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==380); + case 386: /* literal_func ::= NOW */ yytestcase(yyruleno==386); { yylhsminor.yy164 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } yymsp[0].minor.yy164 = yylhsminor.yy164; break; - case 373: /* pseudo_column ::= table_name NK_DOT TBNAME */ + case 372: /* pseudo_column ::= table_name NK_DOT TBNAME */ { yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy593, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy593)))); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 382: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 383: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==383); + case 381: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 382: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==382); { yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy593, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy593, yymsp[-1].minor.yy648)); } yymsp[-3].minor.yy164 = yylhsminor.yy164; break; - case 384: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + case 383: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ { yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy164), yymsp[-1].minor.yy720)); } yymsp[-5].minor.yy164 = yylhsminor.yy164; break; - case 386: /* literal_func ::= noarg_func NK_LP NK_RP */ + case 385: /* literal_func ::= noarg_func NK_LP NK_RP */ { yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy593, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy593, NULL)); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 401: /* star_func_para_list ::= NK_STAR */ + case 400: /* star_func_para_list ::= NK_STAR */ { yylhsminor.yy648 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy648 = yylhsminor.yy648; break; - case 406: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 470: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==470); + case 405: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 469: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==469); { yylhsminor.yy164 = createColumnNode(pCxt, &yymsp[-2].minor.yy593, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 407: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ + case 406: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ { yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy648, yymsp[-1].minor.yy164)); } yymsp[-3].minor.yy164 = yylhsminor.yy164; break; - case 408: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + case 407: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ { yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy164), yymsp[-2].minor.yy648, yymsp[-1].minor.yy164)); } yymsp[-4].minor.yy164 = yylhsminor.yy164; break; - case 411: /* when_then_expr ::= WHEN common_expression THEN common_expression */ + case 410: /* when_then_expr ::= WHEN common_expression THEN common_expression */ { yymsp[-3].minor.yy164 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy164), releaseRawExprNode(pCxt, yymsp[0].minor.yy164)); } break; - case 413: /* case_when_else_opt ::= ELSE common_expression */ + case 412: /* case_when_else_opt ::= ELSE common_expression */ { yymsp[-1].minor.yy164 = releaseRawExprNode(pCxt, yymsp[0].minor.yy164); } break; - case 414: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 419: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==419); + case 413: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 418: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==418); { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy164); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); @@ -4943,7 +4852,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 415: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 414: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy164); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); @@ -4951,7 +4860,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-4].minor.yy164 = yylhsminor.yy164; break; - case 416: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 415: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy164); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); @@ -4959,71 +4868,71 @@ static YYACTIONTYPE yy_reduce( } yymsp[-5].minor.yy164 = yylhsminor.yy164; break; - case 417: /* predicate ::= expr_or_subquery IS NULL */ + case 416: /* predicate ::= expr_or_subquery IS NULL */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy164); yylhsminor.yy164 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy164), NULL)); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 418: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 417: /* predicate ::= expr_or_subquery IS NOT NULL */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy164); yylhsminor.yy164 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy164), NULL)); } yymsp[-3].minor.yy164 = yylhsminor.yy164; break; - case 420: /* compare_op ::= NK_LT */ + case 419: /* compare_op ::= NK_LT */ { yymsp[0].minor.yy656 = OP_TYPE_LOWER_THAN; } break; - case 421: /* compare_op ::= NK_GT */ + case 420: /* compare_op ::= NK_GT */ { yymsp[0].minor.yy656 = OP_TYPE_GREATER_THAN; } break; - case 422: /* compare_op ::= NK_LE */ + case 421: /* compare_op ::= NK_LE */ { yymsp[0].minor.yy656 = OP_TYPE_LOWER_EQUAL; } break; - case 423: /* compare_op ::= NK_GE */ + case 422: /* compare_op ::= NK_GE */ { yymsp[0].minor.yy656 = OP_TYPE_GREATER_EQUAL; } break; - case 424: /* compare_op ::= NK_NE */ + case 423: /* compare_op ::= NK_NE */ { yymsp[0].minor.yy656 = OP_TYPE_NOT_EQUAL; } break; - case 425: /* compare_op ::= NK_EQ */ + case 424: /* compare_op ::= NK_EQ */ { yymsp[0].minor.yy656 = OP_TYPE_EQUAL; } break; - case 426: /* compare_op ::= LIKE */ + case 425: /* compare_op ::= LIKE */ { yymsp[0].minor.yy656 = OP_TYPE_LIKE; } break; - case 427: /* compare_op ::= NOT LIKE */ + case 426: /* compare_op ::= NOT LIKE */ { yymsp[-1].minor.yy656 = OP_TYPE_NOT_LIKE; } break; - case 428: /* compare_op ::= MATCH */ + case 427: /* compare_op ::= MATCH */ { yymsp[0].minor.yy656 = OP_TYPE_MATCH; } break; - case 429: /* compare_op ::= NMATCH */ + case 428: /* compare_op ::= NMATCH */ { yymsp[0].minor.yy656 = OP_TYPE_NMATCH; } break; - case 430: /* compare_op ::= CONTAINS */ + case 429: /* compare_op ::= CONTAINS */ { yymsp[0].minor.yy656 = OP_TYPE_JSON_CONTAINS; } break; - case 431: /* in_op ::= IN */ + case 430: /* in_op ::= IN */ { yymsp[0].minor.yy656 = OP_TYPE_IN; } break; - case 432: /* in_op ::= NOT IN */ + case 431: /* in_op ::= NOT IN */ { yymsp[-1].minor.yy656 = OP_TYPE_NOT_IN; } break; - case 433: /* in_predicate_value ::= NK_LP literal_list NK_RP */ + case 432: /* in_predicate_value ::= NK_LP literal_list NK_RP */ { yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy648)); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 435: /* boolean_value_expression ::= NOT boolean_primary */ + case 434: /* boolean_value_expression ::= NOT boolean_primary */ { SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy164), NULL)); } yymsp[-1].minor.yy164 = yylhsminor.yy164; break; - case 436: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 435: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy164); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); @@ -5031,7 +4940,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 437: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 436: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy164); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy164); @@ -5039,52 +4948,52 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 443: /* from_clause_opt ::= FROM table_reference_list */ - case 472: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==472); - case 500: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==500); + case 442: /* from_clause_opt ::= FROM table_reference_list */ + case 471: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==471); + case 499: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==499); { yymsp[-1].minor.yy164 = yymsp[0].minor.yy164; } break; - case 445: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ + case 444: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ { yylhsminor.yy164 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy164, yymsp[0].minor.yy164, NULL); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 448: /* table_primary ::= table_name alias_opt */ + case 447: /* table_primary ::= table_name alias_opt */ { yylhsminor.yy164 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy593, &yymsp[0].minor.yy593); } yymsp[-1].minor.yy164 = yylhsminor.yy164; break; - case 449: /* table_primary ::= db_name NK_DOT table_name alias_opt */ + case 448: /* table_primary ::= db_name NK_DOT table_name alias_opt */ { yylhsminor.yy164 = createRealTableNode(pCxt, &yymsp[-3].minor.yy593, &yymsp[-1].minor.yy593, &yymsp[0].minor.yy593); } yymsp[-3].minor.yy164 = yylhsminor.yy164; break; - case 450: /* table_primary ::= subquery alias_opt */ + case 449: /* table_primary ::= subquery alias_opt */ { yylhsminor.yy164 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy164), &yymsp[0].minor.yy593); } yymsp[-1].minor.yy164 = yylhsminor.yy164; break; - case 452: /* alias_opt ::= */ + case 451: /* alias_opt ::= */ { yymsp[1].minor.yy593 = nil_token; } break; - case 453: /* alias_opt ::= table_alias */ + case 452: /* alias_opt ::= table_alias */ { yylhsminor.yy593 = yymsp[0].minor.yy593; } yymsp[0].minor.yy593 = yylhsminor.yy593; break; - case 454: /* alias_opt ::= AS table_alias */ + case 453: /* alias_opt ::= AS table_alias */ { yymsp[-1].minor.yy593 = yymsp[0].minor.yy593; } break; - case 455: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 456: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==456); + case 454: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 455: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==455); { yymsp[-2].minor.yy164 = yymsp[-1].minor.yy164; } break; - case 457: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + case 456: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ { yylhsminor.yy164 = createJoinTableNode(pCxt, yymsp[-4].minor.yy868, yymsp[-5].minor.yy164, yymsp[-2].minor.yy164, yymsp[0].minor.yy164); } yymsp[-5].minor.yy164 = yylhsminor.yy164; break; - case 458: /* join_type ::= */ + case 457: /* join_type ::= */ { yymsp[1].minor.yy868 = JOIN_TYPE_INNER; } break; - case 459: /* join_type ::= INNER */ + case 458: /* join_type ::= INNER */ { yymsp[0].minor.yy868 = JOIN_TYPE_INNER; } break; - case 460: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 459: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { yymsp[-11].minor.yy164 = createSelectStmt(pCxt, yymsp[-10].minor.yy193, yymsp[-9].minor.yy648, yymsp[-8].minor.yy164); yymsp[-11].minor.yy164 = addWhereClause(pCxt, yymsp[-11].minor.yy164, yymsp[-7].minor.yy164); @@ -5097,73 +5006,73 @@ static YYACTIONTYPE yy_reduce( yymsp[-11].minor.yy164 = addFillClause(pCxt, yymsp[-11].minor.yy164, yymsp[-3].minor.yy164); } break; - case 463: /* set_quantifier_opt ::= ALL */ + case 462: /* set_quantifier_opt ::= ALL */ { yymsp[0].minor.yy193 = false; } break; - case 466: /* select_item ::= NK_STAR */ + case 465: /* select_item ::= NK_STAR */ { yylhsminor.yy164 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy164 = yylhsminor.yy164; break; - case 468: /* select_item ::= common_expression column_alias */ - case 478: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==478); + case 467: /* select_item ::= common_expression column_alias */ + case 477: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==477); { yylhsminor.yy164 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy164), &yymsp[0].minor.yy593); } yymsp[-1].minor.yy164 = yylhsminor.yy164; break; - case 469: /* select_item ::= common_expression AS column_alias */ - case 479: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==479); + case 468: /* select_item ::= common_expression AS column_alias */ + case 478: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==478); { yylhsminor.yy164 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy164), &yymsp[0].minor.yy593); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 474: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 496: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==496); - case 515: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==515); + case 473: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 495: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==495); + case 514: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==514); { yymsp[-2].minor.yy648 = yymsp[0].minor.yy648; } break; - case 481: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + case 480: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ { yymsp[-5].minor.yy164 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy164), releaseRawExprNode(pCxt, yymsp[-1].minor.yy164)); } break; - case 482: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + case 481: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ { yymsp[-3].minor.yy164 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy164)); } break; - case 483: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + case 482: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ { yymsp[-5].minor.yy164 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy164), NULL, yymsp[-1].minor.yy164, yymsp[0].minor.yy164); } break; - case 484: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + case 483: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ { yymsp[-7].minor.yy164 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy164), releaseRawExprNode(pCxt, yymsp[-3].minor.yy164), yymsp[-1].minor.yy164, yymsp[0].minor.yy164); } break; - case 488: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ + case 487: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ { yymsp[-3].minor.yy164 = createFillNode(pCxt, yymsp[-1].minor.yy638, NULL); } break; - case 489: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + case 488: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ { yymsp[-5].minor.yy164 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy648)); } break; - case 490: /* fill_mode ::= NONE */ + case 489: /* fill_mode ::= NONE */ { yymsp[0].minor.yy638 = FILL_MODE_NONE; } break; - case 491: /* fill_mode ::= PREV */ + case 490: /* fill_mode ::= PREV */ { yymsp[0].minor.yy638 = FILL_MODE_PREV; } break; - case 492: /* fill_mode ::= NULL */ + case 491: /* fill_mode ::= NULL */ { yymsp[0].minor.yy638 = FILL_MODE_NULL; } break; - case 493: /* fill_mode ::= LINEAR */ + case 492: /* fill_mode ::= LINEAR */ { yymsp[0].minor.yy638 = FILL_MODE_LINEAR; } break; - case 494: /* fill_mode ::= NEXT */ + case 493: /* fill_mode ::= NEXT */ { yymsp[0].minor.yy638 = FILL_MODE_NEXT; } break; - case 497: /* group_by_list ::= expr_or_subquery */ + case 496: /* group_by_list ::= expr_or_subquery */ { yylhsminor.yy648 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy164))); } yymsp[0].minor.yy648 = yylhsminor.yy648; break; - case 498: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + case 497: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ { yylhsminor.yy648 = addNodeToList(pCxt, yymsp[-2].minor.yy648, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy164))); } yymsp[-2].minor.yy648 = yylhsminor.yy648; break; - case 502: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + case 501: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ { yymsp[-5].minor.yy164 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy164), releaseRawExprNode(pCxt, yymsp[-1].minor.yy164)); } break; - case 505: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 504: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { yylhsminor.yy164 = addOrderByClause(pCxt, yymsp[-3].minor.yy164, yymsp[-2].minor.yy648); yylhsminor.yy164 = addSlimitClause(pCxt, yylhsminor.yy164, yymsp[-1].minor.yy164); @@ -5171,50 +5080,50 @@ static YYACTIONTYPE yy_reduce( } yymsp[-3].minor.yy164 = yylhsminor.yy164; break; - case 508: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + case 507: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ { yylhsminor.yy164 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy164, yymsp[0].minor.yy164); } yymsp[-3].minor.yy164 = yylhsminor.yy164; break; - case 509: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + case 508: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ { yylhsminor.yy164 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy164, yymsp[0].minor.yy164); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 517: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 521: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==521); + case 516: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 520: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==520); { yymsp[-1].minor.yy164 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 518: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 522: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==522); + case 517: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 521: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==521); { yymsp[-3].minor.yy164 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 519: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 523: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==523); + case 518: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 522: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==522); { yymsp[-3].minor.yy164 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 524: /* subquery ::= NK_LP query_expression NK_RP */ + case 523: /* subquery ::= NK_LP query_expression NK_RP */ { yylhsminor.yy164 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy164); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 529: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + case 528: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ { yylhsminor.yy164 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy164), yymsp[-1].minor.yy238, yymsp[0].minor.yy153); } yymsp[-2].minor.yy164 = yylhsminor.yy164; break; - case 530: /* ordering_specification_opt ::= */ + case 529: /* ordering_specification_opt ::= */ { yymsp[1].minor.yy238 = ORDER_ASC; } break; - case 531: /* ordering_specification_opt ::= ASC */ + case 530: /* ordering_specification_opt ::= ASC */ { yymsp[0].minor.yy238 = ORDER_ASC; } break; - case 532: /* ordering_specification_opt ::= DESC */ + case 531: /* ordering_specification_opt ::= DESC */ { yymsp[0].minor.yy238 = ORDER_DESC; } break; - case 533: /* null_ordering_opt ::= */ + case 532: /* null_ordering_opt ::= */ { yymsp[1].minor.yy153 = NULL_ORDER_DEFAULT; } break; - case 534: /* null_ordering_opt ::= NULLS FIRST */ + case 533: /* null_ordering_opt ::= NULLS FIRST */ { yymsp[-1].minor.yy153 = NULL_ORDER_FIRST; } break; - case 535: /* null_ordering_opt ::= NULLS LAST */ + case 534: /* null_ordering_opt ::= NULLS LAST */ { yymsp[-1].minor.yy153 = NULL_ORDER_LAST; } break; default: From 4369c2ee971bd218776174fc112553eab5a45b99 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 28 Nov 2022 11:24:47 +0800 Subject: [PATCH 17/23] test: add asan case --- tests/parallel_test/cases.task | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 7dacb2369e..580a298588 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -706,15 +706,15 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDnodeRestart.py -,,,system-test,python3 ./test.py -f 7-tmq/tmqDnodeRestart1.py +,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDnodeRestart1.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUpdate-1ctb.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUpdateWithConsume.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot0.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot1.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDelete-1ctb.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDelete-multiCtb.py -,,,system-test,python3 ./test.py -f 7-tmq/tmqDropStb.py -,,,system-test,python3 ./test.py -f 7-tmq/tmqDropStbCtb.py +,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDropStb.py +,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDropStbCtb.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot0.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot1.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUdf.py From 58f49389cd3068813b86418f55ba06d25a00baf1 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 28 Nov 2022 11:56:28 +0800 Subject: [PATCH 18/23] test: adjust cluster case for asan --- tests/system-test/6-cluster/5dnode3mnodeDrop.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/system-test/6-cluster/5dnode3mnodeDrop.py b/tests/system-test/6-cluster/5dnode3mnodeDrop.py index 76684f36ae..de9207ddd8 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeDrop.py +++ b/tests/system-test/6-cluster/5dnode3mnodeDrop.py @@ -8,6 +8,7 @@ import os from util.log import * from util.sql import * from util.cases import * +from util.dnodes import * from util.dnodes import TDDnodes from util.dnodes import TDDnode import time @@ -251,6 +252,9 @@ class TDTestCase: tdSql.checkData(0,1,'%s:6030'%self.host) tdSql.checkData(4,1,'%s:6430'%self.host) tdSql.checkData(0,4,'ready') + tdSql.checkData(1,4,'ready') + tdSql.checkData(2,4,'ready') + tdSql.checkData(3,4,'ready') tdSql.checkData(4,4,'ready') tdSql.query("select * from information_schema.ins_mnodes;") tdSql.checkRows(1) From 2d39bd02fef6e53895397c43d4accd064f726f4a Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 28 Nov 2022 12:27:14 +0800 Subject: [PATCH 19/23] test: add asan case --- tests/parallel_test/cases.task | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 580a298588..0abec6b340 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -409,7 +409,7 @@ ,,n,system-test,python3 ./test.py -f 0-others/taosdShell.py -N 5 -M 3 -Q 3 ,,n,system-test,python3 ./test.py -f 0-others/udfTest.py ,,n,system-test,python3 ./test.py -f 0-others/udf_create.py -,,n,system-test,python3 ./test.py -f 0-others/udf_restart_taosd.py +,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/udf_restart_taosd.py ,,n,system-test,python3 ./test.py -f 0-others/udf_cfg1.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/udf_cfg2.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/cachemodel.py @@ -425,7 +425,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/test_stmt_set_tbname_tag.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_stable.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_table.py -,,n,system-test,python3 ./test.py -f 1-insert/boundary.py +,,,system-test,python3 ./test.py -f 1-insert/boundary.py ,,n,system-test,python3 ./test.py -f 1-insert/insertWithMoreVgroup.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/table_comment.py ,,n,system-test,python3 ./test.py -f 1-insert/time_range_wise.py From 6e81e8cc730133bf5720c0bfbb35e37db333ec05 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 28 Nov 2022 12:32:40 +0800 Subject: [PATCH 20/23] refactor: do some internal refactor. --- include/common/tcommon.h | 27 +- source/common/src/tdatablock.c | 25 +- source/dnode/vnode/src/sma/smaRollup.c | 8 +- source/dnode/vnode/src/tq/tqRead.c | 4 +- source/dnode/vnode/src/tq/tqSink.c | 10 +- source/dnode/vnode/src/tsdb/tsdbRead.c | 10 +- source/dnode/vnode/test/tsdbSmaTest.cpp | 2 +- source/libs/executor/src/cachescanoperator.c | 8 +- source/libs/executor/src/exchangeoperator.c | 10 +- source/libs/executor/src/executil.c | 2 +- source/libs/executor/src/executorimpl.c | 240 +++--------------- source/libs/executor/src/groupoperator.c | 8 +- source/libs/executor/src/joinoperator.c | 2 +- source/libs/executor/src/projectoperator.c | 201 ++++++++++++++- source/libs/executor/src/scanoperator.c | 76 +++--- source/libs/executor/src/sortoperator.c | 12 +- source/libs/executor/src/tfill.c | 16 +- source/libs/executor/src/timewindowoperator.c | 48 ++-- source/libs/executor/src/tsort.c | 6 +- source/libs/function/src/tudf.c | 2 +- .../libs/index/test/index_executor_tests.cpp | 2 +- source/libs/scalar/src/scalar.c | 4 +- .../libs/scalar/test/scalar/scalarTests.cpp | 2 +- source/libs/stream/src/streamDispatch.c | 2 +- source/libs/stream/src/streamUpdate.c | 2 +- 25 files changed, 370 insertions(+), 359 deletions(-) diff --git a/include/common/tcommon.h b/include/common/tcommon.h index 9c1f2063a7..77f1879b81 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -174,15 +174,28 @@ typedef struct SColumnDataAgg { } SColumnDataAgg; #pragma pack(pop) +typedef struct SBlockID { + // The uid of table, from which current data block comes. And it is always 0, if current block is the + // result of calculation. + uint64_t uid; + + // Block id, acquired and assigned from executor, which created according to the hysical planner. Block id is used + // to mark the stage of exec task. + uint64_t blockId; + + // Generated by group/partition by [value|tags]. Created and assigned by table-scan operator, group-by operator, + // and partition by operator. + uint64_t groupId; +} SBlockID; + typedef struct SDataBlockInfo { STimeWindow window; - int32_t rows; // todo hide this attribute int32_t rowSize; - uint64_t uid; // the uid of table, from which current data block comes - uint16_t blockId; // block id, generated by physical planner - uint64_t groupId; - int16_t hasVarCol; + int32_t rows; // todo hide this attribute uint32_t capacity; + SBlockID id; + int16_t hasVarCol; + // TODO: optimize and remove following int64_t version; // used for stream, and need serialization int32_t childId; // used for stream, do not serialize @@ -190,8 +203,8 @@ typedef struct SDataBlockInfo { STimeWindow calWin; // used for stream, do not serialize TSKEY watermark; // used for stream - char parTbName[TSDB_TABLE_NAME_LEN]; // used for stream partition - STag* pTag; // used for stream partition + char parTbName[TSDB_TABLE_NAME_LEN]; // used for stream partition + STag* pTag; // used for stream partition } SDataBlockInfo; typedef struct SSDataBlock { diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index cfa2964e16..a0f795a729 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -621,7 +621,7 @@ int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) { // todo remove this int32_t blockDataFromBuf1(SSDataBlock* pBlock, const char* buf, size_t capacity) { pBlock->info.rows = *(int32_t*)buf; - pBlock->info.groupId = *(uint64_t*)(buf + sizeof(int32_t)); + pBlock->info.id.groupId = *(uint64_t*)(buf + sizeof(int32_t)); size_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); @@ -1140,7 +1140,8 @@ void blockDataCleanup(SSDataBlock* pDataBlock) { SDataBlockInfo* pInfo = &pDataBlock->info; pInfo->rows = 0; - pInfo->groupId = 0; + pInfo->id.uid = 0; + pInfo->id.groupId = 0; pInfo->window.ekey = 0; pInfo->window.skey = 0; @@ -1334,7 +1335,7 @@ int32_t copyDataBlock(SSDataBlock* dst, const SSDataBlock* src) { SSDataBlock* createSpecialDataBlock(EStreamType type) { SSDataBlock* pBlock = taosMemoryCalloc(1, sizeof(SSDataBlock)); pBlock->info.hasVarCol = false; - pBlock->info.groupId = 0; + pBlock->info.id.groupId = 0; pBlock->info.rows = 0; pBlock->info.type = type; pBlock->info.rowSize = sizeof(TSKEY) + sizeof(TSKEY) + sizeof(uint64_t) + sizeof(uint64_t) + sizeof(TSKEY) + @@ -1675,7 +1676,7 @@ int32_t blockDataKeepFirstNRows(SSDataBlock* pBlock, size_t n) { } int32_t tEncodeDataBlock(void** buf, const SSDataBlock* pBlock) { - int64_t tbUid = pBlock->info.uid; + int64_t tbUid = pBlock->info.id.uid; int16_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); int16_t hasVarCol = pBlock->info.hasVarCol; int32_t rows = pBlock->info.rows; @@ -1713,7 +1714,7 @@ void* tDecodeDataBlock(const void* buf, SSDataBlock* pBlock) { int16_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); - buf = taosDecodeFixedU64(buf, &pBlock->info.uid); + buf = taosDecodeFixedU64(buf, &pBlock->info.id.uid); buf = taosDecodeFixedI16(buf, &numOfCols); buf = taosDecodeFixedI16(buf, &pBlock->info.hasVarCol); buf = taosDecodeFixedI32(buf, &pBlock->info.rows); @@ -1834,7 +1835,7 @@ void blockDebugShowDataBlocks(const SArray* dataBlocks, const char* flag) { int32_t rows = pDataBlock->info.rows; printf("%s |block ver %" PRIi64 " |block type %d |child id %d|group id %" PRIu64 "\n", flag, pDataBlock->info.version, (int32_t)pDataBlock->info.type, pDataBlock->info.childId, - pDataBlock->info.groupId); + pDataBlock->info.id.groupId); for (int32_t j = 0; j < rows; j++) { printf("%s |", flag); for (int32_t k = 0; k < numOfCols; k++) { @@ -1905,8 +1906,8 @@ char* dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf) len += snprintf(dumpBuf + len, size - len, "===stream===%s|block type %d|child id %d|group id:%" PRIu64 "|uid:%" PRId64 "|rows:%d|version:%" PRIu64 "\n", - flag, (int32_t)pDataBlock->info.type, pDataBlock->info.childId, pDataBlock->info.groupId, - pDataBlock->info.uid, pDataBlock->info.rows, pDataBlock->info.version); + flag, (int32_t)pDataBlock->info.type, pDataBlock->info.childId, pDataBlock->info.id.groupId, + pDataBlock->info.id.uid, pDataBlock->info.rows, pDataBlock->info.version); if (len >= size - 1) return dumpBuf; for (int32_t j = 0; j < rows; j++) { @@ -2035,8 +2036,6 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SSDataBlock* pDataB for (int32_t i = 0; i < sz; ++i) { int32_t colNum = taosArrayGetSize(pDataBlock->pDataBlock); int32_t rows = pDataBlock->info.rows; - // int32_t rowSize = pDataBlock->info.rowSize; - // int64_t groupId = pDataBlock->info.groupId; if (colNum <= 1) { // invalid if only with TS col @@ -2049,7 +2048,7 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SSDataBlock* pDataB SSubmitBlk* pSubmitBlk = POINTER_SHIFT(pDataBuf, msgLen); pSubmitBlk->suid = suid; - pSubmitBlk->uid = pDataBlock->info.groupId; + pSubmitBlk->uid = pDataBlock->info.id.groupId; pSubmitBlk->numOfRows = rows; pSubmitBlk->sversion = pTSchema->version; @@ -2292,7 +2291,7 @@ int32_t blockEncode(const SSDataBlock* pBlock, char* data, int32_t numOfCols) { } *actualLen = dataLen; - *groupId = pBlock->info.groupId; + *groupId = pBlock->info.id.groupId; ASSERT(dataLen > 0); uDebug("build data block, actualLen:%d, rows:%d, cols:%d", dataLen, *rows, *cols); @@ -2325,7 +2324,7 @@ const char* blockDecode(SSDataBlock* pBlock, const char* pData) { pStart += sizeof(int32_t); // group id sizeof(uint64_t) - pBlock->info.groupId = *(uint64_t*)pStart; + pBlock->info.id.groupId = *(uint64_t*)pStart; pStart += sizeof(uint64_t); if (pBlock->pDataBlock == NULL) { diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index 51842a8ae4..6bd2ae3435 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -708,7 +708,7 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma #endif for (int32_t i = 0; i < taosArrayGetSize(pResList); ++i) { SSDataBlock *output = taosArrayGetP(pResList, i); - smaDebug("result block, uid:%" PRIu64 ", groupid:%" PRIu64 ", rows:%d", output->info.uid, output->info.groupId, + smaDebug("result block, uid:%" PRIu64 ", groupid:%" PRIu64 ", rows:%d", output->info.id.uid, output->info.id.groupId, output->info.rows); STsdb *sinkTsdb = (pItem->level == TSDB_RETENTION_L1 ? pSma->pRSmaTsdb[0] : pSma->pRSmaTsdb[1]); @@ -718,7 +718,7 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma if (buildSubmitReqFromDataBlock(&pReq, output, pTSchema, SMA_VID(pSma), suid) < 0) { smaError("vgId:%d, build submit req for rsma table suid:%" PRIu64 ", uid:%" PRIu64 ", level %" PRIi8 " failed since %s", - SMA_VID(pSma), suid, output->info.groupId, pItem->level, terrstr()); + SMA_VID(pSma), suid, output->info.id.groupId, pItem->level, terrstr()); goto _err; } @@ -726,13 +726,13 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma taosMemoryFreeClear(pReq); smaError("vgId:%d, process submit req for rsma suid:%" PRIu64 ", uid:%" PRIu64 " level %" PRIi8 " failed since %s", - SMA_VID(pSma), suid, output->info.groupId, pItem->level, terrstr()); + SMA_VID(pSma), suid, output->info.id.groupId, pItem->level, terrstr()); goto _err; } smaDebug("vgId:%d, process submit req for rsma suid:%" PRIu64 ",uid:%" PRIu64 ", level %" PRIi8 " ver %" PRIi64 " len %" PRIu32, - SMA_VID(pSma), suid, output->info.groupId, pItem->level, output->info.version, + SMA_VID(pSma), suid, output->info.id.groupId, pItem->level, output->info.version, htonl(pReq->header.contLen)); taosMemoryFreeClear(pReq); diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c index e41b1d8aa8..c3a4cefc66 100644 --- a/source/dnode/vnode/src/tq/tqRead.c +++ b/source/dnode/vnode/src/tq/tqRead.c @@ -530,7 +530,7 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) { tInitSubmitBlkIter(&pReader->msgIter, pReader->pBlock, &pReader->blkIter); - pBlock->info.uid = pReader->msgIter.uid; + pBlock->info.id.uid = pReader->msgIter.uid; pBlock->info.rows = pReader->msgIter.numOfRows; pBlock->info.version = pReader->pMsg->version; @@ -649,7 +649,7 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas } SSDataBlock* pBlock = taosArrayGetLast(blocks); - pBlock->info.uid = pReader->msgIter.uid; + pBlock->info.id.uid = pReader->msgIter.uid; pBlock->info.rows = 0; pBlock->info.version = pReader->pMsg->version; diff --git a/source/dnode/vnode/src/tq/tqSink.c b/source/dnode/vnode/src/tq/tqSink.c index 30cde5d475..a4bfb6c876 100644 --- a/source/dnode/vnode/src/tq/tqSink.c +++ b/source/dnode/vnode/src/tq/tqSink.c @@ -103,7 +103,7 @@ SSubmitReq* tqBlockToSubmit(SVnode* pVnode, const SArray* pBlocks, const STSchem // STagVal tagVal = { // .cid = pTagSchemaWrapper->pSchema[j].colId, // .type = pTagSchemaWrapper->pSchema[j].type, - // .i64 = (int64_t)pDataBlock->info.groupId, + // .i64 = (int64_t)pDataBlock->info.id.groupId, // }; // taosArrayPush(tagArray, &tagVal); // taosArrayPush(tagName, pTagSchemaWrapper->pSchema[j].name); @@ -134,7 +134,7 @@ SSubmitReq* tqBlockToSubmit(SVnode* pVnode, const SArray* pBlocks, const STSchem STagVal tagVal = { .cid = taosArrayGetSize(pDataBlock->pDataBlock) + 1, .type = TSDB_DATA_TYPE_UBIGINT, - .i64 = (int64_t)pDataBlock->info.groupId, + .i64 = (int64_t)pDataBlock->info.id.groupId, }; taosArrayPush(tagArray, &tagVal); createTbReq.ctb.tagNum = taosArrayGetSize(tagArray); @@ -161,7 +161,7 @@ SSubmitReq* tqBlockToSubmit(SVnode* pVnode, const SArray* pBlocks, const STSchem if (pDataBlock->info.parTbName[0]) { createTbReq.name = strdup(pDataBlock->info.parTbName); } else { - createTbReq.name = buildCtbNameByGroupId(stbFullName, pDataBlock->info.groupId); + createTbReq.name = buildCtbNameByGroupId(stbFullName, pDataBlock->info.id.groupId); } // save schema len @@ -358,7 +358,7 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d if (pDataBlock->info.parTbName[0]) { ctbName = strdup(pDataBlock->info.parTbName); } else { - ctbName = buildCtbNameByGroupId(stbFullName, pDataBlock->info.groupId); + ctbName = buildCtbNameByGroupId(stbFullName, pDataBlock->info.id.groupId); } int32_t schemaLen = 0; @@ -390,7 +390,7 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d STagVal tagVal = { .cid = taosArrayGetSize(pDataBlock->pDataBlock) + 1, .type = TSDB_DATA_TYPE_UBIGINT, - .i64 = (int64_t)pDataBlock->info.groupId, + .i64 = (int64_t)pDataBlock->info.id.groupId, }; taosArrayPush(tagArray, &tagVal); createTbReq.ctb.tagNum = taosArrayGetSize(tagArray); diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 96cfa1752d..4ba311212a 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -1624,7 +1624,7 @@ static int32_t buildDataBlockFromBuf(STsdbReader* pReader, STableBlockScanInfo* int32_t code = buildDataBlockFromBufImpl(pBlockScanInfo, endKey, pReader->capacity, pReader); blockDataUpdateTsWindow(pBlock, 0); - pBlock->info.uid = pBlockScanInfo->uid; + pBlock->info.id.uid = pBlockScanInfo->uid; setComposedBlockFlag(pReader, true); @@ -2494,7 +2494,7 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) { } _end: - pResBlock->info.uid = (pBlockScanInfo != NULL) ? pBlockScanInfo->uid : 0; + pResBlock->info.id.uid = (pBlockScanInfo != NULL) ? pBlockScanInfo->uid : 0; blockDataUpdateTsWindow(pResBlock, 0); setComposedBlockFlag(pReader, true); @@ -2506,7 +2506,7 @@ _end: if (pResBlock->info.rows > 0) { tsdbDebug("%p uid:%" PRIu64 ", composed data block created, brange:%" PRIu64 "-%" PRIu64 " rows:%d, elapsed time:%.2f ms %s", - pReader, pResBlock->info.uid, pResBlock->info.window.skey, pResBlock->info.window.ekey, + pReader, pResBlock->info.id.uid, pResBlock->info.window.skey, pResBlock->info.window.ekey, pResBlock->info.rows, el, pReader->idStr); } @@ -2830,7 +2830,7 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { } else { // whole block is required, return it directly SDataBlockInfo* pInfo = &pReader->pResBlock->info; pInfo->rows = pBlock->nRow; - pInfo->uid = pScanInfo->uid; + pInfo->id.uid = pScanInfo->uid; pInfo->window = (STimeWindow){.skey = pBlock->minKey.ts, .ekey = pBlock->maxKey.ts}; setComposedBlockFlag(pReader, false); setBlockAllDumped(&pStatus->fBlockDumpInfo, pBlock->maxKey.ts, pReader->order); @@ -4020,7 +4020,7 @@ bool tsdbTableNextDataBlock(STsdbReader* pReader, uint64_t uid) { static void setBlockInfo(const STsdbReader* pReader, int32_t* rows, uint64_t* uid, STimeWindow* pWindow) { ASSERT(pReader != NULL); *rows = pReader->pResBlock->info.rows; - *uid = pReader->pResBlock->info.uid; + *uid = pReader->pResBlock->info.id.uid; *pWindow = pReader->pResBlock->info.window; } diff --git a/source/dnode/vnode/test/tsdbSmaTest.cpp b/source/dnode/vnode/test/tsdbSmaTest.cpp index 0278a11f80..be101059f2 100644 --- a/source/dnode/vnode/test/tsdbSmaTest.cpp +++ b/source/dnode/vnode/test/tsdbSmaTest.cpp @@ -436,7 +436,7 @@ TEST(testCase, tSma_Data_Insert_Query_Test) { pDataBlock->pBlockAgg = NULL; taosArrayGetSize(pDataBlock->pDataBlock) = tSmaNumOfCols; pDataBlock->info.rows = tSmaNumOfRows; - pDataBlock->info.groupId = tSmaGroupId + g; + pDataBlock->info.id.groupId = tSmaGroupId + g; pDataBlock->pDataBlock = taosArrayInit(tSmaNumOfCols, sizeof(SColumnInfoData *)); EXPECT_NE(pDataBlock->pDataBlock, nullptr); diff --git a/source/libs/executor/src/cachescanoperator.c b/source/libs/executor/src/cachescanoperator.c index cdd744bded..c432f3c01c 100644 --- a/source/libs/executor/src/cachescanoperator.c +++ b/source/libs/executor/src/cachescanoperator.c @@ -185,7 +185,7 @@ SSDataBlock* doScanCache(SOperatorInfo* pOperator) { } } - pRes->info.uid = *(tb_uid_t*)taosArrayGet(pInfo->pUidList, pInfo->indexOfBufferedRes); + pRes->info.id.uid = *(tb_uid_t*)taosArrayGet(pInfo->pUidList, pInfo->indexOfBufferedRes); pRes->info.rows = 1; SExprSupp* pSup = &pInfo->pseudoExprSup; @@ -196,7 +196,7 @@ SSDataBlock* doScanCache(SOperatorInfo* pOperator) { return NULL; } - pRes->info.groupId = getTableGroupId(pTableList, pRes->info.uid); + pRes->info.id.groupId = getTableGroupId(pTableList, pRes->info.id.uid); pInfo->indexOfBufferedRes += 1; return pRes; } else { @@ -232,12 +232,12 @@ SSDataBlock* doScanCache(SOperatorInfo* pOperator) { SExprSupp* pSup = &pInfo->pseudoExprSup; STableKeyInfo* pKeyInfo = &((STableKeyInfo*)pList)[0]; - pInfo->pRes->info.groupId = pKeyInfo->groupId; + pInfo->pRes->info.id.groupId = pKeyInfo->groupId; if (taosArrayGetSize(pInfo->pUidList) > 0) { ASSERT((pInfo->retrieveType & CACHESCAN_RETRIEVE_LAST_ROW) == CACHESCAN_RETRIEVE_LAST_ROW); - pInfo->pRes->info.uid = *(tb_uid_t*)taosArrayGet(pInfo->pUidList, 0); + pInfo->pRes->info.id.uid = *(tb_uid_t*)taosArrayGet(pInfo->pUidList, 0); code = addTagPseudoColumnData(&pInfo->readHandle, pSup->pExprInfo, pSup->numOfExprs, pInfo->pRes, pInfo->pRes->info.rows, GET_TASKID(pTaskInfo), NULL); if (code != TSDB_CODE_SUCCESS) { diff --git a/source/libs/executor/src/exchangeoperator.c b/source/libs/executor/src/exchangeoperator.c index 280880c077..b2ddff45a4 100644 --- a/source/libs/executor/src/exchangeoperator.c +++ b/source/libs/executor/src/exchangeoperator.c @@ -717,10 +717,10 @@ int32_t prepareLoadRemoteData(SOperatorInfo* pOperator) { int32_t handleLimitOffset(SOperatorInfo* pOperator, SLimitInfo* pLimitInfo, SSDataBlock* pBlock, bool holdDataInBuf) { if (pLimitInfo->remainGroupOffset > 0) { if (pLimitInfo->currentGroupId == 0) { // it is the first group - pLimitInfo->currentGroupId = pBlock->info.groupId; + pLimitInfo->currentGroupId = pBlock->info.id.groupId; blockDataCleanup(pBlock); return PROJECT_RETRIEVE_CONTINUE; - } else if (pLimitInfo->currentGroupId != pBlock->info.groupId) { + } else if (pLimitInfo->currentGroupId != pBlock->info.id.groupId) { // now it is the data from a new group pLimitInfo->remainGroupOffset -= 1; @@ -732,11 +732,11 @@ int32_t handleLimitOffset(SOperatorInfo* pOperator, SLimitInfo* pLimitInfo, SSDa } // set current group id of the project operator - pLimitInfo->currentGroupId = pBlock->info.groupId; + pLimitInfo->currentGroupId = pBlock->info.id.groupId; } // here check for a new group data, we need to handle the data of the previous group. - if (pLimitInfo->currentGroupId != 0 && pLimitInfo->currentGroupId != pBlock->info.groupId) { + if (pLimitInfo->currentGroupId != 0 && pLimitInfo->currentGroupId != pBlock->info.id.groupId) { pLimitInfo->numOfOutputGroups += 1; if ((pLimitInfo->slimit.limit > 0) && (pLimitInfo->slimit.limit <= pLimitInfo->numOfOutputGroups)) { pOperator->status = OP_EXEC_DONE; @@ -758,7 +758,7 @@ int32_t handleLimitOffset(SOperatorInfo* pOperator, SLimitInfo* pLimitInfo, SSDa // here we reach the start position, according to the limit/offset requirements. // set current group id - pLimitInfo->currentGroupId = pBlock->info.groupId; + pLimitInfo->currentGroupId = pBlock->info.id.groupId; if (pLimitInfo->remainOffset >= pBlock->info.rows) { pLimitInfo->remainOffset -= pBlock->info.rows; diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 08e6e4792b..b135566caa 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -213,7 +213,7 @@ SSDataBlock* createDataBlockFromDescNode(SDataBlockDescNode* pNode) { SSDataBlock* pBlock = createDataBlock(); - pBlock->info.blockId = pNode->dataBlockId; + pBlock->info.id.blockId = pNode->dataBlockId; pBlock->info.type = STREAM_INVALID; pBlock->info.calWin = (STimeWindow){.skey = INT64_MIN, .ekey = INT64_MAX}; pBlock->info.watermark = INT64_MIN; diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 5abde1be85..514236159d 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -447,7 +447,7 @@ static int32_t doSetInputDataBlock(SExprSupp* pExprSup, SSDataBlock* pBlock, int pCtx[i].scanFlag = scanFlag; SInputColumnInfoData* pInput = &pCtx[i].input; - pInput->uid = pBlock->info.uid; + pInput->uid = pBlock->info.id.uid; pInput->colDataSMAIsSet = false; SExprInfo* pOneExpr = &pExprSup->pExprInfo[i]; @@ -506,184 +506,6 @@ static int32_t doAggregateImpl(SOperatorInfo* pOperator, SqlFunctionCtx* pCtx) { return TSDB_CODE_SUCCESS; } -static void setPseudoOutputColInfo(SSDataBlock* pResult, SqlFunctionCtx* pCtx, SArray* pPseudoList) { - size_t num = (pPseudoList != NULL) ? taosArrayGetSize(pPseudoList) : 0; - for (int32_t i = 0; i < num; ++i) { - pCtx[i].pOutput = taosArrayGet(pResult->pDataBlock, i); - } -} - -int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBlock* pSrcBlock, SqlFunctionCtx* pCtx, - int32_t numOfOutput, SArray* pPseudoList) { - setPseudoOutputColInfo(pResult, pCtx, pPseudoList); - - if (pSrcBlock == NULL) { - for (int32_t k = 0; k < numOfOutput; ++k) { - int32_t outputSlotId = pExpr[k].base.resSchema.slotId; - - ASSERT(pExpr[k].pExpr->nodeType == QUERY_NODE_VALUE); - SColumnInfoData* pColInfoData = taosArrayGet(pResult->pDataBlock, outputSlotId); - - int32_t type = pExpr[k].base.pParam[0].param.nType; - if (TSDB_DATA_TYPE_NULL == type) { - colDataAppendNNULL(pColInfoData, 0, 1); - } else { - colDataAppend(pColInfoData, 0, taosVariantGet(&pExpr[k].base.pParam[0].param, type), false); - } - } - - pResult->info.rows = 1; - return TSDB_CODE_SUCCESS; - } - - if (pResult != pSrcBlock) { - pResult->info.groupId = pSrcBlock->info.groupId; - memcpy(pResult->info.parTbName, pSrcBlock->info.parTbName, TSDB_TABLE_NAME_LEN); - } - - // if the source equals to the destination, it is to create a new column as the result of scalar - // function or some operators. - bool createNewColModel = (pResult == pSrcBlock); - if (createNewColModel) { - blockDataEnsureCapacity(pResult, pResult->info.rows); - } - - int32_t numOfRows = 0; - - for (int32_t k = 0; k < numOfOutput; ++k) { - int32_t outputSlotId = pExpr[k].base.resSchema.slotId; - SqlFunctionCtx* pfCtx = &pCtx[k]; - SInputColumnInfoData* pInputData = &pfCtx->input; - - if (pExpr[k].pExpr->nodeType == QUERY_NODE_COLUMN) { // it is a project query - SColumnInfoData* pColInfoData = taosArrayGet(pResult->pDataBlock, outputSlotId); - if (pResult->info.rows > 0 && !createNewColModel) { - colDataMergeCol(pColInfoData, pResult->info.rows, (int32_t*)&pResult->info.capacity, pInputData->pData[0], - pInputData->numOfRows); - } else { - colDataAssign(pColInfoData, pInputData->pData[0], pInputData->numOfRows, &pResult->info); - } - - numOfRows = pInputData->numOfRows; - } else if (pExpr[k].pExpr->nodeType == QUERY_NODE_VALUE) { - SColumnInfoData* pColInfoData = taosArrayGet(pResult->pDataBlock, outputSlotId); - - int32_t offset = createNewColModel ? 0 : pResult->info.rows; - - int32_t type = pExpr[k].base.pParam[0].param.nType; - if (TSDB_DATA_TYPE_NULL == type) { - colDataAppendNNULL(pColInfoData, offset, pSrcBlock->info.rows); - } else { - for (int32_t i = 0; i < pSrcBlock->info.rows; ++i) { - colDataAppend(pColInfoData, i + offset, taosVariantGet(&pExpr[k].base.pParam[0].param, type), false); - } - } - - numOfRows = pSrcBlock->info.rows; - } else if (pExpr[k].pExpr->nodeType == QUERY_NODE_OPERATOR) { - SArray* pBlockList = taosArrayInit(4, POINTER_BYTES); - taosArrayPush(pBlockList, &pSrcBlock); - - SColumnInfoData* pResColData = taosArrayGet(pResult->pDataBlock, outputSlotId); - SColumnInfoData idata = {.info = pResColData->info, .hasNull = true}; - - SScalarParam dest = {.columnData = &idata}; - int32_t code = scalarCalculate(pExpr[k].pExpr->_optrRoot.pRootNode, pBlockList, &dest); - if (code != TSDB_CODE_SUCCESS) { - taosArrayDestroy(pBlockList); - return code; - } - - int32_t startOffset = createNewColModel ? 0 : pResult->info.rows; - ASSERT(pResult->info.capacity > 0); - - colDataMergeCol(pResColData, startOffset, (int32_t*)&pResult->info.capacity, &idata, dest.numOfRows); - colDataDestroy(&idata); - - numOfRows = dest.numOfRows; - taosArrayDestroy(pBlockList); - } else if (pExpr[k].pExpr->nodeType == QUERY_NODE_FUNCTION) { - // _rowts/_c0, not tbname column - if (fmIsPseudoColumnFunc(pfCtx->functionId) && (!fmIsScanPseudoColumnFunc(pfCtx->functionId))) { - // do nothing - } else if (fmIsIndefiniteRowsFunc(pfCtx->functionId)) { - SResultRowEntryInfo* pResInfo = GET_RES_INFO(pfCtx); - pfCtx->fpSet.init(pfCtx, pResInfo); - - pfCtx->pOutput = taosArrayGet(pResult->pDataBlock, outputSlotId); - pfCtx->offset = createNewColModel ? 0 : pResult->info.rows; // set the start offset - - // set the timestamp(_rowts) output buffer - if (taosArrayGetSize(pPseudoList) > 0) { - int32_t* outputColIndex = taosArrayGet(pPseudoList, 0); - pfCtx->pTsOutput = (SColumnInfoData*)pCtx[*outputColIndex].pOutput; - } - - // link pDstBlock to set selectivity value - if (pfCtx->subsidiaries.num > 0) { - pfCtx->pDstBlock = pResult; - } - - int32_t code = pfCtx->fpSet.process(pfCtx); - if (code != TSDB_CODE_SUCCESS) { - return code; - } - numOfRows = pResInfo->numOfRes; - } else if (fmIsAggFunc(pfCtx->functionId)) { - // selective value output should be set during corresponding function execution - if (fmIsSelectValueFunc(pfCtx->functionId)) { - continue; - } - // _group_key function for "partition by tbname" + csum(col_name) query - SColumnInfoData* pOutput = taosArrayGet(pResult->pDataBlock, outputSlotId); - int32_t slotId = pfCtx->param[0].pCol->slotId; - - // todo handle the json tag - SColumnInfoData* pInput = taosArrayGet(pSrcBlock->pDataBlock, slotId); - for (int32_t f = 0; f < pSrcBlock->info.rows; ++f) { - bool isNull = colDataIsNull_s(pInput, f); - if (isNull) { - colDataAppendNULL(pOutput, pResult->info.rows + f); - } else { - char* data = colDataGetData(pInput, f); - colDataAppend(pOutput, pResult->info.rows + f, data, isNull); - } - } - - } else { - SArray* pBlockList = taosArrayInit(4, POINTER_BYTES); - taosArrayPush(pBlockList, &pSrcBlock); - - SColumnInfoData* pResColData = taosArrayGet(pResult->pDataBlock, outputSlotId); - SColumnInfoData idata = {.info = pResColData->info, .hasNull = true}; - - SScalarParam dest = {.columnData = &idata}; - int32_t code = scalarCalculate((SNode*)pExpr[k].pExpr->_function.pFunctNode, pBlockList, &dest); - if (code != TSDB_CODE_SUCCESS) { - taosArrayDestroy(pBlockList); - return code; - } - - int32_t startOffset = createNewColModel ? 0 : pResult->info.rows; - ASSERT(pResult->info.capacity > 0); - colDataMergeCol(pResColData, startOffset, (int32_t*)&pResult->info.capacity, &idata, dest.numOfRows); - colDataDestroy(&idata); - - numOfRows = dest.numOfRows; - taosArrayDestroy(pBlockList); - } - } else { - return TSDB_CODE_OPS_NOT_SUPPORT; - } - } - - if (!createNewColModel) { - pResult->info.rows += numOfRows; - } - - return TSDB_CODE_SUCCESS; -} - bool functionNeedToExecute(SqlFunctionCtx* pCtx) { struct SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); @@ -862,7 +684,7 @@ int32_t loadDataBlockOnDemand(SExecTaskInfo* pTaskInfo, STableScanInfo* pTableSc pTableScanInfo->pCtx, pTableScanInfo->numOfOutput, pTableScanInfo->rowEntryInfoOffset); } else { - if (setResultOutputBufByKey(pRuntimeEnv, pTableScanInfo->pResultRowInfo, pBlock->info.uid, &win, masterScan, &pResult, groupId, + if (setResultOutputBufByKey(pRuntimeEnv, pTableScanInfo->pResultRowInfo, pBlock->info.id.uid, &win, masterScan, &pResult, groupId, pTableScanInfo->pCtx, pTableScanInfo->numOfOutput, pTableScanInfo->rowEntryInfoOffset) != TSDB_CODE_SUCCESS) { T_LONG_JMP(pRuntimeEnv->env, TSDB_CODE_QRY_OUT_OF_MEMORY); @@ -913,7 +735,7 @@ int32_t loadDataBlockOnDemand(SExecTaskInfo* pTaskInfo, STableScanInfo* pTableSc TSKEY k = ascQuery? pBlock->info.window.skey : pBlock->info.window.ekey; STimeWindow win = getActiveTimeWindow(pTableScanInfo->pResultRowInfo, k, pQueryAttr); - if (setResultOutputBufByKey(pRuntimeEnv, pTableScanInfo->pResultRowInfo, pBlock->info.uid, &win, masterScan, &pResult, groupId, + if (setResultOutputBufByKey(pRuntimeEnv, pTableScanInfo->pResultRowInfo, pBlock->info.id.uid, &win, masterScan, &pResult, groupId, pTableScanInfo->pCtx, pTableScanInfo->numOfOutput, pTableScanInfo->rowEntryInfoOffset) != TSDB_CODE_SUCCESS) { T_LONG_JMP(pRuntimeEnv->env, TSDB_CODE_QRY_OUT_OF_MEMORY); @@ -1245,11 +1067,11 @@ int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock, SExprS continue; } - if (pBlock->info.groupId == 0) { - pBlock->info.groupId = pPos->groupId; + if (pBlock->info.id.groupId == 0) { + pBlock->info.id.groupId = pPos->groupId; } else { // current value belongs to different group, it can't be packed into one datablock - if (pBlock->info.groupId != pPos->groupId) { + if (pBlock->info.id.groupId != pPos->groupId) { releaseBufPage(pBuf, page); break; } @@ -1269,7 +1091,7 @@ int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock, SExprS } qDebug("%s result generated, rows:%d, groupId:%" PRIu64, GET_TASKID(pTaskInfo), pBlock->info.rows, - pBlock->info.groupId); + pBlock->info.id.groupId); blockDataUpdateTsWindow(pBlock, 0); return 0; @@ -1289,12 +1111,12 @@ void doBuildStreamResBlock(SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SGr } // clear the existed group id - pBlock->info.groupId = 0; + pBlock->info.id.groupId = 0; ASSERT(!pbInfo->mergeResultBlock); doCopyToSDataBlock(pTaskInfo, pBlock, &pOperator->exprSupp, pBuf, pGroupResInfo); void* tbname = NULL; - if (streamStateGetParName(pTaskInfo->streamInfo.pState, pBlock->info.groupId, &tbname) < 0) { + if (streamStateGetParName(pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, &tbname) < 0) { pBlock->info.parTbName[0] = 0; } else { memcpy(pBlock->info.parTbName, tbname, TSDB_TABLE_NAME_LEN); @@ -1316,7 +1138,7 @@ void doBuildResultDatablock(SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SG } // clear the existed group id - pBlock->info.groupId = 0; + pBlock->info.id.groupId = 0; if (!pbInfo->mergeResultBlock) { doCopyToSDataBlock(pTaskInfo, pBlock, &pOperator->exprSupp, pBuf, pGroupResInfo); } else { @@ -1327,11 +1149,11 @@ void doBuildResultDatablock(SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SG } // clearing group id to continue to merge data that belong to different groups - pBlock->info.groupId = 0; + pBlock->info.id.groupId = 0; } // clear the group id info in SSDataBlock, since the client does not need it - pBlock->info.groupId = 0; + pBlock->info.id.groupId = 0; } } @@ -1635,7 +1457,7 @@ static int32_t doOpenAggregateOptr(SOperatorInfo* pOperator) { } // the pDataBlock are always the same one, no need to call this again - setExecutionContext(pOperator, pOperator->exprSupp.numOfExprs, pBlock->info.groupId); + setExecutionContext(pOperator, pOperator->exprSupp.numOfExprs, pBlock->info.id.groupId); setInputDataBlock(pSup, pBlock, order, scanFlag, true); code = doAggregateImpl(pOperator, pSup->pCtx); if (code != 0) { @@ -1712,7 +1534,7 @@ static void doHandleRemainBlockForNewGroupImpl(SOperatorInfo* pOperator, SFillOp int32_t numOfResultRows = pResultInfo->capacity - pResBlock->info.rows; taosFillResultDataBlock(pInfo->pFillInfo, pResBlock, numOfResultRows); - pInfo->curGroupId = pInfo->existNewGroupBlock->info.groupId; + pInfo->curGroupId = pInfo->existNewGroupBlock->info.id.groupId; pInfo->existNewGroupBlock = NULL; } @@ -1721,7 +1543,7 @@ static void doHandleRemainBlockFromNewGroup(SOperatorInfo* pOperator, SFillOpera if (taosFillHasMoreResults(pInfo->pFillInfo)) { int32_t numOfResultRows = pResultInfo->capacity - pInfo->pFinalRes->info.rows; taosFillResultDataBlock(pInfo->pFillInfo, pInfo->pFinalRes, numOfResultRows); - pInfo->pRes->info.groupId = pInfo->curGroupId; + pInfo->pRes->info.id.groupId = pInfo->curGroupId; return; } @@ -1743,7 +1565,7 @@ static void doApplyScalarCalculation(SOperatorInfo* pOperator, SSDataBlock* pBlo setInputDataBlock(pNoFillSupp, pBlock, order, scanFlag, false); projectApplyFunctions(pNoFillSupp->pExprInfo, pInfo->pRes, pBlock, pNoFillSupp->pCtx, pNoFillSupp->numOfExprs, NULL); - pInfo->pRes->info.groupId = pBlock->info.groupId; + pInfo->pRes->info.id.groupId = pBlock->info.id.groupId; } static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) { @@ -1761,7 +1583,7 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) { doHandleRemainBlockFromNewGroup(pOperator, pInfo, pResultInfo, pTaskInfo); if (pResBlock->info.rows > 0) { - pResBlock->info.groupId = pInfo->curGroupId; + pResBlock->info.id.groupId = pInfo->curGroupId; return pResBlock; } @@ -1783,8 +1605,8 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) { blockDataEnsureCapacity(pInfo->pFinalRes, pBlock->info.rows); doApplyScalarCalculation(pOperator, pBlock, order, scanFlag); - if (pInfo->curGroupId == 0 || pInfo->curGroupId == pInfo->pRes->info.groupId) { - pInfo->curGroupId = pInfo->pRes->info.groupId; // the first data block + if (pInfo->curGroupId == 0 || pInfo->curGroupId == pInfo->pRes->info.id.groupId) { + pInfo->curGroupId = pInfo->pRes->info.id.groupId; // the first data block pInfo->totalInputRows += pInfo->pRes->info.rows; if (order == pInfo->pFillInfo->order) { @@ -1793,7 +1615,7 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) { taosFillSetStartInfo(pInfo->pFillInfo, pInfo->pRes->info.rows, pBlock->info.window.skey); } taosFillSetInputDataBlock(pInfo->pFillInfo, pInfo->pRes); - } else if (pInfo->curGroupId != pBlock->info.groupId) { // the new group data block + } else if (pInfo->curGroupId != pBlock->info.id.groupId) { // the new group data block pInfo->existNewGroupBlock = pBlock; // Fill the previous group data block, before handle the data block of new group. @@ -1810,13 +1632,13 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) { // 1. The result in current group not reach the threshold of output result, continue // 2. If multiple group results existing in one SSDataBlock is not allowed, return immediately if (pResBlock->info.rows > pResultInfo->threshold || pBlock == NULL || pInfo->existNewGroupBlock != NULL) { - pResBlock->info.groupId = pInfo->curGroupId; + pResBlock->info.id.groupId = pInfo->curGroupId; return pResBlock; } doHandleRemainBlockFromNewGroup(pOperator, pInfo, pResultInfo, pTaskInfo); if (pResBlock->info.rows >= pOperator->resultInfo.threshold || pBlock == NULL) { - pResBlock->info.groupId = pInfo->curGroupId; + pResBlock->info.id.groupId = pInfo->curGroupId; return pResBlock; } } else if (pInfo->existNewGroupBlock) { // try next group @@ -1826,7 +1648,7 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) { doHandleRemainBlockForNewGroupImpl(pOperator, pInfo, pResultInfo, pTaskInfo); if (pResBlock->info.rows > pResultInfo->threshold) { - pResBlock->info.groupId = pInfo->curGroupId; + pResBlock->info.id.groupId = pInfo->curGroupId; return pResBlock; } } else { @@ -2967,10 +2789,10 @@ int32_t buildDataBlockFromGroupRes(SOperatorInfo* pOperator, SStreamState* pStat continue; } - if (pBlock->info.groupId == 0) { - pBlock->info.groupId = pPos->groupId; + if (pBlock->info.id.groupId == 0) { + pBlock->info.id.groupId = pPos->groupId; void* tbname = NULL; - if (streamStateGetParName(pTaskInfo->streamInfo.pState, pBlock->info.groupId, &tbname) < 0) { + if (streamStateGetParName(pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, &tbname) < 0) { pBlock->info.parTbName[0] = 0; } else { memcpy(pBlock->info.parTbName, tbname, TSDB_TABLE_NAME_LEN); @@ -2978,7 +2800,7 @@ int32_t buildDataBlockFromGroupRes(SOperatorInfo* pOperator, SStreamState* pStat tdbFree(tbname); } else { // current value belongs to different group, it can't be packed into one datablock - if (pBlock->info.groupId != pPos->groupId) { + if (pBlock->info.id.groupId != pPos->groupId) { releaseOutputBuf(pState, &key, pRow); break; } @@ -3058,11 +2880,11 @@ int32_t buildSessionResultDataBlock(SOperatorInfo* pOperator, SStreamState* pSta continue; } - if (pBlock->info.groupId == 0) { - pBlock->info.groupId = pKey->groupId; + if (pBlock->info.id.groupId == 0) { + pBlock->info.id.groupId = pKey->groupId; void* tbname = NULL; - if (streamStateGetParName(pTaskInfo->streamInfo.pState, pBlock->info.groupId, &tbname) < 0) { + if (streamStateGetParName(pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, &tbname) < 0) { pBlock->info.parTbName[0] = 0; } else { memcpy(pBlock->info.parTbName, tbname, TSDB_TABLE_NAME_LEN); @@ -3070,7 +2892,7 @@ int32_t buildSessionResultDataBlock(SOperatorInfo* pOperator, SStreamState* pSta tdbFree(tbname); } else { // current value belongs to different group, it can't be packed into one datablock - if (pBlock->info.groupId != pKey->groupId) { + if (pBlock->info.id.groupId != pKey->groupId) { releaseOutputBuf(pState, NULL, pRow); break; } diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index 6dc8818900..4601175561 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -308,7 +308,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) { len = buildGroupKeys(pInfo->keyBuf, pInfo->pGroupColVals); int32_t ret = setGroupResultOutputBuf(pOperator, &(pInfo->binfo), pOperator->exprSupp.numOfExprs, pInfo->keyBuf, - len, pBlock->info.groupId, pInfo->aggSup.pResultBuf, &pInfo->aggSup); + len, pBlock->info.id.groupId, pInfo->aggSup.pResultBuf, &pInfo->aggSup); if (ret != TSDB_CODE_SUCCESS) { // null data, too many state code T_LONG_JMP(pTaskInfo->env, TSDB_CODE_QRY_APP_ERROR); } @@ -325,7 +325,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) { if (num > 0) { len = buildGroupKeys(pInfo->keyBuf, pInfo->pGroupColVals); int32_t ret = setGroupResultOutputBuf(pOperator, &(pInfo->binfo), pOperator->exprSupp.numOfExprs, pInfo->keyBuf, - len, pBlock->info.groupId, pInfo->aggSup.pResultBuf, &pInfo->aggSup); + len, pBlock->info.id.groupId, pInfo->aggSup.pResultBuf, &pInfo->aggSup); if (ret != TSDB_CODE_SUCCESS) { T_LONG_JMP(pTaskInfo->env, TSDB_CODE_QRY_APP_ERROR); } @@ -697,7 +697,7 @@ static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) { releaseBufPage(pInfo->pBuf, page); blockDataUpdateTsWindow(pInfo->binfo.pRes, 0); - pInfo->binfo.pRes->info.groupId = pGroupInfo->groupId; + pInfo->binfo.pRes->info.id.groupId = pGroupInfo->groupId; pOperator->resultInfo.totalRows += pInfo->binfo.pRes->info.rows; return pInfo->binfo.pRes; @@ -952,7 +952,7 @@ static SSDataBlock* buildStreamPartitionResult(SOperatorInfo* pOperator) { taosArrayDestroy(pParInfo->rowIds); pParInfo->rowIds = NULL; blockDataUpdateTsWindow(pDest, pInfo->tsColIndex); - pDest->info.groupId = pParInfo->groupId; + pDest->info.id.groupId = pParInfo->groupId; pOperator->resultInfo.totalRows += pDest->info.rows; pInfo->parIte = taosHashIterate(pInfo->pPartitions, pInfo->parIte); ASSERT(pDest->info.rows > 0); diff --git a/source/libs/executor/src/joinoperator.c b/source/libs/executor/src/joinoperator.c index 3839af9913..e7cce39dfd 100644 --- a/source/libs/executor/src/joinoperator.c +++ b/source/libs/executor/src/joinoperator.c @@ -185,7 +185,7 @@ static void mergeJoinJoinLeftRight(struct SOperatorInfo* pOperator, SSDataBlock* int32_t rowIndex = -1; SColumnInfoData* pSrc = NULL; - if (pLeftBlock->info.blockId == blockId) { + if (pLeftBlock->info.id.blockId == blockId) { pSrc = taosArrayGet(pLeftBlock->pDataBlock, slotId); rowIndex = leftPos; } else { diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c index 4bba3a72e1..d1ce178573 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -138,13 +138,13 @@ _error: static int32_t discardGroupDataBlock(SSDataBlock* pBlock, SLimitInfo* pLimitInfo) { if (pLimitInfo->remainGroupOffset > 0) { // it is the first group - if (pLimitInfo->currentGroupId == 0 || pLimitInfo->currentGroupId == pBlock->info.groupId) { - pLimitInfo->currentGroupId = pBlock->info.groupId; + if (pLimitInfo->currentGroupId == 0 || pLimitInfo->currentGroupId == pBlock->info.id.groupId) { + pLimitInfo->currentGroupId = pBlock->info.id.groupId; return PROJECT_RETRIEVE_CONTINUE; - } else if (pLimitInfo->currentGroupId != pBlock->info.groupId) { + } else if (pLimitInfo->currentGroupId != pBlock->info.id.groupId) { // now it is the data from a new group pLimitInfo->remainGroupOffset -= 1; - pLimitInfo->currentGroupId = pBlock->info.groupId; + pLimitInfo->currentGroupId = pBlock->info.id.groupId; // ignore data block in current group if (pLimitInfo->remainGroupOffset > 0) { @@ -153,7 +153,7 @@ static int32_t discardGroupDataBlock(SSDataBlock* pBlock, SLimitInfo* pLimitInfo } // set current group id of the project operator - pLimitInfo->currentGroupId = pBlock->info.groupId; + pLimitInfo->currentGroupId = pBlock->info.id.groupId; } return PROJECT_RETRIEVE_DONE; @@ -164,7 +164,7 @@ static int32_t setInfoForNewGroup(SSDataBlock* pBlock, SLimitInfo* pLimitInfo, S // here check for a new group data, we need to handle the data of the previous group. ASSERT(pLimitInfo->remainGroupOffset == 0 || pLimitInfo->remainGroupOffset == -1); - if (pLimitInfo->currentGroupId != 0 && pLimitInfo->currentGroupId != pBlock->info.groupId) { + if (pLimitInfo->currentGroupId != 0 && pLimitInfo->currentGroupId != pBlock->info.id.groupId) { pLimitInfo->numOfOutputGroups += 1; if ((pLimitInfo->slimit.limit > 0) && (pLimitInfo->slimit.limit <= pLimitInfo->numOfOutputGroups)) { setOperatorCompleted(pOperator); @@ -306,7 +306,7 @@ SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) { T_LONG_JMP(pTaskInfo->env, code); } - status = doIngroupLimitOffset(pLimitInfo, pBlock->info.groupId, pInfo->pRes, pOperator); + status = doIngroupLimitOffset(pLimitInfo, pBlock->info.id.groupId, pInfo->pRes, pOperator); if (status == PROJECT_RETRIEVE_CONTINUE) { continue; } @@ -316,7 +316,7 @@ SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) { if (pProjectInfo->mergeDataBlocks) { if (pRes->info.rows > 0) { - pFinalRes->info.groupId = pRes->info.groupId; + pFinalRes->info.id.groupId = pRes->info.id.groupId; pFinalRes->info.version = pRes->info.version; // continue merge data, ignore the group id @@ -511,11 +511,11 @@ SSDataBlock* doApplyIndefinitFunction(SOperatorInfo* pOperator) { break; } - if (pIndefInfo->groupId == 0 && pBlock->info.groupId != 0) { - pIndefInfo->groupId = pBlock->info.groupId; // this is the initial group result + if (pIndefInfo->groupId == 0 && pBlock->info.id.groupId != 0) { + pIndefInfo->groupId = pBlock->info.id.groupId; // this is the initial group result } else { - if (pIndefInfo->groupId != pBlock->info.groupId) { // reset output buffer and computing status - pIndefInfo->groupId = pBlock->info.groupId; + if (pIndefInfo->groupId != pBlock->info.id.groupId) { // reset output buffer and computing status + pIndefInfo->groupId = pBlock->info.id.groupId; pIndefInfo->pNextGroupRes = pBlock; break; } @@ -643,3 +643,180 @@ SSDataBlock* doGenerateSourceData(SOperatorInfo* pOperator) { return (pRes->info.rows > 0) ? pRes : NULL; } + +static void setPseudoOutputColInfo(SSDataBlock* pResult, SqlFunctionCtx* pCtx, SArray* pPseudoList) { + size_t num = (pPseudoList != NULL) ? taosArrayGetSize(pPseudoList) : 0; + for (int32_t i = 0; i < num; ++i) { + pCtx[i].pOutput = taosArrayGet(pResult->pDataBlock, i); + } +} + +int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBlock* pSrcBlock, SqlFunctionCtx* pCtx, + int32_t numOfOutput, SArray* pPseudoList) { + setPseudoOutputColInfo(pResult, pCtx, pPseudoList); + + if (pSrcBlock == NULL) { + for (int32_t k = 0; k < numOfOutput; ++k) { + int32_t outputSlotId = pExpr[k].base.resSchema.slotId; + + ASSERT(pExpr[k].pExpr->nodeType == QUERY_NODE_VALUE); + SColumnInfoData* pColInfoData = taosArrayGet(pResult->pDataBlock, outputSlotId); + + int32_t type = pExpr[k].base.pParam[0].param.nType; + if (TSDB_DATA_TYPE_NULL == type) { + colDataAppendNNULL(pColInfoData, 0, 1); + } else { + colDataAppend(pColInfoData, 0, taosVariantGet(&pExpr[k].base.pParam[0].param, type), false); + } + } + + pResult->info.rows = 1; + return TSDB_CODE_SUCCESS; + } + + if (pResult != pSrcBlock) { + pResult->info.id.groupId = pSrcBlock->info.id.groupId; + memcpy(pResult->info.parTbName, pSrcBlock->info.parTbName, TSDB_TABLE_NAME_LEN); + } + + // if the source equals to the destination, it is to create a new column as the result of scalar + // function or some operators. + bool createNewColModel = (pResult == pSrcBlock); + if (createNewColModel) { + blockDataEnsureCapacity(pResult, pResult->info.rows); + } + + int32_t numOfRows = 0; + + for (int32_t k = 0; k < numOfOutput; ++k) { + int32_t outputSlotId = pExpr[k].base.resSchema.slotId; + SqlFunctionCtx* pfCtx = &pCtx[k]; + SInputColumnInfoData* pInputData = &pfCtx->input; + + if (pExpr[k].pExpr->nodeType == QUERY_NODE_COLUMN) { // it is a project query + SColumnInfoData* pColInfoData = taosArrayGet(pResult->pDataBlock, outputSlotId); + if (pResult->info.rows > 0 && !createNewColModel) { + colDataMergeCol(pColInfoData, pResult->info.rows, (int32_t*)&pResult->info.capacity, pInputData->pData[0], + pInputData->numOfRows); + } else { + colDataAssign(pColInfoData, pInputData->pData[0], pInputData->numOfRows, &pResult->info); + } + + numOfRows = pInputData->numOfRows; + } else if (pExpr[k].pExpr->nodeType == QUERY_NODE_VALUE) { + SColumnInfoData* pColInfoData = taosArrayGet(pResult->pDataBlock, outputSlotId); + + int32_t offset = createNewColModel ? 0 : pResult->info.rows; + + int32_t type = pExpr[k].base.pParam[0].param.nType; + if (TSDB_DATA_TYPE_NULL == type) { + colDataAppendNNULL(pColInfoData, offset, pSrcBlock->info.rows); + } else { + char* p = taosVariantGet(&pExpr[k].base.pParam[0].param, type); + colDataAppendNItems(pColInfoData, offset, p, pSrcBlock->info.rows); + } + + numOfRows = pSrcBlock->info.rows; + } else if (pExpr[k].pExpr->nodeType == QUERY_NODE_OPERATOR) { + SArray* pBlockList = taosArrayInit(4, POINTER_BYTES); + taosArrayPush(pBlockList, &pSrcBlock); + + SColumnInfoData* pResColData = taosArrayGet(pResult->pDataBlock, outputSlotId); + SColumnInfoData idata = {.info = pResColData->info, .hasNull = true}; + + SScalarParam dest = {.columnData = &idata}; + int32_t code = scalarCalculate(pExpr[k].pExpr->_optrRoot.pRootNode, pBlockList, &dest); + if (code != TSDB_CODE_SUCCESS) { + taosArrayDestroy(pBlockList); + return code; + } + + int32_t startOffset = createNewColModel ? 0 : pResult->info.rows; + ASSERT(pResult->info.capacity > 0); + + colDataMergeCol(pResColData, startOffset, (int32_t*)&pResult->info.capacity, &idata, dest.numOfRows); + colDataDestroy(&idata); + + numOfRows = dest.numOfRows; + taosArrayDestroy(pBlockList); + } else if (pExpr[k].pExpr->nodeType == QUERY_NODE_FUNCTION) { + // _rowts/_c0, not tbname column + if (fmIsPseudoColumnFunc(pfCtx->functionId) && (!fmIsScanPseudoColumnFunc(pfCtx->functionId))) { + // do nothing + } else if (fmIsIndefiniteRowsFunc(pfCtx->functionId)) { + SResultRowEntryInfo* pResInfo = GET_RES_INFO(pfCtx); + pfCtx->fpSet.init(pfCtx, pResInfo); + + pfCtx->pOutput = taosArrayGet(pResult->pDataBlock, outputSlotId); + pfCtx->offset = createNewColModel ? 0 : pResult->info.rows; // set the start offset + + // set the timestamp(_rowts) output buffer + if (taosArrayGetSize(pPseudoList) > 0) { + int32_t* outputColIndex = taosArrayGet(pPseudoList, 0); + pfCtx->pTsOutput = (SColumnInfoData*)pCtx[*outputColIndex].pOutput; + } + + // link pDstBlock to set selectivity value + if (pfCtx->subsidiaries.num > 0) { + pfCtx->pDstBlock = pResult; + } + + int32_t code = pfCtx->fpSet.process(pfCtx); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + numOfRows = pResInfo->numOfRes; + } else if (fmIsAggFunc(pfCtx->functionId)) { + // selective value output should be set during corresponding function execution + if (fmIsSelectValueFunc(pfCtx->functionId)) { + continue; + } + // _group_key function for "partition by tbname" + csum(col_name) query + SColumnInfoData* pOutput = taosArrayGet(pResult->pDataBlock, outputSlotId); + int32_t slotId = pfCtx->param[0].pCol->slotId; + + // todo handle the json tag + SColumnInfoData* pInput = taosArrayGet(pSrcBlock->pDataBlock, slotId); + for (int32_t f = 0; f < pSrcBlock->info.rows; ++f) { + bool isNull = colDataIsNull_s(pInput, f); + if (isNull) { + colDataAppendNULL(pOutput, pResult->info.rows + f); + } else { + char* data = colDataGetData(pInput, f); + colDataAppend(pOutput, pResult->info.rows + f, data, isNull); + } + } + + } else { + SArray* pBlockList = taosArrayInit(4, POINTER_BYTES); + taosArrayPush(pBlockList, &pSrcBlock); + + SColumnInfoData* pResColData = taosArrayGet(pResult->pDataBlock, outputSlotId); + SColumnInfoData idata = {.info = pResColData->info, .hasNull = true}; + + SScalarParam dest = {.columnData = &idata}; + int32_t code = scalarCalculate((SNode*)pExpr[k].pExpr->_function.pFunctNode, pBlockList, &dest); + if (code != TSDB_CODE_SUCCESS) { + taosArrayDestroy(pBlockList); + return code; + } + + int32_t startOffset = createNewColModel ? 0 : pResult->info.rows; + ASSERT(pResult->info.capacity > 0); + colDataMergeCol(pResColData, startOffset, (int32_t*)&pResult->info.capacity, &idata, dest.numOfRows); + colDataDestroy(&idata); + + numOfRows = dest.numOfRows; + taosArrayDestroy(pBlockList); + } + } else { + return TSDB_CODE_OPS_NOT_SUPPORT; + } + } + + if (!createNewColModel) { + pResult->info.rows += numOfRows; + } + + return TSDB_CODE_SUCCESS; +} diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index c0bea731bd..84b7678b9f 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -184,7 +184,7 @@ static int32_t doDynamicPruneDataBlock(SOperatorInfo* pOperator, SDataBlockInfo* SExprSupp* pSup1 = pTableScanInfo->base.pdInfo.pExprSup; SFilePage* pPage = NULL; - SResultRow* pRow = getTableGroupOutputBuf(pOperator, pBlockInfo->groupId, &pPage); + SResultRow* pRow = getTableGroupOutputBuf(pOperator, pBlockInfo->id.groupId, &pPage); if (pRow == NULL) { return TSDB_CODE_SUCCESS; @@ -484,13 +484,13 @@ int32_t addTagPseudoColumnData(SReadHandle* pHandle, const SExprInfo* pExpr, int // 1. check if it is existed in meta cache if (pCache == NULL) { metaReaderInit(&mr, pHandle->meta, 0); - code = metaGetTableEntryByUidCache(&mr, pBlock->info.uid); + code = metaGetTableEntryByUidCache(&mr, pBlock->info.id.uid); if (code != TSDB_CODE_SUCCESS) { if (terrno == TSDB_CODE_PAR_TABLE_NOT_EXIST) { - qWarn("failed to get table meta, table may have been dropped, uid:0x%" PRIx64 ", code:%s, %s", pBlock->info.uid, + qWarn("failed to get table meta, table may have been dropped, uid:0x%" PRIx64 ", code:%s, %s", pBlock->info.id.uid, tstrerror(terrno), idStr); } else { - qError("failed to get table meta, uid:0x%" PRIx64 ", code:%s, %s", pBlock->info.uid, tstrerror(terrno), idStr); + qError("failed to get table meta, uid:0x%" PRIx64 ", code:%s, %s", pBlock->info.id.uid, tstrerror(terrno), idStr); } metaReaderClear(&mr); return terrno; @@ -505,16 +505,16 @@ int32_t addTagPseudoColumnData(SReadHandle* pHandle, const SExprInfo* pExpr, int } else { pCache->metaFetch += 1; - h = taosLRUCacheLookup(pCache->pTableMetaEntryCache, &pBlock->info.uid, sizeof(pBlock->info.uid)); + h = taosLRUCacheLookup(pCache->pTableMetaEntryCache, &pBlock->info.id.uid, sizeof(pBlock->info.id.uid)); if (h == NULL) { metaReaderInit(&mr, pHandle->meta, 0); - code = metaGetTableEntryByUidCache(&mr, pBlock->info.uid); + code = metaGetTableEntryByUidCache(&mr, pBlock->info.id.uid); if (code != TSDB_CODE_SUCCESS) { if (terrno == TSDB_CODE_PAR_TABLE_NOT_EXIST) { qWarn("failed to get table meta, table may have been dropped, uid:0x%" PRIx64 ", code:%s, %s", - pBlock->info.uid, tstrerror(terrno), idStr); + pBlock->info.id.uid, tstrerror(terrno), idStr); } else { - qError("failed to get table meta, uid:0x%" PRIx64 ", code:%s, %s", pBlock->info.uid, tstrerror(terrno), + qError("failed to get table meta, uid:0x%" PRIx64 ", code:%s, %s", pBlock->info.id.uid, tstrerror(terrno), idStr); } metaReaderClear(&mr); @@ -528,7 +528,7 @@ int32_t addTagPseudoColumnData(SReadHandle* pHandle, const SExprInfo* pExpr, int val = *pVal; freeReader = true; - int32_t ret = taosLRUCacheInsert(pCache->pTableMetaEntryCache, &pBlock->info.uid, sizeof(uint64_t), pVal, + int32_t ret = taosLRUCacheInsert(pCache->pTableMetaEntryCache, &pBlock->info.id.uid, sizeof(uint64_t), pVal, sizeof(STableCachedVal), freeCachedMetaItem, NULL, TAOS_LRU_PRIORITY_LOW); if (ret != TAOS_LRU_STATUS_OK) { qError("failed to put meta into lru cache, code:%d, %s", ret, idStr); @@ -642,13 +642,13 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) { SDataBlockInfo* pBInfo = &pBlock->info; int32_t rows = 0; - tsdbRetrieveDataBlockInfo(pTableScanInfo->base.dataReader, &rows, &pBInfo->uid, &pBInfo->window); + tsdbRetrieveDataBlockInfo(pTableScanInfo->base.dataReader, &rows, &pBInfo->id.uid, &pBInfo->window); blockDataEnsureCapacity(pBlock, rows); // todo remove it latter pBInfo->rows = rows; - ASSERT(pBInfo->uid != 0); - pBlock->info.groupId = getTableGroupId(pTaskInfo->pTableInfoList, pBlock->info.uid); + ASSERT(pBInfo->id.uid != 0); + pBlock->info.id.groupId = getTableGroupId(pTaskInfo->pTableInfoList, pBlock->info.id.uid); uint32_t status = 0; int32_t code = loadDataBlock(pOperator, &pTableScanInfo->base, pBlock, &status); @@ -668,13 +668,13 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) { pOperator->cost.totalCost = pTableScanInfo->base.readRecorder.elapsedTime; // todo refactor - /*pTableScanInfo->lastStatus.uid = pBlock->info.uid;*/ + /*pTableScanInfo->lastStatus.uid = pBlock->info.id.uid;*/ /*pTableScanInfo->lastStatus.ts = pBlock->info.window.ekey;*/ pTaskInfo->streamInfo.lastStatus.type = TMQ_OFFSET__SNAPSHOT_DATA; - pTaskInfo->streamInfo.lastStatus.uid = pBlock->info.uid; + pTaskInfo->streamInfo.lastStatus.uid = pBlock->info.id.uid; pTaskInfo->streamInfo.lastStatus.ts = pBlock->info.window.ekey; - ASSERT(pBlock->info.uid != 0); + ASSERT(pBlock->info.id.uid != 0); return pBlock; } return NULL; @@ -786,7 +786,7 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) { SSDataBlock* result = doGroupedTableScan(pOperator); if (result != NULL) { - ASSERT(result->info.uid != 0); + ASSERT(result->info.id.uid != 0); return result; } @@ -1009,7 +1009,7 @@ static SSDataBlock* readPreVersionData(SOperatorInfo* pTableScanOp, uint64_t tbU SDataBlockInfo* pBInfo = &pBlock->info; int32_t rows = 0; - tsdbRetrieveDataBlockInfo(pReader, &rows, &pBInfo->uid, &pBInfo->window); + tsdbRetrieveDataBlockInfo(pReader, &rows, &pBInfo->id.uid, &pBInfo->window); SArray* pCols = tsdbRetrieveDataBlock(pReader, NULL); blockDataEnsureCapacity(pBlock, rows); @@ -1018,7 +1018,7 @@ static SSDataBlock* readPreVersionData(SOperatorInfo* pTableScanOp, uint64_t tbU relocateColumnData(pBlock, pTableScanInfo->base.matchInfo.pList, pCols, true); doSetTagColumnData(&pTableScanInfo->base, pBlock, pTaskInfo, rows); - pBlock->info.groupId = getTableGroupId(pTaskInfo->pTableInfoList, pBInfo->uid); + pBlock->info.id.groupId = getTableGroupId(pTaskInfo->pTableInfoList, pBInfo->id.uid); } tsdbReaderClose(pReader); @@ -1175,7 +1175,7 @@ static SSDataBlock* doRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pSDB, int32 pResult->info.calWin = pInfo->updateWin; return pResult; } - } else if (pResult->info.groupId == pInfo->groupId) { + } else if (pResult->info.id.groupId == pInfo->groupId) { pResult->info.calWin = pInfo->updateWin; return pResult; } @@ -1366,7 +1366,7 @@ void calBlockTbName(SStreamScanInfo* pInfo, SSDataBlock* pBlock) { if (pBlock == NULL || pBlock->info.rows == 0) return; void* tbname = NULL; - if (streamStateGetParName(pInfo->pStreamScanOp->pTaskInfo->streamInfo.pState, pBlock->info.groupId, &tbname) < 0) { + if (streamStateGetParName(pInfo->pStreamScanOp->pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, &tbname) < 0) { pBlock->info.parTbName[0] = 0; } else { memcpy(pBlock->info.parTbName, tbname, TSDB_TABLE_NAME_LEN); @@ -1399,8 +1399,8 @@ void calBlockTbName(SStreamScanInfo* pInfo, SSDataBlock* pBlock) { pBlock->info.parTbName[0] = 0; } - if (pBlock->info.groupId && pBlock->info.parTbName[0]) { - streamStatePutParName(pState, pBlock->info.groupId, pBlock->info.parTbName); + if (pBlock->info.id.groupId && pBlock->info.parTbName[0]) { + streamStatePutParName(pState, pBlock->info.id.groupId, pBlock->info.parTbName); } blockDataDestroy(pSrcBlock); @@ -1434,7 +1434,7 @@ static void checkUpdateData(SStreamScanInfo* pInfo, bool invertible, SSDataBlock SColumnInfoData* pColDataInfo = taosArrayGet(pBlock->pDataBlock, pInfo->primaryTsIndex); ASSERT(pColDataInfo->info.type == TSDB_DATA_TYPE_TIMESTAMP); TSKEY* tsCol = (TSKEY*)pColDataInfo->pData; - bool tableInserted = updateInfoIsTableInserted(pInfo->pUpdateInfo, pBlock->info.uid); + bool tableInserted = updateInfoIsTableInserted(pInfo->pUpdateInfo, pBlock->info.id.uid); for (int32_t rowId = 0; rowId < pBlock->info.rows; rowId++) { SResultRowInfo dumyInfo; dumyInfo.cur.pageId = -1; @@ -1445,18 +1445,18 @@ static void checkUpdateData(SStreamScanInfo* pInfo, bool invertible, SSDataBlock isClosed = isCloseWindow(&win, &pInfo->twAggSup); } // must check update info first. - bool update = updateInfoIsUpdated(pInfo->pUpdateInfo, pBlock->info.uid, tsCol[rowId]); + bool update = updateInfoIsUpdated(pInfo->pUpdateInfo, pBlock->info.id.uid, tsCol[rowId]); bool closedWin = isClosed && isSignleIntervalWindow(pInfo) && - isDeletedStreamWindow(&win, pBlock->info.groupId, + isDeletedStreamWindow(&win, pBlock->info.id.groupId, pInfo->pTableScanOp->pTaskInfo->streamInfo.pState, &pInfo->twAggSup); if ((update || closedWin) && out) { qDebug("stream update check not pass, update %d, closedWin %d", update, closedWin); uint64_t gpId = 0; - appendOneRowToStreamSpecialBlock(pInfo->pUpdateDataRes, tsCol + rowId, tsCol + rowId, &pBlock->info.uid, &gpId, + appendOneRowToStreamSpecialBlock(pInfo->pUpdateDataRes, tsCol + rowId, tsCol + rowId, &pBlock->info.id.uid, &gpId, NULL); if (closedWin && pInfo->partitionSup.needCalc) { gpId = calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pBlock, rowId); - appendOneRowToStreamSpecialBlock(pInfo->pUpdateDataRes, tsCol + rowId, tsCol + rowId, &pBlock->info.uid, &gpId, + appendOneRowToStreamSpecialBlock(pInfo->pUpdateDataRes, tsCol + rowId, tsCol + rowId, &pBlock->info.id.uid, &gpId, NULL); } } @@ -1476,11 +1476,11 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock blockDataEnsureCapacity(pInfo->pRes, pBlock->info.rows); pInfo->pRes->info.rows = pBlock->info.rows; - pInfo->pRes->info.uid = pBlock->info.uid; + pInfo->pRes->info.id.uid = pBlock->info.id.uid; pInfo->pRes->info.type = STREAM_NORMAL; pInfo->pRes->info.version = pBlock->info.version; - pInfo->pRes->info.groupId = getTableGroupId(pTaskInfo->pTableInfoList, pBlock->info.uid); + pInfo->pRes->info.id.groupId = getTableGroupId(pTaskInfo->pTableInfoList, pBlock->info.id.uid); // todo extract method for (int32_t i = 0; i < taosArrayGetSize(pInfo->matchInfo.pList); ++i) { @@ -1807,8 +1807,8 @@ FETCH_NEXT_BLOCK: int32_t current = pInfo->validBlockIndex++; SSDataBlock* pBlock = taosArrayGetP(pInfo->pBlockLists, current); - if (pBlock->info.groupId && pBlock->info.parTbName[0]) { - streamStatePutParName(pTaskInfo->streamInfo.pState, pBlock->info.groupId, pBlock->info.parTbName); + if (pBlock->info.id.groupId && pBlock->info.parTbName[0]) { + streamStatePutParName(pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, pBlock->info.parTbName); } // TODO move into scan pBlock->info.calWin.skey = INT64_MIN; @@ -1960,7 +1960,7 @@ FETCH_NEXT_BLOCK: setBlockIntoRes(pInfo, &block, false); - if (updateInfoIgnore(pInfo->pUpdateInfo, &pInfo->pRes->info.window, pInfo->pRes->info.groupId, + if (updateInfoIgnore(pInfo->pUpdateInfo, &pInfo->pRes->info.window, pInfo->pRes->info.id.groupId, pInfo->pRes->info.version)) { printDataBlock(pInfo->pRes, "stream scan ignore"); blockDataCleanup(pInfo->pRes); @@ -2050,7 +2050,7 @@ static SSDataBlock* doRawScan(SOperatorInfo* pOperator) { } int32_t rows = 0; - tsdbRetrieveDataBlockInfo(pInfo->dataReader, &rows, &pBlock->info.uid, &pBlock->info.window); + tsdbRetrieveDataBlockInfo(pInfo->dataReader, &rows, &pBlock->info.id.uid, &pBlock->info.window); pBlock->info.rows = rows; SArray* pCols = tsdbRetrieveDataBlock(pInfo->dataReader, NULL); @@ -2059,9 +2059,9 @@ static SSDataBlock* doRawScan(SOperatorInfo* pOperator) { longjmp(pTaskInfo->env, terrno); } - qDebug("tmqsnap doRawScan get data uid:%" PRId64 "", pBlock->info.uid); + qDebug("tmqsnap doRawScan get data uid:%" PRId64 "", pBlock->info.id.uid); pTaskInfo->streamInfo.lastStatus.type = TMQ_OFFSET__SNAPSHOT_DATA; - pTaskInfo->streamInfo.lastStatus.uid = pBlock->info.uid; + pTaskInfo->streamInfo.lastStatus.uid = pBlock->info.id.uid; pTaskInfo->streamInfo.lastStatus.ts = pBlock->info.window.ekey; return pBlock; } @@ -2555,7 +2555,7 @@ static SSDataBlock* getTableDataBlockImpl(void* param) { blockDataCleanup(pBlock); int32_t rows = 0; - tsdbRetrieveDataBlockInfo(reader, &rows, &pBlock->info.uid, &pBlock->info.window); + tsdbRetrieveDataBlockInfo(reader, &rows, &pBlock->info.id.uid, &pBlock->info.window); blockDataEnsureCapacity(pBlock, rows); pBlock->info.rows = rows; @@ -2577,7 +2577,7 @@ static SSDataBlock* getTableDataBlockImpl(void* param) { continue; } - pBlock->info.groupId = getTableGroupId(pTaskInfo->pTableInfoList, pBlock->info.uid); + pBlock->info.id.groupId = getTableGroupId(pTaskInfo->pTableInfoList, pBlock->info.id.uid); pOperator->resultInfo.totalRows += pBlock->info.rows; pTableScanInfo->base.readRecorder.elapsedTime += (taosGetTimestampUs() - st) / 1000.0; @@ -2773,7 +2773,7 @@ SSDataBlock* doTableMergeScan(SOperatorInfo* pOperator) { pBlock = getSortedTableMergeScanBlockData(pInfo->pSortHandle, pInfo->pResBlock, pOperator->resultInfo.capacity, pOperator); if (pBlock != NULL) { - pBlock->info.groupId = pInfo->groupId; + pBlock->info.id.groupId = pInfo->groupId; pOperator->resultInfo.totalRows += pBlock->info.rows; return pBlock; } else { diff --git a/source/libs/executor/src/sortoperator.c b/source/libs/executor/src/sortoperator.c index f2c8dc5083..ec754f31b0 100644 --- a/source/libs/executor/src/sortoperator.c +++ b/source/libs/executor/src/sortoperator.c @@ -359,7 +359,7 @@ SSDataBlock* fetchNextGroupSortDataBlock(void* param) { SOperatorInfo* childOp = source->childOpInfo; SSDataBlock* block = childOp->fpSet.getNextFn(childOp); if (block != NULL) { - if (block->info.groupId == grpSortOpInfo->currGroupId) { + if (block->info.id.groupId == grpSortOpInfo->currGroupId) { grpSortOpInfo->childOpStatus = CHILD_OP_SAME_GROUP; return block; } else { @@ -439,7 +439,7 @@ SSDataBlock* doGroupSort(SOperatorInfo* pOperator) { setOperatorCompleted(pOperator); return NULL; } - pInfo->currGroupId = pInfo->prefetchedSortInput->info.groupId; + pInfo->currGroupId = pInfo->prefetchedSortInput->info.id.groupId; pInfo->childOpStatus = CHILD_OP_NEW_GROUP; beginSortGroup(pOperator); } @@ -451,13 +451,13 @@ SSDataBlock* doGroupSort(SOperatorInfo* pOperator) { pBlock = getGroupSortedBlockData(pInfo->pCurrSortHandle, pInfo->binfo.pRes, pOperator->resultInfo.capacity, pInfo->matchInfo.pList, pInfo); if (pBlock != NULL) { - pBlock->info.groupId = pInfo->currGroupId; + pBlock->info.id.groupId = pInfo->currGroupId; pOperator->resultInfo.totalRows += pBlock->info.rows; return pBlock; } else { if (pInfo->childOpStatus == CHILD_OP_NEW_GROUP) { finishSortGroup(pOperator); - pInfo->currGroupId = pInfo->prefetchedSortInput->info.groupId; + pInfo->currGroupId = pInfo->prefetchedSortInput->info.id.groupId; beginSortGroup(pOperator); } else if (pInfo->childOpStatus == CHILD_OP_FINISHED) { finishSortGroup(pOperator); @@ -691,10 +691,10 @@ SSDataBlock* getMultiwaySortedBlockData(SSortHandle* pHandle, SSDataBlock* pData pInfo->limitInfo.numOfOutputRows += p->info.rows; pDataBlock->info.rows = p->info.rows; - pDataBlock->info.groupId = pInfo->groupId; + pDataBlock->info.id.groupId = pInfo->groupId; } - qDebug("%s get sorted block, groupId:0x%" PRIx64 " rows:%d", GET_TASKID(pTaskInfo), pDataBlock->info.groupId, + qDebug("%s get sorted block, groupId:0x%" PRIx64 " rows:%d", GET_TASKID(pTaskInfo), pDataBlock->info.id.groupId, pDataBlock->info.rows); return (pDataBlock->info.rows > 0) ? pDataBlock : NULL; diff --git a/source/libs/executor/src/tfill.c b/source/libs/executor/src/tfill.c index ba826a23d2..ec02633563 100644 --- a/source/libs/executor/src/tfill.c +++ b/source/libs/executor/src/tfill.c @@ -1092,7 +1092,7 @@ static bool checkResult(SStreamFillSupporter* pFillSup, TSKEY ts, uint64_t group } static void buildFillResult(SResultRowData* pResRow, SStreamFillSupporter* pFillSup, TSKEY ts, SSDataBlock* pBlock) { - uint64_t groupId = pBlock->info.groupId; + uint64_t groupId = pBlock->info.id.groupId; if (pFillSup->hasDelete && !checkResult(pFillSup, ts, groupId)) { return; } @@ -1131,7 +1131,7 @@ static void doStreamFillNormal(SStreamFillSupporter* pFillSup, SStreamFillInfo* static void doStreamFillLinear(SStreamFillSupporter* pFillSup, SStreamFillInfo* pFillInfo, SSDataBlock* pBlock) { while (hasRemainCalc(pFillInfo) && pBlock->info.rows < pBlock->info.capacity) { - uint64_t groupId = pBlock->info.groupId; + uint64_t groupId = pBlock->info.id.groupId; SWinKey key = {.groupId = groupId, .ts = pFillInfo->current}; if (pFillSup->hasDelete && !checkResult(pFillSup, pFillInfo->current, groupId)) { pFillInfo->current = taosTimeAdd(pFillInfo->current, pFillSup->interval.sliding, pFillSup->interval.slidingUnit, @@ -1230,7 +1230,7 @@ void keepBlockRowInDiscBuf(SOperatorInfo* pOperator, SStreamFillInfo* pFillInfo, static void doFillResults(SOperatorInfo* pOperator, SStreamFillSupporter* pFillSup, SStreamFillInfo* pFillInfo, SSDataBlock* pBlock, TSKEY* tsCol, int32_t rowId, SSDataBlock* pRes) { - uint64_t groupId = pBlock->info.groupId; + uint64_t groupId = pBlock->info.id.groupId; getWindowFromDiscBuf(pOperator, tsCol[rowId], groupId, pFillSup); if (pFillSup->prev.key == pFillInfo->preRowKey) { resetFillWindow(&pFillSup->prev); @@ -1245,9 +1245,9 @@ static void doStreamFillImpl(SOperatorInfo* pOperator) { SStreamFillSupporter* pFillSup = pInfo->pFillSup; SStreamFillInfo* pFillInfo = pInfo->pFillInfo; SSDataBlock* pBlock = pInfo->pSrcBlock; - uint64_t groupId = pBlock->info.groupId; + uint64_t groupId = pBlock->info.id.groupId; SSDataBlock* pRes = pInfo->pRes; - pRes->info.groupId = groupId; + pRes->info.id.groupId = groupId; if (hasRemainCalc(pFillInfo)) { doStreamFillRange(pFillInfo, pFillSup, pRes); } @@ -1342,14 +1342,14 @@ static void doDeleteFillFinalize(SOperatorInfo* pOperator) { tSimpleHashClear(pInfo->pFillSup->pResMap); for (; pFillInfo->delIndex < size; pFillInfo->delIndex++) { STimeRange* range = taosArrayGet(pFillInfo->delRanges, pFillInfo->delIndex); - if (pInfo->pRes->info.groupId != 0 && pInfo->pRes->info.groupId != range->groupId) { + if (pInfo->pRes->info.id.groupId != 0 && pInfo->pRes->info.id.groupId != range->groupId) { return; } getWindowFromDiscBuf(pOperator, range->skey, range->groupId, pInfo->pFillSup); setDeleteFillValueInfo(range->skey, range->ekey, pInfo->pFillSup, pInfo->pFillInfo); if (pInfo->pFillInfo->needFill) { doStreamFillRange(pInfo->pFillInfo, pInfo->pFillSup, pInfo->pRes); - pInfo->pRes->info.groupId = range->groupId; + pInfo->pRes->info.id.groupId = range->groupId; } SWinKey key = {.ts = range->skey, .groupId = range->groupId}; streamStateFillDel(pOperator->pTaskInfo->streamInfo.pState, &key); @@ -1435,7 +1435,7 @@ static void doApplyStreamScalarCalculation(SOperatorInfo* pOperator, SSDataBlock pSup = &pInfo->pFillSup->notFillExprSup; setInputDataBlock(pSup, pSrcBlock, TSDB_ORDER_ASC, MAIN_SCAN, false); projectApplyFunctions(pSup->pExprInfo, pDstBlock, pSrcBlock, pSup->pCtx, pSup->numOfExprs, NULL); - pDstBlock->info.groupId = pSrcBlock->info.groupId; + pDstBlock->info.id.groupId = pSrcBlock->info.id.groupId; blockDataUpdateTsWindow(pDstBlock, pInfo->primaryTsCol); } diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 0e0ec5b339..a6a477a9e3 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -655,7 +655,7 @@ static void doInterpUnclosedTimeWindow(SOperatorInfo* pOperatorInfo, int32_t num SGroupKeys* pTsKey = taosArrayGet(pInfo->pPrevValues, 0); int64_t prevTs = *(int64_t*)pTsKey->pData; - if (groupId == pBlock->info.groupId) { + if (groupId == pBlock->info.id.groupId) { doTimeWindowInterpolation(pInfo->pPrevValues, pBlock->pDataBlock, prevTs, -1, tsCols[startPos], startPos, w.ekey, RESULT_ROW_END_INTERP, pSup); } @@ -927,7 +927,7 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul int32_t startPos = 0; int32_t numOfOutput = pSup->numOfExprs; int64_t* tsCols = extractTsCol(pBlock, pInfo); - uint64_t tableGroupId = pBlock->info.groupId; + uint64_t tableGroupId = pBlock->info.id.groupId; bool ascScan = (pInfo->inputOrder == TSDB_ORDER_ASC); TSKEY ts = getStartTsKey(&pBlock->info.window, tsCols); SResultRow* pResult = NULL; @@ -1112,7 +1112,7 @@ static void doStateWindowAggImpl(SOperatorInfo* pOperator, SStateWindowOperatorI SExprSupp* pSup = &pOperator->exprSupp; SColumnInfoData* pStateColInfoData = taosArrayGet(pBlock->pDataBlock, pInfo->stateCol.slotId); - int64_t gid = pBlock->info.groupId; + int64_t gid = pBlock->info.id.groupId; bool masterScan = true; int32_t numOfOutput = pOperator->exprSupp.numOfExprs; @@ -1829,7 +1829,7 @@ static void doSessionWindowAggImpl(SOperatorInfo* pOperator, SSessionAggOperator bool masterScan = true; int32_t numOfOutput = pOperator->exprSupp.numOfExprs; - int64_t gid = pBlock->info.groupId; + int64_t gid = pBlock->info.id.groupId; int64_t gap = pInfo->gap; @@ -2333,7 +2333,7 @@ void doBuildResult(SOperatorInfo* pOperator, SStreamState* pState, SSDataBlock* } // clear the existed group id - pBlock->info.groupId = 0; + pBlock->info.id.groupId = 0; buildDataBlockFromGroupRes(pOperator, pState, pBlock, &pOperator->exprSupp, pGroupResInfo); } @@ -2573,7 +2573,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { projectApplyFunctions(pExprSup->pExprInfo, pBlock, pBlock, pExprSup->pCtx, pExprSup->numOfExprs, NULL); } setInputDataBlock(pSup, pBlock, TSDB_ORDER_ASC, MAIN_SCAN, true); - doStreamIntervalAggImpl(pOperator, pBlock, pBlock->info.groupId, pUpdatedMap); + doStreamIntervalAggImpl(pOperator, pBlock, pBlock->info.id.groupId, pUpdatedMap); if (IS_FINAL_OP(pInfo)) { int32_t chIndex = getChildIndex(pBlock); int32_t size = taosArrayGetSize(pInfo->pChildren); @@ -2591,7 +2591,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { SOperatorInfo* pChildOp = taosArrayGetP(pInfo->pChildren, chIndex); SStreamIntervalOperatorInfo* pChInfo = pChildOp->info; setInputDataBlock(&pChildOp->exprSupp, pBlock, TSDB_ORDER_ASC, MAIN_SCAN, true); - doStreamIntervalAggImpl(pChildOp, pBlock, pBlock->info.groupId, NULL); + doStreamIntervalAggImpl(pChildOp, pBlock, pBlock->info.id.groupId, NULL); } maxTs = TMAX(maxTs, pBlock->info.window.ekey); maxTs = TMAX(maxTs, pBlock->info.watermark); @@ -3086,7 +3086,7 @@ static void doStreamSessionAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSData SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; SStreamSessionAggOperatorInfo* pInfo = pOperator->info; int32_t numOfOutput = pOperator->exprSupp.numOfExprs; - uint64_t groupId = pSDataBlock->info.groupId; + uint64_t groupId = pSDataBlock->info.id.groupId; int64_t code = TSDB_CODE_SUCCESS; SResultRow* pResult = NULL; int32_t rows = pSDataBlock->info.rows; @@ -3377,7 +3377,7 @@ void doBuildSessionResult(SOperatorInfo* pOperator, SStreamState* pState, SGroup } // clear the existed group id - pBlock->info.groupId = 0; + pBlock->info.id.groupId = 0; buildSessionResultDataBlock(pOperator, pState, pBlock, &pOperator->exprSupp, pGroupResInfo); } @@ -3854,7 +3854,7 @@ static void doStreamStateAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDataBl SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; SStreamStateAggOperatorInfo* pInfo = pOperator->info; int32_t numOfOutput = pOperator->exprSupp.numOfExprs; - int64_t groupId = pSDataBlock->info.groupId; + int64_t groupId = pSDataBlock->info.id.groupId; int64_t code = TSDB_CODE_SUCCESS; TSKEY* tsCols = NULL; SResultRow* pResult = NULL; @@ -4178,7 +4178,7 @@ static void doMergeAlignedIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultR } static void cleanupAfterGroupResultGen(SMergeAlignedIntervalAggOperatorInfo* pMiaInfo, SSDataBlock* pRes) { - pRes->info.groupId = pMiaInfo->groupId; + pRes->info.id.groupId = pMiaInfo->groupId; pMiaInfo->curTs = INT64_MIN; pMiaInfo->groupId = 0; } @@ -4203,7 +4203,7 @@ static void doMergeAlignedIntervalAgg(SOperatorInfo* pOperator) { pBlock = pMiaInfo->prefetchedBlock; pMiaInfo->prefetchedBlock = NULL; - pMiaInfo->groupId = pBlock->info.groupId; + pMiaInfo->groupId = pBlock->info.id.groupId; } // no data exists, all query processing is done @@ -4220,12 +4220,12 @@ static void doMergeAlignedIntervalAgg(SOperatorInfo* pOperator) { } if (pMiaInfo->groupId == 0) { - if (pMiaInfo->groupId != pBlock->info.groupId) { - pMiaInfo->groupId = pBlock->info.groupId; - pRes->info.groupId = pMiaInfo->groupId; + if (pMiaInfo->groupId != pBlock->info.id.groupId) { + pMiaInfo->groupId = pBlock->info.id.groupId; + pRes->info.id.groupId = pMiaInfo->groupId; } } else { - if (pMiaInfo->groupId != pBlock->info.groupId) { + if (pMiaInfo->groupId != pBlock->info.id.groupId) { // if there are unclosed time window, close it firstly. ASSERT(pMiaInfo->curTs != INT64_MIN); finalizeResultRows(pIaInfo->aggSup.pResultBuf, &pResultRowInfo->cur, pSup, pRes, pTaskInfo); @@ -4236,7 +4236,7 @@ static void doMergeAlignedIntervalAgg(SOperatorInfo* pOperator) { break; } else { // continue - pRes->info.groupId = pMiaInfo->groupId; + pRes->info.id.groupId = pMiaInfo->groupId; } } @@ -4443,7 +4443,7 @@ static void doMergeIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultRowInfo* int32_t startPos = 0; int32_t numOfOutput = pExprSup->numOfExprs; int64_t* tsCols = extractTsCol(pBlock, iaInfo); - uint64_t tableGroupId = pBlock->info.groupId; + uint64_t tableGroupId = pBlock->info.id.groupId; bool ascScan = (iaInfo->inputOrder == TSDB_ORDER_ASC); TSKEY blockStartTs = getStartTsKey(&pBlock->info.window, tsCols); SResultRow* pResult = NULL; @@ -4549,7 +4549,7 @@ static SSDataBlock* doMergeIntervalAgg(SOperatorInfo* pOperator) { pBlock = downstream->fpSet.getNextFn(downstream); } else { pBlock = miaInfo->prefetchedBlock; - miaInfo->groupId = pBlock->info.groupId; + miaInfo->groupId = pBlock->info.id.groupId; miaInfo->prefetchedBlock = NULL; } @@ -4561,8 +4561,8 @@ static SSDataBlock* doMergeIntervalAgg(SOperatorInfo* pOperator) { if (!miaInfo->hasGroupId) { miaInfo->hasGroupId = true; - miaInfo->groupId = pBlock->info.groupId; - } else if (miaInfo->groupId != pBlock->info.groupId) { + miaInfo->groupId = pBlock->info.id.groupId; + } else if (miaInfo->groupId != pBlock->info.id.groupId) { miaInfo->prefetchedBlock = pBlock; break; } @@ -4576,7 +4576,7 @@ static SSDataBlock* doMergeIntervalAgg(SOperatorInfo* pOperator) { } } - pRes->info.groupId = miaInfo->groupId; + pRes->info.id.groupId = miaInfo->groupId; } if (miaInfo->inputBlocksFinished) { @@ -4585,7 +4585,7 @@ static SSDataBlock* doMergeIntervalAgg(SOperatorInfo* pOperator) { if (listNode != NULL) { SGroupTimeWindow* grpWin = (SGroupTimeWindow*)(listNode->data); // finalizeWindowResult(pOperator, grpWin->groupId, &grpWin->window, pRes); - pRes->info.groupId = grpWin->groupId; + pRes->info.id.groupId = grpWin->groupId; } } @@ -4744,7 +4744,7 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) { maxTs = TMAX(maxTs, pBlock->info.window.ekey); minTs = TMIN(minTs, pBlock->info.window.skey); - doStreamIntervalAggImpl(pOperator, pBlock, pBlock->info.groupId, pUpdatedMap); + doStreamIntervalAggImpl(pOperator, pBlock, pBlock->info.id.groupId, pUpdatedMap); } pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, maxTs); pInfo->twAggSup.minTs = TMIN(pInfo->twAggSup.minTs, minTs); diff --git a/source/libs/executor/src/tsort.c b/source/libs/executor/src/tsort.c index e0a0b9442e..3f91142708 100644 --- a/source/libs/executor/src/tsort.c +++ b/source/libs/executor/src/tsort.c @@ -417,8 +417,8 @@ int32_t msortComparFn(const void* pLeft, const void* pRight, void* param) { SSDataBlock* pRightBlock = pRightSource->src.pBlock; if (pParam->cmpGroupId) { - if (pLeftBlock->info.groupId != pRightBlock->info.groupId) { - return pLeftBlock->info.groupId < pRightBlock->info.groupId ? -1 : 1; + if (pLeftBlock->info.id.groupId != pRightBlock->info.id.groupId) { + return pLeftBlock->info.id.groupId < pRightBlock->info.id.groupId ? -1 : 1; } } @@ -826,7 +826,7 @@ void* tsortGetValue(STupleHandle* pVHandle, int32_t colIndex) { } } -uint64_t tsortGetGroupId(STupleHandle* pVHandle) { return pVHandle->pBlock->info.groupId; } +uint64_t tsortGetGroupId(STupleHandle* pVHandle) { return pVHandle->pBlock->info.id.groupId; } SSortExecInfo tsortGetSortExecInfo(SSortHandle* pHandle) { SSortExecInfo info = {0}; diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index 8715aa0be1..c78ec5b999 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -1096,7 +1096,7 @@ int32_t udfAggProcess(struct SqlFunctionCtx *pCtx) { SSDataBlock *pTempBlock = createDataBlock(); pTempBlock->info.rows = pInput->totalRows; - pTempBlock->info.uid = pInput->uid; + pTempBlock->info.id.uid = pInput->uid; for (int32_t i = 0; i < numOfCols; ++i) { blockDataAppendColInfo(pTempBlock, pInput->pData[i]); } diff --git a/source/libs/index/test/index_executor_tests.cpp b/source/libs/index/test/index_executor_tests.cpp index bcc474dc8b..c8a7ca98f0 100644 --- a/source/libs/index/test/index_executor_tests.cpp +++ b/source/libs/index/test/index_executor_tests.cpp @@ -78,7 +78,7 @@ void sifAppendReservedSlot(SArray *pBlockList, int16_t *dataBlockId, int16_t *sl blockDataEnsureCapacity(res, rows); *dataBlockId = taosArrayGetSize(pBlockList) - 1; - res->info.blockId = *dataBlockId; + res->info.id.blockId = *dataBlockId; *slotId = 0; } else { SSDataBlock *res = *(SSDataBlock **)taosArrayGetLast(pBlockList); diff --git a/source/libs/scalar/src/scalar.c b/source/libs/scalar/src/scalar.c index d1271e9290..55f33b7a3e 100644 --- a/source/libs/scalar/src/scalar.c +++ b/source/libs/scalar/src/scalar.c @@ -378,7 +378,7 @@ int32_t sclInitParam(SNode *node, SScalarParam *param, SScalarCtx *ctx, int32_t int32_t index = -1; for (int32_t i = 0; i < taosArrayGetSize(ctx->pBlockList); ++i) { SSDataBlock *pb = taosArrayGetP(ctx->pBlockList, i); - if (pb->info.blockId == ref->dataBlockId) { + if (pb->info.id.blockId == ref->dataBlockId) { index = i; break; } @@ -1384,7 +1384,7 @@ EDealRes sclWalkTarget(SNode *pNode, SScalarCtx *ctx) { int32_t index = -1; for (int32_t i = 0; i < taosArrayGetSize(ctx->pBlockList); ++i) { SSDataBlock *pb = taosArrayGetP(ctx->pBlockList, i); - if (pb->info.blockId == target->dataBlockId) { + if (pb->info.id.blockId == target->dataBlockId) { index = i; break; } diff --git a/source/libs/scalar/test/scalar/scalarTests.cpp b/source/libs/scalar/test/scalar/scalarTests.cpp index 0fd0c98c1a..dae26d3d58 100644 --- a/source/libs/scalar/test/scalar/scalarTests.cpp +++ b/source/libs/scalar/test/scalar/scalarTests.cpp @@ -98,7 +98,7 @@ void scltAppendReservedSlot(SArray *pBlockList, int16_t *dataBlockId, int16_t *s taosArrayPush(pBlockList, &res); *dataBlockId = taosArrayGetSize(pBlockList) - 1; - res->info.blockId = *dataBlockId; + res->info.id.blockId = *dataBlockId; *slotId = 0; } else { SSDataBlock *res = *(SSDataBlock **)taosArrayGetLast(pBlockList); diff --git a/source/libs/stream/src/streamDispatch.c b/source/libs/stream/src/streamDispatch.c index 573a1ea31f..2c36c299ee 100644 --- a/source/libs/stream/src/streamDispatch.c +++ b/source/libs/stream/src/streamDispatch.c @@ -463,7 +463,7 @@ int32_t streamDispatchAllBlocks(SStreamTask* pTask, const SStreamDataBlock* pDat continue; } - if (streamSearchAndAddBlock(pTask, pReqs, pDataBlock, vgSz, pDataBlock->info.groupId) < 0) { + if (streamSearchAndAddBlock(pTask, pReqs, pDataBlock, vgSz, pDataBlock->info.id.groupId) < 0) { goto FAIL_SHUFFLE_DISPATCH; } } diff --git a/source/libs/stream/src/streamUpdate.c b/source/libs/stream/src/streamUpdate.c index 15526cd8bb..1589fddda4 100644 --- a/source/libs/stream/src/streamUpdate.c +++ b/source/libs/stream/src/streamUpdate.c @@ -166,7 +166,7 @@ bool updateInfoIsTableInserted(SUpdateInfo *pInfo, int64_t tbUid) { TSKEY updateInfoFillBlockData(SUpdateInfo *pInfo, SSDataBlock *pBlock, int32_t primaryTsCol) { if (pBlock == NULL || pBlock->info.rows == 0) return INT64_MIN; TSKEY maxTs = INT64_MIN; - int64_t tbUid = pBlock->info.uid; + int64_t tbUid = pBlock->info.id.uid; SColumnInfoData *pColDataInfo = taosArrayGet(pBlock->pDataBlock, primaryTsCol); From e802fb47ad53c2b476b64fbac41354d412c757dd Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 28 Nov 2022 14:36:55 +0800 Subject: [PATCH 21/23] fix(query): update the copy function. --- source/libs/executor/src/projectoperator.c | 4 +- source/libs/executor/src/sysscanoperator.c | 50 +++++++++++----------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c index d1ce178573..da77facb21 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -713,7 +713,9 @@ int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBloc colDataAppendNNULL(pColInfoData, offset, pSrcBlock->info.rows); } else { char* p = taosVariantGet(&pExpr[k].base.pParam[0].param, type); - colDataAppendNItems(pColInfoData, offset, p, pSrcBlock->info.rows); + for (int32_t i = 0; i < pSrcBlock->info.rows; ++i) { + colDataAppend(pColInfoData, i + offset, p, false); + } } numOfRows = pSrcBlock->info.rows; diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index 7ef2668804..3d35326749 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -1831,39 +1831,39 @@ static int32_t doGetTableRowSize(void* pMeta, uint64_t uid, int32_t* rowLen, con } static SSDataBlock* doBlockInfoScan(SOperatorInfo* pOperator) { - if (pOperator->status == OP_EXEC_DONE) { - return NULL; - } + if (pOperator->status == OP_EXEC_DONE) { + return NULL; + } - SBlockDistInfo* pBlockScanInfo = pOperator->info; - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SBlockDistInfo* pBlockScanInfo = pOperator->info; + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - STableBlockDistInfo blockDistInfo = {.minRows = INT_MAX, .maxRows = INT_MIN}; - int32_t code = doGetTableRowSize(pBlockScanInfo->readHandle.meta, pBlockScanInfo->uid, - (int32_t*)&blockDistInfo.rowSize, GET_TASKID(pTaskInfo)); - if (code != TSDB_CODE_SUCCESS) { - T_LONG_JMP(pTaskInfo->env, code); - } + STableBlockDistInfo blockDistInfo = {.minRows = INT_MAX, .maxRows = INT_MIN}; + int32_t code = doGetTableRowSize(pBlockScanInfo->readHandle.meta, pBlockScanInfo->uid, + (int32_t*)&blockDistInfo.rowSize, GET_TASKID(pTaskInfo)); + if (code != TSDB_CODE_SUCCESS) { + T_LONG_JMP(pTaskInfo->env, code); + } - tsdbGetFileBlocksDistInfo(pBlockScanInfo->pHandle, &blockDistInfo); - blockDistInfo.numOfInmemRows = (int32_t)tsdbGetNumOfRowsInMemTable(pBlockScanInfo->pHandle); + tsdbGetFileBlocksDistInfo(pBlockScanInfo->pHandle, &blockDistInfo); + blockDistInfo.numOfInmemRows = (int32_t)tsdbGetNumOfRowsInMemTable(pBlockScanInfo->pHandle); - SSDataBlock* pBlock = pBlockScanInfo->pResBlock; + SSDataBlock* pBlock = pBlockScanInfo->pResBlock; - int32_t slotId = pOperator->exprSupp.pExprInfo->base.resSchema.slotId; - SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, slotId); + int32_t slotId = pOperator->exprSupp.pExprInfo->base.resSchema.slotId; + SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, slotId); - int32_t len = tSerializeBlockDistInfo(NULL, 0, &blockDistInfo); - char* p = taosMemoryCalloc(1, len + VARSTR_HEADER_SIZE); - tSerializeBlockDistInfo(varDataVal(p), len, &blockDistInfo); - varDataSetLen(p, len); + int32_t len = tSerializeBlockDistInfo(NULL, 0, &blockDistInfo); + char* p = taosMemoryCalloc(1, len + VARSTR_HEADER_SIZE); + tSerializeBlockDistInfo(varDataVal(p), len, &blockDistInfo); + varDataSetLen(p, len); - colDataAppend(pColInfo, 0, p, false); - taosMemoryFree(p); + colDataAppend(pColInfo, 0, p, false); + taosMemoryFree(p); - pBlock->info.rows = 1; - pOperator->status = OP_EXEC_DONE; - return pBlock; + pBlock->info.rows = 1; + pOperator->status = OP_EXEC_DONE; + return pBlock; } static void destroyBlockDistScanOperatorInfo(void* param) { From 7bb27e29b7c25b62f16f56ca1c3768bde3091aa7 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Mon, 28 Nov 2022 14:38:12 +0800 Subject: [PATCH 22/23] fix(tdb/flush): make drop two-child rbtree node works --- source/libs/tdb/src/db/tdbPager.c | 45 ++++- source/util/src/trbtree.c | 287 +++++++++++++++++++++--------- 2 files changed, 238 insertions(+), 94 deletions(-) diff --git a/source/libs/tdb/src/db/tdbPager.c b/source/libs/tdb/src/db/tdbPager.c index 7264e0b5ff..ea67986da2 100644 --- a/source/libs/tdb/src/db/tdbPager.c +++ b/source/libs/tdb/src/db/tdbPager.c @@ -210,6 +210,7 @@ int tdbPagerOpen(SPCache *pCache, const char *fileName, SPager **ppPager) { ret = tdbGetFileSize(pPager->fd, pPager->pageSize, &(pPager->dbOrigSize)); pPager->dbFileSize = pPager->dbOrigSize; + tdbTrace("pager/open reset dirty tree: %p", &pPager->rbt); tRBTreeCreate(&pPager->rbt, pageCmpFn); *ppPager = pPager; @@ -296,7 +297,7 @@ int tdbPagerWrite(SPager *pPager, SPage *pPage) { // ref page one more time so the page will not be release tdbRefPage(pPage); - tdbDebug("pcache/mdirty page %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id); + tdbDebug("pager/mdirty page %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id); // Set page as dirty pPage->isDirty = 1; @@ -316,6 +317,7 @@ int tdbPagerWrite(SPager *pPager, SPage *pPage) { pPage->pDirtyNext = *ppPage; *ppPage = pPage; */ + tdbTrace("put page: %p %d to dirty tree: %p", pPage, TDB_PAGE_PGNO(pPage), &pPager->rbt); tRBTreePut(&pPager->rbt, (SRBTreeNode *)pPage); // Write page to journal if neccessary @@ -373,6 +375,7 @@ int tdbPagerCommit(SPager *pPager, TXN *pTxn) { SRBTreeNode *pNode = NULL; while ((pNode = tRBTreeIterNext(&iter)) != NULL) { pPage = (SPage *)pNode; + ASSERT(pPage->nOverflow == 0); ret = tdbPagerWritePageToDB(pPager, pPage); if (ret < 0) { @@ -398,6 +401,7 @@ int tdbPagerCommit(SPager *pPager, TXN *pTxn) { tdbPCacheRelease(pPager->pCache, pPage, pTxn); } + tdbTrace("pager/commit reset dirty tree: %p", &pPager->rbt); tRBTreeCreate(&pPager->rbt, pageCmpFn); // sync the db file @@ -471,6 +475,7 @@ int tdbPagerPrepareAsyncCommit(SPager *pPager, TXN *pTxn) { tdbPCacheRelease(pPager->pCache, pPage, pTxn); } /* + tdbTrace("reset dirty tree: %p", &pPager->rbt); tRBTreeCreate(&pPager->rbt, pageCmpFn); // sync the db file @@ -566,6 +571,7 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) { tdbPCacheRelease(pPager->pCache, pPage, pTxn); } + tdbTrace("reset dirty tree: %p", &pPager->rbt); tRBTreeCreate(&pPager->rbt, pageCmpFn); // 4, remove the journal file @@ -580,6 +586,8 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) { int tdbPagerFlushPage(SPager *pPager, TXN *pTxn) { SPage *pPage; + i32 nRef; + SPgno maxPgno = pPager->dbOrigSize; int ret; // loop to write the dirty pages to file @@ -587,29 +595,52 @@ int tdbPagerFlushPage(SPager *pPager, TXN *pTxn) { SRBTreeNode *pNode = NULL; while ((pNode = tRBTreeIterNext(&iter)) != NULL) { pPage = (SPage *)pNode; + nRef = tdbGetPageRef(pPage); + if (nRef > 1) { + continue; + } + + SPgno pgno = TDB_PAGE_PGNO(pPage); + if (pgno > maxPgno) { + maxPgno = pgno; + } ret = tdbPagerWritePageToDB(pPager, pPage); if (ret < 0) { tdbError("failed to write page to db since %s", tstrerror(terrno)); return -1; } - } - tdbTrace("tdbttl commit:%p, %d/%d", pPager, pPager->dbOrigSize, pPager->dbFileSize); - pPager->dbOrigSize = pPager->dbFileSize; + tdbTrace("tdb/flush:%p, %d/%d/%d", pPager, pPager->dbOrigSize, pPager->dbFileSize, maxPgno); + pPager->dbOrigSize = maxPgno; + + pPage->isDirty = 0; + + tdbTrace("pager/flush drop page: %p %d from dirty tree: %p", pPage, TDB_PAGE_PGNO(pPage), &pPager->rbt); + tRBTreeDrop(&pPager->rbt, (SRBTreeNode *)pPage); + tdbPCacheRelease(pPager->pCache, pPage, pTxn); + + break; + } + /* + tdbTrace("tdb/flush:%p, %d/%d/%d", pPager, pPager->dbOrigSize, pPager->dbFileSize, maxPgno); + pPager->dbOrigSize = maxPgno; // release the page iter = tRBTreeIterCreate(&pPager->rbt, 1); while ((pNode = tRBTreeIterNext(&iter)) != NULL) { pPage = (SPage *)pNode; + nRef = tdbGetPageRef(pPage); + if (nRef > 1) { + continue; + } pPage->isDirty = 0; + tdbTrace("pager/flush drop page: %p %d from dirty tree: %p", pPage, TDB_PAGE_PGNO(pPage), &pPager->rbt); tRBTreeDrop(&pPager->rbt, (SRBTreeNode *)pPage); tdbPCacheRelease(pPager->pCache, pPage, pTxn); } - - tRBTreeCreate(&pPager->rbt, pageCmpFn); - + */ return 0; } diff --git a/source/util/src/trbtree.c b/source/util/src/trbtree.c index cbbf53d8f1..c6aea87470 100644 --- a/source/util/src/trbtree.c +++ b/source/util/src/trbtree.c @@ -104,61 +104,6 @@ static void tRBTreeTransplant(SRBTree *pTree, SRBTreeNode *u, SRBTreeNode *v) { v->parent = u->parent; } -static void tRBTreeDropFix(SRBTree *pTree, SRBTreeNode *x) { - while (x != pTree->root && x->color == BLACK) { - if (x == x->parent->left) { - SRBTreeNode *w = x->parent->right; - if (w->color == RED) { - w->color = BLACK; - x->parent->color = RED; - tRBTreeRotateLeft(pTree, x->parent); - w = x->parent->right; - } - if (w->left->color == BLACK && w->right->color == BLACK) { - w->color = RED; - x = x->parent; - } else { - if (w->right->color == BLACK) { - w->left->color = BLACK; - w->color = RED; - tRBTreeRotateRight(pTree, w); - w = x->parent->right; - } - w->color = x->parent->color; - x->parent->color = BLACK; - w->right->color = BLACK; - tRBTreeRotateLeft(pTree, x->parent); - x = pTree->root; - } - } else { - SRBTreeNode *w = x->parent->left; - if (w->color == RED) { - w->color = BLACK; - x->parent->color = RED; - tRBTreeRotateRight(pTree, x->parent); - w = x->parent->left; - } - if (w->right->color == BLACK && w->left->color == BLACK) { - w->color = RED; - x = x->parent; - } else { - if (w->left->color == BLACK) { - w->right->color = BLACK; - w->color = RED; - tRBTreeRotateLeft(pTree, w); - w = x->parent->left; - } - w->color = x->parent->color; - x->parent->color = BLACK; - w->left->color = BLACK; - tRBTreeRotateRight(pTree, x->parent); - x = pTree->root; - } - } - } - x->color = BLACK; -} - static SRBTreeNode *tRBTreeSuccessor(SRBTree *pTree, SRBTreeNode *pNode) { if (pNode->right != pTree->NIL) { pNode = pNode->right; @@ -255,11 +200,205 @@ SRBTreeNode *tRBTreePut(SRBTree *pTree, SRBTreeNode *z) { return z; } -void tRBTreeDrop(SRBTree *pTree, SRBTreeNode *z) { - SRBTreeNode *y = z; - SRBTreeNode *x; - ECOLOR y_orignal_color = y->color; +#define RBTREE_NULL rbtree->NIL +#define rbtree_t SRBTree +#define rbnode_t SRBTreeNode +#define rbtree_rotate_left tRBTreeRotateLeft +#define rbtree_rotate_right tRBTreeRotateRight +static void rbtree_delete_fixup(rbtree_t *rbtree, rbnode_t *child, rbnode_t *child_parent) { + rbnode_t *sibling; + int go_up = 1; + + /* determine sibling to the node that is one-black short */ + if (child_parent->right == child) + sibling = child_parent->left; + else + sibling = child_parent->right; + + while (go_up) { + if (child_parent == RBTREE_NULL) { + /* removed parent==black from root, every path, so ok */ + return; + } + + if (sibling->color == RED) { /* rotate to get a black sibling */ + child_parent->color = RED; + sibling->color = BLACK; + if (child_parent->right == child) + rbtree_rotate_right(rbtree, child_parent); + else + rbtree_rotate_left(rbtree, child_parent); + /* new sibling after rotation */ + if (child_parent->right == child) + sibling = child_parent->left; + else + sibling = child_parent->right; + } + + if (child_parent->color == BLACK && sibling->color == BLACK && sibling->left->color == BLACK && + sibling->right->color == BLACK) { /* fixup local with recolor of sibling */ + if (sibling != RBTREE_NULL) sibling->color = RED; + + child = child_parent; + child_parent = child_parent->parent; + /* prepare to go up, new sibling */ + if (child_parent->right == child) + sibling = child_parent->left; + else + sibling = child_parent->right; + } else + go_up = 0; + } + + if (child_parent->color == RED && sibling->color == BLACK && sibling->left->color == BLACK && + sibling->right->color == BLACK) { + /* move red to sibling to rebalance */ + if (sibling != RBTREE_NULL) sibling->color = RED; + child_parent->color = BLACK; + return; + } + assert(sibling != RBTREE_NULL); + + /* get a new sibling, by rotating at sibling. See which child + of sibling is red */ + if (child_parent->right == child && sibling->color == BLACK && sibling->right->color == RED && + sibling->left->color == BLACK) { + sibling->color = RED; + sibling->right->color = BLACK; + rbtree_rotate_left(rbtree, sibling); + /* new sibling after rotation */ + if (child_parent->right == child) + sibling = child_parent->left; + else + sibling = child_parent->right; + } else if (child_parent->left == child && sibling->color == BLACK && sibling->left->color == RED && + sibling->right->color == BLACK) { + sibling->color = RED; + sibling->left->color = BLACK; + rbtree_rotate_right(rbtree, sibling); + /* new sibling after rotation */ + if (child_parent->right == child) + sibling = child_parent->left; + else + sibling = child_parent->right; + } + + /* now we have a black sibling with a red child. rotate and exchange colors. */ + sibling->color = child_parent->color; + child_parent->color = BLACK; + if (child_parent->right == child) { + assert(sibling->left->color == RED); + sibling->left->color = BLACK; + rbtree_rotate_right(rbtree, child_parent); + } else { + assert(sibling->right->color == RED); + sibling->right->color = BLACK; + rbtree_rotate_left(rbtree, child_parent); + } +} + +/** helpers for delete: swap node colours */ +static void swap_int8(ECOLOR *x, ECOLOR *y) { + ECOLOR t = *x; + *x = *y; + *y = t; +} + +/** helpers for delete: swap node pointers */ +static void swap_np(rbnode_t **x, rbnode_t **y) { + rbnode_t *t = *x; + *x = *y; + *y = t; +} + +/** Update parent pointers of child trees of 'parent' */ +static void change_parent_ptr(rbtree_t *rbtree, rbnode_t *parent, rbnode_t *old, rbnode_t *new) { + if (parent == RBTREE_NULL) { + assert(rbtree->root == old); + if (rbtree->root == old) rbtree->root = new; + return; + } + assert(parent->left == old || parent->right == old || parent->left == new || parent->right == new); + if (parent->left == old) parent->left = new; + if (parent->right == old) parent->right = new; +} +/** Update parent pointer of a node 'child' */ +static void change_child_ptr(rbtree_t *rbtree, rbnode_t *child, rbnode_t *old, rbnode_t *new) { + if (child == RBTREE_NULL) return; + assert(child->parent == old || child->parent == new); + if (child->parent == old) child->parent = new; +} + +rbnode_t *rbtree_delete(rbtree_t *rbtree, void *key) { + rbnode_t *to_delete = key; + rbnode_t *child; + + /* make sure we have at most one non-leaf child */ + if (to_delete->left != RBTREE_NULL && to_delete->right != RBTREE_NULL) { + /* swap with smallest from right subtree (or largest from left) */ + rbnode_t *smright = to_delete->right; + while (smright->left != RBTREE_NULL) smright = smright->left; + /* swap the smright and to_delete elements in the tree, + * but the rbnode_t is first part of user data struct + * so cannot just swap the keys and data pointers. Instead + * readjust the pointers left,right,parent */ + + /* swap colors - colors are tied to the position in the tree */ + swap_int8(&to_delete->color, &smright->color); + + /* swap child pointers in parents of smright/to_delete */ + change_parent_ptr(rbtree, to_delete->parent, to_delete, smright); + if (to_delete->right != smright) change_parent_ptr(rbtree, smright->parent, smright, to_delete); + + /* swap parent pointers in children of smright/to_delete */ + change_child_ptr(rbtree, smright->left, smright, to_delete); + change_child_ptr(rbtree, smright->left, smright, to_delete); + change_child_ptr(rbtree, smright->right, smright, to_delete); + change_child_ptr(rbtree, smright->right, smright, to_delete); + change_child_ptr(rbtree, to_delete->left, to_delete, smright); + if (to_delete->right != smright) change_child_ptr(rbtree, to_delete->right, to_delete, smright); + if (to_delete->right == smright) { + /* set up so after swap they work */ + to_delete->right = to_delete; + smright->parent = smright; + } + + /* swap pointers in to_delete/smright nodes */ + swap_np(&to_delete->parent, &smright->parent); + swap_np(&to_delete->left, &smright->left); + swap_np(&to_delete->right, &smright->right); + + /* now delete to_delete (which is at the location where the smright previously was) */ + } + assert(to_delete->left == RBTREE_NULL || to_delete->right == RBTREE_NULL); + + if (to_delete->left != RBTREE_NULL) + child = to_delete->left; + else + child = to_delete->right; + + /* unlink to_delete from the tree, replace to_delete with child */ + change_parent_ptr(rbtree, to_delete->parent, to_delete, child); + change_child_ptr(rbtree, child, to_delete, to_delete->parent); + + if (to_delete->color == RED) { + /* if node is red then the child (black) can be swapped in */ + } else if (child->color == RED) { + /* change child to BLACK, removing a RED node is no problem */ + if (child != RBTREE_NULL) child->color = BLACK; + } else + rbtree_delete_fixup(rbtree, child, to_delete->parent); + + /* unlink completely */ + to_delete->parent = RBTREE_NULL; + to_delete->left = RBTREE_NULL; + to_delete->right = RBTREE_NULL; + to_delete->color = BLACK; + return to_delete; +} + +void tRBTreeDrop(SRBTree *pTree, SRBTreeNode *z) { // update min/max node if (pTree->min == z) { pTree->min = tRBTreeSuccessor(pTree, pTree->min); @@ -268,34 +407,8 @@ void tRBTreeDrop(SRBTree *pTree, SRBTreeNode *z) { pTree->max = tRBTreePredecessor(pTree, pTree->max); } - // drop impl - if (z->left == pTree->NIL) { - x = z->right; - tRBTreeTransplant(pTree, z, z->right); - } else if (z->right == pTree->NIL) { - x = z->left; - tRBTreeTransplant(pTree, z, z->left); - } else { - y = tRBTreeSuccessor(pTree, z); - y_orignal_color = y->color; - x = y->right; - if (y->parent == z) { - x->parent = z; - } else { - tRBTreeTransplant(pTree, y, y->right); - y->right = z->right; - y->right->parent = y; - } - tRBTreeTransplant(pTree, z, y); - y->left = z->left; - y->left->parent = y; - y->color = z->color; - } + rbtree_delete(pTree, z); - // fix - if (y_orignal_color == BLACK) { - tRBTreeDropFix(pTree, x); - } pTree->n--; } @@ -343,4 +456,4 @@ SRBTreeNode *tRBTreeIterNext(SRBTreeIter *pIter) { _exit: return (pNode == pIter->pTree->NIL) ? NULL : pNode; -} \ No newline at end of file +} From 95e4a4812e66b2a92d309172a088c29d0e1a4b2e Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Mon, 28 Nov 2022 15:04:35 +0800 Subject: [PATCH 23/23] fix(stream): fill combine with subtable --- source/libs/executor/src/tfill.c | 39 ++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/source/libs/executor/src/tfill.c b/source/libs/executor/src/tfill.c index 7674b9e479..a736b6e13f 100644 --- a/source/libs/executor/src/tfill.c +++ b/source/libs/executor/src/tfill.c @@ -1282,7 +1282,9 @@ static void doStreamFillImpl(SOperatorInfo* pOperator) { blockDataCleanup(pInfo->pSrcBlock); } -static void buildDeleteRange(TSKEY start, TSKEY end, uint64_t groupId, SSDataBlock* delRes) { +static void buildDeleteRange(SOperatorInfo* pOp, TSKEY start, TSKEY end, uint64_t groupId, SSDataBlock* delRes) { + SStreamState* pState = pOp->pTaskInfo->streamInfo.pState; + SSDataBlock* pBlock = delRes; SColumnInfoData* pStartCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); SColumnInfoData* pEndCol = taosArrayGet(pBlock->pDataBlock, END_TS_COLUMN_INDEX); @@ -1290,25 +1292,42 @@ static void buildDeleteRange(TSKEY start, TSKEY end, uint64_t groupId, SSDataBlo SColumnInfoData* pGroupCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); SColumnInfoData* pCalStartCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX); SColumnInfoData* pCalEndCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX); + SColumnInfoData* pTbNameCol = taosArrayGet(pBlock->pDataBlock, TABLE_NAME_COLUMN_INDEX); colDataAppend(pStartCol, pBlock->info.rows, (const char*)&start, false); colDataAppend(pEndCol, pBlock->info.rows, (const char*)&end, false); colDataAppendNULL(pUidCol, pBlock->info.rows); colDataAppend(pGroupCol, pBlock->info.rows, (const char*)&groupId, false); colDataAppendNULL(pCalStartCol, pBlock->info.rows); colDataAppendNULL(pCalEndCol, pBlock->info.rows); + + SColumnInfoData* pTableCol = taosArrayGet(pBlock->pDataBlock, TABLE_NAME_COLUMN_INDEX); + + void* tbname = NULL; + streamStateGetParName(pOp->pTaskInfo->streamInfo.pState, groupId, &tbname); + if (tbname == NULL) { + colDataAppendNULL(pTableCol, pBlock->info.rows); + } else { + char parTbName[VARSTR_HEADER_SIZE + TSDB_TABLE_NAME_LEN]; + STR_WITH_MAXSIZE_TO_VARSTR(parTbName, tbname, sizeof(parTbName)); + colDataAppend(pTableCol, pBlock->info.rows, (const char*)parTbName, false); + } + tdbFree(tbname); + pBlock->info.rows++; } -static void buildDeleteResult(SStreamFillSupporter* pFillSup, TSKEY startTs, TSKEY endTs, uint64_t groupId, +static void buildDeleteResult(SOperatorInfo* pOperator, TSKEY startTs, TSKEY endTs, uint64_t groupId, SSDataBlock* delRes) { + SStreamFillOperatorInfo* pInfo = pOperator->info; + SStreamFillSupporter* pFillSup = pInfo->pFillSup; if (hasPrevWindow(pFillSup)) { TSKEY start = getNextWindowTs(pFillSup->prev.key, &pFillSup->interval); - buildDeleteRange(start, endTs, groupId, delRes); + buildDeleteRange(pOperator, start, endTs, groupId, delRes); } else if (hasNextWindow(pFillSup)) { TSKEY end = getPrevWindowTs(pFillSup->next.key, &pFillSup->interval); - buildDeleteRange(startTs, end, groupId, delRes); + buildDeleteRange(pOperator, startTs, end, groupId, delRes); } else { - buildDeleteRange(startTs, endTs, groupId, delRes); + buildDeleteRange(pOperator, startTs, endTs, groupId, delRes); } } @@ -1319,7 +1338,7 @@ static void doDeleteFillResultImpl(SOperatorInfo* pOperator, TSKEY startTs, TSKE SWinKey key = {.ts = startTs, .groupId = groupId}; if (!pInfo->pFillInfo->needFill) { streamStateFillDel(pOperator->pTaskInfo->streamInfo.pState, &key); - buildDeleteResult(pInfo->pFillSup, startTs, endTs, groupId, pInfo->pDelRes); + buildDeleteResult(pOperator, startTs, endTs, groupId, pInfo->pDelRes); } else { STimeRange tw = { .skey = startTs, @@ -1578,7 +1597,7 @@ static SStreamFillSupporter* initStreamFillSup(SStreamFillPhysiNode* pPhyFillNod destroyStreamFillSupporter(pFillSup); return NULL; } - + SExprInfo* noFillExpr = createExprInfo(pPhyFillNode->pNotFillExprs, NULL, &numOfNotFillCols); code = initExprSupp(&pFillSup->notFillExprSup, noFillExpr, numOfNotFillCols); if (code != TSDB_CODE_SUCCESS) { @@ -1715,9 +1734,9 @@ SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFi } pInfo->srcRowIndex = 0; - setOperatorInfo(pOperator, "StreamFillOperator", QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL, false, OP_NOT_OPENED, pInfo, pTaskInfo); - pOperator->fpSet = - createOperatorFpSet(operatorDummyOpenFn, doStreamFill, NULL, destroyStreamFillOperatorInfo, NULL); + setOperatorInfo(pOperator, "StreamFillOperator", QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL, false, OP_NOT_OPENED, pInfo, + pTaskInfo); + pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, doStreamFill, NULL, destroyStreamFillOperatorInfo, NULL); code = appendDownstream(pOperator, &downstream, 1); if (code != TSDB_CODE_SUCCESS) {