diff --git a/include/common/tcommon.h b/include/common/tcommon.h index 7e7e9b0481..ccad689710 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -54,6 +54,8 @@ typedef struct SSessionKey { uint64_t groupId; } SSessionKey; +typedef int64_t COUNT_TYPE; + typedef struct SVersionRange { int64_t minVer; int64_t maxVer; diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 88205581fe..1b438ba026 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -247,6 +247,7 @@ typedef enum ENodeType { QUERY_NODE_EVENT_WINDOW, QUERY_NODE_HINT, QUERY_NODE_VIEW, + QUERY_NODE_COUNT_WINDOW, // Statement nodes are used in parser and planner module. QUERY_NODE_SET_OPERATOR = 100, @@ -432,7 +433,9 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_HASH_JOIN, QUERY_NODE_PHYSICAL_PLAN_GROUP_CACHE, QUERY_NODE_PHYSICAL_PLAN_DYN_QUERY_CTRL, - QUERY_NODE_PHYSICAL_PLAN_STREAM_MID_INTERVAL + QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT, + QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT, + QUERY_NODE_PHYSICAL_PLAN_STREAM_MID_INTERVAL, } ENodeType; typedef struct { @@ -3182,18 +3185,11 @@ typedef struct { typedef struct { SMsgHead head; - int64_t leftForVer; + int64_t resetRelHalt; // reset related stream task halt status int64_t streamId; int32_t taskId; } SVDropStreamTaskReq; -typedef struct { - SMsgHead head; - int64_t streamId; - int32_t taskId; - int64_t dataVer; -} SVStreamTaskVerUpdateReq; - typedef struct { int8_t reserved; } SVDropStreamTaskRsp; diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 5f0538ce17..f4a1c79081 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -297,75 +297,77 @@ #define TK_SESSION 278 #define TK_STATE_WINDOW 279 #define TK_EVENT_WINDOW 280 -#define TK_SLIDING 281 -#define TK_FILL 282 -#define TK_VALUE 283 -#define TK_VALUE_F 284 -#define TK_NONE 285 -#define TK_PREV 286 -#define TK_NULL_F 287 -#define TK_LINEAR 288 -#define TK_NEXT 289 -#define TK_HAVING 290 -#define TK_RANGE 291 -#define TK_EVERY 292 -#define TK_ORDER 293 -#define TK_SLIMIT 294 -#define TK_SOFFSET 295 -#define TK_LIMIT 296 -#define TK_OFFSET 297 -#define TK_ASC 298 -#define TK_NULLS 299 -#define TK_ABORT 300 -#define TK_AFTER 301 -#define TK_ATTACH 302 -#define TK_BEFORE 303 -#define TK_BEGIN 304 -#define TK_BITAND 305 -#define TK_BITNOT 306 -#define TK_BITOR 307 -#define TK_BLOCKS 308 -#define TK_CHANGE 309 -#define TK_COMMA 310 -#define TK_CONCAT 311 -#define TK_CONFLICT 312 -#define TK_COPY 313 -#define TK_DEFERRED 314 -#define TK_DELIMITERS 315 -#define TK_DETACH 316 -#define TK_DIVIDE 317 -#define TK_DOT 318 -#define TK_EACH 319 -#define TK_FAIL 320 -#define TK_FILE 321 -#define TK_FOR 322 -#define TK_GLOB 323 -#define TK_ID 324 -#define TK_IMMEDIATE 325 -#define TK_IMPORT 326 -#define TK_INITIALLY 327 -#define TK_INSTEAD 328 -#define TK_ISNULL 329 -#define TK_KEY 330 -#define TK_MODULES 331 -#define TK_NK_BITNOT 332 -#define TK_NK_SEMI 333 -#define TK_NOTNULL 334 -#define TK_OF 335 -#define TK_PLUS 336 -#define TK_PRIVILEGE 337 -#define TK_RAISE 338 -#define TK_RESTRICT 339 -#define TK_ROW 340 -#define TK_SEMI 341 -#define TK_STAR 342 -#define TK_STATEMENT 343 -#define TK_STRICT 344 -#define TK_STRING 345 -#define TK_TIMES 346 -#define TK_VALUES 347 -#define TK_VARIABLE 348 -#define TK_WAL 349 +#define TK_COUNT_WINDOW 281 +#define TK_SLIDING 282 +#define TK_FILL 283 +#define TK_VALUE 284 +#define TK_VALUE_F 285 +#define TK_NONE 286 +#define TK_PREV 287 +#define TK_NULL_F 288 +#define TK_LINEAR 289 +#define TK_NEXT 290 +#define TK_HAVING 291 +#define TK_RANGE 292 +#define TK_EVERY 293 +#define TK_ORDER 294 +#define TK_SLIMIT 295 +#define TK_SOFFSET 296 +#define TK_LIMIT 297 +#define TK_OFFSET 298 +#define TK_ASC 299 +#define TK_NULLS 300 +#define TK_ABORT 301 +#define TK_AFTER 302 +#define TK_ATTACH 303 +#define TK_BEFORE 304 +#define TK_BEGIN 305 +#define TK_BITAND 306 +#define TK_BITNOT 307 +#define TK_BITOR 308 +#define TK_BLOCKS 309 +#define TK_CHANGE 310 +#define TK_COMMA 311 +#define TK_CONCAT 312 +#define TK_CONFLICT 313 +#define TK_COPY 314 +#define TK_DEFERRED 315 +#define TK_DELIMITERS 316 +#define TK_DETACH 317 +#define TK_DIVIDE 318 +#define TK_DOT 319 +#define TK_EACH 320 +#define TK_FAIL 321 +#define TK_FILE 322 +#define TK_FOR 323 +#define TK_GLOB 324 +#define TK_ID 325 +#define TK_IMMEDIATE 326 +#define TK_IMPORT 327 +#define TK_INITIALLY 328 +#define TK_INSTEAD 329 +#define TK_ISNULL 330 +#define TK_KEY 331 +#define TK_MODULES 332 +#define TK_NK_BITNOT 333 +#define TK_NK_SEMI 334 +#define TK_NOTNULL 335 +#define TK_OF 336 +#define TK_PLUS 337 +#define TK_PRIVILEGE 338 +#define TK_RAISE 339 +#define TK_RESTRICT 340 +#define TK_ROW 341 +#define TK_SEMI 342 +#define TK_STAR 343 +#define TK_STATEMENT 344 +#define TK_STRICT 345 +#define TK_STRING 346 +#define TK_TIMES 347 +#define TK_VALUES 348 +#define TK_VARIABLE 349 +#define TK_WAL 350 + #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 diff --git a/include/libs/executor/storageapi.h b/include/libs/executor/storageapi.h index 9987dab166..e66ffe5521 100644 --- a/include/libs/executor/storageapi.h +++ b/include/libs/executor/storageapi.h @@ -352,14 +352,19 @@ typedef struct SStateStore { int32_t (*streamStateSessionPut)(SStreamState* pState, const SSessionKey* key, void* value, int32_t vLen); int32_t (*streamStateSessionGet)(SStreamState* pState, SSessionKey* key, void** pVal, int32_t* pVLen); int32_t (*streamStateSessionDel)(SStreamState* pState, const SSessionKey* key); + int32_t (*streamStateSessionReset)(SStreamState* pState, void* pVal); int32_t (*streamStateSessionClear)(SStreamState* pState); int32_t (*streamStateSessionGetKVByCur)(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen); int32_t (*streamStateStateAddIfNotExist)(SStreamState* pState, SSessionKey* key, char* pKeyData, int32_t keyDataLen, state_key_cmpr_fn fn, void** pVal, int32_t* pVLen); int32_t (*streamStateSessionGetKeyByRange)(SStreamState* pState, const SSessionKey* range, SSessionKey* curKey); + int32_t (*streamStateCountGetKeyByRange)(SStreamState* pState, const SSessionKey* range, SSessionKey* curKey); int32_t (*streamStateSessionAllocWinBuffByNextPosition)(SStreamState* pState, SStreamStateCur* pCur, const SSessionKey* pKey, void** pVal, int32_t* pVLen); + int32_t (*streamStateCountWinAddIfNotExist)(SStreamState* pState, SSessionKey* pKey, COUNT_TYPE winCount, void** ppVal, int32_t* pVLen); + int32_t (*streamStateCountWinAdd)(SStreamState* pState, SSessionKey* pKey, void** pVal, int32_t* pVLen); + SUpdateInfo* (*updateInfoInit)(int64_t interval, int32_t precision, int64_t watermark, bool igUp); TSKEY (*updateInfoFillBlockData)(SUpdateInfo* pInfo, SSDataBlock* pBlock, int32_t primaryTsCol); bool (*updateInfoIsUpdated)(SUpdateInfo* pInfo, uint64_t tableId, TSKEY ts); @@ -377,6 +382,7 @@ typedef struct SStateStore { int32_t (*updateInfoDeserialize)(void* buf, int32_t bufLen, SUpdateInfo* pInfo); SStreamStateCur* (*streamStateSessionSeekKeyNext)(SStreamState* pState, const SSessionKey* key); + SStreamStateCur* (*streamStateCountSeekKeyPrev)(SStreamState* pState, const SSessionKey* pKey, COUNT_TYPE count); SStreamStateCur* (*streamStateSessionSeekKeyCurrentPrev)(SStreamState* pState, const SSessionKey* key); SStreamStateCur* (*streamStateSessionSeekKeyCurrentNext)(SStreamState* pState, const SSessionKey* key); diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 447e8725c7..0e717369d4 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -244,7 +244,8 @@ typedef enum EWindowType { WINDOW_TYPE_INTERVAL = 1, WINDOW_TYPE_SESSION, WINDOW_TYPE_STATE, - WINDOW_TYPE_EVENT + WINDOW_TYPE_EVENT, + WINDOW_TYPE_COUNT } EWindowType; typedef enum EWindowAlgorithm { @@ -282,6 +283,8 @@ typedef struct SWindowLogicNode { int8_t igCheckUpdate; EWindowAlgorithm windowAlgo; bool isPartTb; + int64_t windowCount; + int64_t windowSliding; } SWindowLogicNode; typedef struct SFillLogicNode { @@ -631,6 +634,14 @@ typedef struct SEventWinodwPhysiNode { typedef SEventWinodwPhysiNode SStreamEventWinodwPhysiNode; +typedef struct SCountWinodwPhysiNode { + SWindowPhysiNode window; + int64_t windowCount; + int64_t windowSliding; +} SCountWinodwPhysiNode; + +typedef SCountWinodwPhysiNode SStreamCountWinodwPhysiNode; + typedef struct SSortPhysiNode { SPhysiNode node; SNodeList* pExprs; // these are expression list of order_by_clause and parameter expression of aggregate function diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index 9647c0adac..ebe98e58c0 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -278,6 +278,13 @@ typedef struct SEventWindowNode { SNode* pEndCond; } SEventWindowNode; +typedef struct SCountWindowNode { + ENodeType type; // QUERY_NODE_EVENT_WINDOW + SNode* pCol; // timestamp primary key + int64_t windowCount; + int64_t windowSliding; +} SCountWindowNode; + typedef enum EFillMode { FILL_MODE_NONE = 1, FILL_MODE_VALUE, diff --git a/include/libs/stream/streamState.h b/include/libs/stream/streamState.h index c2f7c6de2f..c603f9f5ac 100644 --- a/include/libs/stream/streamState.h +++ b/include/libs/stream/streamState.h @@ -55,13 +55,16 @@ int32_t streamStateSessionAddIfNotExist(SStreamState* pState, SSessionKey* key, int32_t streamStateSessionPut(SStreamState* pState, const SSessionKey* key, void* value, int32_t vLen); int32_t streamStateSessionGet(SStreamState* pState, SSessionKey* key, void** pVal, int32_t* pVLen); int32_t streamStateSessionDel(SStreamState* pState, const SSessionKey* key); +int32_t streamStateSessionReset(SStreamState* pState, void* pVal); int32_t streamStateSessionClear(SStreamState* pState); int32_t streamStateSessionGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen); int32_t streamStateSessionGetKeyByRange(SStreamState* pState, const SSessionKey* range, SSessionKey* curKey); +int32_t streamStateCountGetKeyByRange(SStreamState* pState, const SSessionKey* range, SSessionKey* curKey); int32_t streamStateSessionAllocWinBuffByNextPosition(SStreamState* pState, SStreamStateCur* pCur, const SSessionKey* pKey, void** pVal, int32_t* pVLen); SStreamStateCur* streamStateSessionSeekKeyNext(SStreamState* pState, const SSessionKey* key); +SStreamStateCur* streamStateCountSeekKeyPrev(SStreamState* pState, const SSessionKey* pKey, COUNT_TYPE count); SStreamStateCur* streamStateSessionSeekKeyCurrentPrev(SStreamState* pState, const SSessionKey* key); SStreamStateCur* streamStateSessionSeekKeyCurrentNext(SStreamState* pState, const SSessionKey* key); @@ -79,6 +82,10 @@ int32_t streamStateReleaseBuf(SStreamState* pState, void* pVal, bool used); int32_t streamStateClearBuff(SStreamState* pState, void* pVal); void streamStateFreeVal(void* val); +// count window +int32_t streamStateCountWinAddIfNotExist(SStreamState* pState, SSessionKey* pKey, COUNT_TYPE winCount, void** ppVal, int32_t* pVLen); +int32_t streamStateCountWinAdd(SStreamState* pState, SSessionKey* pKey, void** pVal, int32_t* pVLen); + SStreamStateCur* streamStateGetAndCheckCur(SStreamState* pState, SWinKey* key); SStreamStateCur* streamStateSeekKeyNext(SStreamState* pState, const SWinKey* key); SStreamStateCur* streamStateFillSeekKeyNext(SStreamState* pState, const SWinKey* key); @@ -128,10 +135,6 @@ int sessionRangeKeyCmpr(const SSessionKey* pWin1, const SSessionKey* pWin2); int sessionWinKeyCmpr(const SSessionKey* pWin1, const SSessionKey* pWin2); int stateSessionKeyCmpr(const void* pKey1, int kLen1, const void* pKey2, int kLen2); int stateKeyCmpr(const void* pKey1, int kLen1, const void* pKey2, int kLen2); -#if 0 -char* streamStateSessionDump(SStreamState* pState); -char* streamStateIntervalDump(SStreamState* pState); -#endif #ifdef __cplusplus } diff --git a/include/libs/stream/tstream.h b/include/libs/stream/tstream.h index e3ab42dd00..11eb34557b 100644 --- a/include/libs/stream/tstream.h +++ b/include/libs/stream/tstream.h @@ -784,7 +784,7 @@ bool streamTaskIsAllUpstreamClosed(SStreamTask* pTask); bool streamTaskSetSchedStatusWait(SStreamTask* pTask); int8_t streamTaskSetSchedStatusActive(SStreamTask* pTask); int8_t streamTaskSetSchedStatusInactive(SStreamTask* pTask); -int32_t streamTaskClearHTaskAttr(SStreamTask* pTask, bool metaLock); +int32_t streamTaskClearHTaskAttr(SStreamTask* pTask, int32_t clearRelHalt, bool metaLock); int32_t streamTaskHandleEvent(SStreamTaskSM* pSM, EStreamTaskEvent event); int32_t streamTaskOnHandleEventSuccess(SStreamTaskSM* pSM, EStreamTaskEvent event); @@ -870,7 +870,7 @@ int32_t streamProcessCheckpointReadyMsg(SStreamTask* pTask); int32_t streamTaskBuildCheckpoint(SStreamTask* pTask); void streamTaskClearCheckInfo(SStreamTask* pTask, bool clearChkpReadyMsg); int32_t streamAlignTransferState(SStreamTask* pTask); -int32_t streamBuildAndSendDropTaskMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskId* pTaskId); +int32_t streamBuildAndSendDropTaskMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskId* pTaskId, int64_t resetRelHalt); int32_t streamAddCheckpointSourceRspMsg(SStreamCheckpointSourceReq* pReq, SRpcHandleInfo* pRpcInfo, SStreamTask* pTask, int8_t isSucceed); int32_t buildCheckpointSourceRsp(SStreamCheckpointSourceReq* pReq, SRpcHandleInfo* pRpcInfo, SRpcMsg* pMsg, diff --git a/include/libs/stream/tstreamFileState.h b/include/libs/stream/tstreamFileState.h index 2a129c1830..a9a198d194 100644 --- a/include/libs/stream/tstreamFileState.h +++ b/include/libs/stream/tstreamFileState.h @@ -41,6 +41,8 @@ typedef int32_t (*_state_file_remove_fn)(SStreamFileState* pFileState, const voi typedef int32_t (*_state_file_get_fn)(SStreamFileState* pFileState, void* pKey, void* data, int32_t* pDataLen); typedef int32_t (*_state_file_clear_fn)(SStreamState* pState); +typedef int32_t (*range_cmpr_fn)(const SSessionKey* pWin1, const SSessionKey* pWin2); + SStreamFileState* streamFileStateInit(int64_t memSize, uint32_t keySize, uint32_t rowSize, uint32_t selectRowSize, GetTsFun fp, void* pFile, TSKEY delMark, const char* taskId, int64_t checkpointId, int8_t type); @@ -90,14 +92,19 @@ void sessionWinStateCleanup(void* pBuff); SStreamStateCur* sessionWinStateSeekKeyCurrentPrev(SStreamFileState* pFileState, const SSessionKey* pWinKey); SStreamStateCur* sessionWinStateSeekKeyCurrentNext(SStreamFileState* pFileState, const SSessionKey* pWinKey); SStreamStateCur* sessionWinStateSeekKeyNext(SStreamFileState* pFileState, const SSessionKey* pWinKey); +SStreamStateCur* countWinStateSeekKeyPrev(SStreamFileState* pFileState, const SSessionKey* pWinKey, COUNT_TYPE count); int32_t sessionWinStateGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen); int32_t sessionWinStateMoveToNext(SStreamStateCur* pCur); -int32_t sessionWinStateGetKeyByRange(SStreamFileState* pFileState, const SSessionKey* key, SSessionKey* curKey); +int32_t sessionWinStateGetKeyByRange(SStreamFileState* pFileState, const SSessionKey* key, SSessionKey* curKey, range_cmpr_fn cmpFn); // state window int32_t getStateWinResultBuff(SStreamFileState* pFileState, SSessionKey* key, char* pKeyData, int32_t keyDataLen, state_key_cmpr_fn fn, void** pVal, int32_t* pVLen); +// count window +int32_t getCountWinResultBuff(SStreamFileState* pFileState, SSessionKey* pKey, COUNT_TYPE winCount, void** pVal, int32_t* pVLen); +int32_t createCountWinResultBuff(SStreamFileState* pFileState, SSessionKey* pKey, void** pVal, int32_t* pVLen); + #ifdef __cplusplus } #endif diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c index a8eaf7c711..cbc0ace75d 100644 --- a/source/dnode/mnode/impl/src/mndScheduler.c +++ b/source/dnode/mnode/impl/src/mndScheduler.c @@ -27,6 +27,28 @@ #define SINK_NODE_LEVEL (0) extern bool tsDeployOnSnode; +static bool hasCountWindowNode(SPhysiNode* pNode) { + if (nodeType(pNode) == QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT) { + return true; + } else { + size_t size = LIST_LENGTH(pNode->pChildren); + + for (int32_t i = 0; i < size; ++i) { + SPhysiNode* pChild = (SPhysiNode*)nodesListGetNode(pNode->pChildren, i); + if (hasCountWindowNode(pChild)) { + return true; + } + } + + return false; + } +} + +static bool countWindowStreamTask(SSubplan* pPlan) { + SPhysiNode* pNode = pPlan->pNode; + return hasCountWindowNode(pNode); +} + int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64_t uid, int8_t triggerType, int64_t watermark, int64_t deleteMark) { SNode* pAst = NULL; @@ -320,6 +342,17 @@ static void streamTaskSetDataRange(SStreamTask* pTask, int64_t skey, SArray* pVe } } +static void haltInitialTaskStatus(SStreamTask* pTask, SSubplan* pPlan) { + bool hasCountWindowNode = countWindowStreamTask(pPlan); + bool isRelStreamTask = (pTask->hTaskInfo.id.taskId != 0); + if (hasCountWindowNode && isRelStreamTask) { + SStreamStatus* pStatus = &pTask->status; + mDebug("s-task:0x%x status is set to %s from %s for count window agg task with fill-history option set", + pTask->id.taskId, streamTaskGetStatusStr(pStatus->taskStatus), streamTaskGetStatusStr(TASK_STATUS__HALT)); + pStatus->taskStatus = TASK_STATUS__HALT; + } +} + static SStreamTask* buildSourceTask(SStreamObj* pStream, SEpSet* pEpset, bool isFillhistory, bool useTriggerParam) { uint64_t uid = (isFillhistory) ? pStream->hTaskUid : pStream->uid; SArray** pTaskList = (isFillhistory) ? taosArrayGetLast(pStream->pHTasksList) : taosArrayGetLast(pStream->tasks); @@ -373,6 +406,8 @@ static int32_t doAddSourceTask(SMnode* pMnode, SSubplan* plan, SStreamObj* pStre } mDebug("doAddSourceTask taskId:%s, vgId:%d, isFillHistory:%d", pTask->id.idStr, pVgroup->vgId, isFillhistory); + haltInitialTaskStatus(pTask, plan); + streamTaskSetDataRange(pTask, skey, pVerList, pVgroup->vgId); int32_t code = mndAssignStreamTaskToVgroup(pMnode, pTask, plan, pVgroup); diff --git a/source/dnode/snode/src/snodeInitApi.c b/source/dnode/snode/src/snodeInitApi.c index c605a8373e..3b60ef3427 100644 --- a/source/dnode/snode/src/snodeInitApi.c +++ b/source/dnode/snode/src/snodeInitApi.c @@ -67,12 +67,17 @@ void initStateStoreAPI(SStateStore* pStore) { pStore->streamStateSessionPut = streamStateSessionPut; pStore->streamStateSessionGet = streamStateSessionGet; pStore->streamStateSessionDel = streamStateSessionDel; + pStore->streamStateSessionReset = streamStateSessionReset; pStore->streamStateSessionClear = streamStateSessionClear; pStore->streamStateSessionGetKVByCur = streamStateSessionGetKVByCur; pStore->streamStateStateAddIfNotExist = streamStateStateAddIfNotExist; pStore->streamStateSessionGetKeyByRange = streamStateSessionGetKeyByRange; + pStore->streamStateCountGetKeyByRange = streamStateCountGetKeyByRange; pStore->streamStateSessionAllocWinBuffByNextPosition = streamStateSessionAllocWinBuffByNextPosition; + pStore->streamStateCountWinAddIfNotExist = streamStateCountWinAddIfNotExist; + pStore->streamStateCountWinAdd = streamStateCountWinAdd; + pStore->updateInfoInit = updateInfoInit; pStore->updateInfoFillBlockData = updateInfoFillBlockData; pStore->updateInfoIsUpdated = updateInfoIsUpdated; @@ -89,6 +94,7 @@ void initStateStoreAPI(SStateStore* pStore) { pStore->updateInfoDeserialize = updateInfoDeserialize; pStore->streamStateSessionSeekKeyNext = streamStateSessionSeekKeyNext; + pStore->streamStateCountSeekKeyPrev = streamStateCountSeekKeyPrev; pStore->streamStateSessionSeekKeyCurrentPrev = streamStateSessionSeekKeyCurrentPrev; pStore->streamStateSessionSeekKeyCurrentNext = streamStateSessionSeekKeyCurrentNext; diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index e9d559481d..67b9cf1ad6 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -841,23 +841,25 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t nextProcessVer) { } char* p = streamTaskGetStatus(pTask)->name; + const char* pNext = streamTaskGetStatusStr(pTask->status.taskStatus); if (pTask->info.fillHistory) { tqInfo("vgId:%d expand stream task, s-task:%s, checkpointId:%" PRId64 " checkpointVer:%" PRId64 " nextProcessVer:%" PRId64 - " child id:%d, level:%d, status:%s fill-history:%d, related stream task:0x%x trigger:%" PRId64 - " ms, inputVer:%" PRId64, + " child id:%d, level:%d, cur-status:%s, next-status:%s fill-history:%d, related stream task:0x%x " + "trigger:%" PRId64 " ms, inputVer:%" PRId64, vgId, pTask->id.idStr, pChkInfo->checkpointId, pChkInfo->checkpointVer, pChkInfo->nextProcessVer, - pTask->info.selfChildId, pTask->info.taskLevel, p, pTask->info.fillHistory, + pTask->info.selfChildId, pTask->info.taskLevel, p, pNext, pTask->info.fillHistory, (int32_t)pTask->streamTaskId.taskId, pTask->info.triggerParam, nextProcessVer); } else { - tqInfo("vgId:%d expand stream task, s-task:%s, checkpointId:%" PRId64 " checkpointVer:%" PRId64 - " nextProcessVer:%" PRId64 - " child id:%d, level:%d, status:%s fill-history:%d, related fill-task:0x%x trigger:%" PRId64 - " ms, inputVer:%" PRId64, - vgId, pTask->id.idStr, pChkInfo->checkpointId, pChkInfo->checkpointVer, pChkInfo->nextProcessVer, - pTask->info.selfChildId, pTask->info.taskLevel, p, pTask->info.fillHistory, - (int32_t)pTask->hTaskInfo.id.taskId, pTask->info.triggerParam, nextProcessVer); + tqInfo( + "vgId:%d expand stream task, s-task:%s, checkpointId:%" PRId64 " checkpointVer:%" PRId64 + " nextProcessVer:%" PRId64 + " child id:%d, level:%d, cur-status:%s next-status:%s fill-history:%d, related fill-task:0x%x trigger:%" PRId64 + " ms, inputVer:%" PRId64, + vgId, pTask->id.idStr, pChkInfo->checkpointId, pChkInfo->checkpointVer, pChkInfo->nextProcessVer, + pTask->info.selfChildId, pTask->info.taskLevel, p, pNext, pTask->info.fillHistory, + (int32_t)pTask->hTaskInfo.id.taskId, pTask->info.triggerParam, nextProcessVer); } return 0; @@ -1016,8 +1018,8 @@ int32_t tqProcessTaskScanHistory(STQ* pTq, SRpcMsg* pMsg) { tqError("failed to find s-task:0x%" PRIx64 ", it may have been destroyed, drop related fill-history task:%s", pTask->streamTaskId.taskId, pTask->id.idStr); - tqDebug("s-task:%s fill-history task set status to be dropping", id); - streamBuildAndSendDropTaskMsg(pTask->pMsgCb, pMeta->vgId, &pTask->id); + tqDebug("s-task:%s fill-history task set status to be dropping and drop it", id); + streamBuildAndSendDropTaskMsg(pTask->pMsgCb, pMeta->vgId, &pTask->id, 0); atomic_store_32(&pTask->status.inScanHistorySentinel, 0); streamMetaReleaseTask(pMeta, pTask); diff --git a/source/dnode/vnode/src/tqCommon/tqCommon.c b/source/dnode/vnode/src/tqCommon/tqCommon.c index c9dd20ef97..cb940aa56c 100644 --- a/source/dnode/vnode/src/tqCommon/tqCommon.c +++ b/source/dnode/vnode/src/tqCommon/tqCommon.c @@ -612,6 +612,10 @@ int32_t tqStreamTaskProcessDropReq(SStreamMeta* pMeta, char* msg, int32_t msgLen streamMetaReleaseTask(pMeta, pTask); } + streamMetaWLock(pMeta); + streamTaskClearHTaskAttr(pTask, pReq->resetRelHalt, false); + streamMetaWUnLock(pMeta); + // drop the stream task now streamMetaUnregisterTask(pMeta, pReq->streamId, pReq->taskId); diff --git a/source/dnode/vnode/src/vnd/vnodeInitApi.c b/source/dnode/vnode/src/vnd/vnodeInitApi.c index 2392716bbf..aff7e4642b 100644 --- a/source/dnode/vnode/src/vnd/vnodeInitApi.c +++ b/source/dnode/vnode/src/vnd/vnodeInitApi.c @@ -181,12 +181,17 @@ void initStateStoreAPI(SStateStore* pStore) { pStore->streamStateSessionPut = streamStateSessionPut; pStore->streamStateSessionGet = streamStateSessionGet; pStore->streamStateSessionDel = streamStateSessionDel; + pStore->streamStateSessionReset = streamStateSessionReset; pStore->streamStateSessionClear = streamStateSessionClear; pStore->streamStateSessionGetKVByCur = streamStateSessionGetKVByCur; pStore->streamStateStateAddIfNotExist = streamStateStateAddIfNotExist; pStore->streamStateSessionGetKeyByRange = streamStateSessionGetKeyByRange; + pStore->streamStateCountGetKeyByRange = streamStateCountGetKeyByRange; pStore->streamStateSessionAllocWinBuffByNextPosition = streamStateSessionAllocWinBuffByNextPosition; + pStore->streamStateCountWinAddIfNotExist = streamStateCountWinAddIfNotExist; + pStore->streamStateCountWinAdd = streamStateCountWinAdd; + pStore->updateInfoInit = updateInfoInit; pStore->updateInfoFillBlockData = updateInfoFillBlockData; pStore->updateInfoIsUpdated = updateInfoIsUpdated; @@ -203,6 +208,7 @@ void initStateStoreAPI(SStateStore* pStore) { pStore->updateInfoDeserialize = updateInfoDeserialize; pStore->streamStateSessionSeekKeyNext = streamStateSessionSeekKeyNext; + pStore->streamStateCountSeekKeyPrev = streamStateCountSeekKeyPrev; pStore->streamStateSessionSeekKeyCurrentPrev = streamStateSessionSeekKeyCurrentPrev; pStore->streamStateSessionSeekKeyCurrentNext = streamStateSessionSeekKeyCurrentNext; diff --git a/source/libs/command/inc/commandInt.h b/source/libs/command/inc/commandInt.h index d7ded9d6f1..f8f932903f 100644 --- a/source/libs/command/inc/commandInt.h +++ b/source/libs/command/inc/commandInt.h @@ -69,6 +69,10 @@ extern "C" { #define EXPLAIN_EVENT_END_FORMAT "End Cond: " #define EXPLAIN_GROUP_CACHE_FORMAT "Group Cache" #define EXPLAIN_DYN_QRY_CTRL_FORMAT "Dynamic Query Control for %s" +#define EXPLAIN_COUNT_FORMAT "Count" +#define EXPLAIN_COUNT_INFO_FORMAT "Window Count Info" +#define EXPLAIN_COUNT_NUM_FORMAT "Window Count=%" PRId64 +#define EXPLAIN_COUNT_SLIDING_FORMAT "Window Sliding=%" PRId64 #define EXPLAIN_PLANNING_TIME_FORMAT "Planning Time: %.3f ms" #define EXPLAIN_EXEC_TIME_FORMAT "Execution Time: %.3f ms" diff --git a/source/libs/command/src/explain.c b/source/libs/command/src/explain.c index 66b50bcb47..ebe8543fae 100644 --- a/source/libs/command/src/explain.c +++ b/source/libs/command/src/explain.c @@ -1735,6 +1735,31 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i } break; } + case QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT: { + SCountWinodwPhysiNode *pCountNode = (SCountWinodwPhysiNode *)pNode; + EXPLAIN_ROW_NEW(level, EXPLAIN_COUNT_FORMAT); + EXPLAIN_ROW_APPEND(EXPLAIN_LEFT_PARENTHESIS_FORMAT); + if (pResNode->pExecInfo) { + QRY_ERR_RET(qExplainBufAppendExecInfo(pResNode->pExecInfo, tbuf, &tlen)); + EXPLAIN_ROW_APPEND(EXPLAIN_BLANK_FORMAT); + } + EXPLAIN_ROW_APPEND(EXPLAIN_FUNCTIONS_FORMAT, pCountNode->window.pFuncs->length); + EXPLAIN_ROW_APPEND(EXPLAIN_BLANK_FORMAT); + EXPLAIN_ROW_APPEND(EXPLAIN_WIDTH_FORMAT, pCountNode->window.node.pOutputDataBlockDesc->totalRowSize); + EXPLAIN_ROW_APPEND(EXPLAIN_RIGHT_PARENTHESIS_FORMAT); + EXPLAIN_ROW_END(); + QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level)); + + if (verbose) { + EXPLAIN_ROW_NEW(level + 1, EXPLAIN_COUNT_NUM_FORMAT, pCountNode->windowCount); + EXPLAIN_ROW_END(); + QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level + 1)); + EXPLAIN_ROW_NEW(level + 1, EXPLAIN_COUNT_SLIDING_FORMAT, pCountNode->windowSliding); + EXPLAIN_ROW_END(); + QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level + 1)); + } + break; + } default: qError("not supported physical node type %d", pNode->type); return TSDB_CODE_APP_ERROR; diff --git a/source/libs/executor/inc/executorInt.h b/source/libs/executor/inc/executorInt.h index 3306cb3b53..6b0b806adb 100644 --- a/source/libs/executor/inc/executorInt.h +++ b/source/libs/executor/inc/executorInt.h @@ -371,6 +371,8 @@ typedef struct SStreamAggSupporter { STimeWindow winRange; SStorageAPI* pSessionAPI; struct SUpdateInfo* pUpdateInfo; + int32_t windowCount; + int32_t windowSliding; } SStreamAggSupporter; typedef struct SWindowSupporter { @@ -663,6 +665,27 @@ typedef struct SStreamEventAggOperatorInfo { SFilterInfo* pEndCondInfo; } SStreamEventAggOperatorInfo; +typedef struct SStreamCountAggOperatorInfo { + SOptrBasicInfo binfo; + SStreamAggSupporter streamAggSup; + SExprSupp scalarSupp; // supporter for perform scalar function + SGroupResInfo groupResInfo; + int32_t primaryTsIndex; // primary timestamp slot id + STimeWindowAggSupp twAggSup; + SSDataBlock* pDelRes; + SSHashObj* pStDeleted; + void* pDelIterator; + bool ignoreExpiredData; + bool ignoreExpiredDataSaved; + SArray* pUpdated; + SSHashObj* pStUpdated; + int64_t dataVersion; + SArray* historyWins; + bool reCkBlock; + bool recvGetAll; + SSDataBlock* pCheckpointRes; +} SStreamCountAggOperatorInfo; + typedef struct SStreamPartitionOperatorInfo { SOptrBasicInfo binfo; SPartitionBySupporter partitionSup; @@ -799,6 +822,9 @@ bool isDeletedStreamWindow(STimeWindow* pWin, uint64_t groupId, void* pState, ST SStateStore* pStore); void appendOneRowToStreamSpecialBlock(SSDataBlock* pBlock, TSKEY* pStartTs, TSKEY* pEndTs, uint64_t* pUid, uint64_t* pGp, void* pTbName); +void appendAllColumnToStreamSpecialBlock(SSDataBlock* pBlock, TSKEY* pStartTs, TSKEY* pEndTs, TSKEY* pCalStartTs, + TSKEY* pCalEndTs, uint64_t* pUid, uint64_t* pGp, void* pTbName); + uint64_t calGroupIdByData(SPartitionBySupporter* pParSup, SExprSupp* pExprSup, SSDataBlock* pBlock, int32_t rowId); int32_t finalizeResultRows(SDiskbasedBuf* pBuf, SResultRowPosition* resultRowPosition, SExprSupp* pSup, @@ -863,7 +889,7 @@ void resetWinRange(STimeWindow* winRange); bool checkExpiredData(SStateStore* pAPI, SUpdateInfo* pUpdateInfo, STimeWindowAggSupp* pTwSup, uint64_t tableId, TSKEY ts); int64_t getDeleteMark(SWindowPhysiNode* pWinPhyNode, int64_t interval); void resetUnCloseSessionWinInfo(SSHashObj* winMap); -void setStreamOperatorCompleted(struct SOperatorInfo* pOperator); +void setStreamOperatorCompleted(struct SOperatorInfo* pOperator); void reloadAggSupFromDownStream(struct SOperatorInfo* downstream, SStreamAggSupporter* pAggSup); int32_t encodeSSessionKey(void** buf, SSessionKey* key); @@ -880,11 +906,18 @@ void freeExchangeGetBasicOperatorParam(void* pParam); void freeOperatorParam(SOperatorParam* pParam, SOperatorParamType type); void freeResetOperatorParams(struct SOperatorInfo* pOperator, SOperatorParamType type, bool allFree); SSDataBlock* getNextBlockFromDownstreamImpl(struct SOperatorInfo* pOperator, int32_t idx, bool clearParam); +void getCountWinRange(SStreamAggSupporter* pAggSup, const SSessionKey* pKey, EStreamType mode, SSessionKey* pDelRange); +bool doDeleteSessionWindow(SStreamAggSupporter* pAggSup, SSessionKey* pKey); + +void saveDeleteInfo(SArray* pWins, SSessionKey key); +void removeSessionResults(SStreamAggSupporter* pAggSup, SSHashObj* pHashMap, SArray* pWins); +void copyDeleteWindowInfo(SArray* pResWins, SSHashObj* pStDeleted); bool inSlidingWindow(SInterval* pInterval, STimeWindow* pWin, SDataBlockInfo* pBlockInfo); bool inCalSlidingWindow(SInterval* pInterval, STimeWindow* pWin, TSKEY calStart, TSKEY calEnd, EStreamType blockType); bool compareVal(const char* v, const SStateKeys* pKey); bool inWinRange(STimeWindow* range, STimeWindow* cur); +void doDeleteTimeWindows(SStreamAggSupporter* pAggSup, SSDataBlock* pBlock, SArray* result); int32_t getNextQualifiedWindow(SInterval* pInterval, STimeWindow* pNext, SDataBlockInfo* pDataBlockInfo, TSKEY* primaryKeys, int32_t prevPosition, int32_t order); diff --git a/source/libs/executor/inc/operator.h b/source/libs/executor/inc/operator.h index 0858a7e595..95208545bd 100644 --- a/source/libs/executor/inc/operator.h +++ b/source/libs/executor/inc/operator.h @@ -154,10 +154,14 @@ SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFi SOperatorInfo* createStreamEventAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, SReadHandle* pHandle); +SOperatorInfo* createStreamCountAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, SReadHandle* pHandle); + SOperatorInfo* createGroupSortOperatorInfo(SOperatorInfo* downstream, SGroupSortPhysiNode* pSortPhyNode, SExecTaskInfo* pTaskInfo); SOperatorInfo* createEventwindowOperatorInfo(SOperatorInfo* downstream, SPhysiNode* physiNode, SExecTaskInfo* pTaskInfo); +SOperatorInfo* createCountwindowOperatorInfo(SOperatorInfo* downstream, SPhysiNode* physiNode, SExecTaskInfo* pTaskInfo); + SOperatorInfo* createGroupCacheOperatorInfo(SOperatorInfo** pDownstream, int32_t numOfDownstream, SGroupCachePhysiNode* pPhyciNode, SExecTaskInfo* pTaskInfo); SOperatorInfo* createDynQueryCtrlOperatorInfo(SOperatorInfo** pDownstream, int32_t numOfDownstream, SDynQueryCtrlPhysiNode* pPhyciNode, SExecTaskInfo* pTaskInfo); diff --git a/source/libs/executor/src/countwindowoperator.c b/source/libs/executor/src/countwindowoperator.c new file mode 100644 index 0000000000..3980e5ae4d --- /dev/null +++ b/source/libs/executor/src/countwindowoperator.c @@ -0,0 +1,271 @@ +/* + * 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 "executorInt.h" +#include "filter.h" +#include "function.h" +#include "functionMgt.h" +#include "operator.h" +#include "querytask.h" +#include "tcommon.h" +#include "tcompare.h" +#include "tdatablock.h" +#include "ttime.h" + +typedef struct SCountWindowResult { + int32_t winRows; + SResultRow row; +} SCountWindowResult; + +typedef struct SCountWindowSupp { + SArray* pWinStates; + int32_t stateIndex; +} SCountWindowSupp; + +typedef struct SCountWindowOperatorInfo { + SOptrBasicInfo binfo; + SAggSupporter aggSup; + SExprSupp scalarSup; + int32_t tsSlotId; // primary timestamp column slot id + STimeWindowAggSupp twAggSup; + uint64_t groupId; // current group id, used to identify the data block from different groups + SResultRow* pRow; + int32_t windowCount; + int32_t windowSliding; + SCountWindowSupp countSup; +} SCountWindowOperatorInfo; + +void destroyCountWindowOperatorInfo(void* param) { + SCountWindowOperatorInfo* pInfo = (SCountWindowOperatorInfo*)param; + if (pInfo == NULL) { + return; + } + cleanupBasicInfo(&pInfo->binfo); + colDataDestroy(&pInfo->twAggSup.timeWindowData); + + cleanupAggSup(&pInfo->aggSup); + cleanupExprSupp(&pInfo->scalarSup); + taosArrayDestroy(pInfo->countSup.pWinStates); + taosMemoryFreeClear(param); +} + +static void clearWinStateBuff(SCountWindowResult* pBuff) { + pBuff->winRows = 0; +} + +static SCountWindowResult* getCountWinStateInfo(SCountWindowSupp* pCountSup) { + SCountWindowResult* pBuffInfo = taosArrayGet(pCountSup->pWinStates, pCountSup->stateIndex); + pCountSup->stateIndex = (pCountSup->stateIndex + 1) % taosArrayGetSize(pCountSup->pWinStates); + return pBuffInfo; +} + +static SCountWindowResult* setCountWindowOutputBuff(SExprSupp* pExprSup, SCountWindowSupp* pCountSup, SResultRow** pResult) { + SCountWindowResult* pBuff = getCountWinStateInfo(pCountSup); + (*pResult) = &pBuff->row; + setResultRowInitCtx(*pResult, pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset); + return pBuff; +} + +static int32_t updateCountWindowInfo(int32_t start, int32_t blockRows, int32_t countWinRows, int32_t* pCurrentRows) { + int32_t rows = TMIN(countWinRows - (*pCurrentRows), blockRows - start); + (*pCurrentRows) += rows; + return rows; +} + +int32_t doCountWindowAggImpl(SOperatorInfo* pOperator, SSDataBlock* pBlock) { + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SExprSupp* pExprSup = &pOperator->exprSupp; + SCountWindowOperatorInfo* pInfo = pOperator->info; + SSDataBlock* pRes = pInfo->binfo.pRes; + SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, pInfo->tsSlotId); + TSKEY* tsCols = (TSKEY*)pColInfoData->pData; + int32_t code = TSDB_CODE_SUCCESS; + + for (int32_t i = 0; i < pBlock->info.rows;) { + int32_t step = pInfo->windowSliding; + SCountWindowResult* pBuffInfo = setCountWindowOutputBuff(pExprSup, &pInfo->countSup, &pInfo->pRow); + int32_t prevRows = pBuffInfo->winRows; + int32_t num = updateCountWindowInfo(i, pBlock->info.rows, pInfo->windowCount, &pBuffInfo->winRows); + if (prevRows == 0) { + pInfo->pRow->win.skey = tsCols[i]; + } + pInfo->pRow->win.ekey = tsCols[num + i - 1]; + + updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pInfo->pRow->win, 0); + applyAggFunctionOnPartialTuples(pTaskInfo, pExprSup->pCtx, &pInfo->twAggSup.timeWindowData, i, num, + pBlock->info.rows, pExprSup->numOfExprs); + if (pBuffInfo->winRows == pInfo->windowCount) { + doUpdateNumOfRows(pExprSup->pCtx, pInfo->pRow, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset); + copyResultrowToDataBlock(pExprSup->pExprInfo, pExprSup->numOfExprs, pInfo->pRow, pExprSup->pCtx, pRes, + pExprSup->rowEntryInfoOffset, pTaskInfo); + pRes->info.rows += pInfo->pRow->numOfRows; + clearWinStateBuff(pBuffInfo); + clearResultRowInitFlag(pExprSup->pCtx, pExprSup->numOfExprs); + } + if (pInfo->windowCount != pInfo->windowSliding) { + if (prevRows <= pInfo->windowSliding) { + if (pBuffInfo->winRows > pInfo->windowSliding) { + step = pInfo->windowSliding - prevRows; + } + } else { + step = 0; + } + } + i += step; + } + + return code; +} + +static void buildCountResult(SExprSupp* pExprSup, SCountWindowSupp* pCountSup, SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock) { + SResultRow* pResultRow = NULL; + for (int32_t i = 0; i < taosArrayGetSize(pCountSup->pWinStates); i++) { + SCountWindowResult* pBuff = setCountWindowOutputBuff(pExprSup, pCountSup, &pResultRow); + if (pBuff->winRows == 0) { + continue;; + } + doUpdateNumOfRows(pExprSup->pCtx, pResultRow, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset); + copyResultrowToDataBlock(pExprSup->pExprInfo, pExprSup->numOfExprs, pResultRow, pExprSup->pCtx, pBlock, + pExprSup->rowEntryInfoOffset, pTaskInfo); + pBlock->info.rows += pResultRow->numOfRows; + clearWinStateBuff(pBuff); + clearResultRowInitFlag(pExprSup->pCtx, pExprSup->numOfExprs); + } +} + +static SSDataBlock* countWindowAggregate(SOperatorInfo* pOperator) { + SCountWindowOperatorInfo* pInfo = pOperator->info; + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SExprSupp* pExprSup = &pOperator->exprSupp; + int32_t order = pInfo->binfo.inputTsOrder; + SSDataBlock* pRes = pInfo->binfo.pRes; + SOperatorInfo* downstream = pOperator->pDownstream[0]; + + blockDataCleanup(pRes); + + while (1) { + SSDataBlock* pBlock = getNextBlockFromDownstream(pOperator, 0); + if (pBlock == NULL) { + break; + } + + pRes->info.scanFlag = pBlock->info.scanFlag; + setInputDataBlock(pExprSup, pBlock, order, MAIN_SCAN, true); + blockDataUpdateTsWindow(pBlock, pInfo->tsSlotId); + + // there is an scalar expression that needs to be calculated right before apply the group aggregation. + if (pInfo->scalarSup.pExprInfo != NULL) { + pTaskInfo->code = projectApplyFunctions(pInfo->scalarSup.pExprInfo, pBlock, pBlock, pInfo->scalarSup.pCtx, + pInfo->scalarSup.numOfExprs, NULL); + if (pTaskInfo->code != TSDB_CODE_SUCCESS) { + T_LONG_JMP(pTaskInfo->env, pTaskInfo->code); + } + } + + if (pInfo->groupId == 0) { + pInfo->groupId = pBlock->info.id.groupId; + } else if (pInfo->groupId != pBlock->info.id.groupId) { + buildCountResult(pExprSup, &pInfo->countSup, pTaskInfo, pRes); + pInfo->groupId = pBlock->info.id.groupId; + } + + doCountWindowAggImpl(pOperator, pBlock); + if (pRes->info.rows >= pOperator->resultInfo.threshold) { + return pRes; + } + } + + buildCountResult(pExprSup, &pInfo->countSup, pTaskInfo, pRes); + return pRes->info.rows == 0 ? NULL : pRes; +} + +SOperatorInfo* createCountwindowOperatorInfo(SOperatorInfo* downstream, SPhysiNode* physiNode, + SExecTaskInfo* pTaskInfo) { + SCountWindowOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SCountWindowOperatorInfo)); + SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); + if (pInfo == NULL || pOperator == NULL) { + goto _error; + } + + int32_t code = TSDB_CODE_SUCCESS; + SCountWinodwPhysiNode* pCountWindowNode = (SCountWinodwPhysiNode*)physiNode; + + pInfo->tsSlotId = ((SColumnNode*)pCountWindowNode->window.pTspk)->slotId; + + if (pCountWindowNode->window.pExprs != NULL) { + int32_t numOfScalarExpr = 0; + SExprInfo* pScalarExprInfo = createExprInfo(pCountWindowNode->window.pExprs, NULL, &numOfScalarExpr); + code = initExprSupp(&pInfo->scalarSup, pScalarExprInfo, numOfScalarExpr, &pTaskInfo->storageAPI.functionStore); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + } + + size_t keyBufSize = 0; + int32_t num = 0; + SExprInfo* pExprInfo = createExprInfo(pCountWindowNode->window.pFuncs, NULL, &num); + initResultSizeInfo(&pOperator->resultInfo, 4096); + + code = initAggSup(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str, + pTaskInfo->streamInfo.pState, &pTaskInfo->storageAPI.functionStore); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + + SSDataBlock* pResBlock = createDataBlockFromDescNode(pCountWindowNode->window.node.pOutputDataBlockDesc); + blockDataEnsureCapacity(pResBlock, pOperator->resultInfo.capacity); + + initBasicInfo(&pInfo->binfo, pResBlock); + initResultRowInfo(&pInfo->binfo.resultRowInfo); + pInfo->binfo.inputTsOrder = physiNode->inputTsOrder; + pInfo->binfo.outputTsOrder = physiNode->outputTsOrder; + pInfo->windowCount = pCountWindowNode->windowCount; + pInfo->windowSliding = pCountWindowNode->windowSliding; + //sizeof(SCountWindowResult) + int32_t itemSize = sizeof(int32_t) + pInfo->aggSup.resultRowSize; + int32_t numOfItem = 1; + if (pInfo->windowCount != pInfo->windowSliding) { + numOfItem = pInfo->windowCount / pInfo->windowSliding + 1; + } + pInfo->countSup.pWinStates = taosArrayInit_s(itemSize, numOfItem); + if (!pInfo->countSup.pWinStates) { + goto _error; + } + + pInfo->countSup.stateIndex = 0; + + initExecTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pTaskInfo->window); + + setOperatorInfo(pOperator, "CountWindowOperator", QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT, true, OP_NOT_OPENED, pInfo, + pTaskInfo); + pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, countWindowAggregate, NULL, destroyCountWindowOperatorInfo, + optrDefaultBufFn, NULL, optrDefaultGetNextExtFn, NULL); + + code = appendDownstream(pOperator, &downstream, 1); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + + return pOperator; + +_error: + if (pInfo != NULL) { + destroyCountWindowOperatorInfo(pInfo); + } + + taosMemoryFreeClear(pOperator); + pTaskInfo->code = code; + return NULL; +} diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 8bd83ee0fb..bb89fb587b 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -2245,6 +2245,8 @@ char* getStreamOpName(uint16_t opType) { return "stream partitionby"; case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: return "stream event"; + case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: + return "stream count"; } return ""; } diff --git a/source/libs/executor/src/operator.c b/source/libs/executor/src/operator.c index fd4b3cd7db..494794f8c2 100644 --- a/source/libs/executor/src/operator.c +++ b/source/libs/executor/src/operator.c @@ -542,6 +542,10 @@ SOperatorInfo* createOperator(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, SR pOptr = createGroupCacheOperatorInfo(ops, size, (SGroupCachePhysiNode*)pPhyNode, pTaskInfo); } else if (QUERY_NODE_PHYSICAL_PLAN_DYN_QUERY_CTRL == type) { pOptr = createDynQueryCtrlOperatorInfo(ops, size, (SDynQueryCtrlPhysiNode*)pPhyNode, pTaskInfo); + } else if (QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT == type) { + pOptr = createStreamCountAggOperatorInfo(ops[0], pPhyNode, pTaskInfo, pHandle); + } else if (QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT == type) { + pOptr = createCountwindowOperatorInfo(ops[0], pPhyNode, pTaskInfo); } else { terrno = TSDB_CODE_INVALID_PARA; pTaskInfo->code = terrno; diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index cb6ec56235..3e256c651b 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -1284,6 +1284,14 @@ static bool isSlidingWindow(SStreamScanInfo* pInfo) { return isIntervalWindow(pInfo) && pInfo->interval.interval != pInfo->interval.sliding; } +static bool isCountSlidingWindow(SStreamScanInfo* pInfo) { + return pInfo->windowSup.pStreamAggSup && (pInfo->windowSup.pStreamAggSup->windowCount != pInfo->windowSup.pStreamAggSup->windowSliding); +} + +static bool isCountWindow(SStreamScanInfo* pInfo) { + return pInfo->windowSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT; +} + static void setGroupId(SStreamScanInfo* pInfo, SSDataBlock* pBlock, int32_t groupColIndex, int32_t rowIndex) { SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, groupColIndex); uint64_t* groupCol = (uint64_t*)pColInfo->pData; @@ -1394,7 +1402,7 @@ static bool prepareRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pBlock, int32_ TSKEY* calEndData = (TSKEY*)pCalEndTsCol->pData; setGroupId(pInfo, pBlock, GROUPID_COLUMN_INDEX, *pRowIndex); - if (isSlidingWindow(pInfo)) { + if (isSlidingWindow(pInfo) || isCountSlidingWindow(pInfo)) { pInfo->updateWin.skey = calStartData[*pRowIndex]; pInfo->updateWin.ekey = calEndData[*pRowIndex]; } @@ -1588,6 +1596,47 @@ static int32_t generateSessionScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSr return TSDB_CODE_SUCCESS; } +static int32_t generateCountScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSrcBlock, SSDataBlock* pDestBlock, EStreamType mode) { + blockDataCleanup(pDestBlock); + if (pSrcBlock->info.rows == 0) { + return TSDB_CODE_SUCCESS; + } + int32_t code = blockDataEnsureCapacity(pDestBlock, pSrcBlock->info.rows); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + ASSERT(taosArrayGetSize(pSrcBlock->pDataBlock) >= 3); + SColumnInfoData* pStartTsCol = taosArrayGet(pSrcBlock->pDataBlock, START_TS_COLUMN_INDEX); + TSKEY* startData = (TSKEY*)pStartTsCol->pData; + SColumnInfoData* pEndTsCol = taosArrayGet(pSrcBlock->pDataBlock, END_TS_COLUMN_INDEX); + TSKEY* endData = (TSKEY*)pEndTsCol->pData; + SColumnInfoData* pUidCol = taosArrayGet(pSrcBlock->pDataBlock, UID_COLUMN_INDEX); + uint64_t* uidCol = (uint64_t*)pUidCol->pData; + + SColumnInfoData* pDestStartCol = taosArrayGet(pDestBlock->pDataBlock, START_TS_COLUMN_INDEX); + SColumnInfoData* pDestEndCol = taosArrayGet(pDestBlock->pDataBlock, END_TS_COLUMN_INDEX); + SColumnInfoData* pDestUidCol = taosArrayGet(pDestBlock->pDataBlock, UID_COLUMN_INDEX); + SColumnInfoData* pDestGpCol = taosArrayGet(pDestBlock->pDataBlock, GROUPID_COLUMN_INDEX); + SColumnInfoData* pDestCalStartTsCol = taosArrayGet(pDestBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX); + SColumnInfoData* pDestCalEndTsCol = taosArrayGet(pDestBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX); + int64_t ver = pSrcBlock->info.version - 1; + for (int32_t i = 0; i < pSrcBlock->info.rows; i++) { + uint64_t groupId = getGroupIdByData(pInfo, uidCol[i], startData[i], ver); + SSessionKey startWin = {.win.skey = startData[i], .win.ekey = endData[i], .groupId = groupId}; + SSessionKey range = {0}; + getCountWinRange(pInfo->windowSup.pStreamAggSup, &startWin, mode, &range); + colDataSetVal(pDestStartCol, i, (const char*)&range.win.skey, false); + colDataSetVal(pDestEndCol, i, (const char*)&range.win.ekey, false); + + colDataSetNULL(pDestUidCol, i); + colDataSetVal(pDestGpCol, i, (const char*)&groupId, false); + colDataSetVal(pDestCalStartTsCol, i, (const char*)&range.win.skey, false); + colDataSetVal(pDestCalEndTsCol, i, (const char*)&range.win.ekey, false); + pDestBlock->info.rows++; + } + return TSDB_CODE_SUCCESS; +} + static int32_t generateIntervalScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSrcBlock, SSDataBlock* pDestBlock) { blockDataCleanup(pDestBlock); int32_t rows = pSrcBlock->info.rows; @@ -1724,12 +1773,14 @@ static int32_t generateDeleteResultBlock(SStreamScanInfo* pInfo, SSDataBlock* pS return TSDB_CODE_SUCCESS; } -static int32_t generateScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSrcBlock, SSDataBlock* pDestBlock) { +static int32_t generateScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSrcBlock, SSDataBlock* pDestBlock, EStreamType type) { int32_t code = TSDB_CODE_SUCCESS; if (isIntervalWindow(pInfo)) { code = generateIntervalScanRange(pInfo, pSrcBlock, pDestBlock); } else if (isSessionWindow(pInfo) || isStateWindow(pInfo)) { code = generateSessionScanRange(pInfo, pSrcBlock, pDestBlock); + } else if (isCountWindow(pInfo)) { + code = generateCountScanRange(pInfo, pSrcBlock, pDestBlock, type); } else { code = generateDeleteResultBlock(pInfo, pSrcBlock, pDestBlock); } @@ -1742,6 +1793,11 @@ static int32_t generateScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSrcBlock, void appendOneRowToStreamSpecialBlock(SSDataBlock* pBlock, TSKEY* pStartTs, TSKEY* pEndTs, uint64_t* pUid, uint64_t* pGp, void* pTbName) { + appendAllColumnToStreamSpecialBlock(pBlock, pStartTs, pEndTs, pStartTs, pEndTs, pUid, pGp, pTbName); +} + +void appendAllColumnToStreamSpecialBlock(SSDataBlock* pBlock, TSKEY* pStartTs, TSKEY* pEndTs, TSKEY* pCalStartTs, + TSKEY* pCalEndTs, uint64_t* pUid, uint64_t* pGp, void* pTbName) { SColumnInfoData* pStartTsCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); SColumnInfoData* pEndTsCol = taosArrayGet(pBlock->pDataBlock, END_TS_COLUMN_INDEX); SColumnInfoData* pUidCol = taosArrayGet(pBlock->pDataBlock, UID_COLUMN_INDEX); @@ -1753,8 +1809,8 @@ void appendOneRowToStreamSpecialBlock(SSDataBlock* pBlock, TSKEY* pStartTs, TSKE colDataSetVal(pEndTsCol, pBlock->info.rows, (const char*)pEndTs, false); colDataSetVal(pUidCol, pBlock->info.rows, (const char*)pUid, false); colDataSetVal(pGpCol, pBlock->info.rows, (const char*)pGp, false); - colDataSetVal(pCalStartCol, pBlock->info.rows, (const char*)pStartTs, false); - colDataSetVal(pCalEndCol, pBlock->info.rows, (const char*)pEndTs, false); + colDataSetVal(pCalStartCol, pBlock->info.rows, (const char*)pCalStartTs, false); + colDataSetVal(pCalEndCol, pBlock->info.rows, (const char*)pCalEndTs, false); colDataSetVal(pTableCol, pBlock->info.rows, (const char*)pTbName, pTbName == NULL); pBlock->info.rows++; } @@ -2159,6 +2215,14 @@ void streamScanOperatorDecode(void* pBuff, int32_t len, SStreamScanInfo* pInfo) taosMemoryFree(pUpInfo); } } +static bool hasScanRange(SStreamScanInfo* pInfo) { + SStreamAggSupporter* pSup = pInfo->windowSup.pStreamAggSup; + return pSup && pSup->pScanBlock->info.rows > 0 && (isStateWindow(pInfo) || isCountWindow(pInfo)); +} + +static bool isStreamWindow(SStreamScanInfo* pInfo) { + return isIntervalWindow(pInfo) || isSessionWindow(pInfo) || isStateWindow(pInfo) || isCountWindow(pInfo); +} static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) { // NOTE: this operator does never check if current status is done or not @@ -2307,7 +2371,7 @@ FETCH_NEXT_BLOCK: goto FETCH_NEXT_BLOCK; } - if (!isIntervalWindow(pInfo) && !isSessionWindow(pInfo) && !isStateWindow(pInfo)) { + if (!isStreamWindow(pInfo)) { generateDeleteResultBlock(pInfo, pDelBlock, pInfo->pDeleteDataRes); pInfo->pDeleteDataRes->info.type = STREAM_DELETE_RESULT; printSpecDataBlock(pDelBlock, getStreamOpName(pOperator->operatorType), "delete result", GET_TASKID(pTaskInfo)); @@ -2321,7 +2385,7 @@ FETCH_NEXT_BLOCK: } else { pInfo->blockType = STREAM_INPUT__DATA_SUBMIT; pInfo->updateResIndex = 0; - generateScanRange(pInfo, pDelBlock, pInfo->pUpdateRes); + generateScanRange(pInfo, pDelBlock, pInfo->pUpdateRes, STREAM_DELETE_DATA); prepareRangeScan(pInfo, pInfo->pUpdateRes, &pInfo->updateResIndex); copyDataBlock(pInfo->pDeleteDataRes, pInfo->pUpdateRes); pInfo->pDeleteDataRes->info.type = STREAM_DELETE_DATA; @@ -2359,7 +2423,7 @@ FETCH_NEXT_BLOCK: } } break; case STREAM_SCAN_FROM_DELETE_DATA: { - generateScanRange(pInfo, pInfo->pUpdateDataRes, pInfo->pUpdateRes); + generateScanRange(pInfo, pInfo->pUpdateDataRes, pInfo->pUpdateRes, STREAM_DELETE_DATA); prepareRangeScan(pInfo, pInfo->pUpdateRes, &pInfo->updateResIndex); pInfo->scanMode = STREAM_SCAN_FROM_DATAREADER_RANGE; copyDataBlock(pInfo->pDeleteDataRes, pInfo->pUpdateRes); @@ -2367,7 +2431,7 @@ FETCH_NEXT_BLOCK: return pInfo->pDeleteDataRes; } break; case STREAM_SCAN_FROM_UPDATERES: { - generateScanRange(pInfo, pInfo->pUpdateDataRes, pInfo->pUpdateRes); + generateScanRange(pInfo, pInfo->pUpdateDataRes, pInfo->pUpdateRes, STREAM_CLEAR); prepareRangeScan(pInfo, pInfo->pUpdateRes, &pInfo->updateResIndex); pInfo->scanMode = STREAM_SCAN_FROM_DATAREADER_RANGE; return pInfo->pUpdateRes; @@ -2392,10 +2456,10 @@ FETCH_NEXT_BLOCK: break; } - SStreamAggSupporter* pSup = pInfo->windowSup.pStreamAggSup; - if (isStateWindow(pInfo) && pSup->pScanBlock->info.rows > 0) { + if (hasScanRange(pInfo)) { pInfo->scanMode = STREAM_SCAN_FROM_DATAREADER_RANGE; pInfo->updateResIndex = 0; + SStreamAggSupporter* pSup = pInfo->windowSup.pStreamAggSup; copyDataBlock(pInfo->pUpdateRes, pSup->pScanBlock); blockDataCleanup(pSup->pScanBlock); prepareRangeScan(pInfo, pInfo->pUpdateRes, &pInfo->updateResIndex); diff --git a/source/libs/executor/src/streamcountwindowoperator.c b/source/libs/executor/src/streamcountwindowoperator.c new file mode 100644 index 0000000000..706b4c5a01 --- /dev/null +++ b/source/libs/executor/src/streamcountwindowoperator.c @@ -0,0 +1,714 @@ +/* + * 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 "executorInt.h" +#include "function.h" +#include "functionMgt.h" +#include "operator.h" +#include "querytask.h" +#include "tchecksum.h" +#include "tcommon.h" +#include "tdatablock.h" +#include "tglobal.h" +#include "tlog.h" +#include "ttime.h" + +#define IS_FINAL_COUNT_OP(op) ((op)->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_COUNT) +#define STREAM_COUNT_OP_STATE_NAME "StreamCountHistoryState" +#define STREAM_COUNT_OP_CHECKPOINT_NAME "StreamCountOperator_Checkpoint" + +typedef struct SCountWindowInfo { + SResultWindowInfo winInfo; + COUNT_TYPE* pWindowCount; +} SCountWindowInfo; + +typedef enum { + NONE_WINDOW = 0, + CREATE_NEW_WINDOW, + MOVE_NEXT_WINDOW, +} BuffOp; +typedef struct SBuffInfo { + bool rebuildWindow; + BuffOp winBuffOp; + SStreamStateCur* pCur; +} SBuffInfo; + +void destroyStreamCountAggOperatorInfo(void* param) { + SStreamCountAggOperatorInfo* pInfo = (SStreamCountAggOperatorInfo*)param; + cleanupBasicInfo(&pInfo->binfo); + destroyStreamAggSupporter(&pInfo->streamAggSup); + cleanupExprSupp(&pInfo->scalarSupp); + clearGroupResInfo(&pInfo->groupResInfo); + + colDataDestroy(&pInfo->twAggSup.timeWindowData); + blockDataDestroy(pInfo->pDelRes); + tSimpleHashCleanup(pInfo->pStUpdated); + tSimpleHashCleanup(pInfo->pStDeleted); + pInfo->pUpdated = taosArrayDestroy(pInfo->pUpdated); + cleanupGroupResInfo(&pInfo->groupResInfo); + + taosArrayDestroy(pInfo->historyWins); + blockDataDestroy(pInfo->pCheckpointRes); + + taosMemoryFreeClear(param); +} + +bool isSlidingCountWindow(SStreamAggSupporter* pAggSup) { + return pAggSup->windowCount != pAggSup->windowSliding; +} + +void setCountOutputBuf(SStreamAggSupporter* pAggSup, TSKEY ts, uint64_t groupId, SCountWindowInfo* pCurWin, + SBuffInfo* pBuffInfo) { + int32_t code = TSDB_CODE_SUCCESS; + int32_t size = pAggSup->resultRowSize; + pCurWin->winInfo.sessionWin.groupId = groupId; + pCurWin->winInfo.sessionWin.win.skey = ts; + pCurWin->winInfo.sessionWin.win.ekey = ts; + + if (isSlidingCountWindow(pAggSup)) { + if (pBuffInfo->winBuffOp == CREATE_NEW_WINDOW) { + pAggSup->stateStore.streamStateCountWinAdd(pAggSup->pState, &pCurWin->winInfo.sessionWin, + (void**)&pCurWin->winInfo.pStatePos, &size); + code = TSDB_CODE_FAILED; + } else if (pBuffInfo->winBuffOp == MOVE_NEXT_WINDOW) { + ASSERT(pBuffInfo->pCur); + pAggSup->stateStore.streamStateCurNext(pAggSup->pState, pBuffInfo->pCur); + code = pAggSup->stateStore.streamStateSessionGetKVByCur(pBuffInfo->pCur, &pCurWin->winInfo.sessionWin, + (void**)&pCurWin->winInfo.pStatePos, &size); + if (code == TSDB_CODE_FAILED) { + pAggSup->stateStore.streamStateCountWinAdd(pAggSup->pState, &pCurWin->winInfo.sessionWin, + (void**)&pCurWin->winInfo.pStatePos, &size); + } + } else { + pBuffInfo->pCur = pAggSup->stateStore.streamStateCountSeekKeyPrev(pAggSup->pState, &pCurWin->winInfo.sessionWin, pAggSup->windowCount); + code = pAggSup->stateStore.streamStateSessionGetKVByCur(pBuffInfo->pCur, &pCurWin->winInfo.sessionWin, + (void**)&pCurWin->winInfo.pStatePos, &size); + if (code == TSDB_CODE_FAILED) { + pAggSup->stateStore.streamStateCountWinAdd(pAggSup->pState, &pCurWin->winInfo.sessionWin, + (void**)&pCurWin->winInfo.pStatePos, &size); + } + } + } else { + code = pAggSup->stateStore.streamStateCountWinAddIfNotExist( + pAggSup->pState, &pCurWin->winInfo.sessionWin, pAggSup->windowCount, (void**)&pCurWin->winInfo.pStatePos, &size); + } + + if (code == TSDB_CODE_SUCCESS) { + pCurWin->winInfo.isOutput = true; + } + pCurWin->pWindowCount= + (COUNT_TYPE*) ((char*)pCurWin->winInfo.pStatePos->pRowBuff + (pAggSup->resultRowSize - sizeof(COUNT_TYPE))); + + if (*pCurWin->pWindowCount == pAggSup->windowCount) { + pBuffInfo->rebuildWindow = true; + } +} + +static int32_t updateCountWindowInfo(SStreamAggSupporter* pAggSup, SCountWindowInfo* pWinInfo, TSKEY* pTs, int32_t start, int32_t rows, int32_t maxRows, + SSHashObj* pStDeleted, bool* pRebuild) { + SSessionKey sWinKey = pWinInfo->winInfo.sessionWin; + int32_t num = 0; + for (int32_t i = start; i < rows; i++) { + if (pTs[i] < pWinInfo->winInfo.sessionWin.win.ekey) { + num++; + } else { + break; + } + } + int32_t maxNum = TMIN(maxRows - *pWinInfo->pWindowCount, rows - start); + if (num > maxNum) { + *pRebuild = true; + } + *pWinInfo->pWindowCount += maxNum; + bool needDelState = false; + if (pWinInfo->winInfo.sessionWin.win.skey > pTs[start]) { + needDelState = true; + if (pStDeleted && pWinInfo->winInfo.isOutput) { + saveDeleteRes(pStDeleted, pWinInfo->winInfo.sessionWin); + } + + pWinInfo->winInfo.sessionWin.win.skey = pTs[start]; + } + + if (pWinInfo->winInfo.sessionWin.win.ekey < pTs[maxNum + start - 1]) { + needDelState = true; + pWinInfo->winInfo.sessionWin.win.ekey = pTs[maxNum + start - 1]; + } + + if (needDelState) { + memcpy(pWinInfo->winInfo.pStatePos->pKey, &pWinInfo->winInfo.sessionWin, sizeof(SSessionKey)); + if (pWinInfo->winInfo.pStatePos->needFree) { + pAggSup->stateStore.streamStateSessionDel(pAggSup->pState, &sWinKey); + } + } + + return maxNum; +} + +void getCountWinRange(SStreamAggSupporter* pAggSup, const SSessionKey* pKey, EStreamType mode, SSessionKey* pDelRange) { + *pDelRange = *pKey; + SStreamStateCur* pCur = NULL; + if (isSlidingCountWindow(pAggSup)) { + pCur = pAggSup->stateStore.streamStateCountSeekKeyPrev(pAggSup->pState, pKey, pAggSup->windowCount); + } else { + pCur = pAggSup->stateStore.streamStateSessionSeekKeyCurrentNext(pAggSup->pState, pKey); + } + SSessionKey tmpKey = {0}; + int32_t code = pAggSup->stateStore.streamStateSessionGetKVByCur(pCur, &tmpKey, NULL, 0); + if (code != TSDB_CODE_SUCCESS) { + pAggSup->stateStore.streamStateFreeCur(pCur); + return; + } + pDelRange->win = tmpKey.win; + while (mode == STREAM_DELETE_DATA) { + pAggSup->stateStore.streamStateCurNext(pAggSup->pState, pCur); + code = pAggSup->stateStore.streamStateSessionGetKVByCur(pCur, &tmpKey, NULL, 0); + if (code != TSDB_CODE_SUCCESS) { + break; + } + pDelRange->win.ekey = TMAX(pDelRange->win.ekey, tmpKey.win.ekey); + } + pAggSup->stateStore.streamStateFreeCur(pCur); +} + +static void destroySBuffInfo(SStreamAggSupporter* pAggSup, SBuffInfo* pBuffInfo) { + pAggSup->stateStore.streamStateFreeCur(pBuffInfo->pCur); +} + +bool inCountCalSlidingWindow(SStreamAggSupporter* pAggSup, STimeWindow* pWin, TSKEY sKey, TSKEY eKey) { + if (pAggSup->windowCount == pAggSup->windowSliding) { + return true; + } + if (sKey <= pWin->skey && pWin->ekey <= eKey) { + return true; + } + return false; +} + +bool inCountSlidingWindow(SStreamAggSupporter* pAggSup, STimeWindow* pWin, SDataBlockInfo* pBlockInfo) { + return inCountCalSlidingWindow(pAggSup, pWin, pBlockInfo->calWin.skey, pBlockInfo->calWin.ekey); +} + +static void doStreamCountAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDataBlock, SSHashObj* pStUpdated, + SSHashObj* pStDeleted) { + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SStreamCountAggOperatorInfo* pInfo = pOperator->info; + int32_t numOfOutput = pOperator->exprSupp.numOfExprs; + uint64_t groupId = pSDataBlock->info.id.groupId; + int64_t code = TSDB_CODE_SUCCESS; + SResultRow* pResult = NULL; + int32_t rows = pSDataBlock->info.rows; + int32_t winRows = 0; + SStreamAggSupporter* pAggSup = &pInfo->streamAggSup; + SBuffInfo buffInfo = {.rebuildWindow = false, .winBuffOp = NONE_WINDOW, .pCur = NULL}; + + pInfo->dataVersion = TMAX(pInfo->dataVersion, pSDataBlock->info.version); + pAggSup->winRange = pTaskInfo->streamInfo.fillHistoryWindow; + if (pAggSup->winRange.ekey <= 0) { + pAggSup->winRange.ekey = INT64_MAX; + } + + SColumnInfoData* pStartTsCol = taosArrayGet(pSDataBlock->pDataBlock, pInfo->primaryTsIndex); + TSKEY* startTsCols = (int64_t*)pStartTsCol->pData; + blockDataEnsureCapacity(pAggSup->pScanBlock, rows * 2); + SStreamStateCur* pCur = NULL; + COUNT_TYPE slidingRows = 0; + + for (int32_t i = 0; i < rows;) { + if (pInfo->ignoreExpiredData && + checkExpiredData(&pInfo->streamAggSup.stateStore, pInfo->streamAggSup.pUpdateInfo, &pInfo->twAggSup, + pSDataBlock->info.id.uid, startTsCols[i])) { + i++; + continue; + } + SCountWindowInfo curWin = {0}; + buffInfo.rebuildWindow = false; + setCountOutputBuf(pAggSup, startTsCols[i], groupId, &curWin, &buffInfo); + if (!inCountSlidingWindow(pAggSup, &curWin.winInfo.sessionWin.win, &pSDataBlock->info)) { + buffInfo.winBuffOp = MOVE_NEXT_WINDOW; + continue; + } + setSessionWinOutputInfo(pStUpdated, &curWin.winInfo); + slidingRows = *curWin.pWindowCount; + if (!buffInfo.rebuildWindow) { + winRows = updateCountWindowInfo(pAggSup, &curWin, startTsCols, i, rows, pAggSup->windowCount, pStDeleted, &buffInfo.rebuildWindow); + } + if (buffInfo.rebuildWindow) { + SSessionKey range = {0}; + if (isSlidingCountWindow(pAggSup)) { + curWin.winInfo.sessionWin.win.skey = startTsCols[i]; + curWin.winInfo.sessionWin.win.ekey = startTsCols[i]; + } + getCountWinRange(pAggSup, &curWin.winInfo.sessionWin, STREAM_DELETE_DATA, &range); + range.win.skey = TMIN(startTsCols[i], range.win.skey); + range.win.ekey = TMAX(startTsCols[rows-1], range.win.ekey); + uint64_t uid = 0; + appendOneRowToStreamSpecialBlock(pAggSup->pScanBlock, &range.win.skey, &range.win.ekey, &uid, &range.groupId, NULL); + break; + } + code = doOneWindowAggImpl(&pInfo->twAggSup.timeWindowData, &curWin.winInfo, &pResult, i, winRows, rows, numOfOutput, + pOperator, 0); + if (code != TSDB_CODE_SUCCESS || pResult == NULL) { + qError("%s do stream count aggregate impl error, code %s", GET_TASKID(pTaskInfo), tstrerror(code)); + T_LONG_JMP(pTaskInfo->env, TSDB_CODE_OUT_OF_MEMORY); + } + saveSessionOutputBuf(pAggSup, &curWin.winInfo); + + if (pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE && pStUpdated) { + code = saveResult(curWin.winInfo, pStUpdated); + if (code != TSDB_CODE_SUCCESS) { + qError("%s do stream count aggregate impl, set result error, code %s", GET_TASKID(pTaskInfo), + tstrerror(code)); + T_LONG_JMP(pTaskInfo->env, TSDB_CODE_OUT_OF_MEMORY); + } + } + if (pInfo->twAggSup.calTrigger == STREAM_TRIGGER_WINDOW_CLOSE) { + SSessionKey key = {0}; + getSessionHashKey(&curWin.winInfo.sessionWin, &key); + tSimpleHashPut(pAggSup->pResultRows, &key, sizeof(SSessionKey), &curWin.winInfo, sizeof(SResultWindowInfo)); + } + + if (isSlidingCountWindow(pAggSup)) { + if (slidingRows <= pAggSup->windowSliding) { + if (slidingRows + winRows > pAggSup->windowSliding) { + buffInfo.winBuffOp = CREATE_NEW_WINDOW; + winRows = pAggSup->windowSliding - slidingRows; + ASSERT(i >= 0); + } + } else { + buffInfo.winBuffOp = MOVE_NEXT_WINDOW; + winRows = 0; + } + } + i += winRows; + } + destroySBuffInfo(pAggSup, &buffInfo); +} + +static SSDataBlock* buildCountResult(SOperatorInfo* pOperator) { + SStreamCountAggOperatorInfo* pInfo = pOperator->info; + SStreamAggSupporter* pAggSup = &pInfo->streamAggSup; + SOptrBasicInfo* pBInfo = &pInfo->binfo; + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + doBuildDeleteDataBlock(pOperator, pInfo->pStDeleted, pInfo->pDelRes, &pInfo->pDelIterator); + if (pInfo->pDelRes->info.rows > 0) { + printDataBlock(pInfo->pDelRes, getStreamOpName(pOperator->operatorType), GET_TASKID(pTaskInfo)); + return pInfo->pDelRes; + } + + doBuildSessionResult(pOperator, pAggSup->pState, &pInfo->groupResInfo, pBInfo->pRes); + if (pBInfo->pRes->info.rows > 0) { + printDataBlock(pBInfo->pRes, getStreamOpName(pOperator->operatorType), GET_TASKID(pTaskInfo)); + return pBInfo->pRes; + } + return NULL; +} + +int32_t doStreamCountEncodeOpState(void** buf, int32_t len, SOperatorInfo* pOperator, bool isParent) { + SStreamCountAggOperatorInfo* pInfo = pOperator->info; + if (!pInfo) { + return 0; + } + + void* pData = (buf == NULL) ? NULL : *buf; + + // 1.streamAggSup.pResultRows + int32_t tlen = 0; + int32_t mapSize = tSimpleHashGetSize(pInfo->streamAggSup.pResultRows); + tlen += taosEncodeFixedI32(buf, mapSize); + void* pIte = NULL; + size_t keyLen = 0; + int32_t iter = 0; + while ((pIte = tSimpleHashIterate(pInfo->streamAggSup.pResultRows, pIte, &iter)) != NULL) { + void* key = taosHashGetKey(pIte, &keyLen); + tlen += encodeSSessionKey(buf, key); + tlen += encodeSResultWindowInfo(buf, pIte, pInfo->streamAggSup.resultRowSize); + } + + // 2.twAggSup + tlen += encodeSTimeWindowAggSupp(buf, &pInfo->twAggSup); + + // 3.dataVersion + tlen += taosEncodeFixedI32(buf, pInfo->dataVersion); + + // 4.checksum + if (isParent) { + if (buf) { + uint32_t cksum = taosCalcChecksum(0, pData, len - sizeof(uint32_t)); + tlen += taosEncodeFixedU32(buf, cksum); + } else { + tlen += sizeof(uint32_t); + } + } + + return tlen; +} + +void* doStreamCountDecodeOpState(void* buf, int32_t len, SOperatorInfo* pOperator, bool isParent) { + SStreamCountAggOperatorInfo* pInfo = pOperator->info; + if (!pInfo) { + return buf; + } + + // 4.checksum + if (isParent) { + int32_t dataLen = len - sizeof(uint32_t); + void* pCksum = POINTER_SHIFT(buf, dataLen); + if (taosCheckChecksum(buf, dataLen, *(uint32_t*)pCksum) != TSDB_CODE_SUCCESS) { + qError("stream count state is invalid"); + return buf; + } + } + + // 1.streamAggSup.pResultRows + int32_t mapSize = 0; + buf = taosDecodeFixedI32(buf, &mapSize); + for (int32_t i = 0; i < mapSize; i++) { + SSessionKey key = {0}; + SResultWindowInfo winfo = {0}; + buf = decodeSSessionKey(buf, &key); + buf = decodeSResultWindowInfo(buf, &winfo, pInfo->streamAggSup.resultRowSize); + tSimpleHashPut(pInfo->streamAggSup.pResultRows, &key, sizeof(SSessionKey), &winfo, sizeof(SResultWindowInfo)); + } + + // 2.twAggSup + buf = decodeSTimeWindowAggSupp(buf, &pInfo->twAggSup); + + // 3.dataVersion + buf = taosDecodeFixedI64(buf, &pInfo->dataVersion); + return buf; +} + +void doStreamCountSaveCheckpoint(SOperatorInfo* pOperator) { + SStreamCountAggOperatorInfo* pInfo = pOperator->info; + int32_t len = doStreamCountEncodeOpState(NULL, 0, pOperator, true); + void* buf = taosMemoryCalloc(1, len); + void* pBuf = buf; + len = doStreamCountEncodeOpState(&pBuf, len, pOperator, true); + pInfo->streamAggSup.stateStore.streamStateSaveInfo(pInfo->streamAggSup.pState, STREAM_COUNT_OP_CHECKPOINT_NAME, + strlen(STREAM_COUNT_OP_CHECKPOINT_NAME), buf, len); + taosMemoryFree(buf); +} + +void doResetCountWindows(SStreamAggSupporter* pAggSup, SSDataBlock* pBlock) { + SColumnInfoData* pStartTsCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); + TSKEY* startDatas = (TSKEY*)pStartTsCol->pData; + SColumnInfoData* pEndTsCol = taosArrayGet(pBlock->pDataBlock, END_TS_COLUMN_INDEX); + TSKEY* endDatas = (TSKEY*)pEndTsCol->pData; + SColumnInfoData* pCalStartTsCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX); + TSKEY* calStartDatas = (TSKEY*)pStartTsCol->pData; + SColumnInfoData* pCalEndTsCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX); + TSKEY* calEndDatas = (TSKEY*)pEndTsCol->pData; + SColumnInfoData* pGroupCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); + uint64_t* gpDatas = (uint64_t*)pGroupCol->pData; + + SRowBuffPos* pPos = NULL; + int32_t size = 0; + for (int32_t i = 0; i < pBlock->info.rows; i++) { + SSessionKey key = {.groupId = gpDatas[i], .win.skey = startDatas[i], .win.ekey = endDatas[i]}; + SStreamStateCur* pCur = NULL; + if (isSlidingCountWindow(pAggSup)) { + pCur = pAggSup->stateStore.streamStateCountSeekKeyPrev(pAggSup->pState, &key, pAggSup->windowCount); + } else { + pCur = pAggSup->stateStore.streamStateSessionSeekKeyCurrentNext(pAggSup->pState, &key); + } + while (1) { + SSessionKey tmpKey = {0}; + int32_t code = pAggSup->stateStore.streamStateSessionGetKVByCur(pCur, &tmpKey, (void **)&pPos, &size); + if (code != TSDB_CODE_SUCCESS || tmpKey.win.skey > endDatas[i]) { + pAggSup->stateStore.streamStateFreeCur(pCur); + break; + } + if (!inCountCalSlidingWindow(pAggSup, &tmpKey.win, calStartDatas[i], calEndDatas[i])) { + pAggSup->stateStore.streamStateCurNext(pAggSup->pState, pCur); + continue; + } + pAggSup->stateStore.streamStateSessionReset(pAggSup->pState, pPos->pRowBuff); + pAggSup->stateStore.streamStateCurNext(pAggSup->pState, pCur); + } + } +} + +void doDeleteCountWindows(SStreamAggSupporter* pAggSup, SSDataBlock* pBlock, SArray* result) { + SColumnInfoData* pStartTsCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); + TSKEY* startDatas = (TSKEY*)pStartTsCol->pData; + SColumnInfoData* pEndTsCol = taosArrayGet(pBlock->pDataBlock, END_TS_COLUMN_INDEX); + TSKEY* endDatas = (TSKEY*)pEndTsCol->pData; + SColumnInfoData* pCalStartTsCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX); + TSKEY* calStartDatas = (TSKEY*)pStartTsCol->pData; + SColumnInfoData* pCalEndTsCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX); + TSKEY* calEndDatas = (TSKEY*)pEndTsCol->pData; + SColumnInfoData* pGroupCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); + uint64_t* gpDatas = (uint64_t*)pGroupCol->pData; + for (int32_t i = 0; i < pBlock->info.rows; i++) { + SSessionKey key = {.win.skey = startDatas[i], .win.ekey = endDatas[i], .groupId = gpDatas[i]}; + while (1) { + SSessionKey curWin = {0}; + int32_t code = pAggSup->stateStore.streamStateCountGetKeyByRange(pAggSup->pState, &key, &curWin); + if (code == TSDB_CODE_FAILED) { + break; + } + doDeleteSessionWindow(pAggSup, &curWin); + if (result) { + saveDeleteInfo(result, curWin); + } + } + } +} + +void deleteCountWinState(SStreamAggSupporter* pAggSup, SSDataBlock* pBlock, SSHashObj* pMapUpdate, + SSHashObj* pMapDelete) { + SArray* pWins = taosArrayInit(16, sizeof(SSessionKey)); + if (isSlidingCountWindow(pAggSup)) { + doDeleteCountWindows(pAggSup, pBlock, pWins); + } else { + doDeleteTimeWindows(pAggSup, pBlock, pWins); + } + removeSessionResults(pAggSup, pMapUpdate, pWins); + copyDeleteWindowInfo(pWins, pMapDelete); + taosArrayDestroy(pWins); +} + +static SSDataBlock* doStreamCountAgg(SOperatorInfo* pOperator) { + SExprSupp* pSup = &pOperator->exprSupp; + SStreamCountAggOperatorInfo* pInfo = pOperator->info; + SOptrBasicInfo* pBInfo = &pInfo->binfo; + SStreamAggSupporter* pAggSup = &pInfo->streamAggSup; + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + qDebug("stask:%s %s status: %d", GET_TASKID(pTaskInfo), getStreamOpName(pOperator->operatorType), pOperator->status); + if (pOperator->status == OP_EXEC_DONE) { + return NULL; + } else if (pOperator->status == OP_RES_TO_RETURN) { + SSDataBlock* opRes = buildCountResult(pOperator); + if (opRes) { + return opRes; + } + + if (pInfo->recvGetAll) { + pInfo->recvGetAll = false; + resetUnCloseSessionWinInfo(pInfo->streamAggSup.pResultRows); + } + + if (pInfo->reCkBlock) { + pInfo->reCkBlock = false; + printDataBlock(pInfo->pCheckpointRes, getStreamOpName(pOperator->operatorType), GET_TASKID(pTaskInfo)); + return pInfo->pCheckpointRes; + } + + setStreamOperatorCompleted(pOperator); + return NULL; + } + + SOperatorInfo* downstream = pOperator->pDownstream[0]; + if (!pInfo->pUpdated) { + pInfo->pUpdated = taosArrayInit(16, sizeof(SResultWindowInfo)); + } + if (!pInfo->pStUpdated) { + _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); + pInfo->pStUpdated = tSimpleHashInit(64, hashFn); + } + while (1) { + SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream); + if (pBlock == NULL) { + break; + } + printSpecDataBlock(pBlock, getStreamOpName(pOperator->operatorType), "recv", GET_TASKID(pTaskInfo)); + + if (pBlock->info.type == STREAM_DELETE_DATA || pBlock->info.type == STREAM_DELETE_RESULT) { + deleteCountWinState(&pInfo->streamAggSup, pBlock, pInfo->pStUpdated, pInfo->pStDeleted); + continue; + } else if (pBlock->info.type == STREAM_CLEAR) { + doResetCountWindows(&pInfo->streamAggSup, pBlock); + continue; + } else if (pBlock->info.type == STREAM_GET_ALL) { + pInfo->recvGetAll = true; + getAllSessionWindow(pAggSup->pResultRows, pInfo->pStUpdated); + continue; + } else if (pBlock->info.type == STREAM_CREATE_CHILD_TABLE) { + return pBlock; + } else if (pBlock->info.type == STREAM_CHECKPOINT) { + pAggSup->stateStore.streamStateCommit(pAggSup->pState); + doStreamCountSaveCheckpoint(pOperator); + copyDataBlock(pInfo->pCheckpointRes, pBlock); + continue; + } else { + ASSERTS(pBlock->info.type == STREAM_NORMAL || pBlock->info.type == STREAM_INVALID, "invalid SSDataBlock type"); + } + + if (pInfo->scalarSupp.pExprInfo != NULL) { + SExprSupp* pExprSup = &pInfo->scalarSupp; + projectApplyFunctions(pExprSup->pExprInfo, pBlock, pBlock, pExprSup->pCtx, pExprSup->numOfExprs, NULL); + } + // the pDataBlock are always the same one, no need to call this again + setInputDataBlock(pSup, pBlock, TSDB_ORDER_ASC, MAIN_SCAN, true); + doStreamCountAggImpl(pOperator, pBlock, pInfo->pStUpdated, pInfo->pStDeleted); + pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, pBlock->info.window.ekey); + pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, pBlock->info.watermark); + } + // restore the value + pOperator->status = OP_RES_TO_RETURN; + + closeSessionWindow(pAggSup->pResultRows, &pInfo->twAggSup, pInfo->pStUpdated); + copyUpdateResult(&pInfo->pStUpdated, pInfo->pUpdated, sessionKeyCompareAsc); + removeSessionDeleteResults(pInfo->pStDeleted, pInfo->pUpdated); + initGroupResInfoFromArrayList(&pInfo->groupResInfo, pInfo->pUpdated); + pInfo->pUpdated = NULL; + blockDataEnsureCapacity(pInfo->binfo.pRes, pOperator->resultInfo.capacity); + + SSDataBlock* opRes = buildCountResult(pOperator); + if (opRes) { + return opRes; + } + + setStreamOperatorCompleted(pOperator); + return NULL; +} + +void streamCountReleaseState(SOperatorInfo* pOperator) { + SStreamEventAggOperatorInfo* pInfo = pOperator->info; + int32_t resSize = sizeof(TSKEY); + char* pBuff = taosMemoryCalloc(1, resSize); + memcpy(pBuff, &pInfo->twAggSup.maxTs, sizeof(TSKEY)); + qDebug("===stream=== count window operator relase state. "); + pInfo->streamAggSup.stateStore.streamStateSaveInfo(pInfo->streamAggSup.pState, STREAM_COUNT_OP_STATE_NAME, + strlen(STREAM_COUNT_OP_STATE_NAME), pBuff, resSize); + pInfo->streamAggSup.stateStore.streamStateCommit(pInfo->streamAggSup.pState); + taosMemoryFreeClear(pBuff); + SOperatorInfo* downstream = pOperator->pDownstream[0]; + if (downstream->fpSet.releaseStreamStateFn) { + downstream->fpSet.releaseStreamStateFn(downstream); + } +} + +void streamCountReloadState(SOperatorInfo* pOperator) { + SStreamCountAggOperatorInfo* pInfo = pOperator->info; + SStreamAggSupporter* pAggSup = &pInfo->streamAggSup; + int32_t size = 0; + void* pBuf = NULL; + + int32_t code = pAggSup->stateStore.streamStateGetInfo(pAggSup->pState, STREAM_COUNT_OP_STATE_NAME, + strlen(STREAM_COUNT_OP_STATE_NAME), &pBuf, &size); + TSKEY ts = *(TSKEY*)pBuf; + pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, ts); + taosMemoryFree(pBuf); + + SOperatorInfo* downstream = pOperator->pDownstream[0]; + if (downstream->fpSet.reloadStreamStateFn) { + downstream->fpSet.reloadStreamStateFn(downstream); + } + reloadAggSupFromDownStream(downstream, &pInfo->streamAggSup); +} + +SOperatorInfo* createStreamCountAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, + SExecTaskInfo* pTaskInfo, SReadHandle* pHandle) { + SCountWinodwPhysiNode* pCountNode = (SCountWinodwPhysiNode*)pPhyNode; + int32_t numOfCols = 0; + int32_t code = TSDB_CODE_OUT_OF_MEMORY; + SStreamCountAggOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SStreamCountAggOperatorInfo)); + SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); + if (pInfo == NULL || pOperator == NULL) { + goto _error; + } + + pOperator->pTaskInfo = pTaskInfo; + + initResultSizeInfo(&pOperator->resultInfo, 4096); + if (pCountNode->window.pExprs != NULL) { + int32_t numOfScalar = 0; + SExprInfo* pScalarExprInfo = createExprInfo(pCountNode->window.pExprs, NULL, &numOfScalar); + code = initExprSupp(&pInfo->scalarSupp, pScalarExprInfo, numOfScalar, &pTaskInfo->storageAPI.functionStore); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + } + SExprSupp* pExpSup = &pOperator->exprSupp; + + SExprInfo* pExprInfo = createExprInfo(pCountNode->window.pFuncs, NULL, &numOfCols); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pPhyNode->pOutputDataBlockDesc); + code = initBasicInfoEx(&pInfo->binfo, pExpSup, pExprInfo, numOfCols, pResBlock, &pTaskInfo->storageAPI.functionStore); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + + code = initStreamAggSupporter(&pInfo->streamAggSup, pExpSup, numOfCols, 0, + pTaskInfo->streamInfo.pState, sizeof(COUNT_TYPE), 0, &pTaskInfo->storageAPI.stateStore, pHandle, + &pInfo->twAggSup, GET_TASKID(pTaskInfo), &pTaskInfo->storageAPI); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + pInfo->streamAggSup.windowCount = pCountNode->windowCount; + pInfo->streamAggSup.windowSliding = pCountNode->windowSliding; + + pInfo->twAggSup = (STimeWindowAggSupp){ + .waterMark = pCountNode->window.watermark, + .calTrigger = pCountNode->window.triggerType, + .maxTs = INT64_MIN, + .minTs = INT64_MAX, + }; + + initExecTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pTaskInfo->window); + + pInfo->primaryTsIndex = ((SColumnNode*)pCountNode->window.pTspk)->slotId; + + pInfo->binfo.pRes = pResBlock; + _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); + pInfo->pStDeleted = tSimpleHashInit(64, hashFn); + pInfo->pDelIterator = NULL; + pInfo->pDelRes = createSpecialDataBlock(STREAM_DELETE_RESULT); + pInfo->ignoreExpiredData = pCountNode->window.igExpired; + pInfo->ignoreExpiredDataSaved = false; + pInfo->pUpdated = NULL; + pInfo->pStUpdated = NULL; + pInfo->dataVersion = 0; + pInfo->historyWins = taosArrayInit(4, sizeof(SSessionKey)); + if (!pInfo->historyWins) { + goto _error; + } + + pInfo->pCheckpointRes = createSpecialDataBlock(STREAM_CHECKPOINT); + pInfo->recvGetAll = false; + + pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT; + // for stream + void* buff = NULL; + int32_t len = 0; + int32_t res = + pInfo->streamAggSup.stateStore.streamStateGetInfo(pInfo->streamAggSup.pState, STREAM_COUNT_OP_CHECKPOINT_NAME, + strlen(STREAM_COUNT_OP_CHECKPOINT_NAME), &buff, &len); + if (res == TSDB_CODE_SUCCESS) { + doStreamCountDecodeOpState(buff, len, pOperator, true); + taosMemoryFree(buff); + } + setOperatorInfo(pOperator, getStreamOpName(pOperator->operatorType), QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT, true, + OP_NOT_OPENED, pInfo, pTaskInfo); + pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, doStreamCountAgg, NULL, destroyStreamCountAggOperatorInfo, + optrDefaultBufFn, NULL, optrDefaultGetNextExtFn, NULL); + setOperatorStreamStateFn(pOperator, streamCountReleaseState, streamCountReloadState); + + if (downstream) { + initDownStream(downstream, &pInfo->streamAggSup, pOperator->operatorType, pInfo->primaryTsIndex, &pInfo->twAggSup); + code = appendDownstream(pOperator, &downstream, 1); + } + return pOperator; + +_error: + if (pInfo != NULL) { + destroyStreamCountAggOperatorInfo(pInfo); + } + + taosMemoryFreeClear(pOperator); + pTaskInfo->code = code; + return NULL; +} + diff --git a/source/libs/executor/src/streamtimewindowoperator.c b/source/libs/executor/src/streamtimewindowoperator.c index b3f18d08ac..2838d005ab 100644 --- a/source/libs/executor/src/streamtimewindowoperator.c +++ b/source/libs/executor/src/streamtimewindowoperator.c @@ -1945,7 +1945,7 @@ int32_t doOneWindowAggImpl(SColumnInfoData* pTimeWindowData, SResultWindowInfo* return TSDB_CODE_SUCCESS; } -static bool doDeleteSessionWindow(SStreamAggSupporter* pAggSup, SSessionKey* pKey) { +bool doDeleteSessionWindow(SStreamAggSupporter* pAggSup, SSessionKey* pKey) { pAggSup->stateStore.streamStateSessionDel(pAggSup->pState, pKey); SSessionKey hashKey = {0}; getSessionHashKey(pKey, &hashKey); @@ -2343,7 +2343,7 @@ int32_t getAllSessionWindow(SSHashObj* pHashMap, SSHashObj* pStUpdated) { return TSDB_CODE_SUCCESS; } -static void copyDeleteWindowInfo(SArray* pResWins, SSHashObj* pStDeleted) { +void copyDeleteWindowInfo(SArray* pResWins, SSHashObj* pStDeleted) { int32_t size = taosArrayGetSize(pResWins); for (int32_t i = 0; i < size; i++) { SSessionKey* pWinKey = taosArrayGet(pResWins, i); diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index f559d90604..0ad454a8ee 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -329,6 +329,13 @@ static int32_t eventWindowNodeCopy(const SEventWindowNode* pSrc, SEventWindowNod return TSDB_CODE_SUCCESS; } +static int32_t countWindowNodeCopy(const SCountWindowNode* pSrc, SCountWindowNode* pDst) { + CLONE_NODE_FIELD(pCol); + COPY_SCALAR_FIELD(windowCount); + COPY_SCALAR_FIELD(windowSliding); + return TSDB_CODE_SUCCESS; +} + static int32_t sessionWindowNodeCopy(const SSessionWindowNode* pSrc, SSessionWindowNode* pDst) { CLONE_NODE_FIELD_EX(pCol, SColumnNode*); CLONE_NODE_FIELD_EX(pGap, SValueNode*); @@ -551,6 +558,8 @@ static int32_t logicWindowCopy(const SWindowLogicNode* pSrc, SWindowLogicNode* p COPY_SCALAR_FIELD(igExpired); COPY_SCALAR_FIELD(igCheckUpdate); COPY_SCALAR_FIELD(windowAlgo); + COPY_SCALAR_FIELD(windowCount); + COPY_SCALAR_FIELD(windowSliding); return TSDB_CODE_SUCCESS; } @@ -853,6 +862,9 @@ SNode* nodesCloneNode(const SNode* pNode) { case QUERY_NODE_EVENT_WINDOW: code = eventWindowNodeCopy((const SEventWindowNode*)pNode, (SEventWindowNode*)pDst); break; + case QUERY_NODE_COUNT_WINDOW: + code = countWindowNodeCopy((const SCountWindowNode*)pNode, (SCountWindowNode*)pDst); + break; case QUERY_NODE_SESSION_WINDOW: code = sessionWindowNodeCopy((const SSessionWindowNode*)pNode, (SSessionWindowNode*)pDst); break; diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 0e491c777d..28c7c511ed 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -91,6 +91,8 @@ const char* nodesNodeName(ENodeType type) { return "CaseWhen"; case QUERY_NODE_EVENT_WINDOW: return "EventWindow"; + case QUERY_NODE_COUNT_WINDOW: + return "CountWindow"; case QUERY_NODE_SET_OPERATOR: return "SetOperator"; case QUERY_NODE_SELECT_STMT: @@ -343,6 +345,10 @@ const char* nodesNodeName(ENodeType type) { return "PhysiMergeEventWindow"; case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: return "PhysiStreamEventWindow"; + case QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT: + return "PhysiMergeCountWindow"; + case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: + return "PhysiStreamCountWindow"; case QUERY_NODE_PHYSICAL_PLAN_PROJECT: return "PhysiProject"; case QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN: @@ -2745,6 +2751,36 @@ static int32_t jsonToPhysiEventWindowNode(const SJson* pJson, void* pObj) { return code; } +static const char* jkCountWindowPhysiPlanWindowCount = "WindowCount"; +static const char* jkCountWindowPhysiPlanWindowSliding = "WindowSliding"; + +static int32_t physiCountWindowNodeToJson(const void* pObj, SJson* pJson) { + const SCountWinodwPhysiNode* pNode = (const SCountWinodwPhysiNode*)pObj; + + int32_t code = physiWindowNodeToJson(pObj, pJson); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkCountWindowPhysiPlanWindowCount, pNode->windowCount); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkCountWindowPhysiPlanWindowSliding, pNode->windowSliding); + } + return code; +} + +static int32_t jsonToPhysiCountWindowNode(const SJson* pJson, void* pObj) { + SCountWinodwPhysiNode* pNode = (SCountWinodwPhysiNode*)pObj; + + int32_t code = jsonToPhysiWindowNode(pJson, pObj); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkCountWindowPhysiPlanWindowCount, &pNode->windowCount); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkCountWindowPhysiPlanWindowSliding, &pNode->windowSliding); + } + + return code; +} + static const char* jkPartitionPhysiPlanExprs = "Exprs"; static const char* jkPartitionPhysiPlanPartitionKeys = "PartitionKeys"; static const char* jkPartitionPhysiPlanTargets = "Targets"; @@ -4408,6 +4444,36 @@ static int32_t jsonToEventWindowNode(const SJson* pJson, void* pObj) { return code; } +static const char* jkCountWindowTsPrimaryKey = "CountTsPrimaryKey"; +static const char* jkCountWindowCount = "CountWindowCount"; +static const char* jkCountWindowSliding = "CountWindowSliding"; + +static int32_t countWindowNodeToJson(const void* pObj, SJson* pJson) { + const SCountWindowNode* pNode = (const SCountWindowNode*)pObj; + + int32_t code = tjsonAddObject(pJson, jkCountWindowTsPrimaryKey, nodeToJson, pNode->pCol); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkCountWindowCount, pNode->windowCount); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkCountWindowSliding, pNode->windowSliding); + } + return code; +} + +static int32_t jsonToCountWindowNode(const SJson* pJson, void* pObj) { + SCountWindowNode* pNode = (SCountWindowNode*)pObj; + + int32_t code = jsonToNodeObject(pJson, jkCountWindowTsPrimaryKey, &pNode->pCol); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkCountWindowCount, &pNode->windowCount); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkCountWindowSliding, &pNode->windowSliding); + } + return code; +} + static const char* jkIntervalWindowInterval = "Interval"; static const char* jkIntervalWindowOffset = "Offset"; static const char* jkIntervalWindowSliding = "Sliding"; @@ -6985,6 +7051,8 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return caseWhenNodeToJson(pObj, pJson); case QUERY_NODE_EVENT_WINDOW: return eventWindowNodeToJson(pObj, pJson); + case QUERY_NODE_COUNT_WINDOW: + return countWindowNodeToJson(pObj, pJson); case QUERY_NODE_SET_OPERATOR: return setOperatorToJson(pObj, pJson); case QUERY_NODE_SELECT_STMT: @@ -7224,6 +7292,9 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: return physiEventWindowNodeToJson(pObj, pJson); + case QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: + return physiCountWindowNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return physiPartitionNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: @@ -7317,6 +7388,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToCaseWhenNode(pJson, pObj); case QUERY_NODE_EVENT_WINDOW: return jsonToEventWindowNode(pJson, pObj); + case QUERY_NODE_COUNT_WINDOW: + return jsonToCountWindowNode(pJson, pObj); case QUERY_NODE_SET_OPERATOR: return jsonToSetOperator(pJson, pObj); case QUERY_NODE_SELECT_STMT: @@ -7564,6 +7637,9 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: return jsonToPhysiEventWindowNode(pJson, pObj); + case QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: + return jsonToPhysiCountWindowNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return jsonToPhysiPartitionNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: diff --git a/source/libs/nodes/src/nodesMsgFuncs.c b/source/libs/nodes/src/nodesMsgFuncs.c index cdbf87b8e3..2c8fb4141a 100644 --- a/source/libs/nodes/src/nodesMsgFuncs.c +++ b/source/libs/nodes/src/nodesMsgFuncs.c @@ -3210,6 +3210,46 @@ static int32_t msgToPhysiEventWindowNode(STlvDecoder* pDecoder, void* pObj) { return code; } +enum { PHY_COUNT_CODE_WINDOW = 1, PHY_COUNT_CODE_WINDOW_COUNT, PHY_COUNT_CODE_WINDOW_SLIDING }; + +static int32_t physiCountWindowNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { + const SCountWinodwPhysiNode* pNode = (const SCountWinodwPhysiNode*)pObj; + + int32_t code = tlvEncodeObj(pEncoder, PHY_COUNT_CODE_WINDOW, physiWindowNodeToMsg, &pNode->window); + if (TSDB_CODE_SUCCESS == code) { + code = tlvEncodeI64(pEncoder, PHY_COUNT_CODE_WINDOW_COUNT, pNode->windowCount); + } + if (TSDB_CODE_SUCCESS == code) { + code = tlvEncodeI64(pEncoder, PHY_COUNT_CODE_WINDOW_SLIDING, pNode->windowSliding); + } + + return code; +} + +static int32_t msgToPhysiCountWindowNode(STlvDecoder* pDecoder, void* pObj) { + SCountWinodwPhysiNode* pNode = (SCountWinodwPhysiNode*)pObj; + + int32_t code = TSDB_CODE_SUCCESS; + STlv* pTlv = NULL; + tlvForEach(pDecoder, pTlv, code) { + switch (pTlv->type) { + case PHY_COUNT_CODE_WINDOW: + code = tlvDecodeObjFromTlv(pTlv, msgToPhysiWindowNode, &pNode->window); + break; + case PHY_COUNT_CODE_WINDOW_COUNT: + code = tlvDecodeI64(pTlv, &pNode->windowCount); + break; + case PHY_COUNT_CODE_WINDOW_SLIDING: + code = tlvDecodeI64(pTlv, &pNode->windowSliding); + break; + default: + break; + } + } + + return code; +} + enum { PHY_PARTITION_CODE_BASE_NODE = 1, PHY_PARTITION_CODE_EXPR, @@ -4200,6 +4240,10 @@ static int32_t specificNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: code = physiEventWindowNodeToMsg(pObj, pEncoder); break; + case QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: + code = physiCountWindowNodeToMsg(pObj, pEncoder); + break; case QUERY_NODE_PHYSICAL_PLAN_PARTITION: code = physiPartitionNodeToMsg(pObj, pEncoder); break; @@ -4355,6 +4399,10 @@ static int32_t msgToSpecificNode(STlvDecoder* pDecoder, void* pObj) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: code = msgToPhysiEventWindowNode(pDecoder, pObj); break; + case QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: + code = msgToPhysiCountWindowNode(pDecoder, pObj); + break; case QUERY_NODE_PHYSICAL_PLAN_PARTITION: code = msgToPhysiPartitionNode(pDecoder, pObj); break; diff --git a/source/libs/nodes/src/nodesTraverseFuncs.c b/source/libs/nodes/src/nodesTraverseFuncs.c index 8b44e478c0..88bd475fb0 100644 --- a/source/libs/nodes/src/nodesTraverseFuncs.c +++ b/source/libs/nodes/src/nodesTraverseFuncs.c @@ -176,6 +176,11 @@ static EDealRes dispatchExpr(SNode* pNode, ETraversalOrder order, FNodeWalker wa } break; } + case QUERY_NODE_COUNT_WINDOW: { + SCountWindowNode* pEvent = (SCountWindowNode*)pNode; + res = walkExpr(pEvent->pCol, order, walker, pContext); + break; + } default: break; } @@ -367,6 +372,11 @@ static EDealRes rewriteExpr(SNode** pRawNode, ETraversalOrder order, FNodeRewrit } break; } + case QUERY_NODE_COUNT_WINDOW: { + SCountWindowNode* pEvent = (SCountWindowNode*)pNode; + res = rewriteExpr(&pEvent->pCol, order, rewriter, pContext); + break; + } default: break; } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index c9169c12fe..1bdcda3ddf 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -302,6 +302,8 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SCaseWhenNode)); case QUERY_NODE_EVENT_WINDOW: return makeNode(type, sizeof(SEventWindowNode)); + case QUERY_NODE_COUNT_WINDOW: + return makeNode(type, sizeof(SCountWindowNode)); case QUERY_NODE_HINT: return makeNode(type, sizeof(SHintNode)); case QUERY_NODE_VIEW: @@ -585,6 +587,10 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SEventWinodwPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: return makeNode(type, sizeof(SStreamEventWinodwPhysiNode)); + case QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT: + return makeNode(type, sizeof(SCountWinodwPhysiNode)); + case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: + return makeNode(type, sizeof(SStreamCountWinodwPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return makeNode(type, sizeof(SPartitionPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: @@ -850,6 +856,11 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pEvent->pEndCond); break; } + case QUERY_NODE_COUNT_WINDOW: { + SCountWindowNode* pEvent = (SCountWindowNode*)pNode; + nodesDestroyNode(pEvent->pCol); + break; + } case QUERY_NODE_HINT: { SHintNode* pHint = (SHintNode*)pNode; destroyHintValue(pHint->option, pHint->value); @@ -1427,6 +1438,12 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pPhyNode->pEndCond); break; } + case QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: { + SCountWinodwPhysiNode* pPhyNode = (SCountWinodwPhysiNode*)pNode; + destroyWinodwPhysiNode((SWindowPhysiNode*)pPhyNode); + break; + } case QUERY_NODE_PHYSICAL_PLAN_PARTITION: { destroyPartitionPhysiNode((SPartitionPhysiNode*)pNode); break; diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 8b45ed6f66..f13f9f1b96 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -131,6 +131,7 @@ SNode* createOrderByExprNode(SAstCreateContext* pCxt, SNode* pExpr, EOrder order SNode* createSessionWindowNode(SAstCreateContext* pCxt, SNode* pCol, SNode* pGap); SNode* createStateWindowNode(SAstCreateContext* pCxt, SNode* pExpr); SNode* createEventWindowNode(SAstCreateContext* pCxt, SNode* pStartCond, SNode* pEndCond); +SNode* createCountWindowNode(SAstCreateContext* pCxt, const SToken* pCountToken, const SToken* pSlidingToken); SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode* pOffset, SNode* pSliding, SNode* pFill); SNode* createFillNode(SAstCreateContext* pCxt, EFillMode mode, SNode* pValues); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index d607287af3..4c59f3abd7 100755 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -1159,6 +1159,10 @@ twindow_clause_opt(A) ::= sliding_opt(D) fill_opt(E). { A = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, B), releaseRawExprNode(pCxt, C), D, E); } twindow_clause_opt(A) ::= EVENT_WINDOW START WITH search_condition(B) END WITH search_condition(C). { A = createEventWindowNode(pCxt, B, C); } +twindow_clause_opt(A) ::= + COUNT_WINDOW NK_LP NK_INTEGER(B) NK_RP. { A = createCountWindowNode(pCxt, &B, &B); } +twindow_clause_opt(A) ::= + COUNT_WINDOW NK_LP NK_INTEGER(B) NK_COMMA NK_INTEGER(C) NK_RP. { A = createCountWindowNode(pCxt, &B, &C); } sliding_opt(A) ::= . { A = NULL; } sliding_opt(A) ::= SLIDING NK_LP interval_sliding_duration_literal(B) NK_RP. { A = releaseRawExprNode(pCxt, B); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 689153010a..f167fa04d7 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -883,6 +883,20 @@ SNode* createEventWindowNode(SAstCreateContext* pCxt, SNode* pStartCond, SNode* return (SNode*)pEvent; } +SNode* createCountWindowNode(SAstCreateContext* pCxt, const SToken* pCountToken, const SToken* pSlidingToken) { + CHECK_PARSER_STATUS(pCxt); + SCountWindowNode* pCount = (SCountWindowNode*)nodesMakeNode(QUERY_NODE_COUNT_WINDOW); + CHECK_OUT_OF_MEM(pCount); + pCount->pCol = createPrimaryKeyCol(pCxt, NULL); + if (NULL == pCount->pCol) { + nodesDestroyNode((SNode*)pCount); + CHECK_OUT_OF_MEM(NULL); + } + pCount->windowCount = taosStr2Int64(pCountToken->z, NULL, 10); + pCount->windowSliding = taosStr2Int64(pSlidingToken->z, NULL, 10); + return (SNode*)pCount; +} + SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode* pOffset, SNode* pSliding, SNode* pFill) { CHECK_PARSER_STATUS(pCxt); diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 0777835def..bb60cbdd7e 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -72,6 +72,7 @@ static SKeyword keywordTable[] = { {"CONSUMERS", TK_CONSUMERS}, {"CONTAINS", TK_CONTAINS}, {"COUNT", TK_COUNT}, + {"COUNT_WINDOW", TK_COUNT_WINDOW}, {"CREATE", TK_CREATE}, {"CURRENT_USER", TK_CURRENT_USER}, {"DATABASE", TK_DATABASE}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index c4c4b0824a..abe50a27da 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -4002,6 +4002,15 @@ static int32_t translateEventWindow(STranslateContext* pCxt, SSelectStmt* pSelec return TSDB_CODE_SUCCESS; } +static int32_t translateCountWindow(STranslateContext* pCxt, SSelectStmt* pSelect) { + if (QUERY_NODE_TEMP_TABLE == nodeType(pSelect->pFromTable) && + !isGlobalTimeLineQuery(((STempTableNode*)pSelect->pFromTable)->pSubquery)) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TIMELINE_QUERY, + "COUNT_WINDOW requires valid time series input"); + } + return TSDB_CODE_SUCCESS; +} + static int32_t translateSpecificWindow(STranslateContext* pCxt, SSelectStmt* pSelect) { switch (nodeType(pSelect->pWindow)) { case QUERY_NODE_STATE_WINDOW: @@ -4012,6 +4021,8 @@ static int32_t translateSpecificWindow(STranslateContext* pCxt, SSelectStmt* pSe return translateIntervalWindow(pCxt, pSelect); case QUERY_NODE_EVENT_WINDOW: return translateEventWindow(pCxt, pSelect); + case QUERY_NODE_COUNT_WINDOW: + return translateCountWindow(pCxt, pSelect); default: break; } @@ -7787,6 +7798,53 @@ static int32_t checkStreamQuery(STranslateContext* pCxt, SCreateStreamStmt* pStm return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY, "The trigger mode of non window query can only be AT_ONCE"); } + + if (pSelect->pWindow != NULL && pSelect->pWindow->type == QUERY_NODE_COUNT_WINDOW) { + if ( (SRealTableNode*)pSelect->pFromTable && ((SRealTableNode*)pSelect->pFromTable)->pMeta + && TSDB_SUPER_TABLE == ((SRealTableNode*)pSelect->pFromTable)->pMeta->tableType + && !hasPartitionByTbname(pSelect->pPartitionByList) ) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY, + "Count window for stream on super table must patitioned by table name"); + } + + int64_t watermark = 0; + if (pStmt->pOptions->pWatermark) { + translateValue(pCxt, (SValueNode*)pStmt->pOptions->pWatermark); + watermark =((SValueNode*)pStmt->pOptions->pWatermark)->datum.i; + } + if (watermark <= 0) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY, + "Watermark of Count window must exceed 0."); + } + + if (pStmt->pOptions->ignoreExpired != 1) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY, + "Ignore expired data of Count window must be 1."); + } + + SCountWindowNode* pCountWin = (SCountWindowNode*)pSelect->pWindow; + if (pCountWin->windowCount <= 1) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY, + "Size of Count window must exceed 1."); + } + + if (pCountWin->windowSliding <= 0) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY, + "Size of Count window must exceed 0."); + } + + if (pCountWin->windowSliding > pCountWin->windowCount) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY, + "sliding value no larger than the count value."); + } + + if (pCountWin->windowCount > INT32_MAX) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY, + "Size of Count window must less than 2147483647(INT32_MAX)."); + } + + } + return TSDB_CODE_SUCCESS; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 63159a10ae..9833c8151b 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -25,8 +25,6 @@ ** input grammar file: */ /************ Begin %include sections from the grammar ************************/ -#line 11 "sql.y" - #include #include #include @@ -42,7 +40,6 @@ #include "parAst.h" #define YYSTACKDEPTH 0 -#line 46 "sql.c" /**************** End of %include directives **********************************/ /* These constants specify the various numeric values for terminal symbols. ***************** Begin token definitions *************************************/ @@ -327,75 +324,76 @@ #define TK_SESSION 278 #define TK_STATE_WINDOW 279 #define TK_EVENT_WINDOW 280 -#define TK_SLIDING 281 -#define TK_FILL 282 -#define TK_VALUE 283 -#define TK_VALUE_F 284 -#define TK_NONE 285 -#define TK_PREV 286 -#define TK_NULL_F 287 -#define TK_LINEAR 288 -#define TK_NEXT 289 -#define TK_HAVING 290 -#define TK_RANGE 291 -#define TK_EVERY 292 -#define TK_ORDER 293 -#define TK_SLIMIT 294 -#define TK_SOFFSET 295 -#define TK_LIMIT 296 -#define TK_OFFSET 297 -#define TK_ASC 298 -#define TK_NULLS 299 -#define TK_ABORT 300 -#define TK_AFTER 301 -#define TK_ATTACH 302 -#define TK_BEFORE 303 -#define TK_BEGIN 304 -#define TK_BITAND 305 -#define TK_BITNOT 306 -#define TK_BITOR 307 -#define TK_BLOCKS 308 -#define TK_CHANGE 309 -#define TK_COMMA 310 -#define TK_CONCAT 311 -#define TK_CONFLICT 312 -#define TK_COPY 313 -#define TK_DEFERRED 314 -#define TK_DELIMITERS 315 -#define TK_DETACH 316 -#define TK_DIVIDE 317 -#define TK_DOT 318 -#define TK_EACH 319 -#define TK_FAIL 320 -#define TK_FILE 321 -#define TK_FOR 322 -#define TK_GLOB 323 -#define TK_ID 324 -#define TK_IMMEDIATE 325 -#define TK_IMPORT 326 -#define TK_INITIALLY 327 -#define TK_INSTEAD 328 -#define TK_ISNULL 329 -#define TK_KEY 330 -#define TK_MODULES 331 -#define TK_NK_BITNOT 332 -#define TK_NK_SEMI 333 -#define TK_NOTNULL 334 -#define TK_OF 335 -#define TK_PLUS 336 -#define TK_PRIVILEGE 337 -#define TK_RAISE 338 -#define TK_RESTRICT 339 -#define TK_ROW 340 -#define TK_SEMI 341 -#define TK_STAR 342 -#define TK_STATEMENT 343 -#define TK_STRICT 344 -#define TK_STRING 345 -#define TK_TIMES 346 -#define TK_VALUES 347 -#define TK_VARIABLE 348 -#define TK_WAL 349 +#define TK_COUNT_WINDOW 281 +#define TK_SLIDING 282 +#define TK_FILL 283 +#define TK_VALUE 284 +#define TK_VALUE_F 285 +#define TK_NONE 286 +#define TK_PREV 287 +#define TK_NULL_F 288 +#define TK_LINEAR 289 +#define TK_NEXT 290 +#define TK_HAVING 291 +#define TK_RANGE 292 +#define TK_EVERY 293 +#define TK_ORDER 294 +#define TK_SLIMIT 295 +#define TK_SOFFSET 296 +#define TK_LIMIT 297 +#define TK_OFFSET 298 +#define TK_ASC 299 +#define TK_NULLS 300 +#define TK_ABORT 301 +#define TK_AFTER 302 +#define TK_ATTACH 303 +#define TK_BEFORE 304 +#define TK_BEGIN 305 +#define TK_BITAND 306 +#define TK_BITNOT 307 +#define TK_BITOR 308 +#define TK_BLOCKS 309 +#define TK_CHANGE 310 +#define TK_COMMA 311 +#define TK_CONCAT 312 +#define TK_CONFLICT 313 +#define TK_COPY 314 +#define TK_DEFERRED 315 +#define TK_DELIMITERS 316 +#define TK_DETACH 317 +#define TK_DIVIDE 318 +#define TK_DOT 319 +#define TK_EACH 320 +#define TK_FAIL 321 +#define TK_FILE 322 +#define TK_FOR 323 +#define TK_GLOB 324 +#define TK_ID 325 +#define TK_IMMEDIATE 326 +#define TK_IMPORT 327 +#define TK_INITIALLY 328 +#define TK_INSTEAD 329 +#define TK_ISNULL 330 +#define TK_KEY 331 +#define TK_MODULES 332 +#define TK_NK_BITNOT 333 +#define TK_NK_SEMI 334 +#define TK_NOTNULL 335 +#define TK_OF 336 +#define TK_PLUS 337 +#define TK_PRIVILEGE 338 +#define TK_RAISE 339 +#define TK_RESTRICT 340 +#define TK_ROW 341 +#define TK_SEMI 342 +#define TK_STAR 343 +#define TK_STATEMENT 344 +#define TK_STRICT 345 +#define TK_STRING 346 +#define TK_TIMES 347 +#define TK_VALUES 348 +#define TK_VARIABLE 349 +#define TK_WAL 350 #endif /**************** End token definitions ***************************************/ @@ -455,29 +453,29 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 511 +#define YYNOCODE 512 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EOperatorType yy30; - EJoinType yy246; - int64_t yy277; - ENullOrder yy361; - STokenPair yy483; - SNode* yy490; - SNodeList* yy502; - SAlterOption yy529; - SToken yy561; - EShowKind yy579; - EFillMode yy718; - int32_t yy774; - SDataType yy826; - bool yy845; - EOrder yy876; - SShowTablesOption yy961; - int8_t yy1013; + STokenPair yy57; + int64_t yy221; + EOperatorType yy252; + EShowKind yy321; + bool yy345; + EFillMode yy358; + SNode* yy360; + SNodeList* yy536; + int32_t yy580; + ENullOrder yy585; + EJoinType yy596; + EOrder yy642; + int8_t yy695; + SAlterOption yy797; + SDataType yy912; + SToken yy929; + SShowTablesOption yy1005; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -493,18 +491,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 847 -#define YYNRULE 647 -#define YYNRULE_WITH_ACTION 647 -#define YYNTOKEN 350 -#define YY_MAX_SHIFT 846 -#define YY_MIN_SHIFTREDUCE 1249 -#define YY_MAX_SHIFTREDUCE 1895 -#define YY_ERROR_ACTION 1896 -#define YY_ACCEPT_ACTION 1897 -#define YY_NO_ACTION 1898 -#define YY_MIN_REDUCE 1899 -#define YY_MAX_REDUCE 2545 +#define YYNSTATE 852 +#define YYNRULE 649 +#define YYNRULE_WITH_ACTION 649 +#define YYNTOKEN 351 +#define YY_MAX_SHIFT 851 +#define YY_MIN_SHIFTREDUCE 1256 +#define YY_MAX_SHIFTREDUCE 1904 +#define YY_ERROR_ACTION 1905 +#define YY_ACCEPT_ACTION 1906 +#define YY_NO_ACTION 1907 +#define YY_MIN_REDUCE 1908 +#define YY_MAX_REDUCE 2556 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -571,879 +569,853 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (3083) +#define YY_ACTTAB_COUNT (2941) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 1922, 2323, 566, 2078, 467, 567, 1942, 14, 13, 466, - /* 10 */ 2176, 2306, 48, 46, 1819, 2331, 2521, 34, 412, 2516, - /* 20 */ 418, 1685, 1660, 41, 40, 2327, 171, 47, 45, 44, - /* 30 */ 43, 42, 2074, 646, 2091, 1745, 1985, 1658, 2520, 732, - /* 40 */ 2089, 699, 2517, 2519, 2516, 2347, 38, 321, 644, 583, - /* 50 */ 642, 270, 269, 2313, 674, 711, 146, 2516, 714, 137, - /* 60 */ 112, 674, 698, 203, 2516, 1740, 609, 2517, 700, 2329, - /* 70 */ 415, 19, 174, 2227, 1911, 2522, 203, 147, 1666, 742, - /* 80 */ 2517, 700, 2522, 203, 2227, 2081, 2365, 2517, 700, 41, - /* 90 */ 40, 2225, 719, 47, 45, 44, 43, 42, 2313, 411, - /* 100 */ 748, 586, 2224, 719, 843, 584, 2220, 15, 474, 818, - /* 110 */ 817, 816, 815, 430, 1788, 814, 813, 151, 808, 807, - /* 120 */ 806, 805, 804, 803, 802, 150, 796, 795, 794, 429, - /* 130 */ 428, 791, 790, 789, 183, 182, 788, 2065, 1315, 2346, - /* 140 */ 1314, 63, 2384, 1747, 1748, 114, 2348, 752, 2350, 2351, - /* 150 */ 747, 731, 742, 533, 531, 142, 367, 186, 574, 2437, - /* 160 */ 217, 567, 1942, 414, 2433, 301, 2445, 710, 571, 138, - /* 170 */ 709, 510, 2516, 1316, 568, 509, 184, 2142, 205, 2521, - /* 180 */ 1720, 1730, 2516, 508, 383, 657, 2467, 1746, 1749, 1861, - /* 190 */ 698, 203, 2140, 711, 146, 2517, 700, 1899, 385, 689, - /* 200 */ 2207, 2520, 1661, 63, 1659, 2517, 2518, 787, 196, 711, - /* 210 */ 146, 41, 40, 732, 2089, 47, 45, 44, 43, 42, - /* 220 */ 2129, 136, 135, 134, 133, 132, 131, 130, 129, 128, - /* 230 */ 731, 483, 2203, 208, 1664, 1665, 1717, 52, 1719, 1722, - /* 240 */ 1723, 1724, 1725, 1726, 1727, 1728, 1729, 744, 740, 1738, - /* 250 */ 1739, 1741, 1742, 1743, 1744, 2, 48, 46, 582, 2521, - /* 260 */ 1686, 365, 699, 1683, 418, 2516, 1660, 732, 2089, 99, - /* 270 */ 517, 238, 2347, 536, 377, 569, 1688, 1950, 535, 1745, - /* 280 */ 219, 1658, 693, 698, 203, 746, 273, 56, 2517, 700, - /* 290 */ 272, 695, 690, 683, 497, 451, 537, 465, 1688, 464, - /* 300 */ 1607, 366, 499, 202, 2445, 2446, 305, 144, 2450, 1740, - /* 310 */ 2365, 658, 477, 2365, 1685, 19, 1453, 51, 1774, 204, - /* 320 */ 2445, 2446, 1666, 144, 2450, 2313, 68, 748, 3, 463, - /* 330 */ 1444, 777, 776, 775, 1448, 774, 1450, 1451, 773, 770, - /* 340 */ 54, 1459, 767, 1461, 1462, 764, 761, 758, 843, 386, - /* 350 */ 1685, 15, 785, 161, 160, 782, 781, 780, 158, 98, - /* 360 */ 485, 1988, 372, 2452, 1885, 398, 2346, 648, 305, 2384, - /* 370 */ 2186, 692, 357, 2348, 752, 2350, 2351, 747, 745, 742, - /* 380 */ 733, 2402, 1775, 1579, 1580, 576, 2266, 1747, 1748, 2449, - /* 390 */ 2214, 2193, 1921, 524, 523, 522, 521, 516, 515, 514, - /* 400 */ 513, 369, 305, 711, 146, 503, 502, 501, 500, 494, - /* 410 */ 493, 492, 481, 487, 486, 384, 798, 732, 2089, 478, - /* 420 */ 1547, 1548, 173, 455, 1720, 1730, 1566, 1578, 1581, 63, - /* 430 */ 2028, 1746, 1749, 1298, 628, 627, 626, 137, 303, 1684, - /* 440 */ 731, 618, 143, 622, 614, 2313, 1661, 621, 1659, 184, - /* 450 */ 457, 453, 620, 625, 393, 392, 489, 2203, 619, 1685, - /* 460 */ 303, 615, 37, 416, 1769, 1770, 1771, 1772, 1773, 1777, - /* 470 */ 1778, 1779, 1780, 2208, 1559, 1560, 391, 390, 1664, 1665, - /* 480 */ 1717, 800, 1719, 1722, 1723, 1724, 1725, 1726, 1727, 1728, - /* 490 */ 1729, 744, 740, 1738, 1739, 1741, 1742, 1743, 1744, 2, - /* 500 */ 12, 48, 46, 2347, 739, 221, 2136, 2137, 2323, 418, - /* 510 */ 1721, 1660, 713, 201, 2445, 2446, 749, 144, 2450, 240, - /* 520 */ 159, 1686, 2080, 569, 1745, 1950, 1658, 51, 12, 36, - /* 530 */ 10, 2323, 2327, 95, 2347, 41, 40, 732, 2089, 47, - /* 540 */ 45, 44, 43, 42, 2365, 2332, 63, 714, 389, 388, - /* 550 */ 387, 611, 732, 2089, 1740, 2327, 2313, 471, 748, 2084, - /* 560 */ 19, 628, 627, 626, 732, 2089, 1718, 1666, 618, 143, - /* 570 */ 622, 694, 472, 613, 621, 2365, 2329, 612, 2520, 620, - /* 580 */ 625, 393, 392, 2142, 491, 619, 742, 2313, 615, 748, - /* 590 */ 399, 605, 604, 843, 305, 55, 15, 2346, 2140, 2329, - /* 600 */ 2384, 2347, 787, 114, 2348, 752, 2350, 2351, 747, 742, - /* 610 */ 742, 1318, 1319, 149, 749, 156, 2408, 2437, 9, 41, - /* 620 */ 40, 414, 2433, 47, 45, 44, 43, 42, 2346, 655, - /* 630 */ 1897, 2384, 1747, 1748, 114, 2348, 752, 2350, 2351, 747, - /* 640 */ 2275, 742, 2365, 1823, 1488, 1489, 186, 658, 2437, 1685, - /* 650 */ 519, 2203, 414, 2433, 2313, 127, 748, 1900, 126, 125, - /* 660 */ 124, 123, 122, 121, 120, 119, 118, 1766, 423, 1720, - /* 670 */ 1730, 2135, 2137, 1755, 2452, 2468, 1746, 1749, 127, 1685, - /* 680 */ 12, 126, 125, 124, 123, 122, 121, 120, 119, 118, - /* 690 */ 673, 1661, 305, 1659, 275, 2346, 732, 2089, 2384, 226, - /* 700 */ 2448, 114, 2348, 752, 2350, 2351, 747, 1920, 742, 433, - /* 710 */ 421, 305, 778, 2412, 432, 2437, 504, 159, 171, 414, - /* 720 */ 2433, 660, 2266, 1664, 1665, 1717, 2091, 1719, 1722, 1723, - /* 730 */ 1724, 1725, 1726, 1727, 1728, 1729, 744, 740, 1738, 1739, - /* 740 */ 1741, 1742, 1743, 1744, 2, 48, 46, 1750, 2347, 421, - /* 750 */ 427, 426, 635, 418, 1408, 1660, 1842, 168, 424, 674, - /* 760 */ 2313, 749, 2516, 1952, 400, 2091, 171, 647, 1745, 1407, - /* 770 */ 1658, 1843, 2140, 2160, 2091, 1667, 732, 2089, 2347, 106, - /* 780 */ 2522, 203, 95, 271, 1776, 2517, 700, 1717, 1315, 2365, - /* 790 */ 1314, 749, 1623, 2475, 223, 2142, 505, 1689, 1740, 638, - /* 800 */ 1396, 2313, 408, 748, 2082, 1892, 632, 630, 2085, 1721, - /* 810 */ 2140, 1666, 1841, 268, 47, 45, 44, 43, 42, 2365, - /* 820 */ 41, 40, 61, 1316, 47, 45, 44, 43, 42, 527, - /* 830 */ 671, 2313, 1689, 748, 1689, 90, 538, 843, 89, 1721, - /* 840 */ 49, 1398, 2346, 732, 2089, 2384, 2347, 1808, 114, 2348, - /* 850 */ 752, 2350, 2351, 747, 72, 742, 1660, 71, 1666, 749, - /* 860 */ 2536, 2488, 2437, 506, 35, 1718, 414, 2433, 702, 732, - /* 870 */ 2089, 1658, 2346, 1850, 1781, 2384, 1747, 1748, 114, 2348, - /* 880 */ 752, 2350, 2351, 747, 274, 742, 1919, 2365, 2066, 585, - /* 890 */ 2536, 228, 2437, 2142, 563, 1718, 414, 2433, 1816, 2313, - /* 900 */ 413, 748, 335, 561, 88, 2119, 557, 553, 2140, 1891, - /* 910 */ 732, 2089, 1666, 1720, 1730, 526, 227, 1918, 326, 1412, - /* 920 */ 1746, 1749, 686, 685, 1848, 1849, 1851, 1852, 1853, 2142, - /* 930 */ 2086, 1296, 512, 511, 1411, 1661, 422, 1659, 843, 2313, - /* 940 */ 2346, 613, 1670, 2384, 2140, 612, 114, 2348, 752, 2350, - /* 950 */ 2351, 747, 1917, 742, 1916, 1294, 1295, 1915, 2536, 194, - /* 960 */ 2437, 2076, 1628, 1629, 414, 2433, 2072, 1664, 1665, 1717, - /* 970 */ 2313, 1719, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, - /* 980 */ 744, 740, 1738, 1739, 1741, 1742, 1743, 1744, 2, 48, - /* 990 */ 46, 2347, 607, 606, 199, 2064, 198, 418, 734, 1660, - /* 1000 */ 2409, 540, 624, 623, 749, 2313, 681, 2313, 801, 2093, - /* 1010 */ 2313, 2050, 1745, 1690, 1658, 41, 40, 732, 2089, 47, - /* 1020 */ 45, 44, 43, 42, 785, 161, 160, 782, 781, 780, - /* 1030 */ 158, 171, 2365, 44, 43, 42, 1661, 276, 1659, 2092, - /* 1040 */ 30, 2452, 1740, 281, 2313, 1689, 748, 1914, 1690, 1685, - /* 1050 */ 1690, 312, 313, 41, 40, 1666, 311, 47, 45, 44, - /* 1060 */ 43, 42, 732, 2089, 1289, 1913, 2294, 2447, 1664, 1665, - /* 1070 */ 41, 40, 1910, 2347, 47, 45, 44, 43, 42, 732, - /* 1080 */ 2089, 843, 284, 1296, 49, 2346, 749, 148, 2384, 2347, - /* 1090 */ 2408, 114, 2348, 752, 2350, 2351, 747, 2142, 742, 717, - /* 1100 */ 2313, 703, 749, 2536, 2509, 2437, 1291, 1294, 1295, 414, - /* 1110 */ 2433, 736, 718, 2409, 2365, 1862, 812, 810, 2313, 402, - /* 1120 */ 1747, 1748, 2067, 732, 2089, 2313, 2313, 197, 748, 1909, - /* 1130 */ 2365, 785, 161, 160, 782, 781, 780, 158, 743, 2142, - /* 1140 */ 732, 2089, 2313, 316, 748, 76, 732, 2089, 2142, 732, - /* 1150 */ 2089, 732, 2089, 1835, 727, 152, 1908, 1720, 1730, 779, - /* 1160 */ 425, 1907, 2133, 2141, 1746, 1749, 729, 2346, 1815, 730, - /* 1170 */ 2384, 322, 2029, 358, 2348, 752, 2350, 2351, 747, 1661, - /* 1180 */ 742, 1659, 2313, 2346, 1906, 1905, 2384, 2457, 1808, 114, - /* 1190 */ 2348, 752, 2350, 2351, 747, 1912, 742, 87, 2307, 1904, - /* 1200 */ 653, 2536, 783, 2437, 1903, 2133, 1902, 414, 2433, 2313, - /* 1210 */ 285, 1664, 1665, 1717, 2313, 1719, 1722, 1723, 1724, 1725, - /* 1220 */ 1726, 1727, 1728, 1729, 744, 740, 1738, 1739, 1741, 1742, - /* 1230 */ 1743, 1744, 2, 48, 46, 139, 784, 2313, 2313, 2133, - /* 1240 */ 1972, 418, 616, 1660, 170, 1927, 838, 86, 674, 2297, - /* 1250 */ 674, 2516, 2313, 2516, 100, 2347, 1745, 2313, 1658, 2313, - /* 1260 */ 617, 1690, 629, 256, 261, 1718, 1393, 259, 749, 2522, - /* 1270 */ 203, 2522, 203, 1970, 2517, 700, 2517, 700, 263, 178, - /* 1280 */ 265, 262, 267, 264, 1391, 266, 1740, 1961, 603, 599, - /* 1290 */ 595, 591, 1959, 255, 210, 631, 2365, 41, 40, 1666, - /* 1300 */ 440, 47, 45, 44, 43, 42, 2481, 159, 2313, 633, - /* 1310 */ 748, 650, 706, 649, 636, 50, 50, 2334, 172, 187, - /* 1320 */ 1894, 1895, 1669, 341, 159, 843, 14, 13, 15, 50, - /* 1330 */ 310, 75, 2347, 298, 96, 687, 1668, 253, 1351, 659, - /* 1340 */ 339, 74, 157, 159, 73, 749, 66, 2456, 792, 2346, - /* 1350 */ 793, 141, 2384, 50, 368, 175, 2348, 752, 2350, 2351, - /* 1360 */ 747, 111, 742, 704, 1747, 1748, 236, 548, 546, 543, - /* 1370 */ 108, 292, 1370, 2365, 1368, 2336, 2026, 715, 2366, 1352, - /* 1380 */ 2025, 2212, 1626, 50, 1943, 2313, 2471, 748, 684, 674, - /* 1390 */ 1847, 1846, 2516, 404, 290, 691, 401, 675, 2478, 716, - /* 1400 */ 721, 1720, 1730, 243, 1576, 314, 724, 63, 1746, 1749, - /* 1410 */ 2522, 203, 252, 245, 1949, 2517, 700, 318, 1438, 250, - /* 1420 */ 580, 1782, 431, 1661, 2213, 1659, 2346, 674, 1731, 2384, - /* 1430 */ 2516, 1953, 114, 2348, 752, 2350, 2351, 747, 242, 742, - /* 1440 */ 756, 157, 2130, 159, 2536, 64, 2437, 140, 2522, 203, - /* 1450 */ 414, 2433, 157, 2517, 700, 1664, 1665, 1717, 334, 1719, - /* 1460 */ 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, 744, 740, - /* 1470 */ 1738, 1739, 1741, 1742, 1743, 1744, 2, 667, 2472, 297, - /* 1480 */ 2482, 427, 426, 836, 2347, 712, 304, 300, 2051, 1672, - /* 1490 */ 5, 1674, 439, 434, 84, 83, 470, 749, 381, 216, - /* 1500 */ 447, 1693, 448, 1671, 1745, 459, 1667, 458, 212, 214, - /* 1510 */ 461, 2347, 462, 460, 1600, 1466, 1470, 211, 1477, 329, - /* 1520 */ 1683, 475, 1475, 364, 749, 2365, 449, 162, 1684, 446, - /* 1530 */ 442, 438, 435, 463, 1740, 482, 225, 2313, 484, 748, - /* 1540 */ 488, 490, 529, 507, 495, 518, 2205, 1666, 520, 525, - /* 1550 */ 528, 530, 2365, 541, 542, 539, 231, 230, 544, 545, - /* 1560 */ 233, 547, 549, 1691, 2313, 564, 748, 4, 565, 572, - /* 1570 */ 573, 575, 305, 738, 241, 92, 707, 1686, 2346, 577, - /* 1580 */ 2347, 2384, 1692, 244, 114, 2348, 752, 2350, 2351, 747, - /* 1590 */ 578, 742, 1694, 749, 579, 1695, 2410, 581, 2437, 247, - /* 1600 */ 249, 587, 414, 2433, 2221, 2346, 93, 94, 2384, 254, - /* 1610 */ 608, 114, 2348, 752, 2350, 2351, 747, 639, 742, 640, - /* 1620 */ 116, 2365, 361, 735, 2284, 2437, 2281, 652, 610, 414, - /* 1630 */ 2433, 2079, 258, 2313, 654, 748, 2075, 260, 164, 165, - /* 1640 */ 2077, 97, 2073, 277, 166, 167, 153, 2280, 1687, 282, - /* 1650 */ 662, 330, 2267, 661, 663, 688, 280, 2487, 669, 722, - /* 1660 */ 8, 666, 678, 2486, 697, 676, 405, 679, 2459, 668, - /* 1670 */ 677, 1675, 2539, 1670, 2346, 179, 291, 2384, 708, 293, - /* 1680 */ 115, 2348, 752, 2350, 2351, 747, 287, 742, 296, 289, - /* 1690 */ 2515, 705, 294, 1808, 2437, 2347, 656, 299, 2436, 2433, - /* 1700 */ 295, 1688, 145, 1678, 1680, 1813, 1811, 1, 749, 2453, - /* 1710 */ 190, 306, 154, 720, 846, 725, 155, 740, 1738, 1739, - /* 1720 */ 1741, 1742, 1743, 1744, 2235, 2234, 331, 2347, 2233, 332, - /* 1730 */ 328, 726, 410, 105, 2090, 333, 2365, 62, 107, 2418, - /* 1740 */ 749, 336, 206, 324, 754, 1273, 193, 2134, 2313, 840, - /* 1750 */ 748, 837, 163, 842, 53, 834, 830, 826, 822, 360, - /* 1760 */ 325, 338, 2347, 373, 340, 345, 2305, 2304, 2365, 359, - /* 1770 */ 2303, 349, 374, 81, 2298, 749, 436, 437, 1651, 1652, - /* 1780 */ 2313, 209, 748, 441, 2296, 443, 444, 445, 1650, 2346, - /* 1790 */ 2295, 382, 2384, 2293, 450, 115, 2348, 752, 2350, 2351, - /* 1800 */ 747, 113, 742, 2365, 319, 2292, 452, 2291, 454, 2437, - /* 1810 */ 2290, 1639, 456, 737, 2433, 2313, 2271, 748, 213, 2270, - /* 1820 */ 215, 750, 82, 1603, 2384, 1602, 2248, 115, 2348, 752, - /* 1830 */ 2350, 2351, 747, 2247, 742, 2347, 728, 2246, 468, 469, - /* 1840 */ 2245, 2437, 2244, 473, 2195, 376, 2433, 1546, 749, 2192, - /* 1850 */ 476, 2191, 2185, 480, 479, 2182, 2346, 218, 2347, 2384, - /* 1860 */ 2181, 2180, 176, 2348, 752, 2350, 2351, 747, 85, 742, - /* 1870 */ 2179, 749, 2184, 220, 2183, 2178, 2365, 2177, 2347, 308, - /* 1880 */ 222, 496, 2172, 498, 2170, 2169, 307, 2175, 2313, 2174, - /* 1890 */ 748, 749, 2173, 2347, 2168, 2167, 2190, 2166, 2165, 2365, - /* 1900 */ 2164, 2188, 2171, 2163, 2162, 278, 749, 2161, 2159, 2158, - /* 1910 */ 2157, 2313, 2156, 748, 224, 2153, 701, 2537, 2155, 2365, - /* 1920 */ 2154, 91, 2152, 2151, 403, 2150, 2189, 2187, 2149, 2346, - /* 1930 */ 2148, 2313, 2384, 748, 2365, 115, 2348, 752, 2350, 2351, - /* 1940 */ 747, 1552, 742, 2147, 229, 2146, 2313, 532, 748, 2437, - /* 1950 */ 2145, 2144, 2346, 2143, 2434, 2384, 1409, 534, 175, 2348, - /* 1960 */ 752, 2350, 2351, 747, 1413, 742, 370, 371, 1991, 1405, - /* 1970 */ 232, 1990, 2346, 1989, 1987, 2384, 234, 1984, 358, 2348, - /* 1980 */ 752, 2350, 2351, 747, 550, 742, 235, 2346, 552, 2347, - /* 1990 */ 2384, 551, 1983, 351, 2348, 752, 2350, 2351, 747, 554, - /* 2000 */ 742, 2479, 749, 555, 1976, 556, 558, 559, 560, 1963, - /* 2010 */ 1938, 185, 562, 2333, 78, 237, 195, 1297, 1937, 239, - /* 2020 */ 2269, 2265, 79, 2255, 2243, 2347, 246, 248, 570, 2242, - /* 2030 */ 2365, 251, 2219, 2068, 1986, 1982, 588, 1344, 749, 696, - /* 2040 */ 589, 1980, 2313, 590, 748, 592, 593, 594, 1978, 596, - /* 2050 */ 1975, 597, 600, 598, 1958, 602, 1956, 2347, 601, 1957, - /* 2060 */ 1955, 1934, 2070, 65, 1482, 1481, 2365, 257, 2069, 1381, - /* 2070 */ 746, 409, 1973, 1395, 1394, 1392, 1390, 1389, 2313, 1388, - /* 2080 */ 748, 1387, 1386, 2346, 809, 811, 2384, 394, 1971, 176, - /* 2090 */ 2348, 752, 2350, 2351, 747, 1383, 742, 395, 2365, 1962, - /* 2100 */ 1382, 1380, 396, 1960, 397, 1933, 634, 637, 1932, 1931, - /* 2110 */ 2313, 641, 748, 1930, 643, 1929, 645, 117, 1633, 2346, - /* 2120 */ 1635, 1632, 2384, 2268, 1637, 358, 2348, 752, 2350, 2351, - /* 2130 */ 747, 57, 742, 29, 2347, 69, 2264, 58, 1613, 279, - /* 2140 */ 1611, 1609, 2254, 169, 2538, 283, 664, 749, 2241, 2240, - /* 2150 */ 2347, 2346, 20, 2521, 2384, 17, 31, 357, 2348, 752, - /* 2160 */ 2350, 2351, 747, 749, 742, 665, 2403, 1588, 2347, 1587, - /* 2170 */ 670, 6, 7, 21, 1864, 2365, 286, 672, 680, 682, - /* 2180 */ 417, 749, 200, 2334, 22, 189, 288, 2313, 33, 748, - /* 2190 */ 23, 2365, 67, 1845, 1834, 24, 419, 1884, 177, 188, - /* 2200 */ 32, 18, 80, 2313, 1885, 748, 1879, 1878, 406, 2365, - /* 2210 */ 1883, 1882, 407, 302, 1805, 1804, 60, 180, 2239, 2218, - /* 2220 */ 102, 2313, 309, 748, 101, 2217, 103, 59, 2346, 320, - /* 2230 */ 317, 2384, 25, 2347, 358, 2348, 752, 2350, 2351, 747, - /* 2240 */ 1840, 742, 191, 723, 2346, 315, 749, 2384, 70, 26, - /* 2250 */ 358, 2348, 752, 2350, 2351, 747, 13, 742, 1676, 108, - /* 2260 */ 104, 1757, 651, 11, 1756, 2384, 1735, 2347, 353, 2348, - /* 2270 */ 752, 2350, 2351, 747, 2365, 742, 181, 192, 1710, 2387, - /* 2280 */ 749, 755, 753, 741, 420, 1733, 2313, 1732, 748, 1767, - /* 2290 */ 2347, 1458, 39, 16, 27, 759, 1702, 28, 762, 1467, - /* 2300 */ 757, 765, 1464, 749, 760, 768, 1463, 763, 2365, 1460, - /* 2310 */ 766, 771, 1454, 769, 323, 1452, 751, 772, 1472, 109, - /* 2320 */ 2313, 110, 748, 1457, 1456, 1476, 1377, 2346, 77, 1342, - /* 2330 */ 2384, 2365, 1374, 343, 2348, 752, 2350, 2351, 747, 1455, - /* 2340 */ 742, 786, 1373, 2313, 1372, 748, 1371, 2347, 1369, 1367, - /* 2350 */ 1366, 1365, 797, 799, 1403, 1402, 207, 1363, 1362, 1361, - /* 2360 */ 749, 2346, 1360, 1359, 2384, 1358, 1357, 342, 2348, 752, - /* 2370 */ 2350, 2351, 747, 1397, 742, 1399, 1354, 1348, 1353, 1350, - /* 2380 */ 1349, 1347, 1981, 819, 2346, 820, 1979, 2384, 2365, 821, - /* 2390 */ 344, 2348, 752, 2350, 2351, 747, 823, 742, 825, 1977, - /* 2400 */ 2313, 824, 748, 827, 828, 829, 1974, 831, 832, 833, - /* 2410 */ 1954, 835, 1286, 1928, 1274, 327, 839, 841, 845, 1662, - /* 2420 */ 2347, 1898, 337, 844, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2430 */ 1898, 1898, 1898, 749, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2440 */ 2347, 2346, 1898, 1898, 2384, 1898, 1898, 350, 2348, 752, - /* 2450 */ 2350, 2351, 747, 749, 742, 1898, 1898, 1898, 1898, 1898, - /* 2460 */ 1898, 2365, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2470 */ 1898, 1898, 1898, 2313, 1898, 748, 1898, 1898, 1898, 1898, - /* 2480 */ 1898, 2365, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2490 */ 1898, 1898, 1898, 2313, 1898, 748, 1898, 1898, 2347, 1898, - /* 2500 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2510 */ 1898, 749, 1898, 2347, 2346, 1898, 1898, 2384, 1898, 1898, - /* 2520 */ 354, 2348, 752, 2350, 2351, 747, 749, 742, 1898, 1898, - /* 2530 */ 1898, 1898, 1898, 1898, 2346, 2347, 1898, 2384, 1898, 2365, - /* 2540 */ 346, 2348, 752, 2350, 2351, 747, 1898, 742, 749, 1898, - /* 2550 */ 1898, 2313, 1898, 748, 2365, 1898, 1898, 1898, 1898, 1898, - /* 2560 */ 1898, 1898, 1898, 1898, 1898, 1898, 2313, 1898, 748, 1898, - /* 2570 */ 1898, 1898, 1898, 1898, 1898, 1898, 2365, 1898, 1898, 1898, - /* 2580 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 2313, 1898, - /* 2590 */ 748, 1898, 2346, 2347, 1898, 2384, 1898, 1898, 355, 2348, - /* 2600 */ 752, 2350, 2351, 747, 1898, 742, 749, 2346, 2347, 1898, - /* 2610 */ 2384, 1898, 1898, 347, 2348, 752, 2350, 2351, 747, 1898, - /* 2620 */ 742, 749, 1898, 1898, 1898, 1898, 1898, 1898, 2347, 2346, - /* 2630 */ 1898, 1898, 2384, 1898, 2365, 356, 2348, 752, 2350, 2351, - /* 2640 */ 747, 749, 742, 1898, 1898, 1898, 2313, 1898, 748, 2365, - /* 2650 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2660 */ 1898, 2313, 1898, 748, 1898, 1898, 1898, 1898, 1898, 2365, - /* 2670 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2680 */ 1898, 2313, 1898, 748, 1898, 1898, 1898, 2346, 1898, 1898, - /* 2690 */ 2384, 1898, 1898, 348, 2348, 752, 2350, 2351, 747, 1898, - /* 2700 */ 742, 2347, 2346, 1898, 1898, 2384, 1898, 1898, 362, 2348, - /* 2710 */ 752, 2350, 2351, 747, 749, 742, 1898, 1898, 1898, 1898, - /* 2720 */ 1898, 2347, 2346, 1898, 1898, 2384, 1898, 1898, 363, 2348, - /* 2730 */ 752, 2350, 2351, 747, 749, 742, 1898, 1898, 2347, 1898, - /* 2740 */ 1898, 1898, 2365, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2750 */ 1898, 749, 1898, 1898, 2313, 1898, 748, 1898, 1898, 1898, - /* 2760 */ 1898, 1898, 2365, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2770 */ 1898, 1898, 1898, 1898, 2313, 1898, 748, 1898, 1898, 2365, - /* 2780 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2790 */ 1898, 2313, 1898, 748, 1898, 2346, 1898, 1898, 2384, 1898, - /* 2800 */ 1898, 2359, 2348, 752, 2350, 2351, 747, 2347, 742, 1898, - /* 2810 */ 1898, 1898, 1898, 1898, 1898, 2346, 1898, 1898, 2384, 1898, - /* 2820 */ 749, 2358, 2348, 752, 2350, 2351, 747, 1898, 742, 1898, - /* 2830 */ 1898, 1898, 2346, 1898, 1898, 2384, 1898, 1898, 2357, 2348, - /* 2840 */ 752, 2350, 2351, 747, 1898, 742, 1898, 1898, 2365, 1898, - /* 2850 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2860 */ 2313, 1898, 748, 1898, 1898, 2347, 1898, 1898, 1898, 1898, - /* 2870 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 749, 1898, - /* 2880 */ 2347, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2890 */ 1898, 1898, 1898, 749, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2900 */ 1898, 2346, 2347, 1898, 2384, 1898, 2365, 378, 2348, 752, - /* 2910 */ 2350, 2351, 747, 1898, 742, 749, 1898, 1898, 2313, 1898, - /* 2920 */ 748, 2365, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2930 */ 1898, 1898, 1898, 2313, 1898, 748, 1898, 1898, 1898, 1898, - /* 2940 */ 1898, 1898, 1898, 2365, 1898, 1898, 1898, 1898, 1898, 1898, - /* 2950 */ 1898, 1898, 1898, 1898, 1898, 2313, 1898, 748, 1898, 2346, - /* 2960 */ 2347, 1898, 2384, 1898, 1898, 379, 2348, 752, 2350, 2351, - /* 2970 */ 747, 1898, 742, 749, 2346, 2347, 1898, 2384, 1898, 1898, - /* 2980 */ 375, 2348, 752, 2350, 2351, 747, 1898, 742, 749, 1898, - /* 2990 */ 1898, 1898, 1898, 1898, 1898, 1898, 2346, 1898, 1898, 2384, - /* 3000 */ 1898, 2365, 380, 2348, 752, 2350, 2351, 747, 1898, 742, - /* 3010 */ 1898, 1898, 1898, 2313, 1898, 748, 2365, 1898, 1898, 1898, - /* 3020 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 2313, 1898, - /* 3030 */ 748, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 3040 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, - /* 3050 */ 1898, 1898, 1898, 1898, 750, 1898, 1898, 2384, 1898, 1898, - /* 3060 */ 353, 2348, 752, 2350, 2351, 747, 1898, 742, 1898, 2346, - /* 3070 */ 1898, 1898, 2384, 1898, 1898, 352, 2348, 752, 2350, 2351, - /* 3080 */ 747, 1898, 742, + /* 0 */ 95, 2332, 567, 2151, 468, 568, 1951, 14, 13, 467, + /* 10 */ 2185, 2315, 48, 46, 1826, 2340, 2532, 387, 723, 2527, + /* 20 */ 419, 699, 1667, 41, 40, 2336, 2093, 47, 45, 44, + /* 30 */ 43, 42, 174, 647, 1920, 1752, 1994, 1665, 2531, 737, + /* 40 */ 2098, 704, 2528, 2530, 2527, 2356, 38, 321, 645, 584, + /* 50 */ 643, 270, 269, 1696, 675, 716, 146, 2527, 719, 137, + /* 60 */ 112, 675, 703, 203, 2527, 1747, 610, 2528, 705, 2338, + /* 70 */ 416, 19, 739, 2236, 2418, 2533, 203, 147, 1673, 747, + /* 80 */ 2528, 705, 2533, 203, 2236, 2090, 2374, 2528, 705, 41, + /* 90 */ 40, 2234, 724, 47, 45, 44, 43, 42, 2322, 412, + /* 100 */ 753, 587, 2233, 724, 848, 585, 2229, 15, 475, 823, + /* 110 */ 822, 821, 820, 431, 1795, 819, 818, 151, 813, 812, + /* 120 */ 811, 810, 809, 808, 807, 150, 801, 800, 799, 430, + /* 130 */ 429, 796, 795, 794, 183, 182, 793, 2074, 1322, 2355, + /* 140 */ 1321, 63, 2393, 1754, 1755, 114, 2357, 757, 2359, 2360, + /* 150 */ 752, 1692, 747, 534, 532, 142, 367, 186, 575, 2446, + /* 160 */ 217, 568, 1951, 415, 2442, 301, 2454, 715, 572, 138, + /* 170 */ 714, 511, 2527, 1323, 569, 510, 184, 2151, 205, 2532, + /* 180 */ 1727, 1737, 2527, 509, 383, 736, 2476, 1753, 1756, 1870, + /* 190 */ 703, 203, 2149, 716, 146, 2528, 705, 1908, 385, 52, + /* 200 */ 2216, 2531, 1668, 63, 1666, 2528, 2529, 792, 196, 1901, + /* 210 */ 1692, 41, 40, 2145, 2146, 47, 45, 44, 43, 42, + /* 220 */ 2138, 136, 135, 134, 133, 132, 131, 130, 129, 128, + /* 230 */ 736, 484, 2212, 528, 1671, 1672, 1724, 1724, 1726, 1729, + /* 240 */ 1730, 1731, 1732, 1733, 1734, 1735, 1736, 749, 745, 1745, + /* 250 */ 1746, 1748, 1749, 1750, 1751, 2, 48, 46, 1325, 1326, + /* 260 */ 1693, 365, 704, 1690, 419, 2527, 1667, 428, 427, 1697, + /* 270 */ 518, 238, 2356, 537, 377, 570, 658, 1959, 536, 1752, + /* 280 */ 219, 1665, 223, 703, 203, 751, 273, 240, 2528, 705, + /* 290 */ 272, 570, 1674, 1959, 498, 228, 538, 466, 1696, 465, + /* 300 */ 698, 366, 500, 202, 2454, 2455, 305, 144, 2459, 1747, + /* 310 */ 1931, 659, 478, 2374, 1900, 19, 1460, 51, 1781, 527, + /* 320 */ 227, 452, 1673, 90, 274, 2322, 89, 753, 2374, 464, + /* 330 */ 1451, 782, 781, 780, 1455, 779, 1457, 1458, 778, 775, + /* 340 */ 583, 1466, 772, 1468, 1469, 769, 766, 763, 848, 386, + /* 350 */ 1693, 15, 790, 161, 160, 787, 786, 785, 158, 98, + /* 360 */ 486, 1997, 372, 2322, 305, 398, 2355, 649, 305, 2393, + /* 370 */ 1566, 1567, 357, 2357, 757, 2359, 2360, 752, 750, 747, + /* 380 */ 738, 2411, 1782, 1586, 1587, 577, 2275, 1754, 1755, 697, + /* 390 */ 2223, 2202, 88, 525, 524, 523, 522, 517, 516, 515, + /* 400 */ 514, 369, 1635, 1636, 1930, 504, 503, 502, 501, 495, + /* 410 */ 494, 493, 2532, 488, 487, 384, 184, 737, 2098, 479, + /* 420 */ 1554, 1555, 716, 146, 1727, 1737, 1573, 1585, 1588, 1695, + /* 430 */ 2461, 1753, 1756, 1695, 629, 628, 627, 137, 716, 146, + /* 440 */ 2217, 619, 143, 623, 615, 1305, 1668, 622, 1666, 456, + /* 450 */ 1696, 1691, 621, 626, 393, 392, 2458, 2322, 620, 1677, + /* 460 */ 194, 616, 37, 417, 1776, 1777, 1778, 1779, 1780, 1784, + /* 470 */ 1785, 1786, 1787, 1495, 1496, 792, 458, 454, 1671, 1672, + /* 480 */ 1724, 744, 1726, 1729, 1730, 1731, 1732, 1733, 1734, 1735, + /* 490 */ 1736, 749, 745, 1745, 1746, 1748, 1749, 1750, 1751, 2, + /* 500 */ 12, 48, 46, 2356, 1322, 2332, 1321, 736, 2531, 419, + /* 510 */ 2075, 1667, 422, 1823, 1697, 256, 754, 1894, 424, 2089, + /* 520 */ 168, 2144, 2146, 2151, 1752, 1929, 1665, 400, 2100, 2336, + /* 530 */ 399, 179, 204, 2454, 2455, 2149, 144, 2459, 2149, 1323, + /* 540 */ 604, 600, 596, 592, 2374, 255, 106, 718, 201, 2454, + /* 550 */ 2455, 1303, 144, 2459, 1747, 12, 2322, 2151, 753, 656, + /* 560 */ 19, 629, 628, 627, 409, 3, 694, 1673, 619, 143, + /* 570 */ 623, 2091, 2149, 2338, 622, 1301, 1302, 54, 2322, 621, + /* 580 */ 626, 393, 392, 747, 1859, 620, 96, 1692, 616, 253, + /* 590 */ 12, 303, 10, 848, 51, 303, 15, 2355, 737, 2098, + /* 600 */ 2393, 2356, 95, 114, 2357, 757, 2359, 2360, 752, 741, + /* 610 */ 747, 2418, 198, 149, 754, 156, 2417, 2446, 492, 41, + /* 620 */ 40, 415, 2442, 47, 45, 44, 43, 42, 2094, 2332, + /* 630 */ 1415, 1696, 1754, 1755, 691, 690, 1857, 1858, 1860, 1861, + /* 640 */ 1862, 1928, 2374, 2341, 1773, 1414, 790, 161, 160, 787, + /* 650 */ 786, 785, 158, 2336, 2322, 243, 753, 1909, 700, 695, + /* 660 */ 688, 684, 490, 2212, 252, 245, 1697, 520, 2212, 1727, + /* 670 */ 1737, 250, 581, 1927, 63, 659, 1753, 1756, 127, 68, + /* 680 */ 2303, 126, 125, 124, 123, 122, 121, 120, 119, 118, + /* 690 */ 242, 1668, 173, 1666, 2322, 2355, 806, 2338, 2393, 2059, + /* 700 */ 2037, 114, 2357, 757, 2359, 2360, 752, 747, 747, 564, + /* 710 */ 1926, 221, 539, 2421, 2316, 2446, 226, 1673, 562, 415, + /* 720 */ 2442, 558, 554, 1671, 1672, 1724, 2322, 1726, 1729, 1730, + /* 730 */ 1731, 1732, 1733, 1734, 1735, 1736, 749, 745, 1745, 1746, + /* 740 */ 1748, 1749, 1750, 1751, 2, 48, 46, 1757, 2356, 661, + /* 750 */ 2275, 737, 2098, 419, 2284, 1667, 654, 312, 313, 305, + /* 760 */ 159, 719, 311, 2322, 675, 1936, 843, 2527, 1752, 127, + /* 770 */ 1665, 208, 126, 125, 124, 123, 122, 121, 120, 119, + /* 780 */ 118, 2356, 63, 1822, 413, 2533, 203, 737, 2098, 2374, + /* 790 */ 2528, 705, 171, 199, 754, 2151, 1961, 326, 1747, 707, + /* 800 */ 2100, 2322, 414, 753, 737, 2098, 675, 56, 275, 2527, + /* 810 */ 2149, 1673, 41, 40, 2151, 422, 47, 45, 44, 43, + /* 820 */ 42, 423, 2374, 171, 472, 606, 605, 2533, 203, 2149, + /* 830 */ 425, 2100, 2528, 705, 2322, 55, 753, 848, 171, 305, + /* 840 */ 49, 9, 2355, 737, 2098, 2393, 2100, 1697, 114, 2357, + /* 850 */ 757, 2359, 2360, 752, 1925, 747, 2356, 1924, 783, 1667, + /* 860 */ 186, 1296, 2446, 473, 171, 1923, 415, 2442, 2461, 754, + /* 870 */ 737, 2098, 2101, 1922, 1665, 2355, 1754, 1755, 2393, 2073, + /* 880 */ 1303, 114, 2357, 757, 2359, 2360, 752, 1919, 747, 2477, + /* 890 */ 505, 636, 1830, 2547, 2457, 2446, 1762, 2374, 1692, 415, + /* 900 */ 2442, 197, 1692, 1298, 1301, 1302, 648, 2322, 210, 2322, + /* 910 */ 2322, 753, 1842, 1727, 1737, 1673, 737, 2098, 2322, 2306, + /* 920 */ 1753, 1756, 271, 41, 40, 1692, 2322, 47, 45, 44, + /* 930 */ 43, 42, 44, 43, 42, 1668, 506, 1666, 639, 1851, + /* 940 */ 2322, 848, 674, 625, 624, 633, 631, 305, 30, 2151, + /* 950 */ 2355, 1403, 268, 2393, 1852, 660, 176, 2357, 757, 2359, + /* 960 */ 2360, 752, 2087, 747, 732, 608, 607, 1671, 1672, 1724, + /* 970 */ 441, 1726, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, + /* 980 */ 749, 745, 1745, 1746, 1748, 1749, 1750, 1751, 2, 48, + /* 990 */ 46, 2083, 1405, 72, 1918, 1850, 71, 419, 1917, 1667, + /* 1000 */ 47, 45, 44, 43, 42, 675, 1916, 1915, 2527, 2085, + /* 1010 */ 706, 2548, 1752, 2151, 1665, 790, 161, 160, 787, 786, + /* 1020 */ 785, 158, 1914, 1871, 1913, 2356, 2533, 203, 2150, 41, + /* 1030 */ 40, 2528, 705, 47, 45, 44, 43, 42, 754, 1668, + /* 1040 */ 2484, 1666, 1747, 1783, 737, 2098, 1692, 2322, 2356, 737, + /* 1050 */ 2098, 2322, 1419, 737, 2098, 1673, 737, 2098, 1728, 2322, + /* 1060 */ 2322, 754, 1728, 2497, 507, 148, 2374, 1418, 2417, 586, + /* 1070 */ 1815, 1671, 1672, 2095, 61, 2322, 276, 2322, 2322, 76, + /* 1080 */ 753, 848, 672, 2356, 49, 1728, 614, 41, 40, 2374, + /* 1090 */ 613, 47, 45, 44, 43, 42, 754, 708, 686, 34, + /* 1100 */ 2169, 2322, 2081, 753, 784, 41, 40, 2142, 1912, 47, + /* 1110 */ 45, 44, 43, 42, 1725, 737, 2098, 803, 1725, 2355, + /* 1120 */ 1754, 1755, 2393, 35, 2374, 114, 2357, 757, 2359, 2360, + /* 1130 */ 752, 87, 747, 1788, 541, 284, 2322, 2547, 753, 2446, + /* 1140 */ 711, 1725, 2355, 415, 2442, 2393, 1981, 99, 114, 2357, + /* 1150 */ 757, 2359, 2360, 752, 2195, 747, 1911, 1727, 1737, 1676, + /* 1160 */ 2547, 2322, 2446, 1675, 1753, 1756, 415, 2442, 630, 737, + /* 1170 */ 2098, 737, 2098, 788, 737, 2098, 2142, 2355, 1614, 1668, + /* 1180 */ 2393, 1666, 805, 114, 2357, 757, 2359, 2360, 752, 322, + /* 1190 */ 747, 722, 720, 36, 316, 2547, 482, 2446, 139, 41, + /* 1200 */ 40, 415, 2442, 47, 45, 44, 43, 42, 2102, 2322, + /* 1210 */ 86, 1671, 1672, 1724, 281, 1726, 1729, 1730, 1731, 1732, + /* 1220 */ 1733, 1734, 1735, 1736, 749, 745, 1745, 1746, 1748, 1749, + /* 1230 */ 1750, 1751, 2, 48, 46, 391, 390, 737, 2098, 2461, + /* 1240 */ 2076, 419, 675, 1667, 159, 2527, 737, 2098, 817, 815, + /* 1250 */ 737, 2098, 789, 2466, 1815, 2142, 1752, 734, 1665, 513, + /* 1260 */ 512, 170, 1725, 2533, 203, 2456, 735, 159, 2528, 705, + /* 1270 */ 426, 335, 261, 152, 2128, 259, 2356, 263, 265, 617, + /* 1280 */ 262, 264, 267, 1979, 1970, 266, 1747, 618, 682, 754, + /* 1290 */ 1968, 2520, 651, 285, 650, 2343, 50, 50, 1921, 1673, + /* 1300 */ 1903, 1904, 748, 1400, 1358, 632, 634, 389, 388, 187, + /* 1310 */ 612, 1398, 637, 14, 13, 2038, 2490, 2374, 172, 1630, + /* 1320 */ 298, 159, 50, 341, 310, 848, 1679, 797, 15, 2322, + /* 1330 */ 1678, 753, 614, 692, 2356, 75, 613, 100, 292, 157, + /* 1340 */ 339, 74, 1633, 159, 73, 1359, 66, 754, 141, 2465, + /* 1350 */ 111, 1377, 50, 2345, 368, 50, 2375, 761, 157, 108, + /* 1360 */ 709, 798, 2035, 1846, 1754, 1755, 236, 549, 547, 544, + /* 1370 */ 2355, 1856, 1855, 2393, 159, 2374, 114, 2357, 757, 2359, + /* 1380 */ 2360, 752, 2034, 747, 290, 1375, 2221, 2322, 2547, 753, + /* 1390 */ 2446, 1962, 1952, 2480, 415, 2442, 721, 1583, 689, 314, + /* 1400 */ 405, 1727, 1737, 140, 157, 712, 696, 63, 1753, 1756, + /* 1410 */ 729, 401, 432, 2222, 318, 1958, 2139, 2481, 1445, 726, + /* 1420 */ 2491, 1789, 668, 1668, 717, 1666, 300, 1738, 2355, 297, + /* 1430 */ 334, 2393, 1473, 1477, 114, 2357, 757, 2359, 2360, 752, + /* 1440 */ 2060, 747, 304, 841, 5, 64, 2547, 435, 2446, 1484, + /* 1450 */ 440, 381, 415, 2442, 448, 1671, 1672, 1724, 449, 1726, + /* 1460 */ 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 749, 745, + /* 1470 */ 1745, 1746, 1748, 1749, 1750, 1751, 2, 1700, 1482, 162, + /* 1480 */ 460, 428, 427, 211, 2356, 459, 212, 462, 214, 329, + /* 1490 */ 1690, 1681, 1607, 476, 84, 83, 471, 754, 1691, 216, + /* 1500 */ 483, 225, 485, 489, 1752, 491, 1674, 2356, 530, 496, + /* 1510 */ 508, 2214, 463, 461, 519, 521, 526, 543, 529, 531, + /* 1520 */ 754, 542, 540, 364, 231, 2374, 450, 230, 545, 447, + /* 1530 */ 443, 439, 436, 464, 1747, 1698, 1906, 2322, 546, 753, + /* 1540 */ 233, 548, 2356, 550, 4, 565, 566, 1673, 2374, 573, + /* 1550 */ 574, 576, 1693, 241, 92, 754, 244, 578, 1699, 1701, + /* 1560 */ 2322, 579, 753, 580, 247, 582, 1702, 249, 588, 93, + /* 1570 */ 94, 609, 305, 743, 2230, 254, 640, 611, 2355, 2088, + /* 1580 */ 116, 2393, 641, 2374, 114, 2357, 757, 2359, 2360, 752, + /* 1590 */ 361, 747, 97, 258, 2084, 2322, 2419, 753, 2446, 260, + /* 1600 */ 164, 2355, 415, 2442, 2393, 165, 653, 114, 2357, 757, + /* 1610 */ 2359, 2360, 752, 2086, 747, 434, 2293, 2082, 166, 740, + /* 1620 */ 433, 2446, 167, 2290, 2289, 415, 2442, 277, 1694, 663, + /* 1630 */ 662, 282, 693, 667, 669, 670, 2355, 679, 727, 2393, + /* 1640 */ 664, 2356, 115, 2357, 757, 2359, 2360, 752, 8, 747, + /* 1650 */ 330, 153, 655, 280, 754, 2496, 2446, 287, 289, 702, + /* 1660 */ 2445, 2442, 2495, 677, 2468, 675, 291, 2276, 2527, 680, + /* 1670 */ 293, 1682, 2356, 1677, 678, 296, 713, 406, 710, 1815, + /* 1680 */ 1695, 2526, 2374, 145, 1820, 754, 2533, 203, 2462, 190, + /* 1690 */ 1818, 2528, 705, 306, 2322, 331, 753, 332, 730, 2356, + /* 1700 */ 154, 725, 294, 1685, 1687, 2244, 2243, 731, 2242, 155, + /* 1710 */ 411, 178, 754, 2374, 333, 105, 62, 745, 1745, 1746, + /* 1720 */ 1748, 1749, 1750, 1751, 295, 2322, 2099, 753, 1, 206, + /* 1730 */ 2427, 107, 759, 299, 336, 2355, 324, 2143, 2393, 1280, + /* 1740 */ 2374, 115, 2357, 757, 2359, 2360, 752, 842, 747, 2550, + /* 1750 */ 845, 847, 2322, 163, 753, 2446, 345, 2356, 360, 742, + /* 1760 */ 2442, 373, 53, 374, 359, 340, 755, 349, 2314, 2393, + /* 1770 */ 754, 338, 115, 2357, 757, 2359, 2360, 752, 2313, 747, + /* 1780 */ 2312, 81, 2307, 437, 438, 1658, 2446, 1659, 209, 442, + /* 1790 */ 376, 2442, 2356, 2355, 2305, 444, 2393, 445, 2374, 175, + /* 1800 */ 2357, 757, 2359, 2360, 752, 754, 747, 446, 1657, 2304, + /* 1810 */ 2322, 382, 753, 2302, 451, 2301, 453, 2300, 455, 2299, + /* 1820 */ 457, 1646, 2356, 213, 2279, 215, 1610, 82, 1609, 2257, + /* 1830 */ 2256, 2255, 469, 2374, 2280, 754, 470, 2254, 2253, 2204, + /* 1840 */ 474, 676, 2487, 2201, 1553, 2322, 2200, 753, 477, 2194, + /* 1850 */ 481, 2355, 2191, 480, 2393, 218, 2190, 115, 2357, 757, + /* 1860 */ 2359, 2360, 752, 2374, 747, 85, 2189, 2188, 403, 2193, + /* 1870 */ 220, 2446, 2192, 2187, 2186, 2322, 2443, 753, 2184, 2183, + /* 1880 */ 2182, 222, 497, 2181, 499, 2179, 2355, 2356, 2178, 2393, + /* 1890 */ 2177, 2176, 175, 2357, 757, 2359, 2360, 752, 91, 747, + /* 1900 */ 754, 2199, 2356, 2175, 2174, 2173, 2197, 2180, 2172, 2171, + /* 1910 */ 2170, 2168, 2167, 2166, 2165, 754, 2355, 2356, 1559, 2393, + /* 1920 */ 2164, 2163, 358, 2357, 757, 2359, 2360, 752, 2374, 747, + /* 1930 */ 754, 224, 2162, 404, 229, 2488, 2161, 2160, 2159, 2198, + /* 1940 */ 2322, 2196, 753, 2374, 2158, 2157, 2156, 2155, 533, 2154, + /* 1950 */ 535, 2153, 2152, 1416, 2000, 2322, 1412, 753, 2374, 232, + /* 1960 */ 1999, 1998, 1420, 1996, 234, 370, 371, 235, 1993, 553, + /* 1970 */ 2322, 1992, 753, 552, 556, 557, 1985, 560, 1972, 551, + /* 1980 */ 555, 2355, 1947, 185, 2393, 559, 1304, 358, 2357, 757, + /* 1990 */ 2359, 2360, 752, 563, 747, 561, 2355, 2356, 1946, 2393, + /* 2000 */ 237, 78, 351, 2357, 757, 2359, 2360, 752, 239, 747, + /* 2010 */ 754, 2355, 79, 2342, 2393, 2356, 195, 176, 2357, 757, + /* 2020 */ 2359, 2360, 752, 571, 747, 2278, 2274, 2264, 751, 246, + /* 2030 */ 2251, 2228, 248, 251, 2077, 1995, 1991, 589, 2374, 2252, + /* 2040 */ 2356, 1351, 1989, 410, 590, 591, 593, 594, 701, 595, + /* 2050 */ 2322, 1987, 753, 754, 597, 598, 2374, 599, 1984, 601, + /* 2060 */ 603, 602, 1967, 1965, 1966, 1964, 1943, 2079, 2322, 1489, + /* 2070 */ 753, 2078, 2549, 65, 1488, 257, 1388, 1402, 1401, 1982, + /* 2080 */ 1399, 2374, 1397, 1396, 1395, 1394, 418, 1393, 814, 816, + /* 2090 */ 1390, 2355, 394, 2322, 2393, 753, 1389, 358, 2357, 757, + /* 2100 */ 2359, 2360, 752, 1980, 747, 1387, 395, 1971, 396, 2355, + /* 2110 */ 2356, 1969, 2393, 635, 657, 357, 2357, 757, 2359, 2360, + /* 2120 */ 752, 397, 747, 754, 2412, 638, 1942, 1941, 1940, 642, + /* 2130 */ 1939, 644, 851, 1938, 2355, 117, 646, 2393, 1640, 1642, + /* 2140 */ 358, 2357, 757, 2359, 2360, 752, 2356, 747, 328, 1639, + /* 2150 */ 2277, 2374, 1644, 279, 2273, 57, 420, 58, 1616, 754, + /* 2160 */ 1618, 2263, 665, 2322, 193, 753, 1620, 666, 29, 2250, + /* 2170 */ 2249, 169, 1595, 839, 835, 831, 827, 2356, 325, 69, + /* 2180 */ 283, 671, 2532, 1594, 20, 31, 673, 2374, 1873, 286, + /* 2190 */ 754, 1847, 681, 402, 17, 6, 683, 7, 685, 2322, + /* 2200 */ 687, 753, 200, 288, 2355, 21, 22, 2393, 1854, 189, + /* 2210 */ 358, 2357, 757, 2359, 2360, 752, 177, 747, 2374, 113, + /* 2220 */ 2343, 33, 319, 188, 32, 67, 1841, 80, 24, 1888, + /* 2230 */ 2322, 1893, 753, 1894, 1887, 407, 1892, 1891, 408, 1812, + /* 2240 */ 652, 60, 1811, 2393, 2248, 302, 353, 2357, 757, 2359, + /* 2250 */ 2360, 752, 2356, 747, 733, 180, 23, 18, 59, 2227, + /* 2260 */ 102, 728, 2226, 103, 101, 754, 25, 26, 108, 317, + /* 2270 */ 309, 2355, 2356, 1849, 2393, 191, 320, 343, 2357, 757, + /* 2280 */ 2359, 2360, 752, 1764, 747, 754, 1763, 315, 2356, 70, + /* 2290 */ 104, 1683, 13, 2374, 11, 1742, 2396, 308, 746, 181, + /* 2300 */ 39, 754, 1740, 1774, 307, 2322, 192, 753, 1717, 323, + /* 2310 */ 1739, 16, 27, 2374, 756, 1709, 28, 760, 1474, 421, + /* 2320 */ 758, 762, 764, 278, 1471, 2322, 765, 753, 1470, 2374, + /* 2330 */ 767, 768, 770, 1467, 1461, 771, 773, 774, 776, 1459, + /* 2340 */ 777, 2322, 1483, 753, 109, 2356, 2355, 110, 77, 2393, + /* 2350 */ 1479, 1465, 342, 2357, 757, 2359, 2360, 752, 754, 747, + /* 2360 */ 1464, 1384, 791, 1463, 1462, 2356, 2355, 1381, 1349, 2393, + /* 2370 */ 1380, 1379, 344, 2357, 757, 2359, 2360, 752, 754, 747, + /* 2380 */ 1378, 1376, 2355, 2356, 1374, 2393, 2374, 1373, 350, 2357, + /* 2390 */ 757, 2359, 2360, 752, 1372, 747, 754, 1410, 2322, 802, + /* 2400 */ 753, 1409, 207, 2356, 804, 1370, 2374, 1369, 1368, 1367, + /* 2410 */ 1366, 1365, 1364, 1406, 1404, 1361, 754, 1360, 2322, 1357, + /* 2420 */ 753, 1355, 1356, 1354, 2374, 1990, 824, 825, 1988, 828, + /* 2430 */ 826, 1986, 829, 830, 832, 834, 2322, 1983, 753, 2355, + /* 2440 */ 836, 2356, 2393, 838, 2374, 354, 2357, 757, 2359, 2360, + /* 2450 */ 752, 833, 747, 837, 754, 1963, 2322, 840, 753, 2355, + /* 2460 */ 1293, 1937, 2393, 1281, 846, 346, 2357, 757, 2359, 2360, + /* 2470 */ 752, 844, 747, 327, 1669, 337, 850, 2355, 2356, 849, + /* 2480 */ 2393, 1907, 2374, 355, 2357, 757, 2359, 2360, 752, 1907, + /* 2490 */ 747, 754, 1907, 1907, 2322, 1907, 753, 2355, 2356, 1907, + /* 2500 */ 2393, 1907, 1907, 347, 2357, 757, 2359, 2360, 752, 1907, + /* 2510 */ 747, 754, 1907, 1907, 2356, 1907, 1907, 1907, 1907, 2374, + /* 2520 */ 1907, 1907, 1907, 1907, 1907, 1907, 1907, 754, 1907, 1907, + /* 2530 */ 1907, 2322, 1907, 753, 1907, 2355, 1907, 1907, 2393, 2374, + /* 2540 */ 1907, 356, 2357, 757, 2359, 2360, 752, 1907, 747, 1907, + /* 2550 */ 1907, 2322, 1907, 753, 1907, 2374, 1907, 1907, 1907, 1907, + /* 2560 */ 1907, 1907, 1907, 1907, 1907, 1907, 1907, 2322, 1907, 753, + /* 2570 */ 1907, 1907, 2355, 1907, 1907, 2393, 1907, 1907, 348, 2357, + /* 2580 */ 757, 2359, 2360, 752, 1907, 747, 1907, 1907, 1907, 1907, + /* 2590 */ 1907, 1907, 2355, 1907, 1907, 2393, 1907, 1907, 362, 2357, + /* 2600 */ 757, 2359, 2360, 752, 1907, 747, 1907, 2356, 2355, 1907, + /* 2610 */ 1907, 2393, 1907, 1907, 363, 2357, 757, 2359, 2360, 752, + /* 2620 */ 754, 747, 1907, 1907, 1907, 1907, 2356, 1907, 1907, 1907, + /* 2630 */ 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 754, + /* 2640 */ 1907, 1907, 1907, 2356, 1907, 1907, 1907, 1907, 2374, 1907, + /* 2650 */ 1907, 1907, 1907, 1907, 1907, 1907, 754, 1907, 1907, 1907, + /* 2660 */ 2322, 1907, 753, 1907, 1907, 1907, 1907, 2374, 1907, 1907, + /* 2670 */ 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 2322, + /* 2680 */ 1907, 753, 1907, 1907, 2374, 1907, 1907, 1907, 1907, 1907, + /* 2690 */ 1907, 1907, 1907, 1907, 1907, 1907, 2322, 1907, 753, 1907, + /* 2700 */ 2356, 2355, 1907, 1907, 2393, 1907, 1907, 2368, 2357, 757, + /* 2710 */ 2359, 2360, 752, 754, 747, 1907, 1907, 1907, 1907, 1907, + /* 2720 */ 2355, 2356, 1907, 2393, 1907, 1907, 2367, 2357, 757, 2359, + /* 2730 */ 2360, 752, 1907, 747, 754, 1907, 1907, 2355, 2356, 1907, + /* 2740 */ 2393, 2374, 1907, 2366, 2357, 757, 2359, 2360, 752, 1907, + /* 2750 */ 747, 754, 1907, 2322, 1907, 753, 1907, 1907, 2356, 1907, + /* 2760 */ 1907, 1907, 2374, 1907, 1907, 1907, 1907, 1907, 1907, 1907, + /* 2770 */ 1907, 754, 1907, 1907, 2322, 1907, 753, 1907, 1907, 2374, + /* 2780 */ 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, + /* 2790 */ 1907, 2322, 1907, 753, 2355, 1907, 2356, 2393, 1907, 2374, + /* 2800 */ 378, 2357, 757, 2359, 2360, 752, 1907, 747, 1907, 754, + /* 2810 */ 1907, 2322, 1907, 753, 1907, 2355, 1907, 1907, 2393, 1907, + /* 2820 */ 1907, 379, 2357, 757, 2359, 2360, 752, 1907, 747, 1907, + /* 2830 */ 1907, 1907, 2355, 2356, 1907, 2393, 1907, 2374, 375, 2357, + /* 2840 */ 757, 2359, 2360, 752, 1907, 747, 754, 1907, 1907, 2322, + /* 2850 */ 1907, 753, 2355, 1907, 1907, 2393, 1907, 1907, 380, 2357, + /* 2860 */ 757, 2359, 2360, 752, 1907, 747, 1907, 1907, 1907, 1907, + /* 2870 */ 1907, 1907, 1907, 1907, 2374, 1907, 1907, 1907, 1907, 1907, + /* 2880 */ 1907, 1907, 1907, 1907, 1907, 1907, 2322, 1907, 753, 1907, + /* 2890 */ 755, 1907, 1907, 2393, 1907, 1907, 353, 2357, 757, 2359, + /* 2900 */ 2360, 752, 1907, 747, 1907, 1907, 1907, 1907, 1907, 1907, + /* 2910 */ 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, + /* 2920 */ 1907, 1907, 1907, 1907, 1907, 1907, 1907, 2355, 1907, 1907, + /* 2930 */ 2393, 1907, 1907, 352, 2357, 757, 2359, 2360, 752, 1907, + /* 2940 */ 747, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 353, 382, 360, 395, 429, 363, 364, 1, 2, 434, - /* 10 */ 0, 429, 12, 13, 14, 396, 479, 2, 386, 482, - /* 20 */ 20, 20, 22, 8, 9, 406, 394, 12, 13, 14, - /* 30 */ 15, 16, 395, 21, 402, 35, 0, 37, 501, 365, - /* 40 */ 366, 479, 505, 506, 482, 353, 468, 469, 36, 365, - /* 50 */ 38, 39, 40, 406, 479, 365, 366, 482, 366, 385, - /* 60 */ 372, 479, 500, 501, 482, 65, 392, 505, 506, 450, - /* 70 */ 451, 71, 352, 408, 354, 500, 501, 389, 78, 460, - /* 80 */ 505, 506, 500, 501, 408, 397, 394, 505, 506, 8, - /* 90 */ 9, 426, 427, 12, 13, 14, 15, 16, 406, 423, - /* 100 */ 408, 70, 426, 427, 104, 421, 422, 107, 365, 73, + /* 0 */ 375, 383, 361, 395, 430, 364, 365, 1, 2, 435, + /* 10 */ 0, 430, 12, 13, 14, 397, 480, 392, 410, 483, + /* 20 */ 20, 20, 22, 8, 9, 407, 401, 12, 13, 14, + /* 30 */ 15, 16, 353, 21, 355, 35, 0, 37, 502, 366, + /* 40 */ 367, 480, 506, 507, 483, 354, 469, 470, 36, 366, + /* 50 */ 38, 39, 40, 20, 480, 366, 367, 483, 367, 386, + /* 60 */ 373, 480, 501, 502, 483, 65, 393, 506, 507, 451, + /* 70 */ 452, 71, 465, 409, 467, 501, 502, 390, 78, 461, + /* 80 */ 506, 507, 501, 502, 409, 398, 395, 506, 507, 8, + /* 90 */ 9, 427, 428, 12, 13, 14, 15, 16, 407, 424, + /* 100 */ 409, 70, 427, 428, 104, 422, 423, 107, 366, 73, /* 110 */ 74, 75, 76, 77, 108, 79, 80, 81, 82, 83, /* 120 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - /* 130 */ 94, 95, 96, 97, 98, 99, 100, 0, 20, 447, - /* 140 */ 22, 107, 450, 143, 144, 453, 454, 455, 456, 457, - /* 150 */ 458, 20, 460, 410, 411, 37, 413, 465, 360, 467, - /* 160 */ 417, 363, 364, 471, 472, 475, 476, 477, 14, 479, - /* 170 */ 480, 161, 482, 55, 20, 165, 394, 394, 486, 479, - /* 180 */ 180, 181, 482, 173, 401, 20, 494, 187, 188, 108, - /* 190 */ 500, 501, 409, 365, 366, 505, 506, 0, 416, 186, - /* 200 */ 418, 501, 202, 107, 204, 505, 506, 70, 393, 365, - /* 210 */ 366, 8, 9, 365, 366, 12, 13, 14, 15, 16, - /* 220 */ 405, 24, 25, 26, 27, 28, 29, 30, 31, 32, - /* 230 */ 20, 365, 366, 385, 234, 235, 236, 107, 238, 239, + /* 130 */ 94, 95, 96, 97, 98, 99, 100, 0, 20, 448, + /* 140 */ 22, 107, 451, 143, 144, 454, 455, 456, 457, 458, + /* 150 */ 459, 20, 461, 411, 412, 37, 414, 466, 361, 468, + /* 160 */ 418, 364, 365, 472, 473, 476, 477, 478, 14, 480, + /* 170 */ 481, 161, 483, 55, 20, 165, 395, 395, 487, 480, + /* 180 */ 180, 181, 483, 173, 402, 20, 495, 187, 188, 108, + /* 190 */ 501, 502, 410, 366, 367, 506, 507, 0, 417, 107, + /* 200 */ 419, 502, 202, 107, 204, 506, 507, 70, 394, 194, + /* 210 */ 20, 8, 9, 408, 409, 12, 13, 14, 15, 16, + /* 220 */ 406, 24, 25, 26, 27, 28, 29, 30, 31, 32, + /* 230 */ 20, 366, 367, 87, 234, 235, 236, 236, 238, 239, /* 240 */ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - /* 250 */ 250, 251, 252, 253, 254, 255, 12, 13, 20, 3, - /* 260 */ 20, 18, 479, 20, 20, 482, 22, 365, 366, 175, - /* 270 */ 27, 361, 353, 30, 71, 365, 20, 367, 35, 35, - /* 280 */ 414, 37, 366, 500, 501, 366, 138, 385, 505, 506, - /* 290 */ 142, 278, 279, 280, 51, 69, 53, 201, 20, 203, - /* 300 */ 206, 58, 59, 475, 476, 477, 272, 479, 480, 65, - /* 310 */ 394, 365, 69, 394, 20, 71, 104, 107, 115, 475, - /* 320 */ 476, 477, 78, 479, 480, 406, 4, 408, 33, 233, + /* 250 */ 250, 251, 252, 253, 254, 255, 12, 13, 56, 57, + /* 260 */ 20, 18, 480, 20, 20, 483, 22, 12, 13, 236, + /* 270 */ 27, 362, 354, 30, 71, 366, 20, 368, 35, 35, + /* 280 */ 415, 37, 65, 501, 502, 367, 138, 362, 506, 507, + /* 290 */ 142, 366, 37, 368, 51, 149, 53, 201, 20, 203, + /* 300 */ 367, 58, 59, 476, 477, 478, 272, 480, 481, 65, + /* 310 */ 354, 366, 69, 395, 299, 71, 104, 107, 115, 173, + /* 320 */ 174, 69, 78, 106, 137, 407, 109, 409, 395, 233, /* 330 */ 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - /* 340 */ 45, 129, 130, 131, 132, 133, 134, 135, 104, 106, + /* 340 */ 20, 129, 130, 131, 132, 133, 134, 135, 104, 106, /* 350 */ 20, 107, 136, 137, 138, 139, 140, 141, 142, 211, - /* 360 */ 117, 0, 214, 452, 108, 217, 447, 219, 272, 450, - /* 370 */ 0, 455, 453, 454, 455, 456, 457, 458, 459, 460, - /* 380 */ 461, 462, 179, 143, 144, 439, 440, 143, 144, 478, - /* 390 */ 147, 148, 353, 150, 151, 152, 153, 154, 155, 156, - /* 400 */ 157, 158, 272, 365, 366, 162, 163, 164, 165, 166, - /* 410 */ 167, 168, 42, 170, 171, 172, 13, 365, 366, 176, - /* 420 */ 177, 178, 375, 197, 180, 181, 183, 187, 188, 107, - /* 430 */ 383, 187, 188, 14, 73, 74, 75, 385, 182, 20, - /* 440 */ 20, 80, 81, 82, 392, 406, 202, 86, 204, 394, - /* 450 */ 224, 225, 91, 92, 93, 94, 365, 366, 97, 20, + /* 360 */ 117, 0, 214, 407, 272, 217, 448, 219, 272, 451, + /* 370 */ 180, 181, 454, 455, 456, 457, 458, 459, 460, 461, + /* 380 */ 462, 463, 179, 143, 144, 440, 441, 143, 144, 456, + /* 390 */ 147, 148, 175, 150, 151, 152, 153, 154, 155, 156, + /* 400 */ 157, 158, 215, 216, 354, 162, 163, 164, 165, 166, + /* 410 */ 167, 168, 3, 170, 171, 172, 395, 366, 367, 176, + /* 420 */ 177, 178, 366, 367, 180, 181, 183, 187, 188, 20, + /* 430 */ 453, 187, 188, 20, 73, 74, 75, 386, 366, 367, + /* 440 */ 419, 80, 81, 82, 393, 14, 202, 86, 204, 197, + /* 450 */ 20, 20, 91, 92, 93, 94, 479, 407, 97, 204, /* 460 */ 182, 100, 259, 260, 261, 262, 263, 264, 265, 266, - /* 470 */ 267, 268, 269, 418, 180, 181, 39, 40, 234, 235, - /* 480 */ 236, 78, 238, 239, 240, 241, 242, 243, 244, 245, + /* 470 */ 267, 268, 269, 143, 144, 70, 224, 225, 234, 235, + /* 480 */ 236, 71, 238, 239, 240, 241, 242, 243, 244, 245, /* 490 */ 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - /* 500 */ 256, 12, 13, 353, 71, 414, 407, 408, 382, 20, - /* 510 */ 180, 22, 474, 475, 476, 477, 366, 479, 480, 361, - /* 520 */ 33, 20, 396, 365, 35, 367, 37, 107, 256, 2, - /* 530 */ 258, 382, 406, 374, 353, 8, 9, 365, 366, 12, - /* 540 */ 13, 14, 15, 16, 394, 396, 107, 366, 111, 112, - /* 550 */ 391, 114, 365, 366, 65, 406, 406, 385, 408, 400, - /* 560 */ 71, 73, 74, 75, 365, 366, 236, 78, 80, 81, - /* 570 */ 82, 20, 385, 136, 86, 394, 450, 140, 3, 91, - /* 580 */ 92, 93, 94, 394, 385, 97, 460, 406, 100, 408, - /* 590 */ 401, 370, 371, 104, 272, 108, 107, 447, 409, 450, - /* 600 */ 450, 353, 70, 453, 454, 455, 456, 457, 458, 460, - /* 610 */ 460, 56, 57, 463, 366, 465, 466, 467, 42, 8, - /* 620 */ 9, 471, 472, 12, 13, 14, 15, 16, 447, 117, - /* 630 */ 350, 450, 143, 144, 453, 454, 455, 456, 457, 458, - /* 640 */ 390, 460, 394, 14, 143, 144, 465, 365, 467, 20, - /* 650 */ 365, 366, 471, 472, 406, 21, 408, 0, 24, 25, - /* 660 */ 26, 27, 28, 29, 30, 31, 32, 234, 404, 180, - /* 670 */ 181, 407, 408, 14, 452, 494, 187, 188, 21, 20, - /* 680 */ 256, 24, 25, 26, 27, 28, 29, 30, 31, 32, - /* 690 */ 50, 202, 272, 204, 444, 447, 365, 366, 450, 414, - /* 700 */ 478, 453, 454, 455, 456, 457, 458, 353, 460, 429, - /* 710 */ 386, 272, 117, 465, 434, 467, 385, 33, 394, 471, - /* 720 */ 472, 439, 440, 234, 235, 236, 402, 238, 239, 240, + /* 500 */ 256, 12, 13, 354, 20, 383, 22, 20, 3, 20, + /* 510 */ 0, 22, 387, 4, 236, 35, 367, 108, 405, 397, + /* 520 */ 395, 408, 409, 395, 35, 354, 37, 402, 403, 407, + /* 530 */ 402, 51, 476, 477, 478, 410, 480, 481, 410, 55, + /* 540 */ 60, 61, 62, 63, 395, 65, 373, 475, 476, 477, + /* 550 */ 478, 23, 480, 481, 65, 256, 407, 395, 409, 117, + /* 560 */ 71, 73, 74, 75, 402, 33, 186, 78, 80, 81, + /* 570 */ 82, 398, 410, 451, 86, 47, 48, 45, 407, 91, + /* 580 */ 92, 93, 94, 461, 234, 97, 106, 20, 100, 109, + /* 590 */ 256, 182, 258, 104, 107, 182, 107, 448, 366, 367, + /* 600 */ 451, 354, 375, 454, 455, 456, 457, 458, 459, 465, + /* 610 */ 461, 467, 182, 464, 367, 466, 467, 468, 386, 8, + /* 620 */ 9, 472, 473, 12, 13, 14, 15, 16, 401, 383, + /* 630 */ 22, 20, 143, 144, 284, 285, 286, 287, 288, 289, + /* 640 */ 290, 354, 395, 397, 234, 37, 136, 137, 138, 139, + /* 650 */ 140, 141, 142, 407, 407, 175, 409, 0, 278, 279, + /* 660 */ 280, 281, 366, 367, 184, 185, 236, 366, 367, 180, + /* 670 */ 181, 191, 192, 354, 107, 366, 187, 188, 21, 4, + /* 680 */ 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, + /* 690 */ 210, 202, 376, 204, 407, 448, 382, 451, 451, 385, + /* 700 */ 384, 454, 455, 456, 457, 458, 459, 461, 461, 51, + /* 710 */ 354, 415, 104, 466, 430, 468, 415, 78, 60, 472, + /* 720 */ 473, 63, 64, 234, 235, 236, 407, 238, 239, 240, /* 730 */ 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - /* 740 */ 251, 252, 253, 254, 255, 12, 13, 14, 353, 386, - /* 750 */ 12, 13, 4, 20, 22, 22, 22, 394, 386, 479, - /* 760 */ 406, 366, 482, 368, 401, 402, 394, 19, 35, 37, - /* 770 */ 37, 37, 409, 0, 402, 37, 365, 366, 353, 372, - /* 780 */ 500, 501, 374, 35, 179, 505, 506, 236, 20, 394, - /* 790 */ 22, 366, 108, 368, 65, 394, 385, 20, 65, 51, - /* 800 */ 37, 406, 401, 408, 397, 194, 58, 59, 400, 180, - /* 810 */ 409, 78, 78, 65, 12, 13, 14, 15, 16, 394, - /* 820 */ 8, 9, 182, 55, 12, 13, 14, 15, 16, 87, - /* 830 */ 190, 406, 20, 408, 20, 106, 104, 104, 109, 180, - /* 840 */ 107, 78, 447, 365, 366, 450, 353, 271, 453, 454, - /* 850 */ 455, 456, 457, 458, 106, 460, 22, 109, 78, 366, - /* 860 */ 465, 368, 467, 385, 259, 236, 471, 472, 293, 365, - /* 870 */ 366, 37, 447, 234, 269, 450, 143, 144, 453, 454, - /* 880 */ 455, 456, 457, 458, 137, 460, 353, 394, 0, 385, - /* 890 */ 465, 149, 467, 394, 51, 236, 471, 472, 4, 406, - /* 900 */ 401, 408, 387, 60, 175, 390, 63, 64, 409, 298, - /* 910 */ 365, 366, 78, 180, 181, 173, 174, 353, 34, 22, - /* 920 */ 187, 188, 283, 284, 285, 286, 287, 288, 289, 394, - /* 930 */ 385, 23, 159, 160, 37, 202, 401, 204, 104, 406, - /* 940 */ 447, 136, 204, 450, 409, 140, 453, 454, 455, 456, - /* 950 */ 457, 458, 353, 460, 353, 47, 48, 353, 465, 182, - /* 960 */ 467, 395, 215, 216, 471, 472, 395, 234, 235, 236, - /* 970 */ 406, 238, 239, 240, 241, 242, 243, 244, 245, 246, + /* 740 */ 251, 252, 253, 254, 255, 12, 13, 14, 354, 440, + /* 750 */ 441, 366, 367, 20, 391, 22, 430, 137, 138, 272, + /* 760 */ 33, 367, 142, 407, 480, 357, 358, 483, 35, 21, + /* 770 */ 37, 386, 24, 25, 26, 27, 28, 29, 30, 31, + /* 780 */ 32, 354, 107, 274, 387, 501, 502, 366, 367, 395, + /* 790 */ 506, 507, 395, 182, 367, 395, 369, 34, 65, 294, + /* 800 */ 403, 407, 402, 409, 366, 367, 480, 386, 445, 483, + /* 810 */ 410, 78, 8, 9, 395, 387, 12, 13, 14, 15, + /* 820 */ 16, 402, 395, 395, 386, 371, 372, 501, 502, 410, + /* 830 */ 387, 403, 506, 507, 407, 108, 409, 104, 395, 272, + /* 840 */ 107, 42, 448, 366, 367, 451, 403, 236, 454, 455, + /* 850 */ 456, 457, 458, 459, 354, 461, 354, 354, 117, 22, + /* 860 */ 466, 4, 468, 386, 395, 354, 472, 473, 453, 367, + /* 870 */ 366, 367, 403, 354, 37, 448, 143, 144, 451, 0, + /* 880 */ 23, 454, 455, 456, 457, 458, 459, 354, 461, 495, + /* 890 */ 386, 4, 14, 466, 479, 468, 14, 395, 20, 472, + /* 900 */ 473, 436, 20, 46, 47, 48, 19, 407, 228, 407, + /* 910 */ 407, 409, 108, 180, 181, 78, 366, 367, 407, 0, + /* 920 */ 187, 188, 35, 8, 9, 20, 407, 12, 13, 14, + /* 930 */ 15, 16, 14, 15, 16, 202, 386, 204, 51, 22, + /* 940 */ 407, 104, 50, 380, 381, 58, 59, 272, 33, 395, + /* 950 */ 448, 37, 65, 451, 37, 430, 454, 455, 456, 457, + /* 960 */ 458, 459, 396, 461, 410, 371, 372, 234, 235, 236, + /* 970 */ 51, 238, 239, 240, 241, 242, 243, 244, 245, 246, /* 980 */ 247, 248, 249, 250, 251, 252, 253, 254, 255, 12, - /* 990 */ 13, 353, 370, 371, 182, 0, 182, 20, 464, 22, - /* 1000 */ 466, 104, 379, 380, 366, 406, 368, 406, 381, 395, - /* 1010 */ 406, 384, 35, 236, 37, 8, 9, 365, 366, 12, - /* 1020 */ 13, 14, 15, 16, 136, 137, 138, 139, 140, 141, - /* 1030 */ 142, 394, 394, 14, 15, 16, 202, 385, 204, 402, - /* 1040 */ 33, 452, 65, 395, 406, 20, 408, 353, 236, 20, - /* 1050 */ 236, 137, 138, 8, 9, 78, 142, 12, 13, 14, - /* 1060 */ 15, 16, 365, 366, 4, 353, 0, 478, 234, 235, - /* 1070 */ 8, 9, 353, 353, 12, 13, 14, 15, 16, 365, - /* 1080 */ 366, 104, 385, 23, 107, 447, 366, 463, 450, 353, - /* 1090 */ 466, 453, 454, 455, 456, 457, 458, 394, 460, 385, - /* 1100 */ 406, 33, 366, 465, 368, 467, 46, 47, 48, 471, - /* 1110 */ 472, 464, 409, 466, 394, 108, 379, 380, 406, 399, - /* 1120 */ 143, 144, 0, 365, 366, 406, 406, 435, 408, 353, - /* 1130 */ 394, 136, 137, 138, 139, 140, 141, 142, 395, 394, - /* 1140 */ 365, 366, 406, 385, 408, 117, 365, 366, 394, 365, - /* 1150 */ 366, 365, 366, 108, 409, 33, 353, 180, 181, 403, - /* 1160 */ 385, 353, 406, 409, 187, 188, 385, 447, 274, 385, - /* 1170 */ 450, 385, 383, 453, 454, 455, 456, 457, 458, 202, - /* 1180 */ 460, 204, 406, 447, 353, 353, 450, 270, 271, 453, - /* 1190 */ 454, 455, 456, 457, 458, 354, 460, 169, 429, 353, - /* 1200 */ 429, 465, 403, 467, 353, 406, 353, 471, 472, 406, - /* 1210 */ 65, 234, 235, 236, 406, 238, 239, 240, 241, 242, + /* 990 */ 13, 396, 78, 106, 354, 78, 109, 20, 354, 22, + /* 1000 */ 12, 13, 14, 15, 16, 480, 354, 354, 483, 396, + /* 1010 */ 508, 509, 35, 395, 37, 136, 137, 138, 139, 140, + /* 1020 */ 141, 142, 354, 108, 354, 354, 501, 502, 410, 8, + /* 1030 */ 9, 506, 507, 12, 13, 14, 15, 16, 367, 202, + /* 1040 */ 369, 204, 65, 179, 366, 367, 20, 407, 354, 366, + /* 1050 */ 367, 407, 22, 366, 367, 78, 366, 367, 180, 407, + /* 1060 */ 407, 367, 180, 369, 386, 464, 395, 37, 467, 386, + /* 1070 */ 271, 234, 235, 386, 182, 407, 386, 407, 407, 117, + /* 1080 */ 409, 104, 190, 354, 107, 180, 136, 8, 9, 395, + /* 1090 */ 140, 12, 13, 14, 15, 16, 367, 33, 369, 2, + /* 1100 */ 0, 407, 396, 409, 404, 8, 9, 407, 354, 12, + /* 1110 */ 13, 14, 15, 16, 236, 366, 367, 13, 236, 448, + /* 1120 */ 143, 144, 451, 259, 395, 454, 455, 456, 457, 458, + /* 1130 */ 459, 169, 461, 269, 104, 386, 407, 466, 409, 468, + /* 1140 */ 33, 236, 448, 472, 473, 451, 0, 175, 454, 455, + /* 1150 */ 456, 457, 458, 459, 0, 461, 354, 180, 181, 37, + /* 1160 */ 466, 407, 468, 37, 187, 188, 472, 473, 22, 366, + /* 1170 */ 367, 366, 367, 404, 366, 367, 407, 448, 206, 202, + /* 1180 */ 451, 204, 78, 454, 455, 456, 457, 458, 459, 386, + /* 1190 */ 461, 386, 430, 2, 386, 466, 42, 468, 33, 8, + /* 1200 */ 9, 472, 473, 12, 13, 14, 15, 16, 396, 407, + /* 1210 */ 45, 234, 235, 236, 396, 238, 239, 240, 241, 242, /* 1220 */ 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - /* 1230 */ 253, 254, 255, 12, 13, 33, 403, 406, 406, 406, - /* 1240 */ 0, 20, 13, 22, 182, 356, 357, 45, 479, 0, - /* 1250 */ 479, 482, 406, 482, 109, 353, 35, 406, 37, 406, - /* 1260 */ 13, 236, 22, 35, 110, 236, 37, 113, 366, 500, - /* 1270 */ 501, 500, 501, 0, 505, 506, 505, 506, 110, 51, - /* 1280 */ 110, 113, 110, 113, 37, 113, 65, 0, 60, 61, - /* 1290 */ 62, 63, 0, 65, 228, 22, 394, 8, 9, 78, - /* 1300 */ 51, 12, 13, 14, 15, 16, 419, 33, 406, 22, - /* 1310 */ 408, 218, 33, 220, 22, 33, 33, 49, 18, 33, - /* 1320 */ 143, 144, 37, 23, 33, 104, 1, 2, 107, 33, - /* 1330 */ 33, 33, 353, 509, 106, 498, 37, 109, 37, 429, - /* 1340 */ 40, 41, 33, 33, 44, 366, 33, 368, 13, 447, - /* 1350 */ 13, 369, 450, 33, 54, 453, 454, 455, 456, 457, - /* 1360 */ 458, 107, 460, 295, 143, 144, 66, 67, 68, 69, - /* 1370 */ 116, 491, 37, 394, 37, 107, 382, 429, 394, 78, - /* 1380 */ 382, 419, 108, 33, 364, 406, 419, 408, 497, 479, - /* 1390 */ 108, 108, 482, 497, 108, 497, 428, 495, 496, 108, - /* 1400 */ 497, 180, 181, 175, 108, 108, 108, 107, 187, 188, - /* 1410 */ 500, 501, 184, 185, 366, 505, 506, 108, 108, 191, - /* 1420 */ 192, 108, 369, 202, 419, 204, 447, 479, 108, 450, - /* 1430 */ 482, 0, 453, 454, 455, 456, 457, 458, 210, 460, - /* 1440 */ 33, 33, 405, 33, 465, 145, 467, 33, 500, 501, - /* 1450 */ 471, 472, 33, 505, 506, 234, 235, 236, 108, 238, + /* 1230 */ 253, 254, 255, 12, 13, 39, 40, 366, 367, 453, + /* 1240 */ 0, 20, 480, 22, 33, 483, 366, 367, 380, 381, + /* 1250 */ 366, 367, 404, 270, 271, 407, 35, 386, 37, 159, + /* 1260 */ 160, 182, 236, 501, 502, 479, 386, 33, 506, 507, + /* 1270 */ 386, 388, 110, 33, 391, 113, 354, 110, 110, 13, + /* 1280 */ 113, 113, 110, 0, 0, 113, 65, 13, 33, 367, + /* 1290 */ 0, 369, 218, 65, 220, 49, 33, 33, 355, 78, + /* 1300 */ 143, 144, 396, 37, 37, 22, 22, 111, 112, 33, + /* 1310 */ 114, 37, 22, 1, 2, 384, 420, 395, 18, 108, + /* 1320 */ 510, 33, 33, 23, 33, 104, 204, 13, 107, 407, + /* 1330 */ 204, 409, 136, 499, 354, 33, 140, 109, 492, 33, + /* 1340 */ 40, 41, 108, 33, 44, 78, 33, 367, 370, 369, + /* 1350 */ 107, 37, 33, 107, 54, 33, 395, 33, 33, 116, + /* 1360 */ 296, 13, 383, 108, 143, 144, 66, 67, 68, 69, + /* 1370 */ 448, 108, 108, 451, 33, 395, 454, 455, 456, 457, + /* 1380 */ 458, 459, 383, 461, 108, 37, 420, 407, 466, 409, + /* 1390 */ 468, 0, 365, 420, 472, 473, 108, 108, 498, 108, + /* 1400 */ 498, 180, 181, 33, 33, 298, 498, 107, 187, 188, + /* 1410 */ 108, 429, 370, 420, 108, 367, 406, 420, 108, 498, + /* 1420 */ 420, 108, 437, 202, 482, 204, 503, 108, 448, 474, + /* 1430 */ 108, 451, 108, 108, 454, 455, 456, 457, 458, 459, + /* 1440 */ 385, 461, 485, 52, 275, 145, 466, 431, 468, 108, + /* 1450 */ 51, 450, 472, 473, 42, 234, 235, 236, 449, 238, /* 1460 */ 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - /* 1470 */ 249, 250, 251, 252, 253, 254, 255, 436, 419, 473, - /* 1480 */ 419, 12, 13, 52, 353, 481, 484, 502, 384, 204, - /* 1490 */ 275, 22, 51, 430, 194, 195, 196, 366, 449, 199, - /* 1500 */ 42, 20, 448, 204, 35, 441, 37, 217, 374, 374, - /* 1510 */ 441, 353, 212, 213, 200, 108, 108, 446, 108, 432, - /* 1520 */ 20, 365, 108, 223, 366, 394, 226, 108, 20, 229, - /* 1530 */ 230, 231, 232, 233, 65, 366, 45, 406, 415, 408, - /* 1540 */ 366, 415, 179, 365, 412, 366, 365, 78, 415, 412, - /* 1550 */ 412, 412, 394, 105, 378, 103, 365, 377, 102, 376, - /* 1560 */ 365, 365, 365, 20, 406, 358, 408, 50, 362, 358, - /* 1570 */ 362, 441, 272, 104, 374, 374, 297, 20, 447, 408, - /* 1580 */ 353, 450, 20, 374, 453, 454, 455, 456, 457, 458, - /* 1590 */ 367, 460, 20, 366, 431, 20, 465, 367, 467, 374, - /* 1600 */ 374, 365, 471, 472, 422, 447, 374, 374, 450, 374, - /* 1610 */ 358, 453, 454, 455, 456, 457, 458, 356, 460, 356, - /* 1620 */ 365, 394, 358, 465, 406, 467, 406, 221, 394, 471, - /* 1630 */ 472, 394, 394, 406, 445, 408, 394, 394, 394, 394, - /* 1640 */ 394, 107, 394, 372, 394, 394, 443, 406, 20, 372, - /* 1650 */ 208, 441, 440, 207, 438, 282, 437, 490, 365, 281, - /* 1660 */ 290, 408, 406, 490, 193, 276, 299, 292, 493, 430, - /* 1670 */ 291, 202, 510, 204, 447, 490, 492, 450, 296, 489, - /* 1680 */ 453, 454, 455, 456, 457, 458, 424, 460, 430, 424, - /* 1690 */ 504, 294, 488, 271, 467, 353, 1, 503, 471, 472, - /* 1700 */ 487, 20, 366, 234, 235, 117, 273, 485, 366, 452, - /* 1710 */ 367, 372, 372, 406, 19, 185, 372, 248, 249, 250, - /* 1720 */ 251, 252, 253, 254, 406, 406, 424, 353, 406, 424, - /* 1730 */ 35, 420, 406, 372, 366, 390, 394, 107, 107, 470, - /* 1740 */ 366, 365, 483, 372, 398, 22, 51, 406, 406, 355, - /* 1750 */ 408, 38, 359, 358, 433, 60, 61, 62, 63, 442, - /* 1760 */ 65, 373, 353, 425, 351, 388, 0, 0, 394, 388, - /* 1770 */ 0, 388, 425, 45, 0, 366, 37, 227, 37, 37, - /* 1780 */ 406, 37, 408, 227, 0, 37, 37, 227, 37, 447, - /* 1790 */ 0, 227, 450, 0, 37, 453, 454, 455, 456, 457, - /* 1800 */ 458, 106, 460, 394, 109, 0, 37, 0, 22, 467, - /* 1810 */ 0, 222, 37, 471, 472, 406, 0, 408, 210, 0, - /* 1820 */ 210, 447, 211, 204, 450, 202, 0, 453, 454, 455, - /* 1830 */ 456, 457, 458, 0, 460, 353, 141, 0, 198, 197, - /* 1840 */ 0, 467, 0, 49, 148, 471, 472, 49, 366, 0, - /* 1850 */ 37, 0, 0, 51, 37, 0, 447, 49, 353, 450, - /* 1860 */ 0, 0, 453, 454, 455, 456, 457, 458, 45, 460, - /* 1870 */ 0, 366, 0, 49, 0, 0, 394, 0, 353, 184, - /* 1880 */ 165, 37, 0, 165, 0, 0, 191, 0, 406, 0, - /* 1890 */ 408, 366, 0, 353, 0, 0, 0, 0, 0, 394, - /* 1900 */ 0, 0, 0, 0, 0, 210, 366, 0, 0, 0, - /* 1910 */ 0, 406, 0, 408, 49, 0, 507, 508, 0, 394, - /* 1920 */ 0, 45, 0, 0, 399, 0, 0, 0, 0, 447, - /* 1930 */ 0, 406, 450, 408, 394, 453, 454, 455, 456, 457, - /* 1940 */ 458, 22, 460, 0, 148, 0, 406, 147, 408, 467, - /* 1950 */ 0, 0, 447, 0, 472, 450, 22, 146, 453, 454, - /* 1960 */ 455, 456, 457, 458, 22, 460, 50, 50, 0, 37, - /* 1970 */ 65, 0, 447, 0, 0, 450, 65, 0, 453, 454, - /* 1980 */ 455, 456, 457, 458, 37, 460, 65, 447, 42, 353, - /* 1990 */ 450, 51, 0, 453, 454, 455, 456, 457, 458, 37, - /* 2000 */ 460, 496, 366, 51, 0, 42, 37, 51, 42, 0, - /* 2010 */ 0, 33, 37, 49, 42, 45, 49, 14, 0, 43, - /* 2020 */ 0, 0, 42, 0, 0, 353, 42, 193, 49, 0, - /* 2030 */ 394, 49, 0, 0, 0, 0, 37, 72, 366, 499, - /* 2040 */ 51, 0, 406, 42, 408, 37, 51, 42, 0, 37, - /* 2050 */ 0, 51, 37, 42, 0, 42, 0, 353, 51, 0, - /* 2060 */ 0, 0, 0, 115, 37, 22, 394, 113, 0, 22, - /* 2070 */ 366, 399, 0, 37, 37, 37, 37, 37, 406, 37, - /* 2080 */ 408, 37, 37, 447, 33, 33, 450, 22, 0, 453, - /* 2090 */ 454, 455, 456, 457, 458, 37, 460, 22, 394, 0, - /* 2100 */ 37, 37, 22, 0, 22, 0, 53, 37, 0, 0, - /* 2110 */ 406, 37, 408, 0, 37, 0, 22, 20, 37, 447, - /* 2120 */ 37, 37, 450, 0, 108, 453, 454, 455, 456, 457, - /* 2130 */ 458, 182, 460, 107, 353, 107, 0, 182, 209, 49, - /* 2140 */ 22, 37, 0, 205, 508, 185, 22, 366, 0, 0, - /* 2150 */ 353, 447, 33, 3, 450, 277, 107, 453, 454, 455, - /* 2160 */ 456, 457, 458, 366, 460, 182, 462, 182, 353, 182, - /* 2170 */ 189, 50, 50, 33, 108, 394, 107, 189, 105, 103, - /* 2180 */ 399, 366, 49, 49, 33, 33, 108, 406, 33, 408, - /* 2190 */ 277, 394, 3, 108, 108, 33, 399, 108, 107, 107, - /* 2200 */ 107, 277, 107, 406, 108, 408, 37, 37, 37, 394, - /* 2210 */ 37, 37, 37, 49, 108, 108, 33, 49, 0, 0, - /* 2220 */ 42, 406, 108, 408, 107, 0, 42, 270, 447, 49, - /* 2230 */ 184, 450, 107, 353, 453, 454, 455, 456, 457, 458, - /* 2240 */ 108, 460, 107, 186, 447, 107, 366, 450, 107, 33, - /* 2250 */ 453, 454, 455, 456, 457, 458, 2, 460, 22, 116, - /* 2260 */ 107, 105, 447, 257, 105, 450, 108, 353, 453, 454, - /* 2270 */ 455, 456, 457, 458, 394, 460, 49, 49, 22, 107, - /* 2280 */ 366, 37, 117, 107, 37, 108, 406, 108, 408, 234, - /* 2290 */ 353, 128, 107, 107, 107, 37, 108, 107, 37, 108, - /* 2300 */ 107, 37, 108, 366, 107, 37, 108, 107, 394, 108, - /* 2310 */ 107, 37, 108, 107, 33, 108, 237, 107, 22, 107, - /* 2320 */ 406, 107, 408, 128, 128, 37, 37, 447, 107, 72, - /* 2330 */ 450, 394, 37, 453, 454, 455, 456, 457, 458, 128, - /* 2340 */ 460, 71, 37, 406, 37, 408, 37, 353, 37, 37, - /* 2350 */ 37, 37, 101, 101, 78, 78, 33, 37, 37, 37, - /* 2360 */ 366, 447, 22, 37, 450, 37, 37, 453, 454, 455, - /* 2370 */ 456, 457, 458, 37, 460, 78, 37, 22, 37, 37, - /* 2380 */ 37, 37, 0, 37, 447, 51, 0, 450, 394, 42, - /* 2390 */ 453, 454, 455, 456, 457, 458, 37, 460, 42, 0, - /* 2400 */ 406, 51, 408, 37, 51, 42, 0, 37, 51, 42, - /* 2410 */ 0, 37, 37, 0, 22, 22, 33, 21, 20, 22, - /* 2420 */ 353, 511, 22, 21, 511, 511, 511, 511, 511, 511, - /* 2430 */ 511, 511, 511, 366, 511, 511, 511, 511, 511, 511, - /* 2440 */ 353, 447, 511, 511, 450, 511, 511, 453, 454, 455, - /* 2450 */ 456, 457, 458, 366, 460, 511, 511, 511, 511, 511, - /* 2460 */ 511, 394, 511, 511, 511, 511, 511, 511, 511, 511, - /* 2470 */ 511, 511, 511, 406, 511, 408, 511, 511, 511, 511, - /* 2480 */ 511, 394, 511, 511, 511, 511, 511, 511, 511, 511, - /* 2490 */ 511, 511, 511, 406, 511, 408, 511, 511, 353, 511, - /* 2500 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - /* 2510 */ 511, 366, 511, 353, 447, 511, 511, 450, 511, 511, - /* 2520 */ 453, 454, 455, 456, 457, 458, 366, 460, 511, 511, - /* 2530 */ 511, 511, 511, 511, 447, 353, 511, 450, 511, 394, - /* 2540 */ 453, 454, 455, 456, 457, 458, 511, 460, 366, 511, - /* 2550 */ 511, 406, 511, 408, 394, 511, 511, 511, 511, 511, - /* 2560 */ 511, 511, 511, 511, 511, 511, 406, 511, 408, 511, - /* 2570 */ 511, 511, 511, 511, 511, 511, 394, 511, 511, 511, - /* 2580 */ 511, 511, 511, 511, 511, 511, 511, 511, 406, 511, - /* 2590 */ 408, 511, 447, 353, 511, 450, 511, 511, 453, 454, - /* 2600 */ 455, 456, 457, 458, 511, 460, 366, 447, 353, 511, - /* 2610 */ 450, 511, 511, 453, 454, 455, 456, 457, 458, 511, - /* 2620 */ 460, 366, 511, 511, 511, 511, 511, 511, 353, 447, - /* 2630 */ 511, 511, 450, 511, 394, 453, 454, 455, 456, 457, - /* 2640 */ 458, 366, 460, 511, 511, 511, 406, 511, 408, 394, - /* 2650 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - /* 2660 */ 511, 406, 511, 408, 511, 511, 511, 511, 511, 394, - /* 2670 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - /* 2680 */ 511, 406, 511, 408, 511, 511, 511, 447, 511, 511, - /* 2690 */ 450, 511, 511, 453, 454, 455, 456, 457, 458, 511, - /* 2700 */ 460, 353, 447, 511, 511, 450, 511, 511, 453, 454, - /* 2710 */ 455, 456, 457, 458, 366, 460, 511, 511, 511, 511, - /* 2720 */ 511, 353, 447, 511, 511, 450, 511, 511, 453, 454, - /* 2730 */ 455, 456, 457, 458, 366, 460, 511, 511, 353, 511, - /* 2740 */ 511, 511, 394, 511, 511, 511, 511, 511, 511, 511, - /* 2750 */ 511, 366, 511, 511, 406, 511, 408, 511, 511, 511, - /* 2760 */ 511, 511, 394, 511, 511, 511, 511, 511, 511, 511, - /* 2770 */ 511, 511, 511, 511, 406, 511, 408, 511, 511, 394, - /* 2780 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - /* 2790 */ 511, 406, 511, 408, 511, 447, 511, 511, 450, 511, - /* 2800 */ 511, 453, 454, 455, 456, 457, 458, 353, 460, 511, - /* 2810 */ 511, 511, 511, 511, 511, 447, 511, 511, 450, 511, - /* 2820 */ 366, 453, 454, 455, 456, 457, 458, 511, 460, 511, - /* 2830 */ 511, 511, 447, 511, 511, 450, 511, 511, 453, 454, - /* 2840 */ 455, 456, 457, 458, 511, 460, 511, 511, 394, 511, - /* 2850 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - /* 2860 */ 406, 511, 408, 511, 511, 353, 511, 511, 511, 511, - /* 2870 */ 511, 511, 511, 511, 511, 511, 511, 511, 366, 511, - /* 2880 */ 353, 511, 511, 511, 511, 511, 511, 511, 511, 511, - /* 2890 */ 511, 511, 511, 366, 511, 511, 511, 511, 511, 511, - /* 2900 */ 511, 447, 353, 511, 450, 511, 394, 453, 454, 455, - /* 2910 */ 456, 457, 458, 511, 460, 366, 511, 511, 406, 511, - /* 2920 */ 408, 394, 511, 511, 511, 511, 511, 511, 511, 511, - /* 2930 */ 511, 511, 511, 406, 511, 408, 511, 511, 511, 511, - /* 2940 */ 511, 511, 511, 394, 511, 511, 511, 511, 511, 511, - /* 2950 */ 511, 511, 511, 511, 511, 406, 511, 408, 511, 447, - /* 2960 */ 353, 511, 450, 511, 511, 453, 454, 455, 456, 457, - /* 2970 */ 458, 511, 460, 366, 447, 353, 511, 450, 511, 511, - /* 2980 */ 453, 454, 455, 456, 457, 458, 511, 460, 366, 511, - /* 2990 */ 511, 511, 511, 511, 511, 511, 447, 511, 511, 450, - /* 3000 */ 511, 394, 453, 454, 455, 456, 457, 458, 511, 460, - /* 3010 */ 511, 511, 511, 406, 511, 408, 394, 511, 511, 511, - /* 3020 */ 511, 511, 511, 511, 511, 511, 511, 511, 406, 511, - /* 3030 */ 408, 511, 511, 511, 511, 511, 511, 511, 511, 511, - /* 3040 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - /* 3050 */ 511, 511, 511, 511, 447, 511, 511, 450, 511, 511, - /* 3060 */ 453, 454, 455, 456, 457, 458, 511, 460, 511, 447, - /* 3070 */ 511, 511, 450, 511, 511, 453, 454, 455, 456, 457, - /* 3080 */ 458, 511, 460, 350, 350, 350, 350, 350, 350, 350, - /* 3090 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3100 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3110 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3120 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3130 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3140 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3150 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3160 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3170 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3180 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3190 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3200 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3210 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3220 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3230 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3240 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3250 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3260 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3270 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3280 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3290 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3300 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3310 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3320 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3330 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3340 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3350 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3360 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3370 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3380 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3390 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3400 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3410 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3420 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, - /* 3430 */ 350, 350, 350, + /* 1470 */ 249, 250, 251, 252, 253, 254, 255, 20, 108, 108, + /* 1480 */ 442, 12, 13, 447, 354, 217, 375, 442, 375, 433, + /* 1490 */ 20, 22, 200, 366, 194, 195, 196, 367, 20, 199, + /* 1500 */ 367, 45, 416, 367, 35, 416, 37, 354, 179, 413, + /* 1510 */ 366, 366, 212, 213, 367, 416, 413, 379, 413, 413, + /* 1520 */ 367, 105, 103, 223, 366, 395, 226, 378, 102, 229, + /* 1530 */ 230, 231, 232, 233, 65, 20, 351, 407, 377, 409, + /* 1540 */ 366, 366, 354, 366, 50, 359, 363, 78, 395, 359, + /* 1550 */ 363, 442, 20, 375, 375, 367, 375, 409, 20, 20, + /* 1560 */ 407, 368, 409, 432, 375, 368, 20, 375, 366, 375, + /* 1570 */ 375, 359, 272, 104, 423, 375, 357, 395, 448, 395, + /* 1580 */ 366, 451, 357, 395, 454, 455, 456, 457, 458, 459, + /* 1590 */ 359, 461, 107, 395, 395, 407, 466, 409, 468, 395, + /* 1600 */ 395, 448, 472, 473, 451, 395, 221, 454, 455, 456, + /* 1610 */ 457, 458, 459, 395, 461, 430, 407, 395, 395, 466, + /* 1620 */ 435, 468, 395, 407, 407, 472, 473, 373, 20, 208, + /* 1630 */ 207, 373, 283, 409, 431, 366, 448, 407, 282, 451, + /* 1640 */ 439, 354, 454, 455, 456, 457, 458, 459, 291, 461, + /* 1650 */ 442, 444, 446, 438, 367, 491, 468, 425, 425, 193, + /* 1660 */ 472, 473, 491, 276, 494, 480, 493, 441, 483, 293, + /* 1670 */ 490, 202, 354, 204, 292, 431, 297, 300, 295, 271, + /* 1680 */ 20, 505, 395, 367, 117, 367, 501, 502, 453, 368, + /* 1690 */ 273, 506, 507, 373, 407, 425, 409, 425, 185, 354, + /* 1700 */ 373, 407, 489, 234, 235, 407, 407, 421, 407, 373, + /* 1710 */ 407, 491, 367, 395, 391, 373, 107, 248, 249, 250, + /* 1720 */ 251, 252, 253, 254, 488, 407, 367, 409, 486, 484, + /* 1730 */ 471, 107, 399, 504, 366, 448, 373, 407, 451, 22, + /* 1740 */ 395, 454, 455, 456, 457, 458, 459, 38, 461, 511, + /* 1750 */ 356, 359, 407, 360, 409, 468, 389, 354, 443, 472, + /* 1760 */ 473, 426, 434, 426, 389, 352, 448, 389, 0, 451, + /* 1770 */ 367, 374, 454, 455, 456, 457, 458, 459, 0, 461, + /* 1780 */ 0, 45, 0, 37, 227, 37, 468, 37, 37, 227, + /* 1790 */ 472, 473, 354, 448, 0, 37, 451, 37, 395, 454, + /* 1800 */ 455, 456, 457, 458, 459, 367, 461, 227, 37, 0, + /* 1810 */ 407, 227, 409, 0, 37, 0, 37, 0, 22, 0, + /* 1820 */ 37, 222, 354, 210, 0, 210, 204, 211, 202, 0, + /* 1830 */ 0, 0, 198, 395, 0, 367, 197, 0, 0, 148, + /* 1840 */ 49, 496, 497, 0, 49, 407, 0, 409, 37, 0, + /* 1850 */ 51, 448, 0, 37, 451, 49, 0, 454, 455, 456, + /* 1860 */ 457, 458, 459, 395, 461, 45, 0, 0, 400, 0, + /* 1870 */ 49, 468, 0, 0, 0, 407, 473, 409, 0, 0, + /* 1880 */ 0, 165, 37, 0, 165, 0, 448, 354, 0, 451, + /* 1890 */ 0, 0, 454, 455, 456, 457, 458, 459, 45, 461, + /* 1900 */ 367, 0, 354, 0, 0, 0, 0, 0, 0, 0, + /* 1910 */ 0, 0, 0, 0, 0, 367, 448, 354, 22, 451, + /* 1920 */ 0, 0, 454, 455, 456, 457, 458, 459, 395, 461, + /* 1930 */ 367, 49, 0, 400, 148, 497, 0, 0, 0, 0, + /* 1940 */ 407, 0, 409, 395, 0, 0, 0, 0, 147, 0, + /* 1950 */ 146, 0, 0, 22, 0, 407, 37, 409, 395, 65, + /* 1960 */ 0, 0, 22, 0, 65, 50, 50, 65, 0, 42, + /* 1970 */ 407, 0, 409, 51, 51, 42, 0, 51, 0, 37, + /* 1980 */ 37, 448, 0, 33, 451, 37, 14, 454, 455, 456, + /* 1990 */ 457, 458, 459, 37, 461, 42, 448, 354, 0, 451, + /* 2000 */ 45, 42, 454, 455, 456, 457, 458, 459, 43, 461, + /* 2010 */ 367, 448, 42, 49, 451, 354, 49, 454, 455, 456, + /* 2020 */ 457, 458, 459, 49, 461, 0, 0, 0, 367, 42, + /* 2030 */ 0, 0, 193, 49, 0, 0, 0, 37, 395, 0, + /* 2040 */ 354, 72, 0, 400, 51, 42, 37, 51, 500, 42, + /* 2050 */ 407, 0, 409, 367, 37, 51, 395, 42, 0, 37, + /* 2060 */ 42, 51, 0, 0, 0, 0, 0, 0, 407, 37, + /* 2070 */ 409, 0, 509, 115, 22, 113, 22, 37, 37, 0, + /* 2080 */ 37, 395, 37, 37, 37, 37, 400, 37, 33, 33, + /* 2090 */ 37, 448, 22, 407, 451, 409, 37, 454, 455, 456, + /* 2100 */ 457, 458, 459, 0, 461, 37, 22, 0, 22, 448, + /* 2110 */ 354, 0, 451, 53, 1, 454, 455, 456, 457, 458, + /* 2120 */ 459, 22, 461, 367, 463, 37, 0, 0, 0, 37, + /* 2130 */ 0, 37, 19, 0, 448, 20, 22, 451, 37, 37, + /* 2140 */ 454, 455, 456, 457, 458, 459, 354, 461, 35, 37, + /* 2150 */ 0, 395, 108, 49, 0, 182, 400, 182, 37, 367, + /* 2160 */ 22, 0, 22, 407, 51, 409, 209, 182, 107, 0, + /* 2170 */ 0, 205, 182, 60, 61, 62, 63, 354, 65, 107, + /* 2180 */ 185, 189, 3, 182, 33, 107, 189, 395, 108, 107, + /* 2190 */ 367, 108, 37, 37, 277, 50, 107, 50, 105, 407, + /* 2200 */ 103, 409, 49, 108, 448, 33, 33, 451, 108, 33, + /* 2210 */ 454, 455, 456, 457, 458, 459, 107, 461, 395, 106, + /* 2220 */ 49, 33, 109, 107, 107, 3, 108, 107, 33, 37, + /* 2230 */ 407, 108, 409, 108, 37, 37, 37, 37, 37, 108, + /* 2240 */ 448, 33, 108, 451, 0, 49, 454, 455, 456, 457, + /* 2250 */ 458, 459, 354, 461, 141, 49, 277, 277, 270, 0, + /* 2260 */ 42, 186, 0, 42, 107, 367, 107, 33, 116, 184, + /* 2270 */ 108, 448, 354, 108, 451, 107, 49, 454, 455, 456, + /* 2280 */ 457, 458, 459, 105, 461, 367, 105, 107, 354, 107, + /* 2290 */ 107, 22, 2, 395, 257, 108, 107, 184, 107, 49, + /* 2300 */ 107, 367, 108, 234, 191, 407, 49, 409, 22, 33, + /* 2310 */ 108, 107, 107, 395, 237, 108, 107, 37, 108, 37, + /* 2320 */ 117, 107, 37, 210, 108, 407, 107, 409, 108, 395, + /* 2330 */ 37, 107, 37, 108, 108, 107, 37, 107, 37, 108, + /* 2340 */ 107, 407, 37, 409, 107, 354, 448, 107, 107, 451, + /* 2350 */ 22, 128, 454, 455, 456, 457, 458, 459, 367, 461, + /* 2360 */ 128, 37, 71, 128, 128, 354, 448, 37, 72, 451, + /* 2370 */ 37, 37, 454, 455, 456, 457, 458, 459, 367, 461, + /* 2380 */ 37, 37, 448, 354, 37, 451, 395, 37, 454, 455, + /* 2390 */ 456, 457, 458, 459, 37, 461, 367, 78, 407, 101, + /* 2400 */ 409, 78, 33, 354, 101, 37, 395, 37, 37, 22, + /* 2410 */ 37, 37, 37, 78, 37, 37, 367, 37, 407, 37, + /* 2420 */ 409, 22, 37, 37, 395, 0, 37, 51, 0, 37, + /* 2430 */ 42, 0, 51, 42, 37, 42, 407, 0, 409, 448, + /* 2440 */ 37, 354, 451, 42, 395, 454, 455, 456, 457, 458, + /* 2450 */ 459, 51, 461, 51, 367, 0, 407, 37, 409, 448, + /* 2460 */ 37, 0, 451, 22, 21, 454, 455, 456, 457, 458, + /* 2470 */ 459, 33, 461, 22, 22, 22, 20, 448, 354, 21, + /* 2480 */ 451, 512, 395, 454, 455, 456, 457, 458, 459, 512, + /* 2490 */ 461, 367, 512, 512, 407, 512, 409, 448, 354, 512, + /* 2500 */ 451, 512, 512, 454, 455, 456, 457, 458, 459, 512, + /* 2510 */ 461, 367, 512, 512, 354, 512, 512, 512, 512, 395, + /* 2520 */ 512, 512, 512, 512, 512, 512, 512, 367, 512, 512, + /* 2530 */ 512, 407, 512, 409, 512, 448, 512, 512, 451, 395, + /* 2540 */ 512, 454, 455, 456, 457, 458, 459, 512, 461, 512, + /* 2550 */ 512, 407, 512, 409, 512, 395, 512, 512, 512, 512, + /* 2560 */ 512, 512, 512, 512, 512, 512, 512, 407, 512, 409, + /* 2570 */ 512, 512, 448, 512, 512, 451, 512, 512, 454, 455, + /* 2580 */ 456, 457, 458, 459, 512, 461, 512, 512, 512, 512, + /* 2590 */ 512, 512, 448, 512, 512, 451, 512, 512, 454, 455, + /* 2600 */ 456, 457, 458, 459, 512, 461, 512, 354, 448, 512, + /* 2610 */ 512, 451, 512, 512, 454, 455, 456, 457, 458, 459, + /* 2620 */ 367, 461, 512, 512, 512, 512, 354, 512, 512, 512, + /* 2630 */ 512, 512, 512, 512, 512, 512, 512, 512, 512, 367, + /* 2640 */ 512, 512, 512, 354, 512, 512, 512, 512, 395, 512, + /* 2650 */ 512, 512, 512, 512, 512, 512, 367, 512, 512, 512, + /* 2660 */ 407, 512, 409, 512, 512, 512, 512, 395, 512, 512, + /* 2670 */ 512, 512, 512, 512, 512, 512, 512, 512, 512, 407, + /* 2680 */ 512, 409, 512, 512, 395, 512, 512, 512, 512, 512, + /* 2690 */ 512, 512, 512, 512, 512, 512, 407, 512, 409, 512, + /* 2700 */ 354, 448, 512, 512, 451, 512, 512, 454, 455, 456, + /* 2710 */ 457, 458, 459, 367, 461, 512, 512, 512, 512, 512, + /* 2720 */ 448, 354, 512, 451, 512, 512, 454, 455, 456, 457, + /* 2730 */ 458, 459, 512, 461, 367, 512, 512, 448, 354, 512, + /* 2740 */ 451, 395, 512, 454, 455, 456, 457, 458, 459, 512, + /* 2750 */ 461, 367, 512, 407, 512, 409, 512, 512, 354, 512, + /* 2760 */ 512, 512, 395, 512, 512, 512, 512, 512, 512, 512, + /* 2770 */ 512, 367, 512, 512, 407, 512, 409, 512, 512, 395, + /* 2780 */ 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, + /* 2790 */ 512, 407, 512, 409, 448, 512, 354, 451, 512, 395, + /* 2800 */ 454, 455, 456, 457, 458, 459, 512, 461, 512, 367, + /* 2810 */ 512, 407, 512, 409, 512, 448, 512, 512, 451, 512, + /* 2820 */ 512, 454, 455, 456, 457, 458, 459, 512, 461, 512, + /* 2830 */ 512, 512, 448, 354, 512, 451, 512, 395, 454, 455, + /* 2840 */ 456, 457, 458, 459, 512, 461, 367, 512, 512, 407, + /* 2850 */ 512, 409, 448, 512, 512, 451, 512, 512, 454, 455, + /* 2860 */ 456, 457, 458, 459, 512, 461, 512, 512, 512, 512, + /* 2870 */ 512, 512, 512, 512, 395, 512, 512, 512, 512, 512, + /* 2880 */ 512, 512, 512, 512, 512, 512, 407, 512, 409, 512, + /* 2890 */ 448, 512, 512, 451, 512, 512, 454, 455, 456, 457, + /* 2900 */ 458, 459, 512, 461, 512, 512, 512, 512, 512, 512, + /* 2910 */ 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, + /* 2920 */ 512, 512, 512, 512, 512, 512, 512, 448, 512, 512, + /* 2930 */ 451, 512, 512, 454, 455, 456, 457, 458, 459, 512, + /* 2940 */ 461, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 2950 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 2960 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 2970 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 2980 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 2990 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3000 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3010 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3020 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3030 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3040 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3050 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3060 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3070 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3080 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3090 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3100 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3110 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3120 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3130 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3140 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3150 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3160 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3170 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3180 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3190 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3200 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3210 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3220 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3230 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3240 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3250 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3260 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3270 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3280 */ 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, + /* 3290 */ 351, 351, }; -#define YY_SHIFT_COUNT (846) +#define YY_SHIFT_COUNT (851) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2413) +#define YY_SHIFT_MAX (2461) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 1300, 0, 244, 0, 489, 489, 489, 489, 489, 489, /* 10 */ 489, 489, 489, 489, 489, 489, 733, 977, 977, 1221, /* 20 */ 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, /* 30 */ 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, /* 40 */ 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, - /* 50 */ 977, 420, 439, 96, 210, 34, 130, 34, 34, 210, - /* 60 */ 210, 34, 1469, 34, 243, 1469, 1469, 322, 34, 1, - /* 70 */ 240, 131, 131, 1060, 1060, 240, 294, 501, 154, 154, - /* 80 */ 551, 131, 131, 131, 131, 131, 131, 131, 131, 131, - /* 90 */ 131, 131, 165, 238, 131, 131, 31, 1, 131, 165, - /* 100 */ 131, 1, 131, 131, 1, 131, 131, 1, 131, 1, - /* 110 */ 1, 1, 131, 532, 203, 203, 488, 634, 834, 834, - /* 120 */ 834, 834, 834, 834, 834, 834, 834, 834, 834, 834, - /* 130 */ 834, 834, 834, 834, 834, 834, 834, 437, 256, 294, - /* 140 */ 501, 555, 555, 763, 278, 278, 278, 137, 272, 272, - /* 150 */ 403, 763, 31, 512, 1, 1, 424, 1, 780, 1, - /* 160 */ 780, 780, 595, 884, 212, 212, 212, 212, 212, 212, - /* 170 */ 212, 212, 1695, 361, 657, 812, 611, 639, 118, 13, - /* 180 */ 629, 659, 738, 738, 777, 908, 814, 734, 734, 734, - /* 190 */ 640, 734, 330, 768, 1025, 419, 805, 94, 1025, 1025, - /* 200 */ 1029, 917, 576, 575, 917, 295, 894, 403, 1215, 1441, - /* 210 */ 1458, 1481, 1290, 31, 1481, 31, 1314, 1500, 1508, 1491, - /* 220 */ 1508, 1491, 1363, 1500, 1508, 1500, 1491, 1363, 1363, 1363, - /* 230 */ 1448, 1452, 1500, 1456, 1500, 1500, 1500, 1543, 1517, 1543, - /* 240 */ 1517, 1481, 31, 31, 1557, 31, 1562, 1572, 31, 1562, - /* 250 */ 31, 1575, 31, 31, 1500, 31, 1543, 1, 1, 1, - /* 260 */ 1, 1, 1, 1, 1, 1, 1, 1, 1500, 884, - /* 270 */ 884, 1543, 780, 780, 780, 1406, 1534, 1481, 532, 1628, - /* 280 */ 1442, 1446, 1557, 532, 1215, 1500, 780, 1373, 1378, 1373, - /* 290 */ 1378, 1370, 1471, 1373, 1375, 1379, 1389, 1215, 1367, 1382, - /* 300 */ 1397, 1422, 1508, 1681, 1588, 1433, 1562, 532, 532, 1378, - /* 310 */ 780, 780, 780, 780, 1378, 780, 1530, 532, 595, 532, - /* 320 */ 1508, 1630, 1631, 780, 1500, 532, 1723, 1713, 1543, 3083, - /* 330 */ 3083, 3083, 3083, 3083, 3083, 3083, 3083, 3083, 36, 1228, - /* 340 */ 197, 748, 1007, 81, 1045, 888, 15, 527, 1062, 995, - /* 350 */ 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 216, - /* 360 */ 148, 12, 802, 802, 226, 729, 10, 742, 843, 773, - /* 370 */ 732, 897, 747, 914, 914, 1019, 6, 605, 1019, 1019, - /* 380 */ 1019, 1249, 1066, 487, 370, 1202, 1028, 1122, 1154, 1168, - /* 390 */ 1170, 1172, 1229, 1247, 1240, 1273, 1287, 1292, 1093, 684, - /* 400 */ 1274, 1145, 1282, 1283, 1286, 1177, 1068, 1279, 1291, 1296, - /* 410 */ 1297, 1298, 1309, 1310, 1325, 1313, 433, 1320, 1268, 1350, - /* 420 */ 1407, 1408, 1410, 1414, 1419, 1254, 1285, 1299, 1335, 1337, - /* 430 */ 1301, 1431, 1766, 1767, 1770, 1728, 1774, 1739, 1550, 1741, - /* 440 */ 1742, 1744, 1556, 1784, 1748, 1749, 1560, 1751, 1790, 1564, - /* 450 */ 1793, 1757, 1805, 1769, 1807, 1786, 1810, 1775, 1589, 1816, - /* 460 */ 1608, 1819, 1610, 1611, 1619, 1623, 1826, 1833, 1837, 1640, - /* 470 */ 1642, 1840, 1842, 1696, 1794, 1798, 1849, 1813, 1851, 1852, - /* 480 */ 1817, 1802, 1855, 1808, 1860, 1823, 1861, 1870, 1872, 1824, - /* 490 */ 1874, 1875, 1877, 1887, 1889, 1892, 1715, 1844, 1882, 1718, - /* 500 */ 1884, 1885, 1894, 1895, 1896, 1897, 1898, 1900, 1901, 1902, - /* 510 */ 1903, 1904, 1907, 1908, 1909, 1910, 1912, 1918, 1920, 1865, - /* 520 */ 1915, 1876, 1922, 1923, 1925, 1926, 1927, 1928, 1930, 1919, - /* 530 */ 1943, 1796, 1945, 1800, 1950, 1811, 1951, 1953, 1934, 1916, - /* 540 */ 1942, 1917, 1968, 1905, 1932, 1971, 1911, 1973, 1921, 1974, - /* 550 */ 1977, 1947, 1940, 1946, 1992, 1962, 1952, 1963, 2004, 1969, - /* 560 */ 1956, 1966, 2009, 1975, 2010, 1970, 1972, 1978, 1964, 1967, - /* 570 */ 2003, 1979, 2018, 1976, 1980, 2020, 2021, 2023, 2024, 1984, - /* 580 */ 1834, 2029, 1964, 1982, 2032, 2033, 1965, 2034, 2035, 1999, - /* 590 */ 1989, 2001, 2041, 2008, 1995, 2005, 2048, 2012, 2000, 2011, - /* 600 */ 2050, 2015, 2007, 2013, 2054, 2056, 2059, 2060, 2061, 2062, - /* 610 */ 1948, 1954, 2027, 2043, 2068, 2036, 2037, 2038, 2039, 2040, - /* 620 */ 2042, 2044, 2045, 2051, 2052, 2058, 2063, 2047, 2064, 2072, - /* 630 */ 2065, 2088, 2075, 2099, 2080, 2053, 2103, 2082, 2070, 2105, - /* 640 */ 2108, 2109, 2074, 2113, 2077, 2115, 2094, 2097, 2081, 2083, - /* 650 */ 2084, 2016, 2026, 2123, 1949, 2028, 1929, 1964, 2090, 2136, - /* 660 */ 1955, 2104, 2118, 2142, 1938, 2124, 1983, 1960, 2148, 2149, - /* 670 */ 1985, 1981, 1987, 1988, 2150, 2119, 1878, 2049, 2066, 2069, - /* 680 */ 2121, 2073, 2122, 2076, 2078, 2140, 2151, 2085, 2091, 2092, - /* 690 */ 2093, 2086, 2152, 2133, 2134, 2095, 2155, 1913, 2089, 2096, - /* 700 */ 2189, 2162, 1924, 2169, 2170, 2171, 2173, 2174, 2175, 2106, - /* 710 */ 2107, 2164, 1957, 2183, 2168, 2218, 2219, 2117, 2178, 2125, - /* 720 */ 2114, 2132, 2135, 2138, 2057, 2141, 2225, 2184, 2046, 2153, - /* 730 */ 2143, 1964, 2180, 2216, 2156, 2006, 2159, 2254, 2236, 2055, - /* 740 */ 2172, 2158, 2176, 2177, 2185, 2179, 2227, 2186, 2187, 2228, - /* 750 */ 2188, 2256, 2079, 2190, 2165, 2191, 2244, 2247, 2193, 2194, - /* 760 */ 2258, 2197, 2198, 2261, 2200, 2201, 2264, 2203, 2204, 2268, - /* 770 */ 2206, 2207, 2274, 2210, 2163, 2195, 2196, 2211, 2212, 2281, - /* 780 */ 2214, 2288, 2221, 2281, 2281, 2296, 2257, 2270, 2289, 2295, - /* 790 */ 2305, 2307, 2309, 2311, 2312, 2313, 2314, 2276, 2251, 2277, - /* 800 */ 2252, 2323, 2320, 2321, 2322, 2340, 2326, 2328, 2329, 2297, - /* 810 */ 2051, 2336, 2052, 2339, 2341, 2342, 2343, 2355, 2344, 2382, - /* 820 */ 2346, 2334, 2347, 2386, 2359, 2350, 2356, 2399, 2366, 2353, - /* 830 */ 2363, 2406, 2370, 2357, 2367, 2410, 2374, 2375, 2413, 2392, - /* 840 */ 2383, 2393, 2396, 2397, 2400, 2402, 2398, + /* 50 */ 977, 487, 567, 96, 210, 34, 92, 34, 34, 210, + /* 60 */ 210, 34, 1469, 34, 243, 1469, 1469, 675, 34, 131, + /* 70 */ 240, 165, 165, 857, 857, 240, 190, 330, 154, 154, + /* 80 */ 1, 165, 165, 165, 165, 165, 165, 165, 165, 165, + /* 90 */ 165, 165, 256, 320, 165, 165, 31, 131, 165, 256, + /* 100 */ 165, 131, 165, 165, 131, 165, 165, 131, 165, 131, + /* 110 */ 131, 131, 165, 405, 203, 203, 488, 748, 837, 837, + /* 120 */ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + /* 130 */ 837, 837, 837, 837, 837, 837, 837, 1196, 409, 190, + /* 140 */ 330, 202, 202, 914, 413, 413, 413, 137, 334, 334, + /* 150 */ 1104, 914, 31, 442, 131, 131, 299, 131, 639, 131, + /* 160 */ 639, 639, 741, 763, 212, 212, 212, 212, 212, 212, + /* 170 */ 212, 212, 2113, 361, 657, 611, 15, 350, 380, 118, + /* 180 */ 878, 882, 255, 255, 278, 528, 430, 917, 917, 917, + /* 190 */ 892, 917, 905, 484, 33, 431, 950, 972, 33, 33, + /* 200 */ 1026, 983, 799, 505, 983, 532, 509, 1104, 1169, 1399, + /* 210 */ 1412, 1457, 1268, 31, 1457, 31, 1292, 1470, 1478, 1456, + /* 220 */ 1478, 1456, 1329, 1470, 1478, 1470, 1456, 1329, 1329, 1329, + /* 230 */ 1416, 1419, 1470, 1426, 1470, 1470, 1470, 1515, 1494, 1515, + /* 240 */ 1494, 1457, 31, 31, 1532, 31, 1538, 1539, 31, 1538, + /* 250 */ 31, 1546, 31, 31, 1470, 31, 1515, 131, 131, 131, + /* 260 */ 131, 131, 131, 131, 131, 131, 131, 131, 1470, 763, + /* 270 */ 763, 1515, 639, 639, 639, 1385, 1485, 1457, 405, 1608, + /* 280 */ 1421, 1423, 1532, 405, 1169, 1470, 639, 1349, 1356, 1349, + /* 290 */ 1356, 1357, 1466, 1349, 1376, 1382, 1387, 1169, 1377, 1379, + /* 300 */ 1383, 1408, 1478, 1660, 1567, 1417, 1538, 405, 405, 1356, + /* 310 */ 639, 639, 639, 639, 1356, 639, 1513, 405, 741, 405, + /* 320 */ 1478, 1609, 1624, 639, 1470, 405, 1717, 1709, 1515, 2941, + /* 330 */ 2941, 2941, 2941, 2941, 2941, 2941, 2941, 2941, 36, 480, + /* 340 */ 197, 887, 915, 81, 804, 510, 1097, 1191, 1079, 879, + /* 350 */ 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 216, + /* 360 */ 148, 12, 988, 988, 252, 217, 10, 146, 658, 1100, + /* 370 */ 608, 1030, 187, 620, 620, 918, 6, 864, 918, 918, + /* 380 */ 918, 919, 680, 727, 1154, 1165, 962, 1240, 1162, 1167, + /* 390 */ 1168, 1172, 1266, 1274, 1146, 1283, 1284, 1290, 1074, 1211, + /* 400 */ 1234, 1228, 1255, 1263, 1264, 1276, 1157, 1064, 1107, 1288, + /* 410 */ 1289, 1291, 1302, 1306, 1310, 1312, 1313, 410, 1319, 1246, + /* 420 */ 1322, 1324, 1325, 1341, 1370, 1371, 1243, 1122, 1126, 1314, + /* 430 */ 1348, 1267, 1391, 1768, 1778, 1780, 1736, 1782, 1746, 1557, + /* 440 */ 1748, 1750, 1751, 1562, 1794, 1758, 1760, 1580, 1771, 1809, + /* 450 */ 1584, 1813, 1777, 1815, 1779, 1817, 1796, 1819, 1783, 1599, + /* 460 */ 1834, 1613, 1824, 1615, 1616, 1622, 1626, 1829, 1830, 1831, + /* 470 */ 1634, 1639, 1837, 1838, 1691, 1791, 1795, 1843, 1811, 1846, + /* 480 */ 1849, 1816, 1799, 1852, 1806, 1856, 1820, 1866, 1867, 1869, + /* 490 */ 1821, 1872, 1873, 1874, 1878, 1879, 1880, 1716, 1845, 1883, + /* 500 */ 1719, 1885, 1888, 1890, 1891, 1901, 1903, 1904, 1905, 1906, + /* 510 */ 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1920, 1921, + /* 520 */ 1882, 1932, 1853, 1936, 1937, 1938, 1939, 1941, 1944, 1945, + /* 530 */ 1896, 1946, 1786, 1947, 1801, 1949, 1804, 1951, 1952, 1931, + /* 540 */ 1915, 1940, 1916, 1954, 1894, 1919, 1960, 1899, 1961, 1902, + /* 550 */ 1963, 1968, 1942, 1922, 1927, 1971, 1943, 1923, 1933, 1976, + /* 560 */ 1948, 1926, 1953, 1978, 1956, 1982, 1955, 1959, 1950, 1964, + /* 570 */ 1967, 1972, 1974, 1998, 1965, 1970, 2025, 2026, 2027, 2039, + /* 580 */ 1987, 1839, 2030, 1964, 1984, 2031, 2034, 1969, 2035, 2036, + /* 590 */ 2000, 1993, 2003, 2042, 2009, 1996, 2007, 2051, 2017, 2004, + /* 600 */ 2015, 2058, 2022, 2010, 2018, 2062, 2063, 2064, 2065, 2066, + /* 610 */ 2067, 1958, 1962, 2032, 2052, 2071, 2040, 2041, 2043, 2045, + /* 620 */ 2046, 2047, 2048, 2050, 2055, 2056, 2053, 2059, 2054, 2068, + /* 630 */ 2079, 2070, 2103, 2084, 2107, 2086, 2060, 2111, 2099, 2088, + /* 640 */ 2126, 2127, 2128, 2092, 2130, 2094, 2133, 2114, 2115, 2101, + /* 650 */ 2102, 2112, 2044, 2061, 2150, 1973, 2072, 1957, 1964, 2104, + /* 660 */ 2154, 1975, 2121, 2138, 2161, 1966, 2140, 1985, 1995, 2169, + /* 670 */ 2170, 1990, 1992, 2001, 1997, 2179, 2151, 1917, 2078, 2080, + /* 680 */ 2082, 2083, 2155, 2156, 2089, 2145, 2093, 2147, 2097, 2095, + /* 690 */ 2172, 2173, 2100, 2109, 2116, 2117, 2118, 2176, 2153, 2171, + /* 700 */ 2120, 2188, 1979, 2123, 2125, 2222, 2195, 1980, 2192, 2197, + /* 710 */ 2198, 2199, 2200, 2201, 2131, 2134, 2196, 1988, 2208, 2206, + /* 720 */ 2244, 2259, 2157, 2218, 2159, 2162, 2165, 2168, 2180, 2075, + /* 730 */ 2182, 2262, 2221, 2085, 2183, 2152, 1964, 2227, 2234, 2178, + /* 740 */ 2037, 2181, 2290, 2269, 2069, 2189, 2187, 2191, 2194, 2193, + /* 750 */ 2202, 2250, 2204, 2205, 2257, 2207, 2286, 2077, 2209, 2203, + /* 760 */ 2210, 2280, 2282, 2214, 2216, 2285, 2219, 2220, 2293, 2224, + /* 770 */ 2225, 2295, 2228, 2226, 2299, 2230, 2231, 2301, 2233, 2223, + /* 780 */ 2232, 2235, 2236, 2237, 2276, 2240, 2305, 2241, 2276, 2276, + /* 790 */ 2328, 2296, 2291, 2324, 2330, 2333, 2334, 2343, 2344, 2347, + /* 800 */ 2350, 2357, 2319, 2298, 2323, 2303, 2369, 2368, 2370, 2371, + /* 810 */ 2387, 2373, 2374, 2375, 2335, 2055, 2377, 2056, 2378, 2380, + /* 820 */ 2382, 2385, 2399, 2386, 2425, 2389, 2376, 2388, 2428, 2392, + /* 830 */ 2381, 2391, 2431, 2397, 2400, 2393, 2437, 2403, 2402, 2401, + /* 840 */ 2455, 2420, 2423, 2461, 2441, 2438, 2451, 2443, 2452, 2453, + /* 850 */ 2458, 2456, }; #define YY_REDUCE_COUNT (337) -#define YY_REDUCE_MIN (-463) -#define YY_REDUCE_MAX (2622) +#define YY_REDUCE_MIN (-464) +#define YY_REDUCE_MAX (2479) static const short yy_reduce_ofst[] = { - /* 0 */ 280, -308, 150, 181, 395, 425, 493, 638, 736, 979, - /* 10 */ 248, 1131, 1158, 1227, 1342, 1374, -81, 902, 1409, 1482, - /* 20 */ 1505, 720, 1525, 1540, 1636, 1672, 1704, 1781, 1797, 1815, - /* 30 */ 1880, 1914, 1937, 1994, 2067, 2087, 2145, 2160, 2182, 2240, - /* 40 */ 2255, 2275, 2348, 2368, 2385, 2454, 2512, 2527, 2549, 2607, - /* 50 */ 2622, -310, -217, -425, 38, -418, 769, 771, 910, -172, - /* 60 */ -156, 948, -381, -438, -257, 126, 149, -463, -300, 363, - /* 70 */ -324, -326, 52, -358, -202, -335, -218, 264, -90, 158, - /* 80 */ -84, -152, -98, 172, 187, -134, 91, 199, 331, 411, - /* 90 */ 478, 285, -54, -316, 504, 545, 159, 189, 652, 282, - /* 100 */ 697, 401, 714, 758, -368, 781, 784, 499, 786, 324, - /* 110 */ 535, 372, 775, -312, -422, -422, 47, -280, -353, 39, - /* 120 */ 354, 533, 564, 599, 601, 604, 694, 712, 719, 776, - /* 130 */ 803, 808, 831, 832, 846, 851, 853, -185, -89, 55, - /* 140 */ 99, 221, 622, 623, -89, 222, 589, 407, 534, 647, - /* 150 */ 627, 737, 408, 250, 703, 745, 624, 637, 756, 754, - /* 160 */ 799, 833, 515, 889, -392, -363, 566, 571, 614, 648, - /* 170 */ 743, 614, 692, 789, 841, 887, 824, 837, 982, 880, - /* 180 */ 984, 984, 994, 998, 962, 1020, 967, 891, 896, 898, - /* 190 */ 968, 903, 984, 1053, 1005, 1048, 1037, 1041, 1059, 1061, - /* 200 */ 984, 1004, 1004, 985, 1004, 1006, 1002, 1104, 1063, 1049, - /* 210 */ 1054, 1064, 1071, 1134, 1069, 1135, 1087, 1156, 1169, 1123, - /* 220 */ 1174, 1126, 1132, 1178, 1179, 1181, 1133, 1137, 1138, 1139, - /* 230 */ 1176, 1180, 1191, 1183, 1195, 1196, 1197, 1207, 1206, 1211, - /* 240 */ 1208, 1130, 1200, 1201, 1171, 1209, 1223, 1163, 1225, 1230, - /* 250 */ 1226, 1182, 1232, 1233, 1236, 1235, 1252, 1234, 1237, 1238, - /* 260 */ 1242, 1243, 1244, 1245, 1246, 1248, 1250, 1251, 1255, 1261, - /* 270 */ 1263, 1264, 1218, 1220, 1241, 1189, 1203, 1210, 1271, 1212, - /* 280 */ 1216, 1219, 1253, 1277, 1239, 1293, 1256, 1167, 1262, 1173, - /* 290 */ 1265, 1175, 1184, 1185, 1190, 1204, 1213, 1258, 1162, 1186, - /* 300 */ 1194, 1004, 1336, 1257, 1222, 1259, 1343, 1339, 1340, 1302, - /* 310 */ 1307, 1318, 1319, 1322, 1305, 1326, 1311, 1344, 1345, 1361, - /* 320 */ 1368, 1269, 1346, 1341, 1376, 1371, 1394, 1393, 1395, 1321, - /* 330 */ 1317, 1338, 1347, 1377, 1381, 1383, 1388, 1413, + /* 0 */ 1185, -309, 149, 394, 427, 671, 694, 729, 922, 980, + /* 10 */ 247, 1130, 1153, 1188, 1287, 1318, -82, 1345, 502, 1403, + /* 20 */ 1438, 1468, 1533, 1548, 1563, 1643, 1661, 1686, 1756, 1792, + /* 30 */ 1823, 1898, 1918, 1934, 1991, 2011, 2029, 2049, 2087, 2124, + /* 40 */ 2144, 2160, 2253, 2272, 2289, 2346, 2367, 2384, 2404, 2442, + /* 50 */ 2479, -311, -218, -426, 72, -419, 284, 326, 525, -173, + /* 60 */ 56, 762, -382, -439, -258, 122, 246, -464, -301, 125, + /* 70 */ -325, -327, 51, -359, -203, -336, -219, 113, -91, -75, + /* 80 */ -67, 385, 421, 438, 477, -135, 296, 232, 504, 550, + /* 90 */ 678, 301, -55, -317, 683, 687, -375, 128, 690, 309, + /* 100 */ 749, 162, 805, 808, 397, 871, 880, 400, 803, 428, + /* 110 */ 419, 443, 884, -313, -423, -423, 316, -321, -44, 50, + /* 120 */ 171, 287, 319, 356, 500, 503, 511, 519, 533, 640, + /* 130 */ 644, 652, 653, 668, 670, 754, 802, -186, -23, 21, + /* 140 */ -195, 454, 594, 563, -23, 415, 786, 173, -393, 144, + /* 150 */ 314, 868, 227, 363, -392, 554, 601, 469, 700, 618, + /* 160 */ 769, 848, 883, 408, 566, 595, 613, 706, 812, 818, + /* 170 */ 906, 812, 465, 931, 943, 896, 810, 834, 846, 978, + /* 180 */ 961, 961, 979, 999, 966, 1027, 973, 900, 902, 908, + /* 190 */ 982, 921, 961, 1042, 993, 1048, 1010, 985, 997, 1000, + /* 200 */ 961, 942, 942, 923, 942, 955, 957, 1055, 1016, 1001, + /* 210 */ 1009, 1038, 1036, 1111, 1045, 1113, 1056, 1127, 1133, 1086, + /* 220 */ 1136, 1089, 1096, 1144, 1147, 1145, 1099, 1103, 1105, 1106, + /* 230 */ 1138, 1149, 1158, 1161, 1174, 1175, 1177, 1186, 1183, 1190, + /* 240 */ 1187, 1109, 1178, 1179, 1148, 1181, 1193, 1131, 1189, 1197, + /* 250 */ 1192, 1151, 1194, 1195, 1202, 1200, 1212, 1182, 1184, 1198, + /* 260 */ 1199, 1204, 1205, 1210, 1218, 1222, 1223, 1227, 1214, 1219, + /* 270 */ 1225, 1231, 1209, 1216, 1217, 1206, 1207, 1208, 1254, 1226, + /* 280 */ 1201, 1215, 1224, 1258, 1203, 1269, 1230, 1164, 1232, 1171, + /* 290 */ 1233, 1170, 1173, 1220, 1180, 1213, 1236, 1244, 1238, 1176, + /* 300 */ 1229, 942, 1316, 1235, 1242, 1245, 1321, 1320, 1327, 1270, + /* 310 */ 1294, 1298, 1299, 1301, 1272, 1303, 1286, 1336, 1323, 1342, + /* 320 */ 1359, 1259, 1333, 1330, 1368, 1363, 1394, 1393, 1392, 1328, + /* 330 */ 1315, 1335, 1337, 1367, 1375, 1378, 1397, 1413, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 10 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 20 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 30 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 40 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 50 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 60 */ 1896, 2236, 1896, 1896, 2199, 1896, 1896, 1896, 1896, 1896, - /* 70 */ 1896, 1896, 1896, 1896, 1896, 1896, 2206, 1896, 1896, 1896, - /* 80 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 90 */ 1896, 1896, 1896, 1896, 1896, 1896, 1995, 1896, 1896, 1896, - /* 100 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 110 */ 1896, 1896, 1896, 1993, 2439, 1896, 1896, 1896, 1896, 1896, - /* 120 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 130 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 2451, 1896, - /* 140 */ 1896, 1967, 1967, 1896, 2451, 2451, 2451, 1993, 2411, 2411, - /* 150 */ 1896, 1896, 1995, 2274, 1896, 1896, 1896, 1896, 1896, 1896, - /* 160 */ 1896, 1896, 2118, 1926, 1896, 1896, 1896, 1896, 2142, 1896, - /* 170 */ 1896, 1896, 2262, 1896, 1896, 2480, 2540, 1896, 1896, 2483, - /* 180 */ 1896, 1896, 1896, 1896, 2211, 1896, 2470, 1896, 1896, 1896, - /* 190 */ 1896, 1896, 1896, 1896, 1896, 1896, 2071, 2256, 1896, 1896, - /* 200 */ 1896, 2443, 2457, 2524, 2444, 2441, 2464, 1896, 2474, 1896, - /* 210 */ 2299, 1896, 2288, 1995, 1896, 1995, 2249, 2194, 1896, 2204, - /* 220 */ 1896, 2204, 2201, 1896, 1896, 1896, 2204, 2201, 2201, 2201, - /* 230 */ 2060, 2056, 1896, 2054, 1896, 1896, 1896, 1896, 1951, 1896, - /* 240 */ 1951, 1896, 1995, 1995, 1896, 1995, 1896, 1896, 1995, 1896, - /* 250 */ 1995, 1896, 1995, 1995, 1896, 1995, 1896, 1896, 1896, 1896, - /* 260 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 270 */ 1896, 1896, 1896, 1896, 1896, 2286, 2272, 1896, 1993, 1896, - /* 280 */ 2260, 2258, 1896, 1993, 2474, 1896, 1896, 2494, 2489, 2494, - /* 290 */ 2489, 2508, 2504, 2494, 2513, 2510, 2476, 2474, 2543, 2530, - /* 300 */ 2526, 2457, 1896, 1896, 2462, 2460, 1896, 1993, 1993, 2489, - /* 310 */ 1896, 1896, 1896, 1896, 2489, 1896, 1896, 1993, 1896, 1993, - /* 320 */ 1896, 1896, 2087, 1896, 1896, 1993, 1896, 1935, 1896, 2251, - /* 330 */ 2277, 2232, 2232, 2121, 2121, 2121, 1996, 1901, 1896, 1896, - /* 340 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 350 */ 2507, 2506, 2364, 1896, 2415, 2414, 2413, 2404, 2363, 2083, - /* 360 */ 1896, 1896, 2362, 2361, 1896, 1896, 1896, 1896, 1896, 1896, - /* 370 */ 1896, 1896, 1896, 2223, 2222, 2355, 1896, 1896, 2356, 2354, - /* 380 */ 2353, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 390 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 400 */ 1896, 1896, 1896, 1896, 1896, 1896, 2527, 2531, 1896, 1896, - /* 410 */ 1896, 1896, 1896, 1896, 2440, 1896, 1896, 1896, 2335, 1896, - /* 420 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 430 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 440 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 450 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 460 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 470 */ 1896, 1896, 1896, 2200, 1896, 1896, 1896, 1896, 1896, 1896, - /* 480 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 490 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 500 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 510 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 520 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 530 */ 1896, 1896, 1896, 1896, 1896, 2215, 1896, 1896, 1896, 1896, - /* 540 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 550 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 560 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1940, 2342, 1896, - /* 570 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 580 */ 1896, 1896, 2345, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 590 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 600 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 610 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 620 */ 1896, 1896, 1896, 2035, 2034, 1896, 1896, 1896, 1896, 1896, - /* 630 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 640 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 650 */ 1896, 2346, 1896, 1896, 1896, 1896, 1896, 2337, 1896, 1896, - /* 660 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 670 */ 1896, 1896, 1896, 1896, 2523, 2477, 1896, 1896, 1896, 1896, - /* 680 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 690 */ 1896, 1896, 1896, 1896, 2335, 1896, 2505, 1896, 1896, 2521, - /* 700 */ 1896, 2525, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 2450, - /* 710 */ 2446, 1896, 1896, 2442, 1896, 1896, 1896, 1896, 1896, 1896, - /* 720 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 730 */ 1896, 2334, 1896, 2401, 1896, 1896, 1896, 2435, 1896, 1896, - /* 740 */ 2386, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 750 */ 2346, 1896, 2349, 1896, 1896, 1896, 1896, 1896, 2115, 1896, - /* 760 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 770 */ 1896, 1896, 1896, 1896, 2099, 2097, 2096, 2095, 1896, 2128, - /* 780 */ 1896, 1896, 1896, 2124, 2123, 1896, 1896, 1896, 1896, 1896, - /* 790 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 800 */ 1896, 2014, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 810 */ 2006, 1896, 2005, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 820 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 830 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, - /* 840 */ 1925, 1896, 1896, 1896, 1896, 1896, 1896, + /* 0 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 10 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 20 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 30 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 40 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 50 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 60 */ 1905, 2245, 1905, 1905, 2208, 1905, 1905, 1905, 1905, 1905, + /* 70 */ 1905, 1905, 1905, 1905, 1905, 1905, 2215, 1905, 1905, 1905, + /* 80 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 90 */ 1905, 1905, 1905, 1905, 1905, 1905, 2004, 1905, 1905, 1905, + /* 100 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 110 */ 1905, 1905, 1905, 2002, 2448, 1905, 1905, 1905, 1905, 1905, + /* 120 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 130 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 2460, 1905, + /* 140 */ 1905, 1976, 1976, 1905, 2460, 2460, 2460, 2002, 2420, 2420, + /* 150 */ 1905, 1905, 2004, 2283, 1905, 1905, 1905, 1905, 1905, 1905, + /* 160 */ 1905, 1905, 2127, 1935, 1905, 1905, 1905, 1905, 2151, 1905, + /* 170 */ 1905, 1905, 2271, 1905, 1905, 2489, 2551, 1905, 2492, 1905, + /* 180 */ 1905, 1905, 1905, 1905, 2220, 1905, 2479, 1905, 1905, 1905, + /* 190 */ 1905, 1905, 1905, 1905, 1905, 1905, 2080, 2265, 1905, 1905, + /* 200 */ 1905, 2452, 2466, 2535, 2453, 2450, 2473, 1905, 2483, 1905, + /* 210 */ 2308, 1905, 2297, 2004, 1905, 2004, 2258, 2203, 1905, 2213, + /* 220 */ 1905, 2213, 2210, 1905, 1905, 1905, 2213, 2210, 2210, 2210, + /* 230 */ 2069, 2065, 1905, 2063, 1905, 1905, 1905, 1905, 1960, 1905, + /* 240 */ 1960, 1905, 2004, 2004, 1905, 2004, 1905, 1905, 2004, 1905, + /* 250 */ 2004, 1905, 2004, 2004, 1905, 2004, 1905, 1905, 1905, 1905, + /* 260 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 270 */ 1905, 1905, 1905, 1905, 1905, 2295, 2281, 1905, 2002, 1905, + /* 280 */ 2269, 2267, 1905, 2002, 2483, 1905, 1905, 2505, 2500, 2505, + /* 290 */ 2500, 2519, 2515, 2505, 2524, 2521, 2485, 2483, 2554, 2541, + /* 300 */ 2537, 2466, 1905, 1905, 2471, 2469, 1905, 2002, 2002, 2500, + /* 310 */ 1905, 1905, 1905, 1905, 2500, 1905, 1905, 2002, 1905, 2002, + /* 320 */ 1905, 1905, 2096, 1905, 1905, 2002, 1905, 1944, 1905, 2260, + /* 330 */ 2286, 2241, 2241, 2130, 2130, 2130, 2005, 1910, 1905, 1905, + /* 340 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 350 */ 2518, 2517, 2373, 1905, 2424, 2423, 2422, 2413, 2372, 2092, + /* 360 */ 1905, 1905, 2371, 2370, 1905, 1905, 1905, 1905, 1905, 1905, + /* 370 */ 1905, 1905, 1905, 2232, 2231, 2364, 1905, 1905, 2365, 2363, + /* 380 */ 2362, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 390 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 400 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 2538, 2542, 1905, + /* 410 */ 1905, 1905, 1905, 1905, 1905, 2449, 1905, 1905, 1905, 2344, + /* 420 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 430 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 440 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 450 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 460 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 470 */ 1905, 1905, 1905, 1905, 2209, 1905, 1905, 1905, 1905, 1905, + /* 480 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 490 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 500 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 510 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 520 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 530 */ 1905, 1905, 1905, 1905, 1905, 1905, 2224, 1905, 1905, 1905, + /* 540 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 550 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 560 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1949, 2351, + /* 570 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 580 */ 1905, 1905, 1905, 2354, 1905, 1905, 1905, 1905, 1905, 1905, + /* 590 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 600 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 610 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 620 */ 1905, 1905, 1905, 1905, 2044, 2043, 1905, 1905, 1905, 1905, + /* 630 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 640 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 650 */ 1905, 1905, 2355, 1905, 1905, 1905, 1905, 1905, 2346, 1905, + /* 660 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 670 */ 1905, 1905, 1905, 1905, 1905, 2534, 2486, 1905, 1905, 1905, + /* 680 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 690 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 2344, + /* 700 */ 1905, 2516, 1905, 1905, 2532, 1905, 2536, 1905, 1905, 1905, + /* 710 */ 1905, 1905, 1905, 1905, 2459, 2455, 1905, 1905, 2451, 1905, + /* 720 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 730 */ 1905, 1905, 1905, 1905, 1905, 1905, 2343, 1905, 2410, 1905, + /* 740 */ 1905, 1905, 2444, 1905, 1905, 2395, 1905, 1905, 1905, 1905, + /* 750 */ 1905, 1905, 1905, 1905, 1905, 2355, 1905, 2358, 1905, 1905, + /* 760 */ 1905, 1905, 1905, 2124, 1905, 1905, 1905, 1905, 1905, 1905, + /* 770 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 2108, + /* 780 */ 2106, 2105, 2104, 1905, 2137, 1905, 1905, 1905, 2133, 2132, + /* 790 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 800 */ 1905, 1905, 1905, 1905, 1905, 1905, 2023, 1905, 1905, 1905, + /* 810 */ 1905, 1905, 1905, 1905, 1905, 2015, 1905, 2014, 1905, 1905, + /* 820 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 830 */ 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, + /* 840 */ 1905, 1905, 1905, 1905, 1905, 1934, 1905, 1905, 1905, 1905, + /* 850 */ 1905, 1905, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1568,7 +1540,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* BWLIMIT => nothing */ 0, /* START => nothing */ 0, /* TIMESTAMP => nothing */ - 300, /* END => ABORT */ + 301, /* END => ABORT */ 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ 0, /* NK_RP => nothing */ @@ -1638,7 +1610,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* VNODES => nothing */ 0, /* ALIVE => nothing */ 0, /* VIEWS => nothing */ - 300, /* VIEW => ABORT */ + 301, /* VIEW => ABORT */ 0, /* COMPACTS => nothing */ 0, /* NORMAL => nothing */ 0, /* CHILD => nothing */ @@ -1744,6 +1716,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* SESSION => nothing */ 0, /* STATE_WINDOW => nothing */ 0, /* EVENT_WINDOW => nothing */ + 0, /* COUNT_WINDOW => nothing */ 0, /* SLIDING => nothing */ 0, /* FILL => nothing */ 0, /* VALUE => nothing */ @@ -1764,55 +1737,55 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 300, /* AFTER => ABORT */ - 300, /* ATTACH => ABORT */ - 300, /* BEFORE => ABORT */ - 300, /* BEGIN => ABORT */ - 300, /* BITAND => ABORT */ - 300, /* BITNOT => ABORT */ - 300, /* BITOR => ABORT */ - 300, /* BLOCKS => ABORT */ - 300, /* CHANGE => ABORT */ - 300, /* COMMA => ABORT */ - 300, /* CONCAT => ABORT */ - 300, /* CONFLICT => ABORT */ - 300, /* COPY => ABORT */ - 300, /* DEFERRED => ABORT */ - 300, /* DELIMITERS => ABORT */ - 300, /* DETACH => ABORT */ - 300, /* DIVIDE => ABORT */ - 300, /* DOT => ABORT */ - 300, /* EACH => ABORT */ - 300, /* FAIL => ABORT */ - 300, /* FILE => ABORT */ - 300, /* FOR => ABORT */ - 300, /* GLOB => ABORT */ - 300, /* ID => ABORT */ - 300, /* IMMEDIATE => ABORT */ - 300, /* IMPORT => ABORT */ - 300, /* INITIALLY => ABORT */ - 300, /* INSTEAD => ABORT */ - 300, /* ISNULL => ABORT */ - 300, /* KEY => ABORT */ - 300, /* MODULES => ABORT */ - 300, /* NK_BITNOT => ABORT */ - 300, /* NK_SEMI => ABORT */ - 300, /* NOTNULL => ABORT */ - 300, /* OF => ABORT */ - 300, /* PLUS => ABORT */ - 300, /* PRIVILEGE => ABORT */ - 300, /* RAISE => ABORT */ - 300, /* RESTRICT => ABORT */ - 300, /* ROW => ABORT */ - 300, /* SEMI => ABORT */ - 300, /* STAR => ABORT */ - 300, /* STATEMENT => ABORT */ - 300, /* STRICT => ABORT */ - 300, /* STRING => ABORT */ - 300, /* TIMES => ABORT */ - 300, /* VALUES => ABORT */ - 300, /* VARIABLE => ABORT */ - 300, /* WAL => ABORT */ + 301, /* AFTER => ABORT */ + 301, /* ATTACH => ABORT */ + 301, /* BEFORE => ABORT */ + 301, /* BEGIN => ABORT */ + 301, /* BITAND => ABORT */ + 301, /* BITNOT => ABORT */ + 301, /* BITOR => ABORT */ + 301, /* BLOCKS => ABORT */ + 301, /* CHANGE => ABORT */ + 301, /* COMMA => ABORT */ + 301, /* CONCAT => ABORT */ + 301, /* CONFLICT => ABORT */ + 301, /* COPY => ABORT */ + 301, /* DEFERRED => ABORT */ + 301, /* DELIMITERS => ABORT */ + 301, /* DETACH => ABORT */ + 301, /* DIVIDE => ABORT */ + 301, /* DOT => ABORT */ + 301, /* EACH => ABORT */ + 301, /* FAIL => ABORT */ + 301, /* FILE => ABORT */ + 301, /* FOR => ABORT */ + 301, /* GLOB => ABORT */ + 301, /* ID => ABORT */ + 301, /* IMMEDIATE => ABORT */ + 301, /* IMPORT => ABORT */ + 301, /* INITIALLY => ABORT */ + 301, /* INSTEAD => ABORT */ + 301, /* ISNULL => ABORT */ + 301, /* KEY => ABORT */ + 301, /* MODULES => ABORT */ + 301, /* NK_BITNOT => ABORT */ + 301, /* NK_SEMI => ABORT */ + 301, /* NOTNULL => ABORT */ + 301, /* OF => ABORT */ + 301, /* PLUS => ABORT */ + 301, /* PRIVILEGE => ABORT */ + 301, /* RAISE => ABORT */ + 301, /* RESTRICT => ABORT */ + 301, /* ROW => ABORT */ + 301, /* SEMI => ABORT */ + 301, /* STAR => ABORT */ + 301, /* STATEMENT => ABORT */ + 301, /* STRICT => ABORT */ + 301, /* STRING => ABORT */ + 301, /* TIMES => ABORT */ + 301, /* VALUES => ABORT */ + 301, /* VARIABLE => ABORT */ + 301, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -2182,236 +2155,237 @@ static const char *const yyTokenName[] = { /* 278 */ "SESSION", /* 279 */ "STATE_WINDOW", /* 280 */ "EVENT_WINDOW", - /* 281 */ "SLIDING", - /* 282 */ "FILL", - /* 283 */ "VALUE", - /* 284 */ "VALUE_F", - /* 285 */ "NONE", - /* 286 */ "PREV", - /* 287 */ "NULL_F", - /* 288 */ "LINEAR", - /* 289 */ "NEXT", - /* 290 */ "HAVING", - /* 291 */ "RANGE", - /* 292 */ "EVERY", - /* 293 */ "ORDER", - /* 294 */ "SLIMIT", - /* 295 */ "SOFFSET", - /* 296 */ "LIMIT", - /* 297 */ "OFFSET", - /* 298 */ "ASC", - /* 299 */ "NULLS", - /* 300 */ "ABORT", - /* 301 */ "AFTER", - /* 302 */ "ATTACH", - /* 303 */ "BEFORE", - /* 304 */ "BEGIN", - /* 305 */ "BITAND", - /* 306 */ "BITNOT", - /* 307 */ "BITOR", - /* 308 */ "BLOCKS", - /* 309 */ "CHANGE", - /* 310 */ "COMMA", - /* 311 */ "CONCAT", - /* 312 */ "CONFLICT", - /* 313 */ "COPY", - /* 314 */ "DEFERRED", - /* 315 */ "DELIMITERS", - /* 316 */ "DETACH", - /* 317 */ "DIVIDE", - /* 318 */ "DOT", - /* 319 */ "EACH", - /* 320 */ "FAIL", - /* 321 */ "FILE", - /* 322 */ "FOR", - /* 323 */ "GLOB", - /* 324 */ "ID", - /* 325 */ "IMMEDIATE", - /* 326 */ "IMPORT", - /* 327 */ "INITIALLY", - /* 328 */ "INSTEAD", - /* 329 */ "ISNULL", - /* 330 */ "KEY", - /* 331 */ "MODULES", - /* 332 */ "NK_BITNOT", - /* 333 */ "NK_SEMI", - /* 334 */ "NOTNULL", - /* 335 */ "OF", - /* 336 */ "PLUS", - /* 337 */ "PRIVILEGE", - /* 338 */ "RAISE", - /* 339 */ "RESTRICT", - /* 340 */ "ROW", - /* 341 */ "SEMI", - /* 342 */ "STAR", - /* 343 */ "STATEMENT", - /* 344 */ "STRICT", - /* 345 */ "STRING", - /* 346 */ "TIMES", - /* 347 */ "VALUES", - /* 348 */ "VARIABLE", - /* 349 */ "WAL", - /* 350 */ "cmd", - /* 351 */ "account_options", - /* 352 */ "alter_account_options", - /* 353 */ "literal", - /* 354 */ "alter_account_option", - /* 355 */ "ip_range_list", - /* 356 */ "white_list", - /* 357 */ "white_list_opt", - /* 358 */ "user_name", - /* 359 */ "sysinfo_opt", - /* 360 */ "privileges", - /* 361 */ "priv_level", - /* 362 */ "with_opt", - /* 363 */ "priv_type_list", - /* 364 */ "priv_type", - /* 365 */ "db_name", - /* 366 */ "table_name", - /* 367 */ "topic_name", - /* 368 */ "search_condition", - /* 369 */ "dnode_endpoint", - /* 370 */ "force_opt", - /* 371 */ "unsafe_opt", - /* 372 */ "not_exists_opt", - /* 373 */ "db_options", - /* 374 */ "exists_opt", - /* 375 */ "alter_db_options", - /* 376 */ "speed_opt", - /* 377 */ "start_opt", - /* 378 */ "end_opt", - /* 379 */ "integer_list", - /* 380 */ "variable_list", - /* 381 */ "retention_list", - /* 382 */ "signed", - /* 383 */ "alter_db_option", - /* 384 */ "retention", - /* 385 */ "full_table_name", - /* 386 */ "column_def_list", - /* 387 */ "tags_def_opt", - /* 388 */ "table_options", - /* 389 */ "multi_create_clause", - /* 390 */ "tags_def", - /* 391 */ "multi_drop_clause", - /* 392 */ "alter_table_clause", - /* 393 */ "alter_table_options", - /* 394 */ "column_name", - /* 395 */ "type_name", - /* 396 */ "signed_literal", - /* 397 */ "create_subtable_clause", - /* 398 */ "specific_cols_opt", - /* 399 */ "expression_list", - /* 400 */ "drop_table_clause", - /* 401 */ "col_name_list", - /* 402 */ "column_def", - /* 403 */ "duration_list", - /* 404 */ "rollup_func_list", - /* 405 */ "alter_table_option", - /* 406 */ "duration_literal", - /* 407 */ "rollup_func_name", - /* 408 */ "function_name", - /* 409 */ "col_name", - /* 410 */ "db_kind_opt", - /* 411 */ "table_kind_db_name_cond_opt", - /* 412 */ "like_pattern_opt", - /* 413 */ "db_name_cond_opt", - /* 414 */ "table_name_cond", - /* 415 */ "from_db_opt", - /* 416 */ "tag_list_opt", - /* 417 */ "table_kind", - /* 418 */ "tag_item", - /* 419 */ "column_alias", - /* 420 */ "index_options", - /* 421 */ "full_index_name", - /* 422 */ "index_name", - /* 423 */ "func_list", - /* 424 */ "sliding_opt", - /* 425 */ "sma_stream_opt", - /* 426 */ "func", - /* 427 */ "sma_func_name", - /* 428 */ "with_meta", - /* 429 */ "query_or_subquery", - /* 430 */ "where_clause_opt", - /* 431 */ "cgroup_name", - /* 432 */ "analyze_opt", - /* 433 */ "explain_options", - /* 434 */ "insert_query", - /* 435 */ "or_replace_opt", - /* 436 */ "agg_func_opt", - /* 437 */ "bufsize_opt", - /* 438 */ "language_opt", - /* 439 */ "full_view_name", - /* 440 */ "view_name", - /* 441 */ "stream_name", - /* 442 */ "stream_options", - /* 443 */ "col_list_opt", - /* 444 */ "tag_def_or_ref_opt", - /* 445 */ "subtable_opt", - /* 446 */ "ignore_opt", - /* 447 */ "expression", - /* 448 */ "on_vgroup_id", - /* 449 */ "dnode_list", - /* 450 */ "literal_func", - /* 451 */ "literal_list", - /* 452 */ "table_alias", - /* 453 */ "expr_or_subquery", - /* 454 */ "pseudo_column", - /* 455 */ "column_reference", - /* 456 */ "function_expression", - /* 457 */ "case_when_expression", - /* 458 */ "star_func", - /* 459 */ "star_func_para_list", - /* 460 */ "noarg_func", - /* 461 */ "other_para_list", - /* 462 */ "star_func_para", - /* 463 */ "when_then_list", - /* 464 */ "case_when_else_opt", - /* 465 */ "common_expression", - /* 466 */ "when_then_expr", - /* 467 */ "predicate", - /* 468 */ "compare_op", - /* 469 */ "in_op", - /* 470 */ "in_predicate_value", - /* 471 */ "boolean_value_expression", - /* 472 */ "boolean_primary", - /* 473 */ "from_clause_opt", - /* 474 */ "table_reference_list", - /* 475 */ "table_reference", - /* 476 */ "table_primary", - /* 477 */ "joined_table", - /* 478 */ "alias_opt", - /* 479 */ "subquery", - /* 480 */ "parenthesized_joined_table", - /* 481 */ "join_type", - /* 482 */ "query_specification", - /* 483 */ "hint_list", - /* 484 */ "set_quantifier_opt", - /* 485 */ "tag_mode_opt", - /* 486 */ "select_list", - /* 487 */ "partition_by_clause_opt", - /* 488 */ "range_opt", - /* 489 */ "every_opt", - /* 490 */ "fill_opt", - /* 491 */ "twindow_clause_opt", - /* 492 */ "group_by_clause_opt", - /* 493 */ "having_clause_opt", - /* 494 */ "select_item", - /* 495 */ "partition_list", - /* 496 */ "partition_item", - /* 497 */ "interval_sliding_duration_literal", - /* 498 */ "fill_mode", - /* 499 */ "group_by_list", - /* 500 */ "query_expression", - /* 501 */ "query_simple", - /* 502 */ "order_by_clause_opt", - /* 503 */ "slimit_clause_opt", - /* 504 */ "limit_clause_opt", - /* 505 */ "union_query_expression", - /* 506 */ "query_simple_or_subquery", - /* 507 */ "sort_specification_list", - /* 508 */ "sort_specification", - /* 509 */ "ordering_specification_opt", - /* 510 */ "null_ordering_opt", + /* 281 */ "COUNT_WINDOW", + /* 282 */ "SLIDING", + /* 283 */ "FILL", + /* 284 */ "VALUE", + /* 285 */ "VALUE_F", + /* 286 */ "NONE", + /* 287 */ "PREV", + /* 288 */ "NULL_F", + /* 289 */ "LINEAR", + /* 290 */ "NEXT", + /* 291 */ "HAVING", + /* 292 */ "RANGE", + /* 293 */ "EVERY", + /* 294 */ "ORDER", + /* 295 */ "SLIMIT", + /* 296 */ "SOFFSET", + /* 297 */ "LIMIT", + /* 298 */ "OFFSET", + /* 299 */ "ASC", + /* 300 */ "NULLS", + /* 301 */ "ABORT", + /* 302 */ "AFTER", + /* 303 */ "ATTACH", + /* 304 */ "BEFORE", + /* 305 */ "BEGIN", + /* 306 */ "BITAND", + /* 307 */ "BITNOT", + /* 308 */ "BITOR", + /* 309 */ "BLOCKS", + /* 310 */ "CHANGE", + /* 311 */ "COMMA", + /* 312 */ "CONCAT", + /* 313 */ "CONFLICT", + /* 314 */ "COPY", + /* 315 */ "DEFERRED", + /* 316 */ "DELIMITERS", + /* 317 */ "DETACH", + /* 318 */ "DIVIDE", + /* 319 */ "DOT", + /* 320 */ "EACH", + /* 321 */ "FAIL", + /* 322 */ "FILE", + /* 323 */ "FOR", + /* 324 */ "GLOB", + /* 325 */ "ID", + /* 326 */ "IMMEDIATE", + /* 327 */ "IMPORT", + /* 328 */ "INITIALLY", + /* 329 */ "INSTEAD", + /* 330 */ "ISNULL", + /* 331 */ "KEY", + /* 332 */ "MODULES", + /* 333 */ "NK_BITNOT", + /* 334 */ "NK_SEMI", + /* 335 */ "NOTNULL", + /* 336 */ "OF", + /* 337 */ "PLUS", + /* 338 */ "PRIVILEGE", + /* 339 */ "RAISE", + /* 340 */ "RESTRICT", + /* 341 */ "ROW", + /* 342 */ "SEMI", + /* 343 */ "STAR", + /* 344 */ "STATEMENT", + /* 345 */ "STRICT", + /* 346 */ "STRING", + /* 347 */ "TIMES", + /* 348 */ "VALUES", + /* 349 */ "VARIABLE", + /* 350 */ "WAL", + /* 351 */ "cmd", + /* 352 */ "account_options", + /* 353 */ "alter_account_options", + /* 354 */ "literal", + /* 355 */ "alter_account_option", + /* 356 */ "ip_range_list", + /* 357 */ "white_list", + /* 358 */ "white_list_opt", + /* 359 */ "user_name", + /* 360 */ "sysinfo_opt", + /* 361 */ "privileges", + /* 362 */ "priv_level", + /* 363 */ "with_opt", + /* 364 */ "priv_type_list", + /* 365 */ "priv_type", + /* 366 */ "db_name", + /* 367 */ "table_name", + /* 368 */ "topic_name", + /* 369 */ "search_condition", + /* 370 */ "dnode_endpoint", + /* 371 */ "force_opt", + /* 372 */ "unsafe_opt", + /* 373 */ "not_exists_opt", + /* 374 */ "db_options", + /* 375 */ "exists_opt", + /* 376 */ "alter_db_options", + /* 377 */ "speed_opt", + /* 378 */ "start_opt", + /* 379 */ "end_opt", + /* 380 */ "integer_list", + /* 381 */ "variable_list", + /* 382 */ "retention_list", + /* 383 */ "signed", + /* 384 */ "alter_db_option", + /* 385 */ "retention", + /* 386 */ "full_table_name", + /* 387 */ "column_def_list", + /* 388 */ "tags_def_opt", + /* 389 */ "table_options", + /* 390 */ "multi_create_clause", + /* 391 */ "tags_def", + /* 392 */ "multi_drop_clause", + /* 393 */ "alter_table_clause", + /* 394 */ "alter_table_options", + /* 395 */ "column_name", + /* 396 */ "type_name", + /* 397 */ "signed_literal", + /* 398 */ "create_subtable_clause", + /* 399 */ "specific_cols_opt", + /* 400 */ "expression_list", + /* 401 */ "drop_table_clause", + /* 402 */ "col_name_list", + /* 403 */ "column_def", + /* 404 */ "duration_list", + /* 405 */ "rollup_func_list", + /* 406 */ "alter_table_option", + /* 407 */ "duration_literal", + /* 408 */ "rollup_func_name", + /* 409 */ "function_name", + /* 410 */ "col_name", + /* 411 */ "db_kind_opt", + /* 412 */ "table_kind_db_name_cond_opt", + /* 413 */ "like_pattern_opt", + /* 414 */ "db_name_cond_opt", + /* 415 */ "table_name_cond", + /* 416 */ "from_db_opt", + /* 417 */ "tag_list_opt", + /* 418 */ "table_kind", + /* 419 */ "tag_item", + /* 420 */ "column_alias", + /* 421 */ "index_options", + /* 422 */ "full_index_name", + /* 423 */ "index_name", + /* 424 */ "func_list", + /* 425 */ "sliding_opt", + /* 426 */ "sma_stream_opt", + /* 427 */ "func", + /* 428 */ "sma_func_name", + /* 429 */ "with_meta", + /* 430 */ "query_or_subquery", + /* 431 */ "where_clause_opt", + /* 432 */ "cgroup_name", + /* 433 */ "analyze_opt", + /* 434 */ "explain_options", + /* 435 */ "insert_query", + /* 436 */ "or_replace_opt", + /* 437 */ "agg_func_opt", + /* 438 */ "bufsize_opt", + /* 439 */ "language_opt", + /* 440 */ "full_view_name", + /* 441 */ "view_name", + /* 442 */ "stream_name", + /* 443 */ "stream_options", + /* 444 */ "col_list_opt", + /* 445 */ "tag_def_or_ref_opt", + /* 446 */ "subtable_opt", + /* 447 */ "ignore_opt", + /* 448 */ "expression", + /* 449 */ "on_vgroup_id", + /* 450 */ "dnode_list", + /* 451 */ "literal_func", + /* 452 */ "literal_list", + /* 453 */ "table_alias", + /* 454 */ "expr_or_subquery", + /* 455 */ "pseudo_column", + /* 456 */ "column_reference", + /* 457 */ "function_expression", + /* 458 */ "case_when_expression", + /* 459 */ "star_func", + /* 460 */ "star_func_para_list", + /* 461 */ "noarg_func", + /* 462 */ "other_para_list", + /* 463 */ "star_func_para", + /* 464 */ "when_then_list", + /* 465 */ "case_when_else_opt", + /* 466 */ "common_expression", + /* 467 */ "when_then_expr", + /* 468 */ "predicate", + /* 469 */ "compare_op", + /* 470 */ "in_op", + /* 471 */ "in_predicate_value", + /* 472 */ "boolean_value_expression", + /* 473 */ "boolean_primary", + /* 474 */ "from_clause_opt", + /* 475 */ "table_reference_list", + /* 476 */ "table_reference", + /* 477 */ "table_primary", + /* 478 */ "joined_table", + /* 479 */ "alias_opt", + /* 480 */ "subquery", + /* 481 */ "parenthesized_joined_table", + /* 482 */ "join_type", + /* 483 */ "query_specification", + /* 484 */ "hint_list", + /* 485 */ "set_quantifier_opt", + /* 486 */ "tag_mode_opt", + /* 487 */ "select_list", + /* 488 */ "partition_by_clause_opt", + /* 489 */ "range_opt", + /* 490 */ "every_opt", + /* 491 */ "fill_opt", + /* 492 */ "twindow_clause_opt", + /* 493 */ "group_by_clause_opt", + /* 494 */ "having_clause_opt", + /* 495 */ "select_item", + /* 496 */ "partition_list", + /* 497 */ "partition_item", + /* 498 */ "interval_sliding_duration_literal", + /* 499 */ "fill_mode", + /* 500 */ "group_by_list", + /* 501 */ "query_expression", + /* 502 */ "query_simple", + /* 503 */ "order_by_clause_opt", + /* 504 */ "slimit_clause_opt", + /* 505 */ "limit_clause_opt", + /* 506 */ "union_query_expression", + /* 507 */ "query_simple_or_subquery", + /* 508 */ "sort_specification_list", + /* 509 */ "sort_specification", + /* 510 */ "ordering_specification_opt", + /* 511 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -3009,63 +2983,65 @@ static const char *const yyRuleName[] = { /* 587 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", /* 588 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", /* 589 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 590 */ "sliding_opt ::=", - /* 591 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", - /* 592 */ "interval_sliding_duration_literal ::= NK_VARIABLE", - /* 593 */ "interval_sliding_duration_literal ::= NK_STRING", - /* 594 */ "interval_sliding_duration_literal ::= NK_INTEGER", - /* 595 */ "fill_opt ::=", - /* 596 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 597 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 598 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 599 */ "fill_mode ::= NONE", - /* 600 */ "fill_mode ::= PREV", - /* 601 */ "fill_mode ::= NULL", - /* 602 */ "fill_mode ::= NULL_F", - /* 603 */ "fill_mode ::= LINEAR", - /* 604 */ "fill_mode ::= NEXT", - /* 605 */ "group_by_clause_opt ::=", - /* 606 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 607 */ "group_by_list ::= expr_or_subquery", - /* 608 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 609 */ "having_clause_opt ::=", - /* 610 */ "having_clause_opt ::= HAVING search_condition", - /* 611 */ "range_opt ::=", - /* 612 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 613 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 614 */ "every_opt ::=", - /* 615 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 616 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 617 */ "query_simple ::= query_specification", - /* 618 */ "query_simple ::= union_query_expression", - /* 619 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 620 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 621 */ "query_simple_or_subquery ::= query_simple", - /* 622 */ "query_simple_or_subquery ::= subquery", - /* 623 */ "query_or_subquery ::= query_expression", - /* 624 */ "query_or_subquery ::= subquery", - /* 625 */ "order_by_clause_opt ::=", - /* 626 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 627 */ "slimit_clause_opt ::=", - /* 628 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 629 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 630 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 631 */ "limit_clause_opt ::=", - /* 632 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 633 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 634 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 635 */ "subquery ::= NK_LP query_expression NK_RP", - /* 636 */ "subquery ::= NK_LP subquery NK_RP", - /* 637 */ "search_condition ::= common_expression", - /* 638 */ "sort_specification_list ::= sort_specification", - /* 639 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 640 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 641 */ "ordering_specification_opt ::=", - /* 642 */ "ordering_specification_opt ::= ASC", - /* 643 */ "ordering_specification_opt ::= DESC", - /* 644 */ "null_ordering_opt ::=", - /* 645 */ "null_ordering_opt ::= NULLS FIRST", - /* 646 */ "null_ordering_opt ::= NULLS LAST", + /* 590 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", + /* 591 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 592 */ "sliding_opt ::=", + /* 593 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", + /* 594 */ "interval_sliding_duration_literal ::= NK_VARIABLE", + /* 595 */ "interval_sliding_duration_literal ::= NK_STRING", + /* 596 */ "interval_sliding_duration_literal ::= NK_INTEGER", + /* 597 */ "fill_opt ::=", + /* 598 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 599 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 600 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 601 */ "fill_mode ::= NONE", + /* 602 */ "fill_mode ::= PREV", + /* 603 */ "fill_mode ::= NULL", + /* 604 */ "fill_mode ::= NULL_F", + /* 605 */ "fill_mode ::= LINEAR", + /* 606 */ "fill_mode ::= NEXT", + /* 607 */ "group_by_clause_opt ::=", + /* 608 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 609 */ "group_by_list ::= expr_or_subquery", + /* 610 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 611 */ "having_clause_opt ::=", + /* 612 */ "having_clause_opt ::= HAVING search_condition", + /* 613 */ "range_opt ::=", + /* 614 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 615 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 616 */ "every_opt ::=", + /* 617 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 618 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 619 */ "query_simple ::= query_specification", + /* 620 */ "query_simple ::= union_query_expression", + /* 621 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 622 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 623 */ "query_simple_or_subquery ::= query_simple", + /* 624 */ "query_simple_or_subquery ::= subquery", + /* 625 */ "query_or_subquery ::= query_expression", + /* 626 */ "query_or_subquery ::= subquery", + /* 627 */ "order_by_clause_opt ::=", + /* 628 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 629 */ "slimit_clause_opt ::=", + /* 630 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 631 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 632 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 633 */ "limit_clause_opt ::=", + /* 634 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 635 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 636 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 637 */ "subquery ::= NK_LP query_expression NK_RP", + /* 638 */ "subquery ::= NK_LP subquery NK_RP", + /* 639 */ "search_condition ::= common_expression", + /* 640 */ "sort_specification_list ::= sort_specification", + /* 641 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 642 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 643 */ "ordering_specification_opt ::=", + /* 644 */ "ordering_specification_opt ::= ASC", + /* 645 */ "ordering_specification_opt ::= DESC", + /* 646 */ "null_ordering_opt ::=", + /* 647 */ "null_ordering_opt ::= NULLS FIRST", + /* 648 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -3192,267 +3168,233 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 350: /* cmd */ - case 353: /* literal */ - case 362: /* with_opt */ - case 368: /* search_condition */ - case 373: /* db_options */ - case 375: /* alter_db_options */ - case 377: /* start_opt */ - case 378: /* end_opt */ - case 382: /* signed */ - case 384: /* retention */ - case 385: /* full_table_name */ - case 388: /* table_options */ - case 392: /* alter_table_clause */ - case 393: /* alter_table_options */ - case 396: /* signed_literal */ - case 397: /* create_subtable_clause */ - case 400: /* drop_table_clause */ - case 402: /* column_def */ - case 406: /* duration_literal */ - case 407: /* rollup_func_name */ - case 409: /* col_name */ - case 412: /* like_pattern_opt */ - case 413: /* db_name_cond_opt */ - case 414: /* table_name_cond */ - case 415: /* from_db_opt */ - case 418: /* tag_item */ - case 420: /* index_options */ - case 421: /* full_index_name */ - case 424: /* sliding_opt */ - case 425: /* sma_stream_opt */ - case 426: /* func */ - case 429: /* query_or_subquery */ - case 430: /* where_clause_opt */ - case 433: /* explain_options */ - case 434: /* insert_query */ - case 439: /* full_view_name */ - case 442: /* stream_options */ - case 445: /* subtable_opt */ - case 447: /* expression */ - case 450: /* literal_func */ - case 453: /* expr_or_subquery */ - case 454: /* pseudo_column */ - case 455: /* column_reference */ - case 456: /* function_expression */ - case 457: /* case_when_expression */ - case 462: /* star_func_para */ - case 464: /* case_when_else_opt */ - case 465: /* common_expression */ - case 466: /* when_then_expr */ - case 467: /* predicate */ - case 470: /* in_predicate_value */ - case 471: /* boolean_value_expression */ - case 472: /* boolean_primary */ - case 473: /* from_clause_opt */ - case 474: /* table_reference_list */ - case 475: /* table_reference */ - case 476: /* table_primary */ - case 477: /* joined_table */ - case 479: /* subquery */ - case 480: /* parenthesized_joined_table */ - case 482: /* query_specification */ - case 488: /* range_opt */ - case 489: /* every_opt */ - case 490: /* fill_opt */ - case 491: /* twindow_clause_opt */ - case 493: /* having_clause_opt */ - case 494: /* select_item */ - case 496: /* partition_item */ - case 497: /* interval_sliding_duration_literal */ - case 500: /* query_expression */ - case 501: /* query_simple */ - case 503: /* slimit_clause_opt */ - case 504: /* limit_clause_opt */ - case 505: /* union_query_expression */ - case 506: /* query_simple_or_subquery */ - case 508: /* sort_specification */ + case 351: /* cmd */ + case 354: /* literal */ + case 363: /* with_opt */ + case 369: /* search_condition */ + case 374: /* db_options */ + case 376: /* alter_db_options */ + case 378: /* start_opt */ + case 379: /* end_opt */ + case 383: /* signed */ + case 385: /* retention */ + case 386: /* full_table_name */ + case 389: /* table_options */ + case 393: /* alter_table_clause */ + case 394: /* alter_table_options */ + case 397: /* signed_literal */ + case 398: /* create_subtable_clause */ + case 401: /* drop_table_clause */ + case 403: /* column_def */ + case 407: /* duration_literal */ + case 408: /* rollup_func_name */ + case 410: /* col_name */ + case 413: /* like_pattern_opt */ + case 414: /* db_name_cond_opt */ + case 415: /* table_name_cond */ + case 416: /* from_db_opt */ + case 419: /* tag_item */ + case 421: /* index_options */ + case 422: /* full_index_name */ + case 425: /* sliding_opt */ + case 426: /* sma_stream_opt */ + case 427: /* func */ + case 430: /* query_or_subquery */ + case 431: /* where_clause_opt */ + case 434: /* explain_options */ + case 435: /* insert_query */ + case 440: /* full_view_name */ + case 443: /* stream_options */ + case 446: /* subtable_opt */ + case 448: /* expression */ + case 451: /* literal_func */ + case 454: /* expr_or_subquery */ + case 455: /* pseudo_column */ + case 456: /* column_reference */ + case 457: /* function_expression */ + case 458: /* case_when_expression */ + case 463: /* star_func_para */ + case 465: /* case_when_else_opt */ + case 466: /* common_expression */ + case 467: /* when_then_expr */ + case 468: /* predicate */ + case 471: /* in_predicate_value */ + case 472: /* boolean_value_expression */ + case 473: /* boolean_primary */ + case 474: /* from_clause_opt */ + case 475: /* table_reference_list */ + case 476: /* table_reference */ + case 477: /* table_primary */ + case 478: /* joined_table */ + case 480: /* subquery */ + case 481: /* parenthesized_joined_table */ + case 483: /* query_specification */ + case 489: /* range_opt */ + case 490: /* every_opt */ + case 491: /* fill_opt */ + case 492: /* twindow_clause_opt */ + case 494: /* having_clause_opt */ + case 495: /* select_item */ + case 497: /* partition_item */ + case 498: /* interval_sliding_duration_literal */ + case 501: /* query_expression */ + case 502: /* query_simple */ + case 504: /* slimit_clause_opt */ + case 505: /* limit_clause_opt */ + case 506: /* union_query_expression */ + case 507: /* query_simple_or_subquery */ + case 509: /* sort_specification */ { -#line 7 "sql.y" - nodesDestroyNode((yypminor->yy490)); -#line 3274 "sql.c" + nodesDestroyNode((yypminor->yy360)); } break; - case 351: /* account_options */ - case 352: /* alter_account_options */ - case 354: /* alter_account_option */ - case 376: /* speed_opt */ - case 428: /* with_meta */ - case 437: /* bufsize_opt */ + case 352: /* account_options */ + case 353: /* alter_account_options */ + case 355: /* alter_account_option */ + case 377: /* speed_opt */ + case 429: /* with_meta */ + case 438: /* bufsize_opt */ { -#line 54 "sql.y" -#line 3286 "sql.c" } break; - case 355: /* ip_range_list */ - case 356: /* white_list */ - case 357: /* white_list_opt */ - case 379: /* integer_list */ - case 380: /* variable_list */ - case 381: /* retention_list */ - case 386: /* column_def_list */ - case 387: /* tags_def_opt */ - case 389: /* multi_create_clause */ - case 390: /* tags_def */ - case 391: /* multi_drop_clause */ - case 398: /* specific_cols_opt */ - case 399: /* expression_list */ - case 401: /* col_name_list */ - case 403: /* duration_list */ - case 404: /* rollup_func_list */ - case 416: /* tag_list_opt */ - case 423: /* func_list */ - case 443: /* col_list_opt */ - case 444: /* tag_def_or_ref_opt */ - case 449: /* dnode_list */ - case 451: /* literal_list */ - case 459: /* star_func_para_list */ - case 461: /* other_para_list */ - case 463: /* when_then_list */ - case 483: /* hint_list */ - case 486: /* select_list */ - case 487: /* partition_by_clause_opt */ - case 492: /* group_by_clause_opt */ - case 495: /* partition_list */ - case 499: /* group_by_list */ - case 502: /* order_by_clause_opt */ - case 507: /* sort_specification_list */ + case 356: /* ip_range_list */ + case 357: /* white_list */ + case 358: /* white_list_opt */ + case 380: /* integer_list */ + case 381: /* variable_list */ + case 382: /* retention_list */ + case 387: /* column_def_list */ + case 388: /* tags_def_opt */ + case 390: /* multi_create_clause */ + case 391: /* tags_def */ + case 392: /* multi_drop_clause */ + case 399: /* specific_cols_opt */ + case 400: /* expression_list */ + case 402: /* col_name_list */ + case 404: /* duration_list */ + case 405: /* rollup_func_list */ + case 417: /* tag_list_opt */ + case 424: /* func_list */ + case 444: /* col_list_opt */ + case 445: /* tag_def_or_ref_opt */ + case 450: /* dnode_list */ + case 452: /* literal_list */ + case 460: /* star_func_para_list */ + case 462: /* other_para_list */ + case 464: /* when_then_list */ + case 484: /* hint_list */ + case 487: /* select_list */ + case 488: /* partition_by_clause_opt */ + case 493: /* group_by_clause_opt */ + case 496: /* partition_list */ + case 500: /* group_by_list */ + case 503: /* order_by_clause_opt */ + case 508: /* sort_specification_list */ { -#line 85 "sql.y" - nodesDestroyList((yypminor->yy502)); -#line 3325 "sql.c" + nodesDestroyList((yypminor->yy536)); } break; - case 358: /* user_name */ - case 365: /* db_name */ - case 366: /* table_name */ - case 367: /* topic_name */ - case 369: /* dnode_endpoint */ - case 394: /* column_name */ - case 408: /* function_name */ - case 419: /* column_alias */ - case 422: /* index_name */ - case 427: /* sma_func_name */ - case 431: /* cgroup_name */ - case 438: /* language_opt */ - case 440: /* view_name */ - case 441: /* stream_name */ - case 448: /* on_vgroup_id */ - case 452: /* table_alias */ - case 458: /* star_func */ - case 460: /* noarg_func */ - case 478: /* alias_opt */ + case 359: /* user_name */ + case 366: /* db_name */ + case 367: /* table_name */ + case 368: /* topic_name */ + case 370: /* dnode_endpoint */ + case 395: /* column_name */ + case 409: /* function_name */ + case 420: /* column_alias */ + case 423: /* index_name */ + case 428: /* sma_func_name */ + case 432: /* cgroup_name */ + case 439: /* language_opt */ + case 441: /* view_name */ + case 442: /* stream_name */ + case 449: /* on_vgroup_id */ + case 453: /* table_alias */ + case 459: /* star_func */ + case 461: /* noarg_func */ + case 479: /* alias_opt */ { -#line 819 "sql.y" -#line 3350 "sql.c" } break; - case 359: /* sysinfo_opt */ + case 360: /* sysinfo_opt */ { -#line 112 "sql.y" -#line 3357 "sql.c" } break; - case 360: /* privileges */ - case 363: /* priv_type_list */ - case 364: /* priv_type */ + case 361: /* privileges */ + case 364: /* priv_type_list */ + case 365: /* priv_type */ { -#line 121 "sql.y" -#line 3366 "sql.c" } break; - case 361: /* priv_level */ + case 362: /* priv_level */ { -#line 138 "sql.y" -#line 3373 "sql.c" } break; - case 370: /* force_opt */ - case 371: /* unsafe_opt */ - case 372: /* not_exists_opt */ - case 374: /* exists_opt */ - case 432: /* analyze_opt */ - case 435: /* or_replace_opt */ - case 436: /* agg_func_opt */ - case 446: /* ignore_opt */ - case 484: /* set_quantifier_opt */ - case 485: /* tag_mode_opt */ + case 371: /* force_opt */ + case 372: /* unsafe_opt */ + case 373: /* not_exists_opt */ + case 375: /* exists_opt */ + case 433: /* analyze_opt */ + case 436: /* or_replace_opt */ + case 437: /* agg_func_opt */ + case 447: /* ignore_opt */ + case 485: /* set_quantifier_opt */ + case 486: /* tag_mode_opt */ { -#line 167 "sql.y" -#line 3389 "sql.c" } break; - case 383: /* alter_db_option */ - case 405: /* alter_table_option */ + case 384: /* alter_db_option */ + case 406: /* alter_table_option */ { -#line 269 "sql.y" -#line 3397 "sql.c" } break; - case 395: /* type_name */ + case 396: /* type_name */ { -#line 392 "sql.y" -#line 3404 "sql.c" } break; - case 410: /* db_kind_opt */ - case 417: /* table_kind */ + case 411: /* db_kind_opt */ + case 418: /* table_kind */ { -#line 560 "sql.y" -#line 3412 "sql.c" } break; - case 411: /* table_kind_db_name_cond_opt */ + case 412: /* table_kind_db_name_cond_opt */ { -#line 525 "sql.y" -#line 3419 "sql.c" } break; - case 468: /* compare_op */ - case 469: /* in_op */ + case 469: /* compare_op */ + case 470: /* in_op */ { -#line 1009 "sql.y" -#line 3427 "sql.c" } break; - case 481: /* join_type */ + case 482: /* join_type */ { -#line 1085 "sql.y" -#line 3434 "sql.c" } break; - case 498: /* fill_mode */ + case 499: /* fill_mode */ { -#line 1176 "sql.y" -#line 3441 "sql.c" } break; - case 509: /* ordering_specification_opt */ + case 510: /* ordering_specification_opt */ { -#line 1261 "sql.y" -#line 3448 "sql.c" } break; - case 510: /* null_ordering_opt */ + case 511: /* null_ordering_opt */ { -#line 1267 "sql.y" -#line 3455 "sql.c" } break; /********* End destructor definitions *****************************************/ @@ -3741,653 +3683,655 @@ static void yy_shift( /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ static const YYCODETYPE yyRuleInfoLhs[] = { - 350, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - 350, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - 351, /* (2) account_options ::= */ - 351, /* (3) account_options ::= account_options PPS literal */ - 351, /* (4) account_options ::= account_options TSERIES literal */ - 351, /* (5) account_options ::= account_options STORAGE literal */ - 351, /* (6) account_options ::= account_options STREAMS literal */ - 351, /* (7) account_options ::= account_options QTIME literal */ - 351, /* (8) account_options ::= account_options DBS literal */ - 351, /* (9) account_options ::= account_options USERS literal */ - 351, /* (10) account_options ::= account_options CONNS literal */ - 351, /* (11) account_options ::= account_options STATE literal */ - 352, /* (12) alter_account_options ::= alter_account_option */ - 352, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - 354, /* (14) alter_account_option ::= PASS literal */ - 354, /* (15) alter_account_option ::= PPS literal */ - 354, /* (16) alter_account_option ::= TSERIES literal */ - 354, /* (17) alter_account_option ::= STORAGE literal */ - 354, /* (18) alter_account_option ::= STREAMS literal */ - 354, /* (19) alter_account_option ::= QTIME literal */ - 354, /* (20) alter_account_option ::= DBS literal */ - 354, /* (21) alter_account_option ::= USERS literal */ - 354, /* (22) alter_account_option ::= CONNS literal */ - 354, /* (23) alter_account_option ::= STATE literal */ - 355, /* (24) ip_range_list ::= NK_STRING */ - 355, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ - 356, /* (26) white_list ::= HOST ip_range_list */ - 357, /* (27) white_list_opt ::= */ - 357, /* (28) white_list_opt ::= white_list */ - 350, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ - 350, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ - 350, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - 350, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - 350, /* (33) cmd ::= ALTER USER user_name ADD white_list */ - 350, /* (34) cmd ::= ALTER USER user_name DROP white_list */ - 350, /* (35) cmd ::= DROP USER user_name */ - 359, /* (36) sysinfo_opt ::= */ - 359, /* (37) sysinfo_opt ::= SYSINFO NK_INTEGER */ - 350, /* (38) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ - 350, /* (39) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ - 360, /* (40) privileges ::= ALL */ - 360, /* (41) privileges ::= priv_type_list */ - 360, /* (42) privileges ::= SUBSCRIBE */ - 363, /* (43) priv_type_list ::= priv_type */ - 363, /* (44) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - 364, /* (45) priv_type ::= READ */ - 364, /* (46) priv_type ::= WRITE */ - 364, /* (47) priv_type ::= ALTER */ - 361, /* (48) priv_level ::= NK_STAR NK_DOT NK_STAR */ - 361, /* (49) priv_level ::= db_name NK_DOT NK_STAR */ - 361, /* (50) priv_level ::= db_name NK_DOT table_name */ - 361, /* (51) priv_level ::= topic_name */ - 362, /* (52) with_opt ::= */ - 362, /* (53) with_opt ::= WITH search_condition */ - 350, /* (54) cmd ::= CREATE DNODE dnode_endpoint */ - 350, /* (55) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - 350, /* (56) cmd ::= DROP DNODE NK_INTEGER force_opt */ - 350, /* (57) cmd ::= DROP DNODE dnode_endpoint force_opt */ - 350, /* (58) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - 350, /* (59) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - 350, /* (60) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - 350, /* (61) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - 350, /* (62) cmd ::= ALTER ALL DNODES NK_STRING */ - 350, /* (63) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - 350, /* (64) cmd ::= RESTORE DNODE NK_INTEGER */ - 369, /* (65) dnode_endpoint ::= NK_STRING */ - 369, /* (66) dnode_endpoint ::= NK_ID */ - 369, /* (67) dnode_endpoint ::= NK_IPTOKEN */ - 370, /* (68) force_opt ::= */ - 370, /* (69) force_opt ::= FORCE */ - 371, /* (70) unsafe_opt ::= UNSAFE */ - 350, /* (71) cmd ::= ALTER CLUSTER NK_STRING */ - 350, /* (72) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - 350, /* (73) cmd ::= ALTER LOCAL NK_STRING */ - 350, /* (74) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - 350, /* (75) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - 350, /* (76) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - 350, /* (77) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - 350, /* (78) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - 350, /* (79) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - 350, /* (80) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - 350, /* (81) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - 350, /* (82) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - 350, /* (83) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - 350, /* (84) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - 350, /* (85) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - 350, /* (86) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - 350, /* (87) cmd ::= DROP DATABASE exists_opt db_name */ - 350, /* (88) cmd ::= USE db_name */ - 350, /* (89) cmd ::= ALTER DATABASE db_name alter_db_options */ - 350, /* (90) cmd ::= FLUSH DATABASE db_name */ - 350, /* (91) cmd ::= TRIM DATABASE db_name speed_opt */ - 350, /* (92) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - 372, /* (93) not_exists_opt ::= IF NOT EXISTS */ - 372, /* (94) not_exists_opt ::= */ - 374, /* (95) exists_opt ::= IF EXISTS */ - 374, /* (96) exists_opt ::= */ - 373, /* (97) db_options ::= */ - 373, /* (98) db_options ::= db_options BUFFER NK_INTEGER */ - 373, /* (99) db_options ::= db_options CACHEMODEL NK_STRING */ - 373, /* (100) db_options ::= db_options CACHESIZE NK_INTEGER */ - 373, /* (101) db_options ::= db_options COMP NK_INTEGER */ - 373, /* (102) db_options ::= db_options DURATION NK_INTEGER */ - 373, /* (103) db_options ::= db_options DURATION NK_VARIABLE */ - 373, /* (104) db_options ::= db_options MAXROWS NK_INTEGER */ - 373, /* (105) db_options ::= db_options MINROWS NK_INTEGER */ - 373, /* (106) db_options ::= db_options KEEP integer_list */ - 373, /* (107) db_options ::= db_options KEEP variable_list */ - 373, /* (108) db_options ::= db_options PAGES NK_INTEGER */ - 373, /* (109) db_options ::= db_options PAGESIZE NK_INTEGER */ - 373, /* (110) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - 373, /* (111) db_options ::= db_options PRECISION NK_STRING */ - 373, /* (112) db_options ::= db_options REPLICA NK_INTEGER */ - 373, /* (113) db_options ::= db_options VGROUPS NK_INTEGER */ - 373, /* (114) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - 373, /* (115) db_options ::= db_options RETENTIONS retention_list */ - 373, /* (116) db_options ::= db_options SCHEMALESS NK_INTEGER */ - 373, /* (117) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - 373, /* (118) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - 373, /* (119) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - 373, /* (120) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 373, /* (121) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - 373, /* (122) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 373, /* (123) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - 373, /* (124) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - 373, /* (125) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - 373, /* (126) db_options ::= db_options TABLE_PREFIX signed */ - 373, /* (127) db_options ::= db_options TABLE_SUFFIX signed */ - 373, /* (128) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - 375, /* (129) alter_db_options ::= alter_db_option */ - 375, /* (130) alter_db_options ::= alter_db_options alter_db_option */ - 383, /* (131) alter_db_option ::= BUFFER NK_INTEGER */ - 383, /* (132) alter_db_option ::= CACHEMODEL NK_STRING */ - 383, /* (133) alter_db_option ::= CACHESIZE NK_INTEGER */ - 383, /* (134) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - 383, /* (135) alter_db_option ::= KEEP integer_list */ - 383, /* (136) alter_db_option ::= KEEP variable_list */ - 383, /* (137) alter_db_option ::= PAGES NK_INTEGER */ - 383, /* (138) alter_db_option ::= REPLICA NK_INTEGER */ - 383, /* (139) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - 383, /* (140) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - 383, /* (141) alter_db_option ::= MINROWS NK_INTEGER */ - 383, /* (142) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - 383, /* (143) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 383, /* (144) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - 383, /* (145) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 383, /* (146) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - 379, /* (147) integer_list ::= NK_INTEGER */ - 379, /* (148) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - 380, /* (149) variable_list ::= NK_VARIABLE */ - 380, /* (150) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - 381, /* (151) retention_list ::= retention */ - 381, /* (152) retention_list ::= retention_list NK_COMMA retention */ - 384, /* (153) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - 384, /* (154) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 376, /* (155) speed_opt ::= */ - 376, /* (156) speed_opt ::= BWLIMIT NK_INTEGER */ - 377, /* (157) start_opt ::= */ - 377, /* (158) start_opt ::= START WITH NK_INTEGER */ - 377, /* (159) start_opt ::= START WITH NK_STRING */ - 377, /* (160) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 378, /* (161) end_opt ::= */ - 378, /* (162) end_opt ::= END WITH NK_INTEGER */ - 378, /* (163) end_opt ::= END WITH NK_STRING */ - 378, /* (164) end_opt ::= END WITH TIMESTAMP NK_STRING */ - 350, /* (165) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - 350, /* (166) cmd ::= CREATE TABLE multi_create_clause */ - 350, /* (167) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - 350, /* (168) cmd ::= DROP TABLE multi_drop_clause */ - 350, /* (169) cmd ::= DROP STABLE exists_opt full_table_name */ - 350, /* (170) cmd ::= ALTER TABLE alter_table_clause */ - 350, /* (171) cmd ::= ALTER STABLE alter_table_clause */ - 392, /* (172) alter_table_clause ::= full_table_name alter_table_options */ - 392, /* (173) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - 392, /* (174) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 392, /* (175) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - 392, /* (176) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 392, /* (177) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - 392, /* (178) alter_table_clause ::= full_table_name DROP TAG column_name */ - 392, /* (179) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - 392, /* (180) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - 392, /* (181) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - 389, /* (182) multi_create_clause ::= create_subtable_clause */ - 389, /* (183) multi_create_clause ::= multi_create_clause create_subtable_clause */ - 397, /* (184) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ - 391, /* (185) multi_drop_clause ::= drop_table_clause */ - 391, /* (186) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - 400, /* (187) drop_table_clause ::= exists_opt full_table_name */ - 398, /* (188) specific_cols_opt ::= */ - 398, /* (189) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - 385, /* (190) full_table_name ::= table_name */ - 385, /* (191) full_table_name ::= db_name NK_DOT table_name */ - 386, /* (192) column_def_list ::= column_def */ - 386, /* (193) column_def_list ::= column_def_list NK_COMMA column_def */ - 402, /* (194) column_def ::= column_name type_name */ - 395, /* (195) type_name ::= BOOL */ - 395, /* (196) type_name ::= TINYINT */ - 395, /* (197) type_name ::= SMALLINT */ - 395, /* (198) type_name ::= INT */ - 395, /* (199) type_name ::= INTEGER */ - 395, /* (200) type_name ::= BIGINT */ - 395, /* (201) type_name ::= FLOAT */ - 395, /* (202) type_name ::= DOUBLE */ - 395, /* (203) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 395, /* (204) type_name ::= TIMESTAMP */ - 395, /* (205) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 395, /* (206) type_name ::= TINYINT UNSIGNED */ - 395, /* (207) type_name ::= SMALLINT UNSIGNED */ - 395, /* (208) type_name ::= INT UNSIGNED */ - 395, /* (209) type_name ::= BIGINT UNSIGNED */ - 395, /* (210) type_name ::= JSON */ - 395, /* (211) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 395, /* (212) type_name ::= MEDIUMBLOB */ - 395, /* (213) type_name ::= BLOB */ - 395, /* (214) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 395, /* (215) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 395, /* (216) type_name ::= DECIMAL */ - 395, /* (217) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 395, /* (218) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 387, /* (219) tags_def_opt ::= */ - 387, /* (220) tags_def_opt ::= tags_def */ - 390, /* (221) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - 388, /* (222) table_options ::= */ - 388, /* (223) table_options ::= table_options COMMENT NK_STRING */ - 388, /* (224) table_options ::= table_options MAX_DELAY duration_list */ - 388, /* (225) table_options ::= table_options WATERMARK duration_list */ - 388, /* (226) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 388, /* (227) table_options ::= table_options TTL NK_INTEGER */ - 388, /* (228) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 388, /* (229) table_options ::= table_options DELETE_MARK duration_list */ - 393, /* (230) alter_table_options ::= alter_table_option */ - 393, /* (231) alter_table_options ::= alter_table_options alter_table_option */ - 405, /* (232) alter_table_option ::= COMMENT NK_STRING */ - 405, /* (233) alter_table_option ::= TTL NK_INTEGER */ - 403, /* (234) duration_list ::= duration_literal */ - 403, /* (235) duration_list ::= duration_list NK_COMMA duration_literal */ - 404, /* (236) rollup_func_list ::= rollup_func_name */ - 404, /* (237) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 407, /* (238) rollup_func_name ::= function_name */ - 407, /* (239) rollup_func_name ::= FIRST */ - 407, /* (240) rollup_func_name ::= LAST */ - 401, /* (241) col_name_list ::= col_name */ - 401, /* (242) col_name_list ::= col_name_list NK_COMMA col_name */ - 409, /* (243) col_name ::= column_name */ - 350, /* (244) cmd ::= SHOW DNODES */ - 350, /* (245) cmd ::= SHOW USERS */ - 350, /* (246) cmd ::= SHOW USER PRIVILEGES */ - 350, /* (247) cmd ::= SHOW db_kind_opt DATABASES */ - 350, /* (248) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - 350, /* (249) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 350, /* (250) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 350, /* (251) cmd ::= SHOW MNODES */ - 350, /* (252) cmd ::= SHOW QNODES */ - 350, /* (253) cmd ::= SHOW FUNCTIONS */ - 350, /* (254) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 350, /* (255) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - 350, /* (256) cmd ::= SHOW STREAMS */ - 350, /* (257) cmd ::= SHOW ACCOUNTS */ - 350, /* (258) cmd ::= SHOW APPS */ - 350, /* (259) cmd ::= SHOW CONNECTIONS */ - 350, /* (260) cmd ::= SHOW LICENCES */ - 350, /* (261) cmd ::= SHOW GRANTS */ - 350, /* (262) cmd ::= SHOW GRANTS FULL */ - 350, /* (263) cmd ::= SHOW GRANTS LOGS */ - 350, /* (264) cmd ::= SHOW CLUSTER MACHINES */ - 350, /* (265) cmd ::= SHOW CREATE DATABASE db_name */ - 350, /* (266) cmd ::= SHOW CREATE TABLE full_table_name */ - 350, /* (267) cmd ::= SHOW CREATE STABLE full_table_name */ - 350, /* (268) cmd ::= SHOW QUERIES */ - 350, /* (269) cmd ::= SHOW SCORES */ - 350, /* (270) cmd ::= SHOW TOPICS */ - 350, /* (271) cmd ::= SHOW VARIABLES */ - 350, /* (272) cmd ::= SHOW CLUSTER VARIABLES */ - 350, /* (273) cmd ::= SHOW LOCAL VARIABLES */ - 350, /* (274) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 350, /* (275) cmd ::= SHOW BNODES */ - 350, /* (276) cmd ::= SHOW SNODES */ - 350, /* (277) cmd ::= SHOW CLUSTER */ - 350, /* (278) cmd ::= SHOW TRANSACTIONS */ - 350, /* (279) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 350, /* (280) cmd ::= SHOW CONSUMERS */ - 350, /* (281) cmd ::= SHOW SUBSCRIPTIONS */ - 350, /* (282) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 350, /* (283) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - 350, /* (284) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 350, /* (285) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - 350, /* (286) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - 350, /* (287) cmd ::= SHOW VNODES */ - 350, /* (288) cmd ::= SHOW db_name_cond_opt ALIVE */ - 350, /* (289) cmd ::= SHOW CLUSTER ALIVE */ - 350, /* (290) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - 350, /* (291) cmd ::= SHOW CREATE VIEW full_table_name */ - 350, /* (292) cmd ::= SHOW COMPACTS */ - 350, /* (293) cmd ::= SHOW COMPACT NK_INTEGER */ - 411, /* (294) table_kind_db_name_cond_opt ::= */ - 411, /* (295) table_kind_db_name_cond_opt ::= table_kind */ - 411, /* (296) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - 411, /* (297) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - 417, /* (298) table_kind ::= NORMAL */ - 417, /* (299) table_kind ::= CHILD */ - 413, /* (300) db_name_cond_opt ::= */ - 413, /* (301) db_name_cond_opt ::= db_name NK_DOT */ - 412, /* (302) like_pattern_opt ::= */ - 412, /* (303) like_pattern_opt ::= LIKE NK_STRING */ - 414, /* (304) table_name_cond ::= table_name */ - 415, /* (305) from_db_opt ::= */ - 415, /* (306) from_db_opt ::= FROM db_name */ - 416, /* (307) tag_list_opt ::= */ - 416, /* (308) tag_list_opt ::= tag_item */ - 416, /* (309) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 418, /* (310) tag_item ::= TBNAME */ - 418, /* (311) tag_item ::= QTAGS */ - 418, /* (312) tag_item ::= column_name */ - 418, /* (313) tag_item ::= column_name column_alias */ - 418, /* (314) tag_item ::= column_name AS column_alias */ - 410, /* (315) db_kind_opt ::= */ - 410, /* (316) db_kind_opt ::= USER */ - 410, /* (317) db_kind_opt ::= SYSTEM */ - 350, /* (318) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - 350, /* (319) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - 350, /* (320) cmd ::= DROP INDEX exists_opt full_index_name */ - 421, /* (321) full_index_name ::= index_name */ - 421, /* (322) full_index_name ::= db_name NK_DOT index_name */ - 420, /* (323) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 420, /* (324) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - 423, /* (325) func_list ::= func */ - 423, /* (326) func_list ::= func_list NK_COMMA func */ - 426, /* (327) func ::= sma_func_name NK_LP expression_list NK_RP */ - 427, /* (328) sma_func_name ::= function_name */ - 427, /* (329) sma_func_name ::= COUNT */ - 427, /* (330) sma_func_name ::= FIRST */ - 427, /* (331) sma_func_name ::= LAST */ - 427, /* (332) sma_func_name ::= LAST_ROW */ - 425, /* (333) sma_stream_opt ::= */ - 425, /* (334) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 425, /* (335) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 425, /* (336) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 428, /* (337) with_meta ::= AS */ - 428, /* (338) with_meta ::= WITH META AS */ - 428, /* (339) with_meta ::= ONLY META AS */ - 350, /* (340) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 350, /* (341) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - 350, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - 350, /* (343) cmd ::= DROP TOPIC exists_opt topic_name */ - 350, /* (344) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 350, /* (345) cmd ::= DESC full_table_name */ - 350, /* (346) cmd ::= DESCRIBE full_table_name */ - 350, /* (347) cmd ::= RESET QUERY CACHE */ - 350, /* (348) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 350, /* (349) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 432, /* (350) analyze_opt ::= */ - 432, /* (351) analyze_opt ::= ANALYZE */ - 433, /* (352) explain_options ::= */ - 433, /* (353) explain_options ::= explain_options VERBOSE NK_BOOL */ - 433, /* (354) explain_options ::= explain_options RATIO NK_FLOAT */ - 350, /* (355) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - 350, /* (356) cmd ::= DROP FUNCTION exists_opt function_name */ - 436, /* (357) agg_func_opt ::= */ - 436, /* (358) agg_func_opt ::= AGGREGATE */ - 437, /* (359) bufsize_opt ::= */ - 437, /* (360) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 438, /* (361) language_opt ::= */ - 438, /* (362) language_opt ::= LANGUAGE NK_STRING */ - 435, /* (363) or_replace_opt ::= */ - 435, /* (364) or_replace_opt ::= OR REPLACE */ - 350, /* (365) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - 350, /* (366) cmd ::= DROP VIEW exists_opt full_view_name */ - 439, /* (367) full_view_name ::= view_name */ - 439, /* (368) full_view_name ::= db_name NK_DOT view_name */ - 350, /* (369) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - 350, /* (370) cmd ::= DROP STREAM exists_opt stream_name */ - 350, /* (371) cmd ::= PAUSE STREAM exists_opt stream_name */ - 350, /* (372) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 443, /* (373) col_list_opt ::= */ - 443, /* (374) col_list_opt ::= NK_LP col_name_list NK_RP */ - 444, /* (375) tag_def_or_ref_opt ::= */ - 444, /* (376) tag_def_or_ref_opt ::= tags_def */ - 444, /* (377) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 442, /* (378) stream_options ::= */ - 442, /* (379) stream_options ::= stream_options TRIGGER AT_ONCE */ - 442, /* (380) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 442, /* (381) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 442, /* (382) stream_options ::= stream_options WATERMARK duration_literal */ - 442, /* (383) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 442, /* (384) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 442, /* (385) stream_options ::= stream_options DELETE_MARK duration_literal */ - 442, /* (386) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 445, /* (387) subtable_opt ::= */ - 445, /* (388) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 446, /* (389) ignore_opt ::= */ - 446, /* (390) ignore_opt ::= IGNORE UNTREATED */ - 350, /* (391) cmd ::= KILL CONNECTION NK_INTEGER */ - 350, /* (392) cmd ::= KILL QUERY NK_STRING */ - 350, /* (393) cmd ::= KILL TRANSACTION NK_INTEGER */ - 350, /* (394) cmd ::= KILL COMPACT NK_INTEGER */ - 350, /* (395) cmd ::= BALANCE VGROUP */ - 350, /* (396) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - 350, /* (397) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 350, /* (398) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 350, /* (399) cmd ::= SPLIT VGROUP NK_INTEGER */ - 448, /* (400) on_vgroup_id ::= */ - 448, /* (401) on_vgroup_id ::= ON NK_INTEGER */ - 449, /* (402) dnode_list ::= DNODE NK_INTEGER */ - 449, /* (403) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 350, /* (404) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 350, /* (405) cmd ::= query_or_subquery */ - 350, /* (406) cmd ::= insert_query */ - 434, /* (407) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 434, /* (408) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 353, /* (409) literal ::= NK_INTEGER */ - 353, /* (410) literal ::= NK_FLOAT */ - 353, /* (411) literal ::= NK_STRING */ - 353, /* (412) literal ::= NK_BOOL */ - 353, /* (413) literal ::= TIMESTAMP NK_STRING */ - 353, /* (414) literal ::= duration_literal */ - 353, /* (415) literal ::= NULL */ - 353, /* (416) literal ::= NK_QUESTION */ - 406, /* (417) duration_literal ::= NK_VARIABLE */ - 382, /* (418) signed ::= NK_INTEGER */ - 382, /* (419) signed ::= NK_PLUS NK_INTEGER */ - 382, /* (420) signed ::= NK_MINUS NK_INTEGER */ - 382, /* (421) signed ::= NK_FLOAT */ - 382, /* (422) signed ::= NK_PLUS NK_FLOAT */ - 382, /* (423) signed ::= NK_MINUS NK_FLOAT */ - 396, /* (424) signed_literal ::= signed */ - 396, /* (425) signed_literal ::= NK_STRING */ - 396, /* (426) signed_literal ::= NK_BOOL */ - 396, /* (427) signed_literal ::= TIMESTAMP NK_STRING */ - 396, /* (428) signed_literal ::= duration_literal */ - 396, /* (429) signed_literal ::= NULL */ - 396, /* (430) signed_literal ::= literal_func */ - 396, /* (431) signed_literal ::= NK_QUESTION */ - 451, /* (432) literal_list ::= signed_literal */ - 451, /* (433) literal_list ::= literal_list NK_COMMA signed_literal */ - 365, /* (434) db_name ::= NK_ID */ - 366, /* (435) table_name ::= NK_ID */ - 394, /* (436) column_name ::= NK_ID */ - 408, /* (437) function_name ::= NK_ID */ - 440, /* (438) view_name ::= NK_ID */ - 452, /* (439) table_alias ::= NK_ID */ - 419, /* (440) column_alias ::= NK_ID */ - 419, /* (441) column_alias ::= NK_ALIAS */ - 358, /* (442) user_name ::= NK_ID */ - 367, /* (443) topic_name ::= NK_ID */ - 441, /* (444) stream_name ::= NK_ID */ - 431, /* (445) cgroup_name ::= NK_ID */ - 422, /* (446) index_name ::= NK_ID */ - 453, /* (447) expr_or_subquery ::= expression */ - 447, /* (448) expression ::= literal */ - 447, /* (449) expression ::= pseudo_column */ - 447, /* (450) expression ::= column_reference */ - 447, /* (451) expression ::= function_expression */ - 447, /* (452) expression ::= case_when_expression */ - 447, /* (453) expression ::= NK_LP expression NK_RP */ - 447, /* (454) expression ::= NK_PLUS expr_or_subquery */ - 447, /* (455) expression ::= NK_MINUS expr_or_subquery */ - 447, /* (456) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 447, /* (457) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 447, /* (458) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 447, /* (459) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 447, /* (460) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 447, /* (461) expression ::= column_reference NK_ARROW NK_STRING */ - 447, /* (462) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 447, /* (463) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 399, /* (464) expression_list ::= expr_or_subquery */ - 399, /* (465) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 455, /* (466) column_reference ::= column_name */ - 455, /* (467) column_reference ::= table_name NK_DOT column_name */ - 455, /* (468) column_reference ::= NK_ALIAS */ - 455, /* (469) column_reference ::= table_name NK_DOT NK_ALIAS */ - 454, /* (470) pseudo_column ::= ROWTS */ - 454, /* (471) pseudo_column ::= TBNAME */ - 454, /* (472) pseudo_column ::= table_name NK_DOT TBNAME */ - 454, /* (473) pseudo_column ::= QSTART */ - 454, /* (474) pseudo_column ::= QEND */ - 454, /* (475) pseudo_column ::= QDURATION */ - 454, /* (476) pseudo_column ::= WSTART */ - 454, /* (477) pseudo_column ::= WEND */ - 454, /* (478) pseudo_column ::= WDURATION */ - 454, /* (479) pseudo_column ::= IROWTS */ - 454, /* (480) pseudo_column ::= ISFILLED */ - 454, /* (481) pseudo_column ::= QTAGS */ - 456, /* (482) function_expression ::= function_name NK_LP expression_list NK_RP */ - 456, /* (483) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 456, /* (484) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 456, /* (485) function_expression ::= literal_func */ - 450, /* (486) literal_func ::= noarg_func NK_LP NK_RP */ - 450, /* (487) literal_func ::= NOW */ - 460, /* (488) noarg_func ::= NOW */ - 460, /* (489) noarg_func ::= TODAY */ - 460, /* (490) noarg_func ::= TIMEZONE */ - 460, /* (491) noarg_func ::= DATABASE */ - 460, /* (492) noarg_func ::= CLIENT_VERSION */ - 460, /* (493) noarg_func ::= SERVER_VERSION */ - 460, /* (494) noarg_func ::= SERVER_STATUS */ - 460, /* (495) noarg_func ::= CURRENT_USER */ - 460, /* (496) noarg_func ::= USER */ - 458, /* (497) star_func ::= COUNT */ - 458, /* (498) star_func ::= FIRST */ - 458, /* (499) star_func ::= LAST */ - 458, /* (500) star_func ::= LAST_ROW */ - 459, /* (501) star_func_para_list ::= NK_STAR */ - 459, /* (502) star_func_para_list ::= other_para_list */ - 461, /* (503) other_para_list ::= star_func_para */ - 461, /* (504) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 462, /* (505) star_func_para ::= expr_or_subquery */ - 462, /* (506) star_func_para ::= table_name NK_DOT NK_STAR */ - 457, /* (507) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 457, /* (508) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 463, /* (509) when_then_list ::= when_then_expr */ - 463, /* (510) when_then_list ::= when_then_list when_then_expr */ - 466, /* (511) when_then_expr ::= WHEN common_expression THEN common_expression */ - 464, /* (512) case_when_else_opt ::= */ - 464, /* (513) case_when_else_opt ::= ELSE common_expression */ - 467, /* (514) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 467, /* (515) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 467, /* (516) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 467, /* (517) predicate ::= expr_or_subquery IS NULL */ - 467, /* (518) predicate ::= expr_or_subquery IS NOT NULL */ - 467, /* (519) predicate ::= expr_or_subquery in_op in_predicate_value */ - 468, /* (520) compare_op ::= NK_LT */ - 468, /* (521) compare_op ::= NK_GT */ - 468, /* (522) compare_op ::= NK_LE */ - 468, /* (523) compare_op ::= NK_GE */ - 468, /* (524) compare_op ::= NK_NE */ - 468, /* (525) compare_op ::= NK_EQ */ - 468, /* (526) compare_op ::= LIKE */ - 468, /* (527) compare_op ::= NOT LIKE */ - 468, /* (528) compare_op ::= MATCH */ - 468, /* (529) compare_op ::= NMATCH */ - 468, /* (530) compare_op ::= CONTAINS */ - 469, /* (531) in_op ::= IN */ - 469, /* (532) in_op ::= NOT IN */ - 470, /* (533) in_predicate_value ::= NK_LP literal_list NK_RP */ - 471, /* (534) boolean_value_expression ::= boolean_primary */ - 471, /* (535) boolean_value_expression ::= NOT boolean_primary */ - 471, /* (536) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 471, /* (537) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 472, /* (538) boolean_primary ::= predicate */ - 472, /* (539) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 465, /* (540) common_expression ::= expr_or_subquery */ - 465, /* (541) common_expression ::= boolean_value_expression */ - 473, /* (542) from_clause_opt ::= */ - 473, /* (543) from_clause_opt ::= FROM table_reference_list */ - 474, /* (544) table_reference_list ::= table_reference */ - 474, /* (545) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 475, /* (546) table_reference ::= table_primary */ - 475, /* (547) table_reference ::= joined_table */ - 476, /* (548) table_primary ::= table_name alias_opt */ - 476, /* (549) table_primary ::= db_name NK_DOT table_name alias_opt */ - 476, /* (550) table_primary ::= subquery alias_opt */ - 476, /* (551) table_primary ::= parenthesized_joined_table */ - 478, /* (552) alias_opt ::= */ - 478, /* (553) alias_opt ::= table_alias */ - 478, /* (554) alias_opt ::= AS table_alias */ - 480, /* (555) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 480, /* (556) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 477, /* (557) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 481, /* (558) join_type ::= */ - 481, /* (559) join_type ::= INNER */ - 482, /* (560) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_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 */ - 483, /* (561) hint_list ::= */ - 483, /* (562) hint_list ::= NK_HINT */ - 485, /* (563) tag_mode_opt ::= */ - 485, /* (564) tag_mode_opt ::= TAGS */ - 484, /* (565) set_quantifier_opt ::= */ - 484, /* (566) set_quantifier_opt ::= DISTINCT */ - 484, /* (567) set_quantifier_opt ::= ALL */ - 486, /* (568) select_list ::= select_item */ - 486, /* (569) select_list ::= select_list NK_COMMA select_item */ - 494, /* (570) select_item ::= NK_STAR */ - 494, /* (571) select_item ::= common_expression */ - 494, /* (572) select_item ::= common_expression column_alias */ - 494, /* (573) select_item ::= common_expression AS column_alias */ - 494, /* (574) select_item ::= table_name NK_DOT NK_STAR */ - 430, /* (575) where_clause_opt ::= */ - 430, /* (576) where_clause_opt ::= WHERE search_condition */ - 487, /* (577) partition_by_clause_opt ::= */ - 487, /* (578) partition_by_clause_opt ::= PARTITION BY partition_list */ - 495, /* (579) partition_list ::= partition_item */ - 495, /* (580) partition_list ::= partition_list NK_COMMA partition_item */ - 496, /* (581) partition_item ::= expr_or_subquery */ - 496, /* (582) partition_item ::= expr_or_subquery column_alias */ - 496, /* (583) partition_item ::= expr_or_subquery AS column_alias */ - 491, /* (584) twindow_clause_opt ::= */ - 491, /* (585) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - 491, /* (586) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 491, /* (587) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 491, /* (588) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 491, /* (589) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 424, /* (590) sliding_opt ::= */ - 424, /* (591) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - 497, /* (592) interval_sliding_duration_literal ::= NK_VARIABLE */ - 497, /* (593) interval_sliding_duration_literal ::= NK_STRING */ - 497, /* (594) interval_sliding_duration_literal ::= NK_INTEGER */ - 490, /* (595) fill_opt ::= */ - 490, /* (596) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 490, /* (597) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 490, /* (598) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 498, /* (599) fill_mode ::= NONE */ - 498, /* (600) fill_mode ::= PREV */ - 498, /* (601) fill_mode ::= NULL */ - 498, /* (602) fill_mode ::= NULL_F */ - 498, /* (603) fill_mode ::= LINEAR */ - 498, /* (604) fill_mode ::= NEXT */ - 492, /* (605) group_by_clause_opt ::= */ - 492, /* (606) group_by_clause_opt ::= GROUP BY group_by_list */ - 499, /* (607) group_by_list ::= expr_or_subquery */ - 499, /* (608) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 493, /* (609) having_clause_opt ::= */ - 493, /* (610) having_clause_opt ::= HAVING search_condition */ - 488, /* (611) range_opt ::= */ - 488, /* (612) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 488, /* (613) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 489, /* (614) every_opt ::= */ - 489, /* (615) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 500, /* (616) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 501, /* (617) query_simple ::= query_specification */ - 501, /* (618) query_simple ::= union_query_expression */ - 505, /* (619) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 505, /* (620) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 506, /* (621) query_simple_or_subquery ::= query_simple */ - 506, /* (622) query_simple_or_subquery ::= subquery */ - 429, /* (623) query_or_subquery ::= query_expression */ - 429, /* (624) query_or_subquery ::= subquery */ - 502, /* (625) order_by_clause_opt ::= */ - 502, /* (626) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 503, /* (627) slimit_clause_opt ::= */ - 503, /* (628) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 503, /* (629) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 503, /* (630) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 504, /* (631) limit_clause_opt ::= */ - 504, /* (632) limit_clause_opt ::= LIMIT NK_INTEGER */ - 504, /* (633) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 504, /* (634) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 479, /* (635) subquery ::= NK_LP query_expression NK_RP */ - 479, /* (636) subquery ::= NK_LP subquery NK_RP */ - 368, /* (637) search_condition ::= common_expression */ - 507, /* (638) sort_specification_list ::= sort_specification */ - 507, /* (639) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 508, /* (640) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 509, /* (641) ordering_specification_opt ::= */ - 509, /* (642) ordering_specification_opt ::= ASC */ - 509, /* (643) ordering_specification_opt ::= DESC */ - 510, /* (644) null_ordering_opt ::= */ - 510, /* (645) null_ordering_opt ::= NULLS FIRST */ - 510, /* (646) null_ordering_opt ::= NULLS LAST */ + 351, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + 351, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + 352, /* (2) account_options ::= */ + 352, /* (3) account_options ::= account_options PPS literal */ + 352, /* (4) account_options ::= account_options TSERIES literal */ + 352, /* (5) account_options ::= account_options STORAGE literal */ + 352, /* (6) account_options ::= account_options STREAMS literal */ + 352, /* (7) account_options ::= account_options QTIME literal */ + 352, /* (8) account_options ::= account_options DBS literal */ + 352, /* (9) account_options ::= account_options USERS literal */ + 352, /* (10) account_options ::= account_options CONNS literal */ + 352, /* (11) account_options ::= account_options STATE literal */ + 353, /* (12) alter_account_options ::= alter_account_option */ + 353, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + 355, /* (14) alter_account_option ::= PASS literal */ + 355, /* (15) alter_account_option ::= PPS literal */ + 355, /* (16) alter_account_option ::= TSERIES literal */ + 355, /* (17) alter_account_option ::= STORAGE literal */ + 355, /* (18) alter_account_option ::= STREAMS literal */ + 355, /* (19) alter_account_option ::= QTIME literal */ + 355, /* (20) alter_account_option ::= DBS literal */ + 355, /* (21) alter_account_option ::= USERS literal */ + 355, /* (22) alter_account_option ::= CONNS literal */ + 355, /* (23) alter_account_option ::= STATE literal */ + 356, /* (24) ip_range_list ::= NK_STRING */ + 356, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ + 357, /* (26) white_list ::= HOST ip_range_list */ + 358, /* (27) white_list_opt ::= */ + 358, /* (28) white_list_opt ::= white_list */ + 351, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ + 351, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ + 351, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + 351, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + 351, /* (33) cmd ::= ALTER USER user_name ADD white_list */ + 351, /* (34) cmd ::= ALTER USER user_name DROP white_list */ + 351, /* (35) cmd ::= DROP USER user_name */ + 360, /* (36) sysinfo_opt ::= */ + 360, /* (37) sysinfo_opt ::= SYSINFO NK_INTEGER */ + 351, /* (38) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ + 351, /* (39) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ + 361, /* (40) privileges ::= ALL */ + 361, /* (41) privileges ::= priv_type_list */ + 361, /* (42) privileges ::= SUBSCRIBE */ + 364, /* (43) priv_type_list ::= priv_type */ + 364, /* (44) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + 365, /* (45) priv_type ::= READ */ + 365, /* (46) priv_type ::= WRITE */ + 365, /* (47) priv_type ::= ALTER */ + 362, /* (48) priv_level ::= NK_STAR NK_DOT NK_STAR */ + 362, /* (49) priv_level ::= db_name NK_DOT NK_STAR */ + 362, /* (50) priv_level ::= db_name NK_DOT table_name */ + 362, /* (51) priv_level ::= topic_name */ + 363, /* (52) with_opt ::= */ + 363, /* (53) with_opt ::= WITH search_condition */ + 351, /* (54) cmd ::= CREATE DNODE dnode_endpoint */ + 351, /* (55) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + 351, /* (56) cmd ::= DROP DNODE NK_INTEGER force_opt */ + 351, /* (57) cmd ::= DROP DNODE dnode_endpoint force_opt */ + 351, /* (58) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + 351, /* (59) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + 351, /* (60) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + 351, /* (61) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + 351, /* (62) cmd ::= ALTER ALL DNODES NK_STRING */ + 351, /* (63) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + 351, /* (64) cmd ::= RESTORE DNODE NK_INTEGER */ + 370, /* (65) dnode_endpoint ::= NK_STRING */ + 370, /* (66) dnode_endpoint ::= NK_ID */ + 370, /* (67) dnode_endpoint ::= NK_IPTOKEN */ + 371, /* (68) force_opt ::= */ + 371, /* (69) force_opt ::= FORCE */ + 372, /* (70) unsafe_opt ::= UNSAFE */ + 351, /* (71) cmd ::= ALTER CLUSTER NK_STRING */ + 351, /* (72) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + 351, /* (73) cmd ::= ALTER LOCAL NK_STRING */ + 351, /* (74) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + 351, /* (75) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + 351, /* (76) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + 351, /* (77) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + 351, /* (78) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + 351, /* (79) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + 351, /* (80) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + 351, /* (81) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + 351, /* (82) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + 351, /* (83) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + 351, /* (84) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + 351, /* (85) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + 351, /* (86) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + 351, /* (87) cmd ::= DROP DATABASE exists_opt db_name */ + 351, /* (88) cmd ::= USE db_name */ + 351, /* (89) cmd ::= ALTER DATABASE db_name alter_db_options */ + 351, /* (90) cmd ::= FLUSH DATABASE db_name */ + 351, /* (91) cmd ::= TRIM DATABASE db_name speed_opt */ + 351, /* (92) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + 373, /* (93) not_exists_opt ::= IF NOT EXISTS */ + 373, /* (94) not_exists_opt ::= */ + 375, /* (95) exists_opt ::= IF EXISTS */ + 375, /* (96) exists_opt ::= */ + 374, /* (97) db_options ::= */ + 374, /* (98) db_options ::= db_options BUFFER NK_INTEGER */ + 374, /* (99) db_options ::= db_options CACHEMODEL NK_STRING */ + 374, /* (100) db_options ::= db_options CACHESIZE NK_INTEGER */ + 374, /* (101) db_options ::= db_options COMP NK_INTEGER */ + 374, /* (102) db_options ::= db_options DURATION NK_INTEGER */ + 374, /* (103) db_options ::= db_options DURATION NK_VARIABLE */ + 374, /* (104) db_options ::= db_options MAXROWS NK_INTEGER */ + 374, /* (105) db_options ::= db_options MINROWS NK_INTEGER */ + 374, /* (106) db_options ::= db_options KEEP integer_list */ + 374, /* (107) db_options ::= db_options KEEP variable_list */ + 374, /* (108) db_options ::= db_options PAGES NK_INTEGER */ + 374, /* (109) db_options ::= db_options PAGESIZE NK_INTEGER */ + 374, /* (110) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + 374, /* (111) db_options ::= db_options PRECISION NK_STRING */ + 374, /* (112) db_options ::= db_options REPLICA NK_INTEGER */ + 374, /* (113) db_options ::= db_options VGROUPS NK_INTEGER */ + 374, /* (114) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + 374, /* (115) db_options ::= db_options RETENTIONS retention_list */ + 374, /* (116) db_options ::= db_options SCHEMALESS NK_INTEGER */ + 374, /* (117) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + 374, /* (118) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + 374, /* (119) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + 374, /* (120) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 374, /* (121) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + 374, /* (122) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 374, /* (123) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + 374, /* (124) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + 374, /* (125) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + 374, /* (126) db_options ::= db_options TABLE_PREFIX signed */ + 374, /* (127) db_options ::= db_options TABLE_SUFFIX signed */ + 374, /* (128) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + 376, /* (129) alter_db_options ::= alter_db_option */ + 376, /* (130) alter_db_options ::= alter_db_options alter_db_option */ + 384, /* (131) alter_db_option ::= BUFFER NK_INTEGER */ + 384, /* (132) alter_db_option ::= CACHEMODEL NK_STRING */ + 384, /* (133) alter_db_option ::= CACHESIZE NK_INTEGER */ + 384, /* (134) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + 384, /* (135) alter_db_option ::= KEEP integer_list */ + 384, /* (136) alter_db_option ::= KEEP variable_list */ + 384, /* (137) alter_db_option ::= PAGES NK_INTEGER */ + 384, /* (138) alter_db_option ::= REPLICA NK_INTEGER */ + 384, /* (139) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + 384, /* (140) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + 384, /* (141) alter_db_option ::= MINROWS NK_INTEGER */ + 384, /* (142) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + 384, /* (143) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 384, /* (144) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + 384, /* (145) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 384, /* (146) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + 380, /* (147) integer_list ::= NK_INTEGER */ + 380, /* (148) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + 381, /* (149) variable_list ::= NK_VARIABLE */ + 381, /* (150) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + 382, /* (151) retention_list ::= retention */ + 382, /* (152) retention_list ::= retention_list NK_COMMA retention */ + 385, /* (153) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + 385, /* (154) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ + 377, /* (155) speed_opt ::= */ + 377, /* (156) speed_opt ::= BWLIMIT NK_INTEGER */ + 378, /* (157) start_opt ::= */ + 378, /* (158) start_opt ::= START WITH NK_INTEGER */ + 378, /* (159) start_opt ::= START WITH NK_STRING */ + 378, /* (160) start_opt ::= START WITH TIMESTAMP NK_STRING */ + 379, /* (161) end_opt ::= */ + 379, /* (162) end_opt ::= END WITH NK_INTEGER */ + 379, /* (163) end_opt ::= END WITH NK_STRING */ + 379, /* (164) end_opt ::= END WITH TIMESTAMP NK_STRING */ + 351, /* (165) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + 351, /* (166) cmd ::= CREATE TABLE multi_create_clause */ + 351, /* (167) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + 351, /* (168) cmd ::= DROP TABLE multi_drop_clause */ + 351, /* (169) cmd ::= DROP STABLE exists_opt full_table_name */ + 351, /* (170) cmd ::= ALTER TABLE alter_table_clause */ + 351, /* (171) cmd ::= ALTER STABLE alter_table_clause */ + 393, /* (172) alter_table_clause ::= full_table_name alter_table_options */ + 393, /* (173) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + 393, /* (174) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + 393, /* (175) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + 393, /* (176) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + 393, /* (177) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + 393, /* (178) alter_table_clause ::= full_table_name DROP TAG column_name */ + 393, /* (179) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + 393, /* (180) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + 393, /* (181) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + 390, /* (182) multi_create_clause ::= create_subtable_clause */ + 390, /* (183) multi_create_clause ::= multi_create_clause create_subtable_clause */ + 398, /* (184) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + 392, /* (185) multi_drop_clause ::= drop_table_clause */ + 392, /* (186) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + 401, /* (187) drop_table_clause ::= exists_opt full_table_name */ + 399, /* (188) specific_cols_opt ::= */ + 399, /* (189) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + 386, /* (190) full_table_name ::= table_name */ + 386, /* (191) full_table_name ::= db_name NK_DOT table_name */ + 387, /* (192) column_def_list ::= column_def */ + 387, /* (193) column_def_list ::= column_def_list NK_COMMA column_def */ + 403, /* (194) column_def ::= column_name type_name */ + 396, /* (195) type_name ::= BOOL */ + 396, /* (196) type_name ::= TINYINT */ + 396, /* (197) type_name ::= SMALLINT */ + 396, /* (198) type_name ::= INT */ + 396, /* (199) type_name ::= INTEGER */ + 396, /* (200) type_name ::= BIGINT */ + 396, /* (201) type_name ::= FLOAT */ + 396, /* (202) type_name ::= DOUBLE */ + 396, /* (203) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 396, /* (204) type_name ::= TIMESTAMP */ + 396, /* (205) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 396, /* (206) type_name ::= TINYINT UNSIGNED */ + 396, /* (207) type_name ::= SMALLINT UNSIGNED */ + 396, /* (208) type_name ::= INT UNSIGNED */ + 396, /* (209) type_name ::= BIGINT UNSIGNED */ + 396, /* (210) type_name ::= JSON */ + 396, /* (211) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 396, /* (212) type_name ::= MEDIUMBLOB */ + 396, /* (213) type_name ::= BLOB */ + 396, /* (214) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 396, /* (215) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 396, /* (216) type_name ::= DECIMAL */ + 396, /* (217) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 396, /* (218) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 388, /* (219) tags_def_opt ::= */ + 388, /* (220) tags_def_opt ::= tags_def */ + 391, /* (221) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + 389, /* (222) table_options ::= */ + 389, /* (223) table_options ::= table_options COMMENT NK_STRING */ + 389, /* (224) table_options ::= table_options MAX_DELAY duration_list */ + 389, /* (225) table_options ::= table_options WATERMARK duration_list */ + 389, /* (226) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 389, /* (227) table_options ::= table_options TTL NK_INTEGER */ + 389, /* (228) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 389, /* (229) table_options ::= table_options DELETE_MARK duration_list */ + 394, /* (230) alter_table_options ::= alter_table_option */ + 394, /* (231) alter_table_options ::= alter_table_options alter_table_option */ + 406, /* (232) alter_table_option ::= COMMENT NK_STRING */ + 406, /* (233) alter_table_option ::= TTL NK_INTEGER */ + 404, /* (234) duration_list ::= duration_literal */ + 404, /* (235) duration_list ::= duration_list NK_COMMA duration_literal */ + 405, /* (236) rollup_func_list ::= rollup_func_name */ + 405, /* (237) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + 408, /* (238) rollup_func_name ::= function_name */ + 408, /* (239) rollup_func_name ::= FIRST */ + 408, /* (240) rollup_func_name ::= LAST */ + 402, /* (241) col_name_list ::= col_name */ + 402, /* (242) col_name_list ::= col_name_list NK_COMMA col_name */ + 410, /* (243) col_name ::= column_name */ + 351, /* (244) cmd ::= SHOW DNODES */ + 351, /* (245) cmd ::= SHOW USERS */ + 351, /* (246) cmd ::= SHOW USER PRIVILEGES */ + 351, /* (247) cmd ::= SHOW db_kind_opt DATABASES */ + 351, /* (248) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + 351, /* (249) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 351, /* (250) cmd ::= SHOW db_name_cond_opt VGROUPS */ + 351, /* (251) cmd ::= SHOW MNODES */ + 351, /* (252) cmd ::= SHOW QNODES */ + 351, /* (253) cmd ::= SHOW FUNCTIONS */ + 351, /* (254) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 351, /* (255) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + 351, /* (256) cmd ::= SHOW STREAMS */ + 351, /* (257) cmd ::= SHOW ACCOUNTS */ + 351, /* (258) cmd ::= SHOW APPS */ + 351, /* (259) cmd ::= SHOW CONNECTIONS */ + 351, /* (260) cmd ::= SHOW LICENCES */ + 351, /* (261) cmd ::= SHOW GRANTS */ + 351, /* (262) cmd ::= SHOW GRANTS FULL */ + 351, /* (263) cmd ::= SHOW GRANTS LOGS */ + 351, /* (264) cmd ::= SHOW CLUSTER MACHINES */ + 351, /* (265) cmd ::= SHOW CREATE DATABASE db_name */ + 351, /* (266) cmd ::= SHOW CREATE TABLE full_table_name */ + 351, /* (267) cmd ::= SHOW CREATE STABLE full_table_name */ + 351, /* (268) cmd ::= SHOW QUERIES */ + 351, /* (269) cmd ::= SHOW SCORES */ + 351, /* (270) cmd ::= SHOW TOPICS */ + 351, /* (271) cmd ::= SHOW VARIABLES */ + 351, /* (272) cmd ::= SHOW CLUSTER VARIABLES */ + 351, /* (273) cmd ::= SHOW LOCAL VARIABLES */ + 351, /* (274) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 351, /* (275) cmd ::= SHOW BNODES */ + 351, /* (276) cmd ::= SHOW SNODES */ + 351, /* (277) cmd ::= SHOW CLUSTER */ + 351, /* (278) cmd ::= SHOW TRANSACTIONS */ + 351, /* (279) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + 351, /* (280) cmd ::= SHOW CONSUMERS */ + 351, /* (281) cmd ::= SHOW SUBSCRIPTIONS */ + 351, /* (282) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 351, /* (283) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + 351, /* (284) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 351, /* (285) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + 351, /* (286) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + 351, /* (287) cmd ::= SHOW VNODES */ + 351, /* (288) cmd ::= SHOW db_name_cond_opt ALIVE */ + 351, /* (289) cmd ::= SHOW CLUSTER ALIVE */ + 351, /* (290) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + 351, /* (291) cmd ::= SHOW CREATE VIEW full_table_name */ + 351, /* (292) cmd ::= SHOW COMPACTS */ + 351, /* (293) cmd ::= SHOW COMPACT NK_INTEGER */ + 412, /* (294) table_kind_db_name_cond_opt ::= */ + 412, /* (295) table_kind_db_name_cond_opt ::= table_kind */ + 412, /* (296) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + 412, /* (297) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + 418, /* (298) table_kind ::= NORMAL */ + 418, /* (299) table_kind ::= CHILD */ + 414, /* (300) db_name_cond_opt ::= */ + 414, /* (301) db_name_cond_opt ::= db_name NK_DOT */ + 413, /* (302) like_pattern_opt ::= */ + 413, /* (303) like_pattern_opt ::= LIKE NK_STRING */ + 415, /* (304) table_name_cond ::= table_name */ + 416, /* (305) from_db_opt ::= */ + 416, /* (306) from_db_opt ::= FROM db_name */ + 417, /* (307) tag_list_opt ::= */ + 417, /* (308) tag_list_opt ::= tag_item */ + 417, /* (309) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + 419, /* (310) tag_item ::= TBNAME */ + 419, /* (311) tag_item ::= QTAGS */ + 419, /* (312) tag_item ::= column_name */ + 419, /* (313) tag_item ::= column_name column_alias */ + 419, /* (314) tag_item ::= column_name AS column_alias */ + 411, /* (315) db_kind_opt ::= */ + 411, /* (316) db_kind_opt ::= USER */ + 411, /* (317) db_kind_opt ::= SYSTEM */ + 351, /* (318) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + 351, /* (319) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + 351, /* (320) cmd ::= DROP INDEX exists_opt full_index_name */ + 422, /* (321) full_index_name ::= index_name */ + 422, /* (322) full_index_name ::= db_name NK_DOT index_name */ + 421, /* (323) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 421, /* (324) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + 424, /* (325) func_list ::= func */ + 424, /* (326) func_list ::= func_list NK_COMMA func */ + 427, /* (327) func ::= sma_func_name NK_LP expression_list NK_RP */ + 428, /* (328) sma_func_name ::= function_name */ + 428, /* (329) sma_func_name ::= COUNT */ + 428, /* (330) sma_func_name ::= FIRST */ + 428, /* (331) sma_func_name ::= LAST */ + 428, /* (332) sma_func_name ::= LAST_ROW */ + 426, /* (333) sma_stream_opt ::= */ + 426, /* (334) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + 426, /* (335) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 426, /* (336) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 429, /* (337) with_meta ::= AS */ + 429, /* (338) with_meta ::= WITH META AS */ + 429, /* (339) with_meta ::= ONLY META AS */ + 351, /* (340) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 351, /* (341) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + 351, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + 351, /* (343) cmd ::= DROP TOPIC exists_opt topic_name */ + 351, /* (344) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 351, /* (345) cmd ::= DESC full_table_name */ + 351, /* (346) cmd ::= DESCRIBE full_table_name */ + 351, /* (347) cmd ::= RESET QUERY CACHE */ + 351, /* (348) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 351, /* (349) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 433, /* (350) analyze_opt ::= */ + 433, /* (351) analyze_opt ::= ANALYZE */ + 434, /* (352) explain_options ::= */ + 434, /* (353) explain_options ::= explain_options VERBOSE NK_BOOL */ + 434, /* (354) explain_options ::= explain_options RATIO NK_FLOAT */ + 351, /* (355) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + 351, /* (356) cmd ::= DROP FUNCTION exists_opt function_name */ + 437, /* (357) agg_func_opt ::= */ + 437, /* (358) agg_func_opt ::= AGGREGATE */ + 438, /* (359) bufsize_opt ::= */ + 438, /* (360) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 439, /* (361) language_opt ::= */ + 439, /* (362) language_opt ::= LANGUAGE NK_STRING */ + 436, /* (363) or_replace_opt ::= */ + 436, /* (364) or_replace_opt ::= OR REPLACE */ + 351, /* (365) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + 351, /* (366) cmd ::= DROP VIEW exists_opt full_view_name */ + 440, /* (367) full_view_name ::= view_name */ + 440, /* (368) full_view_name ::= db_name NK_DOT view_name */ + 351, /* (369) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + 351, /* (370) cmd ::= DROP STREAM exists_opt stream_name */ + 351, /* (371) cmd ::= PAUSE STREAM exists_opt stream_name */ + 351, /* (372) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 444, /* (373) col_list_opt ::= */ + 444, /* (374) col_list_opt ::= NK_LP col_name_list NK_RP */ + 445, /* (375) tag_def_or_ref_opt ::= */ + 445, /* (376) tag_def_or_ref_opt ::= tags_def */ + 445, /* (377) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 443, /* (378) stream_options ::= */ + 443, /* (379) stream_options ::= stream_options TRIGGER AT_ONCE */ + 443, /* (380) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 443, /* (381) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 443, /* (382) stream_options ::= stream_options WATERMARK duration_literal */ + 443, /* (383) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 443, /* (384) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 443, /* (385) stream_options ::= stream_options DELETE_MARK duration_literal */ + 443, /* (386) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 446, /* (387) subtable_opt ::= */ + 446, /* (388) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 447, /* (389) ignore_opt ::= */ + 447, /* (390) ignore_opt ::= IGNORE UNTREATED */ + 351, /* (391) cmd ::= KILL CONNECTION NK_INTEGER */ + 351, /* (392) cmd ::= KILL QUERY NK_STRING */ + 351, /* (393) cmd ::= KILL TRANSACTION NK_INTEGER */ + 351, /* (394) cmd ::= KILL COMPACT NK_INTEGER */ + 351, /* (395) cmd ::= BALANCE VGROUP */ + 351, /* (396) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + 351, /* (397) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + 351, /* (398) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + 351, /* (399) cmd ::= SPLIT VGROUP NK_INTEGER */ + 449, /* (400) on_vgroup_id ::= */ + 449, /* (401) on_vgroup_id ::= ON NK_INTEGER */ + 450, /* (402) dnode_list ::= DNODE NK_INTEGER */ + 450, /* (403) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 351, /* (404) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 351, /* (405) cmd ::= query_or_subquery */ + 351, /* (406) cmd ::= insert_query */ + 435, /* (407) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 435, /* (408) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 354, /* (409) literal ::= NK_INTEGER */ + 354, /* (410) literal ::= NK_FLOAT */ + 354, /* (411) literal ::= NK_STRING */ + 354, /* (412) literal ::= NK_BOOL */ + 354, /* (413) literal ::= TIMESTAMP NK_STRING */ + 354, /* (414) literal ::= duration_literal */ + 354, /* (415) literal ::= NULL */ + 354, /* (416) literal ::= NK_QUESTION */ + 407, /* (417) duration_literal ::= NK_VARIABLE */ + 383, /* (418) signed ::= NK_INTEGER */ + 383, /* (419) signed ::= NK_PLUS NK_INTEGER */ + 383, /* (420) signed ::= NK_MINUS NK_INTEGER */ + 383, /* (421) signed ::= NK_FLOAT */ + 383, /* (422) signed ::= NK_PLUS NK_FLOAT */ + 383, /* (423) signed ::= NK_MINUS NK_FLOAT */ + 397, /* (424) signed_literal ::= signed */ + 397, /* (425) signed_literal ::= NK_STRING */ + 397, /* (426) signed_literal ::= NK_BOOL */ + 397, /* (427) signed_literal ::= TIMESTAMP NK_STRING */ + 397, /* (428) signed_literal ::= duration_literal */ + 397, /* (429) signed_literal ::= NULL */ + 397, /* (430) signed_literal ::= literal_func */ + 397, /* (431) signed_literal ::= NK_QUESTION */ + 452, /* (432) literal_list ::= signed_literal */ + 452, /* (433) literal_list ::= literal_list NK_COMMA signed_literal */ + 366, /* (434) db_name ::= NK_ID */ + 367, /* (435) table_name ::= NK_ID */ + 395, /* (436) column_name ::= NK_ID */ + 409, /* (437) function_name ::= NK_ID */ + 441, /* (438) view_name ::= NK_ID */ + 453, /* (439) table_alias ::= NK_ID */ + 420, /* (440) column_alias ::= NK_ID */ + 420, /* (441) column_alias ::= NK_ALIAS */ + 359, /* (442) user_name ::= NK_ID */ + 368, /* (443) topic_name ::= NK_ID */ + 442, /* (444) stream_name ::= NK_ID */ + 432, /* (445) cgroup_name ::= NK_ID */ + 423, /* (446) index_name ::= NK_ID */ + 454, /* (447) expr_or_subquery ::= expression */ + 448, /* (448) expression ::= literal */ + 448, /* (449) expression ::= pseudo_column */ + 448, /* (450) expression ::= column_reference */ + 448, /* (451) expression ::= function_expression */ + 448, /* (452) expression ::= case_when_expression */ + 448, /* (453) expression ::= NK_LP expression NK_RP */ + 448, /* (454) expression ::= NK_PLUS expr_or_subquery */ + 448, /* (455) expression ::= NK_MINUS expr_or_subquery */ + 448, /* (456) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 448, /* (457) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 448, /* (458) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 448, /* (459) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 448, /* (460) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 448, /* (461) expression ::= column_reference NK_ARROW NK_STRING */ + 448, /* (462) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 448, /* (463) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 400, /* (464) expression_list ::= expr_or_subquery */ + 400, /* (465) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 456, /* (466) column_reference ::= column_name */ + 456, /* (467) column_reference ::= table_name NK_DOT column_name */ + 456, /* (468) column_reference ::= NK_ALIAS */ + 456, /* (469) column_reference ::= table_name NK_DOT NK_ALIAS */ + 455, /* (470) pseudo_column ::= ROWTS */ + 455, /* (471) pseudo_column ::= TBNAME */ + 455, /* (472) pseudo_column ::= table_name NK_DOT TBNAME */ + 455, /* (473) pseudo_column ::= QSTART */ + 455, /* (474) pseudo_column ::= QEND */ + 455, /* (475) pseudo_column ::= QDURATION */ + 455, /* (476) pseudo_column ::= WSTART */ + 455, /* (477) pseudo_column ::= WEND */ + 455, /* (478) pseudo_column ::= WDURATION */ + 455, /* (479) pseudo_column ::= IROWTS */ + 455, /* (480) pseudo_column ::= ISFILLED */ + 455, /* (481) pseudo_column ::= QTAGS */ + 457, /* (482) function_expression ::= function_name NK_LP expression_list NK_RP */ + 457, /* (483) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 457, /* (484) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 457, /* (485) function_expression ::= literal_func */ + 451, /* (486) literal_func ::= noarg_func NK_LP NK_RP */ + 451, /* (487) literal_func ::= NOW */ + 461, /* (488) noarg_func ::= NOW */ + 461, /* (489) noarg_func ::= TODAY */ + 461, /* (490) noarg_func ::= TIMEZONE */ + 461, /* (491) noarg_func ::= DATABASE */ + 461, /* (492) noarg_func ::= CLIENT_VERSION */ + 461, /* (493) noarg_func ::= SERVER_VERSION */ + 461, /* (494) noarg_func ::= SERVER_STATUS */ + 461, /* (495) noarg_func ::= CURRENT_USER */ + 461, /* (496) noarg_func ::= USER */ + 459, /* (497) star_func ::= COUNT */ + 459, /* (498) star_func ::= FIRST */ + 459, /* (499) star_func ::= LAST */ + 459, /* (500) star_func ::= LAST_ROW */ + 460, /* (501) star_func_para_list ::= NK_STAR */ + 460, /* (502) star_func_para_list ::= other_para_list */ + 462, /* (503) other_para_list ::= star_func_para */ + 462, /* (504) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 463, /* (505) star_func_para ::= expr_or_subquery */ + 463, /* (506) star_func_para ::= table_name NK_DOT NK_STAR */ + 458, /* (507) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 458, /* (508) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 464, /* (509) when_then_list ::= when_then_expr */ + 464, /* (510) when_then_list ::= when_then_list when_then_expr */ + 467, /* (511) when_then_expr ::= WHEN common_expression THEN common_expression */ + 465, /* (512) case_when_else_opt ::= */ + 465, /* (513) case_when_else_opt ::= ELSE common_expression */ + 468, /* (514) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 468, /* (515) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 468, /* (516) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 468, /* (517) predicate ::= expr_or_subquery IS NULL */ + 468, /* (518) predicate ::= expr_or_subquery IS NOT NULL */ + 468, /* (519) predicate ::= expr_or_subquery in_op in_predicate_value */ + 469, /* (520) compare_op ::= NK_LT */ + 469, /* (521) compare_op ::= NK_GT */ + 469, /* (522) compare_op ::= NK_LE */ + 469, /* (523) compare_op ::= NK_GE */ + 469, /* (524) compare_op ::= NK_NE */ + 469, /* (525) compare_op ::= NK_EQ */ + 469, /* (526) compare_op ::= LIKE */ + 469, /* (527) compare_op ::= NOT LIKE */ + 469, /* (528) compare_op ::= MATCH */ + 469, /* (529) compare_op ::= NMATCH */ + 469, /* (530) compare_op ::= CONTAINS */ + 470, /* (531) in_op ::= IN */ + 470, /* (532) in_op ::= NOT IN */ + 471, /* (533) in_predicate_value ::= NK_LP literal_list NK_RP */ + 472, /* (534) boolean_value_expression ::= boolean_primary */ + 472, /* (535) boolean_value_expression ::= NOT boolean_primary */ + 472, /* (536) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 472, /* (537) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 473, /* (538) boolean_primary ::= predicate */ + 473, /* (539) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 466, /* (540) common_expression ::= expr_or_subquery */ + 466, /* (541) common_expression ::= boolean_value_expression */ + 474, /* (542) from_clause_opt ::= */ + 474, /* (543) from_clause_opt ::= FROM table_reference_list */ + 475, /* (544) table_reference_list ::= table_reference */ + 475, /* (545) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 476, /* (546) table_reference ::= table_primary */ + 476, /* (547) table_reference ::= joined_table */ + 477, /* (548) table_primary ::= table_name alias_opt */ + 477, /* (549) table_primary ::= db_name NK_DOT table_name alias_opt */ + 477, /* (550) table_primary ::= subquery alias_opt */ + 477, /* (551) table_primary ::= parenthesized_joined_table */ + 479, /* (552) alias_opt ::= */ + 479, /* (553) alias_opt ::= table_alias */ + 479, /* (554) alias_opt ::= AS table_alias */ + 481, /* (555) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 481, /* (556) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 478, /* (557) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 482, /* (558) join_type ::= */ + 482, /* (559) join_type ::= INNER */ + 483, /* (560) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_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 */ + 484, /* (561) hint_list ::= */ + 484, /* (562) hint_list ::= NK_HINT */ + 486, /* (563) tag_mode_opt ::= */ + 486, /* (564) tag_mode_opt ::= TAGS */ + 485, /* (565) set_quantifier_opt ::= */ + 485, /* (566) set_quantifier_opt ::= DISTINCT */ + 485, /* (567) set_quantifier_opt ::= ALL */ + 487, /* (568) select_list ::= select_item */ + 487, /* (569) select_list ::= select_list NK_COMMA select_item */ + 495, /* (570) select_item ::= NK_STAR */ + 495, /* (571) select_item ::= common_expression */ + 495, /* (572) select_item ::= common_expression column_alias */ + 495, /* (573) select_item ::= common_expression AS column_alias */ + 495, /* (574) select_item ::= table_name NK_DOT NK_STAR */ + 431, /* (575) where_clause_opt ::= */ + 431, /* (576) where_clause_opt ::= WHERE search_condition */ + 488, /* (577) partition_by_clause_opt ::= */ + 488, /* (578) partition_by_clause_opt ::= PARTITION BY partition_list */ + 496, /* (579) partition_list ::= partition_item */ + 496, /* (580) partition_list ::= partition_list NK_COMMA partition_item */ + 497, /* (581) partition_item ::= expr_or_subquery */ + 497, /* (582) partition_item ::= expr_or_subquery column_alias */ + 497, /* (583) partition_item ::= expr_or_subquery AS column_alias */ + 492, /* (584) twindow_clause_opt ::= */ + 492, /* (585) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + 492, /* (586) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 492, /* (587) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 492, /* (588) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 492, /* (589) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 492, /* (590) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + 492, /* (591) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 425, /* (592) sliding_opt ::= */ + 425, /* (593) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + 498, /* (594) interval_sliding_duration_literal ::= NK_VARIABLE */ + 498, /* (595) interval_sliding_duration_literal ::= NK_STRING */ + 498, /* (596) interval_sliding_duration_literal ::= NK_INTEGER */ + 491, /* (597) fill_opt ::= */ + 491, /* (598) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 491, /* (599) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 491, /* (600) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 499, /* (601) fill_mode ::= NONE */ + 499, /* (602) fill_mode ::= PREV */ + 499, /* (603) fill_mode ::= NULL */ + 499, /* (604) fill_mode ::= NULL_F */ + 499, /* (605) fill_mode ::= LINEAR */ + 499, /* (606) fill_mode ::= NEXT */ + 493, /* (607) group_by_clause_opt ::= */ + 493, /* (608) group_by_clause_opt ::= GROUP BY group_by_list */ + 500, /* (609) group_by_list ::= expr_or_subquery */ + 500, /* (610) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 494, /* (611) having_clause_opt ::= */ + 494, /* (612) having_clause_opt ::= HAVING search_condition */ + 489, /* (613) range_opt ::= */ + 489, /* (614) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 489, /* (615) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 490, /* (616) every_opt ::= */ + 490, /* (617) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 501, /* (618) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 502, /* (619) query_simple ::= query_specification */ + 502, /* (620) query_simple ::= union_query_expression */ + 506, /* (621) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 506, /* (622) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 507, /* (623) query_simple_or_subquery ::= query_simple */ + 507, /* (624) query_simple_or_subquery ::= subquery */ + 430, /* (625) query_or_subquery ::= query_expression */ + 430, /* (626) query_or_subquery ::= subquery */ + 503, /* (627) order_by_clause_opt ::= */ + 503, /* (628) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 504, /* (629) slimit_clause_opt ::= */ + 504, /* (630) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 504, /* (631) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 504, /* (632) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 505, /* (633) limit_clause_opt ::= */ + 505, /* (634) limit_clause_opt ::= LIMIT NK_INTEGER */ + 505, /* (635) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 505, /* (636) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 480, /* (637) subquery ::= NK_LP query_expression NK_RP */ + 480, /* (638) subquery ::= NK_LP subquery NK_RP */ + 369, /* (639) search_condition ::= common_expression */ + 508, /* (640) sort_specification_list ::= sort_specification */ + 508, /* (641) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 509, /* (642) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 510, /* (643) ordering_specification_opt ::= */ + 510, /* (644) ordering_specification_opt ::= ASC */ + 510, /* (645) ordering_specification_opt ::= DESC */ + 511, /* (646) null_ordering_opt ::= */ + 511, /* (647) null_ordering_opt ::= NULLS FIRST */ + 511, /* (648) null_ordering_opt ::= NULLS LAST */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -4983,63 +4927,65 @@ static const signed char yyRuleInfoNRhs[] = { -6, /* (587) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -8, /* (588) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -7, /* (589) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 0, /* (590) sliding_opt ::= */ - -4, /* (591) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - -1, /* (592) interval_sliding_duration_literal ::= NK_VARIABLE */ - -1, /* (593) interval_sliding_duration_literal ::= NK_STRING */ - -1, /* (594) interval_sliding_duration_literal ::= NK_INTEGER */ - 0, /* (595) fill_opt ::= */ - -4, /* (596) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (597) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (598) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (599) fill_mode ::= NONE */ - -1, /* (600) fill_mode ::= PREV */ - -1, /* (601) fill_mode ::= NULL */ - -1, /* (602) fill_mode ::= NULL_F */ - -1, /* (603) fill_mode ::= LINEAR */ - -1, /* (604) fill_mode ::= NEXT */ - 0, /* (605) group_by_clause_opt ::= */ - -3, /* (606) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (607) group_by_list ::= expr_or_subquery */ - -3, /* (608) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (609) having_clause_opt ::= */ - -2, /* (610) having_clause_opt ::= HAVING search_condition */ - 0, /* (611) range_opt ::= */ - -6, /* (612) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (613) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (614) every_opt ::= */ - -4, /* (615) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (616) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (617) query_simple ::= query_specification */ - -1, /* (618) query_simple ::= union_query_expression */ - -4, /* (619) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (620) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (621) query_simple_or_subquery ::= query_simple */ - -1, /* (622) query_simple_or_subquery ::= subquery */ - -1, /* (623) query_or_subquery ::= query_expression */ - -1, /* (624) query_or_subquery ::= subquery */ - 0, /* (625) order_by_clause_opt ::= */ - -3, /* (626) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (627) slimit_clause_opt ::= */ - -2, /* (628) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (629) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (630) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (631) limit_clause_opt ::= */ - -2, /* (632) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (633) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (634) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (635) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (636) subquery ::= NK_LP subquery NK_RP */ - -1, /* (637) search_condition ::= common_expression */ - -1, /* (638) sort_specification_list ::= sort_specification */ - -3, /* (639) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (640) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (641) ordering_specification_opt ::= */ - -1, /* (642) ordering_specification_opt ::= ASC */ - -1, /* (643) ordering_specification_opt ::= DESC */ - 0, /* (644) null_ordering_opt ::= */ - -2, /* (645) null_ordering_opt ::= NULLS FIRST */ - -2, /* (646) null_ordering_opt ::= NULLS LAST */ + -4, /* (590) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + -6, /* (591) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 0, /* (592) sliding_opt ::= */ + -4, /* (593) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + -1, /* (594) interval_sliding_duration_literal ::= NK_VARIABLE */ + -1, /* (595) interval_sliding_duration_literal ::= NK_STRING */ + -1, /* (596) interval_sliding_duration_literal ::= NK_INTEGER */ + 0, /* (597) fill_opt ::= */ + -4, /* (598) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (599) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (600) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (601) fill_mode ::= NONE */ + -1, /* (602) fill_mode ::= PREV */ + -1, /* (603) fill_mode ::= NULL */ + -1, /* (604) fill_mode ::= NULL_F */ + -1, /* (605) fill_mode ::= LINEAR */ + -1, /* (606) fill_mode ::= NEXT */ + 0, /* (607) group_by_clause_opt ::= */ + -3, /* (608) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (609) group_by_list ::= expr_or_subquery */ + -3, /* (610) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (611) having_clause_opt ::= */ + -2, /* (612) having_clause_opt ::= HAVING search_condition */ + 0, /* (613) range_opt ::= */ + -6, /* (614) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (615) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (616) every_opt ::= */ + -4, /* (617) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (618) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (619) query_simple ::= query_specification */ + -1, /* (620) query_simple ::= union_query_expression */ + -4, /* (621) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (622) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (623) query_simple_or_subquery ::= query_simple */ + -1, /* (624) query_simple_or_subquery ::= subquery */ + -1, /* (625) query_or_subquery ::= query_expression */ + -1, /* (626) query_or_subquery ::= subquery */ + 0, /* (627) order_by_clause_opt ::= */ + -3, /* (628) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (629) slimit_clause_opt ::= */ + -2, /* (630) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (631) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (632) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (633) limit_clause_opt ::= */ + -2, /* (634) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (635) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (636) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (637) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (638) subquery ::= NK_LP subquery NK_RP */ + -1, /* (639) search_condition ::= common_expression */ + -1, /* (640) sort_specification_list ::= sort_specification */ + -3, /* (641) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (642) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (643) ordering_specification_opt ::= */ + -1, /* (644) ordering_specification_opt ::= ASC */ + -1, /* (645) ordering_specification_opt ::= DESC */ + 0, /* (646) null_ordering_opt ::= */ + -2, /* (647) null_ordering_opt ::= NULLS FIRST */ + -2, /* (648) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -5082,21 +5028,15 @@ static YYACTIONTYPE yy_reduce( /********** Begin reduce actions **********************************************/ YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ -#line 50 "sql.y" { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -#line 5087 "sql.c" - yy_destructor(yypParser,351,&yymsp[0].minor); - break; - case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ -#line 51 "sql.y" -{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -#line 5093 "sql.c" yy_destructor(yypParser,352,&yymsp[0].minor); break; + case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ +{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } + yy_destructor(yypParser,353,&yymsp[0].minor); + break; case 2: /* account_options ::= */ -#line 55 "sql.y" { } -#line 5099 "sql.c" break; case 3: /* account_options ::= account_options PPS literal */ case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4); @@ -5107,26 +5047,20 @@ static YYACTIONTYPE yy_reduce( case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9); case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10); case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11); -{ yy_destructor(yypParser,351,&yymsp[-2].minor); -#line 56 "sql.y" +{ yy_destructor(yypParser,352,&yymsp[-2].minor); { } -#line 5113 "sql.c" - yy_destructor(yypParser,353,&yymsp[0].minor); + yy_destructor(yypParser,354,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,354,&yymsp[0].minor); -#line 68 "sql.y" +{ yy_destructor(yypParser,355,&yymsp[0].minor); { } -#line 5121 "sql.c" } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,352,&yymsp[-1].minor); -#line 69 "sql.y" +{ yy_destructor(yypParser,353,&yymsp[-1].minor); { } -#line 5128 "sql.c" - yy_destructor(yypParser,354,&yymsp[0].minor); + yy_destructor(yypParser,355,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -5139,27 +5073,19 @@ static YYACTIONTYPE yy_reduce( case 21: /* alter_account_option ::= USERS literal */ yytestcase(yyruleno==21); case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); -#line 73 "sql.y" { } -#line 5144 "sql.c" - yy_destructor(yypParser,353,&yymsp[0].minor); + yy_destructor(yypParser,354,&yymsp[0].minor); break; case 24: /* ip_range_list ::= NK_STRING */ -#line 86 "sql.y" -{ yylhsminor.yy502 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } -#line 5150 "sql.c" - yymsp[0].minor.yy502 = yylhsminor.yy502; +{ yylhsminor.yy536 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy536 = yylhsminor.yy536; break; case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ -#line 87 "sql.y" -{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-2].minor.yy502, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } -#line 5156 "sql.c" - yymsp[-2].minor.yy502 = yylhsminor.yy502; +{ yylhsminor.yy536 = addNodeToList(pCxt, yymsp[-2].minor.yy536, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy536 = yylhsminor.yy536; break; case 26: /* white_list ::= HOST ip_range_list */ -#line 91 "sql.y" -{ yymsp[-1].minor.yy502 = yymsp[0].minor.yy502; } -#line 5162 "sql.c" +{ yymsp[-1].minor.yy536 = yymsp[0].minor.yy536; } break; case 27: /* white_list_opt ::= */ case 188: /* specific_cols_opt ::= */ yytestcase(yyruleno==188); @@ -5168,140 +5094,92 @@ static YYACTIONTYPE yy_reduce( case 373: /* col_list_opt ::= */ yytestcase(yyruleno==373); case 375: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==375); case 577: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==577); - case 605: /* group_by_clause_opt ::= */ yytestcase(yyruleno==605); - case 625: /* order_by_clause_opt ::= */ yytestcase(yyruleno==625); -#line 95 "sql.y" -{ yymsp[1].minor.yy502 = NULL; } -#line 5175 "sql.c" + case 607: /* group_by_clause_opt ::= */ yytestcase(yyruleno==607); + case 627: /* order_by_clause_opt ::= */ yytestcase(yyruleno==627); +{ yymsp[1].minor.yy536 = NULL; } break; case 28: /* white_list_opt ::= white_list */ case 220: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==220); case 376: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==376); case 502: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==502); -#line 96 "sql.y" -{ yylhsminor.yy502 = yymsp[0].minor.yy502; } -#line 5183 "sql.c" - yymsp[0].minor.yy502 = yylhsminor.yy502; +{ yylhsminor.yy536 = yymsp[0].minor.yy536; } + yymsp[0].minor.yy536 = yylhsminor.yy536; break; case 29: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ -#line 100 "sql.y" { - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy561, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy1013); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy502); + pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy929, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy695); + pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy536); } -#line 5192 "sql.c" break; case 30: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -#line 104 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } -#line 5197 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy929, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 31: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -#line 105 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } -#line 5202 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy929, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 32: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -#line 106 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } -#line 5207 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy929, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 33: /* cmd ::= ALTER USER user_name ADD white_list */ -#line 107 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy502); } -#line 5212 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy929, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy536); } break; case 34: /* cmd ::= ALTER USER user_name DROP white_list */ -#line 108 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy502); } -#line 5217 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy929, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy536); } break; case 35: /* cmd ::= DROP USER user_name */ -#line 109 "sql.y" -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy561); } -#line 5222 "sql.c" +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy929); } break; case 36: /* sysinfo_opt ::= */ -#line 113 "sql.y" -{ yymsp[1].minor.yy1013 = 1; } -#line 5227 "sql.c" +{ yymsp[1].minor.yy695 = 1; } break; case 37: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -#line 114 "sql.y" -{ yymsp[-1].minor.yy1013 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } -#line 5232 "sql.c" +{ yymsp[-1].minor.yy695 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 38: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ -#line 117 "sql.y" -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy277, &yymsp[-3].minor.yy483, &yymsp[0].minor.yy561, yymsp[-2].minor.yy490); } -#line 5237 "sql.c" +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy221, &yymsp[-3].minor.yy57, &yymsp[0].minor.yy929, yymsp[-2].minor.yy360); } break; case 39: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ -#line 118 "sql.y" -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy277, &yymsp[-3].minor.yy483, &yymsp[0].minor.yy561, yymsp[-2].minor.yy490); } -#line 5242 "sql.c" +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy221, &yymsp[-3].minor.yy57, &yymsp[0].minor.yy929, yymsp[-2].minor.yy360); } break; case 40: /* privileges ::= ALL */ -#line 122 "sql.y" -{ yymsp[0].minor.yy277 = PRIVILEGE_TYPE_ALL; } -#line 5247 "sql.c" +{ yymsp[0].minor.yy221 = PRIVILEGE_TYPE_ALL; } break; case 41: /* privileges ::= priv_type_list */ case 43: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==43); -#line 123 "sql.y" -{ yylhsminor.yy277 = yymsp[0].minor.yy277; } -#line 5253 "sql.c" - yymsp[0].minor.yy277 = yylhsminor.yy277; +{ yylhsminor.yy221 = yymsp[0].minor.yy221; } + yymsp[0].minor.yy221 = yylhsminor.yy221; break; case 42: /* privileges ::= SUBSCRIBE */ -#line 124 "sql.y" -{ yymsp[0].minor.yy277 = PRIVILEGE_TYPE_SUBSCRIBE; } -#line 5259 "sql.c" +{ yymsp[0].minor.yy221 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 44: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -#line 129 "sql.y" -{ yylhsminor.yy277 = yymsp[-2].minor.yy277 | yymsp[0].minor.yy277; } -#line 5264 "sql.c" - yymsp[-2].minor.yy277 = yylhsminor.yy277; +{ yylhsminor.yy221 = yymsp[-2].minor.yy221 | yymsp[0].minor.yy221; } + yymsp[-2].minor.yy221 = yylhsminor.yy221; break; case 45: /* priv_type ::= READ */ -#line 133 "sql.y" -{ yymsp[0].minor.yy277 = PRIVILEGE_TYPE_READ; } -#line 5270 "sql.c" +{ yymsp[0].minor.yy221 = PRIVILEGE_TYPE_READ; } break; case 46: /* priv_type ::= WRITE */ -#line 134 "sql.y" -{ yymsp[0].minor.yy277 = PRIVILEGE_TYPE_WRITE; } -#line 5275 "sql.c" +{ yymsp[0].minor.yy221 = PRIVILEGE_TYPE_WRITE; } break; case 47: /* priv_type ::= ALTER */ -#line 135 "sql.y" -{ yymsp[0].minor.yy277 = PRIVILEGE_TYPE_ALTER; } -#line 5280 "sql.c" +{ yymsp[0].minor.yy221 = PRIVILEGE_TYPE_ALTER; } break; case 48: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -#line 139 "sql.y" -{ yylhsminor.yy483.first = yymsp[-2].minor.yy0; yylhsminor.yy483.second = yymsp[0].minor.yy0; } -#line 5285 "sql.c" - yymsp[-2].minor.yy483 = yylhsminor.yy483; +{ yylhsminor.yy57.first = yymsp[-2].minor.yy0; yylhsminor.yy57.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy57 = yylhsminor.yy57; break; case 49: /* priv_level ::= db_name NK_DOT NK_STAR */ -#line 140 "sql.y" -{ yylhsminor.yy483.first = yymsp[-2].minor.yy561; yylhsminor.yy483.second = yymsp[0].minor.yy0; } -#line 5291 "sql.c" - yymsp[-2].minor.yy483 = yylhsminor.yy483; +{ yylhsminor.yy57.first = yymsp[-2].minor.yy929; yylhsminor.yy57.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy57 = yylhsminor.yy57; break; case 50: /* priv_level ::= db_name NK_DOT table_name */ -#line 141 "sql.y" -{ yylhsminor.yy483.first = yymsp[-2].minor.yy561; yylhsminor.yy483.second = yymsp[0].minor.yy561; } -#line 5297 "sql.c" - yymsp[-2].minor.yy483 = yylhsminor.yy483; +{ yylhsminor.yy57.first = yymsp[-2].minor.yy929; yylhsminor.yy57.second = yymsp[0].minor.yy929; } + yymsp[-2].minor.yy57 = yylhsminor.yy57; break; case 51: /* priv_level ::= topic_name */ -#line 142 "sql.y" -{ yylhsminor.yy483.first = yymsp[0].minor.yy561; yylhsminor.yy483.second = nil_token; } -#line 5303 "sql.c" - yymsp[0].minor.yy483 = yylhsminor.yy483; +{ yylhsminor.yy57.first = yymsp[0].minor.yy929; yylhsminor.yy57.second = nil_token; } + yymsp[0].minor.yy57 = yylhsminor.yy57; break; case 52: /* with_opt ::= */ case 157: /* start_opt ::= */ yytestcase(yyruleno==157); @@ -5312,79 +5190,53 @@ static YYACTIONTYPE yy_reduce( case 542: /* from_clause_opt ::= */ yytestcase(yyruleno==542); case 575: /* where_clause_opt ::= */ yytestcase(yyruleno==575); case 584: /* twindow_clause_opt ::= */ yytestcase(yyruleno==584); - case 590: /* sliding_opt ::= */ yytestcase(yyruleno==590); - case 595: /* fill_opt ::= */ yytestcase(yyruleno==595); - case 609: /* having_clause_opt ::= */ yytestcase(yyruleno==609); - case 611: /* range_opt ::= */ yytestcase(yyruleno==611); - case 614: /* every_opt ::= */ yytestcase(yyruleno==614); - case 627: /* slimit_clause_opt ::= */ yytestcase(yyruleno==627); - case 631: /* limit_clause_opt ::= */ yytestcase(yyruleno==631); -#line 144 "sql.y" -{ yymsp[1].minor.yy490 = NULL; } -#line 5324 "sql.c" + case 592: /* sliding_opt ::= */ yytestcase(yyruleno==592); + case 597: /* fill_opt ::= */ yytestcase(yyruleno==597); + case 611: /* having_clause_opt ::= */ yytestcase(yyruleno==611); + case 613: /* range_opt ::= */ yytestcase(yyruleno==613); + case 616: /* every_opt ::= */ yytestcase(yyruleno==616); + case 629: /* slimit_clause_opt ::= */ yytestcase(yyruleno==629); + case 633: /* limit_clause_opt ::= */ yytestcase(yyruleno==633); +{ yymsp[1].minor.yy360 = NULL; } break; case 53: /* with_opt ::= WITH search_condition */ case 543: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==543); case 576: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==576); - case 610: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==610); -#line 145 "sql.y" -{ yymsp[-1].minor.yy490 = yymsp[0].minor.yy490; } -#line 5332 "sql.c" + case 612: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==612); +{ yymsp[-1].minor.yy360 = yymsp[0].minor.yy360; } break; case 54: /* cmd ::= CREATE DNODE dnode_endpoint */ -#line 148 "sql.y" -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy561, NULL); } -#line 5337 "sql.c" +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy929, NULL); } break; case 55: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -#line 149 "sql.y" -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0); } -#line 5342 "sql.c" +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy929, &yymsp[0].minor.yy0); } break; case 56: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -#line 150 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy845, false); } -#line 5347 "sql.c" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy345, false); } break; case 57: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -#line 151 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy561, yymsp[0].minor.yy845, false); } -#line 5352 "sql.c" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy929, yymsp[0].minor.yy345, false); } break; case 58: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ -#line 152 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy845); } -#line 5357 "sql.c" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy345); } break; case 59: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ -#line 153 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy561, false, yymsp[0].minor.yy845); } -#line 5362 "sql.c" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy929, false, yymsp[0].minor.yy345); } break; case 60: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ -#line 154 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } -#line 5367 "sql.c" break; case 61: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ -#line 155 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5372 "sql.c" break; case 62: /* cmd ::= ALTER ALL DNODES NK_STRING */ -#line 156 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); } -#line 5377 "sql.c" break; case 63: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ -#line 157 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5382 "sql.c" break; case 64: /* cmd ::= RESTORE DNODE NK_INTEGER */ -#line 158 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); } -#line 5387 "sql.c" break; case 65: /* dnode_endpoint ::= NK_STRING */ case 66: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==66); @@ -5419,10 +5271,8 @@ static YYACTIONTYPE yy_reduce( case 498: /* star_func ::= FIRST */ yytestcase(yyruleno==498); case 499: /* star_func ::= LAST */ yytestcase(yyruleno==499); case 500: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==500); -#line 162 "sql.y" -{ yylhsminor.yy561 = yymsp[0].minor.yy0; } -#line 5424 "sql.c" - yymsp[0].minor.yy561 = yylhsminor.yy561; +{ yylhsminor.yy929 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy929 = yylhsminor.yy929; break; case 68: /* force_opt ::= */ case 94: /* not_exists_opt ::= */ yytestcase(yyruleno==94); @@ -5433,9 +5283,7 @@ static YYACTIONTYPE yy_reduce( case 389: /* ignore_opt ::= */ yytestcase(yyruleno==389); case 563: /* tag_mode_opt ::= */ yytestcase(yyruleno==563); case 565: /* set_quantifier_opt ::= */ yytestcase(yyruleno==565); -#line 168 "sql.y" -{ yymsp[1].minor.yy845 = false; } -#line 5438 "sql.c" +{ yymsp[1].minor.yy345 = false; } break; case 69: /* force_opt ::= FORCE */ case 70: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==70); @@ -5443,441 +5291,289 @@ static YYACTIONTYPE yy_reduce( case 358: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==358); case 564: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==564); case 566: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==566); -#line 169 "sql.y" -{ yymsp[0].minor.yy845 = true; } -#line 5448 "sql.c" +{ yymsp[0].minor.yy345 = true; } break; case 71: /* cmd ::= ALTER CLUSTER NK_STRING */ -#line 176 "sql.y" { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 5453 "sql.c" break; case 72: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ -#line 177 "sql.y" { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5458 "sql.c" break; case 73: /* cmd ::= ALTER LOCAL NK_STRING */ -#line 180 "sql.y" { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 5463 "sql.c" break; case 74: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ -#line 181 "sql.y" { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5468 "sql.c" break; case 75: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ -#line 184 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); } -#line 5473 "sql.c" break; case 76: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ -#line 185 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); } -#line 5478 "sql.c" break; case 77: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ -#line 186 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); } -#line 5483 "sql.c" break; case 78: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ -#line 189 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); } -#line 5488 "sql.c" break; case 79: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ -#line 190 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); } -#line 5493 "sql.c" break; case 80: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ -#line 193 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); } -#line 5498 "sql.c" break; case 81: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ -#line 194 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); } -#line 5503 "sql.c" break; case 82: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ -#line 197 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); } -#line 5508 "sql.c" break; case 83: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ -#line 198 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } -#line 5513 "sql.c" break; case 84: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ -#line 199 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); } -#line 5518 "sql.c" break; case 85: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ -#line 202 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } -#line 5523 "sql.c" break; case 86: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -#line 205 "sql.y" -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy845, &yymsp[-1].minor.yy561, yymsp[0].minor.yy490); } -#line 5528 "sql.c" +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy345, &yymsp[-1].minor.yy929, yymsp[0].minor.yy360); } break; case 87: /* cmd ::= DROP DATABASE exists_opt db_name */ -#line 206 "sql.y" -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy845, &yymsp[0].minor.yy561); } -#line 5533 "sql.c" +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy345, &yymsp[0].minor.yy929); } break; case 88: /* cmd ::= USE db_name */ -#line 207 "sql.y" -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy561); } -#line 5538 "sql.c" +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy929); } break; case 89: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -#line 208 "sql.y" -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy561, yymsp[0].minor.yy490); } -#line 5543 "sql.c" +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy929, yymsp[0].minor.yy360); } break; case 90: /* cmd ::= FLUSH DATABASE db_name */ -#line 209 "sql.y" -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy561); } -#line 5548 "sql.c" +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy929); } break; case 91: /* cmd ::= TRIM DATABASE db_name speed_opt */ -#line 210 "sql.y" -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy561, yymsp[0].minor.yy774); } -#line 5553 "sql.c" +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy929, yymsp[0].minor.yy580); } break; case 92: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -#line 211 "sql.y" -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy561, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); } -#line 5558 "sql.c" +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy929, yymsp[-1].minor.yy360, yymsp[0].minor.yy360); } break; case 93: /* not_exists_opt ::= IF NOT EXISTS */ -#line 215 "sql.y" -{ yymsp[-2].minor.yy845 = true; } -#line 5563 "sql.c" +{ yymsp[-2].minor.yy345 = true; } break; case 95: /* exists_opt ::= IF EXISTS */ case 364: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==364); case 390: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==390); -#line 220 "sql.y" -{ yymsp[-1].minor.yy845 = true; } -#line 5570 "sql.c" +{ yymsp[-1].minor.yy345 = true; } break; case 97: /* db_options ::= */ -#line 223 "sql.y" -{ yymsp[1].minor.yy490 = createDefaultDatabaseOptions(pCxt); } -#line 5575 "sql.c" +{ yymsp[1].minor.yy360 = createDefaultDatabaseOptions(pCxt); } break; case 98: /* db_options ::= db_options BUFFER NK_INTEGER */ -#line 224 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } -#line 5580 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 99: /* db_options ::= db_options CACHEMODEL NK_STRING */ -#line 225 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } -#line 5586 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 100: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -#line 226 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } -#line 5592 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 101: /* db_options ::= db_options COMP NK_INTEGER */ -#line 227 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_COMP, &yymsp[0].minor.yy0); } -#line 5598 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 102: /* db_options ::= db_options DURATION NK_INTEGER */ case 103: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==103); -#line 228 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } -#line 5605 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 104: /* db_options ::= db_options MAXROWS NK_INTEGER */ -#line 230 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } -#line 5611 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 105: /* db_options ::= db_options MINROWS NK_INTEGER */ -#line 231 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } -#line 5617 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 106: /* db_options ::= db_options KEEP integer_list */ case 107: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==107); -#line 232 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_KEEP, yymsp[0].minor.yy502); } -#line 5624 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_KEEP, yymsp[0].minor.yy536); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 108: /* db_options ::= db_options PAGES NK_INTEGER */ -#line 234 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } -#line 5630 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 109: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -#line 235 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } -#line 5636 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 110: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -#line 236 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } -#line 5642 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 111: /* db_options ::= db_options PRECISION NK_STRING */ -#line 237 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } -#line 5648 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 112: /* db_options ::= db_options REPLICA NK_INTEGER */ -#line 238 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } -#line 5654 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 113: /* db_options ::= db_options VGROUPS NK_INTEGER */ -#line 240 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } -#line 5660 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 114: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -#line 241 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } -#line 5666 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 115: /* db_options ::= db_options RETENTIONS retention_list */ -#line 242 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_RETENTIONS, yymsp[0].minor.yy502); } -#line 5672 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_RETENTIONS, yymsp[0].minor.yy536); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 116: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -#line 243 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } -#line 5678 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 117: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -#line 244 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_WAL, &yymsp[0].minor.yy0); } -#line 5684 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 118: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -#line 245 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } -#line 5690 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 119: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -#line 246 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } -#line 5696 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 120: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ -#line 247 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-3].minor.yy490, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-3].minor.yy360, DB_OPTION_WAL_RETENTION_PERIOD, &t); } -#line 5706 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; case 121: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -#line 252 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } -#line 5712 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 122: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ -#line 253 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-3].minor.yy490, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-3].minor.yy360, DB_OPTION_WAL_RETENTION_SIZE, &t); } -#line 5722 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; case 123: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -#line 258 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } -#line 5728 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 124: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -#line 259 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } -#line 5734 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 125: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -#line 260 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } -#line 5740 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 126: /* db_options ::= db_options TABLE_PREFIX signed */ -#line 261 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy490); } -#line 5746 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy360); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 127: /* db_options ::= db_options TABLE_SUFFIX signed */ -#line 262 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy490); } -#line 5752 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy360); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 128: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ -#line 263 "sql.y" -{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } -#line 5758 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setDatabaseOption(pCxt, yymsp[-2].minor.yy360, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 129: /* alter_db_options ::= alter_db_option */ -#line 265 "sql.y" -{ yylhsminor.yy490 = createAlterDatabaseOptions(pCxt); yylhsminor.yy490 = setAlterDatabaseOption(pCxt, yylhsminor.yy490, &yymsp[0].minor.yy529); } -#line 5764 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createAlterDatabaseOptions(pCxt); yylhsminor.yy360 = setAlterDatabaseOption(pCxt, yylhsminor.yy360, &yymsp[0].minor.yy797); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 130: /* alter_db_options ::= alter_db_options alter_db_option */ -#line 266 "sql.y" -{ yylhsminor.yy490 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy490, &yymsp[0].minor.yy529); } -#line 5770 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy360, &yymsp[0].minor.yy797); } + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 131: /* alter_db_option ::= BUFFER NK_INTEGER */ -#line 270 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 5776 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 132: /* alter_db_option ::= CACHEMODEL NK_STRING */ -#line 271 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 5781 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 133: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -#line 272 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 5786 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 134: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -#line 273 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 5791 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 135: /* alter_db_option ::= KEEP integer_list */ case 136: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==136); -#line 274 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_KEEP; yymsp[-1].minor.yy529.pList = yymsp[0].minor.yy502; } -#line 5797 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_KEEP; yymsp[-1].minor.yy797.pList = yymsp[0].minor.yy536; } break; case 137: /* alter_db_option ::= PAGES NK_INTEGER */ -#line 276 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_PAGES; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 5802 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_PAGES; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 138: /* alter_db_option ::= REPLICA NK_INTEGER */ -#line 277 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 5807 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 139: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -#line 279 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_WAL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 5812 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_WAL; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 140: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -#line 280 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 5817 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 141: /* alter_db_option ::= MINROWS NK_INTEGER */ -#line 281 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 5822 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 142: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -#line 282 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 5827 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 143: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ -#line 283 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy529.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy529.val = t; + yymsp[-2].minor.yy797.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy797.val = t; } -#line 5836 "sql.c" break; case 144: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -#line 288 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 5841 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 145: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ -#line 289 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy529.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy529.val = t; + yymsp[-2].minor.yy797.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy797.val = t; } -#line 5850 "sql.c" break; case 146: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ -#line 294 "sql.y" -{ yymsp[-1].minor.yy529.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 5855 "sql.c" +{ yymsp[-1].minor.yy797.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 147: /* integer_list ::= NK_INTEGER */ -#line 298 "sql.y" -{ yylhsminor.yy502 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 5860 "sql.c" - yymsp[0].minor.yy502 = yylhsminor.yy502; +{ yylhsminor.yy536 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy536 = yylhsminor.yy536; break; case 148: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ case 403: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==403); -#line 299 "sql.y" -{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-2].minor.yy502, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 5867 "sql.c" - yymsp[-2].minor.yy502 = yylhsminor.yy502; +{ yylhsminor.yy536 = addNodeToList(pCxt, yymsp[-2].minor.yy536, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy536 = yylhsminor.yy536; break; case 149: /* variable_list ::= NK_VARIABLE */ -#line 303 "sql.y" -{ yylhsminor.yy502 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 5873 "sql.c" - yymsp[0].minor.yy502 = yylhsminor.yy502; +{ yylhsminor.yy536 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy536 = yylhsminor.yy536; break; case 150: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -#line 304 "sql.y" -{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-2].minor.yy502, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 5879 "sql.c" - yymsp[-2].minor.yy502 = yylhsminor.yy502; +{ yylhsminor.yy536 = addNodeToList(pCxt, yymsp[-2].minor.yy536, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy536 = yylhsminor.yy536; break; case 151: /* retention_list ::= retention */ case 182: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==182); @@ -5892,11 +5588,9 @@ static YYACTIONTYPE yy_reduce( case 509: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==509); case 568: /* select_list ::= select_item */ yytestcase(yyruleno==568); case 579: /* partition_list ::= partition_item */ yytestcase(yyruleno==579); - case 638: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==638); -#line 308 "sql.y" -{ yylhsminor.yy502 = createNodeList(pCxt, yymsp[0].minor.yy490); } -#line 5898 "sql.c" - yymsp[0].minor.yy502 = yylhsminor.yy502; + case 640: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==640); +{ yylhsminor.yy536 = createNodeList(pCxt, yymsp[0].minor.yy360); } + yymsp[0].minor.yy536 = yylhsminor.yy536; break; case 152: /* retention_list ::= retention_list NK_COMMA retention */ case 186: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==186); @@ -5909,1108 +5603,706 @@ static YYACTIONTYPE yy_reduce( case 504: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==504); case 569: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==569); case 580: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==580); - case 639: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==639); -#line 309 "sql.y" -{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-2].minor.yy502, yymsp[0].minor.yy490); } -#line 5915 "sql.c" - yymsp[-2].minor.yy502 = yylhsminor.yy502; + case 641: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==641); +{ yylhsminor.yy536 = addNodeToList(pCxt, yymsp[-2].minor.yy536, yymsp[0].minor.yy360); } + yymsp[-2].minor.yy536 = yylhsminor.yy536; break; case 153: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ case 154: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==154); -#line 311 "sql.y" -{ yylhsminor.yy490 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 5922 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 155: /* speed_opt ::= */ case 359: /* bufsize_opt ::= */ yytestcase(yyruleno==359); -#line 316 "sql.y" -{ yymsp[1].minor.yy774 = 0; } -#line 5929 "sql.c" +{ yymsp[1].minor.yy580 = 0; } break; case 156: /* speed_opt ::= BWLIMIT NK_INTEGER */ case 360: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==360); -#line 317 "sql.y" -{ yymsp[-1].minor.yy774 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } -#line 5935 "sql.c" +{ yymsp[-1].minor.yy580 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 158: /* start_opt ::= START WITH NK_INTEGER */ case 162: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==162); -#line 320 "sql.y" -{ yymsp[-2].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } -#line 5941 "sql.c" +{ yymsp[-2].minor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } break; case 159: /* start_opt ::= START WITH NK_STRING */ case 163: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==163); -#line 321 "sql.y" -{ yymsp[-2].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } -#line 5947 "sql.c" +{ yymsp[-2].minor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 160: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ case 164: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==164); -#line 322 "sql.y" -{ yymsp[-3].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } -#line 5953 "sql.c" +{ yymsp[-3].minor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 165: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 167: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==167); -#line 331 "sql.y" -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy845, yymsp[-5].minor.yy490, yymsp[-3].minor.yy502, yymsp[-1].minor.yy502, yymsp[0].minor.yy490); } -#line 5959 "sql.c" +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy345, yymsp[-5].minor.yy360, yymsp[-3].minor.yy536, yymsp[-1].minor.yy536, yymsp[0].minor.yy360); } break; case 166: /* cmd ::= CREATE TABLE multi_create_clause */ -#line 332 "sql.y" -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy502); } -#line 5964 "sql.c" +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy536); } break; case 168: /* cmd ::= DROP TABLE multi_drop_clause */ -#line 335 "sql.y" -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy502); } -#line 5969 "sql.c" +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy536); } break; case 169: /* cmd ::= DROP STABLE exists_opt full_table_name */ -#line 336 "sql.y" -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy845, yymsp[0].minor.yy490); } -#line 5974 "sql.c" +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy345, yymsp[0].minor.yy360); } break; case 170: /* cmd ::= ALTER TABLE alter_table_clause */ case 405: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==405); case 406: /* cmd ::= insert_query */ yytestcase(yyruleno==406); -#line 338 "sql.y" -{ pCxt->pRootNode = yymsp[0].minor.yy490; } -#line 5981 "sql.c" +{ pCxt->pRootNode = yymsp[0].minor.yy360; } break; case 171: /* cmd ::= ALTER STABLE alter_table_clause */ -#line 339 "sql.y" -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy490); } -#line 5986 "sql.c" +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy360); } break; case 172: /* alter_table_clause ::= full_table_name alter_table_options */ -#line 341 "sql.y" -{ yylhsminor.yy490 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); } -#line 5991 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy360, yymsp[0].minor.yy360); } + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 173: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -#line 343 "sql.y" -{ yylhsminor.yy490 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy490, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy561, yymsp[0].minor.yy826); } -#line 5997 "sql.c" - yymsp[-4].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy360, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy929, yymsp[0].minor.yy912); } + yymsp[-4].minor.yy360 = yylhsminor.yy360; break; case 174: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -#line 344 "sql.y" -{ yylhsminor.yy490 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy490, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy561); } -#line 6003 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy360, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy929); } + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; case 175: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -#line 346 "sql.y" -{ yylhsminor.yy490 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy490, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy561, yymsp[0].minor.yy826); } -#line 6009 "sql.c" - yymsp[-4].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy360, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy929, yymsp[0].minor.yy912); } + yymsp[-4].minor.yy360 = yylhsminor.yy360; break; case 176: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -#line 348 "sql.y" -{ yylhsminor.yy490 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy490, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy561, &yymsp[0].minor.yy561); } -#line 6015 "sql.c" - yymsp[-4].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy360, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy929, &yymsp[0].minor.yy929); } + yymsp[-4].minor.yy360 = yylhsminor.yy360; break; case 177: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -#line 350 "sql.y" -{ yylhsminor.yy490 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy490, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy561, yymsp[0].minor.yy826); } -#line 6021 "sql.c" - yymsp[-4].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy360, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy929, yymsp[0].minor.yy912); } + yymsp[-4].minor.yy360 = yylhsminor.yy360; break; case 178: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -#line 351 "sql.y" -{ yylhsminor.yy490 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy490, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy561); } -#line 6027 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy360, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy929); } + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; case 179: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -#line 353 "sql.y" -{ yylhsminor.yy490 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy490, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy561, yymsp[0].minor.yy826); } -#line 6033 "sql.c" - yymsp[-4].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy360, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy929, yymsp[0].minor.yy912); } + yymsp[-4].minor.yy360 = yylhsminor.yy360; break; case 180: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -#line 355 "sql.y" -{ yylhsminor.yy490 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy490, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy561, &yymsp[0].minor.yy561); } -#line 6039 "sql.c" - yymsp[-4].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy360, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy929, &yymsp[0].minor.yy929); } + yymsp[-4].minor.yy360 = yylhsminor.yy360; break; case 181: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -#line 357 "sql.y" -{ yylhsminor.yy490 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy490, &yymsp[-2].minor.yy561, yymsp[0].minor.yy490); } -#line 6045 "sql.c" - yymsp[-5].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy360, &yymsp[-2].minor.yy929, yymsp[0].minor.yy360); } + yymsp[-5].minor.yy360 = yylhsminor.yy360; break; case 183: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 510: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==510); -#line 362 "sql.y" -{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-1].minor.yy502, yymsp[0].minor.yy490); } -#line 6052 "sql.c" - yymsp[-1].minor.yy502 = yylhsminor.yy502; +{ yylhsminor.yy536 = addNodeToList(pCxt, yymsp[-1].minor.yy536, yymsp[0].minor.yy360); } + yymsp[-1].minor.yy536 = yylhsminor.yy536; break; case 184: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ -#line 366 "sql.y" -{ yylhsminor.yy490 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy845, yymsp[-8].minor.yy490, yymsp[-6].minor.yy490, yymsp[-5].minor.yy502, yymsp[-2].minor.yy502, yymsp[0].minor.yy490); } -#line 6058 "sql.c" - yymsp[-9].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy345, yymsp[-8].minor.yy360, yymsp[-6].minor.yy360, yymsp[-5].minor.yy536, yymsp[-2].minor.yy536, yymsp[0].minor.yy360); } + yymsp[-9].minor.yy360 = yylhsminor.yy360; break; case 187: /* drop_table_clause ::= exists_opt full_table_name */ -#line 373 "sql.y" -{ yylhsminor.yy490 = createDropTableClause(pCxt, yymsp[-1].minor.yy845, yymsp[0].minor.yy490); } -#line 6064 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createDropTableClause(pCxt, yymsp[-1].minor.yy345, yymsp[0].minor.yy360); } + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 189: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ case 374: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==374); -#line 378 "sql.y" -{ yymsp[-2].minor.yy502 = yymsp[-1].minor.yy502; } -#line 6071 "sql.c" +{ yymsp[-2].minor.yy536 = yymsp[-1].minor.yy536; } break; case 190: /* full_table_name ::= table_name */ -#line 380 "sql.y" -{ yylhsminor.yy490 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy561, NULL); } -#line 6076 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy929, NULL); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 191: /* full_table_name ::= db_name NK_DOT table_name */ -#line 381 "sql.y" -{ yylhsminor.yy490 = createRealTableNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561, NULL); } -#line 6082 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRealTableNode(pCxt, &yymsp[-2].minor.yy929, &yymsp[0].minor.yy929, NULL); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 194: /* column_def ::= column_name type_name */ -#line 388 "sql.y" -{ yylhsminor.yy490 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy561, yymsp[0].minor.yy826, NULL); } -#line 6088 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy929, yymsp[0].minor.yy912, NULL); } + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 195: /* type_name ::= BOOL */ -#line 393 "sql.y" -{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_BOOL); } -#line 6094 "sql.c" +{ yymsp[0].minor.yy912 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 196: /* type_name ::= TINYINT */ -#line 394 "sql.y" -{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_TINYINT); } -#line 6099 "sql.c" +{ yymsp[0].minor.yy912 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 197: /* type_name ::= SMALLINT */ -#line 395 "sql.y" -{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_SMALLINT); } -#line 6104 "sql.c" +{ yymsp[0].minor.yy912 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 198: /* type_name ::= INT */ case 199: /* type_name ::= INTEGER */ yytestcase(yyruleno==199); -#line 396 "sql.y" -{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_INT); } -#line 6110 "sql.c" +{ yymsp[0].minor.yy912 = createDataType(TSDB_DATA_TYPE_INT); } break; case 200: /* type_name ::= BIGINT */ -#line 398 "sql.y" -{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_BIGINT); } -#line 6115 "sql.c" +{ yymsp[0].minor.yy912 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 201: /* type_name ::= FLOAT */ -#line 399 "sql.y" -{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_FLOAT); } -#line 6120 "sql.c" +{ yymsp[0].minor.yy912 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 202: /* type_name ::= DOUBLE */ -#line 400 "sql.y" -{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_DOUBLE); } -#line 6125 "sql.c" +{ yymsp[0].minor.yy912 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 203: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -#line 401 "sql.y" -{ yymsp[-3].minor.yy826 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } -#line 6130 "sql.c" +{ yymsp[-3].minor.yy912 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 204: /* type_name ::= TIMESTAMP */ -#line 402 "sql.y" -{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } -#line 6135 "sql.c" +{ yymsp[0].minor.yy912 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 205: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -#line 403 "sql.y" -{ yymsp[-3].minor.yy826 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } -#line 6140 "sql.c" +{ yymsp[-3].minor.yy912 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 206: /* type_name ::= TINYINT UNSIGNED */ -#line 404 "sql.y" -{ yymsp[-1].minor.yy826 = createDataType(TSDB_DATA_TYPE_UTINYINT); } -#line 6145 "sql.c" +{ yymsp[-1].minor.yy912 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 207: /* type_name ::= SMALLINT UNSIGNED */ -#line 405 "sql.y" -{ yymsp[-1].minor.yy826 = createDataType(TSDB_DATA_TYPE_USMALLINT); } -#line 6150 "sql.c" +{ yymsp[-1].minor.yy912 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 208: /* type_name ::= INT UNSIGNED */ -#line 406 "sql.y" -{ yymsp[-1].minor.yy826 = createDataType(TSDB_DATA_TYPE_UINT); } -#line 6155 "sql.c" +{ yymsp[-1].minor.yy912 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 209: /* type_name ::= BIGINT UNSIGNED */ -#line 407 "sql.y" -{ yymsp[-1].minor.yy826 = createDataType(TSDB_DATA_TYPE_UBIGINT); } -#line 6160 "sql.c" +{ yymsp[-1].minor.yy912 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 210: /* type_name ::= JSON */ -#line 408 "sql.y" -{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_JSON); } -#line 6165 "sql.c" +{ yymsp[0].minor.yy912 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 211: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -#line 409 "sql.y" -{ yymsp[-3].minor.yy826 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } -#line 6170 "sql.c" +{ yymsp[-3].minor.yy912 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 212: /* type_name ::= MEDIUMBLOB */ -#line 410 "sql.y" -{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } -#line 6175 "sql.c" +{ yymsp[0].minor.yy912 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 213: /* type_name ::= BLOB */ -#line 411 "sql.y" -{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_BLOB); } -#line 6180 "sql.c" +{ yymsp[0].minor.yy912 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 214: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -#line 412 "sql.y" -{ yymsp[-3].minor.yy826 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } -#line 6185 "sql.c" +{ yymsp[-3].minor.yy912 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 215: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ -#line 413 "sql.y" -{ yymsp[-3].minor.yy826 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } -#line 6190 "sql.c" +{ yymsp[-3].minor.yy912 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } break; case 216: /* type_name ::= DECIMAL */ -#line 414 "sql.y" -{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_DECIMAL); } -#line 6195 "sql.c" +{ yymsp[0].minor.yy912 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 217: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -#line 415 "sql.y" -{ yymsp[-3].minor.yy826 = createDataType(TSDB_DATA_TYPE_DECIMAL); } -#line 6200 "sql.c" +{ yymsp[-3].minor.yy912 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 218: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -#line 416 "sql.y" -{ yymsp[-5].minor.yy826 = createDataType(TSDB_DATA_TYPE_DECIMAL); } -#line 6205 "sql.c" +{ yymsp[-5].minor.yy912 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 221: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ case 377: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==377); -#line 425 "sql.y" -{ yymsp[-3].minor.yy502 = yymsp[-1].minor.yy502; } -#line 6211 "sql.c" +{ yymsp[-3].minor.yy536 = yymsp[-1].minor.yy536; } break; case 222: /* table_options ::= */ -#line 427 "sql.y" -{ yymsp[1].minor.yy490 = createDefaultTableOptions(pCxt); } -#line 6216 "sql.c" +{ yymsp[1].minor.yy360 = createDefaultTableOptions(pCxt); } break; case 223: /* table_options ::= table_options COMMENT NK_STRING */ -#line 428 "sql.y" -{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-2].minor.yy490, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } -#line 6221 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setTableOption(pCxt, yymsp[-2].minor.yy360, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 224: /* table_options ::= table_options MAX_DELAY duration_list */ -#line 429 "sql.y" -{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-2].minor.yy490, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy502); } -#line 6227 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setTableOption(pCxt, yymsp[-2].minor.yy360, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy536); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 225: /* table_options ::= table_options WATERMARK duration_list */ -#line 430 "sql.y" -{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-2].minor.yy490, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy502); } -#line 6233 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setTableOption(pCxt, yymsp[-2].minor.yy360, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy536); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 226: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -#line 431 "sql.y" -{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-4].minor.yy490, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy502); } -#line 6239 "sql.c" - yymsp[-4].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setTableOption(pCxt, yymsp[-4].minor.yy360, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy536); } + yymsp[-4].minor.yy360 = yylhsminor.yy360; break; case 227: /* table_options ::= table_options TTL NK_INTEGER */ -#line 432 "sql.y" -{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-2].minor.yy490, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } -#line 6245 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setTableOption(pCxt, yymsp[-2].minor.yy360, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 228: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -#line 433 "sql.y" -{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-4].minor.yy490, TABLE_OPTION_SMA, yymsp[-1].minor.yy502); } -#line 6251 "sql.c" - yymsp[-4].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setTableOption(pCxt, yymsp[-4].minor.yy360, TABLE_OPTION_SMA, yymsp[-1].minor.yy536); } + yymsp[-4].minor.yy360 = yylhsminor.yy360; break; case 229: /* table_options ::= table_options DELETE_MARK duration_list */ -#line 434 "sql.y" -{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-2].minor.yy490, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy502); } -#line 6257 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setTableOption(pCxt, yymsp[-2].minor.yy360, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy536); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 230: /* alter_table_options ::= alter_table_option */ -#line 436 "sql.y" -{ yylhsminor.yy490 = createAlterTableOptions(pCxt); yylhsminor.yy490 = setTableOption(pCxt, yylhsminor.yy490, yymsp[0].minor.yy529.type, &yymsp[0].minor.yy529.val); } -#line 6263 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createAlterTableOptions(pCxt); yylhsminor.yy360 = setTableOption(pCxt, yylhsminor.yy360, yymsp[0].minor.yy797.type, &yymsp[0].minor.yy797.val); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 231: /* alter_table_options ::= alter_table_options alter_table_option */ -#line 437 "sql.y" -{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-1].minor.yy490, yymsp[0].minor.yy529.type, &yymsp[0].minor.yy529.val); } -#line 6269 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setTableOption(pCxt, yymsp[-1].minor.yy360, yymsp[0].minor.yy797.type, &yymsp[0].minor.yy797.val); } + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 232: /* alter_table_option ::= COMMENT NK_STRING */ -#line 441 "sql.y" -{ yymsp[-1].minor.yy529.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 6275 "sql.c" +{ yymsp[-1].minor.yy797.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 233: /* alter_table_option ::= TTL NK_INTEGER */ -#line 442 "sql.y" -{ yymsp[-1].minor.yy529.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } -#line 6280 "sql.c" +{ yymsp[-1].minor.yy797.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy797.val = yymsp[0].minor.yy0; } break; case 234: /* duration_list ::= duration_literal */ case 464: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==464); -#line 446 "sql.y" -{ yylhsminor.yy502 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); } -#line 6286 "sql.c" - yymsp[0].minor.yy502 = yylhsminor.yy502; +{ yylhsminor.yy536 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy360)); } + yymsp[0].minor.yy536 = yylhsminor.yy536; break; case 235: /* duration_list ::= duration_list NK_COMMA duration_literal */ case 465: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==465); -#line 447 "sql.y" -{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-2].minor.yy502, releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); } -#line 6293 "sql.c" - yymsp[-2].minor.yy502 = yylhsminor.yy502; +{ yylhsminor.yy536 = addNodeToList(pCxt, yymsp[-2].minor.yy536, releaseRawExprNode(pCxt, yymsp[0].minor.yy360)); } + yymsp[-2].minor.yy536 = yylhsminor.yy536; break; case 238: /* rollup_func_name ::= function_name */ -#line 454 "sql.y" -{ yylhsminor.yy490 = createFunctionNode(pCxt, &yymsp[0].minor.yy561, NULL); } -#line 6299 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createFunctionNode(pCxt, &yymsp[0].minor.yy929, NULL); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 239: /* rollup_func_name ::= FIRST */ case 240: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==240); case 311: /* tag_item ::= QTAGS */ yytestcase(yyruleno==311); -#line 455 "sql.y" -{ yylhsminor.yy490 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 6307 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 243: /* col_name ::= column_name */ case 312: /* tag_item ::= column_name */ yytestcase(yyruleno==312); -#line 463 "sql.y" -{ yylhsminor.yy490 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy561); } -#line 6314 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy929); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 244: /* cmd ::= SHOW DNODES */ -#line 466 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } -#line 6320 "sql.c" break; case 245: /* cmd ::= SHOW USERS */ -#line 467 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } -#line 6325 "sql.c" break; case 246: /* cmd ::= SHOW USER PRIVILEGES */ -#line 468 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } -#line 6330 "sql.c" break; case 247: /* cmd ::= SHOW db_kind_opt DATABASES */ -#line 469 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy579); + setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy321); } -#line 6338 "sql.c" break; case 248: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ -#line 473 "sql.y" { - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy961, yymsp[0].minor.yy490, OP_TYPE_LIKE); + pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy1005, yymsp[0].minor.yy360, OP_TYPE_LIKE); } -#line 6345 "sql.c" break; case 249: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -#line 476 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy490, yymsp[0].minor.yy490, OP_TYPE_LIKE); } -#line 6350 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy360, yymsp[0].minor.yy360, OP_TYPE_LIKE); } break; case 250: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -#line 477 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy490, NULL, OP_TYPE_LIKE); } -#line 6355 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy360, NULL, OP_TYPE_LIKE); } break; case 251: /* cmd ::= SHOW MNODES */ -#line 478 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } -#line 6360 "sql.c" break; case 252: /* cmd ::= SHOW QNODES */ -#line 480 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } -#line 6365 "sql.c" break; case 253: /* cmd ::= SHOW FUNCTIONS */ -#line 481 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } -#line 6370 "sql.c" break; case 254: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -#line 482 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy490, yymsp[-1].minor.yy490, OP_TYPE_EQUAL); } -#line 6375 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy360, yymsp[-1].minor.yy360, OP_TYPE_EQUAL); } break; case 255: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ -#line 483 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy561), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561), OP_TYPE_EQUAL); } -#line 6380 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy929), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy929), OP_TYPE_EQUAL); } break; case 256: /* cmd ::= SHOW STREAMS */ -#line 484 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } -#line 6385 "sql.c" break; case 257: /* cmd ::= SHOW ACCOUNTS */ -#line 485 "sql.y" { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -#line 6390 "sql.c" break; case 258: /* cmd ::= SHOW APPS */ -#line 486 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } -#line 6395 "sql.c" break; case 259: /* cmd ::= SHOW CONNECTIONS */ -#line 487 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } -#line 6400 "sql.c" break; case 260: /* cmd ::= SHOW LICENCES */ case 261: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==261); -#line 488 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } -#line 6406 "sql.c" break; case 262: /* cmd ::= SHOW GRANTS FULL */ -#line 490 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); } -#line 6411 "sql.c" break; case 263: /* cmd ::= SHOW GRANTS LOGS */ -#line 491 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); } -#line 6416 "sql.c" break; case 264: /* cmd ::= SHOW CLUSTER MACHINES */ -#line 492 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); } -#line 6421 "sql.c" break; case 265: /* cmd ::= SHOW CREATE DATABASE db_name */ -#line 493 "sql.y" -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy561); } -#line 6426 "sql.c" +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy929); } break; case 266: /* cmd ::= SHOW CREATE TABLE full_table_name */ -#line 494 "sql.y" -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy490); } -#line 6431 "sql.c" +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy360); } break; case 267: /* cmd ::= SHOW CREATE STABLE full_table_name */ -#line 495 "sql.y" -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy490); } -#line 6436 "sql.c" +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy360); } break; case 268: /* cmd ::= SHOW QUERIES */ -#line 496 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } -#line 6441 "sql.c" break; case 269: /* cmd ::= SHOW SCORES */ -#line 497 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } -#line 6446 "sql.c" break; case 270: /* cmd ::= SHOW TOPICS */ -#line 498 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } -#line 6451 "sql.c" break; case 271: /* cmd ::= SHOW VARIABLES */ case 272: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==272); -#line 499 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } -#line 6457 "sql.c" break; case 273: /* cmd ::= SHOW LOCAL VARIABLES */ -#line 501 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } -#line 6462 "sql.c" break; case 274: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -#line 502 "sql.y" -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy490); } -#line 6467 "sql.c" +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy360); } break; case 275: /* cmd ::= SHOW BNODES */ -#line 503 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } -#line 6472 "sql.c" break; case 276: /* cmd ::= SHOW SNODES */ -#line 504 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } -#line 6477 "sql.c" break; case 277: /* cmd ::= SHOW CLUSTER */ -#line 505 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } -#line 6482 "sql.c" break; case 278: /* cmd ::= SHOW TRANSACTIONS */ -#line 506 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } -#line 6487 "sql.c" break; case 279: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -#line 507 "sql.y" -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy490); } -#line 6492 "sql.c" +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy360); } break; case 280: /* cmd ::= SHOW CONSUMERS */ -#line 508 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } -#line 6497 "sql.c" break; case 281: /* cmd ::= SHOW SUBSCRIPTIONS */ -#line 509 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } -#line 6502 "sql.c" break; case 282: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -#line 510 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy490, yymsp[-1].minor.yy490, OP_TYPE_EQUAL); } -#line 6507 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy360, yymsp[-1].minor.yy360, OP_TYPE_EQUAL); } break; case 283: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ -#line 511 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy561), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561), OP_TYPE_EQUAL); } -#line 6512 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy929), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy929), OP_TYPE_EQUAL); } break; case 284: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -#line 512 "sql.y" -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy490, yymsp[0].minor.yy490, yymsp[-3].minor.yy502); } -#line 6517 "sql.c" +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy360, yymsp[0].minor.yy360, yymsp[-3].minor.yy536); } break; case 285: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ -#line 513 "sql.y" -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy561), yymsp[-4].minor.yy502); } -#line 6522 "sql.c" +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy929), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy929), yymsp[-4].minor.yy536); } break; case 286: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ -#line 514 "sql.y" { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } -#line 6527 "sql.c" break; case 287: /* cmd ::= SHOW VNODES */ -#line 515 "sql.y" { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } -#line 6532 "sql.c" break; case 288: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -#line 517 "sql.y" -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy490, QUERY_NODE_SHOW_DB_ALIVE_STMT); } -#line 6537 "sql.c" +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy360, QUERY_NODE_SHOW_DB_ALIVE_STMT); } break; case 289: /* cmd ::= SHOW CLUSTER ALIVE */ -#line 518 "sql.y" { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } -#line 6542 "sql.c" break; case 290: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ -#line 519 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy490, yymsp[0].minor.yy490, OP_TYPE_LIKE); } -#line 6547 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy360, yymsp[0].minor.yy360, OP_TYPE_LIKE); } break; case 291: /* cmd ::= SHOW CREATE VIEW full_table_name */ -#line 520 "sql.y" -{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy490); } -#line 6552 "sql.c" +{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy360); } break; case 292: /* cmd ::= SHOW COMPACTS */ -#line 521 "sql.y" { pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } -#line 6557 "sql.c" break; case 293: /* cmd ::= SHOW COMPACT NK_INTEGER */ -#line 522 "sql.y" { pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 6562 "sql.c" break; case 294: /* table_kind_db_name_cond_opt ::= */ -#line 526 "sql.y" -{ yymsp[1].minor.yy961.kind = SHOW_KIND_ALL; yymsp[1].minor.yy961.dbName = nil_token; } -#line 6567 "sql.c" +{ yymsp[1].minor.yy1005.kind = SHOW_KIND_ALL; yymsp[1].minor.yy1005.dbName = nil_token; } break; case 295: /* table_kind_db_name_cond_opt ::= table_kind */ -#line 527 "sql.y" -{ yylhsminor.yy961.kind = yymsp[0].minor.yy579; yylhsminor.yy961.dbName = nil_token; } -#line 6572 "sql.c" - yymsp[0].minor.yy961 = yylhsminor.yy961; +{ yylhsminor.yy1005.kind = yymsp[0].minor.yy321; yylhsminor.yy1005.dbName = nil_token; } + yymsp[0].minor.yy1005 = yylhsminor.yy1005; break; case 296: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ -#line 528 "sql.y" -{ yylhsminor.yy961.kind = SHOW_KIND_ALL; yylhsminor.yy961.dbName = yymsp[-1].minor.yy561; } -#line 6578 "sql.c" - yymsp[-1].minor.yy961 = yylhsminor.yy961; +{ yylhsminor.yy1005.kind = SHOW_KIND_ALL; yylhsminor.yy1005.dbName = yymsp[-1].minor.yy929; } + yymsp[-1].minor.yy1005 = yylhsminor.yy1005; break; case 297: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ -#line 529 "sql.y" -{ yylhsminor.yy961.kind = yymsp[-2].minor.yy579; yylhsminor.yy961.dbName = yymsp[-1].minor.yy561; } -#line 6584 "sql.c" - yymsp[-2].minor.yy961 = yylhsminor.yy961; +{ yylhsminor.yy1005.kind = yymsp[-2].minor.yy321; yylhsminor.yy1005.dbName = yymsp[-1].minor.yy929; } + yymsp[-2].minor.yy1005 = yylhsminor.yy1005; break; case 298: /* table_kind ::= NORMAL */ -#line 533 "sql.y" -{ yymsp[0].minor.yy579 = SHOW_KIND_TABLES_NORMAL; } -#line 6590 "sql.c" +{ yymsp[0].minor.yy321 = SHOW_KIND_TABLES_NORMAL; } break; case 299: /* table_kind ::= CHILD */ -#line 534 "sql.y" -{ yymsp[0].minor.yy579 = SHOW_KIND_TABLES_CHILD; } -#line 6595 "sql.c" +{ yymsp[0].minor.yy321 = SHOW_KIND_TABLES_CHILD; } break; case 300: /* db_name_cond_opt ::= */ case 305: /* from_db_opt ::= */ yytestcase(yyruleno==305); -#line 536 "sql.y" -{ yymsp[1].minor.yy490 = createDefaultDatabaseCondValue(pCxt); } -#line 6601 "sql.c" +{ yymsp[1].minor.yy360 = createDefaultDatabaseCondValue(pCxt); } break; case 301: /* db_name_cond_opt ::= db_name NK_DOT */ -#line 537 "sql.y" -{ yylhsminor.yy490 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy561); } -#line 6606 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy929); } + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 303: /* like_pattern_opt ::= LIKE NK_STRING */ -#line 540 "sql.y" -{ yymsp[-1].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } -#line 6612 "sql.c" +{ yymsp[-1].minor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; case 304: /* table_name_cond ::= table_name */ -#line 542 "sql.y" -{ yylhsminor.yy490 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561); } -#line 6617 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy929); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 306: /* from_db_opt ::= FROM db_name */ -#line 545 "sql.y" -{ yymsp[-1].minor.yy490 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561); } -#line 6623 "sql.c" +{ yymsp[-1].minor.yy360 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy929); } break; case 310: /* tag_item ::= TBNAME */ -#line 553 "sql.y" -{ yylhsminor.yy490 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } -#line 6628 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 313: /* tag_item ::= column_name column_alias */ -#line 556 "sql.y" -{ yylhsminor.yy490 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy561), &yymsp[0].minor.yy561); } -#line 6634 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy929), &yymsp[0].minor.yy929); } + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 314: /* tag_item ::= column_name AS column_alias */ -#line 557 "sql.y" -{ yylhsminor.yy490 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy561), &yymsp[0].minor.yy561); } -#line 6640 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy929), &yymsp[0].minor.yy929); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 315: /* db_kind_opt ::= */ -#line 561 "sql.y" -{ yymsp[1].minor.yy579 = SHOW_KIND_ALL; } -#line 6646 "sql.c" +{ yymsp[1].minor.yy321 = SHOW_KIND_ALL; } break; case 316: /* db_kind_opt ::= USER */ -#line 562 "sql.y" -{ yymsp[0].minor.yy579 = SHOW_KIND_DATABASES_USER; } -#line 6651 "sql.c" +{ yymsp[0].minor.yy321 = SHOW_KIND_DATABASES_USER; } break; case 317: /* db_kind_opt ::= SYSTEM */ -#line 563 "sql.y" -{ yymsp[0].minor.yy579 = SHOW_KIND_DATABASES_SYSTEM; } -#line 6656 "sql.c" +{ yymsp[0].minor.yy321 = SHOW_KIND_DATABASES_SYSTEM; } break; case 318: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ -#line 567 "sql.y" -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy845, yymsp[-3].minor.yy490, yymsp[-1].minor.yy490, NULL, yymsp[0].minor.yy490); } -#line 6661 "sql.c" +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy345, yymsp[-3].minor.yy360, yymsp[-1].minor.yy360, NULL, yymsp[0].minor.yy360); } break; case 319: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ -#line 569 "sql.y" -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy845, yymsp[-5].minor.yy490, yymsp[-3].minor.yy490, yymsp[-1].minor.yy502, NULL); } -#line 6666 "sql.c" +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy345, yymsp[-5].minor.yy360, yymsp[-3].minor.yy360, yymsp[-1].minor.yy536, NULL); } break; case 320: /* cmd ::= DROP INDEX exists_opt full_index_name */ -#line 570 "sql.y" -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy845, yymsp[0].minor.yy490); } -#line 6671 "sql.c" +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy345, yymsp[0].minor.yy360); } break; case 321: /* full_index_name ::= index_name */ -#line 572 "sql.y" -{ yylhsminor.yy490 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy561); } -#line 6676 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy929); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 322: /* full_index_name ::= db_name NK_DOT index_name */ -#line 573 "sql.y" -{ yylhsminor.yy490 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561); } -#line 6682 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy929, &yymsp[0].minor.yy929); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 323: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -#line 576 "sql.y" -{ yymsp[-9].minor.yy490 = createIndexOption(pCxt, yymsp[-7].minor.yy502, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), NULL, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); } -#line 6688 "sql.c" +{ yymsp[-9].minor.yy360 = createIndexOption(pCxt, yymsp[-7].minor.yy536, releaseRawExprNode(pCxt, yymsp[-3].minor.yy360), NULL, yymsp[-1].minor.yy360, yymsp[0].minor.yy360); } break; case 324: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ -#line 579 "sql.y" -{ yymsp[-11].minor.yy490 = createIndexOption(pCxt, yymsp[-9].minor.yy502, releaseRawExprNode(pCxt, yymsp[-5].minor.yy490), releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), yymsp[-1].minor.yy490, yymsp[0].minor.yy490); } -#line 6693 "sql.c" +{ yymsp[-11].minor.yy360 = createIndexOption(pCxt, yymsp[-9].minor.yy536, releaseRawExprNode(pCxt, yymsp[-5].minor.yy360), releaseRawExprNode(pCxt, yymsp[-3].minor.yy360), yymsp[-1].minor.yy360, yymsp[0].minor.yy360); } break; case 327: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -#line 586 "sql.y" -{ yylhsminor.yy490 = createFunctionNode(pCxt, &yymsp[-3].minor.yy561, yymsp[-1].minor.yy502); } -#line 6698 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createFunctionNode(pCxt, &yymsp[-3].minor.yy929, yymsp[-1].minor.yy536); } + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; case 328: /* sma_func_name ::= function_name */ case 553: /* alias_opt ::= table_alias */ yytestcase(yyruleno==553); -#line 590 "sql.y" -{ yylhsminor.yy561 = yymsp[0].minor.yy561; } -#line 6705 "sql.c" - yymsp[0].minor.yy561 = yylhsminor.yy561; +{ yylhsminor.yy929 = yymsp[0].minor.yy929; } + yymsp[0].minor.yy929 = yylhsminor.yy929; break; case 333: /* sma_stream_opt ::= */ case 378: /* stream_options ::= */ yytestcase(yyruleno==378); -#line 596 "sql.y" -{ yymsp[1].minor.yy490 = createStreamOptions(pCxt); } -#line 6712 "sql.c" +{ yymsp[1].minor.yy360 = createStreamOptions(pCxt); } break; case 334: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -#line 597 "sql.y" -{ ((SStreamOptions*)yymsp[-2].minor.yy490)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy490); yylhsminor.yy490 = yymsp[-2].minor.yy490; } -#line 6717 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ ((SStreamOptions*)yymsp[-2].minor.yy360)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy360); yylhsminor.yy360 = yymsp[-2].minor.yy360; } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 335: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -#line 598 "sql.y" -{ ((SStreamOptions*)yymsp[-2].minor.yy490)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy490); yylhsminor.yy490 = yymsp[-2].minor.yy490; } -#line 6723 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ ((SStreamOptions*)yymsp[-2].minor.yy360)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy360); yylhsminor.yy360 = yymsp[-2].minor.yy360; } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 336: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -#line 599 "sql.y" -{ ((SStreamOptions*)yymsp[-2].minor.yy490)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy490); yylhsminor.yy490 = yymsp[-2].minor.yy490; } -#line 6729 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ ((SStreamOptions*)yymsp[-2].minor.yy360)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy360); yylhsminor.yy360 = yymsp[-2].minor.yy360; } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 337: /* with_meta ::= AS */ -#line 604 "sql.y" -{ yymsp[0].minor.yy774 = 0; } -#line 6735 "sql.c" +{ yymsp[0].minor.yy580 = 0; } break; case 338: /* with_meta ::= WITH META AS */ -#line 605 "sql.y" -{ yymsp[-2].minor.yy774 = 1; } -#line 6740 "sql.c" +{ yymsp[-2].minor.yy580 = 1; } break; case 339: /* with_meta ::= ONLY META AS */ -#line 606 "sql.y" -{ yymsp[-2].minor.yy774 = 2; } -#line 6745 "sql.c" +{ yymsp[-2].minor.yy580 = 2; } break; case 340: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -#line 608 "sql.y" -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy845, &yymsp[-2].minor.yy561, yymsp[0].minor.yy490); } -#line 6750 "sql.c" +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy345, &yymsp[-2].minor.yy929, yymsp[0].minor.yy360); } break; case 341: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ -#line 610 "sql.y" -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy845, &yymsp[-3].minor.yy561, &yymsp[0].minor.yy561, yymsp[-2].minor.yy774); } -#line 6755 "sql.c" +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy345, &yymsp[-3].minor.yy929, &yymsp[0].minor.yy929, yymsp[-2].minor.yy580); } break; case 342: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ -#line 612 "sql.y" -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy845, &yymsp[-4].minor.yy561, yymsp[-1].minor.yy490, yymsp[-3].minor.yy774, yymsp[0].minor.yy490); } -#line 6760 "sql.c" +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy345, &yymsp[-4].minor.yy929, yymsp[-1].minor.yy360, yymsp[-3].minor.yy580, yymsp[0].minor.yy360); } break; case 343: /* cmd ::= DROP TOPIC exists_opt topic_name */ -#line 614 "sql.y" -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy845, &yymsp[0].minor.yy561); } -#line 6765 "sql.c" +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy345, &yymsp[0].minor.yy929); } break; case 344: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -#line 615 "sql.y" -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy845, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561); } -#line 6770 "sql.c" +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy345, &yymsp[-2].minor.yy929, &yymsp[0].minor.yy929); } break; case 345: /* cmd ::= DESC full_table_name */ case 346: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==346); -#line 618 "sql.y" -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy490); } -#line 6776 "sql.c" +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy360); } break; case 347: /* cmd ::= RESET QUERY CACHE */ -#line 622 "sql.y" { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } -#line 6781 "sql.c" break; case 348: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ case 349: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==349); -#line 625 "sql.y" -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy845, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); } -#line 6787 "sql.c" +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy345, yymsp[-1].minor.yy360, yymsp[0].minor.yy360); } break; case 352: /* explain_options ::= */ -#line 633 "sql.y" -{ yymsp[1].minor.yy490 = createDefaultExplainOptions(pCxt); } -#line 6792 "sql.c" +{ yymsp[1].minor.yy360 = createDefaultExplainOptions(pCxt); } break; case 353: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -#line 634 "sql.y" -{ yylhsminor.yy490 = setExplainVerbose(pCxt, yymsp[-2].minor.yy490, &yymsp[0].minor.yy0); } -#line 6797 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setExplainVerbose(pCxt, yymsp[-2].minor.yy360, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 354: /* explain_options ::= explain_options RATIO NK_FLOAT */ -#line 635 "sql.y" -{ yylhsminor.yy490 = setExplainRatio(pCxt, yymsp[-2].minor.yy490, &yymsp[0].minor.yy0); } -#line 6803 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setExplainRatio(pCxt, yymsp[-2].minor.yy360, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 355: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ -#line 640 "sql.y" -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy845, yymsp[-9].minor.yy845, &yymsp[-6].minor.yy561, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy826, yymsp[-1].minor.yy774, &yymsp[0].minor.yy561, yymsp[-10].minor.yy845); } -#line 6809 "sql.c" +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy345, yymsp[-9].minor.yy345, &yymsp[-6].minor.yy929, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy912, yymsp[-1].minor.yy580, &yymsp[0].minor.yy929, yymsp[-10].minor.yy345); } break; case 356: /* cmd ::= DROP FUNCTION exists_opt function_name */ -#line 641 "sql.y" -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy845, &yymsp[0].minor.yy561); } -#line 6814 "sql.c" +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy345, &yymsp[0].minor.yy929); } break; case 361: /* language_opt ::= */ case 400: /* on_vgroup_id ::= */ yytestcase(yyruleno==400); -#line 655 "sql.y" -{ yymsp[1].minor.yy561 = nil_token; } -#line 6820 "sql.c" +{ yymsp[1].minor.yy929 = nil_token; } break; case 362: /* language_opt ::= LANGUAGE NK_STRING */ case 401: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==401); -#line 656 "sql.y" -{ yymsp[-1].minor.yy561 = yymsp[0].minor.yy0; } -#line 6826 "sql.c" +{ yymsp[-1].minor.yy929 = yymsp[0].minor.yy0; } break; case 365: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ -#line 665 "sql.y" -{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy845, yymsp[-2].minor.yy490, &yymsp[-1].minor.yy0, yymsp[0].minor.yy490); } -#line 6831 "sql.c" +{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy345, yymsp[-2].minor.yy360, &yymsp[-1].minor.yy0, yymsp[0].minor.yy360); } break; case 366: /* cmd ::= DROP VIEW exists_opt full_view_name */ -#line 666 "sql.y" -{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy845, yymsp[0].minor.yy490); } -#line 6836 "sql.c" +{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy345, yymsp[0].minor.yy360); } break; case 367: /* full_view_name ::= view_name */ -#line 668 "sql.y" -{ yylhsminor.yy490 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy561); } -#line 6841 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy929); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 368: /* full_view_name ::= db_name NK_DOT view_name */ -#line 669 "sql.y" -{ yylhsminor.yy490 = createViewNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561); } -#line 6847 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createViewNode(pCxt, &yymsp[-2].minor.yy929, &yymsp[0].minor.yy929); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 369: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ -#line 674 "sql.y" -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy845, &yymsp[-8].minor.yy561, yymsp[-5].minor.yy490, yymsp[-7].minor.yy490, yymsp[-3].minor.yy502, yymsp[-2].minor.yy490, yymsp[0].minor.yy490, yymsp[-4].minor.yy502); } -#line 6853 "sql.c" +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy345, &yymsp[-8].minor.yy929, yymsp[-5].minor.yy360, yymsp[-7].minor.yy360, yymsp[-3].minor.yy536, yymsp[-2].minor.yy360, yymsp[0].minor.yy360, yymsp[-4].minor.yy536); } break; case 370: /* cmd ::= DROP STREAM exists_opt stream_name */ -#line 675 "sql.y" -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy845, &yymsp[0].minor.yy561); } -#line 6858 "sql.c" +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy345, &yymsp[0].minor.yy929); } break; case 371: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -#line 676 "sql.y" -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy845, &yymsp[0].minor.yy561); } -#line 6863 "sql.c" +{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy345, &yymsp[0].minor.yy929); } break; case 372: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -#line 677 "sql.y" -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy845, yymsp[-1].minor.yy845, &yymsp[0].minor.yy561); } -#line 6868 "sql.c" +{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy345, yymsp[-1].minor.yy345, &yymsp[0].minor.yy929); } break; case 379: /* stream_options ::= stream_options TRIGGER AT_ONCE */ case 380: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==380); -#line 691 "sql.y" -{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-2].minor.yy490, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } -#line 6874 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setStreamOptions(pCxt, yymsp[-2].minor.yy360, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 381: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -#line 693 "sql.y" -{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-3].minor.yy490, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); } -#line 6880 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setStreamOptions(pCxt, yymsp[-3].minor.yy360, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy360)); } + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; case 382: /* stream_options ::= stream_options WATERMARK duration_literal */ -#line 694 "sql.y" -{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-2].minor.yy490, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); } -#line 6886 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setStreamOptions(pCxt, yymsp[-2].minor.yy360, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy360)); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 383: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -#line 695 "sql.y" -{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-3].minor.yy490, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } -#line 6892 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setStreamOptions(pCxt, yymsp[-3].minor.yy360, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; case 384: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -#line 696 "sql.y" -{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-2].minor.yy490, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } -#line 6898 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setStreamOptions(pCxt, yymsp[-2].minor.yy360, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 385: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -#line 697 "sql.y" -{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-2].minor.yy490, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); } -#line 6904 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setStreamOptions(pCxt, yymsp[-2].minor.yy360, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy360)); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 386: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -#line 698 "sql.y" -{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-3].minor.yy490, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } -#line 6910 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setStreamOptions(pCxt, yymsp[-3].minor.yy360, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; case 388: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 591: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==591); - case 615: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==615); -#line 701 "sql.y" -{ yymsp[-3].minor.yy490 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy490); } -#line 6918 "sql.c" + case 593: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==593); + case 617: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==617); +{ yymsp[-3].minor.yy360 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy360); } break; case 391: /* cmd ::= KILL CONNECTION NK_INTEGER */ -#line 709 "sql.y" { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } -#line 6923 "sql.c" break; case 392: /* cmd ::= KILL QUERY NK_STRING */ -#line 710 "sql.y" { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } -#line 6928 "sql.c" break; case 393: /* cmd ::= KILL TRANSACTION NK_INTEGER */ -#line 711 "sql.y" { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } -#line 6933 "sql.c" break; case 394: /* cmd ::= KILL COMPACT NK_INTEGER */ -#line 712 "sql.y" { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); } -#line 6938 "sql.c" break; case 395: /* cmd ::= BALANCE VGROUP */ -#line 715 "sql.y" { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } -#line 6943 "sql.c" break; case 396: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -#line 716 "sql.y" -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy561); } -#line 6948 "sql.c" +{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy929); } break; case 397: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ -#line 717 "sql.y" { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 6953 "sql.c" break; case 398: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -#line 718 "sql.y" -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy502); } -#line 6958 "sql.c" +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy536); } break; case 399: /* cmd ::= SPLIT VGROUP NK_INTEGER */ -#line 719 "sql.y" { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } -#line 6963 "sql.c" break; case 402: /* dnode_list ::= DNODE NK_INTEGER */ -#line 728 "sql.y" -{ yymsp[-1].minor.yy502 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 6968 "sql.c" +{ yymsp[-1].minor.yy536 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; case 404: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -#line 735 "sql.y" -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); } -#line 6973 "sql.c" +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy360, yymsp[0].minor.yy360); } break; case 407: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -#line 744 "sql.y" -{ yymsp[-6].minor.yy490 = createInsertStmt(pCxt, yymsp[-4].minor.yy490, yymsp[-2].minor.yy502, yymsp[0].minor.yy490); } -#line 6978 "sql.c" +{ yymsp[-6].minor.yy360 = createInsertStmt(pCxt, yymsp[-4].minor.yy360, yymsp[-2].minor.yy536, yymsp[0].minor.yy360); } break; case 408: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -#line 745 "sql.y" -{ yymsp[-3].minor.yy490 = createInsertStmt(pCxt, yymsp[-1].minor.yy490, NULL, yymsp[0].minor.yy490); } -#line 6983 "sql.c" +{ yymsp[-3].minor.yy360 = createInsertStmt(pCxt, yymsp[-1].minor.yy360, NULL, yymsp[0].minor.yy360); } break; case 409: /* literal ::= NK_INTEGER */ -#line 748 "sql.y" -{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } -#line 6988 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 410: /* literal ::= NK_FLOAT */ -#line 749 "sql.y" -{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } -#line 6994 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 411: /* literal ::= NK_STRING */ -#line 750 "sql.y" -{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } -#line 7000 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 412: /* literal ::= NK_BOOL */ -#line 751 "sql.y" -{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } -#line 7006 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 413: /* literal ::= TIMESTAMP NK_STRING */ -#line 752 "sql.y" -{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } -#line 7012 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 414: /* literal ::= duration_literal */ case 424: /* signed_literal ::= signed */ yytestcase(yyruleno==424); @@ -7028,254 +6320,190 @@ static YYACTIONTYPE yy_reduce( case 546: /* table_reference ::= table_primary */ yytestcase(yyruleno==546); case 547: /* table_reference ::= joined_table */ yytestcase(yyruleno==547); case 551: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==551); - case 617: /* query_simple ::= query_specification */ yytestcase(yyruleno==617); - case 618: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==618); - case 621: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==621); - case 623: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==623); -#line 753 "sql.y" -{ yylhsminor.yy490 = yymsp[0].minor.yy490; } -#line 7037 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; + case 619: /* query_simple ::= query_specification */ yytestcase(yyruleno==619); + case 620: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==620); + case 623: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==623); + case 625: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==625); +{ yylhsminor.yy360 = yymsp[0].minor.yy360; } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 415: /* literal ::= NULL */ -#line 754 "sql.y" -{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } -#line 7043 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 416: /* literal ::= NK_QUESTION */ -#line 755 "sql.y" -{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 7049 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 417: /* duration_literal ::= NK_VARIABLE */ - case 592: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==592); - case 593: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==593); - case 594: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==594); -#line 757 "sql.y" -{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 7058 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; + case 594: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==594); + case 595: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==595); + case 596: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==596); +{ yylhsminor.yy360 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 418: /* signed ::= NK_INTEGER */ -#line 759 "sql.y" -{ yylhsminor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } -#line 7064 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 419: /* signed ::= NK_PLUS NK_INTEGER */ -#line 760 "sql.y" -{ yymsp[-1].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } -#line 7070 "sql.c" +{ yymsp[-1].minor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; case 420: /* signed ::= NK_MINUS NK_INTEGER */ -#line 761 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } -#line 7079 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 421: /* signed ::= NK_FLOAT */ -#line 766 "sql.y" -{ yylhsminor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } -#line 7085 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 422: /* signed ::= NK_PLUS NK_FLOAT */ -#line 767 "sql.y" -{ yymsp[-1].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } -#line 7091 "sql.c" +{ yymsp[-1].minor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; case 423: /* signed ::= NK_MINUS NK_FLOAT */ -#line 768 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } -#line 7100 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 425: /* signed_literal ::= NK_STRING */ -#line 775 "sql.y" -{ yylhsminor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } -#line 7106 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 426: /* signed_literal ::= NK_BOOL */ -#line 776 "sql.y" -{ yylhsminor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } -#line 7112 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 427: /* signed_literal ::= TIMESTAMP NK_STRING */ -#line 777 "sql.y" -{ yymsp[-1].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } -#line 7118 "sql.c" +{ yymsp[-1].minor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 428: /* signed_literal ::= duration_literal */ case 430: /* signed_literal ::= literal_func */ yytestcase(yyruleno==430); case 505: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==505); case 571: /* select_item ::= common_expression */ yytestcase(yyruleno==571); case 581: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==581); - case 622: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==622); - case 624: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==624); - case 637: /* search_condition ::= common_expression */ yytestcase(yyruleno==637); -#line 778 "sql.y" -{ yylhsminor.yy490 = releaseRawExprNode(pCxt, yymsp[0].minor.yy490); } -#line 7130 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; + case 624: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==624); + case 626: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==626); + case 639: /* search_condition ::= common_expression */ yytestcase(yyruleno==639); +{ yylhsminor.yy360 = releaseRawExprNode(pCxt, yymsp[0].minor.yy360); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 429: /* signed_literal ::= NULL */ -#line 779 "sql.y" -{ yylhsminor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } -#line 7136 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 431: /* signed_literal ::= NK_QUESTION */ -#line 781 "sql.y" -{ yylhsminor.yy490 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } -#line 7142 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 449: /* expression ::= pseudo_column */ -#line 843 "sql.y" -{ yylhsminor.yy490 = yymsp[0].minor.yy490; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy490, true); } -#line 7148 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = yymsp[0].minor.yy360; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy360, true); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 453: /* expression ::= NK_LP expression NK_RP */ case 539: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==539); - case 636: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==636); -#line 847 "sql.y" -{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy490)); } -#line 7156 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + case 638: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==638); +{ yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy360)); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 454: /* expression ::= NK_PLUS expr_or_subquery */ -#line 848 "sql.y" { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy360)); } -#line 7165 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 455: /* expression ::= NK_MINUS expr_or_subquery */ -#line 852 "sql.y" { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy490), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy360), NULL)); } -#line 7174 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 456: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ -#line 856 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy360); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } -#line 7184 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 457: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ -#line 861 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy360); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } -#line 7194 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 458: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ -#line 866 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy360); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } -#line 7204 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 459: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ -#line 871 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy360); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } -#line 7214 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 460: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ -#line 876 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy360); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } -#line 7224 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 461: /* expression ::= column_reference NK_ARROW NK_STRING */ -#line 881 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } -#line 7233 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 462: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ -#line 885 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy360); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } -#line 7243 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 463: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ -#line 890 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy360); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } -#line 7253 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 466: /* column_reference ::= column_name */ -#line 901 "sql.y" -{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy561, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy561)); } -#line 7259 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNode(pCxt, &yymsp[0].minor.yy929, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy929)); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 467: /* column_reference ::= table_name NK_DOT column_name */ -#line 902 "sql.y" -{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561, createColumnNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561)); } -#line 7265 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy929, &yymsp[0].minor.yy929, createColumnNode(pCxt, &yymsp[-2].minor.yy929, &yymsp[0].minor.yy929)); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 468: /* column_reference ::= NK_ALIAS */ -#line 903 "sql.y" -{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } -#line 7271 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 469: /* column_reference ::= table_name NK_DOT NK_ALIAS */ -#line 904 "sql.y" -{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0)); } -#line 7277 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy929, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy929, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 470: /* pseudo_column ::= ROWTS */ case 471: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==471); @@ -7289,508 +6517,348 @@ static YYACTIONTYPE yy_reduce( case 480: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==480); case 481: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==481); case 487: /* literal_func ::= NOW */ yytestcase(yyruleno==487); -#line 906 "sql.y" -{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } -#line 7294 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 472: /* pseudo_column ::= table_name NK_DOT TBNAME */ -#line 908 "sql.y" -{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy561)))); } -#line 7300 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy929, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy929)))); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 482: /* function_expression ::= function_name NK_LP expression_list NK_RP */ case 483: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==483); -#line 919 "sql.y" -{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy561, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy561, yymsp[-1].minor.yy502)); } -#line 7307 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy929, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy929, yymsp[-1].minor.yy536)); } + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; case 484: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -#line 922 "sql.y" -{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), yymsp[-1].minor.yy826)); } -#line 7313 "sql.c" - yymsp[-5].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy360), yymsp[-1].minor.yy912)); } + yymsp[-5].minor.yy360 = yylhsminor.yy360; break; case 486: /* literal_func ::= noarg_func NK_LP NK_RP */ -#line 925 "sql.y" -{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy561, NULL)); } -#line 7319 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy929, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy929, NULL)); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 501: /* star_func_para_list ::= NK_STAR */ -#line 949 "sql.y" -{ yylhsminor.yy502 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } -#line 7325 "sql.c" - yymsp[0].minor.yy502 = yylhsminor.yy502; +{ yylhsminor.yy536 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy536 = yylhsminor.yy536; break; case 506: /* star_func_para ::= table_name NK_DOT NK_STAR */ case 574: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==574); -#line 958 "sql.y" -{ yylhsminor.yy490 = createColumnNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0); } -#line 7332 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createColumnNode(pCxt, &yymsp[-2].minor.yy929, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 507: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -#line 961 "sql.y" -{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy502, yymsp[-1].minor.yy490)); } -#line 7338 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy536, yymsp[-1].minor.yy360)); } + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; case 508: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -#line 963 "sql.y" -{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), yymsp[-2].minor.yy502, yymsp[-1].minor.yy490)); } -#line 7344 "sql.c" - yymsp[-4].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy360), yymsp[-2].minor.yy536, yymsp[-1].minor.yy360)); } + yymsp[-4].minor.yy360 = yylhsminor.yy360; break; case 511: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -#line 970 "sql.y" -{ yymsp[-3].minor.yy490 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); } -#line 7350 "sql.c" +{ yymsp[-3].minor.yy360 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360)); } break; case 513: /* case_when_else_opt ::= ELSE common_expression */ -#line 973 "sql.y" -{ yymsp[-1].minor.yy490 = releaseRawExprNode(pCxt, yymsp[0].minor.yy490); } -#line 7355 "sql.c" +{ yymsp[-1].minor.yy360 = releaseRawExprNode(pCxt, yymsp[0].minor.yy360); } break; case 514: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ case 519: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==519); -#line 976 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy30, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy360); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy252, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } -#line 7365 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 515: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ -#line 983 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy490); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy490), releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy360); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy360), releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } -#line 7375 "sql.c" - yymsp[-4].minor.yy490 = yylhsminor.yy490; + yymsp[-4].minor.yy360 = yylhsminor.yy360; break; case 516: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ -#line 989 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy490); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy490), releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy360); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy360), releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } -#line 7385 "sql.c" - yymsp[-5].minor.yy490 = yylhsminor.yy490; + yymsp[-5].minor.yy360 = yylhsminor.yy360; break; case 517: /* predicate ::= expr_or_subquery IS NULL */ -#line 994 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), NULL)); } -#line 7394 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 518: /* predicate ::= expr_or_subquery IS NOT NULL */ -#line 998 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy360), NULL)); } -#line 7403 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; case 520: /* compare_op ::= NK_LT */ -#line 1010 "sql.y" -{ yymsp[0].minor.yy30 = OP_TYPE_LOWER_THAN; } -#line 7409 "sql.c" +{ yymsp[0].minor.yy252 = OP_TYPE_LOWER_THAN; } break; case 521: /* compare_op ::= NK_GT */ -#line 1011 "sql.y" -{ yymsp[0].minor.yy30 = OP_TYPE_GREATER_THAN; } -#line 7414 "sql.c" +{ yymsp[0].minor.yy252 = OP_TYPE_GREATER_THAN; } break; case 522: /* compare_op ::= NK_LE */ -#line 1012 "sql.y" -{ yymsp[0].minor.yy30 = OP_TYPE_LOWER_EQUAL; } -#line 7419 "sql.c" +{ yymsp[0].minor.yy252 = OP_TYPE_LOWER_EQUAL; } break; case 523: /* compare_op ::= NK_GE */ -#line 1013 "sql.y" -{ yymsp[0].minor.yy30 = OP_TYPE_GREATER_EQUAL; } -#line 7424 "sql.c" +{ yymsp[0].minor.yy252 = OP_TYPE_GREATER_EQUAL; } break; case 524: /* compare_op ::= NK_NE */ -#line 1014 "sql.y" -{ yymsp[0].minor.yy30 = OP_TYPE_NOT_EQUAL; } -#line 7429 "sql.c" +{ yymsp[0].minor.yy252 = OP_TYPE_NOT_EQUAL; } break; case 525: /* compare_op ::= NK_EQ */ -#line 1015 "sql.y" -{ yymsp[0].minor.yy30 = OP_TYPE_EQUAL; } -#line 7434 "sql.c" +{ yymsp[0].minor.yy252 = OP_TYPE_EQUAL; } break; case 526: /* compare_op ::= LIKE */ -#line 1016 "sql.y" -{ yymsp[0].minor.yy30 = OP_TYPE_LIKE; } -#line 7439 "sql.c" +{ yymsp[0].minor.yy252 = OP_TYPE_LIKE; } break; case 527: /* compare_op ::= NOT LIKE */ -#line 1017 "sql.y" -{ yymsp[-1].minor.yy30 = OP_TYPE_NOT_LIKE; } -#line 7444 "sql.c" +{ yymsp[-1].minor.yy252 = OP_TYPE_NOT_LIKE; } break; case 528: /* compare_op ::= MATCH */ -#line 1018 "sql.y" -{ yymsp[0].minor.yy30 = OP_TYPE_MATCH; } -#line 7449 "sql.c" +{ yymsp[0].minor.yy252 = OP_TYPE_MATCH; } break; case 529: /* compare_op ::= NMATCH */ -#line 1019 "sql.y" -{ yymsp[0].minor.yy30 = OP_TYPE_NMATCH; } -#line 7454 "sql.c" +{ yymsp[0].minor.yy252 = OP_TYPE_NMATCH; } break; case 530: /* compare_op ::= CONTAINS */ -#line 1020 "sql.y" -{ yymsp[0].minor.yy30 = OP_TYPE_JSON_CONTAINS; } -#line 7459 "sql.c" +{ yymsp[0].minor.yy252 = OP_TYPE_JSON_CONTAINS; } break; case 531: /* in_op ::= IN */ -#line 1024 "sql.y" -{ yymsp[0].minor.yy30 = OP_TYPE_IN; } -#line 7464 "sql.c" +{ yymsp[0].minor.yy252 = OP_TYPE_IN; } break; case 532: /* in_op ::= NOT IN */ -#line 1025 "sql.y" -{ yymsp[-1].minor.yy30 = OP_TYPE_NOT_IN; } -#line 7469 "sql.c" +{ yymsp[-1].minor.yy252 = OP_TYPE_NOT_IN; } break; case 533: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -#line 1027 "sql.y" -{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy502)); } -#line 7474 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy536)); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 535: /* boolean_value_expression ::= NOT boolean_primary */ -#line 1031 "sql.y" { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy490), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy360), NULL)); } -#line 7483 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 536: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ -#line 1036 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy360); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } -#line 7493 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 537: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ -#line 1042 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490); - yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy360); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy360); + yylhsminor.yy360 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } -#line 7503 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 545: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -#line 1060 "sql.y" -{ yylhsminor.yy490 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy490, yymsp[0].minor.yy490, NULL); } -#line 7509 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy360, yymsp[0].minor.yy360, NULL); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 548: /* table_primary ::= table_name alias_opt */ -#line 1066 "sql.y" -{ yylhsminor.yy490 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy561, &yymsp[0].minor.yy561); } -#line 7515 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy929, &yymsp[0].minor.yy929); } + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 549: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -#line 1067 "sql.y" -{ yylhsminor.yy490 = createRealTableNode(pCxt, &yymsp[-3].minor.yy561, &yymsp[-1].minor.yy561, &yymsp[0].minor.yy561); } -#line 7521 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createRealTableNode(pCxt, &yymsp[-3].minor.yy929, &yymsp[-1].minor.yy929, &yymsp[0].minor.yy929); } + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; case 550: /* table_primary ::= subquery alias_opt */ -#line 1068 "sql.y" -{ yylhsminor.yy490 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy490), &yymsp[0].minor.yy561); } -#line 7527 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy360), &yymsp[0].minor.yy929); } + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 552: /* alias_opt ::= */ -#line 1073 "sql.y" -{ yymsp[1].minor.yy561 = nil_token; } -#line 7533 "sql.c" +{ yymsp[1].minor.yy929 = nil_token; } break; case 554: /* alias_opt ::= AS table_alias */ -#line 1075 "sql.y" -{ yymsp[-1].minor.yy561 = yymsp[0].minor.yy561; } -#line 7538 "sql.c" +{ yymsp[-1].minor.yy929 = yymsp[0].minor.yy929; } break; case 555: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ case 556: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==556); -#line 1077 "sql.y" -{ yymsp[-2].minor.yy490 = yymsp[-1].minor.yy490; } -#line 7544 "sql.c" +{ yymsp[-2].minor.yy360 = yymsp[-1].minor.yy360; } break; case 557: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -#line 1082 "sql.y" -{ yylhsminor.yy490 = createJoinTableNode(pCxt, yymsp[-4].minor.yy246, yymsp[-5].minor.yy490, yymsp[-2].minor.yy490, yymsp[0].minor.yy490); } -#line 7549 "sql.c" - yymsp[-5].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createJoinTableNode(pCxt, yymsp[-4].minor.yy596, yymsp[-5].minor.yy360, yymsp[-2].minor.yy360, yymsp[0].minor.yy360); } + yymsp[-5].minor.yy360 = yylhsminor.yy360; break; case 558: /* join_type ::= */ -#line 1086 "sql.y" -{ yymsp[1].minor.yy246 = JOIN_TYPE_INNER; } -#line 7555 "sql.c" +{ yymsp[1].minor.yy596 = JOIN_TYPE_INNER; } break; case 559: /* join_type ::= INNER */ -#line 1087 "sql.y" -{ yymsp[0].minor.yy246 = JOIN_TYPE_INNER; } -#line 7560 "sql.c" +{ yymsp[0].minor.yy596 = JOIN_TYPE_INNER; } break; case 560: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_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 */ -#line 1093 "sql.y" { - yymsp[-13].minor.yy490 = createSelectStmt(pCxt, yymsp[-11].minor.yy845, yymsp[-9].minor.yy502, yymsp[-8].minor.yy490, yymsp[-12].minor.yy502); - yymsp[-13].minor.yy490 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy490, yymsp[-10].minor.yy845); - yymsp[-13].minor.yy490 = addWhereClause(pCxt, yymsp[-13].minor.yy490, yymsp[-7].minor.yy490); - yymsp[-13].minor.yy490 = addPartitionByClause(pCxt, yymsp[-13].minor.yy490, yymsp[-6].minor.yy502); - yymsp[-13].minor.yy490 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy490, yymsp[-2].minor.yy490); - yymsp[-13].minor.yy490 = addGroupByClause(pCxt, yymsp[-13].minor.yy490, yymsp[-1].minor.yy502); - yymsp[-13].minor.yy490 = addHavingClause(pCxt, yymsp[-13].minor.yy490, yymsp[0].minor.yy490); - yymsp[-13].minor.yy490 = addRangeClause(pCxt, yymsp[-13].minor.yy490, yymsp[-5].minor.yy490); - yymsp[-13].minor.yy490 = addEveryClause(pCxt, yymsp[-13].minor.yy490, yymsp[-4].minor.yy490); - yymsp[-13].minor.yy490 = addFillClause(pCxt, yymsp[-13].minor.yy490, yymsp[-3].minor.yy490); + yymsp[-13].minor.yy360 = createSelectStmt(pCxt, yymsp[-11].minor.yy345, yymsp[-9].minor.yy536, yymsp[-8].minor.yy360, yymsp[-12].minor.yy536); + yymsp[-13].minor.yy360 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy360, yymsp[-10].minor.yy345); + yymsp[-13].minor.yy360 = addWhereClause(pCxt, yymsp[-13].minor.yy360, yymsp[-7].minor.yy360); + yymsp[-13].minor.yy360 = addPartitionByClause(pCxt, yymsp[-13].minor.yy360, yymsp[-6].minor.yy536); + yymsp[-13].minor.yy360 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy360, yymsp[-2].minor.yy360); + yymsp[-13].minor.yy360 = addGroupByClause(pCxt, yymsp[-13].minor.yy360, yymsp[-1].minor.yy536); + yymsp[-13].minor.yy360 = addHavingClause(pCxt, yymsp[-13].minor.yy360, yymsp[0].minor.yy360); + yymsp[-13].minor.yy360 = addRangeClause(pCxt, yymsp[-13].minor.yy360, yymsp[-5].minor.yy360); + yymsp[-13].minor.yy360 = addEveryClause(pCxt, yymsp[-13].minor.yy360, yymsp[-4].minor.yy360); + yymsp[-13].minor.yy360 = addFillClause(pCxt, yymsp[-13].minor.yy360, yymsp[-3].minor.yy360); } -#line 7576 "sql.c" break; case 561: /* hint_list ::= */ -#line 1108 "sql.y" -{ yymsp[1].minor.yy502 = createHintNodeList(pCxt, NULL); } -#line 7581 "sql.c" +{ yymsp[1].minor.yy536 = createHintNodeList(pCxt, NULL); } break; case 562: /* hint_list ::= NK_HINT */ -#line 1109 "sql.y" -{ yylhsminor.yy502 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } -#line 7586 "sql.c" - yymsp[0].minor.yy502 = yylhsminor.yy502; +{ yylhsminor.yy536 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy536 = yylhsminor.yy536; break; case 567: /* set_quantifier_opt ::= ALL */ -#line 1120 "sql.y" -{ yymsp[0].minor.yy845 = false; } -#line 7592 "sql.c" +{ yymsp[0].minor.yy345 = false; } break; case 570: /* select_item ::= NK_STAR */ -#line 1127 "sql.y" -{ yylhsminor.yy490 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } -#line 7597 "sql.c" - yymsp[0].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy360 = yylhsminor.yy360; break; case 572: /* select_item ::= common_expression column_alias */ case 582: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==582); -#line 1129 "sql.y" -{ yylhsminor.yy490 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy490), &yymsp[0].minor.yy561); } -#line 7604 "sql.c" - yymsp[-1].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy360), &yymsp[0].minor.yy929); } + yymsp[-1].minor.yy360 = yylhsminor.yy360; break; case 573: /* select_item ::= common_expression AS column_alias */ case 583: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==583); -#line 1130 "sql.y" -{ yylhsminor.yy490 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), &yymsp[0].minor.yy561); } -#line 7611 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; +{ yylhsminor.yy360 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), &yymsp[0].minor.yy929); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; case 578: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 606: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==606); - case 626: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==626); -#line 1139 "sql.y" -{ yymsp[-2].minor.yy502 = yymsp[0].minor.yy502; } -#line 7619 "sql.c" + case 608: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==608); + case 628: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==628); +{ yymsp[-2].minor.yy536 = yymsp[0].minor.yy536; } break; case 585: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ -#line 1152 "sql.y" -{ yymsp[-5].minor.yy490 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), releaseRawExprNode(pCxt, yymsp[-1].minor.yy490)); } -#line 7624 "sql.c" +{ yymsp[-5].minor.yy360 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy360), releaseRawExprNode(pCxt, yymsp[-1].minor.yy360)); } break; case 586: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -#line 1153 "sql.y" -{ yymsp[-3].minor.yy490 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy490)); } -#line 7629 "sql.c" +{ yymsp[-3].minor.yy360 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy360)); } break; case 587: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -#line 1155 "sql.y" -{ yymsp[-5].minor.yy490 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), NULL, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); } -#line 7634 "sql.c" +{ yymsp[-5].minor.yy360 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy360), NULL, yymsp[-1].minor.yy360, yymsp[0].minor.yy360); } break; case 588: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -#line 1159 "sql.y" -{ yymsp[-7].minor.yy490 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy490), releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), yymsp[-1].minor.yy490, yymsp[0].minor.yy490); } -#line 7639 "sql.c" +{ yymsp[-7].minor.yy360 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy360), releaseRawExprNode(pCxt, yymsp[-3].minor.yy360), yymsp[-1].minor.yy360, yymsp[0].minor.yy360); } break; case 589: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -#line 1161 "sql.y" -{ yymsp[-6].minor.yy490 = createEventWindowNode(pCxt, yymsp[-3].minor.yy490, yymsp[0].minor.yy490); } -#line 7644 "sql.c" +{ yymsp[-6].minor.yy360 = createEventWindowNode(pCxt, yymsp[-3].minor.yy360, yymsp[0].minor.yy360); } break; - case 596: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -#line 1171 "sql.y" -{ yymsp[-3].minor.yy490 = createFillNode(pCxt, yymsp[-1].minor.yy718, NULL); } -#line 7649 "sql.c" + case 590: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy360 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 597: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -#line 1172 "sql.y" -{ yymsp[-5].minor.yy490 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy502)); } -#line 7654 "sql.c" + case 591: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy360 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 598: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -#line 1173 "sql.y" -{ yymsp[-5].minor.yy490 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy502)); } -#line 7659 "sql.c" + case 598: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy360 = createFillNode(pCxt, yymsp[-1].minor.yy358, NULL); } break; - case 599: /* fill_mode ::= NONE */ -#line 1177 "sql.y" -{ yymsp[0].minor.yy718 = FILL_MODE_NONE; } -#line 7664 "sql.c" + case 599: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy360 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy536)); } break; - case 600: /* fill_mode ::= PREV */ -#line 1178 "sql.y" -{ yymsp[0].minor.yy718 = FILL_MODE_PREV; } -#line 7669 "sql.c" + case 600: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy360 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy536)); } break; - case 601: /* fill_mode ::= NULL */ -#line 1179 "sql.y" -{ yymsp[0].minor.yy718 = FILL_MODE_NULL; } -#line 7674 "sql.c" + case 601: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy358 = FILL_MODE_NONE; } break; - case 602: /* fill_mode ::= NULL_F */ -#line 1180 "sql.y" -{ yymsp[0].minor.yy718 = FILL_MODE_NULL_F; } -#line 7679 "sql.c" + case 602: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy358 = FILL_MODE_PREV; } break; - case 603: /* fill_mode ::= LINEAR */ -#line 1181 "sql.y" -{ yymsp[0].minor.yy718 = FILL_MODE_LINEAR; } -#line 7684 "sql.c" + case 603: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy358 = FILL_MODE_NULL; } break; - case 604: /* fill_mode ::= NEXT */ -#line 1182 "sql.y" -{ yymsp[0].minor.yy718 = FILL_MODE_NEXT; } -#line 7689 "sql.c" + case 604: /* fill_mode ::= NULL_F */ +{ yymsp[0].minor.yy358 = FILL_MODE_NULL_F; } break; - case 607: /* group_by_list ::= expr_or_subquery */ -#line 1191 "sql.y" -{ yylhsminor.yy502 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); } -#line 7694 "sql.c" - yymsp[0].minor.yy502 = yylhsminor.yy502; + case 605: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy358 = FILL_MODE_LINEAR; } break; - case 608: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -#line 1192 "sql.y" -{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-2].minor.yy502, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); } -#line 7700 "sql.c" - yymsp[-2].minor.yy502 = yylhsminor.yy502; + case 606: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy358 = FILL_MODE_NEXT; } break; - case 612: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -#line 1199 "sql.y" -{ yymsp[-5].minor.yy490 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), releaseRawExprNode(pCxt, yymsp[-1].minor.yy490)); } -#line 7706 "sql.c" + case 609: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy536 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } + yymsp[0].minor.yy536 = yylhsminor.yy536; break; - case 613: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -#line 1201 "sql.y" -{ yymsp[-3].minor.yy490 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy490)); } -#line 7711 "sql.c" + case 610: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy536 = addNodeToList(pCxt, yymsp[-2].minor.yy536, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy360))); } + yymsp[-2].minor.yy536 = yylhsminor.yy536; break; - case 616: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ -#line 1208 "sql.y" + case 614: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy360 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy360), releaseRawExprNode(pCxt, yymsp[-1].minor.yy360)); } + break; + case 615: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy360 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy360)); } + break; + case 618: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy490 = addOrderByClause(pCxt, yymsp[-3].minor.yy490, yymsp[-2].minor.yy502); - yylhsminor.yy490 = addSlimitClause(pCxt, yylhsminor.yy490, yymsp[-1].minor.yy490); - yylhsminor.yy490 = addLimitClause(pCxt, yylhsminor.yy490, yymsp[0].minor.yy490); + yylhsminor.yy360 = addOrderByClause(pCxt, yymsp[-3].minor.yy360, yymsp[-2].minor.yy536); + yylhsminor.yy360 = addSlimitClause(pCxt, yylhsminor.yy360, yymsp[-1].minor.yy360); + yylhsminor.yy360 = addLimitClause(pCxt, yylhsminor.yy360, yymsp[0].minor.yy360); } -#line 7720 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; - case 619: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -#line 1218 "sql.y" -{ yylhsminor.yy490 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy490, yymsp[0].minor.yy490); } -#line 7726 "sql.c" - yymsp[-3].minor.yy490 = yylhsminor.yy490; + case 621: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy360 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy360, yymsp[0].minor.yy360); } + yymsp[-3].minor.yy360 = yylhsminor.yy360; break; - case 620: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -#line 1220 "sql.y" -{ yylhsminor.yy490 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy490, yymsp[0].minor.yy490); } -#line 7732 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + case 622: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy360 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy360, yymsp[0].minor.yy360); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; - case 628: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 632: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==632); -#line 1234 "sql.y" -{ yymsp[-1].minor.yy490 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 7739 "sql.c" + case 630: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 634: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==634); +{ yymsp[-1].minor.yy360 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 629: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 633: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==633); -#line 1235 "sql.y" -{ yymsp[-3].minor.yy490 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } -#line 7745 "sql.c" + case 631: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 635: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==635); +{ yymsp[-3].minor.yy360 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 630: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 634: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==634); -#line 1236 "sql.y" -{ yymsp[-3].minor.yy490 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } -#line 7751 "sql.c" + case 632: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 636: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==636); +{ yymsp[-3].minor.yy360 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 635: /* subquery ::= NK_LP query_expression NK_RP */ -#line 1244 "sql.y" -{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy490); } -#line 7756 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + case 637: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy360 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy360); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; - case 640: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -#line 1258 "sql.y" -{ yylhsminor.yy490 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), yymsp[-1].minor.yy876, yymsp[0].minor.yy361); } -#line 7762 "sql.c" - yymsp[-2].minor.yy490 = yylhsminor.yy490; + case 642: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy360 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy360), yymsp[-1].minor.yy642, yymsp[0].minor.yy585); } + yymsp[-2].minor.yy360 = yylhsminor.yy360; break; - case 641: /* ordering_specification_opt ::= */ -#line 1262 "sql.y" -{ yymsp[1].minor.yy876 = ORDER_ASC; } -#line 7768 "sql.c" + case 643: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy642 = ORDER_ASC; } break; - case 642: /* ordering_specification_opt ::= ASC */ -#line 1263 "sql.y" -{ yymsp[0].minor.yy876 = ORDER_ASC; } -#line 7773 "sql.c" + case 644: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy642 = ORDER_ASC; } break; - case 643: /* ordering_specification_opt ::= DESC */ -#line 1264 "sql.y" -{ yymsp[0].minor.yy876 = ORDER_DESC; } -#line 7778 "sql.c" + case 645: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy642 = ORDER_DESC; } break; - case 644: /* null_ordering_opt ::= */ -#line 1268 "sql.y" -{ yymsp[1].minor.yy361 = NULL_ORDER_DEFAULT; } -#line 7783 "sql.c" + case 646: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy585 = NULL_ORDER_DEFAULT; } break; - case 645: /* null_ordering_opt ::= NULLS FIRST */ -#line 1269 "sql.y" -{ yymsp[-1].minor.yy361 = NULL_ORDER_FIRST; } -#line 7788 "sql.c" + case 647: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy585 = NULL_ORDER_FIRST; } break; - case 646: /* null_ordering_opt ::= NULLS LAST */ -#line 1270 "sql.y" -{ yymsp[-1].minor.yy361 = NULL_ORDER_LAST; } -#line 7793 "sql.c" + case 648: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy585 = NULL_ORDER_LAST; } break; default: break; @@ -7852,7 +6920,6 @@ static void yy_syntax_error( ParseCTX_FETCH #define TOKEN yyminor /************ Begin %syntax_error code ****************************************/ -#line 29 "sql.y" if (TSDB_CODE_SUCCESS == pCxt->errCode) { if(TOKEN.z) { @@ -7863,7 +6930,6 @@ static void yy_syntax_error( } else if (TSDB_CODE_PAR_DB_NOT_SPECIFIED == pCxt->errCode && TK_NK_FLOAT == TOKEN.type) { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); } -#line 7866 "sql.c" /************ End %syntax_error code ******************************************/ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ ParseCTX_STORE diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index 12b7360165..0657335e36 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -1008,6 +1008,29 @@ static int32_t createWindowLogicNodeByEvent(SLogicPlanContext* pCxt, SEventWindo return createWindowLogicNodeFinalize(pCxt, pSelect, pWindow, pLogicNode); } +static int32_t createWindowLogicNodeByCount(SLogicPlanContext* pCxt, SCountWindowNode* pCount, SSelectStmt* pSelect, + SLogicNode** pLogicNode) { + SWindowLogicNode* pWindow = (SWindowLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW); + if (NULL == pWindow) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + pWindow->winType = WINDOW_TYPE_COUNT; + pWindow->node.groupAction = getGroupAction(pCxt, pSelect); + pWindow->node.requireDataOrder = + pCxt->pPlanCxt->streamQuery ? DATA_ORDER_LEVEL_IN_BLOCK : getRequireDataOrder(true, pSelect); + pWindow->node.resultDataOrder = + pCxt->pPlanCxt->streamQuery ? DATA_ORDER_LEVEL_GLOBAL : pWindow->node.requireDataOrder; + pWindow->windowCount = pCount->windowCount; + pWindow->windowSliding = pCount->windowSliding; + pWindow->pTspk = nodesCloneNode(pCount->pCol); + if (NULL == pWindow->pTspk) { + nodesDestroyNode((SNode*)pWindow); + return TSDB_CODE_OUT_OF_MEMORY; + } + return createWindowLogicNodeFinalize(pCxt, pSelect, pWindow, pLogicNode); +} + static int32_t createWindowLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SLogicNode** pLogicNode) { if (NULL == pSelect->pWindow) { return TSDB_CODE_SUCCESS; @@ -1021,6 +1044,8 @@ static int32_t createWindowLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSele return createWindowLogicNodeByInterval(pCxt, (SIntervalWindowNode*)pSelect->pWindow, pSelect, pLogicNode); case QUERY_NODE_EVENT_WINDOW: return createWindowLogicNodeByEvent(pCxt, (SEventWindowNode*)pSelect->pWindow, pSelect, pLogicNode); + case QUERY_NODE_COUNT_WINDOW: + return createWindowLogicNodeByCount(pCxt, (SCountWindowNode*)pSelect->pWindow, pSelect, pLogicNode); default: break; } diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index dde3b23b29..8f92da85ba 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -1751,6 +1751,27 @@ static int32_t createEventWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pC return code; } +static int32_t createCountWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, + SWindowLogicNode* pWindowLogicNode, SPhysiNode** pPhyNode) { + SCountWinodwPhysiNode* pCount = (SCountWinodwPhysiNode*)makePhysiNode( + pCxt, (SLogicNode*)pWindowLogicNode, + (pCxt->pPlanCxt->streamQuery ? QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT : QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT)); + if (NULL == pCount) { + return TSDB_CODE_OUT_OF_MEMORY; + } + pCount->windowCount = pWindowLogicNode->windowCount; + pCount->windowSliding = pWindowLogicNode->windowSliding; + + int32_t code = createWindowPhysiNodeFinalize(pCxt, pChildren, &pCount->window, pWindowLogicNode); + if (TSDB_CODE_SUCCESS == code) { + *pPhyNode = (SPhysiNode*)pCount; + } else { + nodesDestroyNode((SNode*)pCount); + } + + return code; +} + static int32_t createWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, SWindowLogicNode* pWindowLogicNode, SPhysiNode** pPhyNode) { switch (pWindowLogicNode->winType) { @@ -1762,6 +1783,8 @@ static int32_t createWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildr return createStateWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); case WINDOW_TYPE_EVENT: return createEventWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); + case WINDOW_TYPE_COUNT: + return createCountWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); default: break; } diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index 4099f2be42..d9a7475f59 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -872,6 +872,18 @@ static int32_t stbSplSplitEvent(SSplitContext* pCxt, SStableSplitInfo* pInfo) { } } +static int32_t stbSplSplitCountForStream(SSplitContext* pCxt, SStableSplitInfo* pInfo) { + return TSDB_CODE_PLAN_INTERNAL_ERROR; +} + +static int32_t stbSplSplitCount(SSplitContext* pCxt, SStableSplitInfo* pInfo) { + if (pCxt->pPlanCxt->streamQuery) { + return stbSplSplitCountForStream(pCxt, pInfo); + } else { + return stbSplSplitSessionOrStateForBatch(pCxt, pInfo); + } +} + static int32_t stbSplSplitWindowForCrossTable(SSplitContext* pCxt, SStableSplitInfo* pInfo) { switch (((SWindowLogicNode*)pInfo->pSplitNode)->winType) { case WINDOW_TYPE_INTERVAL: @@ -882,6 +894,8 @@ static int32_t stbSplSplitWindowForCrossTable(SSplitContext* pCxt, SStableSplitI return stbSplSplitState(pCxt, pInfo); case WINDOW_TYPE_EVENT: return stbSplSplitEvent(pCxt, pInfo); + case WINDOW_TYPE_COUNT: + return stbSplSplitCount(pCxt, pInfo); default: break; } diff --git a/source/libs/planner/src/planUtil.c b/source/libs/planner/src/planUtil.c index aeef3f2487..74b325a298 100644 --- a/source/libs/planner/src/planUtil.c +++ b/source/libs/planner/src/planUtil.c @@ -237,6 +237,15 @@ static int32_t adjustEventDataRequirement(SWindowLogicNode* pWindow, EDataOrderL return TSDB_CODE_SUCCESS; } +static int32_t adjustCountDataRequirement(SWindowLogicNode* pWindow, EDataOrderLevel requirement) { + if (requirement <= pWindow->node.resultDataOrder) { + return TSDB_CODE_SUCCESS; + } + pWindow->node.resultDataOrder = requirement; + pWindow->node.requireDataOrder = requirement; + return TSDB_CODE_SUCCESS; +} + static int32_t adjustWindowDataRequirement(SWindowLogicNode* pWindow, EDataOrderLevel requirement) { switch (pWindow->winType) { case WINDOW_TYPE_INTERVAL: @@ -247,6 +256,8 @@ static int32_t adjustWindowDataRequirement(SWindowLogicNode* pWindow, EDataOrder return adjustStateDataRequirement(pWindow, requirement); case WINDOW_TYPE_EVENT: return adjustEventDataRequirement(pWindow, requirement); + case WINDOW_TYPE_COUNT: + return adjustCountDataRequirement(pWindow, requirement); default: break; } diff --git a/source/libs/stream/inc/streamBackendRocksdb.h b/source/libs/stream/inc/streamBackendRocksdb.h index b89664a6c1..03f70604b7 100644 --- a/source/libs/stream/inc/streamBackendRocksdb.h +++ b/source/libs/stream/inc/streamBackendRocksdb.h @@ -179,7 +179,8 @@ int32_t streamStateSessionDel_rocksdb(SStreamState* pState, const SSessionKey* k SStreamStateCur* streamStateSessionSeekKeyCurrentPrev_rocksdb(SStreamState* pState, const SSessionKey* key); SStreamStateCur* streamStateSessionSeekKeyCurrentNext_rocksdb(SStreamState* pState, SSessionKey* key); SStreamStateCur* streamStateSessionSeekKeyNext_rocksdb(SStreamState* pState, const SSessionKey* key); -SStreamStateCur* streamStateSessionSeekToLast_rocksdb(SStreamState* pState); +SStreamStateCur* streamStateSessionSeekKeyPrev_rocksdb(SStreamState* pState, const SSessionKey* key); +SStreamStateCur* streamStateSessionSeekToLast_rocksdb(SStreamState* pState, int64_t groupId); int32_t streamStateSessionCurPrev_rocksdb(SStreamStateCur* pCur); int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen); diff --git a/source/libs/stream/src/streamBackendRocksdb.c b/source/libs/stream/src/streamBackendRocksdb.c index acec9b7da9..f173157da6 100644 --- a/source/libs/stream/src/streamBackendRocksdb.c +++ b/source/libs/stream/src/streamBackendRocksdb.c @@ -2883,13 +2883,13 @@ int32_t streamStateSessionDel_rocksdb(SStreamState* pState, const SSessionKey* k return code; } -SStreamStateCur* streamStateSessionSeekToLast_rocksdb(SStreamState* pState) { +SStreamStateCur* streamStateSessionSeekToLast_rocksdb(SStreamState* pState, int64_t groupId) { stDebug("streamStateSessionSeekToLast_rocksdb"); int32_t code = 0; - SSessionKey maxSessionKey = {.groupId = UINT64_MAX, .win = {.skey = INT64_MAX, .ekey = INT64_MAX}}; - SStateSessionKey maxKey = {.key = maxSessionKey, .opNum = INT64_MAX}; + SSessionKey maxSessionKey = {.groupId = groupId, .win = {.skey = INT64_MAX, .ekey = INT64_MAX}}; + SStateSessionKey maxKey = {.key = maxSessionKey, .opNum = pState->number}; STREAM_STATE_PUT_ROCKSDB(pState, "sess", &maxKey, "", 0); if (code != 0) { @@ -3048,6 +3048,46 @@ SStreamStateCur* streamStateSessionSeekKeyNext_rocksdb(SStreamState* pState, con return pCur; } +SStreamStateCur* streamStateSessionSeekKeyPrev_rocksdb(SStreamState* pState, const SSessionKey* key) { + stDebug("streamStateSessionSeekKeyPrev_rocksdb"); + STaskDbWrapper* wrapper = pState->pTdbState->pOwner->pBackend; + SStreamStateCur* pCur = createStreamStateCursor(); + if (pCur == NULL) { + return NULL; + } + pCur->db = wrapper->db; + pCur->iter = streamStateIterCreate(pState, "sess", (rocksdb_snapshot_t**)&pCur->snapshot, + (rocksdb_readoptions_t**)&pCur->readOpt); + pCur->number = pState->number; + + SStateSessionKey sKey = {.key = *key, .opNum = pState->number}; + + char buf[128] = {0}; + int len = stateSessionKeyEncode(&sKey, buf); + if (!streamStateIterSeekAndValid(pCur->iter, buf, len)) { + streamStateFreeCur(pCur); + return NULL; + } + while (rocksdb_iter_valid(pCur->iter) && iterValueIsStale(pCur->iter)) rocksdb_iter_prev(pCur->iter); + if (!rocksdb_iter_valid(pCur->iter)) { + streamStateFreeCur(pCur); + return NULL; + } + + size_t klen; + const char* iKey = rocksdb_iter_key(pCur->iter, &klen); + SStateSessionKey curKey = {0}; + stateSessionKeyDecode(&curKey, (char*)iKey); + if (stateSessionKeyCmpr(&sKey, sizeof(sKey), &curKey, sizeof(curKey)) > 0) return pCur; + + rocksdb_iter_prev(pCur->iter); + if (!rocksdb_iter_valid(pCur->iter)) { + streamStateFreeCur(pCur); + return NULL; + } + return pCur; +} + int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen) { stDebug("streamStateSessionGetKVByCur_rocksdb"); if (!pCur) { diff --git a/source/libs/stream/src/streamCheckpoint.c b/source/libs/stream/src/streamCheckpoint.c index b1783fb640..4614cb0cee 100644 --- a/source/libs/stream/src/streamCheckpoint.c +++ b/source/libs/stream/src/streamCheckpoint.c @@ -512,7 +512,7 @@ int32_t streamTaskBuildCheckpoint(SStreamTask* pTask) { SStreamTaskId hTaskId = {.streamId = pTask->hTaskInfo.id.streamId, .taskId = pTask->hTaskInfo.id.taskId}; stDebug("s-task:%s fill-history finish checkpoint done, drop related fill-history task:0x%x", id, hTaskId.taskId); - streamBuildAndSendDropTaskMsg(pTask->pMsgCb, pTask->pMeta->vgId, &hTaskId); + streamBuildAndSendDropTaskMsg(pTask->pMsgCb, pTask->pMeta->vgId, &hTaskId, 1); } else { stWarn("s-task:%s related fill-history task:0x%x is erased", id, (int32_t)pTask->hTaskInfo.id.taskId); } diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c index 840a7678f2..bac6022834 100644 --- a/source/libs/stream/src/streamExec.c +++ b/source/libs/stream/src/streamExec.c @@ -328,7 +328,7 @@ int32_t streamDoTransferStateToStreamTask(SStreamTask* pTask) { id, (int32_t) pTask->streamTaskId.taskId); // 1. free it and remove fill-history task from disk meta-store - streamBuildAndSendDropTaskMsg(pTask->pMsgCb, pMeta->vgId, &pTask->id); + streamBuildAndSendDropTaskMsg(pTask->pMsgCb, pMeta->vgId, &pTask->id, 0); // 2. save to disk streamMetaWLock(pMeta); diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index db74ce9897..ab519e2b4b 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -725,9 +725,6 @@ int32_t streamMetaUnregisterTask(SStreamMeta* pMeta, int64_t streamId, int32_t t // it is an fill-history task, remove the related stream task's id that points to it atomic_sub_fetch_32(&pMeta->numOfStreamTasks, 1); - if (pTask->info.fillHistory == 1) { - streamTaskClearHTaskAttr(pTask, false); - } taosHashRemove(pMeta->pTasksMap, &id, sizeof(id)); doRemoveIdFromList(pMeta, (int32_t)taosArrayGetSize(pMeta->pTaskList), &pTask->id); diff --git a/source/libs/stream/src/streamSessionState.c b/source/libs/stream/src/streamSessionState.c index 1f991d309f..bd28d2bca9 100644 --- a/source/libs/stream/src/streamSessionState.c +++ b/source/libs/stream/src/streamSessionState.c @@ -28,6 +28,12 @@ int sessionStateKeyCompare(const SSessionKey* pWin1, const void* pDatas, int pos return sessionWinKeyCmpr(pWin1, pWin2); } +int sessionStateRangeKeyCompare(const SSessionKey* pWin1, const void* pDatas, int pos) { + SRowBuffPos* pPos2 = taosArrayGetP(pDatas, pos); + SSessionKey* pWin2 = (SSessionKey*)pPos2->pKey; + return sessionRangeKeyCmpr(pWin1, pWin2); +} + int32_t binarySearch(void* keyList, int num, const void* key, __session_compare_fn_t cmpFn) { int firstPos = 0, lastPos = num - 1, midPos = -1; int numOfRows = 0; @@ -69,6 +75,12 @@ bool inSessionWindow(SSessionKey* pKey, TSKEY ts, int64_t gap) { return false; } +SStreamStateCur* createSessionStateCursor(SStreamFileState* pFileState) { + SStreamStateCur* pCur = createStreamStateCursor(); + pCur->pStreamFileState = pFileState; + return pCur; +} + static SRowBuffPos* addNewSessionWindow(SStreamFileState* pFileState, SArray* pWinInfos, const SSessionKey* pKey) { SRowBuffPos* pNewPos = getNewRowPosForWrite(pFileState); ASSERT(pNewPos->pRowBuff); @@ -91,7 +103,12 @@ SRowBuffPos* createSessionWinBuff(SStreamFileState* pFileState, SSessionKey* pKe memcpy(pNewPos->pKey, pKey, sizeof(SSessionKey)); pNewPos->needFree = true; pNewPos->beFlushed = true; - memcpy(pNewPos->pRowBuff, p, *pVLen); + if(p) { + memcpy(pNewPos->pRowBuff, p, *pVLen); + } else { + int32_t len = getRowStateRowSize(pFileState); + memset(pNewPos->pRowBuff, 0, len); + } taosMemoryFree(p); return pNewPos; } @@ -364,9 +381,8 @@ static SStreamStateCur* seekKeyCurrentPrev_buff(SStreamFileState* pFileState, co } if (index >= 0) { - pCur = createStreamStateCursor(); + pCur = createSessionStateCursor(pFileState); pCur->buffIndex = index; - pCur->pStreamFileState = pFileState; if (pIndex) { *pIndex = index; } @@ -405,7 +421,7 @@ static void checkAndTransformCursor(SStreamFileState* pFileState, const uint64_t if (taosArrayGetSize(pWinStates) > 0 && (code == TSDB_CODE_FAILED || sessionStateKeyCompare(&key, pWinStates, 0) >= 0)) { if (!(*ppCur)) { - (*ppCur) = createStreamStateCursor(); + (*ppCur) = createSessionStateCursor(pFileState); } transformCursor(pFileState, *ppCur); } else if (*ppCur) { @@ -419,7 +435,7 @@ SStreamStateCur* sessionWinStateSeekKeyCurrentNext(SStreamFileState* pFileState, int32_t index = -1; SStreamStateCur* pCur = seekKeyCurrentPrev_buff(pFileState, pWinKey, &pWinStates, &index); if (pCur) { - if (sessionStateKeyCompare(pWinKey, pWinStates, index) > 0) { + if (sessionStateRangeKeyCompare(pWinKey, pWinStates, index) > 0) { sessionWinStateMoveToNext(pCur); } return pCur; @@ -446,6 +462,66 @@ SStreamStateCur* sessionWinStateSeekKeyNext(SStreamFileState* pFileState, const return pCur; } +SStreamStateCur* countWinStateSeekKeyPrev(SStreamFileState* pFileState, const SSessionKey* pWinKey, COUNT_TYPE count) { + SArray* pWinStates = NULL; + int32_t index = -1; + SStreamStateCur* pBuffCur = seekKeyCurrentPrev_buff(pFileState, pWinKey, &pWinStates, &index); + int32_t resSize = getRowStateRowSize(pFileState); + COUNT_TYPE winCount = 0; + if (pBuffCur) { + while (index >= 0) { + SRowBuffPos* pPos = taosArrayGetP(pWinStates, index); + winCount = *((COUNT_TYPE*) ((char*)pPos->pRowBuff + (resSize - sizeof(COUNT_TYPE)))); + if (sessionStateRangeKeyCompare(pWinKey, pWinStates, index) == 0 || winCount < count) { + index--; + } else if (index >= 0) { + pBuffCur->buffIndex = index + 1; + return pBuffCur; + } + } + pBuffCur->buffIndex = 0; + } else if (taosArrayGetSize(pWinStates) > 0) { + pBuffCur = createSessionStateCursor(pFileState); + pBuffCur->buffIndex = 0; + } + + void* pFileStore = getStateFileStore(pFileState); + SStreamStateCur* pCur = streamStateSessionSeekKeyPrev_rocksdb(pFileStore, pWinKey); + if (pCur) { + SSessionKey key = {0}; + void* pVal = NULL; + int len = 0; + int32_t code = streamStateSessionGetKVByCur_rocksdb(pCur, &key, &pVal, &len); + if (code == TSDB_CODE_FAILED) { + streamStateFreeCur(pCur); + return pBuffCur; + } + winCount = *((COUNT_TYPE*) ((char*)pVal + (resSize - sizeof(COUNT_TYPE)))); + if (sessionRangeKeyCmpr(pWinKey, &key) != 0 && winCount == count) { + streamStateFreeCur(pCur); + return pBuffCur; + } + streamStateCurPrev(pFileStore, pCur); + while (1) { + code = streamStateSessionGetKVByCur_rocksdb(pCur, &key, &pVal, &len); + if (code == TSDB_CODE_FAILED) { + streamStateCurNext(pFileStore, pCur); + streamStateFreeCur(pBuffCur); + return pCur; + } + winCount = *((COUNT_TYPE*) ((char*)pVal + (resSize - sizeof(COUNT_TYPE)))); + if (sessionRangeKeyCmpr(pWinKey, &key) == 0 || winCount < count) { + streamStateCurPrev(pFileStore, pCur); + } else { + streamStateCurNext(pFileStore, pCur); + streamStateFreeCur(pBuffCur); + return pCur; + } + } + } + return pBuffCur; +} + int32_t sessionWinStateGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen) { if (!pCur) { return TSDB_CODE_FAILED; @@ -503,7 +579,7 @@ int32_t sessionWinStateMoveToNext(SStreamStateCur* pCur) { return TSDB_CODE_SUCCESS; } -int32_t sessionWinStateGetKeyByRange(SStreamFileState* pFileState, const SSessionKey* key, SSessionKey* curKey) { +int32_t sessionWinStateGetKeyByRange(SStreamFileState* pFileState, const SSessionKey* key, SSessionKey* curKey, range_cmpr_fn cmpFn) { SStreamStateCur* pCur = sessionWinStateSeekKeyCurrentPrev(pFileState, key); SSessionKey tmpKey = *key; int32_t code = sessionWinStateGetKVByCur(pCur, &tmpKey, NULL, NULL); @@ -520,7 +596,7 @@ int32_t sessionWinStateGetKeyByRange(SStreamFileState* pFileState, const SSessio goto _end; } - if (sessionRangeKeyCmpr(key, &tmpKey) == 0) { + if (cmpFn(key, &tmpKey) == 0) { *curKey = tmpKey; goto _end; } else if (!hasCurrentPrev) { @@ -530,7 +606,7 @@ int32_t sessionWinStateGetKeyByRange(SStreamFileState* pFileState, const SSessio sessionWinStateMoveToNext(pCur); code = sessionWinStateGetKVByCur(pCur, &tmpKey, NULL, NULL); - if (code == TSDB_CODE_SUCCESS && sessionRangeKeyCmpr(key, &tmpKey) == 0) { + if (code == TSDB_CODE_SUCCESS && cmpFn(key, &tmpKey) == 0) { *curKey = tmpKey; } else { code = TSDB_CODE_FAILED; @@ -636,3 +712,143 @@ int32_t getStateWinResultBuff(SStreamFileState* pFileState, SSessionKey* key, ch _end: return code; } + +int32_t getCountWinResultBuff(SStreamFileState* pFileState, SSessionKey* pKey, COUNT_TYPE winCount, void** pVal, int32_t* pVLen) { + SSessionKey* pWinKey = pKey; + const TSKEY gap = 0; + int32_t code = TSDB_CODE_SUCCESS; + SSHashObj* pSessionBuff = getRowStateBuff(pFileState); + SArray* pWinStates = NULL; + void** ppBuff = tSimpleHashGet(pSessionBuff, &pWinKey->groupId, sizeof(uint64_t)); + if (ppBuff) { + pWinStates = (SArray*)(*ppBuff); + } else { + pWinStates = taosArrayInit(16, POINTER_BYTES); + tSimpleHashPut(pSessionBuff, &pWinKey->groupId, sizeof(uint64_t), &pWinStates, POINTER_BYTES); + } + + TSKEY startTs = pWinKey->win.skey; + TSKEY endTs = pWinKey->win.ekey; + + int32_t size = taosArrayGetSize(pWinStates); + if (size == 0) { + void* pFileStore = getStateFileStore(pFileState); + void* pRockVal = NULL; + SStreamStateCur* pCur = streamStateSessionSeekToLast_rocksdb(pFileStore, pKey->groupId); + code = streamStateSessionGetKVByCur_rocksdb(pCur, pWinKey, &pRockVal, pVLen); + if (code == TSDB_CODE_SUCCESS || isFlushedState(pFileState, endTs, 0)) { + qDebug("===stream===0 get state win:%" PRId64 ",%" PRId64 " from disc, res %d", pWinKey->win.skey, pWinKey->win.ekey, code); + if (code == TSDB_CODE_SUCCESS) { + int32_t valSize = *pVLen; + COUNT_TYPE* pWinStateCout = (COUNT_TYPE*)( (char*)(pRockVal) + (valSize - sizeof(COUNT_TYPE)) ); + if (inSessionWindow(pWinKey, startTs, gap) || (*pWinStateCout) < winCount) { + (*pVal) = createSessionWinBuff(pFileState, pWinKey, pRockVal, pVLen); + streamStateFreeCur(pCur); + goto _end; + } + } + pWinKey->win.skey = startTs; + pWinKey->win.ekey = endTs; + (*pVal) = createSessionWinBuff(pFileState, pWinKey, NULL, NULL); + taosMemoryFree(pRockVal); + streamStateFreeCur(pCur); + } else { + (*pVal) = addNewSessionWindow(pFileState, pWinStates, pWinKey); + code = TSDB_CODE_FAILED; + } + goto _end; + } + + // find the first position which is smaller than the pWinKey + int32_t index = binarySearch(pWinStates, size, pWinKey, sessionStateKeyCompare); + SRowBuffPos* pPos = NULL; + int32_t valSize = *pVLen; + + if (index >= 0) { + pPos = taosArrayGetP(pWinStates, index); + COUNT_TYPE* pWinStateCout = (COUNT_TYPE*)( (char*)(pPos->pRowBuff) + (valSize - sizeof(COUNT_TYPE)) ); + if (inSessionWindow(pPos->pKey, startTs, gap) || (index == size - 1 && (*pWinStateCout) < winCount) ) { + (*pVal) = pPos; + SSessionKey* pDestWinKey = (SSessionKey*)pPos->pKey; + pPos->beUsed = true; + *pWinKey = *pDestWinKey; + goto _end; + } + } + + if (index == -1) { + if (!isDeteled(pFileState, endTs)) { + void* p = NULL; + void* pFileStore = getStateFileStore(pFileState); + SStreamStateCur* pCur = streamStateSessionSeekToLast_rocksdb(pFileStore, pKey->groupId); + int32_t code_file = streamStateSessionGetKVByCur_rocksdb(pCur, pWinKey, &p, pVLen); + if (code_file == TSDB_CODE_SUCCESS) { + (*pVal) = createSessionWinBuff(pFileState, pWinKey, p, pVLen); + code = code_file; + qDebug("===stream===1 get state win:%" PRId64 ",%" PRId64 " from disc, res %d", pWinKey->win.skey, pWinKey->win.ekey, code_file); + streamStateFreeCur(pCur); + goto _end; + } + taosMemoryFree(p); + streamStateFreeCur(pCur); + } + } + + if (index + 1 < size) { + pPos = taosArrayGetP(pWinStates, index + 1); + (*pVal) = pPos; + SSessionKey* pDestWinKey = (SSessionKey*)pPos->pKey; + pPos->beUsed = true; + *pWinKey = *pDestWinKey; + goto _end; + } + + (*pVal) = addNewSessionWindow(pFileState, pWinStates, pWinKey); + code = TSDB_CODE_FAILED; + +_end: + return code; +} + +int32_t createCountWinResultBuff(SStreamFileState* pFileState, SSessionKey* pKey, void** pVal, int32_t* pVLen) { + SSessionKey* pWinKey = pKey; + const TSKEY gap = 0; + int32_t code = TSDB_CODE_SUCCESS; + SSHashObj* pSessionBuff = getRowStateBuff(pFileState); + SArray* pWinStates = NULL; + void** ppBuff = tSimpleHashGet(pSessionBuff, &pWinKey->groupId, sizeof(uint64_t)); + if (ppBuff) { + pWinStates = (SArray*)(*ppBuff); + } else { + pWinStates = taosArrayInit(16, POINTER_BYTES); + tSimpleHashPut(pSessionBuff, &pWinKey->groupId, sizeof(uint64_t), &pWinStates, POINTER_BYTES); + } + + TSKEY startTs = pWinKey->win.skey; + TSKEY endTs = pWinKey->win.ekey; + + int32_t size = taosArrayGetSize(pWinStates); + if (size == 0) { + void* pFileStore = getStateFileStore(pFileState); + void* p = NULL; + + SStreamStateCur* pCur = streamStateSessionSeekToLast_rocksdb(pFileStore, pKey->groupId); + int32_t code_file = streamStateSessionGetKVByCur_rocksdb(pCur, pWinKey, &p, pVLen); + if (code_file == TSDB_CODE_SUCCESS || isFlushedState(pFileState, endTs, 0)) { + (*pVal) = createSessionWinBuff(pFileState, pWinKey, p, pVLen); + code = code_file; + qDebug("===stream===0 get state win:%" PRId64 ",%" PRId64 " from disc, res %d", pWinKey->win.skey, pWinKey->win.ekey, code_file); + } else { + (*pVal) = addNewSessionWindow(pFileState, pWinStates, pWinKey); + code = TSDB_CODE_FAILED; + taosMemoryFree(p); + } + streamStateFreeCur(pCur); + goto _end; + } else { + (*pVal) = addNewSessionWindow(pFileState, pWinStates, pWinKey); + } + +_end: + return code; +} diff --git a/source/libs/stream/src/streamStart.c b/source/libs/stream/src/streamStart.c index fc921a4acc..6112a208c6 100644 --- a/source/libs/stream/src/streamStart.c +++ b/source/libs/stream/src/streamStart.c @@ -391,6 +391,16 @@ void doProcessDownstreamReadyRsp(SStreamTask* pTask) { int64_t startTs = pTask->execInfo.start; streamMetaAddTaskLaunchResult(pTask->pMeta, pTask->id.streamId, pTask->id.taskId, initTs, startTs, true); + if (pTask->status.taskStatus == TASK_STATUS__HALT) { + ASSERT(HAS_RELATED_FILLHISTORY_TASK(pTask) && (pTask->info.fillHistory == 0)); + + // halt it self for count window stream task until the related + // fill history task completd. + stDebug("s-task:%s level:%d initial status is %s from mnode, set it to be halt", pTask->id.idStr, + pTask->info.taskLevel, streamTaskGetStatusStr(pTask->status.taskStatus)); + streamTaskHandleEvent(pTask->status.pSM, TASK_EVENT_HALT); + } + // start the related fill-history task, when current task is ready // not invoke in success callback due to the deadlock. if (HAS_RELATED_FILLHISTORY_TASK(pTask)) { @@ -799,7 +809,7 @@ int32_t streamLaunchFillHistoryTask(SStreamTask* pTask) { // check stream task status in the first place. SStreamTaskState* pStatus = streamTaskGetStatus(pTask); - if (pStatus->state != TASK_STATUS__READY) { + if (pStatus->state != TASK_STATUS__READY && pStatus->state != TASK_STATUS__HALT) { stDebug("s-task:%s not launch related fill-history task:0x%" PRIx64 "-0x%x, status:%s", idStr, hStreamId, hTaskId, pStatus->name); diff --git a/source/libs/stream/src/streamState.c b/source/libs/stream/src/streamState.c index e370312338..b53dc9daa6 100644 --- a/source/libs/stream/src/streamState.c +++ b/source/libs/stream/src/streamState.c @@ -42,6 +42,14 @@ int sessionRangeKeyCmpr(const SSessionKey* pWin1, const SSessionKey* pWin2) { return 0; } +int countRangeKeyEqual(const SSessionKey* pWin1, const SSessionKey* pWin2) { + if (pWin1->groupId == pWin2->groupId && pWin1->win.skey <= pWin2->win.skey && pWin2->win.skey <= pWin1->win.ekey) { + return 0; + } + + return 1; +} + int sessionWinKeyCmpr(const SSessionKey* pWin1, const SSessionKey* pWin2) { if (pWin1->groupId > pWin2->groupId) { return 1; @@ -752,6 +760,12 @@ int32_t streamStateSessionDel(SStreamState* pState, const SSessionKey* key) { #endif } +int32_t streamStateSessionReset(SStreamState* pState, void* pVal) { + int32_t len = getRowStateRowSize(pState->pFileState); + memset(pVal, 0, len); + return TSDB_CODE_SUCCESS; +} + SStreamStateCur* streamStateSessionSeekKeyCurrentPrev(SStreamState* pState, const SSessionKey* key) { #ifdef USE_ROCKSDB return sessionWinStateSeekKeyCurrentPrev(pState->pFileState, key); @@ -846,6 +860,13 @@ SStreamStateCur* streamStateSessionSeekKeyNext(SStreamState* pState, const SSess #endif } +SStreamStateCur* streamStateCountSeekKeyPrev(SStreamState* pState, const SSessionKey* key, COUNT_TYPE count) { +#ifdef USE_ROCKSDB + return countWinStateSeekKeyPrev(pState->pFileState, key, count); +#else +#endif +} + int32_t streamStateSessionGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen) { #ifdef USE_ROCKSDB return sessionWinStateGetKVByCur(pCur, pKey, pVal, pVLen); @@ -896,7 +917,7 @@ int32_t streamStateSessionClear(SStreamState* pState) { int32_t streamStateSessionGetKeyByRange(SStreamState* pState, const SSessionKey* key, SSessionKey* curKey) { #ifdef USE_ROCKSDB - return sessionWinStateGetKeyByRange(pState->pFileState, key, curKey); + return sessionWinStateGetKeyByRange(pState->pFileState, key, curKey, sessionRangeKeyCmpr); #else SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); if (pCur == NULL) { @@ -946,6 +967,13 @@ int32_t streamStateSessionGetKeyByRange(SStreamState* pState, const SSessionKey* #endif } +int32_t streamStateCountGetKeyByRange(SStreamState* pState, const SSessionKey* key, SSessionKey* curKey) { +#ifdef USE_ROCKSDB + return sessionWinStateGetKeyByRange(pState->pFileState, key, curKey, countRangeKeyEqual); +#else +#endif +} + int32_t streamStateSessionAddIfNotExist(SStreamState* pState, SSessionKey* key, TSKEY gap, void** pVal, int32_t* pVLen) { #ifdef USE_ROCKSDB @@ -1135,90 +1163,11 @@ SStreamStateCur* createStreamStateCursor() { return pCur; } -#if 0 -char* streamStateSessionDump(SStreamState* pState) { - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); - if (pCur == NULL) { - return NULL; - } - pCur->number = pState->number; - if (tdbTbcOpen(pState->pTdbState->pSessionStateDb, &pCur->pCur, NULL) < 0) { - streamStateFreeCur(pCur); - return NULL; - } - tdbTbcMoveToFirst(pCur->pCur); - - SSessionKey key = {0}; - void* buf = NULL; - int32_t bufSize = 0; - int32_t code = streamStateSessionGetKVByCur(pCur, &key, &buf, &bufSize); - if (code != 0) { - streamStateFreeCur(pCur); - return NULL; - } - - int32_t size = 2048; - char* dumpBuf = taosMemoryCalloc(size, 1); - int64_t len = 0; - len += snprintf(dumpBuf + len, size - len, "||s:%15" PRId64 ",", key.win.skey); - len += snprintf(dumpBuf + len, size - len, "e:%15" PRId64 ",", key.win.ekey); - len += snprintf(dumpBuf + len, size - len, "g:%15" PRId64 "||", key.groupId); - while (1) { - tdbTbcMoveToNext(pCur->pCur); - key = (SSessionKey){0}; - code = streamStateSessionGetKVByCur(pCur, &key, NULL, 0); - if (code != 0) { - streamStateFreeCur(pCur); - return dumpBuf; - } - len += snprintf(dumpBuf + len, size - len, "||s:%15" PRId64 ",", key.win.skey); - len += snprintf(dumpBuf + len, size - len, "e:%15" PRId64 ",", key.win.ekey); - len += snprintf(dumpBuf + len, size - len, "g:%15" PRId64 "||", key.groupId); - } - streamStateFreeCur(pCur); - return dumpBuf; +// count window +int32_t streamStateCountWinAddIfNotExist(SStreamState* pState, SSessionKey* pKey, COUNT_TYPE winCount, void** ppVal, int32_t* pVLen) { + return getCountWinResultBuff(pState->pFileState, pKey, winCount, ppVal, pVLen); } -char* streamStateIntervalDump(SStreamState* pState) { - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); - if (pCur == NULL) { - return NULL; - } - pCur->number = pState->number; - if (tdbTbcOpen(pState->pTdbState->pStateDb, &pCur->pCur, NULL) < 0) { - streamStateFreeCur(pCur); - return NULL; - } - tdbTbcMoveToFirst(pCur->pCur); - - SWinKey key = {0}; - void* buf = NULL; - int32_t bufSize = 0; - int32_t code = streamStateGetKVByCur(pCur, &key, (const void **)&buf, &bufSize); - if (code != 0) { - streamStateFreeCur(pCur); - return NULL; - } - - int32_t size = 2048; - char* dumpBuf = taosMemoryCalloc(size, 1); - int64_t len = 0; - len += snprintf(dumpBuf + len, size - len, "||s:%15" PRId64 ",", key.ts); - // len += snprintf(dumpBuf + len, size - len, "e:%15" PRId64 ",", key.win.ekey); - len += snprintf(dumpBuf + len, size - len, "g:%15" PRId64 "||", key.groupId); - while (1) { - tdbTbcMoveToNext(pCur->pCur); - key = (SWinKey){0}; - code = streamStateGetKVByCur(pCur, &key, NULL, 0); - if (code != 0) { - streamStateFreeCur(pCur); - return dumpBuf; - } - len += snprintf(dumpBuf + len, size - len, "||s:%15" PRId64 ",", key.ts); - // len += snprintf(dumpBuf + len, size - len, "e:%15" PRId64 ",", key.win.ekey); - len += snprintf(dumpBuf + len, size - len, "g:%15" PRId64 "||", key.groupId); - } - streamStateFreeCur(pCur); - return dumpBuf; +int32_t streamStateCountWinAdd(SStreamState* pState, SSessionKey* pKey, void** pVal, int32_t* pVLen) { + return createCountWinResultBuff(pState->pFileState, pKey, pVal, pVLen); } -#endif \ No newline at end of file diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c index db3d2729af..281e2ed550 100644 --- a/source/libs/stream/src/streamTask.c +++ b/source/libs/stream/src/streamTask.c @@ -109,7 +109,7 @@ SStreamTask* tNewStreamTask(int64_t streamId, int8_t taskLevel, SEpSet* pEpset, pTask->id.idStr = taosStrdup(buf); pTask->status.schedStatus = TASK_SCHED_STATUS__INACTIVE; - pTask->status.taskStatus = (fillHistory || hasFillhistory) ? TASK_STATUS__SCAN_HISTORY : TASK_STATUS__READY; + pTask->status.taskStatus = fillHistory? TASK_STATUS__SCAN_HISTORY : TASK_STATUS__READY; pTask->inputq.status = TASK_INPUT_STATUS__NORMAL; pTask->outputq.status = TASK_OUTPUT_STATUS__NORMAL; @@ -127,7 +127,6 @@ int32_t tEncodeStreamEpInfo(SEncoder* pEncoder, const SStreamChildEpInfo* pInfo) if (tEncodeI32(pEncoder, pInfo->taskId) < 0) return -1; if (tEncodeI32(pEncoder, pInfo->nodeId) < 0) return -1; if (tEncodeI32(pEncoder, pInfo->childId) < 0) return -1; - /*if (tEncodeI64(pEncoder, pInfo->processedVer) < 0) return -1;*/ if (tEncodeSEpSet(pEncoder, &pInfo->epSet) < 0) return -1; if (tEncodeI64(pEncoder, pInfo->stage) < 0) return -1; return 0; @@ -137,7 +136,6 @@ int32_t tDecodeStreamEpInfo(SDecoder* pDecoder, SStreamChildEpInfo* pInfo) { if (tDecodeI32(pDecoder, &pInfo->taskId) < 0) return -1; if (tDecodeI32(pDecoder, &pInfo->nodeId) < 0) return -1; if (tDecodeI32(pDecoder, &pInfo->childId) < 0) return -1; - /*if (tDecodeI64(pDecoder, &pInfo->processedVer) < 0) return -1;*/ if (tDecodeSEpSet(pDecoder, &pInfo->epSet) < 0) return -1; if (tDecodeI64(pDecoder, &pInfo->stage) < 0) return -1; return 0; @@ -297,7 +295,6 @@ int32_t tDecodeStreamTask(SDecoder* pDecoder, SStreamTask* pTask) { } int32_t tDecodeStreamTaskChkInfo(SDecoder* pDecoder, SCheckpointInfo* pChkpInfo) { - int64_t ver; int64_t skip64; int8_t skip8; int32_t skip32; @@ -651,7 +648,7 @@ int32_t streamTaskStop(SStreamTask* pTask) { streamTaskHandleEvent(pTask->status.pSM, TASK_EVENT_STOP); qKillTask(pTask->exec.pExecutor, TSDB_CODE_SUCCESS); - while (/*pTask->status.schedStatus != TASK_SCHED_STATUS__INACTIVE */ !streamTaskIsIdle(pTask)) { + while (!streamTaskIsIdle(pTask)) { stDebug("s-task:%s level:%d wait for task to be idle and then close, check again in 100ms", id, pTask->info.taskLevel); taosMsleep(100); @@ -758,7 +755,7 @@ int8_t streamTaskSetSchedStatusInactive(SStreamTask* pTask) { return status; } -int32_t streamTaskClearHTaskAttr(SStreamTask* pTask, bool metaLock) { +int32_t streamTaskClearHTaskAttr(SStreamTask* pTask, int32_t resetRelHalt, bool metaLock) { SStreamMeta* pMeta = pTask->pMeta; STaskId sTaskId = {.streamId = pTask->streamTaskId.streamId, .taskId = pTask->streamTaskId.taskId}; if (pTask->info.fillHistory == 0) { @@ -776,6 +773,12 @@ int32_t streamTaskClearHTaskAttr(SStreamTask* pTask, bool metaLock) { taosThreadMutexLock(&(*ppStreamTask)->lock); CLEAR_RELATED_FILLHISTORY_TASK((*ppStreamTask)); + + if (resetRelHalt) { + (*ppStreamTask)->status.taskStatus = TASK_STATUS__READY; + stDebug("s-task:0x%" PRIx64 " set the status to be ready", sTaskId.taskId); + } + streamMetaSaveTask(pMeta, *ppStreamTask); taosThreadMutexUnlock(&(*ppStreamTask)->lock); } @@ -787,7 +790,7 @@ int32_t streamTaskClearHTaskAttr(SStreamTask* pTask, bool metaLock) { return TSDB_CODE_SUCCESS; } -int32_t streamBuildAndSendDropTaskMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskId* pTaskId) { +int32_t streamBuildAndSendDropTaskMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskId* pTaskId, int64_t resetRelHalt) { SVDropStreamTaskReq* pReq = rpcMallocCont(sizeof(SVDropStreamTaskReq)); if (pReq == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -797,6 +800,7 @@ int32_t streamBuildAndSendDropTaskMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskI pReq->head.vgId = vgId; pReq->taskId = pTaskId->taskId; pReq->streamId = pTaskId->streamId; + pReq->resetRelHalt = resetRelHalt; SRpcMsg msg = {.msgType = TDMT_STREAM_TASK_DROP, .pCont = pReq, .contLen = sizeof(SVDropStreamTaskReq)}; int32_t code = tmsgPutToQueue(pMsgCb, WRITE_QUEUE, &msg); diff --git a/source/libs/stream/src/tstreamFileState.c b/source/libs/stream/src/tstreamFileState.c index fb5e02c827..f86ab6b8a3 100644 --- a/source/libs/stream/src/tstreamFileState.c +++ b/source/libs/stream/src/tstreamFileState.c @@ -480,6 +480,15 @@ int32_t deleteRowBuff(SStreamFileState* pFileState, const void* pKey, int32_t ke return TSDB_CODE_FAILED; } +int32_t resetRowBuff(SStreamFileState* pFileState, const void* pKey, int32_t keyLen) { + int32_t code_buff = pFileState->stateBuffRemoveFn(pFileState->rowStateBuff, pKey, keyLen); + int32_t code_file = pFileState->stateFileRemoveFn(pFileState, pKey); + if (code_buff == TSDB_CODE_SUCCESS || code_file == TSDB_CODE_SUCCESS) { + return TSDB_CODE_SUCCESS; + } + return TSDB_CODE_FAILED; +} + static void recoverSessionRowBuff(SStreamFileState* pFileState, SRowBuffPos* pPos) { int32_t len = 0; void* pBuff = NULL; @@ -656,7 +665,7 @@ int32_t recoverSesssion(SStreamFileState* pFileState, int64_t ckId) { deleteExpiredCheckPoint(pFileState, mark); } - SStreamStateCur* pCur = streamStateSessionSeekToLast_rocksdb(pFileState->pFileStore); + SStreamStateCur* pCur = streamStateSessionSeekToLast_rocksdb(pFileState->pFileStore, INT64_MAX); if (pCur == NULL) { return -1; } diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 19d08580a3..d12a1e5837 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -1141,6 +1141,8 @@ ,,y,script,./test.sh -f tsim/query/bug3398.sim ,,y,script,./test.sh -f tsim/query/explain_tsorder.sim ,,y,script,./test.sh -f tsim/query/apercentile.sim +,,y,script,./test.sh -f tsim/query/query_count0.sim +,,y,script,./test.sh -f tsim/query/query_count_sliding0.sim ,,y,script,./test.sh -f tsim/qnode/basic1.sim ,,y,script,./test.sh -f tsim/snode/basic1.sim ,,y,script,./test.sh -f tsim/mnode/basic1.sim @@ -1185,6 +1187,13 @@ ,,y,script,./test.sh -f tsim/stream/checkpointInterval0.sim ,,y,script,./test.sh -f tsim/stream/checkStreamSTable1.sim ,,y,script,./test.sh -f tsim/stream/checkStreamSTable.sim +,,y,script,./test.sh -f tsim/stream/count0.sim +,,y,script,./test.sh -f tsim/stream/count1.sim +,,y,script,./test.sh -f tsim/stream/count2.sim +,,y,script,./test.sh -f tsim/stream/count3.sim +,,y,script,./test.sh -f tsim/stream/countSliding0.sim +,,y,script,./test.sh -f tsim/stream/countSliding1.sim +,,y,script,./test.sh -f tsim/stream/countSliding2.sim ,,y,script,./test.sh -f tsim/stream/deleteInterval.sim ,,y,script,./test.sh -f tsim/stream/deleteSession.sim ,,y,script,./test.sh -f tsim/stream/deleteState.sim diff --git a/tests/script/tsim/query/query_count0.sim b/tests/script/tsim/query/query_count0.sim new file mode 100644 index 0000000000..c3a75d635b --- /dev/null +++ b/tests/script/tsim/query/query_count0.sim @@ -0,0 +1,179 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +print step1 +print =============== create database +sql create database test vgroups 1; +sql use test; + +sql create table t1(ts timestamp, a int, b int , c int, d double); + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sql insert into t1 values(1648791213001,9,2,2,1.1); +sql insert into t1 values(1648791213009,0,3,3,1.0); + + +sql insert into t1 values(1648791223000,0,1,1,1.0); +sql insert into t1 values(1648791223001,9,2,2,1.1); +sql insert into t1 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop2: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(3); +sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(3); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $data01 != 3 then + print ======data01=$data01 + goto loop2 +endi + +if $data02 != 6 then + print ======data02=$data02 + goto loop2 +endi + +if $data03 != 3 then + print ======data03=$data03 + goto loop2 +endi + +# row 1 +if $data11 != 3 then + print ======data11=$data11 + goto loop2 +endi + +if $data12 != 6 then + print ======data12=$data12 + goto loop2 +endi + +if $data13 != 3 then + print ======data13=$data13 + goto loop2 +endi + + + +print step2 +print =============== create database +sql create database test2 vgroups 4; +sql use test2; + +sql create stable st(ts timestamp, a int, b int , c int, d double) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sql insert into t1 values(1648791213001,9,2,2,1.1); +sql insert into t1 values(1648791213009,0,3,3,1.0); + +sql insert into t2 values(1648791213000,0,1,1,1.0); +sql insert into t2 values(1648791213001,9,2,2,1.1); +sql insert into t2 values(1648791213009,0,3,3,1.0); + +sql insert into t1 values(1648791223000,0,1,1,1.0); +sql insert into t1 values(1648791223001,9,2,2,1.1); +sql insert into t1 values(1648791223009,0,3,3,1.0); + +sql insert into t2 values(1648791223000,0,1,1,1.0); +sql insert into t2 values(1648791223001,9,2,2,1.1); +sql insert into t2 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop3: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(3); +sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(3); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $data01 != 3 then + print ======data01=$data01 + goto loop3 +endi + +if $data02 != 6 then + print ======data02=$data02 + goto loop3 +endi + +if $data03 != 3 then + print ======data03=$data03 + goto loop3 +endi + +# row 1 +if $data11 != 3 then + print ======data11=$data11 + goto loop3 +endi + +if $data12 != 6 then + print ======data12=$data12 + goto loop3 +endi + +if $data13 != 3 then + print ======data13=$data13 + goto loop3 +endi + +# row 2 +if $data21 != 3 then + print ======data21=$data21 + goto loop3 +endi + +if $data22 != 6 then + print ======data22=$data22 + goto loop3 +endi + +if $data23 != 3 then + print ======data23=$data23 + goto loop3 +endi + +# row 3 +if $data31 != 3 then + print ======data31=$data31 + goto loop3 +endi + +if $data32 != 6 then + print ======data32=$data32 + goto loop3 +endi + +if $data33 != 3 then + print ======data33=$data33 + goto loop3 +endi + +print query_count0 end +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/query/query_count1.sim b/tests/script/tsim/query/query_count1.sim new file mode 100644 index 0000000000..0694ab062a --- /dev/null +++ b/tests/script/tsim/query/query_count1.sim @@ -0,0 +1,83 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +print step1 +print =============== create database +sql create database test vgroups 4; +sql use test; + +sql create stable st(ts timestamp, a int, b int , c int, d double) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sql insert into t1 values(1648791213001,9,1,2,1.1); +sql insert into t1 values(1648791213009,0,1,3,1.0); + +sql insert into t2 values(1648791213000,0,1,4,1.0); +sql insert into t2 values(1648791213001,9,1,5,1.1); +sql insert into t2 values(1648791213009,0,1,6,1.0); + +sql insert into t1 values(1648791223000,0,1,7,1.0); +sql insert into t1 values(1648791223001,9,1,8,1.1); +sql insert into t1 values(1648791223009,0,1,9,1.0); + +sql insert into t2 values(1648791223000,0,1,10,1.0); +sql insert into t2 values(1648791223001,9,1,11,1.1); +sql insert into t2 values(1648791223009,0,1,12,1.0); + +$loop_count = 0 +loop3: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from st count_window(4); +sql select _wstart as s, count(*) c1, sum(b), max(c) from st count_window(4); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop3 +endi + +if $data02 != 4 then + print ======data02=$data02 + goto loop3 +endi + +# row 1 +if $data11 != 4 then + print ======data11=$data11 + goto loop3 +endi + +if $data12 != 4 then + print ======data12=$data12 + goto loop3 +endi + +# row 2 +if $data21 != 4 then + print ======data21=$data21 + goto loop3 +endi + +if $data22 != 4 then + print ======data22=$data22 + goto loop3 +endi + +print query_count0 end +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/query/query_count_sliding0.sim b/tests/script/tsim/query/query_count_sliding0.sim new file mode 100644 index 0000000000..464aec6b97 --- /dev/null +++ b/tests/script/tsim/query/query_count_sliding0.sim @@ -0,0 +1,670 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +print step1 +print =============== create database +sql create database test vgroups 1; +sql use test; + +sql create table t1(ts timestamp, a int, b int , c int, d double); + +sql insert into t1 values(1648791213000,0,1,1,1.0); + +$loop_count = 0 +loop00: + +sleep 300 +print 00 sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 1 then + print ======rows=$rows + goto loop00 +endi + +# row 0 +if $data01 != 1 then + print ======data01=$data01 + goto loop00 +endi + +sql insert into t1 values(1648791213001,9,2,2,1.1); + +$loop_count = 0 +loop01: + +sleep 300 +print 01 sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 1 then + print ======rows=$rows + goto loop01 +endi + +# row 0 +if $data01 != 2 then + print ======data01=$data01 + goto loop01 +endi + + +sql insert into t1 values(1648791213002,0,3,3,1.0); + +$loop_count = 0 +loop02: + +sleep 300 +print 02 sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 2 then + print ======rows=$rows + goto loop02 +endi + +# row 0 +if $data01 != 3 then + print ======data01=$data01 + goto loop02 +endi + +# row 1 +if $data11 != 1 then + print ======data01=$data01 + goto loop02 +endi + +sql insert into t1 values(1648791213009,0,3,3,1.0); + +$loop_count = 0 +loop0: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 2 then + print ======rows=$rows + goto loop0 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop0 +endi + +# row 1 +if $data11 != 2 then + print ======data11=$data11 + goto loop0 +endi + +sql insert into t1 values(1648791223000,0,1,1,1.0); +sql insert into t1 values(1648791223001,9,2,2,1.1); +sql insert into t1 values(1648791223002,9,2,2,1.1); +sql insert into t1 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop2: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 4 then + print ======rows=$rows + goto loop2 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop2 +endi + +# row 1 +if $data11 != 4 then + print ======data11=$data11 + goto loop2 +endi + +# row 2 +if $data21 != 4 then + print ======data21=$data21 + goto loop2 +endi + +# row 3 +if $data31 != 2 then + print ======data31=$data31 + goto loop2 +endi + +sql insert into t1 values(1648791233000,0,1,1,1.0) (1648791233001,9,2,2,1.1) (1648791233002,9,2,2,1.1) (1648791233009,0,3,3,1.0); + +$loop_count = 0 +loop3: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 6 then + print ======rows=$rows + goto loop3 +endi + + +sql insert into t1 values(1648791243000,0,1,1,1.0) (1648791243001,9,2,2,1.1); + +$loop_count = 0 +loop4: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 7 then + print ======rows=$rows + goto loop4 +endi + +sql insert into t1 values(1648791253000,0,1,1,1.0) (1648791253001,9,2,2,1.1) (1648791253002,9,2,2,1.1); + +$loop_count = 0 +loop5: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 +print $data80 $data81 $data82 $data83 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 9 then + print ======rows=$rows + goto loop5 +endi + +sql insert into t1 values(1648791263000,0,1,1,1.0); + +$loop_count = 0 +loop6: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 +print $data80 $data81 $data82 $data83 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 9 then + print ======rows=$rows + goto loop6 +endi + + + +print step2 +print =============== create database +sql create database test2 vgroups 4; +sql use test2; + +sql create stable st(ts timestamp, a int, b int , c int, d double) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sql insert into t1 values(1648791213001,9,2,2,1.1); +sql insert into t1 values(1648791213002,0,3,3,1.0); +sql insert into t1 values(1648791213009,0,3,3,1.0); + +$loop_count = 0 +loop7: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 2 then + print ======rows=$rows + goto loop7 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop7 +endi + +# row 1 +if $data11 != 2 then + print ======data11=$data11 + goto loop7 +endi + +sql insert into t1 values(1648791223000,0,1,1,1.0); +sql insert into t1 values(1648791223001,9,2,2,1.1); +sql insert into t1 values(1648791223002,9,2,2,1.1); +sql insert into t1 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop8: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 4 then + print ======rows=$rows + goto loop8 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop8 +endi + +# row 1 +if $data11 != 4 then + print ======data11=$data11 + goto loop8 +endi + +# row 2 +if $data21 != 4 then + print ======data21=$data21 + goto loop8 +endi + +# row 3 +if $data31 != 2 then + print ======data31=$data31 + goto loop8 +endi + +sql insert into t1 values(1648791233000,0,1,1,1.0) (1648791233001,9,2,2,1.1) (1648791233002,9,2,2,1.1) (1648791233009,0,3,3,1.0); + +$loop_count = 0 +loop9: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 6 then + print ======rows=$rows + goto loop9 +endi + + +sql insert into t1 values(1648791243000,0,1,1,1.0) (1648791243001,9,2,2,1.1); + +$loop_count = 0 +loop10: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 7 then + print ======rows=$rows + goto loop10 +endi + +sql insert into t1 values(1648791253000,0,1,1,1.0) (1648791253001,9,2,2,1.1) (1648791253002,9,2,2,1.1); + +$loop_count = 0 +loop11: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 +print $data80 $data81 $data82 $data83 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 9 then + print ======rows=$rows + goto loop11 +endi + +sql insert into t1 values(1648791263000,0,1,1,1.0); + +$loop_count = 0 +loop12: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); +sql select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 +print $data80 $data81 $data82 $data83 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 9 then + print ======rows=$rows + goto loop12 +endi + + + +print step3 +print =============== create database +sql create database test3 vgroups 4; +sql use test3; + +sql create stable st(ts timestamp, a int, b int , c int, d double) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sql insert into t1 values(1648791213001,9,1,2,1.1); +sql insert into t1 values(1648791213009,0,1,3,1.0); + +sql insert into t2 values(1648791213000,0,1,4,1.0); +sql insert into t2 values(1648791213001,9,1,5,1.1); +sql insert into t2 values(1648791213009,0,1,6,1.0); + +sql insert into t1 values(1648791223000,0,1,7,1.0); +sql insert into t1 values(1648791223001,9,1,8,1.1); +sql insert into t1 values(1648791223009,0,1,9,1.0); + +sql insert into t2 values(1648791223000,0,1,10,1.0); +sql insert into t2 values(1648791223001,9,1,11,1.1); +sql insert into t2 values(1648791223009,0,1,12,1.0); + +$loop_count = 0 +loop13: + +sleep 300 +print 1 sql select _wstart as s, count(*) c1, sum(b), max(c) from st count_window(4, 1); +sql select _wstart as s, count(*) c1, sum(b), max(c) from st count_window(4,1); + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 +print $data80 $data81 $data82 $data83 +print $data90 $data91 $data92 $data93 +print $data[10][0] $data[10][1] $data[10][2] $data[10][3] +print $data[11][0] $data[11][1] $data[11][2] $data[11][3] +print $data[12][0] $data[12][1] $data[12][2] $data[12][3] + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# rows +if $rows != 12 then + print ======rows=$rows + goto loop13 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop13 +endi + +if $data02 != 4 then + print ======data02=$data02 + goto loop13 +endi + +# row 1 +if $data11 != 4 then + print ======data11=$data11 + goto loop13 +endi + +if $data12 != 4 then + print ======data12=$data12 + goto loop13 +endi + +# row 2 +if $data21 != 4 then + print ======data21=$data21 + goto loop13 +endi + +if $data22 != 4 then + print ======data22=$data22 + goto loop13 +endi + +# row 9 +if $data91 != 3 then + print ======data91=$data91 + goto loop13 +endi + +if $data92 != 3 then + print ======data92=$data92 + goto loop13 +endi + +# row 10 +if $data[10][1] != 2 then + print ======data[10][1]=$data[10][1] + goto loop13 +endi + +if $data[10][2] != 2 then + print ======data[10][2]=$data[10][2] + goto loop13 +endi + +# row 11 +if $data[11][1] != 1 then + print ======data[11][1]=$data[11][1] + goto loop13 +endi + +if $data[11][2] != 1 then + print ======data[11][2]=$data[11][2] + goto loop13 +endi + +print count sliding 0 end +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/stream/count0.sim b/tests/script/tsim/stream/count0.sim new file mode 100644 index 0000000000..5f5ec72275 --- /dev/null +++ b/tests/script/tsim/stream/count0.sim @@ -0,0 +1,249 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +print step1 +print =============== create database +sql create database test vgroups 1; +sql use test; + +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams1 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 100s into streamt as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(3); +sleep 1000 + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sql insert into t1 values(1648791213001,9,2,2,1.1); +sql insert into t1 values(1648791213009,0,3,3,1.0); + + +sql insert into t1 values(1648791223000,0,1,1,1.0); +sql insert into t1 values(1648791223001,9,2,2,1.1); +sql insert into t1 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop2: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $data01 != 3 then + print ======data01=$data01 + goto loop2 +endi + +if $data02 != 6 then + print ======data02=$data02 + goto loop2 +endi + +if $data03 != 3 then + print ======data03=$data03 + goto loop2 +endi + +# row 1 +if $data11 != 3 then + print ======data11=$data11 + goto loop2 +endi + +if $data12 != 6 then + print ======data12=$data12 + goto loop2 +endi + +if $data13 != 3 then + print ======data13=$data13 + goto loop2 +endi + + + +print step2 +print =============== create database +sql create database test2 vgroups 4; +sql use test2; + +sql create stable st(ts timestamp, a int, b int , c int, d double) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); +sql create stream streams2 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 100s into streamt2 as select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(3) +sleep 1000 + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sql insert into t1 values(1648791213001,9,2,2,1.1); +sql insert into t1 values(1648791213009,0,3,3,1.0); + +sql insert into t2 values(1648791213000,0,1,1,1.0); +sql insert into t2 values(1648791213001,9,2,2,1.1); +sql insert into t2 values(1648791213009,0,3,3,1.0); + +sql insert into t1 values(1648791223000,0,1,1,1.0); +sql insert into t1 values(1648791223001,9,2,2,1.1); +sql insert into t1 values(1648791223009,0,3,3,1.0); + +sql insert into t2 values(1648791223000,0,1,1,1.0); +sql insert into t2 values(1648791223001,9,2,2,1.1); +sql insert into t2 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop3: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt2 order by 1,2; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $data01 != 3 then + print ======data01=$data01 + goto loop3 +endi + +if $data02 != 6 then + print ======data02=$data02 + goto loop3 +endi + +if $data03 != 3 then + print ======data03=$data03 + goto loop3 +endi + +# row 1 +if $data11 != 3 then + print ======data11=$data11 + goto loop3 +endi + +if $data12 != 6 then + print ======data12=$data12 + goto loop3 +endi + +if $data13 != 3 then + print ======data13=$data13 + goto loop3 +endi + +# row 2 +if $data21 != 3 then + print ======data21=$data21 + goto loop3 +endi + +if $data22 != 6 then + print ======data22=$data22 + goto loop3 +endi + +if $data23 != 3 then + print ======data23=$data23 + goto loop3 +endi + +# row 3 +if $data31 != 3 then + print ======data31=$data31 + goto loop3 +endi + +if $data32 != 6 then + print ======data32=$data32 + goto loop3 +endi + +if $data33 != 3 then + print ======data33=$data33 + goto loop3 +endi + +print step3 +print =============== create database +sql create database test3 vgroups 1; +sql use test3; + +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql insert into t1 values(1648791213000,0,1,1,1.0); +sql insert into t1 values(1648791213001,9,2,2,1.1); +sql insert into t1 values(1648791213009,0,3,3,1.0); + +sleep 500 + +sql create stream streams3 trigger at_once FILL_HISTORY 1 IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 100s into streamt3 as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(3); +sleep 1000 + +sql insert into t1 values(1648791223000,0,1,1,1.0); +sql insert into t1 values(1648791223001,9,2,2,1.1); +sql insert into t1 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop4: + +sleep 300 +print 1 sql select * from streamt3; +sql select * from streamt3; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $data01 != 3 then + print ======data01=$data01 + goto loop4 +endi + +if $data02 != 6 then + print ======data02=$data02 + goto loop4 +endi + +if $data03 != 3 then + print ======data03=$data03 + goto loop4 +endi + +# row 1 +if $data11 != 3 then + print ======data11=$data11 + goto loop4 +endi + +if $data12 != 6 then + print ======data12=$data12 + goto loop4 +endi + +if $data13 != 3 then + print ======data13=$data13 + goto loop4 +endi + +print count0 end +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/stream/count1.sim b/tests/script/tsim/stream/count1.sim new file mode 100644 index 0000000000..694f801f77 --- /dev/null +++ b/tests/script/tsim/stream/count1.sim @@ -0,0 +1,36 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +print step1 +print =============== create database +sql create database test vgroups 1; +sql use test; + +sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); + +# stable +sql_error create stream streams1 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 10s into streamt as select _wstart as s, count(*) c1, sum(b), max(c) from st count_window(3); + +# IGNORE EXPIRED 0 +sql_error create stream streams1 trigger at_once IGNORE EXPIRED 0 IGNORE UPDATE 0 WATERMARK 10s into streamt as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(3); + +# WATERMARK 0 +sql_error create stream streams1 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 into streamt as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(3); + +# All +sql_error create stream streams1 trigger at_once IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt as select _wstart as s, count(*) c1, sum(b), max(c) from st count_window(3); + +#2~INT32_MAX +sql_error create stream streams1 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 into streamt as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(1); +sql_error create stream streams1 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 into streamt as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(2147483648); + +sql create stream streams2 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 10s into streamt2 as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(2); +sql create stream streams3 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 10s into streamt3 as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(2147483647); + +print count1 end +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/stream/count2.sim b/tests/script/tsim/stream/count2.sim new file mode 100644 index 0000000000..2558bd1072 --- /dev/null +++ b/tests/script/tsim/stream/count2.sim @@ -0,0 +1,302 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +print step1 +print =============== create database +sql create database test vgroups 1; +sql use test; + +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams1 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 100s into streamt as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(3); +sleep 1000 + +sql insert into t1 values(1648791213001,9,2,2,1.1); +sql insert into t1 values(1648791213009,0,3,3,1.0); + +$loop_count = 0 +loop0: + +sleep 300 +print 0 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $data01 != 2 then + print ======data01=$data01 + goto loop0 +endi + +sql insert into t1 values(1648791213000,0,1,1,1.0); + +$loop_count = 0 +loop1: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 + +if $rows != 1 then + print ======rows=$rows + goto loop1 +endi + +if $data01 != 3 then + print ======data01=$data01 + goto loop1 +endi + +sql insert into t1 values(1648791223000,0,1,1,1.0); +sql insert into t1 values(1648791223001,9,2,2,1.1); +sql insert into t1 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop2: + +sleep 300 +print 2 sql select * from streamt order by 1; +sql select * from streamt order by 1; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 2 then + print ======rows=$rows + goto loop2 +endi + +sql insert into t1 values(1648791212000,0,1,1,1.0); + +$loop_count = 0 +loop3: + +sleep 300 +print 3 sql select * from streamt order by 1; +sql select * from streamt order by 1; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 3 then + print ======rows=$rows + goto loop3 +endi + +if $data01 != 3 then + print ======data01=$data01 + goto loop3 +endi + +if $data11 != 3 then + print ======data11=$data11 + goto loop3 +endi + +if $data21 != 1 then + print ======data21=$data21 + goto loop3 +endi + +print step2 +print =============== create database +sql create database test2 vgroups 1; +sql use test2; + +sql create stable st(ts timestamp, a int, b int , c int, d double) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); +sql create stream streams2 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 100s into streamt2 as select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(3) +sleep 1000 + + +sql insert into t1 values(1648791213001,9,2,2,1.1); +sql insert into t1 values(1648791213009,0,3,3,1.0); + +sql insert into t2 values(1648791213001,9,2,2,1.1); +sql insert into t2 values(1648791213009,0,3,3,1.0); + +$loop_count = 0 +loop4: + +sleep 300 +print 0 sql select * from streamt2 order by 1;; +sql select * from streamt2 order by 1;; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $data01 != 2 then + print ======data01=$data01 + goto loop4 +endi + +if $data11 != 2 then + print ======data11=$data11 + goto loop4 +endi + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sql insert into t2 values(1648791213000,0,1,1,1.0); + +$loop_count = 0 +loop5: + +sleep 300 +print 1 sql select * from streamt2 order by 1;; +sql select * from streamt2 order by 1;; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 + +if $rows != 2 then + print ======rows=$rows + goto loop5 +endi + +if $data01 != 3 then + print ======data01=$data01 + goto loop5 +endi + +if $data11 != 3 then + print ======data11=$data11 + goto loop5 +endi + +sql insert into t1 values(1648791223000,0,1,1,1.0); +sql insert into t1 values(1648791223001,9,2,2,1.1); +sql insert into t1 values(1648791223009,0,3,3,1.0); + +sql insert into t2 values(1648791223000,0,1,1,1.0); +sql insert into t2 values(1648791223001,9,2,2,1.1); +sql insert into t2 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop6: + +sleep 300 +print 2 sql select * from streamt2 order by 1; +sql select * from streamt2 order by 1; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 4 then + print ======rows=$rows + goto loop6 +endi + +sql insert into t1 values(1648791212000,0,1,1,1.0); +sql insert into t2 values(1648791212000,0,1,1,1.0); + +$loop_count = 0 +loop7: + +sleep 300 +print 3 sql select * from streamt2 order by 1; +sql select * from streamt2 order by 1; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 6 then + print ======rows=$rows + goto loop7 +endi + +if $data01 != 3 then + print ======data01=$data01 + goto loop7 +endi + +if $data11 != 3 then + print ======data11=$data11 + goto loop7 +endi + +if $data21 != 3 then + print ======data21=$data21 + goto loop7 +endi + +if $data31 != 3 then + print ======data31=$data31 + goto loop7 +endi + +if $data41 != 1 then + print ======data41=$data41 + goto loop7 +endi + +if $data51 != 1 then + print ======data51=$data51 + goto loop7 +endi + +print count2 end +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/stream/count3.sim b/tests/script/tsim/stream/count3.sim new file mode 100644 index 0000000000..f04996cdaa --- /dev/null +++ b/tests/script/tsim/stream/count3.sim @@ -0,0 +1,116 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +print step1 +print =============== create database +sql create database test vgroups 1; +sql use test; + +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams1 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 100s into streamt as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(3); +sleep 1000 + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sql insert into t1 values(1648791213001,9,2,2,1.1); +sql insert into t1 values(1648791213009,0,3,3,1.0); + +sql insert into t1 values(1648791223000,0,1,1,1.0); +sql insert into t1 values(1648791223001,9,2,2,1.1); +sql insert into t1 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop2: + +sleep 300 +print 2 sql select * from streamt order by 1; +sql select * from streamt order by 1; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 2 then + print ======rows=$rows + goto loop2 +endi + +sql insert into t1 values(1648791213000,4,4,4,4.0); + +$loop_count = 0 +loop3: + +sleep 300 +print 3 sql select * from streamt order by 1; +sql select * from streamt order by 1; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 2 then + print ======rows=$rows + goto loop3 +endi + +if $data01 != 3 then + print ======data01=$data01 + goto loop3 +endi + +if $data11 != 3 then + print ======data11=$data11 + goto loop3 +endi + +sql delete from t1 where ts = 1648791223001; + +$loop_count = 0 +loop4: + +sleep 300 +print 3 sql select * from streamt order by 1; +sql select * from streamt order by 1; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 2 then + print ======rows=$rows + goto loop4 +endi + +if $data01 != 3 then + print ======data01=$data01 + goto loop4 +endi + +if $data11 != 2 then + print ======data11=$data11 + goto loop4 +endi + + +print count3 end +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/stream/countSliding0.sim b/tests/script/tsim/stream/countSliding0.sim new file mode 100644 index 0000000000..82c54649b2 --- /dev/null +++ b/tests/script/tsim/stream/countSliding0.sim @@ -0,0 +1,463 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +print step1 +print =============== create database +sql create database test vgroups 1; +sql use test; + +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams1 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 100s into streamt as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); +sleep 1000 + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sleep 100 +sql insert into t1 values(1648791213001,9,2,2,1.1); +sleep 100 +sql insert into t1 values(1648791213002,0,3,3,1.0); +sleep 100 +sql insert into t1 values(1648791213009,0,3,3,1.0); + +$loop_count = 0 +loop0: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 2 then + print ======rows=$rows + goto loop0 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop0 +endi + +# row 1 +if $data11 != 2 then + print ======data11=$data11 + goto loop0 +endi + +sql insert into t1 values(1648791223000,0,1,1,1.0); +sleep 100 +sql insert into t1 values(1648791223001,9,2,2,1.1); +sleep 100 +sql insert into t1 values(1648791223002,9,2,2,1.1); +sleep 100 +sql insert into t1 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop2: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 4 then + print ======rows=$rows + goto loop2 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop2 +endi + +# row 1 +if $data11 != 4 then + print ======data11=$data11 + goto loop2 +endi + +# row 2 +if $data21 != 4 then + print ======data21=$data21 + goto loop2 +endi + +# row 3 +if $data31 != 2 then + print ======data31=$data31 + goto loop2 +endi + +sql insert into t1 values(1648791233000,0,1,1,1.0) (1648791233001,9,2,2,1.1) (1648791233002,9,2,2,1.1) (1648791233009,0,3,3,1.0); + +$loop_count = 0 +loop3: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 6 then + print ======rows=$rows + goto loop3 +endi + + +sql insert into t1 values(1648791243000,0,1,1,1.0) (1648791243001,9,2,2,1.1); + +$loop_count = 0 +loop4: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 7 then + print ======rows=$rows + goto loop4 +endi + +sql insert into t1 values(1648791253000,0,1,1,1.0) (1648791253001,9,2,2,1.1) (1648791253002,9,2,2,1.1); + +$loop_count = 0 +loop5: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 +print $data80 $data81 $data82 $data83 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 9 then + print ======rows=$rows + goto loop5 +endi + +sql insert into t1 values(1648791263000,0,1,1,1.0); + +$loop_count = 0 +loop6: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 +print $data80 $data81 $data82 $data83 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 9 then + print ======rows=$rows + goto loop6 +endi + + + +print step2 +print =============== create database +sql create database test2 vgroups 4; +sql use test2; + +sql create stable st(ts timestamp, a int, b int , c int, d double) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); +sql create stream streams2 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 100s into streamt2 as select _wstart as s, count(*) c1, sum(b), max(c) from st partition by tbname count_window(4, 2); +sleep 1000 + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sleep 100 +sql insert into t1 values(1648791213001,9,2,2,1.1); +sleep 100 +sql insert into t1 values(1648791213002,0,3,3,1.0); +sleep 100 +sql insert into t1 values(1648791213009,0,3,3,1.0); + +$loop_count = 0 +loop7: + +sleep 300 +print 1 sql select * from streamt2; +sql select * from streamt2; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 2 then + print ======rows=$rows + goto loop7 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop7 +endi + +# row 1 +if $data11 != 2 then + print ======data11=$data11 + goto loop7 +endi + +sql insert into t1 values(1648791223000,0,1,1,1.0); +sleep 100 +sql insert into t1 values(1648791223001,9,2,2,1.1); +sleep 100 +sql insert into t1 values(1648791223002,9,2,2,1.1); +sleep 100 +sql insert into t1 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop8: + +sleep 300 +print 1 sql select * from streamt2; +sql select * from streamt2; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 4 then + print ======rows=$rows + goto loop8 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop8 +endi + +# row 1 +if $data11 != 4 then + print ======data11=$data11 + goto loop8 +endi + +# row 2 +if $data21 != 4 then + print ======data21=$data21 + goto loop8 +endi + +# row 3 +if $data31 != 2 then + print ======data31=$data31 + goto loop8 +endi + +sql insert into t1 values(1648791233000,0,1,1,1.0) (1648791233001,9,2,2,1.1) (1648791233002,9,2,2,1.1) (1648791233009,0,3,3,1.0); + +$loop_count = 0 +loop9: + +sleep 300 +print 1 sql select * from streamt2; +sql select * from streamt2; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 6 then + print ======rows=$rows + goto loop9 +endi + + +sql insert into t1 values(1648791243000,0,1,1,1.0) (1648791243001,9,2,2,1.1); + +$loop_count = 0 +loop10: + +sleep 300 +print 1 sql select * from streamt2; +sql select * from streamt2; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 7 then + print ======rows=$rows + goto loop10 +endi + +sql insert into t1 values(1648791253000,0,1,1,1.0) (1648791253001,9,2,2,1.1) (1648791253002,9,2,2,1.1); + +$loop_count = 0 +loop11: + +sleep 300 +print 1 sql select * from streamt2; +sql select * from streamt2; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 +print $data80 $data81 $data82 $data83 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 9 then + print ======rows=$rows + goto loop11 +endi + +sql insert into t1 values(1648791263000,0,1,1,1.0); + +$loop_count = 0 +loop12: + +sleep 300 +print 1 sql select * from streamt2; +sql select * from streamt2; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 +print $data40 $data41 $data42 $data43 +print $data50 $data51 $data52 $data53 +print $data60 $data61 $data62 $data63 +print $data70 $data71 $data72 $data73 +print $data80 $data81 $data82 $data83 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 9 then + print ======rows=$rows + goto loop12 +endi +print count sliding 0 end +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/stream/countSliding1.sim b/tests/script/tsim/stream/countSliding1.sim new file mode 100644 index 0000000000..6759ab7abd --- /dev/null +++ b/tests/script/tsim/stream/countSliding1.sim @@ -0,0 +1,181 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +print step1 +print =============== create database +sql create database test vgroups 1; +sql use test; + +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams1 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 100s into streamt as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); +sleep 1000 + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sleep 100 +sql insert into t1 values(1648791213001,9,2,2,1.1); +sleep 100 +sql insert into t1 values(1648791213002,0,3,3,1.0); +sleep 100 +sql insert into t1 values(1648791213009,0,3,3,1.0); +sleep 100 +sql insert into t1 values(1648791223000,0,1,1,1.0); +sleep 100 +sql insert into t1 values(1648791223001,9,2,2,1.1); +sleep 100 +sql insert into t1 values(1648791223002,9,2,2,1.1); +sleep 100 +sql insert into t1 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop0: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 4 then + print ======rows=$rows + goto loop0 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop0 +endi + +# row 1 +if $data11 != 4 then + print ======data11=$data11 + goto loop0 +endi + +# row 2 +if $data21 != 4 then + print ======data21=$data21 + goto loop0 +endi + +# row 3 +if $data31 != 2 then + print ======data31=$data31 + goto loop0 +endi + +sql insert into t1 values(1648791213000,0,1,1,1.0); + + +$loop_count = 0 +loop1: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 4 then + print ======rows=$rows + goto loop1 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop1 +endi + +# row 1 +if $data11 != 4 then + print ======data11=$data11 + goto loop1 +endi + +# row 2 +if $data21 != 4 then + print ======data21=$data21 + goto loop1 +endi + +# row 3 +if $data31 != 2 then + print ======data31=$data31 + goto loop1 +endi + +sleep 500 +sql insert into t1 values(1648791223002,9,2,2,1.1); + + +$loop_count = 0 +loop2: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 4 then + print ======rows=$rows + goto loop2 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop2 +endi + +# row 1 +if $data11 != 4 then + print ======data11=$data11 + goto loop2 +endi + +# row 2 +if $data21 != 4 then + print ======data21=$data21 + goto loop2 +endi + +# row 3 +if $data31 != 2 then + print ======data31=$data31 + goto loop2 +endi + +print count sliding 1 end +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/stream/countSliding2.sim b/tests/script/tsim/stream/countSliding2.sim new file mode 100644 index 0000000000..8841283c81 --- /dev/null +++ b/tests/script/tsim/stream/countSliding2.sim @@ -0,0 +1,175 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +print step1 +print =============== create database +sql create database test vgroups 1; +sql use test; + +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams1 trigger at_once IGNORE EXPIRED 1 IGNORE UPDATE 0 WATERMARK 100s into streamt as select _wstart as s, count(*) c1, sum(b), max(c) from t1 count_window(4, 2); +sleep 1000 + +sql insert into t1 values(1648791213000,0,1,1,1.0); +sleep 100 +sql insert into t1 values(1648791213001,9,2,2,1.1); +sleep 100 +sql insert into t1 values(1648791213002,0,3,3,1.0); +sleep 100 +sql insert into t1 values(1648791213009,0,3,3,1.0); +sleep 100 +sql insert into t1 values(1648791223000,0,1,1,1.0); +sleep 100 +sql insert into t1 values(1648791223001,9,2,2,1.1); +sleep 100 +sql insert into t1 values(1648791223002,9,2,2,1.1); +sleep 100 +sql insert into t1 values(1648791223009,0,3,3,1.0); + +$loop_count = 0 +loop0: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 4 then + print ======rows=$rows + goto loop0 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop0 +endi + +# row 1 +if $data11 != 4 then + print ======data11=$data11 + goto loop0 +endi + +# row 2 +if $data21 != 4 then + print ======data21=$data21 + goto loop0 +endi + +# row 3 +if $data31 != 2 then + print ======data31=$data31 + goto loop0 +endi + +sql delete from t1 where ts = 1648791213000; + + +$loop_count = 0 +loop1: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 4 then + print ======rows=$rows + goto loop1 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop1 +endi + +# row 1 +if $data11 != 4 then + print ======data11=$data11 + goto loop1 +endi + +# row 2 +if $data21 != 3 then + print ======data21=$data21 + goto loop1 +endi + +# row 3 +if $data31 != 1 then + print ======data31=$data31 + goto loop1 +endi + +sleep 500 +sql delete from t1 where ts = 1648791223002; + + +$loop_count = 0 +loop2: + +sleep 300 +print 1 sql select * from streamt; +sql select * from streamt; + +print $data00 $data01 $data02 $data03 +print $data10 $data11 $data12 $data13 +print $data20 $data21 $data22 $data23 +print $data30 $data31 $data32 $data33 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 3 then + print ======rows=$rows + goto loop2 +endi + +# row 0 +if $data01 != 4 then + print ======data01=$data01 + goto loop2 +endi + +# row 1 +if $data11 != 4 then + print ======data11=$data11 + goto loop2 +endi + +# row 2 +if $data21 != 2 then + print ======data21=$data21 + goto loop2 +endi + +print count sliding 1 end +system sh/exec.sh -n dnode1 -s stop -x SIGINT