diff --git a/docs/en/14-reference/06-taosdump.md b/docs/en/14-reference/06-taosdump.md index 5403e40925..96e68d0edb 100644 --- a/docs/en/14-reference/06-taosdump.md +++ b/docs/en/14-reference/06-taosdump.md @@ -36,6 +36,8 @@ There are two ways to install taosdump: :::tip - taosdump versions after 1.4.1 provide the `-I` argument for parsing Avro file schema and data. If users specify `-s` then only taosdump will parse schema. - Backups after taosdump 1.4.2 use the batch count specified by the `-B` parameter. The default value is 16384. If, in some environments, low network speed or disk performance causes "Error actual dump ... batch ...", then try changing the `-B` parameter to a smaller value. +- The export of taosdump does not support resuming from an interruption. Therefore, if the taosdump process terminates unexpectedly, delete all related files that have been exported or generated. +- The import of taosdump supports resuming from an interruption, but when the process resumes, you will receive some "table already exists" messages, which could be ignored. ::: diff --git a/docs/zh/14-reference/06-taosdump.md b/docs/zh/14-reference/06-taosdump.md index 3a9f2e9acd..95ee20bfba 100644 --- a/docs/zh/14-reference/06-taosdump.md +++ b/docs/zh/14-reference/06-taosdump.md @@ -39,6 +39,8 @@ taosdump 有两种安装方式: :::tip - taosdump 1.4.1 之后的版本提供 `-I` 参数,用于解析 avro 文件 schema 和数据,如果指定 `-s` 参数将只解析 schema。 - taosdump 1.4.2 之后的备份使用 `-B` 参数指定的批次数,默认值为 16384,如果在某些环境下由于网络速度或磁盘性能不足导致 "Error actual dump .. batch .." 可以通过 `-B` 参数调整为更小的值进行尝试。 +- taosdump 的导出不支持中断恢复,所以当进程意外终止后,正确的处理方式是删除当前已导出或生成的所有相关文件。 +- taosdump 的导入支持中断恢复,但是当进程重新启动时,会收到一些“表已经存在”的提示,可以忽视。 ::: diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 857a554f62..2a29d9b7c7 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1817,6 +1817,8 @@ typedef struct SVCreateTbReq { tb_uid_t uid; int64_t ctime; int32_t ttl; + int32_t commentLen; + char* comment; int8_t type; union { struct { @@ -1834,6 +1836,7 @@ int tDecodeSVCreateTbReq(SDecoder* pCoder, SVCreateTbReq* pReq); static FORCE_INLINE void tdDestroySVCreateTbReq(SVCreateTbReq* req) { taosMemoryFreeClear(req->name); + taosMemoryFreeClear(req->comment); if (req->type == TSDB_CHILD_TABLE) { taosMemoryFreeClear(req->ctb.pTag); } else if (req->type == TSDB_NORMAL_TABLE) { @@ -1930,7 +1933,7 @@ typedef struct { // TSDB_ALTER_TABLE_UPDATE_OPTIONS int8_t updateTTL; int32_t newTTL; - int8_t updateComment; + int32_t newCommentLen; char* newComment; } SVAlterTbReq; diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index f89f548fc5..1b640642d7 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -198,7 +198,7 @@ enum { TD_DEF_MSG_TYPE(TDMT_VND_ALTER_CONFIRM, "alter-confirm", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_ALTER_HASHRANGE, "alter-hashrange", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_COMPACT, "compact", NULL, NULL) - + TD_DEF_MSG_TYPE(TDMT_VND_DROP_TTL_TABLE, "drop-ttl-stb", NULL, NULL) TD_NEW_MSG_SEG(TDMT_QND_MSG) //shared by snode and vnode diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 1edfcbabad..35b4a5ce7d 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -156,104 +156,107 @@ #define TK_SNODES 138 #define TK_CLUSTER 139 #define TK_TRANSACTIONS 140 -#define TK_LIKE 141 -#define TK_INDEX 142 -#define TK_FULLTEXT 143 -#define TK_FUNCTION 144 -#define TK_INTERVAL 145 -#define TK_TOPIC 146 -#define TK_AS 147 -#define TK_CONSUMER 148 -#define TK_GROUP 149 -#define TK_DESC 150 -#define TK_DESCRIBE 151 -#define TK_RESET 152 -#define TK_QUERY 153 -#define TK_CACHE 154 -#define TK_EXPLAIN 155 -#define TK_ANALYZE 156 -#define TK_VERBOSE 157 -#define TK_NK_BOOL 158 -#define TK_RATIO 159 -#define TK_NK_FLOAT 160 -#define TK_COMPACT 161 -#define TK_VNODES 162 -#define TK_IN 163 -#define TK_OUTPUTTYPE 164 -#define TK_AGGREGATE 165 -#define TK_BUFSIZE 166 -#define TK_STREAM 167 -#define TK_INTO 168 -#define TK_TRIGGER 169 -#define TK_AT_ONCE 170 -#define TK_WINDOW_CLOSE 171 -#define TK_KILL 172 -#define TK_CONNECTION 173 -#define TK_TRANSACTION 174 -#define TK_BALANCE 175 -#define TK_VGROUP 176 -#define TK_MERGE 177 -#define TK_REDISTRIBUTE 178 -#define TK_SPLIT 179 -#define TK_SYNCDB 180 -#define TK_DELETE 181 -#define TK_NULL 182 -#define TK_NK_QUESTION 183 -#define TK_NK_ARROW 184 -#define TK_ROWTS 185 -#define TK_TBNAME 186 -#define TK_QSTARTTS 187 -#define TK_QENDTS 188 -#define TK_WSTARTTS 189 -#define TK_WENDTS 190 -#define TK_WDURATION 191 -#define TK_CAST 192 -#define TK_NOW 193 -#define TK_TODAY 194 -#define TK_TIMEZONE 195 -#define TK_COUNT 196 -#define TK_LAST_ROW 197 -#define TK_BETWEEN 198 -#define TK_IS 199 -#define TK_NK_LT 200 -#define TK_NK_GT 201 -#define TK_NK_LE 202 -#define TK_NK_GE 203 -#define TK_NK_NE 204 -#define TK_MATCH 205 -#define TK_NMATCH 206 -#define TK_CONTAINS 207 -#define TK_JOIN 208 -#define TK_INNER 209 -#define TK_SELECT 210 -#define TK_DISTINCT 211 -#define TK_WHERE 212 -#define TK_PARTITION 213 -#define TK_BY 214 -#define TK_SESSION 215 -#define TK_STATE_WINDOW 216 -#define TK_SLIDING 217 -#define TK_FILL 218 -#define TK_VALUE 219 -#define TK_NONE 220 -#define TK_PREV 221 -#define TK_LINEAR 222 -#define TK_NEXT 223 -#define TK_HAVING 224 -#define TK_ORDER 225 -#define TK_SLIMIT 226 -#define TK_SOFFSET 227 -#define TK_LIMIT 228 -#define TK_OFFSET 229 -#define TK_ASC 230 -#define TK_NULLS 231 -#define TK_ID 232 -#define TK_NK_BITNOT 233 -#define TK_INSERT 234 -#define TK_VALUES 235 -#define TK_IMPORT 236 -#define TK_NK_SEMI 237 -#define TK_FILE 238 +#define TK_DISTRIBUTED 141 +#define TK_LIKE 142 +#define TK_INDEX 143 +#define TK_FULLTEXT 144 +#define TK_FUNCTION 145 +#define TK_INTERVAL 146 +#define TK_TOPIC 147 +#define TK_AS 148 +#define TK_CONSUMER 149 +#define TK_GROUP 150 +#define TK_DESC 151 +#define TK_DESCRIBE 152 +#define TK_RESET 153 +#define TK_QUERY 154 +#define TK_CACHE 155 +#define TK_EXPLAIN 156 +#define TK_ANALYZE 157 +#define TK_VERBOSE 158 +#define TK_NK_BOOL 159 +#define TK_RATIO 160 +#define TK_NK_FLOAT 161 +#define TK_COMPACT 162 +#define TK_VNODES 163 +#define TK_IN 164 +#define TK_OUTPUTTYPE 165 +#define TK_AGGREGATE 166 +#define TK_BUFSIZE 167 +#define TK_STREAM 168 +#define TK_INTO 169 +#define TK_TRIGGER 170 +#define TK_AT_ONCE 171 +#define TK_WINDOW_CLOSE 172 +#define TK_KILL 173 +#define TK_CONNECTION 174 +#define TK_TRANSACTION 175 +#define TK_BALANCE 176 +#define TK_VGROUP 177 +#define TK_MERGE 178 +#define TK_REDISTRIBUTE 179 +#define TK_SPLIT 180 +#define TK_SYNCDB 181 +#define TK_DELETE 182 +#define TK_NULL 183 +#define TK_NK_QUESTION 184 +#define TK_NK_ARROW 185 +#define TK_ROWTS 186 +#define TK_TBNAME 187 +#define TK_QSTARTTS 188 +#define TK_QENDTS 189 +#define TK_WSTARTTS 190 +#define TK_WENDTS 191 +#define TK_WDURATION 192 +#define TK_CAST 193 +#define TK_NOW 194 +#define TK_TODAY 195 +#define TK_TIMEZONE 196 +#define TK_COUNT 197 +#define TK_LAST_ROW 198 +#define TK_BETWEEN 199 +#define TK_IS 200 +#define TK_NK_LT 201 +#define TK_NK_GT 202 +#define TK_NK_LE 203 +#define TK_NK_GE 204 +#define TK_NK_NE 205 +#define TK_MATCH 206 +#define TK_NMATCH 207 +#define TK_CONTAINS 208 +#define TK_JOIN 209 +#define TK_INNER 210 +#define TK_SELECT 211 +#define TK_DISTINCT 212 +#define TK_WHERE 213 +#define TK_PARTITION 214 +#define TK_BY 215 +#define TK_SESSION 216 +#define TK_STATE_WINDOW 217 +#define TK_SLIDING 218 +#define TK_FILL 219 +#define TK_VALUE 220 +#define TK_NONE 221 +#define TK_PREV 222 +#define TK_LINEAR 223 +#define TK_NEXT 224 +#define TK_HAVING 225 +#define TK_RANGE 226 +#define TK_EVERY 227 +#define TK_ORDER 228 +#define TK_SLIMIT 229 +#define TK_SOFFSET 230 +#define TK_LIMIT 231 +#define TK_OFFSET 232 +#define TK_ASC 233 +#define TK_NULLS 234 +#define TK_ID 235 +#define TK_NK_BITNOT 236 +#define TK_INSERT 237 +#define TK_VALUES 238 +#define TK_IMPORT 239 +#define TK_NK_SEMI 240 +#define TK_FILE 241 #define TK_NK_SPACE 300 #define TK_NK_COMMENT 301 diff --git a/include/libs/catalog/catalog.h b/include/libs/catalog/catalog.h index c0116051af..a7ac767883 100644 --- a/include/libs/catalog/catalog.h +++ b/include/libs/catalog/catalog.h @@ -87,7 +87,7 @@ typedef struct SMetaData { SArray* pUdfList; // pRes = SFuncInfo* SArray* pIndex; // pRes = SIndexInfo* SArray* pUser; // pRes = bool* - SArray* pQnodeList; // pRes = SQueryNodeAddr* + SArray* pQnodeList; // pRes = SArray* } SMetaData; typedef struct SCatalogCfg { diff --git a/include/libs/function/functionMgt.h b/include/libs/function/functionMgt.h index 8e003eea7f..cbaff29cb2 100644 --- a/include/libs/function/functionMgt.h +++ b/include/libs/function/functionMgt.h @@ -121,7 +121,8 @@ typedef enum EFunctionType { // internal function FUNCTION_TYPE_SELECT_VALUE, - FUNCTION_TYPE_BLOCK_DIST, // block distribution aggregate function + FUNCTION_TYPE_BLOCK_DIST, // block distribution aggregate function + FUNCTION_TYPE_BLOCK_DIST_INFO, // block distribution pseudo column function // distributed splitting functions FUNCTION_TYPE_APERCENTILE_PARTIAL = 4000, @@ -188,6 +189,7 @@ bool fmIsForbidStreamFunc(int32_t funcId); bool fmIsForbidWindowFunc(int32_t funcId); bool fmIsForbidGroupByFunc(int32_t funcId); bool fmIsIntervalInterpoFunc(int32_t funcId); +bool fmIsInterpFunc(int32_t funcId); int32_t fmGetDistMethod(const SFunctionNode* pFunc, SFunctionNode** pPartialFunc, SFunctionNode** pMergeFunc); diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 087d252ed7..13a8dbd7e3 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -87,6 +87,7 @@ typedef struct SAlterDatabaseStmt { typedef struct STableOptions { ENodeType type; + bool commentNull; char comment[TSDB_TB_COMMENT_LEN]; SNodeList* pMaxDelay; int64_t maxDelay1; @@ -126,6 +127,7 @@ typedef struct SCreateSubTableClause { bool ignoreExists; SNodeList* pSpecificTags; SNodeList* pValsOfTags; + STableOptions* pOptions; } SCreateSubTableClause; typedef struct SCreateMultiTableStmt { @@ -203,9 +205,10 @@ typedef struct SAlterDnodeStmt { } SAlterDnodeStmt; typedef struct SShowStmt { - ENodeType type; - SNode* pDbName; // SValueNode - SNode* pTbNamePattern; // SValueNode + ENodeType type; + SNode* pDbName; // SValueNode + SNode* pTbName; // SValueNode + EOperatorType tableCondType; } SShowStmt; typedef struct SShowCreateDatabaseStmt { @@ -221,6 +224,12 @@ typedef struct SShowCreateTableStmt { STableMeta* pMeta; } SShowCreateTableStmt; +typedef struct SShowTableDistributedStmt { + ENodeType type; + char dbName[TSDB_DB_NAME_LEN]; + char tableName[TSDB_TABLE_NAME_LEN]; +} SShowTableDistributedStmt; + typedef enum EIndexType { INDEX_TYPE_SMA = 1, INDEX_TYPE_FULLTEXT } EIndexType; typedef struct SIndexOptions { diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index 08190d978e..975321cd5b 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -185,6 +185,7 @@ typedef enum ENodeType { QUERY_NODE_SHOW_CREATE_TABLE_STMT, QUERY_NODE_SHOW_CREATE_STABLE_STMT, QUERY_NODE_SHOW_TRANSACTIONS_STMT, + QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT, QUERY_NODE_KILL_CONNECTION_STMT, QUERY_NODE_KILL_QUERY_STMT, QUERY_NODE_KILL_TRANSACTION_STMT, @@ -204,6 +205,7 @@ typedef enum ENodeType { QUERY_NODE_LOGIC_PLAN_SORT, QUERY_NODE_LOGIC_PLAN_PARTITION, QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC, + QUERY_NODE_LOGIC_PLAN_INTERP_FUNC, QUERY_NODE_LOGIC_SUBPLAN, QUERY_NODE_LOGIC_PLAN, @@ -214,6 +216,7 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN, QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN, QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN, + QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN, QUERY_NODE_PHYSICAL_PLAN_PROJECT, QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN, QUERY_NODE_PHYSICAL_PLAN_HASH_AGG, @@ -234,6 +237,7 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE, QUERY_NODE_PHYSICAL_PLAN_PARTITION, QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC, + QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC, QUERY_NODE_PHYSICAL_PLAN_DISPATCH, QUERY_NODE_PHYSICAL_PLAN_INSERT, QUERY_NODE_PHYSICAL_PLAN_DELETE, diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index a9002b5d19..38a179869f 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -39,7 +39,8 @@ typedef enum EScanType { SCAN_TYPE_TABLE, SCAN_TYPE_SYSTEM_TABLE, SCAN_TYPE_STREAM, - SCAN_TYPE_TABLE_MERGE + SCAN_TYPE_TABLE_MERGE, + SCAN_TYPE_BLOCK_INFO } EScanType; typedef struct SScanLogicNode { @@ -97,9 +98,16 @@ typedef struct SProjectLogicNode { typedef struct SIndefRowsFuncLogicNode { SLogicNode node; - SNodeList* pVectorFuncs; + SNodeList* pFuncs; } SIndefRowsFuncLogicNode; +typedef struct SInterpFuncLogicNode { + SLogicNode node; + SNodeList* pFuncs; + STimeWindow timeRange; + int64_t interval; +} SInterpFuncLogicNode; + typedef enum EModifyTableType { MODIFY_TABLE_TYPE_INSERT = 1, MODIFY_TABLE_TYPE_DELETE } EModifyTableType; typedef struct SVnodeModifyLogicNode { @@ -143,21 +151,22 @@ typedef enum EWindowAlgorithm { } EWindowAlgorithm; typedef struct SWindowLogicNode { - SLogicNode node; - EWindowType winType; - SNodeList* pFuncs; - int64_t interval; - int64_t offset; - int64_t sliding; - int8_t intervalUnit; - int8_t slidingUnit; - int64_t sessionGap; - SNode* pTspk; - SNode* pStateExpr; - int8_t triggerType; - int64_t watermark; - double filesFactor; - EWindowAlgorithm windowAlgo; + SLogicNode node; + EWindowType winType; + SNodeList* pFuncs; + int64_t interval; + int64_t offset; + int64_t sliding; + int8_t intervalUnit; + int8_t slidingUnit; + int64_t sessionGap; + SNode* pTspk; + SNode* pTsEnd; + SNode* pStateExpr; + int8_t triggerType; + int64_t watermark; + double filesFactor; + EWindowAlgorithm windowAlgo; } SWindowLogicNode; typedef struct SFillLogicNode { @@ -247,6 +256,7 @@ typedef struct SScanPhysiNode { } SScanPhysiNode; typedef SScanPhysiNode STagScanPhysiNode; +typedef SScanPhysiNode SBlockDistScanPhysiNode; typedef struct SSystemTableScanPhysiNode { SScanPhysiNode scan; @@ -290,9 +300,17 @@ typedef struct SProjectPhysiNode { typedef struct SIndefRowsFuncPhysiNode { SPhysiNode node; SNodeList* pExprs; - SNodeList* pVectorFuncs; + SNodeList* pFuncs; } SIndefRowsFuncPhysiNode; +typedef struct SInterpFuncPhysiNode { + SPhysiNode node; + SNodeList* pExprs; + SNodeList* pFuncs; + STimeWindow timeRange; + int64_t interval; +} SInterpFuncPhysiNode; + typedef struct SJoinPhysiNode { SPhysiNode node; EJoinType joinType; @@ -335,7 +353,8 @@ typedef struct SWinodwPhysiNode { SPhysiNode node; SNodeList* pExprs; // these are expression list of parameter expression of function SNodeList* pFuncs; - SNode* pTspk; // timestamp primary key + SNode* pTspk; // timestamp primary key + SNode* pTsEnd; // window end timestamp int8_t triggerType; int64_t watermark; double filesFactor; diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index 3a0d3178a3..73e487f073 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -240,6 +240,9 @@ typedef struct SSelectStmt { SNode* pWindow; SNodeList* pGroupByList; // SGroupingSetNode SNode* pHaving; + SNode* pRange; + SNode* pEvery; + SNode* pFill; SNodeList* pOrderByList; // SOrderByExprNode SLimitNode* pLimit; SLimitNode* pSlimit; @@ -254,6 +257,7 @@ typedef struct SSelectStmt { bool hasSelectValFunc; bool hasUniqueFunc; bool hasTailFunc; + bool hasInterpFunc; } SSelectStmt; typedef enum ESetOperatorType { SET_OP_TYPE_UNION_ALL = 1, SET_OP_TYPE_UNION } ESetOperatorType; diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h index b6a3a08f7e..d562d07d77 100644 --- a/include/libs/qcom/query.h +++ b/include/libs/qcom/query.h @@ -47,6 +47,10 @@ typedef enum { TARGET_TYPE_OTHER, } ETargetType; +#define QUERY_POLICY_VNODE 1 +#define QUERY_POLICY_HYBRID 2 +#define QUERY_POLICY_QNODE 3 + typedef struct STableComInfo { uint8_t numOfTags; // the number of tags in schema uint8_t precision; // the number of precision diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 280af6adb5..fde016375b 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -128,6 +128,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_TSC_STMT_TBNAME_ERROR TAOS_DEF_ERROR_CODE(0, 0X0226) #define TSDB_CODE_TSC_STMT_CLAUSE_ERROR TAOS_DEF_ERROR_CODE(0, 0X0227) #define TSDB_CODE_TSC_QUERY_KILLED TAOS_DEF_ERROR_CODE(0, 0X0228) +#define TSDB_CODE_TSC_NO_EXEC_NODE TAOS_DEF_ERROR_CODE(0, 0X0229) // mnode-common #define TSDB_CODE_MND_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x0300) diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h index 51a5b84a1c..c39b492620 100644 --- a/source/client/inc/clientInt.h +++ b/source/client/inc/clientInt.h @@ -22,6 +22,7 @@ extern "C" { #include "parser.h" #include "planner.h" +#include "catalog.h" #include "query.h" #include "taos.h" #include "tcommon.h" @@ -162,6 +163,7 @@ typedef struct SReqResultInfo { int32_t precision; bool convertUcs4; int32_t payloadLen; + char* convertJson; } SReqResultInfo; typedef struct SRequestSendRecvBody { @@ -242,6 +244,7 @@ static FORCE_INLINE SReqResultInfo* tmqGetNextResInfo(TAOS_RES* res, bool conver taosMemoryFreeClear(msg->resInfo.pCol); taosMemoryFreeClear(msg->resInfo.length); taosMemoryFreeClear(msg->resInfo.convertBuf); + taosMemoryFreeClear(msg->resInfo.convertJson); } setQueryResultFromRsp(&msg->resInfo, pRetrieve, convertUcs4, false); return &msg->resInfo; @@ -292,7 +295,7 @@ SRequestObj* launchQuery(STscObj* pTscObj, const char* sql, int sqlLen); int32_t parseSql(SRequestObj* pRequest, bool topicQuery, SQuery** pQuery, SStmtCallback* pStmtCb); -int32_t getPlan(SRequestObj* pRequest, SQuery* pQuery, SQueryPlan** pPlan, SArray** pNodeList); +int32_t getPlan(SRequestObj* pRequest, SQuery* pQuery, SQueryPlan** pPlan, SArray* pNodeList); int32_t buildRequest(STscObj* pTscObj, const char* sql, int sqlLen, SRequestObj** pRequest); @@ -317,12 +320,13 @@ void hbMgrInitMqHbRspHandle(); SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQuery, void** res); int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList); -void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery); +void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData *pResultMeta); int32_t refreshMeta(STscObj* pTscObj, SRequestObj* pRequest); int32_t updateQnodeList(SAppInstInfo* pInfo, SArray* pNodeList); void doAsyncQuery(SRequestObj* pRequest, bool forceUpdateMeta); int32_t removeMeta(STscObj* pTscObj, SArray* tbList);// todo move to clientImpl.c and become a static function int32_t handleAlterTbExecRes(void* res, struct SCatalog* pCatalog);// todo move to xxx +bool qnodeRequired(SRequestObj* pRequest); #ifdef __cplusplus } diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 78454268b7..9f04e89694 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -212,6 +212,7 @@ void doFreeReqResultInfo(SReqResultInfo *pResInfo) { taosMemoryFreeClear(pResInfo->pCol); taosMemoryFreeClear(pResInfo->fields); taosMemoryFreeClear(pResInfo->userFields); + taosMemoryFreeClear(pResInfo->convertJson); if (pResInfo->convertBuf != NULL) { for (int32_t i = 0; i < pResInfo->numOfCols; ++i) { diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 1af6c2d2da..ea8f58b05b 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -307,6 +307,21 @@ int32_t updateQnodeList(SAppInstInfo* pInfo, SArray* pNodeList) { return TSDB_CODE_SUCCESS; } +bool qnodeRequired(SRequestObj* pRequest) { + if (QUERY_POLICY_VNODE == tsQueryPolicy) { + return false; + } + + SAppInstInfo* pInfo = pRequest->pTscObj->pAppInfo; + bool required = false; + + taosThreadMutexLock(&pInfo->qnodeMutex); + required = (NULL == pInfo->pQnodeList); + taosThreadMutexUnlock(&pInfo->qnodeMutex); + + return required; +} + int32_t getQnodeList(SRequestObj* pRequest, SArray** pNodeList) { SAppInstInfo* pInfo = pRequest->pTscObj->pAppInfo; int32_t code = 0; @@ -337,7 +352,7 @@ int32_t getQnodeList(SRequestObj* pRequest, SArray** pNodeList) { return code; } -int32_t getPlan(SRequestObj* pRequest, SQuery* pQuery, SQueryPlan** pPlan, SArray** pNodeList) { +int32_t getPlan(SRequestObj* pRequest, SQuery* pQuery, SQueryPlan** pPlan, SArray* pNodeList) { pRequest->type = pQuery->msgType; SAppInstInfo* pAppInfo = getAppInfo(pRequest); @@ -349,12 +364,7 @@ int32_t getPlan(SRequestObj* pRequest, SQuery* pQuery, SQueryPlan** pPlan, SArra .pMsg = pRequest->msgBuf, .msgLen = ERROR_MSG_BUF_DEFAULT_SIZE}; - int32_t code = getQnodeList(pRequest, pNodeList); - if (TSDB_CODE_SUCCESS == code) { - code = qCreateQueryPlan(&cxt, pPlan, *pNodeList); - } - - return code; + return qCreateQueryPlan(&cxt, pPlan, pNodeList); } void setResSchemaInfo(SReqResultInfo* pResInfo, const SSchema* pSchema, int32_t numOfCols) { @@ -397,6 +407,195 @@ void setResPrecision(SReqResultInfo* pResInfo, int32_t precision) { pResInfo->precision = precision; } +int32_t buildVnodePolicyNodeList(SRequestObj* pRequest, SArray** pNodeList, SArray* pMnodeList, SArray* pDbVgList) { + SArray* nodeList = taosArrayInit(4, sizeof(SQueryNodeLoad)); + + int32_t dbNum = taosArrayGetSize(pDbVgList); + for (int32_t i = 0; i < dbNum; ++i) { + SArray* pVg = taosArrayGetP(pDbVgList, i); + int32_t vgNum = taosArrayGetSize(pVg); + if (vgNum <= 0) { + continue; + } + + for (int32_t j = 0; j < vgNum; ++j) { + SVgroupInfo* pInfo = taosArrayGet(pVg, j); + SQueryNodeLoad load = {0}; + load.addr.nodeId = pInfo->vgId; + load.addr.epSet = pInfo->epSet; + + taosArrayPush(nodeList, &load); + } + } + + int32_t vnodeNum = taosArrayGetSize(nodeList); + if (vnodeNum > 0) { + tscDebug("0x%" PRIx64 " vnode policy, use vnode list, num:%d", pRequest->requestId, vnodeNum); + goto _return; + } + + int32_t mnodeNum = taosArrayGetSize(pMnodeList); + if (mnodeNum <= 0) { + tscDebug("0x%" PRIx64 " vnode policy, empty node list", pRequest->requestId); + goto _return; + } + + void* pData = taosArrayGet(pMnodeList, 0); + taosArrayAddBatch(nodeList, pData, mnodeNum); + + tscDebug("0x%" PRIx64 " vnode policy, use mnode list, num:%d", pRequest->requestId, mnodeNum); + +_return: + + *pNodeList = nodeList; + + return TSDB_CODE_SUCCESS; +} + +int32_t buildQnodePolicyNodeList(SRequestObj* pRequest, SArray** pNodeList, SArray* pMnodeList, SArray* pQnodeList) { + SArray* nodeList = taosArrayInit(4, sizeof(SQueryNodeLoad)); + + int32_t qNodeNum = taosArrayGetSize(pQnodeList); + if (qNodeNum > 0) { + void* pData = taosArrayGet(pQnodeList, 0); + taosArrayAddBatch(nodeList, pData, qNodeNum); + tscDebug("0x%" PRIx64 " qnode policy, use qnode list, num:%d", pRequest->requestId, qNodeNum); + goto _return; + } + + int32_t mnodeNum = taosArrayGetSize(pMnodeList); + if (mnodeNum <= 0) { + tscDebug("0x%" PRIx64 " qnode policy, empty node list", pRequest->requestId); + goto _return; + } + + void* pData = taosArrayGet(pMnodeList, 0); + taosArrayAddBatch(nodeList, pData, mnodeNum); + + tscDebug("0x%" PRIx64 " qnode policy, use mnode list, num:%d", pRequest->requestId, mnodeNum); + +_return: + + *pNodeList = nodeList; + + return TSDB_CODE_SUCCESS; +} + + +int32_t buildAsyncExecNodeList(SRequestObj* pRequest, SArray** pNodeList, SArray* pMnodeList, SMetaData *pResultMeta) { + SArray* pDbVgList = NULL; + SArray* pQnodeList = NULL; + int32_t code = 0; + + switch (tsQueryPolicy) { + case QUERY_POLICY_VNODE: { + if (pResultMeta) { + pDbVgList = taosArrayInit(4, POINTER_BYTES); + + int32_t dbNum = taosArrayGetSize(pResultMeta->pDbVgroup); + for (int32_t i = 0; i < dbNum; ++i) { + SMetaRes* pRes = taosArrayGet(pResultMeta->pDbVgroup, i); + if (pRes->code || NULL == pRes->pRes) { + continue; + } + + taosArrayPush(pDbVgList, &pRes->pRes); + } + } + + code = buildVnodePolicyNodeList(pRequest, pNodeList, pMnodeList, pDbVgList); + break; + } + case QUERY_POLICY_HYBRID: + case QUERY_POLICY_QNODE: { + if (pResultMeta && taosArrayGetSize(pResultMeta->pQnodeList) > 0) { + SMetaRes* pRes = taosArrayGet(pResultMeta->pQnodeList, 0); + if (pRes->code) { + pQnodeList = NULL; + } else { + pQnodeList = taosArrayDup((SArray*)pRes->pRes); + } + } else { + SAppInstInfo* pInst = pRequest->pTscObj->pAppInfo; + taosThreadMutexLock(&pInst->qnodeMutex); + if (pInst->pQnodeList) { + pQnodeList = taosArrayDup(pInst->pQnodeList); + } + taosThreadMutexUnlock(&pInst->qnodeMutex); + } + + code = buildQnodePolicyNodeList(pRequest, pNodeList, pMnodeList, pQnodeList); + break; + } + default: + tscError("unknown query policy: %d", tsQueryPolicy); + return TSDB_CODE_TSC_APP_ERROR; + } + + taosArrayDestroy(pDbVgList); + taosArrayDestroy(pQnodeList); + + return code; +} + +int32_t buildSyncExecNodeList(SRequestObj* pRequest, SArray** pNodeList, SArray* pMnodeList) { + SArray* pDbVgList = NULL; + SArray* pQnodeList = NULL; + int32_t code = 0; + + switch (tsQueryPolicy) { + case QUERY_POLICY_VNODE: { + int32_t dbNum = taosArrayGetSize(pRequest->dbList); + if (dbNum > 0) { + SCatalog* pCtg = NULL; + SAppInstInfo* pInst = pRequest->pTscObj->pAppInfo; + code = catalogGetHandle(pInst->clusterId, &pCtg); + if (code != TSDB_CODE_SUCCESS) { + goto _return; + } + + pDbVgList = taosArrayInit(dbNum, POINTER_BYTES); + SArray* pVgList = NULL; + for (int32_t i = 0; i < dbNum; ++i) { + char* dbFName = taosArrayGet(pRequest->dbList, i); + SRequestConnInfo conn = {.pTrans = pInst->pTransporter, + .requestId = pRequest->requestId, + .requestObjRefId = pRequest->self, + .mgmtEps = getEpSet_s(&pInst->mgmtEp)}; + + code = catalogGetDBVgInfo(pCtg, &conn, dbFName, &pVgList); + if (code) { + goto _return; + } + + taosArrayPush(pDbVgList, &pVgList); + } + } + + code = buildVnodePolicyNodeList(pRequest, pNodeList, pMnodeList, pDbVgList); + break; + } + case QUERY_POLICY_HYBRID: + case QUERY_POLICY_QNODE: { + getQnodeList(pRequest, &pQnodeList); + + code = buildQnodePolicyNodeList(pRequest, pNodeList, pMnodeList, pQnodeList); + break; + } + default: + tscError("unknown query policy: %d", tsQueryPolicy); + return TSDB_CODE_TSC_APP_ERROR; + } + +_return: + + taosArrayDestroy(pDbVgList); + taosArrayDestroy(pQnodeList); + + return code; +} + + int32_t scheduleAsyncQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList) { tsem_init(&schdRspSem, 0, 0); @@ -658,12 +857,16 @@ SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQue code = execDdlQuery(pRequest, pQuery); break; case QUERY_EXEC_MODE_SCHEDULE: { - SArray* pNodeList = NULL; - code = getPlan(pRequest, pQuery, &pRequest->body.pDag, &pNodeList); + SArray* pMnodeList = taosArrayInit(4, sizeof(SQueryNodeLoad)); + code = getPlan(pRequest, pQuery, &pRequest->body.pDag, pMnodeList); if (TSDB_CODE_SUCCESS == code) { + SArray* pNodeList = NULL; + buildSyncExecNodeList(pRequest, &pNodeList, pMnodeList); + code = scheduleQuery(pRequest, pRequest->body.pDag, pNodeList); + taosArrayDestroy(pNodeList); } - taosArrayDestroy(pNodeList); + taosArrayDestroy(pMnodeList); break; } case QUERY_EXEC_MODE_EMPTY_RESULT: @@ -712,7 +915,7 @@ SRequestObj* launchQuery(STscObj* pTscObj, const char* sql, int sqlLen) { return launchQueryImpl(pRequest, pQuery, false, NULL); } -void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery) { +void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData *pResultMeta) { int32_t code = 0; switch (pQuery->execMode) { @@ -723,7 +926,7 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery) { code = asyncExecDdlQuery(pRequest, pQuery); break; case QUERY_EXEC_MODE_SCHEDULE: { - SArray* pNodeList = taosArrayInit(4, sizeof(SQueryNodeLoad)); + SArray* pMnodeList = taosArrayInit(4, sizeof(SQueryNodeLoad)); pRequest->type = pQuery->msgType; @@ -736,13 +939,16 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery) { .msgLen = ERROR_MSG_BUF_DEFAULT_SIZE}; SAppInstInfo* pAppInfo = getAppInfo(pRequest); - code = qCreateQueryPlan(&cxt, &pRequest->body.pDag, pNodeList); + code = qCreateQueryPlan(&cxt, &pRequest->body.pDag, pMnodeList); if (code) { tscError("0x%" PRIx64 " failed to create query plan, code:%s 0x%" PRIx64, pRequest->self, tstrerror(code), pRequest->requestId); } if (TSDB_CODE_SUCCESS == code) { + SArray* pNodeList = NULL; + buildAsyncExecNodeList(pRequest, &pNodeList, pMnodeList, pResultMeta); + SRequestConnInfo conn = { .pTrans = pAppInfo->pTransporter, .requestId = pRequest->requestId, .requestObjRefId = pRequest->self}; SSchedulerReq req = {.pConn = &conn, @@ -754,6 +960,7 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery) { .cbParam = pRequest, .reqKilled = &pRequest->killed}; code = schedulerAsyncExecJob(&req, &pRequest->body.queryJob); + taosArrayDestroy(pNodeList); } else { tscError("0x%" PRIx64 " failed to create query plan, code:%s 0x%" PRIx64, pRequest->self, tstrerror(code), pRequest->requestId); @@ -761,7 +968,7 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery) { } // todo not to be released here - taosArrayDestroy(pNodeList); + taosArrayDestroy(pMnodeList); break; } case QUERY_EXEC_MODE_EMPTY_RESULT: @@ -1339,67 +1546,6 @@ static int32_t doConvertUCS4(SReqResultInfo* pResultInfo, int32_t numOfRows, int } } - pResultInfo->pCol[i].pData = pResultInfo->convertBuf[i]; - pResultInfo->row[i] = pResultInfo->pCol[i].pData; - } else if (type == TSDB_DATA_TYPE_JSON && colLength[i] > 0) { - char* p = taosMemoryRealloc(pResultInfo->convertBuf[i], colLength[i]); - if (p == NULL) { - return TSDB_CODE_OUT_OF_MEMORY; - } - - pResultInfo->convertBuf[i] = p; - int32_t len = 0; - SResultColumn* pCol = &pResultInfo->pCol[i]; - for (int32_t j = 0; j < numOfRows; ++j) { - if (pCol->offset[j] != -1) { - char* pStart = pCol->offset[j] + pCol->pData; - - int32_t jsonInnerType = *pStart; - char* jsonInnerData = pStart + CHAR_BYTES; - char dst[TSDB_MAX_JSON_TAG_LEN] = {0}; - if (jsonInnerType == TSDB_DATA_TYPE_NULL) { - sprintf(varDataVal(dst), "%s", TSDB_DATA_NULL_STR_L); - varDataSetLen(dst, strlen(varDataVal(dst))); - } else if (jsonInnerType & TD_TAG_JSON) { - char* jsonString = parseTagDatatoJson(pStart); - STR_TO_VARSTR(dst, jsonString); - taosMemoryFree(jsonString); - } else if (jsonInnerType == TSDB_DATA_TYPE_NCHAR) { // value -> "value" - *(char*)varDataVal(dst) = '\"'; - int32_t length = taosUcs4ToMbs((TdUcs4*)varDataVal(jsonInnerData), varDataLen(jsonInnerData), - varDataVal(dst) + CHAR_BYTES); - if (length <= 0) { - tscError("charset:%s to %s. convert failed.", DEFAULT_UNICODE_ENCODEC, tsCharset); - length = 0; - } - varDataSetLen(dst, length + CHAR_BYTES * 2); - *(char*)POINTER_SHIFT(varDataVal(dst), length + CHAR_BYTES) = '\"'; - } else if (jsonInnerType == TSDB_DATA_TYPE_DOUBLE) { - double jsonVd = *(double*)(jsonInnerData); - sprintf(varDataVal(dst), "%.9lf", jsonVd); - varDataSetLen(dst, strlen(varDataVal(dst))); - } else if (jsonInnerType == TSDB_DATA_TYPE_BOOL) { - sprintf(varDataVal(dst), "%s", (*((char*)jsonInnerData) == 1) ? "true" : "false"); - varDataSetLen(dst, strlen(varDataVal(dst))); - } else { - ASSERT(0); - } - - if (len + varDataTLen(dst) > colLength[i]) { - p = taosMemoryRealloc(pResultInfo->convertBuf[i], len + varDataTLen(dst)); - if (p == NULL) { - return TSDB_CODE_OUT_OF_MEMORY; - } - - pResultInfo->convertBuf[i] = p; - } - p = pResultInfo->convertBuf[i] + len; - memcpy(p, dst, varDataTLen(dst)); - pCol->offset[j] = len; - len += varDataTLen(dst); - } - } - pResultInfo->pCol[i].pData = pResultInfo->convertBuf[i]; pResultInfo->row[i] = pResultInfo->pCol[i].pData; } @@ -1408,6 +1554,170 @@ static int32_t doConvertUCS4(SReqResultInfo* pResultInfo, int32_t numOfRows, int return TSDB_CODE_SUCCESS; } +static int32_t estimateJsonLen(SReqResultInfo* pResultInfo, int32_t numOfCols, int32_t numOfRows){ + char* p = (char*)pResultInfo->pData; + + int32_t len = sizeof(int32_t) + sizeof(uint64_t) + numOfCols * (sizeof(int16_t) + sizeof(int32_t)); + int32_t* colLength = (int32_t*)(p + len); + len += sizeof(int32_t) * numOfCols; + + char* pStart = p + len; + for (int32_t i = 0; i < numOfCols; ++i) { + int32_t colLen = htonl(colLength[i]); + + if (pResultInfo->fields[i].type == TSDB_DATA_TYPE_JSON) { + int32_t* offset = (int32_t*)pStart; + int32_t lenTmp = numOfRows * sizeof(int32_t); + len += lenTmp; + pStart += lenTmp; + + for (int32_t j = 0; j < numOfRows; ++j) { + if (offset[j] == -1) { + continue; + } + char* data = offset[j] + pStart; + + int32_t jsonInnerType = *data; + char* jsonInnerData = data + CHAR_BYTES; + if (jsonInnerType == TSDB_DATA_TYPE_NULL) { + len += (VARSTR_HEADER_SIZE + strlen(TSDB_DATA_NULL_STR_L)); + } else if (jsonInnerType & TD_TAG_JSON) { + len += (VARSTR_HEADER_SIZE + ((const STag*)(data))->len); + } else if (jsonInnerType == TSDB_DATA_TYPE_NCHAR) { // value -> "value" + len += varDataTLen(jsonInnerData) + CHAR_BYTES * 2; + } else if (jsonInnerType == TSDB_DATA_TYPE_DOUBLE) { + len += (VARSTR_HEADER_SIZE + 32); + } else if (jsonInnerType == TSDB_DATA_TYPE_BOOL) { + len += (VARSTR_HEADER_SIZE + 5); + } else { + ASSERT(0); + } + } + } else if (IS_VAR_DATA_TYPE(pResultInfo->fields[i].type)) { + int32_t lenTmp = numOfRows * sizeof(int32_t); + len += (lenTmp + colLen); + pStart += lenTmp; + } else { + int32_t lenTmp = BitmapLen(pResultInfo->numOfRows); + len += (lenTmp + colLen); + pStart += lenTmp; + } + pStart += colLen; + } + return len; +} + +static int32_t doConvertJson(SReqResultInfo* pResultInfo, int32_t numOfCols, int32_t numOfRows) { + bool needConvert = false; + for (int32_t i = 0; i < numOfCols; ++i) { + if (pResultInfo->fields[i].type == TSDB_DATA_TYPE_JSON) { + needConvert = true; + break; + } + } + if(!needConvert) return TSDB_CODE_SUCCESS; + + char* p = (char*)pResultInfo->pData; + int32_t dataLen = estimateJsonLen(pResultInfo, numOfCols, numOfRows); + + pResultInfo->convertJson = taosMemoryCalloc(1, dataLen); + if(pResultInfo->convertJson == NULL) return TSDB_CODE_OUT_OF_MEMORY; + char* p1 = pResultInfo->convertJson; + + int32_t len = sizeof(int32_t) + sizeof(uint64_t) + numOfCols * (sizeof(int16_t) + sizeof(int32_t)); + memcpy(p1, p, len); + + p += len; + p1 += len; + + len = sizeof(int32_t) * numOfCols; + int32_t* colLength = (int32_t*)p; + int32_t* colLength1 = (int32_t*)p1; + memcpy(p1, p, len); + p += len; + p1 += len; + + char* pStart = p; + char* pStart1 = p1; + for (int32_t i = 0; i < numOfCols; ++i) { + int32_t colLen = htonl(colLength[i]); + int32_t colLen1 = htonl(colLength1[i]); + ASSERT(colLen < dataLen); + + if (pResultInfo->fields[i].type == TSDB_DATA_TYPE_JSON) { + int32_t* offset = (int32_t*)pStart; + int32_t* offset1 = (int32_t*)pStart1; + len = numOfRows * sizeof(int32_t); + memcpy(pStart1, pStart, len); + pStart += len; + pStart1 += len; + + len = 0; + for (int32_t j = 0; j < numOfRows; ++j) { + if (offset[j] == -1) { + continue; + } + char* data = offset[j] + pStart; + + int32_t jsonInnerType = *data; + char* jsonInnerData = data + CHAR_BYTES; + char dst[TSDB_MAX_JSON_TAG_LEN] = {0}; + if (jsonInnerType == TSDB_DATA_TYPE_NULL) { + sprintf(varDataVal(dst), "%s", TSDB_DATA_NULL_STR_L); + varDataSetLen(dst, strlen(varDataVal(dst))); + } else if (jsonInnerType & TD_TAG_JSON) { + char* jsonString = parseTagDatatoJson(data); + STR_TO_VARSTR(dst, jsonString); + taosMemoryFree(jsonString); + } else if (jsonInnerType == TSDB_DATA_TYPE_NCHAR) { // value -> "value" + *(char*)varDataVal(dst) = '\"'; + int32_t length = taosUcs4ToMbs((TdUcs4*)varDataVal(jsonInnerData), varDataLen(jsonInnerData), + varDataVal(dst) + CHAR_BYTES); + if (length <= 0) { + tscError("charset:%s to %s. convert failed.", DEFAULT_UNICODE_ENCODEC, tsCharset); + length = 0; + } + varDataSetLen(dst, length + CHAR_BYTES * 2); + *(char*)POINTER_SHIFT(varDataVal(dst), length + CHAR_BYTES) = '\"'; + } else if (jsonInnerType == TSDB_DATA_TYPE_DOUBLE) { + double jsonVd = *(double*)(jsonInnerData); + sprintf(varDataVal(dst), "%.9lf", jsonVd); + varDataSetLen(dst, strlen(varDataVal(dst))); + } else if (jsonInnerType == TSDB_DATA_TYPE_BOOL) { + sprintf(varDataVal(dst), "%s", (*((char*)jsonInnerData) == 1) ? "true" : "false"); + varDataSetLen(dst, strlen(varDataVal(dst))); + } else { + ASSERT(0); + } + + offset1[j]= len; + memcpy(pStart1 + len, dst, varDataTLen(dst)); + len += varDataTLen(dst); + } + colLen1 = len; + colLength1[i] = htonl(len); + } else if (IS_VAR_DATA_TYPE(pResultInfo->fields[i].type)) { + len = numOfRows * sizeof(int32_t); + memcpy(pStart1, pStart, len); + pStart += len; + pStart1 += len; + memcpy(pStart1, pStart, colLen); + } else { + len = BitmapLen(pResultInfo->numOfRows); + memcpy(pStart1, pStart, len); + pStart += len; + pStart1 += len; + memcpy(pStart1, pStart, colLen); + + } + pStart += colLen; + pStart1 += colLen1; + } + + pResultInfo->pData = pResultInfo->convertJson; + return TSDB_CODE_SUCCESS; +} + int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32_t numOfCols, int32_t numOfRows, bool convertUcs4) { assert(numOfCols > 0 && pFields != NULL && pResultInfo != NULL); @@ -1419,6 +1729,10 @@ int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32 if (code != TSDB_CODE_SUCCESS) { return code; } + code = doConvertJson(pResultInfo, numOfCols, numOfRows); + if (code != TSDB_CODE_SUCCESS) { + return code; + } char* p = (char*)pResultInfo->pData; @@ -1462,8 +1776,7 @@ int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32 pStart += colLength[i]; } - // convert UCS4-LE encoded character to native multi-bytes character in current data block. - if (convertUcs4) { + if(convertUcs4){ code = doConvertUCS4(pResultInfo, numOfRows, numOfCols, colLength); } diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 51e05537d4..c5a237f5ed 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -702,7 +702,7 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) { TSWAP(pRequest->tableList, (pQuery)->pTableList); destorySqlParseWrapper(pWrapper); - launchAsyncQuery(pRequest, pQuery); + launchAsyncQuery(pRequest, pQuery, pResultMeta); } else { destorySqlParseWrapper(pWrapper); tscDebug("error happens, code:%d", code); @@ -808,7 +808,7 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) { SQuery *pQuery = NULL; - SCatalogReq catalogReq = {.forceUpdate = updateMetaForce}; + SCatalogReq catalogReq = {.forceUpdate = updateMetaForce, .qNodeRequired = qnodeRequired(pRequest)}; code = qParseSqlSyntax(pCxt, &pQuery, &catalogReq); if (code != TSDB_CODE_SUCCESS) { goto _error; diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 580aafa010..6fa4e6bffb 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -2274,7 +2274,7 @@ static int32_t smlInsertData(SSmlHandle *info) { // info->affectedRows = taos_affected_rows(info->pRequest); // return info->pRequest->code; - launchAsyncQuery(info->pRequest, info->pQuery); + launchAsyncQuery(info->pRequest, info->pQuery, NULL); return TSDB_CODE_SUCCESS; } diff --git a/source/common/src/systable.c b/source/common/src/systable.c index a1b64b363c..e7b6342150 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -124,7 +124,7 @@ static const SSysDbTableSchema userStbsSchema[] = { {.name = "columns", .bytes = 4, .type = TSDB_DATA_TYPE_INT}, {.name = "tags", .bytes = 4, .type = TSDB_DATA_TYPE_INT}, {.name = "last_update", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP}, - {.name = "table_comment", .bytes = 1024 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, + {.name = "table_comment", .bytes = TSDB_TB_COMMENT_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, }; static const SSysDbTableSchema streamSchema[] = { @@ -148,7 +148,7 @@ static const SSysDbTableSchema userTblsSchema[] = { {.name = "uid", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT}, {.name = "vgroup_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT}, {.name = "ttl", .bytes = 4, .type = TSDB_DATA_TYPE_INT}, - {.name = "table_comment", .bytes = 512 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, + {.name = "table_comment", .bytes = TSDB_TB_COMMENT_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, {.name = "type", .bytes = 20 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, }; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 2443ffbb7f..c3c96972b7 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -524,7 +524,7 @@ int32_t tSerializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pReq } if (pReq->commentLen > 0) { - if (tEncodeBinary(&encoder, pReq->comment, pReq->commentLen) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->comment) < 0) return -1; } if (pReq->ast1Len > 0) { if (tEncodeBinary(&encoder, pReq->pAst1, pReq->ast1Len) < 0) return -1; @@ -589,7 +589,7 @@ int32_t tDeserializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pR } if (pReq->commentLen > 0) { - pReq->comment = taosMemoryMalloc(pReq->commentLen); + pReq->comment = taosMemoryMalloc(pReq->commentLen + 1); if (pReq->comment == NULL) return -1; if (tDecodeCStrTo(&decoder, pReq->comment) < 0) return -1; } @@ -707,7 +707,7 @@ int32_t tDeserializeSMAlterStbReq(void *buf, int32_t bufLen, SMAlterStbReq *pReq if (tDecodeI32(&decoder, &pReq->ttl) < 0) return -1; if (tDecodeI32(&decoder, &pReq->commentLen) < 0) return -1; if (pReq->commentLen > 0) { - pReq->comment = taosMemoryMalloc(pReq->commentLen); + pReq->comment = taosMemoryMalloc(pReq->commentLen + 1); if (pReq->comment == NULL) return -1; if (tDecodeCStrTo(&decoder, pReq->comment) < 0) return -1; } @@ -4374,6 +4374,10 @@ int tEncodeSVCreateTbReq(SEncoder *pCoder, const SVCreateTbReq *pReq) { if (tEncodeI64(pCoder, pReq->ctime) < 0) return -1; if (tEncodeI32(pCoder, pReq->ttl) < 0) return -1; if (tEncodeI8(pCoder, pReq->type) < 0) return -1; + if (tEncodeI32(pCoder, pReq->commentLen) < 0) return -1; + if (pReq->commentLen > 0) { + if (tEncodeCStr(pCoder, pReq->comment) < 0) return -1; + } if (pReq->type == TSDB_CHILD_TABLE) { if (tEncodeI64(pCoder, pReq->ctb.suid) < 0) return -1; @@ -4397,6 +4401,12 @@ int tDecodeSVCreateTbReq(SDecoder *pCoder, SVCreateTbReq *pReq) { if (tDecodeI64(pCoder, &pReq->ctime) < 0) return -1; if (tDecodeI32(pCoder, &pReq->ttl) < 0) return -1; if (tDecodeI8(pCoder, &pReq->type) < 0) return -1; + if (tDecodeI32(pCoder, &pReq->commentLen) < 0) return -1; + if (pReq->commentLen > 0) { + pReq->comment = taosMemoryMalloc(pReq->commentLen + 1); + if (pReq->comment == NULL) return -1; + if (tDecodeCStrTo(pCoder, pReq->comment) < 0) return -1; + } if (pReq->type == TSDB_CHILD_TABLE) { if (tDecodeI64(pCoder, &pReq->ctb.suid) < 0) return -1; @@ -4750,8 +4760,8 @@ int32_t tEncodeSVAlterTbReq(SEncoder *pEncoder, const SVAlterTbReq *pReq) { if (pReq->updateTTL) { if (tEncodeI32v(pEncoder, pReq->newTTL) < 0) return -1; } - if (tEncodeI8(pEncoder, pReq->updateComment) < 0) return -1; - if (pReq->updateComment) { + if (tEncodeI32v(pEncoder, pReq->newCommentLen) < 0) return -1; + if (pReq->newCommentLen > 0) { if (tEncodeCStr(pEncoder, pReq->newComment) < 0) return -1; } break; @@ -4798,8 +4808,8 @@ int32_t tDecodeSVAlterTbReq(SDecoder *pDecoder, SVAlterTbReq *pReq) { if (pReq->updateTTL) { if (tDecodeI32v(pDecoder, &pReq->newTTL) < 0) return -1; } - if (tDecodeI8(pDecoder, &pReq->updateComment) < 0) return -1; - if (pReq->updateComment) { + if (tDecodeI32v(pDecoder, &pReq->newCommentLen) < 0) return -1; + if (pReq->newCommentLen > 0) { if (tDecodeCStr(pDecoder, &pReq->newComment) < 0) return -1; } break; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index f112727c08..c3ed6d781c 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -334,6 +334,7 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_VND_CANCEL_TASK, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_TASK, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_CREATE_STB, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_TTL_TABLE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_STB, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_STB, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_CREATE_TABLE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index fa6f45bdad..5ea55d558f 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -77,12 +77,50 @@ static void mndPullupTelem(SMnode *pMnode) { tmsgPutToQueue(&pMnode->msgCb, READ_QUEUE, &rpcMsg); } +static void mndPushTtlTime(SMnode *pMnode) { + SSdb *pSdb = pMnode->pSdb; + SVgObj *pVgroup = NULL; + void *pIter = NULL; + + while (1) { + pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup); + if (pIter == NULL) break; + + int32_t contLen = sizeof(SMsgHead) + sizeof(int32_t); + SMsgHead *pHead = rpcMallocCont(contLen); + if (pHead == NULL) { + mError("ttl time malloc err. contLen:%d", contLen); + sdbRelease(pSdb, pVgroup); + continue; + } + pHead->contLen = htonl(contLen); + pHead->vgId = htonl(pVgroup->vgId); + + int32_t t = taosGetTimestampSec(); + *(int32_t*)(POINTER_SHIFT(pHead, sizeof(SMsgHead))) = htonl(t); + + SRpcMsg rpcMsg = {.msgType = TDMT_VND_DROP_TTL_TABLE, .pCont = pHead, .contLen = contLen}; + + SEpSet epSet = mndGetVgroupEpset(pMnode, pVgroup); + int32_t code = tmsgSendReq(&epSet, &rpcMsg); + if(code != 0){ + mError("ttl time seed err. code:%d", code); + } + mError("ttl time seed succ. time:%d", t); + sdbRelease(pSdb, pVgroup); + } +} + static void *mndThreadFp(void *param) { SMnode *pMnode = param; int64_t lastTime = 0; setThreadName("mnode-timer"); while (1) { + if (lastTime % (864000) == 0) { // sleep 1 day for ttl + mndPushTtlTime(pMnode); + } + lastTime++; taosMsleep(100); if (mndGetStop(pMnode)) break; diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index c37cdd1888..96dc79adbc 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -117,7 +117,7 @@ SSdbRaw *mndStbActionEncode(SStbObj *pStb) { } if (pStb->commentLen > 0) { - SDB_SET_BINARY(pRaw, dataPos, pStb->comment, pStb->commentLen, _OVER) + SDB_SET_BINARY(pRaw, dataPos, pStb->comment, pStb->commentLen + 1, _OVER) } if (pStb->ast1Len > 0) { SDB_SET_BINARY(pRaw, dataPos, pStb->pAst1, pStb->ast1Len, _OVER) @@ -204,9 +204,9 @@ static SSdbRow *mndStbActionDecode(SSdbRaw *pRaw) { } if (pStb->commentLen > 0) { - pStb->comment = taosMemoryCalloc(pStb->commentLen, 1); + pStb->comment = taosMemoryCalloc(pStb->commentLen + 1, 1); if (pStb->comment == NULL) goto _OVER; - SDB_GET_BINARY(pRaw, dataPos, pStb->comment, pStb->commentLen, _OVER) + SDB_GET_BINARY(pRaw, dataPos, pStb->comment, pStb->commentLen + 1, _OVER) } if (pStb->ast1Len > 0) { pStb->pAst1 = taosMemoryCalloc(pStb->ast1Len, 1); @@ -280,8 +280,8 @@ static int32_t mndStbActionUpdate(SSdb *pSdb, SStbObj *pOld, SStbObj *pNew) { } } - if (pOld->commentLen < pNew->commentLen) { - void *comment = taosMemoryMalloc(pNew->commentLen); + if (pOld->commentLen < pNew->commentLen && pNew->commentLen > 0) { + void *comment = taosMemoryMalloc(pNew->commentLen + 1); if (comment != NULL) { taosMemoryFree(pOld->comment); pOld->comment = comment; @@ -291,6 +291,7 @@ static int32_t mndStbActionUpdate(SSdb *pSdb, SStbObj *pOld, SStbObj *pNew) { taosWUnLockLatch(&pOld->lock); } } + pOld->commentLen = pNew->commentLen; if (pOld->ast1Len < pNew->ast1Len) { void *pAst1 = taosMemoryMalloc(pNew->ast1Len); @@ -330,8 +331,8 @@ static int32_t mndStbActionUpdate(SSdb *pSdb, SStbObj *pOld, SStbObj *pNew) { pOld->numOfTags = pNew->numOfTags; memcpy(pOld->pTags, pNew->pTags, pOld->numOfTags * sizeof(SSchema)); } - if (pNew->commentLen != 0) { - memcpy(pOld->comment, pNew->comment, pNew->commentLen); + if (pNew->commentLen > 0) { + memcpy(pOld->comment, pNew->comment, pNew->commentLen + 1); } if (pNew->ast1Len != 0) { memcpy(pOld->pAst1, pNew->pAst1, pNew->ast1Len); @@ -676,12 +677,12 @@ int32_t mndBuildStbFromReq(SMnode *pMnode, SStbObj *pDst, SMCreateStbReq *pCreat pDst->numOfTags = pCreate->numOfTags; pDst->commentLen = pCreate->commentLen; if (pDst->commentLen > 0) { - pDst->comment = taosMemoryCalloc(pDst->commentLen, 1); + pDst->comment = taosMemoryCalloc(pDst->commentLen + 1, 1); if (pDst->comment == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } - memcpy(pDst->comment, pCreate->comment, pDst->commentLen); + memcpy(pDst->comment, pCreate->comment, pDst->commentLen + 1); } pDst->ast1Len = pCreate->ast1Len; @@ -835,7 +836,7 @@ _OVER: } static int32_t mndCheckAlterStbReq(SMAlterStbReq *pAlter) { - if (pAlter->commentLen != 0 || pAlter->ttl != 0) return 0; + if (pAlter->commentLen >= 0 || pAlter->ttl != 0) return 0; if (pAlter->numOfFields < 1 || pAlter->numOfFields != (int32_t)taosArrayGetSize(pAlter->pFields)) { terrno = TSDB_CODE_MND_INVALID_STB_OPTION; @@ -890,13 +891,16 @@ static int32_t mndUpdateStbCommentAndTTL(const SStbObj *pOld, SStbObj *pNew, cha int32_t ttl) { if (commentLen > 0) { pNew->commentLen = commentLen; - pNew->comment = taosMemoryCalloc(1, commentLen); + pNew->comment = taosMemoryCalloc(1, commentLen + 1); if (pNew->comment == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } - memcpy(pNew->comment, pComment, commentLen); + memcpy(pNew->comment, pComment, commentLen + 1); + } else if(commentLen == 0){ + pNew->commentLen = 0; } + if (ttl >= 0) { pNew->ttl = ttl; } @@ -1206,7 +1210,6 @@ static int32_t mndSetAlterStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj sdbRelease(pSdb, pVgroup); return -1; } - STransAction action = {0}; action.epSet = mndGetVgroupEpset(pMnode, pVgroup); action.pCont = pReq; @@ -1841,17 +1844,17 @@ static int32_t mndRetrieveStb(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBloc pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppend(pColInfo, numOfRows, (const char *)&pStb->updateTime, false); // number of tables - char *p = taosMemoryCalloc(1, pStb->commentLen + 1 + VARSTR_HEADER_SIZE); // check malloc failures - if (p != NULL) { - if (pStb->commentLen != 0) { - STR_TO_VARSTR(p, pStb->comment); - } else { - STR_TO_VARSTR(p, ""); - } - - pColInfo = taosArrayGet(pBlock->pDataBlock, cols); - colDataAppend(pColInfo, numOfRows, (const char *)p, false); - taosMemoryFree(p); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols); + if (pStb->commentLen > 0) { + char comment[TSDB_TB_COMMENT_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(comment, pStb->comment); + colDataAppend(pColInfo, numOfRows, comment, false); + } else if(pStb->commentLen == 0) { + char comment[VARSTR_HEADER_SIZE + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(comment, ""); + colDataAppend(pColInfo, numOfRows, comment, false); + } else { + colDataAppendNULL(pColInfo, numOfRows); } numOfRows++; diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 3cfca66a39..e83b992f06 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -210,12 +210,16 @@ struct SMetaEntry { struct { int64_t ctime; int32_t ttlDays; + int32_t commentLen; + char *comment; tb_uid_t suid; uint8_t *pTags; } ctbEntry; struct { int64_t ctime; int32_t ttlDays; + int32_t commentLen; + char *comment; int32_t ncid; // next column id SSchemaWrapper schemaRow; } ntbEntry; diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 553c6a40ab..d399b5e3bf 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -87,6 +87,7 @@ int metaAlterSTable(SMeta* pMeta, int64_t version, SVCreateStbReq* p int metaDropSTable(SMeta* pMeta, int64_t verison, SVDropStbReq* pReq); int metaCreateTable(SMeta* pMeta, int64_t version, SVCreateTbReq* pReq); int metaDropTable(SMeta* pMeta, int64_t version, SVDropTbReq* pReq, SArray* tbUids); +int metaTtlDropTable(SMeta *pMeta, int64_t ttl, SArray *tbUids); int metaAlterTable(SMeta* pMeta, int64_t version, SVAlterTbReq* pReq, STableMetaRsp* pMetaRsp); SSchemaWrapper* metaGetTableSchema(SMeta* pMeta, tb_uid_t uid, int32_t sver, bool isinline); STSchema* metaGetTbTSchema(SMeta* pMeta, tb_uid_t uid, int32_t sver); @@ -105,6 +106,7 @@ int32_t metaSnapshotReaderClose(SMetaSnapshotReader* pReader); int32_t metaSnapshotRead(SMetaSnapshotReader* pReader, void** ppData, uint32_t* nData); void* metaGetIdx(SMeta* pMeta); void* metaGetIvtIdx(SMeta* pMeta); +int metaTtlSmaller(SMeta *pMeta, uint64_t time, SArray *uidList); int32_t metaCreateTSma(SMeta* pMeta, int64_t version, SSmaCfg* pCfg); int32_t metaDropTSma(SMeta* pMeta, int64_t indexUid); diff --git a/source/dnode/vnode/src/meta/metaEntry.c b/source/dnode/vnode/src/meta/metaEntry.c index 15ef38719f..acf5b0b613 100644 --- a/source/dnode/vnode/src/meta/metaEntry.c +++ b/source/dnode/vnode/src/meta/metaEntry.c @@ -29,12 +29,20 @@ int metaEncodeEntry(SEncoder *pCoder, const SMetaEntry *pME) { } else if (pME->type == TSDB_CHILD_TABLE) { if (tEncodeI64(pCoder, pME->ctbEntry.ctime) < 0) return -1; if (tEncodeI32(pCoder, pME->ctbEntry.ttlDays) < 0) return -1; + if (tEncodeI32(pCoder, pME->ctbEntry.commentLen) < 0) return -1; + if (pME->ctbEntry.commentLen > 0){ + if (tEncodeCStr(pCoder, pME->ctbEntry.comment) < 0) return -1; + } if (tEncodeI64(pCoder, pME->ctbEntry.suid) < 0) return -1; debugCheckTags((STag*)pME->ctbEntry.pTags); // TODO: remove after debug if (tEncodeTag(pCoder, (const STag *)pME->ctbEntry.pTags) < 0) return -1; } else if (pME->type == TSDB_NORMAL_TABLE) { if (tEncodeI64(pCoder, pME->ntbEntry.ctime) < 0) return -1; if (tEncodeI32(pCoder, pME->ntbEntry.ttlDays) < 0) return -1; + if (tEncodeI32(pCoder, pME->ntbEntry.commentLen) < 0) return -1; + if (pME->ntbEntry.commentLen > 0){ + if (tEncodeCStr(pCoder, pME->ntbEntry.comment) < 0) return -1; + } if (tEncodeI32v(pCoder, pME->ntbEntry.ncid) < 0) return -1; if (tEncodeSSchemaWrapper(pCoder, &pME->ntbEntry.schemaRow) < 0) return -1; } else if (pME->type == TSDB_TSMA_TABLE) { @@ -61,12 +69,21 @@ int metaDecodeEntry(SDecoder *pCoder, SMetaEntry *pME) { } else if (pME->type == TSDB_CHILD_TABLE) { if (tDecodeI64(pCoder, &pME->ctbEntry.ctime) < 0) return -1; if (tDecodeI32(pCoder, &pME->ctbEntry.ttlDays) < 0) return -1; + if (tDecodeI32(pCoder, &pME->ctbEntry.commentLen) < 0) return -1; + if (pME->ctbEntry.commentLen > 0){ + if (tDecodeCStr(pCoder, &pME->ctbEntry.comment) < 0) + return -1; + } if (tDecodeI64(pCoder, &pME->ctbEntry.suid) < 0) return -1; if (tDecodeTag(pCoder, (STag **)&pME->ctbEntry.pTags) < 0) return -1; // (TODO) debugCheckTags((STag*)pME->ctbEntry.pTags); // TODO: remove after debug } else if (pME->type == TSDB_NORMAL_TABLE) { if (tDecodeI64(pCoder, &pME->ntbEntry.ctime) < 0) return -1; if (tDecodeI32(pCoder, &pME->ntbEntry.ttlDays) < 0) return -1; + if (tDecodeI32(pCoder, &pME->ntbEntry.commentLen) < 0) return -1; + if (pME->ntbEntry.commentLen > 0){ + if (tDecodeCStr(pCoder, &pME->ntbEntry.comment) < 0) return -1; + } if (tDecodeI32v(pCoder, &pME->ntbEntry.ncid) < 0) return -1; if (tDecodeSSchemaWrapperEx(pCoder, &pME->ntbEntry.schemaRow) < 0) return -1; } else if (pME->type == TSDB_TSMA_TABLE) { diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c index 8cfebe1b98..a5ca90e55f 100644 --- a/source/dnode/vnode/src/meta/metaQuery.c +++ b/source/dnode/vnode/src/meta/metaQuery.c @@ -95,7 +95,7 @@ tb_uid_t metaGetTableEntryUidByName(SMeta *pMeta, const char *name) { metaULock(pMeta); - return 0; + return uid; } int metaReadNext(SMetaReader *pReader) { @@ -218,6 +218,40 @@ _err: return NULL; } +int metaTtlSmaller(SMeta *pMeta, uint64_t ttl, SArray *uidList){ + metaRLock(pMeta); + TBC * pCur; + int ret = tdbTbcOpen(pMeta->pTtlIdx, &pCur, NULL); + if (ret < 0) { + metaULock(pMeta); + return ret; + } + + STtlIdxKey ttlKey = {0}; + ttlKey.dtime = ttl; + ttlKey.uid = INT64_MAX; + int c = 0; + tdbTbcMoveTo(pCur, &ttlKey, sizeof(ttlKey), &c); + if (c < 0) { + tdbTbcMoveToPrev(pCur); + } + + void *pKey = NULL; + int kLen = 0; + while(1){ + ret = tdbTbcPrev(pCur, &pKey, &kLen, NULL, NULL); + if (ret < 0) { + break; + } + ttlKey = *(STtlIdxKey*)pKey; + taosArrayPush(uidList, &ttlKey.uid); + } + tdbTbcClose(pCur); + + tdbFree(pKey); + return 0; +} + struct SMCtbCursor { SMeta * pMeta; TBC * pCur; diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index 9a05f9e5a0..bf5d5912f9 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -320,11 +320,15 @@ int metaCreateTable(SMeta *pMeta, int64_t version, SVCreateTbReq *pReq) { if (me.type == TSDB_CHILD_TABLE) { me.ctbEntry.ctime = pReq->ctime; me.ctbEntry.ttlDays = pReq->ttl; + me.ctbEntry.commentLen = pReq->commentLen; + me.ctbEntry.comment = pReq->comment; me.ctbEntry.suid = pReq->ctb.suid; me.ctbEntry.pTags = pReq->ctb.pTag; } else { me.ntbEntry.ctime = pReq->ctime; me.ntbEntry.ttlDays = pReq->ttl; + me.ntbEntry.commentLen = pReq->commentLen; + me.ntbEntry.comment = pReq->comment; me.ntbEntry.schemaRow = pReq->ntb.schemaRow; me.ntbEntry.ncid = me.ntbEntry.schemaRow.pSchema[me.ntbEntry.schemaRow.nCols - 1].colId + 1; } @@ -359,7 +363,7 @@ int metaDropTable(SMeta *pMeta, int64_t version, SVDropTbReq *pReq, SArray *tbUi metaDropTableByUid(pMeta, uid, &type); metaULock(pMeta); - if (type == TSDB_CHILD_TABLE && tbUids) { + if ((type == TSDB_CHILD_TABLE || type == TSDB_NORMAL_TABLE) && tbUids) { taosArrayPush(tbUids, &uid); } @@ -367,16 +371,57 @@ int metaDropTable(SMeta *pMeta, int64_t version, SVDropTbReq *pReq, SArray *tbUi return 0; } +int metaTtlDropTable(SMeta *pMeta, int64_t ttl, SArray *tbUids) { + metaWLock(pMeta); + int ret = metaTtlSmaller(pMeta, ttl, tbUids); + if(ret != 0){ + return ret; + } + for (int i = 0; i < taosArrayGetSize(tbUids); ++i) { + tb_uid_t *uid = (tb_uid_t *)taosArrayGet(tbUids, i); + metaDropTableByUid(pMeta, *uid, NULL); + } + metaULock(pMeta); + return 0; +} + +static void metaBuildTtlIdxKey(STtlIdxKey *ttlKey, const SMetaEntry *pME){ + int32_t ttlDays; + int64_t ctime; + if (pME->type == TSDB_CHILD_TABLE) { + ctime = pME->ctbEntry.ctime; + ttlDays = pME->ctbEntry.ttlDays; + } else if (pME->type == TSDB_NORMAL_TABLE) { + ctime = pME->ntbEntry.ctime; + ttlDays = pME->ntbEntry.ttlDays; + } else { + ASSERT(0); + } + + if (ttlDays <= 0) return; + + ttlKey->dtime = ctime / 1000 + ttlDays * 24 * 60 * 60; +// ttlKey->dtime = ctime / 1000 + ttlDays; + ttlKey->uid = pME->uid; +} + +static int metaDeleteTtlIdx(SMeta *pMeta, const SMetaEntry *pME) { + STtlIdxKey ttlKey = {0}; + metaBuildTtlIdxKey(&ttlKey, pME); + if(ttlKey.dtime == 0) return 0; + return tdbTbDelete(pMeta->pTtlIdx, &ttlKey, sizeof(ttlKey), &pMeta->txn); +} + + static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type) { void * pData = NULL; int nData = 0; int rc = 0; - int64_t version; SMetaEntry e = {0}; SDecoder dc = {0}; rc = tdbTbGet(pMeta->pUidIdx, &uid, sizeof(uid), &pData, &nData); - version = *(int64_t *)pData; + int64_t version = *(int64_t *)pData; tdbTbGet(pMeta->pTbDb, &(STbDbKey){.version = version, .uid = uid}, sizeof(STbDbKey), &pData, &nData); @@ -388,15 +433,17 @@ static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type) { tdbTbDelete(pMeta->pTbDb, &(STbDbKey){.version = version, .uid = uid}, sizeof(STbDbKey), &pMeta->txn); tdbTbDelete(pMeta->pNameIdx, e.name, strlen(e.name) + 1, &pMeta->txn); tdbTbDelete(pMeta->pUidIdx, &uid, sizeof(uid), &pMeta->txn); + if(e.type != TSDB_SUPER_TABLE) metaDeleteTtlIdx(pMeta, &e); + if (e.type == TSDB_CHILD_TABLE) { tdbTbDelete(pMeta->pCtbIdx, &(SCtbIdxKey){.suid = e.ctbEntry.suid, .uid = uid}, sizeof(SCtbIdxKey), &pMeta->txn); } else if (e.type == TSDB_NORMAL_TABLE) { // drop schema.db (todo) - // drop ttl.idx (todo) } else if (e.type == TSDB_SUPER_TABLE) { // drop schema.db (todo) } + metaError("ttl drop table:%s", e.name); tDecoderClear(&dc); tdbFree(pData); @@ -545,16 +592,20 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl metaUpdateMetaRsp(uid, pAlterTbReq->tbName, pSchema, pMetaRsp); + if (entry.pBuf) taosMemoryFree(entry.pBuf); if (pNewSchema) taosMemoryFree(pNewSchema); - tDecoderClear(&dc); tdbTbcClose(pTbDbc); tdbTbcClose(pUidIdxc); + tDecoderClear(&dc); + return 0; _err: - tDecoderClear(&dc); + if (entry.pBuf) taosMemoryFree(entry.pBuf); tdbTbcClose(pTbDbc); tdbTbcClose(pUidIdxc); + tDecoderClear(&dc); + return -1; } @@ -706,8 +757,87 @@ _err: } static int metaUpdateTableOptions(SMeta *pMeta, int64_t version, SVAlterTbReq *pAlterTbReq) { - // TODO - ASSERT(0); + void * pVal = NULL; + int nVal = 0; + const void * pData = NULL; + int nData = 0; + int ret = 0; + tb_uid_t uid; + int64_t oversion; + SMetaEntry entry = {0}; + int c = 0; + + // search name index + ret = tdbTbGet(pMeta->pNameIdx, pAlterTbReq->tbName, strlen(pAlterTbReq->tbName) + 1, &pVal, &nVal); + if (ret < 0) { + terrno = TSDB_CODE_VND_TABLE_NOT_EXIST; + return -1; + } + + uid = *(tb_uid_t *)pVal; + tdbFree(pVal); + pVal = NULL; + + // search uid index + TBC *pUidIdxc = NULL; + + tdbTbcOpen(pMeta->pUidIdx, &pUidIdxc, &pMeta->txn); + tdbTbcMoveTo(pUidIdxc, &uid, sizeof(uid), &c); + ASSERT(c == 0); + + tdbTbcGet(pUidIdxc, NULL, NULL, &pData, &nData); + oversion = *(int64_t *)pData; + + // search table.db + TBC *pTbDbc = NULL; + + tdbTbcOpen(pMeta->pTbDb, &pTbDbc, &pMeta->txn); + tdbTbcMoveTo(pTbDbc, &((STbDbKey){.uid = uid, .version = oversion}), sizeof(STbDbKey), &c); + ASSERT(c == 0); + tdbTbcGet(pTbDbc, NULL, NULL, &pData, &nData); + + // get table entry + SDecoder dc = {0}; + entry.pBuf = taosMemoryMalloc(nData); + memcpy(entry.pBuf, pData, nData); + tDecoderInit(&dc, entry.pBuf, nData); + ret = metaDecodeEntry(&dc, &entry); + ASSERT(ret == 0); + + entry.version = version; + metaWLock(pMeta); + // build SMetaEntry + if (entry.type == TSDB_CHILD_TABLE) { + if(pAlterTbReq->updateTTL) { + metaDeleteTtlIdx(pMeta, &entry); + entry.ctbEntry.ttlDays = pAlterTbReq->newTTL; + metaUpdateTtlIdx(pMeta, &entry); + } + if(pAlterTbReq->newCommentLen >= 0) { + entry.ctbEntry.commentLen = pAlterTbReq->newCommentLen; + entry.ctbEntry.comment = pAlterTbReq->newComment; + } + } else { + if(pAlterTbReq->updateTTL) { + metaDeleteTtlIdx(pMeta, &entry); + entry.ntbEntry.ttlDays = pAlterTbReq->newTTL; + metaUpdateTtlIdx(pMeta, &entry); + } + if(pAlterTbReq->newCommentLen >= 0) { + entry.ntbEntry.commentLen = pAlterTbReq->newCommentLen; + entry.ntbEntry.comment = pAlterTbReq->newComment; + } + } + + // save to table db + metaSaveToTbDb(pMeta, &entry); + tdbTbcUpsert(pUidIdxc, &entry.uid, sizeof(tb_uid_t), &version, sizeof(version), 0); + metaULock(pMeta); + + tdbTbcClose(pTbDbc); + tdbTbcClose(pUidIdxc); + tDecoderClear(&dc); + if (entry.pBuf) taosMemoryFree(entry.pBuf); return 0; } @@ -786,25 +916,9 @@ static int metaUpdateNameIdx(SMeta *pMeta, const SMetaEntry *pME) { } static int metaUpdateTtlIdx(SMeta *pMeta, const SMetaEntry *pME) { - int32_t ttlDays; - int64_t ctime; - STtlIdxKey ttlKey; - - if (pME->type == TSDB_CHILD_TABLE) { - ctime = pME->ctbEntry.ctime; - ttlDays = pME->ctbEntry.ttlDays; - } else if (pME->type == TSDB_NORMAL_TABLE) { - ctime = pME->ntbEntry.ctime; - ttlDays = pME->ntbEntry.ttlDays; - } else { - ASSERT(0); - } - - if (ttlDays <= 0) return 0; - - ttlKey.dtime = ctime + ttlDays * 24 * 60 * 60; - ttlKey.uid = pME->uid; - + STtlIdxKey ttlKey = {0}; + metaBuildTtlIdxKey(&ttlKey, pME); + if(ttlKey.dtime == 0) return 0; return tdbTbInsert(pMeta->pTtlIdx, &ttlKey, sizeof(ttlKey), NULL, 0, &pMeta->txn); } diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index feb8419bdf..fb22b7c5bf 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -26,6 +26,7 @@ static int32_t vnodeProcessCreateTSmaReq(SVnode *pVnode, int64_t version, void * static int32_t vnodeProcessAlterConfirmReq(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessAlterHasnRangeReq(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessWriteMsg(SVnode *pVnode, int64_t version, SRpcMsg *pMsg, SRpcMsg *pRsp); +static int32_t vnodeProcessDropTtlTbReq(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp); int32_t vnodePreprocessReq(SVnode *pVnode, SRpcMsg *pMsg) { int32_t code = 0; @@ -105,7 +106,7 @@ int32_t vnodeProcessWriteReq(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp int32_t len; int32_t ret; - vTrace("vgId:%d, start to process write request %s, index:%" PRId64, TD_VID(pVnode), TMSG_INFO(pMsg->msgType), + vError("vgId:%d, start to process write request %s, index:%" PRId64, TD_VID(pVnode), TMSG_INFO(pMsg->msgType), version); pVnode->state.applied = version; @@ -134,6 +135,9 @@ int32_t vnodeProcessWriteReq(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp case TDMT_VND_DROP_TABLE: if (vnodeProcessDropTbReq(pVnode, version, pReq, len, pRsp) < 0) goto _err; break; + case TDMT_VND_DROP_TTL_TABLE: + if (vnodeProcessDropTtlTbReq(pVnode, version, pReq, len, pRsp) < 0) goto _err; + break; case TDMT_VND_CREATE_SMA: { if (vnodeProcessCreateTSmaReq(pVnode, version, pReq, len, pRsp) < 0) goto _err; } break; @@ -300,6 +304,26 @@ void vnodeUpdateMetaRsp(SVnode *pVnode, STableMetaRsp *pMetaRsp) { pMetaRsp->precision = pVnode->config.tsdbCfg.precision; } +static int32_t vnodeProcessDropTtlTbReq(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp){ + + SArray *tbUids = taosArrayInit(8, sizeof(int64_t)); + if (tbUids == NULL) return TSDB_CODE_OUT_OF_MEMORY; + + int32_t t = ntohl(*(int32_t*)pReq); + vError("rec ttl time:%d", t); + int32_t ret = metaTtlDropTable(pVnode->pMeta, t, tbUids); + if(ret != 0){ + goto end; + } + if(taosArrayGetSize(tbUids) > 0){ + tqUpdateTbUidList(pVnode->pTq, tbUids, false); + } + +end: + taosArrayDestroy(tbUids); + return ret; +} + static int32_t vnodeProcessCreateStbReq(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp) { SVCreateStbReq req = {0}; SDecoder coder; diff --git a/source/libs/command/src/explain.c b/source/libs/command/src/explain.c index 8f91282480..00643be0e1 100644 --- a/source/libs/command/src/explain.c +++ b/source/libs/command/src/explain.c @@ -631,8 +631,8 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i QRY_ERR_RET(qExplainBufAppendExecInfo(pResNode->pExecInfo, tbuf, &tlen)); EXPLAIN_ROW_APPEND(EXPLAIN_BLANK_FORMAT); } - if (pIndefNode->pVectorFuncs) { - EXPLAIN_ROW_APPEND(EXPLAIN_FUNCTIONS_FORMAT, pIndefNode->pVectorFuncs->length); + if (pIndefNode->pFuncs) { + EXPLAIN_ROW_APPEND(EXPLAIN_FUNCTIONS_FORMAT, pIndefNode->pFuncs->length); EXPLAIN_ROW_APPEND(EXPLAIN_BLANK_FORMAT); } EXPLAIN_ROW_APPEND(EXPLAIN_WIDTH_FORMAT, pIndefNode->node.pOutputDataBlockDesc->totalRowSize); diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index 8173dbde63..bb6bb9f007 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -422,6 +422,7 @@ typedef struct SStreamFinalIntervalOperatorInfo { SArray* pChildren; SSDataBlock* pUpdateRes; SPhysiNode* pPhyNode; // create new child + bool isFinal; } SStreamFinalIntervalOperatorInfo; typedef struct SAggOperatorInfo { @@ -546,14 +547,18 @@ typedef struct SStreamSessionAggOperatorInfo { SGroupResInfo groupResInfo; int64_t gap; // session window gap int32_t primaryTsIndex; // primary timestamp slot id + int32_t endTsIndex; // window end timestamp slot id int32_t order; // current SSDataBlock scan order STimeWindowAggSupp twAggSup; SSDataBlock* pWinBlock; // window result SqlFunctionCtx* pDummyCtx; // for combine - SSDataBlock* pDelRes; + SSDataBlock* pDelRes; // delete result + SSDataBlock* pUpdateRes; // update window SHashObj* pStDeleted; void* pDelIterator; SArray* pChildren; // cache for children's result; final stream operator + SPhysiNode* pPhyNode; // create new child + bool isFinal; } SStreamSessionAggOperatorInfo; typedef struct STimeSliceOperatorInfo { @@ -812,10 +817,10 @@ int32_t binarySearchForKey(char* pValue, int num, TSKEY key, int order); int32_t initStreamAggSupporter(SStreamAggSupporter* pSup, const char* pKey, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t size); SResultRow* getNewResultRow(SDiskbasedBuf* pResultBuf, int64_t tableGroupId, int32_t interBufSize); -SResultWindowInfo* getSessionTimeWindow(SStreamAggSupporter* pAggSup, TSKEY ts, uint64_t groupId, int64_t gap, int32_t* pIndex); -int32_t updateSessionWindowInfo(SResultWindowInfo* pWinInfo, TSKEY* pTs, int32_t rows, int32_t start, int64_t gap, - SHashObj* pStDeleted); - +SResultWindowInfo* getSessionTimeWindow(SStreamAggSupporter* pAggSup, TSKEY startTs, + TSKEY endTs, uint64_t groupId, int64_t gap, int32_t* pIndex); +int32_t updateSessionWindowInfo(SResultWindowInfo* pWinInfo, TSKEY* pStartTs, + TSKEY* pEndTs, int32_t rows, int32_t start, int64_t gap, SHashObj* pStDeleted); bool functionNeedToExecute(SqlFunctionCtx* pCtx); int32_t compareTimeWindow(const void* p1, const void* p2, const void* param); diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 422923c405..01a1dbed5b 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -3716,7 +3716,7 @@ SOperatorInfo* createIndefinitOutputOperatorInfo(SOperatorInfo* downstream, SPhy SIndefRowsFuncPhysiNode* pPhyNode = (SIndefRowsFuncPhysiNode*)pNode; int32_t numOfExpr = 0; - SExprInfo* pExprInfo = createExprInfo(pPhyNode->pVectorFuncs, NULL, &numOfExpr); + SExprInfo* pExprInfo = createExprInfo(pPhyNode->pFuncs, NULL, &numOfExpr); if (pPhyNode->pExprs != NULL) { SExprSupp* pSup1 = &pInfo->scalarSup; diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index fc65acab1b..31bf7994b3 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -706,11 +706,12 @@ static bool prepareDataScan(SStreamBlockScanInfo* pInfo) { SStreamAggSupporter* pAggSup = pInfo->sessionSup.pStreamAggSup; int64_t gap = pInfo->sessionSup.gap; int32_t winIndex = 0; - SResultWindowInfo* pCurWin = - getSessionTimeWindow(pAggSup, tsCols[pInfo->updateResIndex], pSDB->info.groupId, gap, &winIndex); + SResultWindowInfo* pCurWin = + getSessionTimeWindow(pAggSup, tsCols[pInfo->updateResIndex], INT64_MIN, + pSDB->info.groupId, gap, &winIndex); win = pCurWin->win; pInfo->updateResIndex += - updateSessionWindowInfo(pCurWin, tsCols, pSDB->info.rows, pInfo->updateResIndex, gap, NULL); + updateSessionWindowInfo(pCurWin, tsCols, NULL, pSDB->info.rows, pInfo->updateResIndex, gap, NULL); } else { win = getActiveTimeWindow(NULL, &dumyInfo, tsCols[pInfo->updateResIndex], &pInfo->interval, pInfo->interval.precision, NULL); @@ -1368,12 +1369,6 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) { pColInfoData = taosArrayGet(p->pDataBlock, 6); colDataAppend(pColInfoData, numOfRows, (char*)&vgId, false); - // table comment - // todo: set the correct comment - pColInfoData = taosArrayGet(p->pDataBlock, 8); - colDataAppendNULL(pColInfoData, numOfRows); - - char str[256] = {0}; int32_t tableType = pInfo->pCur->mr.me.type; if (tableType == TSDB_CHILD_TABLE) { // create time @@ -1390,11 +1385,25 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) { colDataAppend(pColInfoData, numOfRows, (char*)&mr.me.stbEntry.schemaRow.nCols, false); // super table name - STR_TO_VARSTR(str, mr.me.name); + STR_TO_VARSTR(n, mr.me.name); pColInfoData = taosArrayGet(p->pDataBlock, 4); - colDataAppend(pColInfoData, numOfRows, str, false); + colDataAppend(pColInfoData, numOfRows, n, false); metaReaderClear(&mr); + // table comment + pColInfoData = taosArrayGet(p->pDataBlock, 8); + if(pInfo->pCur->mr.me.ctbEntry.commentLen > 0) { + char comment[TSDB_TB_COMMENT_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(comment, pInfo->pCur->mr.me.ctbEntry.comment); + colDataAppend(pColInfoData, numOfRows, comment, false); + }else if(pInfo->pCur->mr.me.ctbEntry.commentLen == 0) { + char comment[VARSTR_HEADER_SIZE + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(comment, ""); + colDataAppend(pColInfoData, numOfRows, comment, false); + }else{ + colDataAppendNULL(pColInfoData, numOfRows); + } + // uid pColInfoData = taosArrayGet(p->pDataBlock, 5); colDataAppend(pColInfoData, numOfRows, (char*)&pInfo->pCur->mr.me.uid, false); @@ -1403,7 +1412,7 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) { pColInfoData = taosArrayGet(p->pDataBlock, 7); colDataAppend(pColInfoData, numOfRows, (char*)&pInfo->pCur->mr.me.ctbEntry.ttlDays, false); - STR_TO_VARSTR(str, "CHILD_TABLE"); + STR_TO_VARSTR(n, "CHILD_TABLE"); } else if (tableType == TSDB_NORMAL_TABLE) { // create time pColInfoData = taosArrayGet(p->pDataBlock, 2); @@ -1417,6 +1426,20 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) { pColInfoData = taosArrayGet(p->pDataBlock, 4); colDataAppendNULL(pColInfoData, numOfRows); + // table comment + pColInfoData = taosArrayGet(p->pDataBlock, 8); + if(pInfo->pCur->mr.me.ntbEntry.commentLen > 0) { + char comment[TSDB_TB_COMMENT_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(comment, pInfo->pCur->mr.me.ntbEntry.comment); + colDataAppend(pColInfoData, numOfRows, comment, false); + }else if(pInfo->pCur->mr.me.ntbEntry.commentLen == 0) { + char comment[VARSTR_HEADER_SIZE + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(comment, ""); + colDataAppend(pColInfoData, numOfRows, comment, false); + }else{ + colDataAppendNULL(pColInfoData, numOfRows); + } + // uid pColInfoData = taosArrayGet(p->pDataBlock, 5); colDataAppend(pColInfoData, numOfRows, (char*)&pInfo->pCur->mr.me.uid, false); @@ -1425,11 +1448,11 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) { pColInfoData = taosArrayGet(p->pDataBlock, 7); colDataAppend(pColInfoData, numOfRows, (char*)&pInfo->pCur->mr.me.ntbEntry.ttlDays, false); - STR_TO_VARSTR(str, "NORMAL_TABLE"); + STR_TO_VARSTR(n, "NORMAL_TABLE"); } pColInfoData = taosArrayGet(p->pDataBlock, 9); - colDataAppend(pColInfoData, numOfRows, str, false); + colDataAppend(pColInfoData, numOfRows, n, false); if (++numOfRows >= pOperator->resultInfo.capacity) { break; diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index a31bfab62d..f8650d95c1 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -24,6 +24,8 @@ typedef enum SResultTsInterpType { RESULT_ROW_END_INTERP = 2, } SResultTsInterpType; +#define IS_FINAL_OP(op) ((op)->isFinal) + static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator); static int64_t* extractTsCol(SSDataBlock* pBlock, const SIntervalAggOperatorInfo* pInfo); @@ -682,6 +684,13 @@ static void doInterpUnclosedTimeWindow(SOperatorInfo* pOperatorInfo, int32_t num } } +void printDataBlock(SSDataBlock* pBlock, const char* flag) { + SArray* blocks = taosArrayInit(1, sizeof(SSDataBlock)); + taosArrayPush(blocks, pBlock); + blockDebugShowData(blocks, flag); + taosArrayDestroy(blocks); +} + typedef int64_t (*__get_value_fn_t)(void* data, int32_t index); int32_t binarySearch(void* keyList, int num, TSKEY key, int order, __get_value_fn_t getValuefn) { @@ -2054,8 +2063,6 @@ _error: return NULL; } -bool isFinalInterval(SStreamFinalIntervalOperatorInfo* pInfo) { return pInfo->pChildren != NULL; } - void compactFunctions(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx, int32_t numOfOutput, SExecTaskInfo* pTaskInfo) { for (int32_t k = 0; k < numOfOutput; ++k) { @@ -2129,7 +2136,7 @@ static void doHashInterval(SOperatorInfo* pOperatorInfo, SSDataBlock* pSDataBloc STimeWindow nextWin = getActiveTimeWindow(pInfo->aggSup.pResultBuf, pResultRowInfo, ts, &pInfo->interval, pInfo->interval.precision, NULL); while (1) { - if (isFinalInterval(pInfo) && isCloseWindow(&nextWin, &pInfo->twAggSup) && + if (IS_FINAL_OP(pInfo) && isCloseWindow(&nextWin, &pInfo->twAggSup) && isDeletedWindow(&nextWin, tableGroupId, &pInfo->aggSup)) { SArray* pUpWins = taosArrayInit(8, sizeof(STimeWindow)); taosArrayPush(pUpWins, &nextWin); @@ -2150,9 +2157,6 @@ static void doHashInterval(SOperatorInfo* pOperatorInfo, SSDataBlock* pSDataBloc if (pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE && pUpdated) { saveResultRow(pResult, tableGroupId, pUpdated); } - // window start(end) key interpolation - // doWindowBorderInterpolation(pInfo, pSDataBlock, numOfOutput, pSup->pCtx, pResult, &nextWin, startPos, - // forwardRows); updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &nextWin, true); doApplyFunctions(pTaskInfo, pSup->pCtx, &nextWin, &pInfo->twAggSup.timeWindowData, startPos, forwardRows, tsCols, pSDataBlock->info.rows, numOfOutput, TSDB_ORDER_ASC); @@ -2214,8 +2218,8 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->aggSup.pResultBuf); if (pInfo->binfo.pRes->info.rows == 0) { pOperator->status = OP_EXEC_DONE; - if (isFinalInterval(pInfo) || pInfo->pUpdateRes->info.rows == 0) { - if (!isFinalInterval(pInfo)) { + if (IS_FINAL_OP(pInfo) || pInfo->pUpdateRes->info.rows == 0) { + if (!IS_FINAL_OP(pInfo)) { // semi interval operator clear disk buffer clearStreamIntervalOperator(pInfo); } @@ -2239,7 +2243,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { SArray* pUpWins = taosArrayInit(8, sizeof(STimeWindow)); doClearWindows(&pInfo->aggSup, pSup, &pInfo->interval, pInfo->primaryTsIndex, pOperator->exprSupp.numOfExprs, pBlock, pUpWins); - if (isFinalInterval(pInfo)) { + if (IS_FINAL_OP(pInfo)) { int32_t childIndex = getChildIndex(pBlock); SOperatorInfo* pChildOp = taosArrayGetP(pInfo->pChildren, childIndex); SIntervalAggOperatorInfo* pChildInfo = pChildOp->info; @@ -2256,14 +2260,14 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { copyUpdateDataBlock(pInfo->pUpdateRes, pBlock, pInfo->primaryTsIndex); taosArrayDestroy(pUpWins); break; - } else if (pBlock->info.type == STREAM_GET_ALL && isFinalInterval(pInfo)) { + } else if (pBlock->info.type == STREAM_GET_ALL && IS_FINAL_OP(pInfo)) { getAllIntervalWindow(pInfo->aggSup.pResultRowHashTable, pUpdated); continue; } setInputDataBlock(pOperator, pSup->pCtx, pBlock, pInfo->order, MAIN_SCAN, true); doHashInterval(pOperator, pBlock, pBlock->info.groupId, pUpdated); - if (isFinalInterval(pInfo)) { + if (IS_FINAL_OP(pInfo)) { int32_t chIndex = getChildIndex(pBlock); int32_t size = taosArrayGetSize(pInfo->pChildren); // if chIndex + 1 - size > 0, add new child @@ -2283,7 +2287,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { } pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, maxTs); - if (isFinalInterval(pInfo)) { + if (IS_FINAL_OP(pInfo)) { closeIntervalWindow(pInfo->aggSup.pResultRowHashTable, &pInfo->twAggSup, &pInfo->interval, pUpdated); } @@ -2356,7 +2360,7 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, } } // semi interval operator does not catch result - if (!isFinalInterval(pInfo)) { + if (!IS_FINAL_OP(pInfo)) { pInfo->twAggSup.calTrigger = STREAM_TRIGGER_AT_ONCE; } pInfo->pUpdateRes = createResDataBlock(pPhyNode->pOutputDataBlockDesc); @@ -2364,8 +2368,15 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, blockDataEnsureCapacity(pInfo->pUpdateRes, 128); pInfo->pPhyNode = (SPhysiNode*)nodesCloneNode((SNode*)pPhyNode); - pOperator->name = "StreamFinalIntervalOperator"; - pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL; + if (pPhyNode->type == QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL) { + pInfo->isFinal = true; + pOperator->name = "StreamFinalIntervalOperator"; + } else { + pInfo->isFinal = false; + pOperator->name = "StreamSemiIntervalOperator"; + } + + pOperator->operatorType = pPhyNode->type; pOperator->blocking = true; pOperator->status = OP_NOT_OPENED; pOperator->exprSupp.pExprInfo = pExprInfo; @@ -2455,7 +2466,6 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh int32_t numOfCols = 0; SExprInfo* pExprInfo = createExprInfo(pSessionNode->window.pFuncs, NULL, &numOfCols); SSDataBlock* pResBlock = createResDataBlock(pPhyNode->pOutputDataBlockDesc); - int32_t tsSlotId = ((SColumnNode*)pSessionNode->window.pTspk)->slotId; int32_t code = TSDB_CODE_OUT_OF_MEMORY; SStreamSessionAggOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SStreamSessionAggOperatorInfo)); SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); @@ -2491,7 +2501,10 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh initResultRowInfo(&pInfo->binfo.resultRowInfo); initExecTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pTaskInfo->window); - pInfo->primaryTsIndex = tsSlotId; + pInfo->primaryTsIndex = ((SColumnNode*)pSessionNode->window.pTspk)->slotId; + if (pSessionNode->window.pTsEnd) { + pInfo->endTsIndex = ((SColumnNode*)pSessionNode->window.pTsEnd)->slotId; + } pInfo->gap = pSessionNode->gap; pInfo->binfo.pRes = pResBlock; pInfo->order = TSDB_ORDER_ASC; @@ -2501,6 +2514,8 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh pInfo->pDelRes = createOneDataBlock(pResBlock, false); blockDataEnsureCapacity(pInfo->pDelRes, 64); pInfo->pChildren = NULL; + pInfo->isFinal = false; + pInfo->pPhyNode = pPhyNode; pOperator->name = "StreamSessionWindowAggOperator"; pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION; @@ -2513,8 +2528,10 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh createOperatorFpSet(operatorDummyOpenFn, doStreamSessionAgg, NULL, NULL, destroyStreamSessionAggOperatorInfo, aggEncodeResultRow, aggDecodeResultRow, NULL); pOperator->pTaskInfo = pTaskInfo; - initDownStream(downstream, &pInfo->streamAggSup, pInfo->gap, pInfo->twAggSup.waterMark, pOperator->operatorType); - code = appendDownstream(pOperator, &downstream, 1); + if (downstream) { + initDownStream(downstream, &pInfo->streamAggSup, pInfo->gap, pInfo->twAggSup.waterMark, pOperator->operatorType); + code = appendDownstream(pOperator, &downstream, 1); + } return pOperator; _error: @@ -2564,21 +2581,22 @@ SArray* getWinInfos(SStreamAggSupporter* pAggSup, uint64_t groupId) { return pWinInfos; } -SResultWindowInfo* getSessionTimeWindow(SStreamAggSupporter* pAggSup, TSKEY ts, uint64_t groupId, int64_t gap, int32_t* pIndex) { +SResultWindowInfo* getSessionTimeWindow(SStreamAggSupporter* pAggSup, TSKEY startTs, + TSKEY endTs, uint64_t groupId, int64_t gap, int32_t* pIndex) { SArray* pWinInfos = getWinInfos(pAggSup, groupId); pAggSup->pCurWins = pWinInfos; int32_t size = taosArrayGetSize(pWinInfos); if (size == 0) { *pIndex = 0; - return addNewSessionWindow(pWinInfos, ts); + return addNewSessionWindow(pWinInfos, startTs); } // find the first position which is smaller than the key - int32_t index = binarySearch(pWinInfos, size, ts, TSDB_ORDER_DESC, getSessionWindowEndkey); + int32_t index = binarySearch(pWinInfos, size, startTs, TSDB_ORDER_DESC, getSessionWindowEndkey); SResultWindowInfo* pWin = NULL; if (index >= 0) { pWin = taosArrayGet(pWinInfos, index); - if (isInWindow(pWin, ts, gap)) { + if (isInWindow(pWin, startTs, gap)) { *pIndex = index; return pWin; } @@ -2586,34 +2604,40 @@ SResultWindowInfo* getSessionTimeWindow(SStreamAggSupporter* pAggSup, TSKEY ts, if (index + 1 < size) { pWin = taosArrayGet(pWinInfos, index + 1); - if (isInWindow(pWin, ts, gap)) { + if (isInWindow(pWin, startTs, gap)) { *pIndex = index + 1; return pWin; + } else if (endTs != INT64_MIN && isInWindow(pWin, endTs, gap)) { + *pIndex = index; + return pWin; } } if (index == size - 1) { *pIndex = taosArrayGetSize(pWinInfos); - return addNewSessionWindow(pWinInfos, ts); + return addNewSessionWindow(pWinInfos, startTs); } *pIndex = index + 1; - return insertNewSessionWindow(pWinInfos, ts, index + 1); + return insertNewSessionWindow(pWinInfos, startTs, index + 1); } -int32_t updateSessionWindowInfo(SResultWindowInfo* pWinInfo, TSKEY* pTs, int32_t rows, int32_t start, int64_t gap, - SHashObj* pStDeleted) { +int32_t updateSessionWindowInfo(SResultWindowInfo* pWinInfo, TSKEY* pStartTs, + TSKEY* pEndTs, int32_t rows, int32_t start, int64_t gap, SHashObj* pStDeleted) { for (int32_t i = start; i < rows; ++i) { - if (!isInWindow(pWinInfo, pTs[i], gap)) { + if (!isInWindow(pWinInfo, pStartTs[i], gap) && (!pEndTs || !isInWindow(pWinInfo, pEndTs[i], gap)) ) { return i - start; } - if (pWinInfo->win.skey > pTs[i]) { + if (pWinInfo->win.skey > pStartTs[i]) { if (pStDeleted && pWinInfo->isOutput) { taosHashPut(pStDeleted, &pWinInfo->pos, sizeof(SResultRowPosition), &pWinInfo->win.skey, sizeof(TSKEY)); pWinInfo->isOutput = false; } - pWinInfo->win.skey = pTs[i]; + pWinInfo->win.skey = pStartTs[i]; + } + pWinInfo->win.ekey = TMAX(pWinInfo->win.ekey, pStartTs[i]); + if (pEndTs) { + pWinInfo->win.ekey = TMAX(pWinInfo->win.ekey, pEndTs[i]); } - pWinInfo->win.ekey = TMAX(pWinInfo->win.ekey, pTs[i]); } return rows - start; } @@ -2666,7 +2690,7 @@ static int32_t doOneWindowAggImpl(int32_t tsColId, SOptrBasicInfo* pBinfo, SStre if (code != TSDB_CODE_SUCCESS || (*pResult) == NULL) { return TSDB_CODE_QRY_OUT_OF_MEMORY; } - updateTimeWindowInfo(pTimeWindowData, &pCurWin->win, true); + updateTimeWindowInfo(pTimeWindowData, &pCurWin->win, false); doApplyFunctions(pTaskInfo, pSup->pCtx, &pCurWin->win, pTimeWindowData, startIndex, winRows, tsCols, pSDataBlock->info.rows, numOutput, TSDB_ORDER_ASC); return TSDB_CODE_SUCCESS; @@ -2733,8 +2757,8 @@ typedef struct SWinRes { uint64_t groupId; } SWinRes; -static void doStreamSessionAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDataBlock, SHashObj* pStUpdated, - SHashObj* pStDeleted) { +static void doStreamSessionAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDataBlock, + SHashObj* pStUpdated, SHashObj* pStDeleted, bool hasEndTs) { SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; SStreamSessionAggOperatorInfo* pInfo = pOperator->info; bool masterScan = true; @@ -2745,13 +2769,21 @@ static void doStreamSessionAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSData int32_t step = 1; bool ascScan = true; - TSKEY* tsCols = NULL; + TSKEY* startTsCols = NULL; + TSKEY* endTsCols = NULL; SResultRow* pResult = NULL; int32_t winRows = 0; if (pSDataBlock->pDataBlock != NULL) { - SColumnInfoData* pColDataInfo = taosArrayGet(pSDataBlock->pDataBlock, pInfo->primaryTsIndex); - tsCols = (int64_t*)pColDataInfo->pData; + SColumnInfoData* pStartTsCol = taosArrayGet(pSDataBlock->pDataBlock, pInfo->primaryTsIndex); + startTsCols = (int64_t*) pStartTsCol->pData; + SColumnInfoData* pEndTsCol = NULL; + if (hasEndTs) { + pEndTsCol = taosArrayGet(pSDataBlock->pDataBlock, pInfo->endTsIndex); + } else { + pEndTsCol = taosArrayGet(pSDataBlock->pDataBlock, pInfo->primaryTsIndex); + } + endTsCols = (int64_t*) pEndTsCol->pData; } else { return; } @@ -2759,22 +2791,21 @@ static void doStreamSessionAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSData SStreamAggSupporter* pAggSup = &pInfo->streamAggSup; for (int32_t i = 0; i < pSDataBlock->info.rows;) { int32_t winIndex = 0; - SResultWindowInfo* pCurWin = getSessionTimeWindow(pAggSup, tsCols[i], groupId, gap, &winIndex); - winRows = updateSessionWindowInfo(pCurWin, tsCols, pSDataBlock->info.rows, i, pInfo->gap, pStDeleted); + SResultWindowInfo* pCurWin = getSessionTimeWindow(pAggSup, startTsCols[i], + endTsCols[i], groupId, gap, &winIndex); + winRows = updateSessionWindowInfo(pCurWin, startTsCols, endTsCols, + pSDataBlock->info.rows, i, pInfo->gap, pStDeleted); code = doOneWindowAgg(pInfo, pSDataBlock, pCurWin, &pResult, i, winRows, numOfOutput, pOperator); if (code != TSDB_CODE_SUCCESS || pResult == NULL) { longjmp(pTaskInfo->env, TSDB_CODE_QRY_OUT_OF_MEMORY); } - // window start(end) key interpolation - // doWindowBorderInterpolation(pOperatorInfo, pSDataBlock, pSup->pCtx, pResult, &nextWin, startPos, - // forwardRows, - // pInfo->order, false); + int32_t winNum = getNumCompactWindow(pAggSup->pCurWins, winIndex, gap); if (winNum > 0) { compactTimeWindow(pInfo, winIndex, winNum, groupId, numOfOutput, pStUpdated, pStDeleted, pOperator); } pCurWin->isClosed = false; - if (pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE) { + if (pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE && pStUpdated) { SWinRes value = {.ts = pCurWin->win.skey, .groupId = groupId}; code = taosHashPut(pStUpdated, &pCurWin->pos, sizeof(SResultRowPosition), &value, sizeof(SWinRes)); if (code != TSDB_CODE_SUCCESS) { @@ -2793,8 +2824,8 @@ static void doClearSessionWindows(SStreamAggSupporter* pAggSup, SExprSupp* pSup, int32_t step = 0; for (int32_t i = 0; i < pBlock->info.rows; i += step) { int32_t winIndex = 0; - SResultWindowInfo* pCurWin = getSessionTimeWindow(pAggSup, tsCols[i], pBlock->info.groupId, gap, &winIndex); - step = updateSessionWindowInfo(pCurWin, tsCols, pBlock->info.rows, i, gap, NULL); + SResultWindowInfo* pCurWin = getSessionTimeWindow(pAggSup, tsCols[i], INT64_MIN, pBlock->info.groupId, gap, &winIndex); + step = updateSessionWindowInfo(pCurWin, tsCols, NULL, pBlock->info.rows, i, gap, NULL); ASSERT(isInWindow(pCurWin, tsCols[i], gap)); doClearWindowImpl(&pCurWin->pos, pAggSup->pResultBuf, pSup, numOfOutput); if (result) { @@ -2876,11 +2907,9 @@ static void rebuildTimeWindow(SStreamSessionAggOperatorInfo* pInfo, SArray* pWin } } -bool isFinalSession(SStreamSessionAggOperatorInfo* pInfo) { return pInfo->pChildren != NULL; } - typedef SResultWindowInfo* (*__get_win_info_)(void*); -SResultWindowInfo* getSessionWinInfo(void* pData) { return (SResultWindowInfo*)pData; } -SResultWindowInfo* getStateWinInfo(void* pData) { return &((SStateWindowInfo*)pData)->winInfo; } +SResultWindowInfo* getResWinForSession(void* pData) { return (SResultWindowInfo*)pData; } +SResultWindowInfo* getResWinForState(void* pData) { return &((SStateWindowInfo*)pData)->winInfo; } int32_t closeSessionWindow(SHashObj* pHashMap, STimeWindowAggSupp* pTwSup, SArray* pClosed, __get_win_info_ fn) { @@ -2928,14 +2957,13 @@ int32_t getAllSessionWindow(SHashObj* pHashMap, SArray* pClosed, __get_win_info_ } static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) { - if (pOperator->status == OP_EXEC_DONE) { - return NULL; - } - - SExprSupp* pSup = &pOperator->exprSupp; + SExprSupp* pSup = &pOperator->exprSupp; SStreamSessionAggOperatorInfo* pInfo = pOperator->info; SOptrBasicInfo* pBInfo = &pInfo->binfo; - if (pOperator->status == OP_RES_TO_RETURN) { + TSKEY maxTs = INT64_MIN; + if (pOperator->status == OP_EXEC_DONE) { + return NULL; + } else if (pOperator->status == OP_RES_TO_RETURN) { doBuildDeleteDataBlock(pInfo->pStDeleted, pInfo->pDelRes, &pInfo->pDelIterator); if (pInfo->pDelRes->info.rows > 0) { return pInfo->pDelRes; @@ -2960,8 +2988,8 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) { if (pBlock->info.type == STREAM_REPROCESS) { SArray* pWins = taosArrayInit(16, sizeof(SResultWindowInfo)); doClearSessionWindows(&pInfo->streamAggSup, &pOperator->exprSupp, pBlock, 0, pOperator->exprSupp.numOfExprs, pInfo->gap, pWins); - if (isFinalSession(pInfo)) { - int32_t childIndex = 0; // Todo(liuyao) get child id from SSDataBlock + if (IS_FINAL_OP(pInfo)) { + int32_t childIndex = getChildIndex(pBlock); SOperatorInfo* pChildOp = taosArrayGetP(pInfo->pChildren, childIndex); SStreamSessionAggOperatorInfo* pChildInfo = pChildOp->info; doClearSessionWindows(&pChildInfo->streamAggSup, &pChildOp->exprSupp, pBlock, 0, pChildOp->exprSupp.numOfExprs, @@ -2971,25 +2999,139 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) { taosArrayDestroy(pWins); continue; } else if (pBlock->info.type == STREAM_GET_ALL) { - getAllSessionWindow(pInfo->streamAggSup.pResultRows, pUpdated, getSessionWinInfo); + getAllSessionWindow(pInfo->streamAggSup.pResultRows, pUpdated, getResWinForSession); continue; } // the pDataBlock are always the same one, no need to call this again setInputDataBlock(pOperator, pSup->pCtx, pBlock, TSDB_ORDER_ASC, MAIN_SCAN, true); - if (isFinalSession(pInfo)) { - int32_t childIndex = 0; // Todo(liuyao) get child id from SSDataBlock - SOptrBasicInfo* pChildOp = taosArrayGetP(pInfo->pChildren, childIndex); - doStreamSessionAggImpl(pOperator, pBlock, NULL, NULL); + doStreamSessionAggImpl(pOperator, pBlock, pStUpdated, pInfo->pStDeleted, IS_FINAL_OP(pInfo)); + if (IS_FINAL_OP(pInfo)) { + int32_t chIndex = getChildIndex(pBlock); + int32_t size = taosArrayGetSize(pInfo->pChildren); + // if chIndex + 1 - size > 0, add new child + for (int32_t i = 0; i < chIndex + 1 - size; i++) { + SOperatorInfo* pChildOp = createStreamFinalSessionAggOperatorInfo(NULL, pInfo->pPhyNode, pOperator->pTaskInfo, 0); + if (!pChildOp) { + longjmp(pOperator->pTaskInfo->env, TSDB_CODE_QRY_OUT_OF_MEMORY); + } + taosArrayPush(pInfo->pChildren, &pChildOp); + } + SOperatorInfo* pChildOp = taosArrayGetP(pInfo->pChildren, chIndex); + setInputDataBlock(pChildOp, pChildOp->exprSupp.pCtx, pBlock, TSDB_ORDER_ASC, MAIN_SCAN, true); + doStreamSessionAggImpl(pChildOp, pBlock, NULL, NULL, true); } - doStreamSessionAggImpl(pOperator, pBlock, pStUpdated, pInfo->pStDeleted); - pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, pBlock->info.window.ekey); + maxTs = TMAX(maxTs, pBlock->info.window.ekey); } + + pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, maxTs); // restore the value pOperator->status = OP_RES_TO_RETURN; closeSessionWindow(pInfo->streamAggSup.pResultRows, &pInfo->twAggSup, pUpdated, - getSessionWinInfo); + getResWinForSession); + copyUpdateResult(pStUpdated, pUpdated); + taosHashCleanup(pStUpdated); + + finalizeUpdatedResult(pSup->numOfExprs, pInfo->streamAggSup.pResultBuf, pUpdated, + pSup->rowEntryInfoOffset); + initMultiResInfoFromArrayList(&pInfo->groupResInfo, pUpdated); + blockDataEnsureCapacity(pInfo->binfo.pRes, pOperator->resultInfo.capacity); + doBuildDeleteDataBlock(pInfo->pStDeleted, pInfo->pDelRes, &pInfo->pDelIterator); + if (pInfo->pDelRes->info.rows > 0) { + return pInfo->pDelRes; + } + doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->streamAggSup.pResultBuf); + return pBInfo->pRes->info.rows == 0 ? NULL : pBInfo->pRes; +} + +static void clearStreamSessionOperator(SStreamSessionAggOperatorInfo* pInfo) { + void **pIte = NULL; + while ((pIte = taosHashIterate(pInfo->streamAggSup.pResultRows, pIte)) != NULL) { + SArray *pWins = (SArray *) (*pIte); + int32_t size = taosArrayGetSize(pWins); + for (int32_t i = 0; i < size; i++) { + SResultWindowInfo* pWin = (SResultWindowInfo*)taosArrayGet(pWins, i); + pWin->pos.pageId = -1; + pWin->pos.offset = -1; + } + } + clearDiskbasedBuf(pInfo->streamAggSup.pResultBuf); + cleanupResultRowInfo(&pInfo->binfo.resultRowInfo); + initResultRowInfo(&pInfo->binfo.resultRowInfo); +} + +static void removeSessionResults(SHashObj* pHashMap, SArray* pWins) { + int32_t size = taosArrayGetSize(pWins); + for (int32_t i = 0; i < size; i++) { + SResultWindowInfo* pWin = taosArrayGet(pWins, i); + taosHashRemove(pHashMap, &pWin->pos, sizeof(SResultRowPosition)); + } +} + +static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) { + SStreamSessionAggOperatorInfo* pInfo = pOperator->info; + SOptrBasicInfo* pBInfo = &pInfo->binfo; + TSKEY maxTs = INT64_MIN; + SExprSupp* pSup = &pOperator->exprSupp; + + if (pOperator->status == OP_EXEC_DONE) { + return NULL; + } else if (pOperator->status == OP_RES_TO_RETURN) { + doBuildDeleteDataBlock(pInfo->pStDeleted, pInfo->pDelRes, &pInfo->pDelIterator); + if (pInfo->pDelRes->info.rows > 0) { + return pInfo->pDelRes; + } + doBuildResultDatablock(pOperator, pBInfo, &pInfo->groupResInfo, pInfo->streamAggSup.pResultBuf); + if (pInfo->binfo.pRes->info.rows == 0) { + pOperator->status = OP_EXEC_DONE; + if (pInfo->pUpdateRes->info.rows == 0) { + // semi interval operator clear disk buffer + clearStreamSessionOperator(pInfo); + return NULL; + } + // process the rest of the data + pOperator->status = OP_OPENED; + return pInfo->pUpdateRes; + } + return pInfo->binfo.pRes; + } + + _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); + SHashObj* pStUpdated = taosHashInit(64, hashFn, true, HASH_NO_LOCK); + SOperatorInfo* downstream = pOperator->pDownstream[0]; + SArray* pUpdated = taosArrayInit(16, POINTER_BYTES); + while (1) { + SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream); + if (pBlock == NULL) { + clearUpdateDataBlock(pInfo->pUpdateRes); + break; + } + + if (pBlock->info.type == STREAM_REPROCESS) { + SArray* pWins = taosArrayInit(16, sizeof(SResultWindowInfo)); + doClearSessionWindows(&pInfo->streamAggSup, pSup, pBlock, 0, pSup->numOfExprs, pInfo->gap, pWins); + removeSessionResults(pStUpdated, pWins); + taosArrayDestroy(pWins); + copyUpdateDataBlock(pInfo->pUpdateRes, pBlock, pInfo->primaryTsIndex); + break; + } else if (pBlock->info.type == STREAM_GET_ALL) { + getAllSessionWindow(pInfo->streamAggSup.pResultRows, pUpdated, getResWinForSession); + continue; + } + + // the pDataBlock are always the same one, no need to call this again + setInputDataBlock(pOperator, pSup->pCtx, pBlock, TSDB_ORDER_ASC, MAIN_SCAN, true); + doStreamSessionAggImpl(pOperator, pBlock, pStUpdated, pInfo->pStDeleted, false); + maxTs = TMAX(pInfo->twAggSup.maxTs, pBlock->info.window.ekey); + } + + pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, maxTs); + // restore the value + pOperator->status = OP_RES_TO_RETURN; + // semi operator + // closeSessionWindow(pInfo->streamAggSup.pResultRows, &pInfo->twAggSup, pUpdated, + // getResWinForSession); copyUpdateResult(pStUpdated, pUpdated); taosHashCleanup(pStUpdated); @@ -3002,6 +3144,15 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) { return pInfo->pDelRes; } doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->streamAggSup.pResultBuf); + if (pInfo->binfo.pRes->info.rows == 0) { + pOperator->status = OP_EXEC_DONE; + if (pInfo->pUpdateRes->info.rows == 0) { + return NULL; + } + // process the rest of the data + pOperator->status = OP_OPENED; + return pInfo->pUpdateRes; + } return pBInfo->pRes->info.rows == 0 ? NULL : pBInfo->pRes; } @@ -3012,17 +3163,32 @@ SOperatorInfo* createStreamFinalSessionAggOperatorInfo(SOperatorInfo* downstream if (pOperator == NULL) { goto _error; } - pOperator->name = "StreamFinalSessionWindowAggOperator"; - pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_SESSION; SStreamSessionAggOperatorInfo* pInfo = pOperator->info; - pInfo->pChildren = taosArrayInit(8, sizeof(void*)); - for (int32_t i = 0; i < numOfChild; i++) { - SOperatorInfo* pChild = - createStreamSessionAggOperatorInfo(NULL, pPhyNode, pTaskInfo); - if (pChild == NULL) { - goto _error; + + if (pPhyNode->type == QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_SESSION) { + pInfo->isFinal = true; + pOperator->name = "StreamSessionFinalAggOperator"; + } else { + pInfo->isFinal = false; + pInfo->pUpdateRes = createResDataBlock(pPhyNode->pOutputDataBlockDesc); + pInfo->pUpdateRes->info.type = STREAM_REPROCESS; + blockDataEnsureCapacity(pInfo->pUpdateRes, 128); + pOperator->name = "StreamSessionSemiAggOperator"; + pOperator->fpSet = + createOperatorFpSet(operatorDummyOpenFn, doStreamSessionSemiAgg, NULL, NULL, destroyStreamSessionAggOperatorInfo, + aggEncodeResultRow, aggDecodeResultRow, NULL); + } + pOperator->operatorType = pPhyNode->type; + if (numOfChild > 0) { + pInfo->pChildren = taosArrayInit(numOfChild, sizeof(void*)); + for (int32_t i = 0; i < numOfChild; i++) { + SOperatorInfo* pChild = + createStreamFinalSessionAggOperatorInfo(NULL, pPhyNode, pTaskInfo, 0); + if (pChild == NULL) { + goto _error; + } + taosArrayPush(pInfo->pChildren, &pChild); } - taosArrayPush(pInfo->pChildren, &pChild); } return pOperator; @@ -3331,7 +3497,7 @@ static SSDataBlock* doStreamStateAgg(SOperatorInfo* pOperator) { pSeUpdated, pInfo->pSeDeleted); continue; } else if (pBlock->info.type == STREAM_GET_ALL) { - getAllSessionWindow(pInfo->streamAggSup.pResultRows, pUpdated, getStateWinInfo); + getAllSessionWindow(pInfo->streamAggSup.pResultRows, pUpdated, getResWinForState); continue; } @@ -3344,7 +3510,7 @@ static SSDataBlock* doStreamStateAgg(SOperatorInfo* pOperator) { pOperator->status = OP_RES_TO_RETURN; closeSessionWindow(pInfo->streamAggSup.pResultRows, &pInfo->twAggSup, pUpdated, - getStateWinInfo); + getResWinForState); copyUpdateResult(pSeUpdated, pUpdated); taosHashCleanup(pSeUpdated); diff --git a/source/libs/function/inc/builtins.h b/source/libs/function/inc/builtins.h index bc91875006..256500ff8c 100644 --- a/source/libs/function/inc/builtins.h +++ b/source/libs/function/inc/builtins.h @@ -24,22 +24,24 @@ extern "C" { typedef int32_t (*FTranslateFunc)(SFunctionNode* pFunc, char* pErrBuf, int32_t len); typedef EFuncDataRequired (*FFuncDataRequired)(SFunctionNode* pFunc, STimeWindow* pTimeWindow); +typedef int32_t (*FCreateMergeFuncParameters)(SNodeList* pRawParameters, SNode* pPartialRes, SNodeList** pParameters); typedef struct SBuiltinFuncDefinition { - const char* name; - EFunctionType type; - uint64_t classification; - FTranslateFunc translateFunc; - FFuncDataRequired dataRequiredFunc; - FExecGetEnv getEnvFunc; - FExecInit initFunc; - FExecProcess processFunc; - FScalarExecProcess sprocessFunc; - FExecFinalize finalizeFunc; - FExecProcess invertFunc; - FExecCombine combineFunc; - const char* pPartialFunc; - const char* pMergeFunc; + const char* name; + EFunctionType type; + uint64_t classification; + FTranslateFunc translateFunc; + FFuncDataRequired dataRequiredFunc; + FExecGetEnv getEnvFunc; + FExecInit initFunc; + FExecProcess processFunc; + FScalarExecProcess sprocessFunc; + FExecFinalize finalizeFunc; + FExecProcess invertFunc; + FExecCombine combineFunc; + const char* pPartialFunc; + const char* pMergeFunc; + FCreateMergeFuncParameters createMergeParaFuc; } SBuiltinFuncDefinition; extern const SBuiltinFuncDefinition funcMgtBuiltins[]; diff --git a/source/libs/function/inc/functionMgtInt.h b/source/libs/function/inc/functionMgtInt.h index c02c09e18a..44e1e6f7b1 100644 --- a/source/libs/function/inc/functionMgtInt.h +++ b/source/libs/function/inc/functionMgtInt.h @@ -51,8 +51,6 @@ extern "C" { #define FUNC_UDF_ID_START 5000 -extern const int funcMgtUdfNum; - #ifdef __cplusplus } #endif diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index e1375e8a6f..522ee09b3c 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -419,6 +419,14 @@ static int32_t translateTopBot(SFunctionNode* pFunc, char* pErrBuf, int32_t len) return TSDB_CODE_SUCCESS; } +int32_t topCreateMergePara(SNodeList* pRawParameters, SNode* pPartialRes, SNodeList** pParameters) { + int32_t code = nodesListMakeAppend(pParameters, pPartialRes); + if (TSDB_CODE_SUCCESS == code) { + code = nodesListStrictAppend(*pParameters, nodesCloneNode(nodesListGetNode(pRawParameters, 1))); + } + return TSDB_CODE_SUCCESS; +} + static int32_t translateTopBotImpl(SFunctionNode* pFunc, char* pErrBuf, int32_t len, bool isPartial) { int32_t numOfParams = LIST_LENGTH(pFunc->pParameterList); @@ -1508,6 +1516,11 @@ static int32_t translateBlockDistFunc(SFunctionNode* pFunc, char* pErrBuf, int32 return TSDB_CODE_SUCCESS; } +static int32_t translateBlockDistInfoFunc(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + pFunc->node.resType = (SDataType){.bytes = 128, .type = TSDB_DATA_TYPE_VARCHAR}; + return TSDB_CODE_SUCCESS; +} + static bool getBlockDistFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { pEnv->calcMemSize = sizeof(STableBlockDistInfo); return true; @@ -1723,7 +1736,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .finalizeFunc = topBotFinalize, .combineFunc = topCombine, .pPartialFunc = "_top_partial", - .pMergeFunc = "_top_merge" + .pMergeFunc = "_top_merge", + // .createMergeParaFuc = topCreateMergePara }, { .name = "_top_partial", @@ -1867,7 +1881,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "interp", .type = FUNCTION_TYPE_INTERP, - .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_INTERVAL_INTERPO_FUNC, + .classification = FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_INTERVAL_INTERPO_FUNC, .translateFunc = translateFirstLast, .getEnvFunc = getSelectivityFuncEnv, .initFunc = functionSetup, @@ -2520,6 +2534,12 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .getEnvFunc = getBlockDistFuncEnv, .processFunc = blockDistFunction, .finalizeFunc = blockDistFinalize + }, + { + .name = "_block_dist_info", + .type = FUNCTION_TYPE_BLOCK_DIST_INFO, + .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_SCAN_PC_FUNC, + .translateFunc = translateBlockDistInfoFunc, } }; // clang-format on diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 55900c7c7e..583e8bd300 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -794,8 +794,8 @@ int32_t avgFunctionMerge(SqlFunctionCtx* pCtx) { SAvgRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); + int32_t start = pInput->startRowIndex; + char* data = colDataGetData(pCol, start); SAvgRes* pInputInfo = (SAvgRes*)varDataVal(data); avgTransferInfo(pInputInfo, pInfo); @@ -908,9 +908,9 @@ int32_t avgFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t avgPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SAvgRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t resultBytes = getAvgInfoSize(); - char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); + SAvgRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + int32_t resultBytes = getAvgInfoSize(); + char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); memcpy(varDataVal(res), pInfo, resultBytes); varDataSetLen(res, resultBytes); @@ -1418,7 +1418,7 @@ int32_t minmaxFunctionFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { void setNullSelectivityValue(SqlFunctionCtx* pCtx, SSDataBlock* pBlock, int32_t rowIndex) { for (int32_t j = 0; j < pCtx->subsidiaries.num; ++j) { SqlFunctionCtx* pc = pCtx->subsidiaries.pCtx[j]; - int32_t dstSlotId = pc->pExpr->base.resSchema.slotId; + int32_t dstSlotId = pc->pExpr->base.resSchema.slotId; SColumnInfoData* pDstCol = taosArrayGet(pBlock->pDataBlock, dstSlotId); colDataAppendNULL(pDstCol, rowIndex); @@ -1663,8 +1663,8 @@ int32_t stddevFunctionMerge(SqlFunctionCtx* pCtx) { SStddevRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); + int32_t start = pInput->startRowIndex; + char* data = colDataGetData(pCol, start); SStddevRes* pInputInfo = (SStddevRes*)varDataVal(data); stddevTransferInfo(pInputInfo, pInfo); @@ -1756,9 +1756,9 @@ int32_t stddevFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t stddevPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SStddevRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t resultBytes = getStddevInfoSize(); - char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); + SStddevRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + int32_t resultBytes = getStddevInfoSize(); + char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); memcpy(varDataVal(res), pInfo, resultBytes); varDataSetLen(res, resultBytes); @@ -2360,12 +2360,10 @@ int32_t apercentileCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) return TSDB_CODE_SUCCESS; } -int32_t getFirstLastInfoSize(int32_t resBytes) { - return sizeof(SFirstLastRes) + resBytes + sizeof(int64_t); -} +int32_t getFirstLastInfoSize(int32_t resBytes) { return sizeof(SFirstLastRes) + resBytes + sizeof(int64_t); } bool getFirstLastFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { - SColumnNode* pNode = (SColumnNode *)nodesListGetNode(pFunc->pParameterList, 0); + SColumnNode* pNode = (SColumnNode*)nodesListGetNode(pFunc->pParameterList, 0); pEnv->calcMemSize = sizeof(SFirstLastRes) + pNode->node.resType.bytes + sizeof(int64_t); return true; } @@ -2390,14 +2388,14 @@ int32_t firstFunction(SqlFunctionCtx* pCtx) { int32_t numOfElems = 0; SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SFirstLastRes *pInfo = GET_ROWCELL_INTERBUF(pResInfo); + SFirstLastRes* pInfo = GET_ROWCELL_INTERBUF(pResInfo); SInputColumnInfoData* pInput = &pCtx->input; SColumnInfoData* pInputCol = pInput->pData[0]; - int32_t type = pInputCol->info.type; + int32_t type = pInputCol->info.type; int32_t bytes = pInputCol->info.bytes; - pInfo->bytes = bytes; + pInfo->bytes = bytes; // All null data column, return directly. if (pInput->colDataAggIsSet && (pInput->pColumnDataAgg[0]->numOfNull == pInput->totalRows)) { @@ -2488,14 +2486,14 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) { int32_t numOfElems = 0; SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SFirstLastRes *pInfo = GET_ROWCELL_INTERBUF(pResInfo); + SFirstLastRes* pInfo = GET_ROWCELL_INTERBUF(pResInfo); SInputColumnInfoData* pInput = &pCtx->input; SColumnInfoData* pInputCol = pInput->pData[0]; - int32_t type = pInputCol->info.type; + int32_t type = pInputCol->info.type; int32_t bytes = pInputCol->info.bytes; - pInfo->bytes = bytes; + pInfo->bytes = bytes; // All null data column, return directly. if (pInput->colDataAggIsSet && (pInput->pColumnDataAgg[0]->numOfNull == pInput->totalRows)) { @@ -2567,8 +2565,8 @@ static void firstLastTransferInfo(SFirstLastRes* pInput, SFirstLastRes* pOutput, return; } pOutput->bytes = pInput->bytes; - TSKEY *tsIn = (TSKEY*)(pInput->buf + pInput->bytes); - TSKEY *tsOut = (TSKEY*)(pOutput->buf + pInput->bytes); + TSKEY* tsIn = (TSKEY*)(pInput->buf + pInput->bytes); + TSKEY* tsOut = (TSKEY*)(pOutput->buf + pInput->bytes); if (pOutput->hasResult) { if (isFirst) { if (*tsIn > *tsOut) { @@ -2586,16 +2584,16 @@ static void firstLastTransferInfo(SFirstLastRes* pInput, SFirstLastRes* pOutput, return; } -static int32_t firstLastFunctionMergeImpl(SqlFunctionCtx *pCtx, bool isFirstQuery) { +static int32_t firstLastFunctionMergeImpl(SqlFunctionCtx* pCtx, bool isFirstQuery) { SInputColumnInfoData* pInput = &pCtx->input; - SColumnInfoData* pCol = pInput->pData[0]; + SColumnInfoData* pCol = pInput->pData[0]; ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY); SFirstLastRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); - SFirstLastRes* pInputInfo = (SFirstLastRes *)varDataVal(data); + int32_t start = pInput->startRowIndex; + char* data = colDataGetData(pCol, start); + SFirstLastRes* pInputInfo = (SFirstLastRes*)varDataVal(data); firstLastTransferInfo(pInputInfo, pInfo, isFirstQuery); @@ -2604,13 +2602,9 @@ static int32_t firstLastFunctionMergeImpl(SqlFunctionCtx *pCtx, bool isFirstQuer return TSDB_CODE_SUCCESS; } -int32_t firstFunctionMerge(SqlFunctionCtx *pCtx) { - return firstLastFunctionMergeImpl(pCtx, true); -} +int32_t firstFunctionMerge(SqlFunctionCtx* pCtx) { return firstLastFunctionMergeImpl(pCtx, true); } -int32_t lastFunctionMerge(SqlFunctionCtx *pCtx) { - return firstLastFunctionMergeImpl(pCtx, false); -} +int32_t lastFunctionMerge(SqlFunctionCtx* pCtx) { return firstLastFunctionMergeImpl(pCtx, false); } int32_t firstLastFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t slotId = pCtx->pExpr->base.resSchema.slotId; @@ -2627,9 +2621,9 @@ int32_t firstLastFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t firstLastPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pEntryInfo = GET_RES_INFO(pCtx); - SFirstLastRes* pRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t resultBytes = getFirstLastInfoSize(pRes->bytes); - char *res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); + SFirstLastRes* pRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + int32_t resultBytes = getFirstLastInfoSize(pRes->bytes); + char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); memcpy(varDataVal(res), pRes, resultBytes); varDataSetLen(res, resultBytes); @@ -3369,8 +3363,8 @@ int32_t spreadFunctionMerge(SqlFunctionCtx* pCtx) { SSpreadInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); + int32_t start = pInput->startRowIndex; + char* data = colDataGetData(pCol, start); SSpreadInfo* pInputInfo = (SSpreadInfo*)varDataVal(data); spreadTransferInfo(pInputInfo, pInfo); @@ -3390,9 +3384,9 @@ int32_t spreadFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t spreadPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SSpreadInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t resultBytes = getSpreadInfoSize(); - char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); + SSpreadInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + int32_t resultBytes = getSpreadInfoSize(); + char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); memcpy(varDataVal(res), pInfo, resultBytes); varDataSetLen(res, resultBytes); @@ -3484,8 +3478,8 @@ int32_t elapsedFunction(SqlFunctionCtx* pCtx) { SColumnInfoData* pCol = pInput->pData[0]; - int32_t start = pInput->startRowIndex; - TSKEY* ptsList = (int64_t*)colDataGetData(pCol, 0); + int32_t start = pInput->startRowIndex; + TSKEY* ptsList = (int64_t*)colDataGetData(pCol, 0); if (pCtx->order == TSDB_ORDER_DESC) { if (pCtx->start.key == INT64_MIN) { pInfo->max = @@ -5176,11 +5170,11 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { } typedef struct SDerivInfo { - double prevValue; // previous value - TSKEY prevTs; // previous timestamp - bool ignoreNegative;// ignore the negative value - int64_t tsWindow; // time window for derivative - bool valueSet; // the value has been set already + double prevValue; // previous value + TSKEY prevTs; // previous timestamp + bool ignoreNegative; // ignore the negative value + int64_t tsWindow; // time window for derivative + bool valueSet; // the value has been set already } SDerivInfo; bool getDerivativeFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv) { @@ -5188,7 +5182,7 @@ bool getDerivativeFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv) { return true; } -bool derivativeFuncSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResInfo) { +bool derivativeFuncSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) { if (!functionSetup(pCtx, pResInfo)) { return false; // not initialized since it has been initialized } @@ -5196,25 +5190,25 @@ bool derivativeFuncSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResInfo) { SDerivInfo* pDerivInfo = GET_ROWCELL_INTERBUF(pResInfo); pDerivInfo->ignoreNegative = pCtx->param[2].param.i; - pDerivInfo->prevTs = -1; + pDerivInfo->prevTs = -1; pDerivInfo->tsWindow = pCtx->param[1].param.i; pDerivInfo->valueSet = false; return true; } -int32_t derivativeFunction(SqlFunctionCtx *pCtx) { - SResultRowEntryInfo *pResInfo = GET_RES_INFO(pCtx); - SDerivInfo* pDerivInfo = GET_ROWCELL_INTERBUF(pResInfo); +int32_t derivativeFunction(SqlFunctionCtx* pCtx) { + SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); + SDerivInfo* pDerivInfo = GET_ROWCELL_INTERBUF(pResInfo); SInputColumnInfoData* pInput = &pCtx->input; - SColumnInfoData* pInputCol = pInput->pData[0]; + SColumnInfoData* pInputCol = pInput->pData[0]; - int32_t numOfElems = 0; + int32_t numOfElems = 0; SColumnInfoData* pOutput = (SColumnInfoData*)pCtx->pOutput; SColumnInfoData* pTsOutput = pCtx->pTsOutput; int32_t i = pInput->startRowIndex; - TSKEY* tsList = (int64_t*)pInput->pPTS->pData; + TSKEY* tsList = (int64_t*)pInput->pPTS->pData; double v = 0; @@ -5224,7 +5218,7 @@ int32_t derivativeFunction(SqlFunctionCtx *pCtx) { continue; } - char* d = (char*)pInputCol->pData + pInputCol->info.bytes * i; + char* d = (char*)pInputCol->pData + pInputCol->info.bytes * i; GET_TYPED_DATA(v, double, pInputCol->info.type, d); int32_t pos = pCtx->offset + numOfElems; @@ -5251,7 +5245,7 @@ int32_t derivativeFunction(SqlFunctionCtx *pCtx) { continue; } - char* d = (char*)pInputCol->pData + pInputCol->info.bytes * i; + char* d = (char*)pInputCol->pData + pInputCol->info.bytes * i; GET_TYPED_DATA(v, double, pInputCol->info.type, d); int32_t pos = pCtx->offset + numOfElems; @@ -5277,7 +5271,7 @@ int32_t derivativeFunction(SqlFunctionCtx *pCtx) { return numOfElems; } -int32_t interpFunction(SqlFunctionCtx *pCtx) { +int32_t interpFunction(SqlFunctionCtx* pCtx) { #if 0 int32_t fillType = (int32_t) pCtx->param[2].i64; //bool ascQuery = (pCtx->order == TSDB_ORDER_ASC); diff --git a/source/libs/function/src/functionMgt.c b/source/libs/function/src/functionMgt.c index 7dbe456d4a..710b01ce59 100644 --- a/source/libs/function/src/functionMgt.c +++ b/source/libs/function/src/functionMgt.c @@ -70,11 +70,21 @@ int32_t fmFuncMgtInit() { } int32_t fmGetFuncInfo(SFunctionNode* pFunc, char* pMsg, int32_t msgLen) { - void* pVal = taosHashGet(gFunMgtService.pFuncNameHashTable, pFunc->functionName, strlen(pFunc->functionName)); - if (NULL != pVal) { - pFunc->funcId = *(int32_t*)pVal; - pFunc->funcType = funcMgtBuiltins[pFunc->funcId].type; - return funcMgtBuiltins[pFunc->funcId].translateFunc(pFunc, pMsg, msgLen); + if (NULL != gFunMgtService.pFuncNameHashTable) { + void* pVal = taosHashGet(gFunMgtService.pFuncNameHashTable, pFunc->functionName, strlen(pFunc->functionName)); + if (NULL != pVal) { + pFunc->funcId = *(int32_t*)pVal; + pFunc->funcType = funcMgtBuiltins[pFunc->funcId].type; + return funcMgtBuiltins[pFunc->funcId].translateFunc(pFunc, pMsg, msgLen); + } + return TSDB_CODE_FUNC_NOT_BUILTIN_FUNTION; + } + for (int32_t i = 0; i < funcMgtBuiltinsNum; ++i) { + if (0 == strcmp(funcMgtBuiltins[i].name, pFunc->functionName)) { + pFunc->funcId = i; + pFunc->funcType = funcMgtBuiltins[pFunc->funcId].type; + return funcMgtBuiltins[pFunc->funcId].translateFunc(pFunc, pMsg, msgLen); + } } return TSDB_CODE_FUNC_NOT_BUILTIN_FUNTION; } @@ -169,6 +179,13 @@ bool fmIsForbidWindowFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId bool fmIsForbidGroupByFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, FUNC_MGT_FORBID_GROUP_BY_FUNC); } +bool fmIsInterpFunc(int32_t funcId) { + if (funcId < 0 || funcId >= funcMgtBuiltinsNum) { + return false; + } + return FUNCTION_TYPE_INTERP == funcMgtBuiltins[funcId].type; +} + void fmFuncMgtDestroy() { void* m = gFunMgtService.pFuncNameHashTable; if (m != NULL && atomic_val_compare_exchange_ptr((void**)&gFunMgtService.pFuncNameHashTable, m, 0) == m) { @@ -233,17 +250,7 @@ bool fmIsSameInOutType(int32_t funcId) { static int32_t getFuncInfo(SFunctionNode* pFunc) { char msg[64] = {0}; - if (NULL != gFunMgtService.pFuncNameHashTable) { - return fmGetFuncInfo(pFunc, msg, sizeof(msg)); - } - for (int32_t i = 0; i < funcMgtBuiltinsNum; ++i) { - if (0 == strcmp(funcMgtBuiltins[i].name, pFunc->functionName)) { - pFunc->funcId = i; - pFunc->funcType = funcMgtBuiltins[pFunc->funcId].type; - return funcMgtBuiltins[pFunc->funcId].translateFunc(pFunc, msg, sizeof(msg)); - } - } - return TSDB_CODE_FUNC_NOT_BUILTIN_FUNTION; + return fmGetFuncInfo(pFunc, msg, sizeof(msg)); } static SFunctionNode* createFunction(const char* pName, SNodeList* pParameterList) { @@ -261,14 +268,14 @@ static SFunctionNode* createFunction(const char* pName, SNodeList* pParameterLis return pFunc; } -static SColumnNode* createColumnByFunc(const SFunctionNode* pFunc) { +static SNode* createColumnByFunc(const SFunctionNode* pFunc) { SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); if (NULL == pCol) { return NULL; } strcpy(pCol->colName, pFunc->node.aliasName); pCol->node.resType = pFunc->node.resType; - return pCol; + return (SNode*)pCol; } bool fmIsDistExecFunc(int32_t funcId) { @@ -296,21 +303,47 @@ static int32_t createPartialFunction(const SFunctionNode* pSrcFunc, SFunctionNod return TSDB_CODE_SUCCESS; } +static int32_t createMergeFuncPara(const SFunctionNode* pSrcFunc, const SFunctionNode* pPartialFunc, + SNodeList** pParameterList) { + SNode* pRes = createColumnByFunc(pPartialFunc); + if (NULL != funcMgtBuiltins[pSrcFunc->funcId].createMergeParaFuc) { + return funcMgtBuiltins[pSrcFunc->funcId].createMergeParaFuc(pSrcFunc->pParameterList, pRes, pParameterList); + } else { + return nodesListMakeStrictAppend(pParameterList, pRes); + } +} + static int32_t createMergeFunction(const SFunctionNode* pSrcFunc, const SFunctionNode* pPartialFunc, SFunctionNode** pMergeFunc) { - SNodeList* pParameterList = NULL; - nodesListMakeStrictAppend(&pParameterList, (SNode*)createColumnByFunc(pPartialFunc)); - *pMergeFunc = createFunction(funcMgtBuiltins[pSrcFunc->funcId].pMergeFunc, pParameterList); - if (NULL == *pMergeFunc) { + SNodeList* pParameterList = NULL; + SFunctionNode* pFunc = NULL; + + int32_t code = createMergeFuncPara(pSrcFunc, pPartialFunc, &pParameterList); + if (TSDB_CODE_SUCCESS == code) { + pFunc = createFunction(funcMgtBuiltins[pSrcFunc->funcId].pMergeFunc, pParameterList); + if (NULL == pFunc) { + code = TSDB_CODE_OUT_OF_MEMORY; + } + } + if (TSDB_CODE_SUCCESS == code) { + // overwrite function restype set by translate function + if (fmIsSameInOutType(pSrcFunc->funcId)) { + pFunc->node.resType = pSrcFunc->node.resType; + } + strcpy(pFunc->node.aliasName, pSrcFunc->node.aliasName); + } + + if (TSDB_CODE_SUCCESS == code) { + *pMergeFunc = pFunc; + } else { + if (NULL != pFunc) { + pFunc->pParameterList = NULL; + nodesDestroyNode((SNode*)pFunc); + } nodesDestroyList(pParameterList); - return TSDB_CODE_OUT_OF_MEMORY; } - // overwrite function restype set by translate function - if (fmIsSameInOutType(pSrcFunc->funcId)) { - (*pMergeFunc)->node.resType = pSrcFunc->node.resType; - } - strcpy((*pMergeFunc)->node.aliasName, pSrcFunc->node.aliasName); - return TSDB_CODE_SUCCESS; + + return code; } int32_t fmGetDistMethod(const SFunctionNode* pFunc, SFunctionNode** pPartialFunc, SFunctionNode** pMergeFunc) { diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index d0eb1548c1..b12f910cb1 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -423,6 +423,7 @@ static SNode* logicWindowCopy(const SWindowLogicNode* pSrc, SWindowLogicNode* pD COPY_SCALAR_FIELD(slidingUnit); COPY_SCALAR_FIELD(sessionGap); CLONE_NODE_FIELD(pTspk); + CLONE_NODE_FIELD(pTsEnd); CLONE_NODE_FIELD(pStateExpr); COPY_SCALAR_FIELD(triggerType); COPY_SCALAR_FIELD(watermark); @@ -454,7 +455,15 @@ static SNode* logicPartitionCopy(const SPartitionLogicNode* pSrc, SPartitionLogi static SNode* logicIndefRowsFuncCopy(const SIndefRowsFuncLogicNode* pSrc, SIndefRowsFuncLogicNode* pDst) { COPY_BASE_OBJECT_FIELD(node, logicNodeCopy); - CLONE_NODE_LIST_FIELD(pVectorFuncs); + CLONE_NODE_LIST_FIELD(pFuncs); + return (SNode*)pDst; +} + +static SNode* logicInterpFuncCopy(const SInterpFuncLogicNode* pSrc, SInterpFuncLogicNode* pDst) { + COPY_BASE_OBJECT_FIELD(node, logicNodeCopy); + CLONE_NODE_LIST_FIELD(pFuncs); + COPY_OBJECT_FIELD(timeRange, sizeof(STimeWindow)); + COPY_SCALAR_FIELD(interval); return (SNode*)pDst; } @@ -522,6 +531,7 @@ static SNode* physiWindowCopy(const SWinodwPhysiNode* pSrc, SWinodwPhysiNode* pD CLONE_NODE_LIST_FIELD(pExprs); CLONE_NODE_LIST_FIELD(pFuncs); CLONE_NODE_FIELD(pTspk); + CLONE_NODE_FIELD(pTsEnd); COPY_SCALAR_FIELD(triggerType); COPY_SCALAR_FIELD(watermark); COPY_SCALAR_FIELD(filesFactor); @@ -668,6 +678,8 @@ SNode* nodesCloneNode(const SNode* pNode) { return logicPartitionCopy((const SPartitionLogicNode*)pNode, (SPartitionLogicNode*)pDst); case QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC: return logicIndefRowsFuncCopy((const SIndefRowsFuncLogicNode*)pNode, (SIndefRowsFuncLogicNode*)pDst); + case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: + return logicInterpFuncCopy((const SInterpFuncLogicNode*)pNode, (SInterpFuncLogicNode*)pDst); case QUERY_NODE_LOGIC_SUBPLAN: return logicSubplanCopy((const SLogicSubplan*)pNode, (SLogicSubplan*)pDst); case QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN: diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 1b2eadd8e8..57d1ee7857 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -202,6 +202,8 @@ const char* nodesNodeName(ENodeType type) { return "LogicPartition"; case QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC: return "LogicIndefRowsFunc"; + case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: + return "LogicInterpFunc"; case QUERY_NODE_LOGIC_SUBPLAN: return "LogicSubplan"; case QUERY_NODE_LOGIC_PLAN: @@ -216,6 +218,8 @@ const char* nodesNodeName(ENodeType type) { return "PhysiSreamScan"; case QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN: return "PhysiSystemTableScan"; + case QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN: + return "PhysiBlockDistScan"; case QUERY_NODE_PHYSICAL_PLAN_PROJECT: return "PhysiProject"; case QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN: @@ -256,6 +260,8 @@ const char* nodesNodeName(ENodeType type) { return "PhysiPartition"; case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: return "PhysiIndefRowsFunc"; + case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: + return "PhysiInterpFunc"; case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: return "PhysiDispatch"; case QUERY_NODE_PHYSICAL_PLAN_INSERT: @@ -933,14 +939,14 @@ static int32_t jsonToLogicPartitionNode(const SJson* pJson, void* pObj) { return code; } -static const char* jkIndefRowsFuncLogicPlanVectorFuncs = "VectorFuncs"; +static const char* jkIndefRowsFuncLogicPlanFuncs = "Funcs"; static int32_t logicIndefRowsFuncNodeToJson(const void* pObj, SJson* pJson) { const SIndefRowsFuncLogicNode* pNode = (const SIndefRowsFuncLogicNode*)pObj; int32_t code = logicPlanNodeToJson(pObj, pJson); if (TSDB_CODE_SUCCESS == code) { - code = nodeListToJson(pJson, jkIndefRowsFuncLogicPlanVectorFuncs, pNode->pVectorFuncs); + code = nodeListToJson(pJson, jkIndefRowsFuncLogicPlanFuncs, pNode->pFuncs); } return code; @@ -951,7 +957,52 @@ static int32_t jsonToLogicIndefRowsFuncNode(const SJson* pJson, void* pObj) { int32_t code = jsonToLogicPlanNode(pJson, pObj); if (TSDB_CODE_SUCCESS == code) { - code = jsonToNodeList(pJson, jkIndefRowsFuncLogicPlanVectorFuncs, &pNode->pVectorFuncs); + code = jsonToNodeList(pJson, jkIndefRowsFuncLogicPlanFuncs, &pNode->pFuncs); + } + + return code; +} + +static const char* jkInterpFuncLogicPlanFuncs = "Funcs"; +static const char* jkInterpFuncLogicPlanStartTime = "StartTime"; +static const char* jkInterpFuncLogicPlanEndTime = "EndTime"; +static const char* jkInterpFuncLogicPlanInterval = "Interval"; + +static int32_t logicInterpFuncNodeToJson(const void* pObj, SJson* pJson) { + const SInterpFuncLogicNode* pNode = (const SInterpFuncLogicNode*)pObj; + + int32_t code = logicPlanNodeToJson(pObj, pJson); + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkInterpFuncLogicPlanFuncs, pNode->pFuncs); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkInterpFuncLogicPlanStartTime, pNode->timeRange.skey); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkInterpFuncLogicPlanEndTime, pNode->timeRange.ekey); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkInterpFuncLogicPlanInterval, pNode->interval); + } + + return code; +} + +static int32_t jsonToLogicInterpFuncNode(const SJson* pJson, void* pObj) { + SInterpFuncLogicNode* pNode = (SInterpFuncLogicNode*)pObj; + + int32_t code = jsonToLogicPlanNode(pJson, pObj); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkInterpFuncLogicPlanFuncs, &pNode->pFuncs); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkInterpFuncLogicPlanStartTime, &pNode->timeRange.skey); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkInterpFuncLogicPlanEndTime, &pNode->timeRange.ekey); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkInterpFuncLogicPlanInterval, &pNode->interval); } return code; @@ -1782,6 +1833,7 @@ static int32_t jsonToPhysiSortNode(const SJson* pJson, void* pObj) { static const char* jkWindowPhysiPlanExprs = "Exprs"; static const char* jkWindowPhysiPlanFuncs = "Funcs"; static const char* jkWindowPhysiPlanTsPk = "TsPk"; +static const char* jkWindowPhysiPlanTsEnd = "TsEnd"; static const char* jkWindowPhysiPlanTriggerType = "TriggerType"; static const char* jkWindowPhysiPlanWatermark = "Watermark"; static const char* jkWindowPhysiPlanFilesFactor = "FilesFactor"; @@ -1799,6 +1851,9 @@ static int32_t physiWindowNodeToJson(const void* pObj, SJson* pJson) { if (TSDB_CODE_SUCCESS == code) { code = tjsonAddObject(pJson, jkWindowPhysiPlanTsPk, nodeToJson, pNode->pTspk); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkWindowPhysiPlanTsEnd, nodeToJson, pNode->pTsEnd); + } if (TSDB_CODE_SUCCESS == code) { code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanTriggerType, pNode->triggerType); } @@ -1825,6 +1880,9 @@ static int32_t jsonToPhysiWindowNode(const SJson* pJson, void* pObj) { if (TSDB_CODE_SUCCESS == code) { code = jsonToNodeObject(pJson, jkWindowPhysiPlanTsPk, (SNode**)&pNode->pTspk); } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkWindowPhysiPlanTsEnd, (SNode**)&pNode->pTsEnd); + } if (TSDB_CODE_SUCCESS == code) { tjsonGetNumberValue(pJson, jkWindowPhysiPlanTriggerType, pNode->triggerType, code); ; @@ -2040,7 +2098,7 @@ static int32_t jsonToPhysiPartitionNode(const SJson* pJson, void* pObj) { } static const char* jkIndefRowsFuncPhysiPlanExprs = "Exprs"; -static const char* jkIndefRowsFuncPhysiPlanVectorFuncs = "VectorFuncs"; +static const char* jkIndefRowsFuncPhysiPlanFuncs = "Funcs"; static int32_t physiIndefRowsFuncNodeToJson(const void* pObj, SJson* pJson) { const SIndefRowsFuncPhysiNode* pNode = (const SIndefRowsFuncPhysiNode*)pObj; @@ -2050,7 +2108,7 @@ static int32_t physiIndefRowsFuncNodeToJson(const void* pObj, SJson* pJson) { code = nodeListToJson(pJson, jkIndefRowsFuncPhysiPlanExprs, pNode->pExprs); } if (TSDB_CODE_SUCCESS == code) { - code = nodeListToJson(pJson, jkIndefRowsFuncPhysiPlanVectorFuncs, pNode->pVectorFuncs); + code = nodeListToJson(pJson, jkIndefRowsFuncPhysiPlanFuncs, pNode->pFuncs); } return code; @@ -2064,7 +2122,59 @@ static int32_t jsonToPhysiIndefRowsFuncNode(const SJson* pJson, void* pObj) { code = jsonToNodeList(pJson, jkIndefRowsFuncPhysiPlanExprs, &pNode->pExprs); } if (TSDB_CODE_SUCCESS == code) { - code = jsonToNodeList(pJson, jkIndefRowsFuncPhysiPlanVectorFuncs, &pNode->pVectorFuncs); + code = jsonToNodeList(pJson, jkIndefRowsFuncPhysiPlanFuncs, &pNode->pFuncs); + } + + return code; +} + +static const char* jkInterpFuncPhysiPlanExprs = "Exprs"; +static const char* jkInterpFuncPhysiPlanFuncs = "Funcs"; +static const char* jkInterpFuncPhysiPlanStartTime = "StartTime"; +static const char* jkInterpFuncPhysiPlanEndTime = "EndTime"; +static const char* jkInterpFuncPhysiPlanInterval = "Interval"; + +static int32_t physiInterpFuncNodeToJson(const void* pObj, SJson* pJson) { + const SInterpFuncPhysiNode* pNode = (const SInterpFuncPhysiNode*)pObj; + + int32_t code = physicPlanNodeToJson(pObj, pJson); + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkInterpFuncPhysiPlanExprs, pNode->pExprs); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkInterpFuncPhysiPlanFuncs, pNode->pFuncs); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkInterpFuncPhysiPlanStartTime, pNode->timeRange.skey); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkInterpFuncPhysiPlanEndTime, pNode->timeRange.ekey); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkInterpFuncPhysiPlanInterval, pNode->interval); + } + + return code; +} + +static int32_t jsonToPhysiInterpFuncNode(const SJson* pJson, void* pObj) { + SInterpFuncPhysiNode* pNode = (SInterpFuncPhysiNode*)pObj; + + int32_t code = jsonToPhysicPlanNode(pJson, pObj); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkInterpFuncPhysiPlanExprs, &pNode->pExprs); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkInterpFuncPhysiPlanFuncs, &pNode->pFuncs); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkInterpFuncPhysiPlanStartTime, &pNode->timeRange.skey); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkInterpFuncPhysiPlanEndTime, &pNode->timeRange.ekey); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkInterpFuncPhysiPlanInterval, &pNode->interval); } return code; @@ -3966,11 +4076,14 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return logicPartitionNodeToJson(pObj, pJson); case QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC: return logicIndefRowsFuncNodeToJson(pObj, pJson); + case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: + return logicInterpFuncNodeToJson(pObj, pJson); case QUERY_NODE_LOGIC_SUBPLAN: return logicSubplanToJson(pObj, pJson); case QUERY_NODE_LOGIC_PLAN: return logicPlanToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN: + case QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN: return physiTagScanNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN: case QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN: @@ -4010,6 +4123,8 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return physiPartitionNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: return physiIndefRowsFuncNodeToJson(pObj, pJson); + case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: + return physiInterpFuncNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: return physiDispatchNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_INSERT: @@ -4101,11 +4216,14 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToLogicPartitionNode(pJson, pObj); case QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC: return jsonToLogicIndefRowsFuncNode(pJson, pObj); + case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: + return jsonToLogicInterpFuncNode(pJson, pObj); case QUERY_NODE_LOGIC_SUBPLAN: return jsonToLogicSubplan(pJson, pObj); case QUERY_NODE_LOGIC_PLAN: return jsonToLogicPlan(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN: + case QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN: return jsonToPhysiTagScanNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN: case QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN: @@ -4145,6 +4263,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToPhysiPartitionNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: return jsonToPhysiIndefRowsFuncNode(pJson, pObj); + case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: + return jsonToPhysiInterpFuncNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: return jsonToPhysiDispatchNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_DELETE: diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 6ebd0f2d39..a48071ef52 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -215,6 +215,8 @@ SNode* nodesMakeNode(ENodeType type) { case QUERY_NODE_SHOW_CREATE_TABLE_STMT: case QUERY_NODE_SHOW_CREATE_STABLE_STMT: return makeNode(type, sizeof(SShowCreateTableStmt)); + case QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT: + return makeNode(type, sizeof(SShowTableDistributedStmt)); case QUERY_NODE_KILL_QUERY_STMT: return makeNode(type, sizeof(SKillQueryStmt)); case QUERY_NODE_KILL_TRANSACTION_STMT: @@ -248,6 +250,8 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SPartitionLogicNode)); case QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC: return makeNode(type, sizeof(SIndefRowsFuncLogicNode)); + case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: + return makeNode(type, sizeof(SInterpFuncLogicNode)); case QUERY_NODE_LOGIC_SUBPLAN: return makeNode(type, sizeof(SLogicSubplan)); case QUERY_NODE_LOGIC_PLAN: @@ -264,6 +268,8 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SStreamScanPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN: return makeNode(type, sizeof(SSystemTableScanPhysiNode)); + case QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN: + return makeNode(type, sizeof(SBlockDistScanPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_PROJECT: return makeNode(type, sizeof(SProjectPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN: @@ -304,6 +310,8 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SPartitionPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: return makeNode(type, sizeof(SIndefRowsFuncPhysiNode)); + case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: + return makeNode(type, sizeof(SInterpFuncLogicNode)); case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: return makeNode(type, sizeof(SDataDispatcherNode)); case QUERY_NODE_PHYSICAL_PLAN_INSERT: @@ -348,6 +356,7 @@ static void destroyWinodwPhysiNode(SWinodwPhysiNode* pNode) { nodesDestroyList(pNode->pExprs); nodesDestroyList(pNode->pFuncs); nodesDestroyNode(pNode->pTspk); + nodesDestroyNode(pNode->pTsEnd); } static void destroyScanPhysiNode(SScanPhysiNode* pNode) { @@ -521,6 +530,7 @@ void nodesDestroyNode(SNode* pNode) { SCreateSubTableClause* pStmt = (SCreateSubTableClause*)pNode; nodesDestroyList(pStmt->pSpecificTags); nodesDestroyList(pStmt->pValsOfTags); + nodesDestroyNode((SNode*)pStmt->pOptions); break; } case QUERY_NODE_CREATE_MULTI_TABLE_STMT: @@ -628,18 +638,23 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_SHOW_APPS_STMT: case QUERY_NODE_SHOW_SCORES_STMT: case QUERY_NODE_SHOW_VARIABLE_STMT: - case QUERY_NODE_SHOW_CREATE_DATABASE_STMT: - case QUERY_NODE_SHOW_CREATE_TABLE_STMT: - case QUERY_NODE_SHOW_CREATE_STABLE_STMT: case QUERY_NODE_SHOW_TRANSACTIONS_STMT: { SShowStmt* pStmt = (SShowStmt*)pNode; nodesDestroyNode(pStmt->pDbName); - nodesDestroyNode(pStmt->pTbNamePattern); + nodesDestroyNode(pStmt->pTbName); break; } - case QUERY_NODE_KILL_CONNECTION_STMT: // no pointer field - case QUERY_NODE_KILL_QUERY_STMT: // no pointer field - case QUERY_NODE_KILL_TRANSACTION_STMT: // no pointer field + case QUERY_NODE_SHOW_CREATE_DATABASE_STMT: + taosMemoryFreeClear(((SShowCreateDatabaseStmt*)pNode)->pCfg); + break; + case QUERY_NODE_SHOW_CREATE_TABLE_STMT: + case QUERY_NODE_SHOW_CREATE_STABLE_STMT: + taosMemoryFreeClear(((SShowCreateTableStmt*)pNode)->pMeta); + break; + case QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT: // no pointer field + case QUERY_NODE_KILL_CONNECTION_STMT: // no pointer field + case QUERY_NODE_KILL_QUERY_STMT: // no pointer field + case QUERY_NODE_KILL_TRANSACTION_STMT: // no pointer field break; case QUERY_NODE_DELETE_STMT: { SDeleteStmt* pStmt = (SDeleteStmt*)pNode; @@ -709,6 +724,7 @@ void nodesDestroyNode(SNode* pNode) { destroyLogicNode((SLogicNode*)pLogicNode); nodesDestroyList(pLogicNode->pFuncs); nodesDestroyNode(pLogicNode->pTspk); + nodesDestroyNode(pLogicNode->pTsEnd); break; } case QUERY_NODE_LOGIC_PLAN_FILL: { @@ -733,7 +749,13 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC: { SIndefRowsFuncLogicNode* pLogicNode = (SIndefRowsFuncLogicNode*)pNode; destroyLogicNode((SLogicNode*)pLogicNode); - nodesDestroyList(pLogicNode->pVectorFuncs); + nodesDestroyList(pLogicNode->pFuncs); + break; + } + case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: { + SInterpFuncLogicNode* pLogicNode = (SInterpFuncLogicNode*)pNode; + destroyLogicNode((SLogicNode*)pLogicNode); + nodesDestroyList(pLogicNode->pFuncs); break; } case QUERY_NODE_LOGIC_SUBPLAN: { @@ -752,6 +774,7 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN: case QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN: case QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN: + case QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN: destroyScanPhysiNode((SScanPhysiNode*)pNode); break; case QUERY_NODE_PHYSICAL_PLAN_PROJECT: { @@ -835,7 +858,14 @@ void nodesDestroyNode(SNode* pNode) { SIndefRowsFuncPhysiNode* pPhyNode = (SIndefRowsFuncPhysiNode*)pNode; destroyPhysiNode((SPhysiNode*)pPhyNode); nodesDestroyList(pPhyNode->pExprs); - nodesDestroyList(pPhyNode->pVectorFuncs); + nodesDestroyList(pPhyNode->pFuncs); + break; + } + case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: { + SInterpFuncPhysiNode* pPhyNode = (SInterpFuncPhysiNode*)pNode; + destroyPhysiNode((SPhysiNode*)pPhyNode); + nodesDestroyList(pPhyNode->pExprs); + nodesDestroyList(pPhyNode->pFuncs); break; } case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index b4f49b3e88..64fcccc827 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -109,6 +109,7 @@ SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode SNode* pFill); SNode* createFillNode(SAstCreateContext* pCxt, EFillMode mode, SNode* pValues); SNode* createGroupingSetNode(SAstCreateContext* pCxt, SNode* pNode); +SNode* createInterpTimeRange(SAstCreateContext* pCxt, SNode* pStart, SNode* pEnd); SNode* addWhereClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pWhere); SNode* addPartitionByClause(SAstCreateContext* pCxt, SNode* pStmt, SNodeList* pPartitionByList); @@ -118,6 +119,9 @@ SNode* addHavingClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pHaving); SNode* addOrderByClause(SAstCreateContext* pCxt, SNode* pStmt, SNodeList* pOrderByList); SNode* addSlimitClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pSlimit); SNode* addLimitClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pLimit); +SNode* addRangeClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pRange); +SNode* addEveryClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pEvery); +SNode* addFillClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pFill); SNode* createSelectStmt(SAstCreateContext* pCxt, bool isDistinct, SNodeList* pProjectionList, SNode* pTable); SNode* createSetOperator(SAstCreateContext* pCxt, ESetOperatorType type, SNode* pLeft, SNode* pRight); @@ -151,9 +155,12 @@ SNode* createAlterTableRenameCol(SAstCreateContext* pCxt, SNode* pRealTable, int SToken* pNewColName); SNode* createAlterTableSetTag(SAstCreateContext* pCxt, SNode* pRealTable, SToken* pTagName, SNode* pVal); SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName); -SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, SNode* pTbNamePattern); +SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type); +SNode* createShowStmtWithCond(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, SNode* pTbName, + EOperatorType tableCondType); SNode* createShowCreateDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName); SNode* createShowCreateTableStmt(SAstCreateContext* pCxt, ENodeType type, SNode* pRealTable); +SNode* createShowTableDistributedStmt(SAstCreateContext* pCxt, SNode* pRealTable); SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const SToken* pPassword); SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t alterType, const SToken* pVal); SNode* createDropUserStmt(SAstCreateContext* pCxt, SToken* pUserName); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 476485904c..4c808fc609 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -350,34 +350,35 @@ col_name_list(A) ::= col_name_list(B) NK_COMMA col_name(C). col_name(A) ::= column_name(B). { A = createColumnNode(pCxt, NULL, &B); } /************************************************ show ****************************************************************/ -cmd ::= SHOW DNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); } -cmd ::= SHOW USERS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL, NULL); } -cmd ::= SHOW DATABASES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); } -cmd ::= SHOW db_name_cond_opt(A) TABLES like_pattern_opt(B). { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, A, B); } -cmd ::= SHOW db_name_cond_opt(A) STABLES like_pattern_opt(B). { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, A, B); } -cmd ::= SHOW db_name_cond_opt(A) VGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, A, NULL); } -cmd ::= SHOW MNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); } -cmd ::= SHOW MODULES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT, NULL, NULL); } -cmd ::= SHOW QNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL, NULL); } -cmd ::= SHOW FUNCTIONS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); } -cmd ::= SHOW INDEXES FROM table_name_cond(A) from_db_opt(B). { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, A, B); } -cmd ::= SHOW STREAMS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); } +cmd ::= SHOW DNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } +cmd ::= SHOW USERS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } +cmd ::= SHOW DATABASES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } +cmd ::= SHOW db_name_cond_opt(A) TABLES like_pattern_opt(B). { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, A, B, OP_TYPE_LIKE); } +cmd ::= SHOW db_name_cond_opt(A) STABLES like_pattern_opt(B). { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, A, B, OP_TYPE_LIKE); } +cmd ::= SHOW db_name_cond_opt(A) VGROUPS. { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, A, NULL, OP_TYPE_LIKE); } +cmd ::= SHOW MNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } +cmd ::= SHOW MODULES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT); } +cmd ::= SHOW QNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } +cmd ::= SHOW FUNCTIONS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } +cmd ::= SHOW INDEXES FROM table_name_cond(A) from_db_opt(B). { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, B, A, OP_TYPE_EQUAL); } +cmd ::= SHOW STREAMS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } cmd ::= SHOW ACCOUNTS. { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -cmd ::= SHOW APPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT, NULL, NULL); } -cmd ::= SHOW CONNECTIONS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT, NULL, NULL); } -cmd ::= SHOW LICENCE. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT, NULL, NULL); } -cmd ::= SHOW GRANTS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT, NULL, NULL); } +cmd ::= SHOW APPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } +cmd ::= SHOW CONNECTIONS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } +cmd ::= SHOW LICENCE. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT); } +cmd ::= SHOW GRANTS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT); } cmd ::= SHOW CREATE DATABASE db_name(A). { pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &A); } cmd ::= SHOW CREATE TABLE full_table_name(A). { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, A); } cmd ::= SHOW CREATE STABLE full_table_name(A). { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, A); } -cmd ::= SHOW QUERIES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT, NULL, NULL); } -cmd ::= SHOW SCORES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT, NULL, NULL); } -cmd ::= SHOW TOPICS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT, NULL, NULL); } -cmd ::= SHOW VARIABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLE_STMT, NULL, NULL); } -cmd ::= SHOW BNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT, NULL, NULL); } -cmd ::= SHOW SNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT, NULL, NULL); } -cmd ::= SHOW CLUSTER. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT, NULL, NULL); } -cmd ::= SHOW TRANSACTIONS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT, NULL, NULL); } +cmd ::= SHOW QUERIES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } +cmd ::= SHOW SCORES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } +cmd ::= SHOW TOPICS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } +cmd ::= SHOW VARIABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLE_STMT); } +cmd ::= SHOW BNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } +cmd ::= SHOW SNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } +cmd ::= SHOW CLUSTER. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } +cmd ::= SHOW TRANSACTIONS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } +cmd ::= SHOW TABLE DISTRIBUTED full_table_name(A). { pCxt->pRootNode = createShowTableDistributedStmt(pCxt, A); } db_name_cond_opt(A) ::= . { A = createDefaultDatabaseCondValue(pCxt); } db_name_cond_opt(A) ::= db_name(B) NK_DOT. { A = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B); } @@ -790,7 +791,7 @@ join_type(A) ::= INNER. /************************************************ query_specification *************************************************/ query_specification(A) ::= SELECT set_quantifier_opt(B) select_list(C) from_clause(D) where_clause_opt(E) - partition_by_clause_opt(F) twindow_clause_opt(G) + partition_by_clause_opt(F) range_opt(J) every_opt(K) fill_opt(L) twindow_clause_opt(G) group_by_clause_opt(H) having_clause_opt(I). { A = createSelectStmt(pCxt, B, C, D); A = addWhereClause(pCxt, A, E); @@ -798,6 +799,9 @@ query_specification(A) ::= A = addWindowClauseClause(pCxt, A, G); A = addGroupByClause(pCxt, A, H); A = addHavingClause(pCxt, A, I); + A = addRangeClause(pCxt, A, J); + A = addEveryClause(pCxt, A, K); + A = addFillClause(pCxt, A, L); } %type set_quantifier_opt { bool } @@ -859,14 +863,20 @@ fill_mode(A) ::= NEXT. group_by_clause_opt(A) ::= . { A = NULL; } group_by_clause_opt(A) ::= GROUP BY group_by_list(B). { A = B; } -%type group_by_list { SNodeList* } -%destructor group_by_list { nodesDestroyList($$); } -group_by_list(A) ::= expression(B). { A = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, B))); } -group_by_list(A) ::= group_by_list(B) NK_COMMA expression(C). { A = addNodeToList(pCxt, B, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, C))); } +%type group_by_list { SNodeList* } +%destructor group_by_list { nodesDestroyList($$); } +group_by_list(A) ::= expression(B). { A = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, B))); } +group_by_list(A) ::= group_by_list(B) NK_COMMA expression(C). { A = addNodeToList(pCxt, B, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, C))); } having_clause_opt(A) ::= . { A = NULL; } having_clause_opt(A) ::= HAVING search_condition(B). { A = B; } +range_opt(A) ::= . { A = NULL; } +range_opt(A) ::= RANGE NK_LP expression(B) NK_COMMA expression(C) NK_RP. { A = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, B), releaseRawExprNode(pCxt, C)); } + +every_opt(A) ::= . { A = NULL; } +every_opt(A) ::= EVERY NK_LP duration_literal(B) NK_RP. { A = releaseRawExprNode(pCxt, B); } + /************************************************ query_expression ****************************************************/ query_expression(A) ::= query_expression_body(B) diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 6ea1b090ad..6b3fdad27d 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -599,6 +599,11 @@ SNode* createGroupingSetNode(SAstCreateContext* pCxt, SNode* pNode) { return (SNode*)groupingSet; } +SNode* createInterpTimeRange(SAstCreateContext* pCxt, SNode* pStart, SNode* pEnd) { + CHECK_PARSER_STATUS(pCxt); + return createBetweenAnd(pCxt, createPrimaryKeyCol(pCxt), pStart, pEnd); +} + SNode* setProjectionAlias(SAstCreateContext* pCxt, SNode* pNode, const SToken* pAlias) { CHECK_PARSER_STATUS(pCxt); int32_t len = TMIN(sizeof(((SExprNode*)pNode)->aliasName) - 1, pAlias->n); @@ -671,6 +676,32 @@ SNode* addLimitClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pLimit) { CHECK_PARSER_STATUS(pCxt); if (QUERY_NODE_SELECT_STMT == nodeType(pStmt)) { ((SSelectStmt*)pStmt)->pLimit = (SLimitNode*)pLimit; + } else { + ((SSetOperator*)pStmt)->pLimit = pLimit; + } + return pStmt; +} + +SNode* addRangeClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pRange) { + CHECK_PARSER_STATUS(pCxt); + if (QUERY_NODE_SELECT_STMT == nodeType(pStmt)) { + ((SSelectStmt*)pStmt)->pRange = pRange; + } + return pStmt; +} + +SNode* addEveryClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pEvery) { + CHECK_PARSER_STATUS(pCxt); + if (QUERY_NODE_SELECT_STMT == nodeType(pStmt)) { + ((SSelectStmt*)pStmt)->pEvery = pEvery; + } + return pStmt; +} + +SNode* addFillClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pFill) { + CHECK_PARSER_STATUS(pCxt); + if (QUERY_NODE_SELECT_STMT == nodeType(pStmt)) { + ((SSelectStmt*)pStmt)->pFill = pFill; } return pStmt; } @@ -878,6 +909,7 @@ SNode* createDefaultTableOptions(SAstCreateContext* pCxt) { pOptions->watermark1 = TSDB_DEFAULT_ROLLUP_WATERMARK; pOptions->watermark2 = TSDB_DEFAULT_ROLLUP_WATERMARK; pOptions->ttl = TSDB_DEFAULT_TABLE_TTL; + pOptions->commentNull = true; // mark null return (SNode*)pOptions; } @@ -886,6 +918,7 @@ SNode* createAlterTableOptions(SAstCreateContext* pCxt) { STableOptions* pOptions = (STableOptions*)nodesMakeNode(QUERY_NODE_TABLE_OPTIONS); CHECK_OUT_OF_MEM(pOptions); pOptions->ttl = -1; + pOptions->commentNull = true; // mark null return (SNode*)pOptions; } @@ -894,6 +927,7 @@ SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType switch (type) { case TABLE_OPTION_COMMENT: if (checkComment(pCxt, (SToken*)pVal, true)) { + ((STableOptions*)pOptions)->commentNull = false; COPY_STRING_FORM_STR_TOKEN(((STableOptions*)pOptions)->comment, (SToken*)pVal); } break; @@ -906,9 +940,15 @@ SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType case TABLE_OPTION_ROLLUP: ((STableOptions*)pOptions)->pRollupFuncs = pVal; break; - case TABLE_OPTION_TTL: - ((STableOptions*)pOptions)->ttl = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + case TABLE_OPTION_TTL:{ + int64_t ttl = taosStr2Int64(((SToken*)pVal)->z, NULL, 10); + if (ttl > INT32_MAX){ + ttl = INT32_MAX; + } + // ttl can not be smaller than 0, because there is a limitation in sql.y (TTL NK_INTEGER) + ((STableOptions*)pOptions)->ttl = ttl; break; + } case TABLE_OPTION_SMA: ((STableOptions*)pOptions)->pSma = pVal; break; @@ -971,9 +1011,9 @@ SNode* createCreateSubTableClause(SAstCreateContext* pCxt, bool ignoreExists, SN pStmt->ignoreExists = ignoreExists; pStmt->pSpecificTags = pSpecificTags; pStmt->pValsOfTags = pValsOfTags; + pStmt->pOptions = (STableOptions*)pOptions; nodesDestroyNode(pRealTable); nodesDestroyNode(pUseRealTable); - nodesDestroyNode(pOptions); return (SNode*)pStmt; } @@ -1100,7 +1140,15 @@ static bool needDbShowStmt(ENodeType type) { QUERY_NODE_SHOW_VGROUPS_STMT == type; } -SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, SNode* pTbNamePattern) { +SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type) { + CHECK_PARSER_STATUS(pCxt); + SShowStmt* pStmt = (SShowStmt*)nodesMakeNode(type); + CHECK_OUT_OF_MEM(pStmt); + return (SNode*)pStmt; +} + +SNode* createShowStmtWithCond(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, SNode* pTbName, + EOperatorType tableCondType) { CHECK_PARSER_STATUS(pCxt); if (needDbShowStmt(type) && NULL == pDbName && NULL == pCxt->pQueryCxt->db) { snprintf(pCxt->pQueryCxt->pMsg, pCxt->pQueryCxt->msgLen, "db not specified"); @@ -1110,7 +1158,8 @@ SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, S SShowStmt* pStmt = (SShowStmt*)nodesMakeNode(type); CHECK_OUT_OF_MEM(pStmt); pStmt->pDbName = pDbName; - pStmt->pTbNamePattern = pTbNamePattern; + pStmt->pTbName = pTbName; + pStmt->tableCondType = tableCondType; return (SNode*)pStmt; } @@ -1131,6 +1180,17 @@ SNode* createShowCreateTableStmt(SAstCreateContext* pCxt, ENodeType type, SNode* CHECK_OUT_OF_MEM(pStmt); strcpy(pStmt->dbName, ((SRealTableNode*)pRealTable)->table.dbName); strcpy(pStmt->tableName, ((SRealTableNode*)pRealTable)->table.tableName); + nodesDestroyNode(pRealTable); + return (SNode*)pStmt; +} + +SNode* createShowTableDistributedStmt(SAstCreateContext* pCxt, SNode* pRealTable) { + CHECK_PARSER_STATUS(pCxt); + SShowTableDistributedStmt* pStmt = (SShowTableDistributedStmt*)nodesMakeNode(QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT); + CHECK_OUT_OF_MEM(pStmt); + strcpy(pStmt->dbName, ((SRealTableNode*)pRealTable)->table.dbName); + strcpy(pStmt->tableName, ((SRealTableNode*)pRealTable)->table.tableName); + nodesDestroyNode(pRealTable); return (SNode*)pStmt; } diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 626960bf10..c8b78fcc8b 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -803,6 +803,7 @@ static void buildCreateTbReq(SVCreateTbReq* pTbReq, const char* tname, STag* pTa pTbReq->name = strdup(tname); pTbReq->ctb.suid = suid; pTbReq->ctb.pTag = (uint8_t*)pTag; + pTbReq->commentLen = -1; return; } diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 41d32204da..21f227b7ea 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -68,12 +68,12 @@ static SKeyword keywordTable[] = { {"CONTAINS", TK_CONTAINS}, {"DATABASE", TK_DATABASE}, {"DATABASES", TK_DATABASES}, - // {"DAYS", TK_DAYS}, {"DBS", TK_DBS}, {"DELETE", TK_DELETE}, {"DESC", TK_DESC}, {"DESCRIBE", TK_DESCRIBE}, {"DISTINCT", TK_DISTINCT}, + {"DISTRIBUTED", TK_DISTRIBUTED}, {"DNODE", TK_DNODE}, {"DNODES", TK_DNODES}, {"DOUBLE", TK_DOUBLE}, @@ -81,7 +81,7 @@ static SKeyword keywordTable[] = { {"DURATION", TK_DURATION}, {"EXISTS", TK_EXISTS}, {"EXPLAIN", TK_EXPLAIN}, - // {"FILE_FACTOR", TK_FILE_FACTOR}, + {"EVERY", TK_EVERY}, {"FILL", TK_FILL}, {"FIRST", TK_FIRST}, {"FLOAT", TK_FLOAT}, @@ -153,6 +153,7 @@ static SKeyword keywordTable[] = { {"QTIME", TK_QTIME}, {"QUERIES", TK_QUERIES}, {"QUERY", TK_QUERY}, + {"RANGE", TK_RANGE}, {"RATIO", TK_RATIO}, {"READ", TK_READ}, {"REDISTRIBUTE", TK_REDISTRIBUTE}, @@ -259,7 +260,6 @@ static SKeyword keywordTable[] = { // {"LP", TK_LP}, // {"RP", TK_RP}, // {"COMMA", TK_COMMA}, - // {"EVERY", TK_EVERY}, // {"VARIABLE", TK_VARIABLE}, // {"UPDATE", TK_UPDATE}, // {"CHANGE", TK_CHANGE}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 3cb885c8e1..77ef9027cd 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -1157,6 +1157,7 @@ static void setFuncClassification(SSelectStmt* pSelect, SFunctionNode* pFunc) { pSelect->hasIndefiniteRowsFunc = pSelect->hasIndefiniteRowsFunc ? true : fmIsIndefiniteRowsFunc(pFunc->funcId); pSelect->hasUniqueFunc = pSelect->hasUniqueFunc ? true : (FUNCTION_TYPE_UNIQUE == pFunc->funcType); pSelect->hasTailFunc = pSelect->hasTailFunc ? true : (FUNCTION_TYPE_TAIL == pFunc->funcType); + pSelect->hasInterpFunc = pSelect->hasInterpFunc ? true : (FUNCTION_TYPE_INTERP == pFunc->funcType); } } @@ -3147,9 +3148,6 @@ static int32_t checkCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt if (TSDB_CODE_SUCCESS == code) { code = checkTableRollupOption(pCxt, pStmt->pOptions->pRollupFuncs); } - if (TSDB_CODE_SUCCESS == code) { - code = checkRangeOption(pCxt, "ttl", pStmt->pOptions->ttl, TSDB_MIN_TABLE_TTL, INT32_MAX); - } if (TSDB_CODE_SUCCESS == code) { code = checkTableSmaOption(pCxt, pStmt); } @@ -3390,17 +3388,19 @@ static int32_t buildCreateStbReq(STranslateContext* pCxt, SCreateTableStmt* pStm pReq->delay2 = pStmt->pOptions->maxDelay2; pReq->watermark1 = pStmt->pOptions->watermark1; pReq->watermark2 = pStmt->pOptions->watermark2; - pReq->ttl = pStmt->pOptions->ttl; +// pReq->ttl = pStmt->pOptions->ttl; columnDefNodeToField(pStmt->pCols, &pReq->pColumns); columnDefNodeToField(pStmt->pTags, &pReq->pTags); pReq->numOfColumns = LIST_LENGTH(pStmt->pCols); pReq->numOfTags = LIST_LENGTH(pStmt->pTags); - if ('\0' != pStmt->pOptions->comment[0]) { + if(pStmt->pOptions->commentNull == false){ pReq->comment = strdup(pStmt->pOptions->comment); if (NULL == pReq->comment) { return TSDB_CODE_OUT_OF_MEMORY; } - pReq->commentLen = strlen(pStmt->pOptions->comment) + 1; + pReq->commentLen = strlen(pStmt->pOptions->comment); + }else{ + pReq->commentLen = -1; } SName tableName; @@ -3452,14 +3452,17 @@ static int32_t buildAlterSuperTableReq(STranslateContext* pCxt, SAlterTableStmt* pAlterReq->alterType = pStmt->alterType; if (TSDB_ALTER_TABLE_UPDATE_OPTIONS == pStmt->alterType) { - pAlterReq->ttl = pStmt->pOptions->ttl; - if ('\0' != pStmt->pOptions->comment[0]) { +// pAlterReq->ttl = pStmt->pOptions->ttl; + if (pStmt->pOptions->commentNull == false) { pAlterReq->comment = strdup(pStmt->pOptions->comment); if (NULL == pAlterReq->comment) { return TSDB_CODE_OUT_OF_MEMORY; } - pAlterReq->commentLen = strlen(pStmt->pOptions->comment) + 1; + pAlterReq->commentLen = strlen(pStmt->pOptions->comment); + }else{ + pAlterReq->commentLen = -1; } + return TSDB_CODE_SUCCESS; } @@ -4534,28 +4537,36 @@ static const char* getSysTableName(ENodeType type) { return NULL; } -static int32_t createSelectStmtForShow(ENodeType showType, SSelectStmt** pStmt) { +static int32_t createSimpleSelectStmt(const char* pDb, const char* pTable, SSelectStmt** pStmt) { SSelectStmt* pSelect = (SSelectStmt*)nodesMakeNode(QUERY_NODE_SELECT_STMT); if (NULL == pSelect) { return TSDB_CODE_OUT_OF_MEMORY; } sprintf(pSelect->stmtName, "%p", pSelect); - SRealTableNode* pTable = (SRealTableNode*)nodesMakeNode(QUERY_NODE_REAL_TABLE); - if (NULL == pTable) { + SRealTableNode* pRealTable = (SRealTableNode*)nodesMakeNode(QUERY_NODE_REAL_TABLE); + if (NULL == pRealTable) { nodesDestroyNode((SNode*)pSelect); return TSDB_CODE_OUT_OF_MEMORY; } - strcpy(pTable->table.dbName, getSysDbName(showType)); - strcpy(pTable->table.tableName, getSysTableName(showType)); - strcpy(pTable->table.tableAlias, pTable->table.tableName); - pSelect->pFromTable = (SNode*)pTable; + strcpy(pRealTable->table.dbName, pDb); + strcpy(pRealTable->table.tableName, pTable); + strcpy(pRealTable->table.tableAlias, pTable); + pSelect->pFromTable = (SNode*)pRealTable; *pStmt = pSelect; return TSDB_CODE_SUCCESS; } +static int32_t createSelectStmtForShow(ENodeType showType, SSelectStmt** pStmt) { + return createSimpleSelectStmt(getSysDbName(showType), getSysTableName(showType), pStmt); +} + +static int32_t createSelectStmtForShowTableDist(SShowTableDistributedStmt* pStmt, SSelectStmt** pOutput) { + return createSimpleSelectStmt(pStmt->dbName, pStmt->tableName, pOutput); +} + static int32_t createOperatorNode(EOperatorType opType, const char* pColName, SNode* pRight, SNode** pOp) { if (NULL == pRight) { return TSDB_CODE_SUCCESS; @@ -4609,7 +4620,7 @@ static int32_t createShowCondition(const SShowStmt* pShow, SSelectStmt* pSelect) SNode* pTbCond = NULL; if (TSDB_CODE_SUCCESS != createOperatorNode(OP_TYPE_EQUAL, "db_name", pShow->pDbName, &pDbCond) || TSDB_CODE_SUCCESS != - createOperatorNode(OP_TYPE_LIKE, getTbNameColName(nodeType(pShow)), pShow->pTbNamePattern, &pTbCond)) { + createOperatorNode(pShow->tableCondType, getTbNameColName(nodeType(pShow)), pShow->pTbName, &pTbCond)) { nodesDestroyNode(pDbCond); nodesDestroyNode(pTbCond); return TSDB_CODE_OUT_OF_MEMORY; @@ -4646,6 +4657,46 @@ static int32_t rewriteShow(STranslateContext* pCxt, SQuery* pQuery) { return code; } +static SNode* createBlockDistInfoFunc() { + SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); + if (NULL == pFunc) { + return NULL; + } + + strcpy(pFunc->functionName, "_block_dist_info"); + strcpy(pFunc->node.aliasName, "_block_dist_info"); + return (SNode*)pFunc; +} + +static SNode* createBlockDistFunc() { + SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); + if (NULL == pFunc) { + return NULL; + } + + strcpy(pFunc->functionName, "_block_dist"); + strcpy(pFunc->node.aliasName, "_block_dist"); + if (TSDB_CODE_SUCCESS != nodesListMakeStrictAppend(&pFunc->pParameterList, createBlockDistInfoFunc())) { + nodesDestroyNode((SNode*)pFunc); + return NULL; + } + return (SNode*)pFunc; +} + +static int32_t rewriteShowTableDist(STranslateContext* pCxt, SQuery* pQuery) { + SSelectStmt* pStmt = NULL; + int32_t code = createSelectStmtForShowTableDist((SShowTableDistributedStmt*)pQuery->pRoot, &pStmt); + if (TSDB_CODE_SUCCESS == code) { + code = nodesListMakeStrictAppend(&pStmt->pProjectionList, createBlockDistFunc()); + } + if (TSDB_CODE_SUCCESS == code) { + pQuery->showRewrite = true; + nodesDestroyNode(pQuery->pRoot); + pQuery->pRoot = (SNode*)pStmt; + } + return code; +} + typedef struct SVgroupCreateTableBatch { SVCreateTbBatchReq req; SVgroupInfo info; @@ -4667,6 +4718,16 @@ static int32_t buildNormalTableBatchReq(int32_t acctId, const SCreateTableStmt* SVCreateTbReq req = {0}; req.type = TD_NORMAL_TABLE; req.name = strdup(pStmt->tableName); + req.ttl = pStmt->pOptions->ttl; + if (pStmt->pOptions->commentNull == false) { + req.comment = strdup(pStmt->pOptions->comment); + if (NULL == req.comment) { + return TSDB_CODE_OUT_OF_MEMORY; + } + req.commentLen = strlen(pStmt->pOptions->comment); + }else{ + req.commentLen = -1; + } req.ntb.schemaRow.nCols = LIST_LENGTH(pStmt->pCols); req.ntb.schemaRow.version = 1; req.ntb.schemaRow.pSchema = taosMemoryCalloc(req.ntb.schemaRow.nCols, sizeof(SSchema)); @@ -4817,6 +4878,13 @@ static void addCreateTbReqIntoVgroup(int32_t acctId, SHashObj* pVgroupHashmap, S struct SVCreateTbReq req = {0}; req.type = TD_CHILD_TABLE; req.name = strdup(pStmt->tableName); + req.ttl = pStmt->pOptions->ttl; + if (pStmt->pOptions->commentNull == false) { + req.comment = strdup(pStmt->pOptions->comment); + req.commentLen = strlen(pStmt->pOptions->comment); + } else{ + req.commentLen = -1; + } req.ctb.suid = suid; req.ctb.pTag = (uint8_t*)pTag; if (pStmt->ignoreExists) { @@ -5388,18 +5456,20 @@ static int32_t buildUpdateOptionsReq(STranslateContext* pCxt, SAlterTableStmt* p int32_t code = TSDB_CODE_SUCCESS; if (-1 != pStmt->pOptions->ttl) { - code = checkRangeOption(pCxt, "ttl", pStmt->pOptions->ttl, TSDB_MIN_TABLE_TTL, INT32_MAX); - if (TSDB_CODE_SUCCESS == code) { - pReq->updateTTL = true; - pReq->newTTL = pStmt->pOptions->ttl; - } + pReq->updateTTL = true; + pReq->newTTL = pStmt->pOptions->ttl; } - if (TSDB_CODE_SUCCESS == code && '\0' != pStmt->pOptions->comment[0]) { - pReq->updateComment = true; - pReq->newComment = strdup(pStmt->pOptions->comment); - if (NULL == pReq->newComment) { - code = TSDB_CODE_OUT_OF_MEMORY; + if (TSDB_CODE_SUCCESS == code){ + if(pStmt->pOptions->commentNull == false) { + pReq->newComment = strdup(pStmt->pOptions->comment); + if (NULL == pReq->newComment) { + code = TSDB_CODE_OUT_OF_MEMORY; + } + pReq->newCommentLen = strlen(pReq->newComment); + } + else{ + pReq->newCommentLen = -1; } } @@ -5518,6 +5588,9 @@ static int32_t rewriteAlterTableImpl(STranslateContext* pCxt, SAlterTableStmt* p pStmt->alterType == TSDB_ALTER_TABLE_UPDATE_TAG_BYTES)) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_ONLY_ONE_JSON_TAG); } + if (pStmt->alterType == TSDB_ALTER_TABLE_UPDATE_OPTIONS && -1 != pStmt->pOptions->ttl) { + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_ALTER_TABLE); + } return TSDB_CODE_SUCCESS; } else if (TSDB_CHILD_TABLE != pTableMeta->tableType && TSDB_NORMAL_TABLE != pTableMeta->tableType) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_ALTER_TABLE); @@ -5584,6 +5657,9 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_SHOW_APPS_STMT: code = rewriteShow(pCxt, pQuery); break; + case QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT: + code = rewriteShowTableDist(pCxt, pQuery); + break; case QUERY_NODE_CREATE_TABLE_STMT: if (NULL == ((SCreateTableStmt*)pQuery->pRoot)->pTags) { code = rewriteCreateTable(pCxt, pQuery); diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index a950b4efb0..422661219e 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,25 +104,25 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 359 +#define YYNOCODE 364 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EOperatorType yy28; - int32_t yy42; - ENullOrder yy107; - EFillMode yy320; - SToken yy421; - SNodeList* yy530; - SAlterOption yy557; - EOrder yy610; - bool yy621; - EJoinType yy636; - int64_t yy669; - SNode* yy674; - SDataType yy690; + SToken yy57; + EOrder yy162; + EJoinType yy204; + SAlterOption yy221; + int32_t yy228; + EFillMode yy270; + EOperatorType yy324; + int64_t yy389; + SNode* yy392; + SDataType yy448; + bool yy481; + ENullOrder yy529; + SNodeList* yy600; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -138,17 +138,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 622 -#define YYNRULE 459 -#define YYNTOKEN 239 -#define YY_MAX_SHIFT 621 -#define YY_MIN_SHIFTREDUCE 912 -#define YY_MAX_SHIFTREDUCE 1370 -#define YY_ERROR_ACTION 1371 -#define YY_ACCEPT_ACTION 1372 -#define YY_NO_ACTION 1373 -#define YY_MIN_REDUCE 1374 -#define YY_MAX_REDUCE 1832 +#define YYNSTATE 636 +#define YYNRULE 464 +#define YYNTOKEN 242 +#define YY_MAX_SHIFT 635 +#define YY_MIN_SHIFTREDUCE 928 +#define YY_MAX_SHIFTREDUCE 1391 +#define YY_ERROR_ACTION 1392 +#define YY_ACCEPT_ACTION 1393 +#define YY_NO_ACTION 1394 +#define YY_MIN_REDUCE 1395 +#define YY_MAX_REDUCE 1858 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -215,594 +215,603 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2098) +#define YY_ACTTAB_COUNT (2123) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 1557, 321, 1679, 1666, 1550, 1552, 300, 396, 1666, 397, - /* 10 */ 1406, 317, 35, 33, 1663, 404, 1556, 397, 1406, 1663, - /* 20 */ 309, 1483, 1184, 1557, 36, 34, 32, 31, 30, 1695, - /* 30 */ 299, 536, 36, 34, 32, 31, 30, 521, 1810, 1555, - /* 40 */ 1659, 1665, 1649, 1810, 520, 1659, 1665, 1182, 28, 233, - /* 50 */ 1809, 540, 362, 1372, 1807, 150, 540, 501, 14, 1807, - /* 60 */ 35, 33, 1311, 395, 1190, 1679, 399, 536, 309, 1708, - /* 70 */ 1184, 159, 82, 1680, 523, 1682, 1683, 519, 414, 540, - /* 80 */ 57, 1, 1748, 536, 401, 1810, 283, 1744, 497, 281, - /* 90 */ 1206, 537, 1695, 537, 1325, 1182, 62, 1808, 1810, 61, - /* 100 */ 521, 1807, 106, 618, 154, 1649, 14, 520, 942, 435, - /* 110 */ 151, 326, 1190, 24, 1807, 414, 114, 1253, 1254, 1505, - /* 120 */ 501, 1505, 356, 36, 34, 32, 31, 30, 39, 2, - /* 130 */ 134, 497, 1708, 1695, 1462, 82, 1680, 523, 1682, 1683, - /* 140 */ 519, 490, 540, 524, 38, 1748, 946, 947, 1318, 283, - /* 150 */ 1744, 618, 1810, 1600, 1208, 112, 196, 56, 1185, 114, - /* 160 */ 1183, 1810, 1208, 1810, 149, 1253, 1254, 130, 1807, 499, - /* 170 */ 146, 1755, 1756, 149, 1760, 149, 574, 1807, 489, 1807, - /* 180 */ 508, 486, 1188, 1189, 347, 1235, 1236, 1238, 1239, 1240, - /* 190 */ 1241, 1242, 516, 538, 1250, 1251, 1252, 1255, 112, 36, - /* 200 */ 34, 32, 31, 30, 349, 345, 1185, 133, 1183, 1386, - /* 210 */ 152, 66, 282, 147, 1755, 1756, 1209, 1760, 524, 35, - /* 220 */ 33, 36, 34, 32, 31, 30, 312, 309, 1599, 1184, - /* 230 */ 1188, 1189, 1375, 1235, 1236, 1238, 1239, 1240, 1241, 1242, - /* 240 */ 516, 538, 1250, 1251, 1252, 1255, 36, 34, 32, 31, - /* 250 */ 30, 492, 487, 96, 1182, 73, 95, 94, 93, 92, - /* 260 */ 91, 90, 89, 88, 87, 14, 491, 35, 33, 1222, - /* 270 */ 26, 1190, 1433, 152, 1496, 309, 1498, 1184, 1193, 56, - /* 280 */ 36, 34, 32, 31, 30, 1663, 152, 403, 2, 1335, - /* 290 */ 399, 1049, 563, 562, 561, 1053, 560, 1055, 1056, 559, - /* 300 */ 1058, 556, 1182, 1064, 553, 1066, 1067, 550, 547, 1261, - /* 310 */ 618, 1659, 1665, 1091, 1092, 1208, 32, 31, 30, 1190, - /* 320 */ 1237, 589, 540, 1397, 1253, 1254, 483, 1333, 1334, 1336, - /* 330 */ 1337, 1209, 596, 595, 594, 324, 8, 593, 592, 591, - /* 340 */ 116, 586, 585, 584, 583, 582, 581, 580, 579, 124, - /* 350 */ 575, 1436, 578, 313, 1477, 355, 56, 354, 618, 1367, - /* 360 */ 1207, 131, 350, 1649, 572, 1185, 1396, 1183, 509, 1395, - /* 370 */ 1507, 96, 1253, 1254, 95, 94, 93, 92, 91, 90, - /* 380 */ 89, 88, 87, 122, 121, 569, 568, 567, 64, 1188, - /* 390 */ 1189, 1196, 1235, 1236, 1238, 1239, 1240, 1241, 1242, 516, - /* 400 */ 538, 1250, 1251, 1252, 1255, 497, 1649, 537, 152, 1649, - /* 410 */ 1501, 449, 448, 1185, 1557, 1183, 447, 1394, 360, 111, - /* 420 */ 444, 314, 1393, 443, 442, 441, 35, 33, 1256, 570, - /* 430 */ 1555, 1679, 1548, 114, 309, 1505, 1184, 1188, 1189, 1366, - /* 440 */ 1235, 1236, 1238, 1239, 1240, 1241, 1242, 516, 538, 1250, - /* 450 */ 1251, 1252, 1255, 1392, 1184, 449, 448, 1649, 1695, 1391, - /* 460 */ 447, 1182, 1649, 111, 444, 152, 521, 443, 442, 441, - /* 470 */ 197, 1649, 112, 520, 35, 33, 1551, 1552, 1190, 1182, - /* 480 */ 1190, 1237, 309, 1679, 1184, 152, 537, 148, 1755, 1756, - /* 490 */ 293, 1760, 959, 1649, 958, 9, 1190, 361, 1708, 1649, - /* 500 */ 64, 84, 1680, 523, 1682, 1683, 519, 1390, 540, 1182, - /* 510 */ 1695, 1748, 203, 110, 1505, 1747, 1744, 618, 500, 433, - /* 520 */ 473, 960, 1500, 1649, 571, 520, 1190, 1548, 1166, 1167, - /* 530 */ 187, 1253, 1254, 185, 537, 618, 316, 315, 56, 294, - /* 540 */ 67, 292, 291, 9, 437, 106, 1198, 1649, 439, 1482, - /* 550 */ 1708, 1310, 440, 83, 1680, 523, 1682, 1683, 519, 1011, - /* 560 */ 540, 1810, 1505, 1748, 959, 618, 958, 302, 1744, 145, - /* 570 */ 438, 1191, 1185, 149, 1183, 463, 1013, 1807, 1557, 1253, - /* 580 */ 1254, 225, 446, 445, 537, 320, 479, 1775, 1190, 386, - /* 590 */ 1185, 7, 1183, 960, 1555, 371, 1188, 1189, 1208, 1235, - /* 600 */ 1236, 1238, 1239, 1240, 1241, 1242, 516, 538, 1250, 1251, - /* 610 */ 1252, 1255, 1505, 319, 1188, 1189, 1810, 1275, 946, 947, - /* 620 */ 1185, 131, 1183, 322, 144, 79, 1389, 541, 149, 1388, - /* 630 */ 1507, 131, 1807, 35, 33, 163, 162, 1544, 115, 1280, - /* 640 */ 1507, 309, 572, 1184, 1188, 1189, 1497, 1235, 1236, 1238, - /* 650 */ 1239, 1240, 1241, 1242, 516, 538, 1250, 1251, 1252, 1255, - /* 660 */ 1385, 122, 121, 569, 568, 567, 1649, 152, 1182, 1649, - /* 670 */ 537, 1384, 11, 10, 25, 1667, 1383, 537, 280, 54, - /* 680 */ 1206, 372, 1199, 1762, 1194, 1190, 1663, 379, 413, 1382, - /* 690 */ 391, 36, 34, 32, 31, 30, 590, 588, 1505, 537, - /* 700 */ 1649, 1679, 2, 1210, 132, 1505, 1202, 1759, 392, 262, - /* 710 */ 1502, 1649, 1659, 1665, 1192, 1381, 1649, 538, 1250, 1251, - /* 720 */ 1374, 260, 53, 540, 618, 52, 1380, 1505, 1695, 1649, - /* 730 */ 1379, 256, 1762, 1762, 1535, 505, 521, 284, 1253, 1254, - /* 740 */ 1480, 1649, 164, 520, 105, 104, 103, 102, 101, 100, - /* 750 */ 99, 98, 97, 1287, 480, 1649, 1758, 1757, 1309, 1767, - /* 760 */ 1306, 1222, 1378, 1306, 1237, 566, 1649, 56, 1708, 1273, - /* 770 */ 1649, 278, 1680, 523, 1682, 1683, 519, 577, 540, 1185, - /* 780 */ 390, 1183, 1481, 385, 384, 383, 382, 381, 378, 377, - /* 790 */ 376, 375, 374, 370, 369, 368, 367, 366, 365, 364, - /* 800 */ 363, 1211, 1649, 1188, 1189, 81, 1235, 1236, 1238, 1239, - /* 810 */ 1240, 1241, 1242, 516, 538, 1250, 1251, 1252, 1255, 131, - /* 820 */ 1274, 537, 36, 34, 32, 31, 30, 1195, 1508, 537, - /* 830 */ 224, 1637, 1626, 572, 537, 1377, 60, 59, 359, 574, - /* 840 */ 471, 158, 1279, 189, 513, 534, 188, 353, 191, 1505, - /* 850 */ 439, 190, 122, 121, 569, 568, 567, 1505, 279, 537, - /* 860 */ 537, 343, 1505, 341, 337, 333, 155, 328, 284, 1494, - /* 870 */ 535, 246, 438, 1423, 1490, 1649, 335, 27, 307, 1268, - /* 880 */ 1269, 1270, 1271, 1272, 1276, 1277, 1278, 1505, 1505, 1418, - /* 890 */ 1679, 1590, 537, 1416, 193, 450, 152, 192, 1669, 461, - /* 900 */ 1273, 503, 161, 323, 120, 621, 46, 983, 212, 1369, - /* 910 */ 1370, 452, 459, 11, 10, 455, 78, 1695, 37, 251, - /* 920 */ 1505, 506, 1492, 1488, 984, 500, 75, 200, 209, 515, - /* 930 */ 1649, 142, 520, 565, 182, 1671, 37, 612, 608, 604, - /* 940 */ 600, 250, 470, 1387, 37, 475, 137, 1332, 235, 214, - /* 950 */ 118, 1274, 431, 427, 423, 419, 181, 1708, 228, 1281, - /* 960 */ 83, 1680, 523, 1682, 1683, 519, 80, 540, 1265, 244, - /* 970 */ 1748, 484, 1463, 1279, 302, 1744, 145, 1243, 119, 120, - /* 980 */ 46, 65, 545, 119, 179, 1139, 120, 107, 1412, 237, - /* 990 */ 464, 529, 119, 432, 1776, 1696, 219, 325, 1407, 1545, - /* 1000 */ 1778, 498, 533, 3, 1679, 5, 227, 230, 27, 307, - /* 1010 */ 1268, 1269, 1270, 1271, 1272, 1276, 1277, 1278, 327, 243, - /* 1020 */ 1042, 255, 1206, 1070, 1074, 232, 330, 1081, 1079, 478, - /* 1030 */ 1679, 1695, 205, 123, 614, 334, 289, 1150, 1011, 521, - /* 1040 */ 290, 252, 380, 178, 1649, 170, 520, 175, 373, 409, - /* 1050 */ 1592, 1158, 160, 199, 388, 387, 1679, 1695, 389, 1212, - /* 1060 */ 393, 394, 402, 1215, 405, 521, 167, 406, 168, 169, - /* 1070 */ 1649, 1708, 520, 1214, 83, 1680, 523, 1682, 1683, 519, - /* 1080 */ 407, 540, 1216, 1695, 1748, 408, 172, 410, 302, 1744, - /* 1090 */ 1823, 521, 174, 1213, 412, 177, 1649, 1708, 520, 1782, - /* 1100 */ 83, 1680, 523, 1682, 1683, 519, 411, 540, 1679, 63, - /* 1110 */ 1748, 415, 180, 434, 302, 1744, 1823, 436, 1495, 184, - /* 1120 */ 1491, 186, 1679, 1708, 125, 1805, 83, 1680, 523, 1682, - /* 1130 */ 1683, 519, 298, 540, 86, 1695, 1748, 126, 198, 1493, - /* 1140 */ 302, 1744, 1823, 521, 1489, 127, 1631, 253, 1649, 1695, - /* 1150 */ 520, 1766, 128, 1630, 472, 465, 469, 521, 1211, 466, - /* 1160 */ 527, 201, 1649, 501, 520, 204, 207, 476, 485, 477, - /* 1170 */ 474, 1789, 1779, 1679, 482, 1708, 301, 501, 269, 1680, - /* 1180 */ 523, 1682, 1683, 519, 210, 540, 488, 1788, 6, 1708, - /* 1190 */ 454, 213, 269, 1680, 523, 1682, 1683, 519, 494, 540, - /* 1200 */ 1695, 1306, 1769, 220, 1810, 462, 481, 113, 521, 1210, - /* 1210 */ 1763, 40, 510, 1649, 303, 520, 151, 18, 1810, 195, - /* 1220 */ 1807, 1598, 507, 530, 531, 218, 525, 1597, 221, 526, - /* 1230 */ 149, 457, 239, 241, 1807, 311, 451, 1679, 139, 532, - /* 1240 */ 1708, 194, 1826, 84, 1680, 523, 1682, 1683, 519, 1729, - /* 1250 */ 540, 1679, 254, 1748, 72, 1806, 1506, 512, 1744, 504, - /* 1260 */ 1679, 511, 74, 226, 1695, 1478, 51, 543, 229, 50, - /* 1270 */ 231, 257, 518, 617, 249, 47, 138, 1649, 1695, 520, - /* 1280 */ 1549, 261, 263, 270, 264, 259, 521, 1695, 1643, 1642, - /* 1290 */ 58, 1649, 1641, 520, 329, 521, 1638, 332, 331, 1177, - /* 1300 */ 1649, 1178, 520, 156, 1708, 336, 1636, 277, 1680, 523, - /* 1310 */ 1682, 1683, 519, 517, 540, 514, 1720, 1679, 1708, 338, - /* 1320 */ 339, 135, 1680, 523, 1682, 1683, 519, 1708, 540, 340, - /* 1330 */ 84, 1680, 523, 1682, 1683, 519, 1635, 540, 342, 1679, - /* 1340 */ 1748, 1634, 344, 1633, 1695, 1745, 346, 1632, 348, 1616, - /* 1350 */ 157, 351, 521, 352, 1153, 1152, 1610, 1649, 1609, 520, - /* 1360 */ 357, 358, 1608, 1607, 502, 1824, 1695, 1125, 1585, 1584, - /* 1370 */ 1583, 1582, 1581, 1580, 521, 1579, 1578, 1577, 1576, 1649, - /* 1380 */ 1575, 520, 1574, 1573, 1708, 1572, 1571, 273, 1680, 523, - /* 1390 */ 1682, 1683, 519, 1679, 540, 1570, 1569, 1568, 1567, 117, - /* 1400 */ 1566, 1565, 1564, 1563, 1562, 1679, 1708, 1561, 1560, 135, - /* 1410 */ 1680, 523, 1682, 1683, 519, 1127, 540, 1559, 1558, 1435, - /* 1420 */ 1695, 1403, 143, 949, 493, 108, 948, 165, 521, 1402, - /* 1430 */ 1624, 1618, 1695, 1649, 398, 520, 400, 166, 1606, 173, - /* 1440 */ 518, 1605, 109, 1595, 1484, 1649, 306, 520, 171, 1434, - /* 1450 */ 176, 1432, 418, 1825, 1430, 1428, 1679, 422, 1426, 426, - /* 1460 */ 1708, 416, 430, 278, 1680, 523, 1682, 1683, 519, 977, - /* 1470 */ 540, 417, 1708, 421, 420, 277, 1680, 523, 1682, 1683, - /* 1480 */ 519, 424, 540, 1695, 1721, 425, 428, 429, 1415, 1414, - /* 1490 */ 1401, 521, 1486, 1085, 1084, 1485, 1649, 1010, 520, 1009, - /* 1500 */ 1008, 587, 589, 1007, 1004, 1424, 45, 1679, 295, 308, - /* 1510 */ 1003, 183, 1002, 1419, 453, 296, 1417, 456, 297, 1400, - /* 1520 */ 458, 1679, 1399, 1708, 460, 1623, 278, 1680, 523, 1682, - /* 1530 */ 1683, 519, 85, 540, 1695, 1617, 49, 467, 1160, 1604, - /* 1540 */ 1603, 1602, 521, 129, 1594, 68, 206, 1649, 1695, 520, - /* 1550 */ 211, 4, 37, 15, 136, 43, 521, 1331, 215, 22, - /* 1560 */ 310, 1649, 1324, 520, 216, 217, 69, 23, 1669, 16, - /* 1570 */ 1679, 468, 223, 41, 1708, 208, 202, 278, 1680, 523, - /* 1580 */ 1682, 1683, 519, 48, 540, 1303, 1302, 1679, 1708, 42, - /* 1590 */ 140, 265, 1680, 523, 1682, 1683, 519, 1695, 540, 1360, - /* 1600 */ 17, 1355, 1349, 1354, 10, 521, 19, 304, 1359, 1358, - /* 1610 */ 1649, 305, 520, 1245, 1695, 29, 141, 153, 1244, 1266, - /* 1620 */ 234, 1230, 521, 12, 20, 1593, 21, 1649, 236, 520, - /* 1630 */ 240, 1329, 522, 238, 70, 1668, 1679, 1708, 245, 528, - /* 1640 */ 272, 1680, 523, 1682, 1683, 519, 75, 540, 1679, 13, - /* 1650 */ 71, 1711, 1200, 1247, 1708, 539, 44, 274, 1680, 523, - /* 1660 */ 1682, 1683, 519, 1695, 540, 1071, 544, 318, 542, 242, - /* 1670 */ 546, 521, 1068, 548, 1065, 1695, 1649, 549, 520, 551, - /* 1680 */ 554, 552, 555, 521, 557, 1059, 1057, 558, 1649, 1679, - /* 1690 */ 520, 1063, 1062, 1048, 76, 77, 1080, 55, 564, 247, - /* 1700 */ 1061, 1076, 1060, 1708, 975, 573, 266, 1680, 523, 1682, - /* 1710 */ 1683, 519, 999, 540, 1017, 1708, 1695, 576, 275, 1680, - /* 1720 */ 523, 1682, 1683, 519, 521, 540, 248, 997, 996, 1649, - /* 1730 */ 995, 520, 992, 994, 993, 991, 990, 1014, 1012, 987, - /* 1740 */ 986, 1679, 985, 982, 981, 980, 1431, 597, 598, 599, - /* 1750 */ 1679, 1429, 601, 602, 1427, 603, 1708, 1425, 605, 267, - /* 1760 */ 1680, 523, 1682, 1683, 519, 606, 540, 607, 1695, 609, - /* 1770 */ 610, 611, 1413, 613, 1398, 615, 521, 1695, 1186, 616, - /* 1780 */ 619, 1649, 258, 520, 620, 521, 1373, 1373, 1373, 1373, - /* 1790 */ 1649, 1373, 520, 1373, 1373, 1373, 1373, 1373, 1373, 1679, - /* 1800 */ 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1708, 1373, - /* 1810 */ 1373, 276, 1680, 523, 1682, 1683, 519, 1708, 540, 1373, - /* 1820 */ 268, 1680, 523, 1682, 1683, 519, 1695, 540, 1373, 1373, - /* 1830 */ 1373, 1373, 1373, 1373, 521, 1373, 1373, 497, 1373, 1649, - /* 1840 */ 1679, 520, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, - /* 1850 */ 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1679, 1373, 1373, - /* 1860 */ 1373, 1373, 1373, 1373, 1373, 114, 1708, 1695, 1373, 1691, - /* 1870 */ 1680, 523, 1682, 1683, 519, 521, 540, 1373, 1373, 1373, - /* 1880 */ 1649, 1373, 520, 1373, 1695, 501, 1373, 1373, 1373, 1373, - /* 1890 */ 1373, 1373, 521, 1373, 1373, 1373, 1373, 1649, 1373, 520, - /* 1900 */ 1373, 1373, 1373, 1373, 112, 1373, 1679, 1708, 1373, 1373, - /* 1910 */ 1690, 1680, 523, 1682, 1683, 519, 1373, 540, 1679, 222, - /* 1920 */ 1755, 496, 1373, 495, 1708, 1373, 1810, 1689, 1680, 523, - /* 1930 */ 1682, 1683, 519, 1695, 540, 1373, 1373, 1373, 151, 497, - /* 1940 */ 1373, 521, 1807, 1373, 1373, 1695, 1649, 1373, 520, 1373, - /* 1950 */ 1373, 1373, 1373, 521, 1373, 1373, 1373, 1373, 1649, 1679, - /* 1960 */ 520, 1373, 1373, 1373, 1373, 1373, 1373, 114, 1373, 1373, - /* 1970 */ 1373, 1373, 1373, 1708, 1373, 1373, 287, 1680, 523, 1682, - /* 1980 */ 1683, 519, 1373, 540, 1373, 1708, 1695, 501, 286, 1680, - /* 1990 */ 523, 1682, 1683, 519, 521, 540, 1373, 1373, 1373, 1649, - /* 2000 */ 1373, 520, 1373, 1373, 1373, 1373, 112, 1373, 1373, 1373, - /* 2010 */ 1373, 1679, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, - /* 2020 */ 1679, 222, 1755, 496, 1373, 495, 1708, 1373, 1810, 288, - /* 2030 */ 1680, 523, 1682, 1683, 519, 1373, 540, 1373, 1695, 1373, - /* 2040 */ 149, 1373, 1373, 1373, 1807, 1373, 521, 1695, 1373, 1373, - /* 2050 */ 1373, 1649, 1373, 520, 1373, 521, 1373, 1373, 1373, 1373, - /* 2060 */ 1649, 1373, 520, 1373, 1373, 1373, 1373, 1373, 1373, 1373, - /* 2070 */ 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1708, 1373, - /* 2080 */ 1373, 285, 1680, 523, 1682, 1683, 519, 1708, 540, 1373, - /* 2090 */ 271, 1680, 523, 1682, 1683, 519, 1373, 540, + /* 0 */ 1688, 1836, 1515, 309, 407, 1688, 408, 1427, 326, 1393, + /* 10 */ 137, 1685, 37, 35, 1483, 1835, 1685, 1701, 412, 1833, + /* 20 */ 318, 551, 1201, 551, 1223, 38, 36, 34, 33, 32, + /* 30 */ 325, 324, 109, 415, 109, 408, 1427, 1681, 1687, 446, + /* 40 */ 1215, 451, 1681, 1687, 1717, 30, 240, 1199, 554, 1526, + /* 50 */ 1784, 1526, 535, 554, 22, 551, 550, 1671, 14, 534, + /* 60 */ 37, 35, 1328, 322, 1207, 1208, 157, 335, 318, 1701, + /* 70 */ 1201, 134, 515, 365, 1781, 38, 36, 34, 33, 32, + /* 80 */ 1528, 1, 1207, 1526, 1730, 67, 550, 85, 1702, 537, + /* 90 */ 1704, 1705, 533, 58, 554, 1199, 1717, 1770, 113, 76, + /* 100 */ 371, 292, 1766, 632, 514, 551, 14, 1521, 1836, 1671, + /* 110 */ 1418, 534, 1207, 1836, 1836, 538, 369, 1270, 1271, 958, + /* 120 */ 1519, 555, 152, 465, 550, 1622, 1833, 154, 152, 2, + /* 130 */ 425, 1833, 1833, 1526, 206, 82, 1730, 290, 473, 86, + /* 140 */ 1702, 537, 1704, 1705, 533, 1362, 554, 40, 118, 1770, + /* 150 */ 1671, 632, 198, 311, 1766, 148, 1518, 962, 963, 1202, + /* 160 */ 58, 1200, 70, 328, 468, 1270, 1271, 232, 56, 462, + /* 170 */ 364, 134, 363, 1226, 197, 490, 1797, 1216, 330, 1211, + /* 180 */ 1528, 1571, 1573, 1205, 1206, 41, 1252, 1253, 1255, 1256, + /* 190 */ 1257, 1258, 1259, 530, 552, 1267, 1268, 1269, 1272, 53, + /* 200 */ 1225, 1219, 52, 1572, 1573, 26, 59, 1202, 1836, 1200, + /* 210 */ 505, 155, 552, 1267, 1268, 38, 36, 34, 33, 32, + /* 220 */ 37, 35, 153, 155, 1417, 1701, 1833, 397, 318, 67, + /* 230 */ 1201, 1205, 1206, 302, 1252, 1253, 1255, 1256, 1257, 1258, + /* 240 */ 1259, 530, 552, 1267, 1268, 1269, 1272, 511, 1717, 460, + /* 250 */ 459, 1522, 1717, 484, 458, 1199, 504, 114, 455, 1659, + /* 260 */ 535, 454, 453, 452, 1671, 1671, 14, 534, 37, 35, + /* 270 */ 1107, 1108, 1207, 166, 165, 117, 318, 155, 1201, 1292, + /* 280 */ 515, 1504, 303, 58, 301, 300, 356, 448, 58, 2, + /* 290 */ 155, 450, 1730, 503, 1836, 85, 1702, 537, 1704, 1705, + /* 300 */ 533, 1297, 554, 1199, 344, 1770, 358, 354, 152, 292, + /* 310 */ 1766, 632, 1833, 449, 115, 38, 36, 34, 33, 32, + /* 320 */ 1207, 1836, 136, 1517, 1407, 1270, 1271, 1502, 513, 149, + /* 330 */ 1777, 1778, 1327, 1782, 1685, 152, 27, 8, 425, 1833, + /* 340 */ 1065, 577, 576, 575, 1069, 574, 1071, 1072, 573, 1074, + /* 350 */ 570, 1396, 1080, 567, 1082, 1083, 564, 561, 81, 632, + /* 360 */ 1681, 1687, 38, 36, 34, 33, 32, 1202, 78, 1200, + /* 370 */ 1352, 554, 99, 1270, 1271, 98, 97, 96, 95, 94, + /* 380 */ 93, 92, 91, 90, 588, 1342, 38, 36, 34, 33, + /* 390 */ 32, 1205, 1206, 517, 1252, 1253, 1255, 1256, 1257, 1258, + /* 400 */ 1259, 530, 552, 1267, 1268, 1269, 1272, 497, 1350, 1351, + /* 410 */ 1353, 1354, 975, 155, 974, 1202, 99, 1200, 155, 98, + /* 420 */ 97, 96, 95, 94, 93, 92, 91, 90, 37, 35, + /* 430 */ 1273, 406, 414, 1701, 410, 410, 318, 162, 1201, 1205, + /* 440 */ 1206, 976, 1252, 1253, 1255, 1256, 1257, 1258, 1259, 530, + /* 450 */ 552, 1267, 1268, 1269, 1272, 38, 36, 34, 33, 32, + /* 460 */ 1717, 474, 65, 1199, 1836, 64, 1027, 155, 535, 975, + /* 470 */ 199, 974, 1578, 1671, 1416, 534, 37, 35, 1834, 308, + /* 480 */ 1207, 1454, 1833, 1029, 318, 1784, 1201, 592, 1576, 1498, + /* 490 */ 38, 36, 34, 33, 32, 1415, 444, 9, 976, 500, + /* 500 */ 1730, 1388, 1836, 87, 1702, 537, 1704, 1705, 533, 1780, + /* 510 */ 554, 1199, 200, 1770, 1671, 1226, 152, 1769, 1766, 632, + /* 520 */ 1833, 538, 133, 1578, 147, 1239, 69, 291, 1207, 321, + /* 530 */ 323, 1621, 588, 1270, 1271, 1671, 293, 1565, 1414, 1576, + /* 540 */ 1326, 610, 609, 608, 333, 9, 607, 606, 605, 119, + /* 550 */ 600, 599, 598, 597, 596, 595, 594, 593, 127, 589, + /* 560 */ 1239, 1395, 38, 36, 34, 33, 32, 632, 1290, 506, + /* 570 */ 501, 1183, 1184, 1227, 1335, 1202, 1413, 1200, 1671, 1412, + /* 580 */ 1225, 1270, 1271, 1387, 28, 108, 107, 106, 105, 104, + /* 590 */ 103, 102, 101, 100, 38, 36, 34, 33, 32, 1205, + /* 600 */ 1206, 1411, 1252, 1253, 1255, 1256, 1257, 1258, 1259, 530, + /* 610 */ 552, 1267, 1268, 1269, 1272, 551, 1671, 1578, 134, 1671, + /* 620 */ 1291, 1224, 331, 1202, 329, 1200, 370, 1529, 1278, 1410, + /* 630 */ 134, 457, 456, 1576, 1225, 1207, 37, 35, 1457, 1528, + /* 640 */ 1228, 1671, 1296, 1526, 318, 1503, 1201, 1205, 1206, 527, + /* 650 */ 1252, 1253, 1255, 1256, 1257, 1258, 1259, 530, 552, 1267, + /* 660 */ 1268, 1269, 1272, 11, 10, 34, 33, 32, 1784, 1671, + /* 670 */ 580, 1199, 38, 36, 34, 33, 32, 29, 316, 1285, + /* 680 */ 1286, 1287, 1288, 1289, 1293, 1294, 1295, 584, 1207, 511, + /* 690 */ 1569, 1689, 1779, 604, 602, 1409, 7, 551, 460, 459, + /* 700 */ 586, 231, 1685, 458, 551, 2, 114, 455, 372, 450, + /* 710 */ 454, 453, 452, 1406, 1578, 382, 1225, 117, 293, 125, + /* 720 */ 124, 583, 582, 581, 289, 1526, 1223, 632, 1681, 1687, + /* 730 */ 1577, 449, 1526, 390, 551, 1671, 402, 515, 586, 554, + /* 740 */ 585, 1270, 1271, 1569, 1304, 383, 135, 1254, 1405, 1404, + /* 750 */ 1290, 269, 263, 1671, 403, 1556, 115, 125, 124, 583, + /* 760 */ 582, 581, 1526, 267, 55, 1403, 551, 54, 212, 551, + /* 770 */ 551, 229, 1777, 510, 1282, 509, 551, 424, 1836, 1612, + /* 780 */ 1523, 1648, 522, 1202, 167, 1200, 373, 253, 1671, 1671, + /* 790 */ 164, 591, 154, 519, 1526, 551, 1833, 1526, 1526, 962, + /* 800 */ 963, 1254, 1291, 1511, 1526, 1671, 482, 1205, 1206, 58, + /* 810 */ 1252, 1253, 1255, 1256, 1257, 1258, 1259, 530, 552, 1267, + /* 820 */ 1268, 1269, 1272, 1526, 1296, 1513, 401, 1789, 1323, 396, + /* 830 */ 395, 394, 393, 392, 389, 388, 387, 386, 385, 381, + /* 840 */ 380, 379, 378, 377, 376, 375, 374, 84, 1402, 1509, + /* 850 */ 190, 1701, 1201, 188, 203, 1401, 1400, 1399, 1398, 29, + /* 860 */ 316, 1285, 1286, 1287, 1288, 1289, 1293, 1294, 1295, 1323, + /* 870 */ 603, 192, 194, 196, 191, 193, 195, 1199, 1717, 62, + /* 880 */ 61, 368, 529, 1254, 161, 999, 514, 1501, 1671, 551, + /* 890 */ 362, 1671, 1701, 534, 1207, 1671, 1671, 1671, 1671, 472, + /* 900 */ 548, 288, 1000, 123, 352, 48, 350, 346, 342, 158, + /* 910 */ 337, 359, 470, 216, 11, 10, 1210, 1526, 1730, 1717, + /* 920 */ 1209, 86, 1702, 537, 1704, 1705, 533, 535, 554, 551, + /* 930 */ 1444, 1770, 1671, 632, 534, 311, 1766, 148, 39, 155, + /* 940 */ 549, 1390, 1391, 579, 486, 39, 1349, 1433, 481, 39, + /* 950 */ 1408, 1484, 461, 1439, 218, 1691, 235, 1526, 1798, 1730, + /* 960 */ 551, 1437, 86, 1702, 537, 1704, 1705, 533, 242, 554, + /* 970 */ 1701, 332, 1770, 523, 121, 463, 311, 1766, 1849, 1298, + /* 980 */ 586, 122, 520, 466, 123, 498, 1260, 1804, 1526, 1202, + /* 990 */ 1156, 1200, 1693, 628, 475, 443, 1701, 1717, 223, 125, + /* 1000 */ 124, 583, 582, 581, 1718, 535, 334, 1428, 48, 244, + /* 1010 */ 1671, 559, 534, 1205, 1206, 543, 1800, 122, 123, 110, + /* 1020 */ 122, 1566, 250, 1717, 512, 1058, 3, 234, 237, 239, + /* 1030 */ 1213, 535, 5, 336, 1212, 1223, 1671, 1730, 534, 343, + /* 1040 */ 86, 1702, 537, 1704, 1705, 533, 339, 554, 1701, 262, + /* 1050 */ 1770, 1027, 1086, 298, 311, 1766, 1849, 1701, 1090, 1097, + /* 1060 */ 1095, 126, 299, 1730, 1167, 1827, 86, 1702, 537, 1704, + /* 1070 */ 1705, 533, 259, 554, 384, 1717, 1770, 1614, 163, 399, + /* 1080 */ 311, 1766, 1849, 535, 1717, 391, 398, 400, 1671, 404, + /* 1090 */ 534, 1788, 535, 1229, 405, 413, 1232, 1671, 416, 534, + /* 1100 */ 170, 417, 172, 515, 1231, 418, 1701, 1233, 419, 175, + /* 1110 */ 421, 177, 515, 422, 1230, 1730, 423, 426, 278, 1702, + /* 1120 */ 537, 1704, 1705, 533, 1730, 554, 180, 278, 1702, 537, + /* 1130 */ 1704, 1705, 533, 1717, 554, 66, 183, 445, 447, 1516, + /* 1140 */ 187, 535, 307, 1512, 1836, 89, 1671, 1701, 534, 189, + /* 1150 */ 201, 260, 476, 1836, 128, 129, 1514, 1510, 154, 1653, + /* 1160 */ 130, 131, 1833, 477, 204, 1701, 1652, 152, 483, 207, + /* 1170 */ 1228, 1833, 487, 1730, 1717, 485, 87, 1702, 537, 1704, + /* 1180 */ 1705, 533, 532, 554, 488, 480, 1770, 1671, 210, 534, + /* 1190 */ 526, 1766, 1717, 499, 494, 214, 1811, 496, 541, 1810, + /* 1200 */ 535, 217, 310, 502, 1791, 1671, 6, 534, 1801, 508, + /* 1210 */ 495, 492, 222, 493, 1730, 1323, 1701, 286, 1702, 537, + /* 1220 */ 1704, 1705, 533, 531, 554, 528, 1742, 1227, 116, 227, + /* 1230 */ 42, 524, 1730, 142, 635, 138, 1702, 537, 1704, 1705, + /* 1240 */ 533, 1785, 554, 1717, 312, 226, 224, 521, 258, 18, + /* 1250 */ 1620, 535, 1619, 228, 539, 544, 1671, 1751, 534, 225, + /* 1260 */ 145, 1832, 545, 233, 246, 546, 626, 622, 618, 614, + /* 1270 */ 257, 540, 1527, 320, 248, 261, 75, 1701, 77, 557, + /* 1280 */ 516, 1850, 518, 1730, 525, 1852, 87, 1702, 537, 1704, + /* 1290 */ 1705, 533, 236, 554, 1701, 83, 1770, 1570, 251, 238, + /* 1300 */ 264, 1767, 1499, 631, 1717, 256, 141, 511, 270, 49, + /* 1310 */ 279, 271, 535, 266, 268, 1665, 1664, 1671, 60, 534, + /* 1320 */ 1663, 1717, 338, 1660, 340, 341, 1194, 1195, 159, 535, + /* 1330 */ 491, 547, 345, 1658, 1671, 117, 534, 347, 348, 349, + /* 1340 */ 1657, 351, 1656, 353, 1730, 1701, 355, 287, 1702, 537, + /* 1350 */ 1704, 1705, 533, 1655, 554, 515, 1654, 357, 1638, 489, + /* 1360 */ 360, 1730, 208, 361, 282, 1702, 537, 1704, 1705, 533, + /* 1370 */ 160, 554, 1717, 511, 115, 1170, 1632, 1169, 1631, 366, + /* 1380 */ 535, 1175, 367, 202, 1630, 1671, 1629, 534, 1142, 229, + /* 1390 */ 1777, 510, 1607, 509, 63, 1606, 1836, 1605, 1604, 1701, + /* 1400 */ 1603, 117, 1602, 507, 1601, 1600, 1599, 1598, 1701, 1597, + /* 1410 */ 152, 1596, 1730, 1595, 1833, 138, 1702, 537, 1704, 1705, + /* 1420 */ 533, 1594, 554, 1593, 1592, 1591, 1717, 1590, 1589, 120, + /* 1430 */ 1588, 1587, 1586, 1585, 535, 1717, 1144, 1582, 1581, 1671, + /* 1440 */ 115, 534, 1584, 532, 1583, 1580, 1579, 1456, 1671, 1424, + /* 1450 */ 534, 146, 315, 111, 965, 150, 1777, 1778, 168, 1782, + /* 1460 */ 1423, 1851, 1701, 409, 964, 1646, 1730, 169, 1640, 287, + /* 1470 */ 1702, 537, 1704, 1705, 533, 1730, 554, 511, 286, 1702, + /* 1480 */ 537, 1704, 1705, 533, 1628, 554, 176, 1743, 112, 1717, + /* 1490 */ 1627, 174, 411, 1617, 179, 1505, 1455, 535, 993, 1453, + /* 1500 */ 185, 429, 1671, 427, 534, 117, 428, 1451, 433, 1449, + /* 1510 */ 431, 432, 140, 1701, 437, 317, 435, 436, 442, 438, + /* 1520 */ 434, 430, 184, 1447, 440, 439, 441, 1701, 1436, 1730, + /* 1530 */ 1435, 1422, 287, 1702, 537, 1704, 1705, 533, 1101, 554, + /* 1540 */ 1717, 1507, 47, 186, 115, 1506, 1100, 68, 535, 1026, + /* 1550 */ 182, 1025, 1024, 1671, 1717, 534, 601, 1023, 603, 151, + /* 1560 */ 1777, 1778, 535, 1782, 1445, 1020, 319, 1671, 1019, 534, + /* 1570 */ 304, 1440, 1018, 305, 464, 1438, 306, 1421, 469, 467, + /* 1580 */ 1730, 1420, 1701, 287, 1702, 537, 1704, 1705, 533, 471, + /* 1590 */ 554, 1701, 88, 1645, 1730, 1639, 1177, 272, 1702, 537, + /* 1600 */ 1704, 1705, 533, 1626, 554, 1701, 51, 478, 132, 1717, + /* 1610 */ 181, 1625, 173, 1624, 178, 205, 420, 535, 1717, 1616, + /* 1620 */ 71, 479, 1671, 50, 534, 209, 535, 4, 211, 1364, + /* 1630 */ 39, 1671, 1717, 534, 23, 171, 221, 15, 213, 45, + /* 1640 */ 535, 215, 1348, 139, 219, 1671, 24, 534, 1341, 1730, + /* 1650 */ 220, 1691, 273, 1702, 537, 1704, 1705, 533, 1730, 554, + /* 1660 */ 72, 274, 1702, 537, 1704, 1705, 533, 25, 554, 1320, + /* 1670 */ 44, 230, 1730, 1319, 16, 281, 1702, 537, 1704, 1705, + /* 1680 */ 533, 1701, 554, 43, 143, 17, 1381, 1370, 1376, 1375, + /* 1690 */ 313, 13, 1380, 1379, 314, 10, 1283, 19, 1701, 144, + /* 1700 */ 1262, 31, 1247, 1261, 12, 20, 156, 1701, 1717, 21, + /* 1710 */ 1615, 243, 536, 241, 1346, 245, 535, 73, 247, 542, + /* 1720 */ 74, 1671, 1690, 534, 78, 1717, 249, 252, 1217, 1733, + /* 1730 */ 556, 1264, 553, 535, 1717, 46, 558, 327, 1671, 1087, + /* 1740 */ 534, 560, 535, 1084, 562, 563, 565, 1671, 1730, 534, + /* 1750 */ 1081, 283, 1702, 537, 1704, 1705, 533, 566, 554, 1701, + /* 1760 */ 568, 1075, 571, 569, 1079, 1730, 1073, 572, 275, 1702, + /* 1770 */ 537, 1704, 1705, 533, 1730, 554, 1078, 284, 1702, 537, + /* 1780 */ 1704, 1705, 533, 1701, 554, 1064, 1717, 578, 79, 80, + /* 1790 */ 1077, 1096, 1076, 57, 535, 254, 1092, 991, 587, 1671, + /* 1800 */ 1701, 534, 1015, 1033, 590, 255, 1013, 1012, 1011, 1010, + /* 1810 */ 1717, 1008, 1009, 1007, 1006, 1030, 1028, 1003, 535, 1002, + /* 1820 */ 1001, 1452, 998, 1671, 997, 534, 1730, 1717, 996, 276, + /* 1830 */ 1702, 537, 1704, 1705, 533, 535, 554, 611, 612, 613, + /* 1840 */ 1671, 1450, 534, 615, 616, 617, 1448, 621, 619, 620, + /* 1850 */ 1730, 1701, 1446, 285, 1702, 537, 1704, 1705, 533, 623, + /* 1860 */ 554, 624, 1701, 625, 1434, 627, 1419, 1730, 634, 629, + /* 1870 */ 277, 1702, 537, 1704, 1705, 533, 630, 554, 1717, 1203, + /* 1880 */ 265, 633, 1394, 1394, 1394, 1394, 535, 1394, 1394, 1717, + /* 1890 */ 1394, 1671, 1394, 534, 1394, 1394, 1394, 535, 1394, 1394, + /* 1900 */ 1394, 1394, 1671, 1701, 534, 1394, 1394, 1394, 1394, 1394, + /* 1910 */ 1394, 1394, 1394, 1394, 1701, 1394, 1394, 1394, 1730, 1394, + /* 1920 */ 1394, 1713, 1702, 537, 1704, 1705, 533, 1394, 554, 1730, + /* 1930 */ 1717, 1394, 1712, 1702, 537, 1704, 1705, 533, 535, 554, + /* 1940 */ 1394, 1717, 1394, 1671, 1394, 534, 1394, 1394, 1394, 535, + /* 1950 */ 1394, 1394, 1394, 1394, 1671, 1394, 534, 1394, 1394, 1394, + /* 1960 */ 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1701, 1394, 1394, + /* 1970 */ 1730, 1394, 1394, 1711, 1702, 537, 1704, 1705, 533, 1701, + /* 1980 */ 554, 1730, 1394, 1394, 296, 1702, 537, 1704, 1705, 533, + /* 1990 */ 1394, 554, 1394, 1701, 1717, 1394, 1394, 1394, 1394, 1394, + /* 2000 */ 1394, 1394, 535, 1394, 1394, 1394, 1717, 1671, 1394, 534, + /* 2010 */ 1394, 1394, 1394, 1394, 535, 1394, 1394, 1394, 1394, 1671, + /* 2020 */ 1717, 534, 1394, 1394, 1394, 1394, 1394, 1394, 535, 1394, + /* 2030 */ 1394, 1394, 1394, 1671, 1730, 534, 1394, 295, 1702, 537, + /* 2040 */ 1704, 1705, 533, 1394, 554, 1701, 1730, 1394, 1394, 297, + /* 2050 */ 1702, 537, 1704, 1705, 533, 1394, 554, 1394, 1394, 1394, + /* 2060 */ 1730, 1394, 1394, 294, 1702, 537, 1704, 1705, 533, 1394, + /* 2070 */ 554, 1394, 1717, 1394, 1394, 1394, 1394, 1394, 1394, 1394, + /* 2080 */ 535, 1394, 1394, 1394, 1394, 1671, 1394, 534, 1394, 1394, + /* 2090 */ 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394, + /* 2100 */ 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394, + /* 2110 */ 1394, 1394, 1730, 1394, 1394, 280, 1702, 537, 1704, 1705, + /* 2120 */ 533, 1394, 554, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 269, 280, 242, 271, 283, 284, 274, 245, 271, 247, - /* 10 */ 248, 274, 12, 13, 282, 245, 285, 247, 248, 282, - /* 20 */ 20, 0, 22, 269, 12, 13, 14, 15, 16, 269, - /* 30 */ 276, 20, 12, 13, 14, 15, 16, 277, 338, 285, - /* 40 */ 308, 309, 282, 338, 284, 308, 309, 47, 323, 324, - /* 50 */ 350, 319, 249, 239, 354, 350, 319, 297, 58, 354, - /* 60 */ 12, 13, 14, 246, 64, 242, 249, 20, 20, 309, - /* 70 */ 22, 55, 312, 313, 314, 315, 316, 317, 57, 319, - /* 80 */ 4, 81, 322, 20, 14, 338, 326, 327, 249, 286, - /* 90 */ 20, 249, 269, 249, 82, 47, 80, 350, 338, 83, - /* 100 */ 277, 354, 260, 103, 260, 282, 58, 284, 4, 267, - /* 110 */ 350, 297, 64, 2, 354, 57, 277, 117, 118, 277, - /* 120 */ 297, 277, 297, 12, 13, 14, 15, 16, 81, 81, - /* 130 */ 254, 249, 309, 269, 258, 312, 313, 314, 315, 316, - /* 140 */ 317, 277, 319, 284, 81, 322, 42, 43, 14, 326, - /* 150 */ 327, 103, 338, 294, 20, 316, 113, 81, 158, 277, - /* 160 */ 160, 338, 20, 338, 350, 117, 118, 147, 354, 330, - /* 170 */ 331, 332, 333, 350, 335, 350, 57, 354, 314, 354, - /* 180 */ 41, 145, 182, 183, 153, 185, 186, 187, 188, 189, - /* 190 */ 190, 191, 192, 193, 194, 195, 196, 197, 316, 12, - /* 200 */ 13, 14, 15, 16, 173, 174, 158, 241, 160, 243, - /* 210 */ 210, 168, 169, 331, 332, 333, 20, 335, 284, 12, - /* 220 */ 13, 12, 13, 14, 15, 16, 292, 20, 294, 22, - /* 230 */ 182, 183, 0, 185, 186, 187, 188, 189, 190, 191, - /* 240 */ 192, 193, 194, 195, 196, 197, 12, 13, 14, 15, - /* 250 */ 16, 215, 216, 21, 47, 251, 24, 25, 26, 27, - /* 260 */ 28, 29, 30, 31, 32, 58, 20, 12, 13, 82, - /* 270 */ 2, 64, 0, 210, 271, 20, 272, 22, 47, 81, - /* 280 */ 12, 13, 14, 15, 16, 282, 210, 246, 81, 182, - /* 290 */ 249, 94, 95, 96, 97, 98, 99, 100, 101, 102, - /* 300 */ 103, 104, 47, 106, 107, 108, 109, 110, 111, 14, - /* 310 */ 103, 308, 309, 117, 118, 20, 14, 15, 16, 64, - /* 320 */ 186, 41, 319, 242, 117, 118, 219, 220, 221, 222, - /* 330 */ 223, 20, 60, 61, 62, 63, 81, 65, 66, 67, - /* 340 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 350 */ 78, 0, 257, 261, 259, 157, 81, 159, 103, 150, - /* 360 */ 20, 269, 82, 282, 93, 158, 242, 160, 229, 242, - /* 370 */ 278, 21, 117, 118, 24, 25, 26, 27, 28, 29, - /* 380 */ 30, 31, 32, 112, 113, 114, 115, 116, 253, 182, - /* 390 */ 183, 160, 185, 186, 187, 188, 189, 190, 191, 192, - /* 400 */ 193, 194, 195, 196, 197, 249, 282, 249, 210, 282, - /* 410 */ 275, 60, 61, 158, 269, 160, 65, 242, 260, 68, - /* 420 */ 69, 276, 242, 72, 73, 74, 12, 13, 14, 279, - /* 430 */ 285, 242, 282, 277, 20, 277, 22, 182, 183, 230, - /* 440 */ 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - /* 450 */ 195, 196, 197, 242, 22, 60, 61, 282, 269, 242, - /* 460 */ 65, 47, 282, 68, 69, 210, 277, 72, 73, 74, - /* 470 */ 112, 282, 316, 284, 12, 13, 283, 284, 64, 47, - /* 480 */ 64, 186, 20, 242, 22, 210, 249, 331, 332, 333, - /* 490 */ 35, 335, 20, 282, 22, 81, 64, 260, 309, 282, - /* 500 */ 253, 312, 313, 314, 315, 316, 317, 242, 319, 47, - /* 510 */ 269, 322, 55, 266, 277, 326, 327, 103, 277, 47, - /* 520 */ 297, 49, 275, 282, 279, 284, 64, 282, 170, 171, - /* 530 */ 85, 117, 118, 88, 249, 103, 12, 13, 81, 84, - /* 540 */ 83, 86, 87, 81, 89, 260, 22, 282, 93, 0, - /* 550 */ 309, 4, 267, 312, 313, 314, 315, 316, 317, 47, - /* 560 */ 319, 338, 277, 322, 20, 103, 22, 326, 327, 328, - /* 570 */ 115, 47, 158, 350, 160, 297, 64, 354, 269, 117, - /* 580 */ 118, 340, 255, 256, 249, 276, 345, 346, 64, 75, - /* 590 */ 158, 37, 160, 49, 285, 260, 182, 183, 20, 185, - /* 600 */ 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - /* 610 */ 196, 197, 277, 261, 182, 183, 338, 141, 42, 43, - /* 620 */ 158, 269, 160, 261, 268, 251, 242, 103, 350, 242, - /* 630 */ 278, 269, 354, 12, 13, 121, 122, 281, 264, 163, - /* 640 */ 278, 20, 93, 22, 182, 183, 272, 185, 186, 187, - /* 650 */ 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - /* 660 */ 242, 112, 113, 114, 115, 116, 282, 210, 47, 282, - /* 670 */ 249, 242, 1, 2, 198, 271, 242, 249, 18, 3, - /* 680 */ 20, 260, 158, 310, 160, 64, 282, 27, 260, 242, - /* 690 */ 30, 12, 13, 14, 15, 16, 255, 256, 277, 249, - /* 700 */ 282, 242, 81, 20, 18, 277, 182, 334, 48, 23, - /* 710 */ 260, 282, 308, 309, 47, 242, 282, 193, 194, 195, - /* 720 */ 0, 35, 36, 319, 103, 39, 242, 277, 269, 282, - /* 730 */ 242, 262, 310, 310, 265, 41, 277, 58, 117, 118, - /* 740 */ 0, 282, 56, 284, 24, 25, 26, 27, 28, 29, - /* 750 */ 30, 31, 32, 82, 295, 282, 334, 334, 211, 208, - /* 760 */ 209, 82, 242, 209, 186, 92, 282, 81, 309, 90, - /* 770 */ 282, 312, 313, 314, 315, 316, 317, 64, 319, 158, - /* 780 */ 120, 160, 0, 123, 124, 125, 126, 127, 128, 129, - /* 790 */ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - /* 800 */ 140, 20, 282, 182, 183, 119, 185, 186, 187, 188, - /* 810 */ 189, 190, 191, 192, 193, 194, 195, 196, 197, 269, - /* 820 */ 141, 249, 12, 13, 14, 15, 16, 160, 278, 249, - /* 830 */ 147, 0, 260, 93, 249, 242, 150, 151, 152, 57, - /* 840 */ 260, 155, 163, 85, 58, 260, 88, 161, 85, 277, - /* 850 */ 93, 88, 112, 113, 114, 115, 116, 277, 172, 249, - /* 860 */ 249, 175, 277, 177, 178, 179, 180, 181, 58, 270, - /* 870 */ 260, 260, 115, 0, 270, 282, 45, 198, 199, 200, - /* 880 */ 201, 202, 203, 204, 205, 206, 207, 277, 277, 0, - /* 890 */ 242, 277, 249, 0, 85, 22, 210, 88, 44, 21, - /* 900 */ 90, 225, 288, 260, 41, 19, 41, 47, 41, 117, - /* 910 */ 118, 22, 34, 1, 2, 22, 81, 269, 41, 33, - /* 920 */ 277, 227, 270, 270, 64, 277, 91, 270, 147, 270, - /* 930 */ 282, 45, 284, 270, 33, 81, 41, 51, 52, 53, - /* 940 */ 54, 55, 301, 243, 41, 82, 45, 82, 41, 82, - /* 950 */ 41, 141, 51, 52, 53, 54, 55, 309, 357, 82, - /* 960 */ 312, 313, 314, 315, 316, 317, 80, 319, 182, 83, - /* 970 */ 322, 348, 258, 163, 326, 327, 328, 82, 41, 41, - /* 980 */ 41, 80, 41, 41, 83, 82, 41, 41, 0, 82, - /* 990 */ 305, 82, 41, 250, 346, 269, 342, 250, 248, 281, - /* 1000 */ 311, 336, 116, 339, 242, 212, 351, 351, 198, 199, - /* 1010 */ 200, 201, 202, 203, 204, 205, 206, 207, 307, 82, - /* 1020 */ 82, 82, 20, 82, 82, 351, 249, 82, 82, 143, - /* 1030 */ 242, 269, 146, 82, 46, 45, 306, 156, 47, 277, - /* 1040 */ 255, 299, 289, 142, 282, 144, 284, 146, 249, 148, - /* 1050 */ 249, 165, 40, 167, 141, 287, 242, 269, 287, 20, - /* 1060 */ 249, 244, 244, 20, 303, 277, 253, 284, 167, 253, - /* 1070 */ 282, 309, 284, 20, 312, 313, 314, 315, 316, 317, - /* 1080 */ 296, 319, 20, 269, 322, 298, 253, 296, 326, 327, - /* 1090 */ 328, 277, 253, 20, 290, 253, 282, 309, 284, 337, - /* 1100 */ 312, 313, 314, 315, 316, 317, 277, 319, 242, 253, - /* 1110 */ 322, 249, 253, 244, 326, 327, 328, 269, 269, 269, - /* 1120 */ 269, 269, 242, 309, 269, 337, 312, 313, 314, 315, - /* 1130 */ 316, 317, 244, 319, 249, 269, 322, 269, 251, 269, - /* 1140 */ 326, 327, 328, 277, 269, 269, 282, 303, 282, 269, - /* 1150 */ 284, 337, 269, 282, 249, 166, 284, 277, 20, 302, - /* 1160 */ 217, 251, 282, 297, 284, 251, 251, 277, 218, 290, - /* 1170 */ 296, 347, 311, 242, 282, 309, 282, 297, 312, 313, - /* 1180 */ 314, 315, 316, 317, 293, 319, 282, 347, 224, 309, - /* 1190 */ 4, 293, 312, 313, 314, 315, 316, 317, 149, 319, - /* 1200 */ 269, 209, 344, 307, 338, 19, 213, 277, 277, 20, - /* 1210 */ 310, 40, 228, 282, 231, 284, 350, 81, 338, 33, - /* 1220 */ 354, 293, 226, 144, 291, 343, 282, 293, 329, 282, - /* 1230 */ 350, 45, 277, 251, 354, 282, 50, 242, 341, 290, - /* 1240 */ 309, 55, 358, 312, 313, 314, 315, 316, 317, 325, - /* 1250 */ 319, 242, 265, 322, 251, 353, 277, 326, 327, 353, - /* 1260 */ 242, 353, 81, 352, 269, 259, 80, 273, 352, 83, - /* 1270 */ 352, 249, 277, 244, 251, 300, 304, 282, 269, 284, - /* 1280 */ 282, 240, 263, 263, 263, 252, 277, 269, 0, 0, - /* 1290 */ 40, 282, 0, 284, 72, 277, 0, 176, 47, 47, - /* 1300 */ 282, 47, 284, 47, 309, 176, 0, 312, 313, 314, - /* 1310 */ 315, 316, 317, 318, 319, 320, 321, 242, 309, 47, - /* 1320 */ 47, 312, 313, 314, 315, 316, 317, 309, 319, 176, - /* 1330 */ 312, 313, 314, 315, 316, 317, 0, 319, 176, 242, - /* 1340 */ 322, 0, 47, 0, 269, 327, 22, 0, 47, 0, - /* 1350 */ 81, 163, 277, 162, 160, 158, 0, 282, 0, 284, - /* 1360 */ 154, 153, 0, 0, 355, 356, 269, 44, 0, 0, - /* 1370 */ 0, 0, 0, 0, 277, 0, 0, 0, 0, 282, - /* 1380 */ 0, 284, 0, 0, 309, 0, 0, 312, 313, 314, - /* 1390 */ 315, 316, 317, 242, 319, 0, 0, 0, 0, 40, - /* 1400 */ 0, 0, 0, 0, 0, 242, 309, 0, 0, 312, - /* 1410 */ 313, 314, 315, 316, 317, 22, 319, 0, 0, 0, - /* 1420 */ 269, 0, 41, 14, 349, 37, 14, 40, 277, 0, - /* 1430 */ 0, 0, 269, 282, 44, 284, 44, 38, 0, 149, - /* 1440 */ 277, 0, 37, 0, 0, 282, 295, 284, 37, 0, - /* 1450 */ 37, 0, 37, 356, 0, 0, 242, 37, 0, 37, - /* 1460 */ 309, 47, 37, 312, 313, 314, 315, 316, 317, 59, - /* 1470 */ 319, 45, 309, 45, 47, 312, 313, 314, 315, 316, - /* 1480 */ 317, 47, 319, 269, 321, 45, 47, 45, 0, 0, - /* 1490 */ 0, 277, 0, 47, 22, 0, 282, 47, 284, 47, - /* 1500 */ 47, 41, 41, 47, 47, 0, 90, 242, 22, 295, - /* 1510 */ 47, 88, 47, 0, 48, 22, 0, 47, 22, 0, - /* 1520 */ 22, 242, 0, 309, 22, 0, 312, 313, 314, 315, - /* 1530 */ 316, 317, 20, 319, 269, 0, 147, 22, 47, 0, - /* 1540 */ 0, 0, 277, 164, 0, 81, 37, 282, 269, 284, - /* 1550 */ 82, 41, 41, 214, 81, 41, 277, 82, 81, 81, - /* 1560 */ 295, 282, 82, 284, 41, 44, 81, 41, 44, 214, - /* 1570 */ 242, 147, 44, 208, 309, 142, 144, 312, 313, 314, - /* 1580 */ 315, 316, 317, 147, 319, 82, 82, 242, 309, 41, - /* 1590 */ 44, 312, 313, 314, 315, 316, 317, 269, 319, 82, - /* 1600 */ 41, 47, 82, 47, 2, 277, 41, 47, 47, 47, - /* 1610 */ 282, 47, 284, 82, 269, 81, 44, 44, 82, 182, - /* 1620 */ 82, 22, 277, 81, 81, 0, 81, 282, 81, 284, - /* 1630 */ 37, 82, 184, 81, 81, 44, 242, 309, 44, 145, - /* 1640 */ 312, 313, 314, 315, 316, 317, 91, 319, 242, 214, - /* 1650 */ 81, 81, 22, 82, 309, 81, 81, 312, 313, 314, - /* 1660 */ 315, 316, 317, 269, 319, 82, 47, 47, 92, 142, - /* 1670 */ 81, 277, 82, 47, 82, 269, 282, 81, 284, 47, - /* 1680 */ 47, 81, 81, 277, 47, 82, 82, 81, 282, 242, - /* 1690 */ 284, 105, 105, 22, 81, 81, 47, 81, 93, 41, - /* 1700 */ 105, 22, 105, 309, 59, 58, 312, 313, 314, 315, - /* 1710 */ 316, 317, 47, 319, 64, 309, 269, 79, 312, 313, - /* 1720 */ 314, 315, 316, 317, 277, 319, 41, 47, 47, 282, - /* 1730 */ 47, 284, 22, 47, 47, 47, 47, 64, 47, 47, - /* 1740 */ 47, 242, 47, 47, 47, 47, 0, 47, 45, 37, - /* 1750 */ 242, 0, 47, 45, 0, 37, 309, 0, 47, 312, - /* 1760 */ 313, 314, 315, 316, 317, 45, 319, 37, 269, 47, - /* 1770 */ 45, 37, 0, 47, 0, 22, 277, 269, 22, 21, - /* 1780 */ 21, 282, 22, 284, 20, 277, 359, 359, 359, 359, - /* 1790 */ 282, 359, 284, 359, 359, 359, 359, 359, 359, 242, - /* 1800 */ 359, 359, 359, 359, 359, 359, 359, 359, 309, 359, - /* 1810 */ 359, 312, 313, 314, 315, 316, 317, 309, 319, 359, - /* 1820 */ 312, 313, 314, 315, 316, 317, 269, 319, 359, 359, - /* 1830 */ 359, 359, 359, 359, 277, 359, 359, 249, 359, 282, - /* 1840 */ 242, 284, 359, 359, 359, 359, 359, 359, 359, 359, - /* 1850 */ 359, 359, 359, 359, 359, 359, 359, 242, 359, 359, - /* 1860 */ 359, 359, 359, 359, 359, 277, 309, 269, 359, 312, - /* 1870 */ 313, 314, 315, 316, 317, 277, 319, 359, 359, 359, - /* 1880 */ 282, 359, 284, 359, 269, 297, 359, 359, 359, 359, - /* 1890 */ 359, 359, 277, 359, 359, 359, 359, 282, 359, 284, - /* 1900 */ 359, 359, 359, 359, 316, 359, 242, 309, 359, 359, - /* 1910 */ 312, 313, 314, 315, 316, 317, 359, 319, 242, 331, - /* 1920 */ 332, 333, 359, 335, 309, 359, 338, 312, 313, 314, - /* 1930 */ 315, 316, 317, 269, 319, 359, 359, 359, 350, 249, - /* 1940 */ 359, 277, 354, 359, 359, 269, 282, 359, 284, 359, - /* 1950 */ 359, 359, 359, 277, 359, 359, 359, 359, 282, 242, - /* 1960 */ 284, 359, 359, 359, 359, 359, 359, 277, 359, 359, - /* 1970 */ 359, 359, 359, 309, 359, 359, 312, 313, 314, 315, - /* 1980 */ 316, 317, 359, 319, 359, 309, 269, 297, 312, 313, - /* 1990 */ 314, 315, 316, 317, 277, 319, 359, 359, 359, 282, - /* 2000 */ 359, 284, 359, 359, 359, 359, 316, 359, 359, 359, - /* 2010 */ 359, 242, 359, 359, 359, 359, 359, 359, 359, 359, - /* 2020 */ 242, 331, 332, 333, 359, 335, 309, 359, 338, 312, - /* 2030 */ 313, 314, 315, 316, 317, 359, 319, 359, 269, 359, - /* 2040 */ 350, 359, 359, 359, 354, 359, 277, 269, 359, 359, - /* 2050 */ 359, 282, 359, 284, 359, 277, 359, 359, 359, 359, - /* 2060 */ 282, 359, 284, 359, 359, 359, 359, 359, 359, 359, - /* 2070 */ 359, 359, 359, 359, 359, 359, 359, 359, 309, 359, - /* 2080 */ 359, 312, 313, 314, 315, 316, 317, 309, 319, 359, - /* 2090 */ 312, 313, 314, 315, 316, 317, 359, 319, + /* 0 */ 274, 341, 273, 277, 248, 274, 250, 251, 277, 242, + /* 10 */ 257, 285, 12, 13, 261, 355, 285, 245, 14, 359, + /* 20 */ 20, 252, 22, 252, 20, 12, 13, 14, 15, 16, + /* 30 */ 12, 13, 263, 248, 263, 250, 251, 311, 312, 270, + /* 40 */ 22, 270, 311, 312, 272, 326, 327, 47, 322, 280, + /* 50 */ 313, 280, 280, 322, 41, 252, 20, 285, 58, 287, + /* 60 */ 12, 13, 14, 264, 64, 47, 263, 300, 20, 245, + /* 70 */ 22, 272, 300, 300, 337, 12, 13, 14, 15, 16, + /* 80 */ 281, 81, 64, 280, 312, 256, 20, 315, 316, 317, + /* 90 */ 318, 319, 320, 81, 322, 47, 272, 325, 269, 254, + /* 100 */ 252, 329, 330, 103, 280, 252, 58, 278, 341, 285, + /* 110 */ 245, 287, 64, 341, 341, 287, 263, 117, 118, 4, + /* 120 */ 275, 103, 355, 4, 20, 297, 359, 355, 355, 81, + /* 130 */ 57, 359, 359, 280, 55, 254, 312, 289, 19, 315, + /* 140 */ 316, 317, 318, 319, 320, 82, 322, 81, 267, 325, + /* 150 */ 285, 103, 33, 329, 330, 331, 275, 42, 43, 159, + /* 160 */ 81, 161, 83, 264, 45, 117, 118, 343, 3, 50, + /* 170 */ 158, 272, 160, 20, 55, 351, 352, 159, 283, 161, + /* 180 */ 281, 286, 287, 183, 184, 81, 186, 187, 188, 189, + /* 190 */ 190, 191, 192, 193, 194, 195, 196, 197, 198, 80, + /* 200 */ 20, 183, 83, 286, 287, 2, 4, 159, 341, 161, + /* 210 */ 20, 211, 194, 195, 196, 12, 13, 14, 15, 16, + /* 220 */ 12, 13, 355, 211, 245, 245, 359, 75, 20, 256, + /* 230 */ 22, 183, 184, 35, 186, 187, 188, 189, 190, 191, + /* 240 */ 192, 193, 194, 195, 196, 197, 198, 252, 272, 60, + /* 250 */ 61, 278, 272, 300, 65, 47, 280, 68, 69, 0, + /* 260 */ 280, 72, 73, 74, 285, 285, 58, 287, 12, 13, + /* 270 */ 117, 118, 64, 121, 122, 280, 20, 211, 22, 142, + /* 280 */ 300, 0, 84, 81, 86, 87, 154, 89, 81, 81, + /* 290 */ 211, 93, 312, 317, 341, 315, 316, 317, 318, 319, + /* 300 */ 320, 164, 322, 47, 45, 325, 174, 175, 355, 329, + /* 310 */ 330, 103, 359, 115, 319, 12, 13, 14, 15, 16, + /* 320 */ 64, 341, 244, 274, 246, 117, 118, 0, 333, 334, + /* 330 */ 335, 336, 4, 338, 285, 355, 199, 81, 57, 359, + /* 340 */ 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + /* 350 */ 104, 0, 106, 107, 108, 109, 110, 111, 81, 103, + /* 360 */ 311, 312, 12, 13, 14, 15, 16, 159, 91, 161, + /* 370 */ 183, 322, 21, 117, 118, 24, 25, 26, 27, 28, + /* 380 */ 29, 30, 31, 32, 57, 82, 12, 13, 14, 15, + /* 390 */ 16, 183, 184, 228, 186, 187, 188, 189, 190, 191, + /* 400 */ 192, 193, 194, 195, 196, 197, 198, 220, 221, 222, + /* 410 */ 223, 224, 20, 211, 22, 159, 21, 161, 211, 24, + /* 420 */ 25, 26, 27, 28, 29, 30, 31, 32, 12, 13, + /* 430 */ 14, 249, 249, 245, 252, 252, 20, 55, 22, 183, + /* 440 */ 184, 49, 186, 187, 188, 189, 190, 191, 192, 193, + /* 450 */ 194, 195, 196, 197, 198, 12, 13, 14, 15, 16, + /* 460 */ 272, 300, 80, 47, 341, 83, 47, 211, 280, 20, + /* 470 */ 113, 22, 272, 285, 245, 287, 12, 13, 355, 279, + /* 480 */ 64, 0, 359, 64, 20, 313, 22, 260, 288, 262, + /* 490 */ 12, 13, 14, 15, 16, 245, 47, 81, 49, 146, + /* 500 */ 312, 151, 341, 315, 316, 317, 318, 319, 320, 337, + /* 510 */ 322, 47, 112, 325, 285, 20, 355, 329, 330, 103, + /* 520 */ 359, 287, 148, 272, 271, 82, 169, 170, 64, 295, + /* 530 */ 279, 297, 57, 117, 118, 285, 58, 284, 245, 288, + /* 540 */ 212, 60, 61, 62, 63, 81, 65, 66, 67, 68, + /* 550 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + /* 560 */ 82, 0, 12, 13, 14, 15, 16, 103, 90, 216, + /* 570 */ 217, 171, 172, 20, 14, 159, 245, 161, 285, 245, + /* 580 */ 20, 117, 118, 233, 2, 24, 25, 26, 27, 28, + /* 590 */ 29, 30, 31, 32, 12, 13, 14, 15, 16, 183, + /* 600 */ 184, 245, 186, 187, 188, 189, 190, 191, 192, 193, + /* 610 */ 194, 195, 196, 197, 198, 252, 285, 272, 272, 285, + /* 620 */ 142, 20, 264, 159, 279, 161, 263, 281, 14, 245, + /* 630 */ 272, 258, 259, 288, 20, 64, 12, 13, 0, 281, + /* 640 */ 20, 285, 164, 280, 20, 0, 22, 183, 184, 58, + /* 650 */ 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + /* 660 */ 196, 197, 198, 1, 2, 14, 15, 16, 313, 285, + /* 670 */ 92, 47, 12, 13, 14, 15, 16, 199, 200, 201, + /* 680 */ 202, 203, 204, 205, 206, 207, 208, 282, 64, 252, + /* 690 */ 285, 274, 337, 258, 259, 245, 37, 252, 60, 61, + /* 700 */ 93, 148, 285, 65, 252, 81, 68, 69, 263, 93, + /* 710 */ 72, 73, 74, 245, 272, 263, 20, 280, 58, 112, + /* 720 */ 113, 114, 115, 116, 18, 280, 20, 103, 311, 312, + /* 730 */ 288, 115, 280, 27, 252, 285, 30, 300, 93, 322, + /* 740 */ 282, 117, 118, 285, 82, 263, 18, 187, 245, 245, + /* 750 */ 90, 23, 265, 285, 48, 268, 319, 112, 113, 114, + /* 760 */ 115, 116, 280, 35, 36, 245, 252, 39, 148, 252, + /* 770 */ 252, 334, 335, 336, 183, 338, 252, 263, 341, 280, + /* 780 */ 263, 263, 41, 159, 56, 161, 80, 263, 285, 285, + /* 790 */ 291, 64, 355, 41, 280, 252, 359, 280, 280, 42, + /* 800 */ 43, 187, 142, 273, 280, 285, 263, 183, 184, 81, + /* 810 */ 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + /* 820 */ 196, 197, 198, 280, 164, 273, 120, 209, 210, 123, + /* 830 */ 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + /* 840 */ 134, 135, 136, 137, 138, 139, 140, 119, 245, 273, + /* 850 */ 85, 245, 22, 88, 273, 245, 245, 245, 245, 199, + /* 860 */ 200, 201, 202, 203, 204, 205, 206, 207, 208, 210, + /* 870 */ 41, 85, 85, 85, 88, 88, 88, 47, 272, 151, + /* 880 */ 152, 153, 273, 187, 156, 47, 280, 0, 285, 252, + /* 890 */ 162, 285, 245, 287, 64, 285, 285, 285, 285, 21, + /* 900 */ 263, 173, 64, 41, 176, 41, 178, 179, 180, 181, + /* 910 */ 182, 82, 34, 41, 1, 2, 47, 280, 312, 272, + /* 920 */ 47, 315, 316, 317, 318, 319, 320, 280, 322, 252, + /* 930 */ 0, 325, 285, 103, 287, 329, 330, 331, 41, 211, + /* 940 */ 263, 117, 118, 273, 82, 41, 82, 0, 304, 41, + /* 950 */ 246, 261, 22, 0, 82, 44, 362, 280, 352, 312, + /* 960 */ 252, 0, 315, 316, 317, 318, 319, 320, 41, 322, + /* 970 */ 245, 263, 325, 232, 41, 22, 329, 330, 331, 82, + /* 980 */ 93, 41, 230, 22, 41, 353, 82, 340, 280, 159, + /* 990 */ 82, 161, 81, 46, 308, 253, 245, 272, 348, 112, + /* 1000 */ 113, 114, 115, 116, 272, 280, 253, 251, 41, 82, + /* 1010 */ 285, 41, 287, 183, 184, 82, 314, 41, 41, 41, + /* 1020 */ 41, 284, 82, 272, 339, 82, 342, 356, 356, 356, + /* 1030 */ 161, 280, 213, 310, 161, 20, 285, 312, 287, 45, + /* 1040 */ 315, 316, 317, 318, 319, 320, 252, 322, 245, 82, + /* 1050 */ 325, 47, 82, 309, 329, 330, 331, 245, 82, 82, + /* 1060 */ 82, 82, 258, 312, 157, 340, 315, 316, 317, 318, + /* 1070 */ 319, 320, 302, 322, 252, 272, 325, 252, 40, 142, + /* 1080 */ 329, 330, 331, 280, 272, 292, 290, 290, 285, 252, + /* 1090 */ 287, 340, 280, 20, 247, 247, 20, 285, 306, 287, + /* 1100 */ 256, 287, 256, 300, 20, 299, 245, 20, 301, 256, + /* 1110 */ 299, 256, 300, 280, 20, 312, 293, 252, 315, 316, + /* 1120 */ 317, 318, 319, 320, 312, 322, 256, 315, 316, 317, + /* 1130 */ 318, 319, 320, 272, 322, 256, 256, 247, 272, 272, + /* 1140 */ 272, 280, 247, 272, 341, 252, 285, 245, 287, 272, + /* 1150 */ 254, 306, 167, 341, 272, 272, 272, 272, 355, 285, + /* 1160 */ 272, 272, 359, 305, 254, 245, 285, 355, 252, 254, + /* 1170 */ 20, 359, 280, 312, 272, 299, 315, 316, 317, 318, + /* 1180 */ 319, 320, 280, 322, 293, 287, 325, 285, 254, 287, + /* 1190 */ 329, 330, 272, 219, 285, 296, 347, 285, 218, 347, + /* 1200 */ 280, 296, 285, 285, 350, 285, 225, 287, 314, 150, + /* 1210 */ 227, 214, 349, 226, 312, 210, 245, 315, 316, 317, + /* 1220 */ 318, 319, 320, 321, 322, 323, 324, 20, 280, 310, + /* 1230 */ 40, 231, 312, 347, 19, 315, 316, 317, 318, 319, + /* 1240 */ 320, 313, 322, 272, 234, 344, 346, 229, 33, 81, + /* 1250 */ 296, 280, 296, 332, 285, 145, 285, 328, 287, 345, + /* 1260 */ 45, 358, 294, 357, 280, 293, 51, 52, 53, 54, + /* 1270 */ 55, 285, 280, 285, 254, 268, 254, 245, 81, 276, + /* 1280 */ 360, 361, 358, 312, 358, 363, 315, 316, 317, 318, + /* 1290 */ 319, 320, 357, 322, 245, 80, 325, 285, 83, 357, + /* 1300 */ 252, 330, 262, 247, 272, 254, 307, 252, 266, 303, + /* 1310 */ 266, 266, 280, 255, 243, 0, 0, 285, 40, 287, + /* 1320 */ 0, 272, 72, 0, 47, 177, 47, 47, 47, 280, + /* 1330 */ 298, 116, 177, 0, 285, 280, 287, 47, 47, 177, + /* 1340 */ 0, 177, 0, 47, 312, 245, 22, 315, 316, 317, + /* 1350 */ 318, 319, 320, 0, 322, 300, 0, 47, 0, 144, + /* 1360 */ 164, 312, 147, 163, 315, 316, 317, 318, 319, 320, + /* 1370 */ 81, 322, 272, 252, 319, 161, 0, 159, 0, 155, + /* 1380 */ 280, 166, 154, 168, 0, 285, 0, 287, 44, 334, + /* 1390 */ 335, 336, 0, 338, 141, 0, 341, 0, 0, 245, + /* 1400 */ 0, 280, 0, 354, 0, 0, 0, 0, 245, 0, + /* 1410 */ 355, 0, 312, 0, 359, 315, 316, 317, 318, 319, + /* 1420 */ 320, 0, 322, 0, 0, 0, 272, 0, 0, 40, + /* 1430 */ 0, 0, 0, 0, 280, 272, 22, 0, 0, 285, + /* 1440 */ 319, 287, 0, 280, 0, 0, 0, 0, 285, 0, + /* 1450 */ 287, 41, 298, 37, 14, 334, 335, 336, 40, 338, + /* 1460 */ 0, 361, 245, 44, 14, 0, 312, 38, 0, 315, + /* 1470 */ 316, 317, 318, 319, 320, 312, 322, 252, 315, 316, + /* 1480 */ 317, 318, 319, 320, 0, 322, 150, 324, 37, 272, + /* 1490 */ 0, 37, 44, 0, 37, 0, 0, 280, 59, 0, + /* 1500 */ 33, 37, 285, 47, 287, 280, 45, 0, 37, 0, + /* 1510 */ 47, 45, 45, 245, 37, 298, 47, 45, 51, 52, + /* 1520 */ 53, 54, 55, 0, 45, 47, 37, 245, 0, 312, + /* 1530 */ 0, 0, 315, 316, 317, 318, 319, 320, 47, 322, + /* 1540 */ 272, 0, 90, 88, 319, 0, 22, 80, 280, 47, + /* 1550 */ 83, 47, 47, 285, 272, 287, 41, 47, 41, 334, + /* 1560 */ 335, 336, 280, 338, 0, 47, 298, 285, 47, 287, + /* 1570 */ 22, 0, 47, 22, 48, 0, 22, 0, 22, 47, + /* 1580 */ 312, 0, 245, 315, 316, 317, 318, 319, 320, 22, + /* 1590 */ 322, 245, 20, 0, 312, 0, 47, 315, 316, 317, + /* 1600 */ 318, 319, 320, 0, 322, 245, 148, 22, 165, 272, + /* 1610 */ 143, 0, 145, 0, 147, 145, 149, 280, 272, 0, + /* 1620 */ 81, 148, 285, 148, 287, 37, 280, 41, 143, 82, + /* 1630 */ 41, 285, 272, 287, 81, 168, 44, 215, 81, 41, + /* 1640 */ 280, 82, 82, 81, 81, 285, 81, 287, 82, 312, + /* 1650 */ 41, 44, 315, 316, 317, 318, 319, 320, 312, 322, + /* 1660 */ 81, 315, 316, 317, 318, 319, 320, 41, 322, 82, + /* 1670 */ 41, 44, 312, 82, 215, 315, 316, 317, 318, 319, + /* 1680 */ 320, 245, 322, 209, 44, 41, 82, 82, 47, 47, + /* 1690 */ 47, 215, 47, 47, 47, 2, 183, 41, 245, 44, + /* 1700 */ 82, 81, 22, 82, 81, 81, 44, 245, 272, 81, + /* 1710 */ 0, 81, 185, 82, 82, 81, 280, 81, 37, 146, + /* 1720 */ 81, 285, 44, 287, 91, 272, 143, 44, 22, 81, + /* 1730 */ 92, 82, 81, 280, 272, 81, 47, 47, 285, 82, + /* 1740 */ 287, 81, 280, 82, 47, 81, 47, 285, 312, 287, + /* 1750 */ 82, 315, 316, 317, 318, 319, 320, 81, 322, 245, + /* 1760 */ 47, 82, 47, 81, 105, 312, 82, 81, 315, 316, + /* 1770 */ 317, 318, 319, 320, 312, 322, 105, 315, 316, 317, + /* 1780 */ 318, 319, 320, 245, 322, 22, 272, 93, 81, 81, + /* 1790 */ 105, 47, 105, 81, 280, 41, 22, 59, 58, 285, + /* 1800 */ 245, 287, 47, 64, 79, 41, 47, 47, 47, 47, + /* 1810 */ 272, 22, 47, 47, 47, 64, 47, 47, 280, 47, + /* 1820 */ 47, 0, 47, 285, 47, 287, 312, 272, 47, 315, + /* 1830 */ 316, 317, 318, 319, 320, 280, 322, 47, 45, 37, + /* 1840 */ 285, 0, 287, 47, 45, 37, 0, 37, 47, 45, + /* 1850 */ 312, 245, 0, 315, 316, 317, 318, 319, 320, 47, + /* 1860 */ 322, 45, 245, 37, 0, 47, 0, 312, 20, 22, + /* 1870 */ 315, 316, 317, 318, 319, 320, 21, 322, 272, 22, + /* 1880 */ 22, 21, 364, 364, 364, 364, 280, 364, 364, 272, + /* 1890 */ 364, 285, 364, 287, 364, 364, 364, 280, 364, 364, + /* 1900 */ 364, 364, 285, 245, 287, 364, 364, 364, 364, 364, + /* 1910 */ 364, 364, 364, 364, 245, 364, 364, 364, 312, 364, + /* 1920 */ 364, 315, 316, 317, 318, 319, 320, 364, 322, 312, + /* 1930 */ 272, 364, 315, 316, 317, 318, 319, 320, 280, 322, + /* 1940 */ 364, 272, 364, 285, 364, 287, 364, 364, 364, 280, + /* 1950 */ 364, 364, 364, 364, 285, 364, 287, 364, 364, 364, + /* 1960 */ 364, 364, 364, 364, 364, 364, 364, 245, 364, 364, + /* 1970 */ 312, 364, 364, 315, 316, 317, 318, 319, 320, 245, + /* 1980 */ 322, 312, 364, 364, 315, 316, 317, 318, 319, 320, + /* 1990 */ 364, 322, 364, 245, 272, 364, 364, 364, 364, 364, + /* 2000 */ 364, 364, 280, 364, 364, 364, 272, 285, 364, 287, + /* 2010 */ 364, 364, 364, 364, 280, 364, 364, 364, 364, 285, + /* 2020 */ 272, 287, 364, 364, 364, 364, 364, 364, 280, 364, + /* 2030 */ 364, 364, 364, 285, 312, 287, 364, 315, 316, 317, + /* 2040 */ 318, 319, 320, 364, 322, 245, 312, 364, 364, 315, + /* 2050 */ 316, 317, 318, 319, 320, 364, 322, 364, 364, 364, + /* 2060 */ 312, 364, 364, 315, 316, 317, 318, 319, 320, 364, + /* 2070 */ 322, 364, 272, 364, 364, 364, 364, 364, 364, 364, + /* 2080 */ 280, 364, 364, 364, 364, 285, 364, 287, 364, 364, + /* 2090 */ 364, 364, 364, 364, 364, 364, 364, 364, 364, 364, + /* 2100 */ 364, 364, 364, 364, 364, 364, 364, 364, 364, 364, + /* 2110 */ 364, 364, 312, 364, 364, 315, 316, 317, 318, 319, + /* 2120 */ 320, 364, 322, 364, }; -#define YY_SHIFT_COUNT (621) +#define YY_SHIFT_COUNT (635) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (1774) +#define YY_SHIFT_MAX (1866) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 686, 0, 0, 48, 207, 207, 207, 207, 255, 255, - /* 10 */ 207, 207, 414, 462, 621, 462, 462, 462, 462, 462, - /* 20 */ 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, - /* 30 */ 462, 462, 462, 462, 462, 462, 462, 462, 63, 63, - /* 40 */ 47, 47, 47, 524, 524, 524, 524, 198, 457, 275, - /* 50 */ 11, 11, 104, 104, 76, 196, 275, 275, 11, 11, - /* 60 */ 11, 11, 11, 11, 11, 58, 11, 11, 142, 246, - /* 70 */ 311, 142, 11, 11, 142, 11, 142, 142, 142, 11, - /* 80 */ 119, 660, 679, 810, 810, 350, 395, 432, 432, 432, - /* 90 */ 432, 432, 432, 432, 432, 432, 432, 432, 432, 432, - /* 100 */ 432, 432, 432, 432, 432, 432, 455, 196, 70, 70, - /* 110 */ 21, 512, 683, 683, 683, 782, 512, 340, 311, 142, - /* 120 */ 142, 416, 416, 673, 713, 197, 197, 197, 197, 197, - /* 130 */ 197, 197, 886, 232, 351, 209, 107, 472, 43, 36, - /* 140 */ 134, 295, 544, 576, 757, 781, 551, 554, 551, 676, - /* 150 */ 676, 676, 547, 578, 793, 1002, 990, 991, 881, 1002, - /* 160 */ 1002, 1012, 913, 913, 1002, 1039, 1039, 1043, 58, 311, - /* 170 */ 58, 1053, 1062, 58, 1053, 58, 340, 1073, 58, 58, - /* 180 */ 1002, 58, 1039, 142, 142, 142, 142, 142, 142, 142, - /* 190 */ 142, 142, 142, 142, 1002, 1039, 416, 416, 1043, 119, - /* 200 */ 989, 311, 119, 1002, 1053, 119, 340, 1073, 119, 1138, - /* 210 */ 950, 943, 416, 950, 943, 416, 416, 142, 964, 1049, - /* 220 */ 993, 793, 992, 340, 1189, 1171, 984, 996, 983, 984, - /* 230 */ 996, 984, 996, 1136, 943, 416, 416, 943, 416, 1079, - /* 240 */ 340, 1073, 119, 673, 119, 340, 1181, 416, 713, 1002, - /* 250 */ 119, 1039, 2098, 2098, 2098, 2098, 2098, 2098, 2098, 272, - /* 260 */ 901, 720, 1186, 549, 740, 12, 111, 268, 20, 187, - /* 270 */ 271, 234, 234, 234, 234, 234, 234, 234, 234, 31, - /* 280 */ 16, 514, 358, 671, 476, 302, 302, 302, 302, 831, - /* 290 */ 280, 445, 758, 763, 809, 873, 889, 893, 878, 863, - /* 300 */ 865, 867, 912, 792, 694, 139, 877, 786, 895, 854, - /* 310 */ 903, 907, 909, 937, 938, 231, 667, 939, 941, 942, - /* 320 */ 945, 946, 951, 835, 860, 988, 1288, 1289, 1250, 1292, - /* 330 */ 1222, 1296, 1251, 1121, 1252, 1254, 1256, 1129, 1306, 1272, - /* 340 */ 1273, 1153, 1336, 1162, 1341, 1295, 1343, 1324, 1347, 1301, - /* 350 */ 1349, 1269, 1188, 1191, 1194, 1197, 1356, 1358, 1206, 1208, - /* 360 */ 1362, 1363, 1323, 1368, 1369, 1370, 1371, 1372, 1373, 1375, - /* 370 */ 1376, 1377, 1378, 1380, 1382, 1383, 1385, 1386, 1395, 1396, - /* 380 */ 1397, 1359, 1398, 1400, 1401, 1402, 1403, 1404, 1393, 1407, - /* 390 */ 1408, 1417, 1418, 1419, 1421, 1387, 1388, 1381, 1409, 1390, - /* 400 */ 1412, 1392, 1429, 1399, 1405, 1430, 1431, 1438, 1411, 1290, - /* 410 */ 1441, 1443, 1413, 1444, 1410, 1449, 1451, 1414, 1426, 1415, - /* 420 */ 1454, 1427, 1428, 1420, 1455, 1434, 1440, 1422, 1458, 1439, - /* 430 */ 1442, 1425, 1488, 1489, 1490, 1492, 1416, 1423, 1446, 1472, - /* 440 */ 1495, 1450, 1452, 1453, 1456, 1460, 1461, 1457, 1463, 1465, - /* 450 */ 1505, 1486, 1513, 1493, 1466, 1516, 1496, 1470, 1519, 1498, - /* 460 */ 1522, 1502, 1512, 1525, 1389, 1491, 1535, 1379, 1515, 1424, - /* 470 */ 1432, 1539, 1540, 1541, 1436, 1544, 1464, 1509, 1433, 1510, - /* 480 */ 1511, 1339, 1468, 1514, 1475, 1473, 1477, 1478, 1480, 1523, - /* 490 */ 1521, 1524, 1485, 1526, 1355, 1503, 1504, 1528, 1365, 1548, - /* 500 */ 1546, 1517, 1559, 1435, 1520, 1554, 1556, 1560, 1561, 1562, - /* 510 */ 1564, 1520, 1602, 1437, 1565, 1531, 1534, 1536, 1572, 1542, - /* 520 */ 1543, 1573, 1599, 1448, 1545, 1538, 1549, 1547, 1552, 1494, - /* 530 */ 1553, 1625, 1593, 1527, 1569, 1555, 1591, 1594, 1570, 1571, - /* 540 */ 1574, 1630, 1575, 1576, 1583, 1619, 1620, 1589, 1590, 1626, - /* 550 */ 1596, 1592, 1632, 1600, 1603, 1633, 1601, 1604, 1637, 1606, - /* 560 */ 1586, 1587, 1595, 1597, 1671, 1605, 1613, 1614, 1649, 1616, - /* 570 */ 1658, 1658, 1679, 1645, 1647, 1665, 1650, 1638, 1685, 1680, - /* 580 */ 1681, 1683, 1686, 1687, 1710, 1688, 1689, 1673, 1460, 1691, - /* 590 */ 1461, 1692, 1693, 1695, 1696, 1697, 1698, 1746, 1700, 1703, - /* 600 */ 1712, 1751, 1705, 1708, 1718, 1754, 1711, 1720, 1730, 1757, - /* 610 */ 1722, 1725, 1734, 1772, 1726, 1774, 1753, 1758, 1756, 1760, - /* 620 */ 1759, 1764, + /* 0 */ 728, 0, 0, 48, 208, 208, 208, 208, 256, 256, + /* 10 */ 208, 208, 416, 464, 624, 464, 464, 464, 464, 464, + /* 20 */ 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + /* 30 */ 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + /* 40 */ 66, 66, 104, 104, 104, 18, 18, 18, 18, 12, + /* 50 */ 79, 207, 36, 36, 115, 115, 202, 153, 207, 207, + /* 60 */ 36, 36, 36, 36, 36, 36, 36, 36, 73, 36, + /* 70 */ 36, 180, 190, 495, 180, 36, 36, 180, 36, 180, + /* 80 */ 180, 180, 36, 475, 706, 478, 660, 660, 395, 189, + /* 90 */ 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, + /* 100 */ 830, 830, 830, 830, 830, 830, 830, 830, 830, 198, + /* 110 */ 153, 4, 4, 281, 419, 553, 553, 553, 327, 419, + /* 120 */ 601, 495, 180, 180, 571, 571, 578, 727, 246, 246, + /* 130 */ 246, 246, 246, 246, 246, 1215, 351, 638, 350, 187, + /* 140 */ 449, 357, 353, 560, 614, 392, 757, 616, 620, 618, + /* 150 */ 659, 618, 165, 165, 165, 328, 696, 819, 1015, 994, + /* 160 */ 1004, 907, 1015, 1015, 1038, 937, 937, 1015, 1073, 1073, + /* 170 */ 1076, 73, 495, 73, 1084, 1087, 73, 1084, 73, 601, + /* 180 */ 1094, 73, 73, 1015, 73, 1073, 180, 180, 180, 180, + /* 190 */ 180, 180, 180, 180, 180, 180, 180, 1015, 1073, 571, + /* 200 */ 571, 1076, 475, 985, 495, 475, 1015, 1084, 475, 601, + /* 210 */ 1094, 475, 1150, 571, 974, 980, 571, 974, 980, 571, + /* 220 */ 571, 180, 981, 1059, 974, 983, 987, 997, 819, 1005, + /* 230 */ 601, 1207, 1190, 1000, 1018, 1010, 1000, 1018, 1000, 1018, + /* 240 */ 1168, 980, 571, 571, 980, 571, 1110, 601, 1094, 475, + /* 250 */ 578, 475, 601, 1197, 571, 727, 1015, 475, 1073, 2123, + /* 260 */ 2123, 2123, 2123, 2123, 2123, 2123, 481, 1467, 561, 119, + /* 270 */ 645, 887, 63, 13, 303, 203, 582, 374, 443, 607, + /* 280 */ 550, 550, 550, 550, 550, 550, 550, 550, 132, 382, + /* 290 */ 152, 400, 662, 137, 651, 651, 651, 651, 259, 829, + /* 300 */ 765, 786, 787, 788, 930, 953, 961, 878, 862, 864, + /* 310 */ 872, 913, 824, 752, 741, 897, 591, 904, 911, 908, + /* 320 */ 927, 933, 940, 943, 869, 873, 967, 970, 976, 977, + /* 330 */ 978, 979, 277, 838, 947, 1315, 1316, 1278, 1320, 1250, + /* 340 */ 1323, 1277, 1148, 1279, 1280, 1281, 1155, 1333, 1290, 1291, + /* 350 */ 1162, 1340, 1164, 1342, 1296, 1353, 1324, 1356, 1310, 1358, + /* 360 */ 1289, 1196, 1200, 1214, 1218, 1376, 1378, 1224, 1228, 1384, + /* 370 */ 1386, 1344, 1392, 1253, 1395, 1397, 1398, 1400, 1402, 1404, + /* 380 */ 1405, 1406, 1407, 1409, 1411, 1413, 1421, 1423, 1424, 1425, + /* 390 */ 1427, 1428, 1389, 1430, 1431, 1432, 1433, 1442, 1444, 1414, + /* 400 */ 1437, 1438, 1445, 1446, 1447, 1449, 1418, 1416, 1410, 1440, + /* 410 */ 1419, 1450, 1448, 1460, 1429, 1451, 1465, 1468, 1484, 1454, + /* 420 */ 1336, 1490, 1493, 1457, 1495, 1439, 1496, 1499, 1456, 1461, + /* 430 */ 1464, 1507, 1463, 1466, 1471, 1509, 1469, 1472, 1477, 1523, + /* 440 */ 1478, 1479, 1489, 1528, 1530, 1531, 1541, 1452, 1455, 1491, + /* 450 */ 1524, 1545, 1502, 1504, 1505, 1510, 1515, 1517, 1518, 1521, + /* 460 */ 1525, 1564, 1548, 1571, 1551, 1526, 1575, 1554, 1532, 1577, + /* 470 */ 1556, 1581, 1567, 1572, 1593, 1458, 1549, 1595, 1443, 1585, + /* 480 */ 1473, 1470, 1603, 1611, 1613, 1475, 1619, 1539, 1588, 1485, + /* 490 */ 1586, 1589, 1422, 1553, 1547, 1557, 1559, 1598, 1560, 1562, + /* 500 */ 1563, 1565, 1566, 1609, 1592, 1607, 1579, 1626, 1459, 1587, + /* 510 */ 1591, 1627, 1474, 1629, 1640, 1604, 1644, 1476, 1605, 1641, + /* 520 */ 1642, 1643, 1645, 1646, 1647, 1605, 1693, 1513, 1656, 1618, + /* 530 */ 1620, 1621, 1655, 1623, 1624, 1662, 1680, 1527, 1628, 1631, + /* 540 */ 1632, 1630, 1634, 1573, 1636, 1710, 1681, 1583, 1639, 1633, + /* 550 */ 1678, 1683, 1648, 1649, 1651, 1706, 1654, 1638, 1657, 1689, + /* 560 */ 1690, 1660, 1661, 1697, 1664, 1668, 1699, 1676, 1679, 1713, + /* 570 */ 1682, 1684, 1715, 1686, 1659, 1671, 1685, 1687, 1763, 1694, + /* 580 */ 1707, 1708, 1744, 1712, 1754, 1754, 1774, 1738, 1740, 1755, + /* 590 */ 1739, 1725, 1764, 1759, 1760, 1761, 1762, 1765, 1789, 1766, + /* 600 */ 1767, 1751, 1515, 1769, 1517, 1770, 1772, 1773, 1775, 1777, + /* 610 */ 1781, 1821, 1790, 1793, 1802, 1841, 1796, 1799, 1808, 1846, + /* 620 */ 1801, 1804, 1810, 1852, 1812, 1816, 1826, 1864, 1818, 1866, + /* 630 */ 1847, 1855, 1857, 1858, 1860, 1848, }; -#define YY_REDUCE_COUNT (258) -#define YY_REDUCE_MIN (-300) -#define YY_REDUCE_MAX (1778) +#define YY_REDUCE_COUNT (265) +#define YY_REDUCE_MIN (-340) +#define YY_REDUCE_MAX (1800) static const short yy_reduce_ofst[] = { - /* 0 */ -186, -240, -177, 241, 648, 762, 788, 814, 866, 880, - /* 10 */ 189, 931, 995, 1009, 1018, 459, 1075, 1097, 1151, 1163, - /* 20 */ 1214, 1265, 1279, 1328, 1345, 1394, 1406, 1447, 1499, 1508, - /* 30 */ 1557, 1598, 1615, 1664, 1676, 1717, 1769, 1778, 1588, 1690, - /* 40 */ -161, -118, 156, -268, -263, 3, 404, -175, 223, 278, - /* 50 */ -158, 285, -238, -230, -300, -279, -295, -253, -156, 158, - /* 60 */ 237, 335, 421, 428, 450, 247, 572, 580, -246, -136, - /* 70 */ -66, 92, 585, 610, 145, 611, 352, 309, 362, 643, - /* 80 */ 374, -197, -275, -275, -275, -34, -124, 81, 124, 127, - /* 90 */ 175, 180, 211, 217, 265, 384, 387, 418, 429, 434, - /* 100 */ 447, 473, 484, 488, 520, 593, 356, 193, -183, 41, - /* 110 */ 135, 327, 373, 422, 423, 4, 441, 614, -141, 550, - /* 120 */ -269, 150, 245, 469, 95, 599, 604, 652, 653, 657, - /* 130 */ 659, 663, 641, 700, 714, 601, 623, 743, 685, 654, - /* 140 */ 726, 726, 747, 750, 718, 689, 665, 665, 665, 655, - /* 150 */ 656, 674, 664, 726, 711, 777, 730, 785, 742, 799, - /* 160 */ 801, 753, 768, 771, 811, 817, 818, 761, 813, 783, - /* 170 */ 816, 784, 787, 833, 791, 839, 829, 804, 842, 856, - /* 180 */ 862, 859, 869, 848, 849, 850, 851, 852, 855, 868, - /* 190 */ 870, 875, 876, 883, 885, 888, 864, 871, 844, 887, - /* 200 */ 857, 872, 910, 905, 874, 914, 890, 879, 915, 861, - /* 210 */ 824, 891, 892, 840, 898, 894, 904, 726, 858, 882, - /* 220 */ 897, 896, 665, 930, 900, 899, 902, 911, 884, 906, - /* 230 */ 916, 908, 918, 924, 928, 944, 947, 934, 953, 933, - /* 240 */ 955, 949, 982, 987, 1003, 979, 994, 998, 1006, 1022, - /* 250 */ 1023, 1029, 975, 972, 1019, 1020, 1021, 1033, 1041, + /* 0 */ -233, -228, -20, -176, 606, 647, 725, 751, 803, 812, + /* 10 */ 188, 861, 902, 920, 971, 1032, 1049, 1100, 1154, 1163, + /* 20 */ 1217, 1268, 1282, 1337, 1346, 1360, 1436, 1453, 1462, 1514, + /* 30 */ 1538, 1555, 1606, 1617, 1658, 1669, 1722, 1734, 1748, 1800, + /* 40 */ 437, 1055, -5, 1121, 1225, -274, -269, 49, 417, -227, + /* 50 */ -47, 161, -231, -229, -244, -215, -340, -105, -133, 123, + /* 60 */ -197, -147, 363, 445, 452, 482, 514, 517, -171, 518, + /* 70 */ 543, 200, -24, 234, -201, 637, 677, 251, 524, -101, + /* 80 */ 345, 358, 708, -119, -152, -281, -281, -281, 78, -247, + /* 90 */ -135, -21, 229, 250, 293, 331, 334, 356, 384, 450, + /* 100 */ 468, 503, 504, 520, 603, 610, 611, 612, 613, 253, + /* 110 */ -83, 182, 183, -27, 373, -263, 172, 355, -155, 435, + /* 120 */ 499, -172, 346, 442, 405, 458, 487, 227, -271, 530, + /* 130 */ 552, 576, 581, 609, 670, 644, 704, 690, 594, 632, + /* 140 */ 742, 686, 650, 732, 732, 753, 756, 737, 702, 685, + /* 150 */ 685, 685, 671, 672, 673, 684, 732, 723, 794, 744, + /* 160 */ 804, 770, 822, 825, 793, 796, 797, 837, 847, 848, + /* 170 */ 792, 844, 814, 846, 806, 807, 853, 811, 855, 833, + /* 180 */ 823, 870, 879, 865, 880, 890, 866, 867, 868, 871, + /* 190 */ 877, 882, 883, 884, 885, 888, 889, 893, 895, 874, + /* 200 */ 881, 845, 896, 858, 898, 910, 916, 876, 915, 892, + /* 210 */ 891, 934, 894, 909, 849, 899, 912, 852, 905, 917, + /* 220 */ 918, 732, 854, 863, 886, 900, 914, 901, 919, 685, + /* 230 */ 948, 928, 921, 903, 906, 922, 924, 935, 926, 942, + /* 240 */ 929, 954, 969, 986, 956, 988, 968, 984, 972, 1020, + /* 250 */ 1007, 1022, 992, 1003, 1012, 1040, 1048, 1051, 1056, 1006, + /* 260 */ 999, 1042, 1044, 1045, 1058, 1071, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 10 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 20 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 30 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 40 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 50 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 60 */ 1371, 1371, 1371, 1371, 1371, 1440, 1371, 1371, 1371, 1371, - /* 70 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 80 */ 1438, 1586, 1371, 1750, 1371, 1371, 1371, 1371, 1371, 1371, - /* 90 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 100 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 110 */ 1440, 1371, 1761, 1761, 1761, 1438, 1371, 1371, 1371, 1371, - /* 120 */ 1371, 1371, 1371, 1534, 1371, 1371, 1371, 1371, 1371, 1371, - /* 130 */ 1371, 1371, 1619, 1371, 1371, 1827, 1371, 1371, 1625, 1785, - /* 140 */ 1371, 1371, 1371, 1371, 1487, 1777, 1753, 1767, 1754, 1812, - /* 150 */ 1812, 1812, 1770, 1371, 1781, 1371, 1371, 1371, 1611, 1371, - /* 160 */ 1371, 1591, 1588, 1588, 1371, 1371, 1371, 1371, 1440, 1371, - /* 170 */ 1440, 1371, 1371, 1440, 1371, 1440, 1371, 1371, 1440, 1440, - /* 180 */ 1371, 1440, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 190 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1438, - /* 200 */ 1621, 1371, 1438, 1371, 1371, 1438, 1371, 1371, 1438, 1371, - /* 210 */ 1792, 1790, 1371, 1792, 1790, 1371, 1371, 1371, 1804, 1800, - /* 220 */ 1783, 1781, 1767, 1371, 1371, 1371, 1818, 1814, 1830, 1818, - /* 230 */ 1814, 1818, 1814, 1371, 1790, 1371, 1371, 1790, 1371, 1596, - /* 240 */ 1371, 1371, 1438, 1371, 1438, 1371, 1503, 1371, 1371, 1371, - /* 250 */ 1438, 1371, 1613, 1627, 1537, 1537, 1537, 1441, 1376, 1371, - /* 260 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 270 */ 1499, 1694, 1803, 1802, 1726, 1725, 1724, 1722, 1693, 1371, - /* 280 */ 1371, 1371, 1371, 1371, 1371, 1687, 1688, 1686, 1685, 1371, - /* 290 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 300 */ 1371, 1371, 1751, 1371, 1815, 1819, 1371, 1371, 1371, 1670, - /* 310 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 320 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 330 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 340 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 350 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 360 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 370 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 380 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 390 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1405, 1371, 1371, - /* 400 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 410 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 420 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 430 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 440 */ 1371, 1371, 1371, 1371, 1371, 1468, 1467, 1371, 1371, 1371, - /* 450 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 460 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 470 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1774, - /* 480 */ 1784, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 490 */ 1371, 1670, 1371, 1801, 1371, 1760, 1756, 1371, 1371, 1752, - /* 500 */ 1371, 1371, 1813, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 510 */ 1371, 1371, 1746, 1371, 1719, 1371, 1371, 1371, 1371, 1371, - /* 520 */ 1371, 1371, 1371, 1681, 1371, 1371, 1371, 1371, 1371, 1371, - /* 530 */ 1371, 1371, 1371, 1371, 1371, 1371, 1669, 1371, 1710, 1371, - /* 540 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1531, 1371, 1371, - /* 550 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 560 */ 1516, 1514, 1513, 1512, 1371, 1509, 1371, 1371, 1371, 1371, - /* 570 */ 1540, 1539, 1371, 1371, 1371, 1371, 1371, 1371, 1460, 1371, - /* 580 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1451, 1371, - /* 590 */ 1450, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 600 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 610 */ 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, - /* 620 */ 1371, 1371, + /* 0 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 10 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 20 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 30 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 40 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 50 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 60 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1461, 1392, + /* 70 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 80 */ 1392, 1392, 1392, 1459, 1608, 1392, 1772, 1392, 1392, 1392, + /* 90 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 100 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 110 */ 1392, 1392, 1392, 1461, 1392, 1783, 1783, 1783, 1459, 1392, + /* 120 */ 1392, 1392, 1392, 1392, 1392, 1392, 1555, 1392, 1392, 1392, + /* 130 */ 1392, 1392, 1392, 1392, 1392, 1641, 1392, 1392, 1853, 1392, + /* 140 */ 1392, 1647, 1807, 1392, 1392, 1392, 1392, 1508, 1799, 1775, + /* 150 */ 1789, 1776, 1838, 1838, 1838, 1792, 1392, 1803, 1392, 1392, + /* 160 */ 1392, 1633, 1392, 1392, 1613, 1610, 1610, 1392, 1392, 1392, + /* 170 */ 1392, 1461, 1392, 1461, 1392, 1392, 1461, 1392, 1461, 1392, + /* 180 */ 1392, 1461, 1461, 1392, 1461, 1392, 1392, 1392, 1392, 1392, + /* 190 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 200 */ 1392, 1392, 1459, 1643, 1392, 1459, 1392, 1392, 1459, 1392, + /* 210 */ 1392, 1459, 1392, 1392, 1814, 1812, 1392, 1814, 1812, 1392, + /* 220 */ 1392, 1392, 1826, 1822, 1814, 1830, 1828, 1805, 1803, 1789, + /* 230 */ 1392, 1392, 1392, 1844, 1840, 1856, 1844, 1840, 1844, 1840, + /* 240 */ 1392, 1812, 1392, 1392, 1812, 1392, 1618, 1392, 1392, 1459, + /* 250 */ 1392, 1459, 1392, 1524, 1392, 1392, 1392, 1459, 1392, 1635, + /* 260 */ 1649, 1558, 1558, 1558, 1462, 1397, 1392, 1392, 1392, 1392, + /* 270 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1520, + /* 280 */ 1716, 1825, 1824, 1748, 1747, 1746, 1744, 1715, 1392, 1392, + /* 290 */ 1392, 1392, 1392, 1392, 1709, 1710, 1708, 1707, 1392, 1392, + /* 300 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 310 */ 1392, 1773, 1392, 1841, 1845, 1392, 1392, 1392, 1692, 1392, + /* 320 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 330 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 340 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 350 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 360 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 370 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 380 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 390 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 400 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1426, 1392, + /* 410 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 420 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 430 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 440 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 450 */ 1392, 1392, 1392, 1392, 1392, 1392, 1489, 1488, 1392, 1392, + /* 460 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 470 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 480 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 490 */ 1796, 1806, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 500 */ 1392, 1392, 1392, 1392, 1392, 1692, 1392, 1823, 1392, 1782, + /* 510 */ 1778, 1392, 1392, 1774, 1392, 1392, 1839, 1392, 1392, 1392, + /* 520 */ 1392, 1392, 1392, 1392, 1392, 1392, 1768, 1392, 1741, 1392, + /* 530 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1703, 1392, 1392, + /* 540 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 550 */ 1691, 1392, 1732, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 560 */ 1392, 1552, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 570 */ 1392, 1392, 1392, 1392, 1537, 1535, 1534, 1533, 1392, 1530, + /* 580 */ 1392, 1392, 1392, 1392, 1561, 1560, 1392, 1392, 1392, 1392, + /* 590 */ 1392, 1392, 1481, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 600 */ 1392, 1392, 1472, 1392, 1471, 1392, 1392, 1392, 1392, 1392, + /* 610 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 620 */ 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + /* 630 */ 1392, 1392, 1392, 1392, 1392, 1392, }; /********** End of lemon-generated parsing tables *****************************/ @@ -963,6 +972,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* SNODES => nothing */ 0, /* CLUSTER => nothing */ 0, /* TRANSACTIONS => nothing */ + 0, /* DISTRIBUTED => nothing */ 0, /* LIKE => nothing */ 0, /* INDEX => nothing */ 0, /* FULLTEXT => nothing */ @@ -1047,6 +1057,8 @@ static const YYCODETYPE yyFallback[] = { 0, /* LINEAR => nothing */ 0, /* NEXT => nothing */ 0, /* HAVING => nothing */ + 0, /* RANGE => nothing */ + 0, /* EVERY => nothing */ 0, /* ORDER => nothing */ 0, /* SLIMIT => nothing */ 0, /* SOFFSET => nothing */ @@ -1055,12 +1067,12 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ID => nothing */ - 232, /* NK_BITNOT => ID */ - 232, /* INSERT => ID */ - 232, /* VALUES => ID */ - 232, /* IMPORT => ID */ - 232, /* NK_SEMI => ID */ - 232, /* FILE => ID */ + 235, /* NK_BITNOT => ID */ + 235, /* INSERT => ID */ + 235, /* VALUES => ID */ + 235, /* IMPORT => ID */ + 235, /* NK_SEMI => ID */ + 235, /* FILE => ID */ }; #endif /* YYFALLBACK */ @@ -1289,224 +1301,229 @@ static const char *const yyTokenName[] = { /* 138 */ "SNODES", /* 139 */ "CLUSTER", /* 140 */ "TRANSACTIONS", - /* 141 */ "LIKE", - /* 142 */ "INDEX", - /* 143 */ "FULLTEXT", - /* 144 */ "FUNCTION", - /* 145 */ "INTERVAL", - /* 146 */ "TOPIC", - /* 147 */ "AS", - /* 148 */ "CONSUMER", - /* 149 */ "GROUP", - /* 150 */ "DESC", - /* 151 */ "DESCRIBE", - /* 152 */ "RESET", - /* 153 */ "QUERY", - /* 154 */ "CACHE", - /* 155 */ "EXPLAIN", - /* 156 */ "ANALYZE", - /* 157 */ "VERBOSE", - /* 158 */ "NK_BOOL", - /* 159 */ "RATIO", - /* 160 */ "NK_FLOAT", - /* 161 */ "COMPACT", - /* 162 */ "VNODES", - /* 163 */ "IN", - /* 164 */ "OUTPUTTYPE", - /* 165 */ "AGGREGATE", - /* 166 */ "BUFSIZE", - /* 167 */ "STREAM", - /* 168 */ "INTO", - /* 169 */ "TRIGGER", - /* 170 */ "AT_ONCE", - /* 171 */ "WINDOW_CLOSE", - /* 172 */ "KILL", - /* 173 */ "CONNECTION", - /* 174 */ "TRANSACTION", - /* 175 */ "BALANCE", - /* 176 */ "VGROUP", - /* 177 */ "MERGE", - /* 178 */ "REDISTRIBUTE", - /* 179 */ "SPLIT", - /* 180 */ "SYNCDB", - /* 181 */ "DELETE", - /* 182 */ "NULL", - /* 183 */ "NK_QUESTION", - /* 184 */ "NK_ARROW", - /* 185 */ "ROWTS", - /* 186 */ "TBNAME", - /* 187 */ "QSTARTTS", - /* 188 */ "QENDTS", - /* 189 */ "WSTARTTS", - /* 190 */ "WENDTS", - /* 191 */ "WDURATION", - /* 192 */ "CAST", - /* 193 */ "NOW", - /* 194 */ "TODAY", - /* 195 */ "TIMEZONE", - /* 196 */ "COUNT", - /* 197 */ "LAST_ROW", - /* 198 */ "BETWEEN", - /* 199 */ "IS", - /* 200 */ "NK_LT", - /* 201 */ "NK_GT", - /* 202 */ "NK_LE", - /* 203 */ "NK_GE", - /* 204 */ "NK_NE", - /* 205 */ "MATCH", - /* 206 */ "NMATCH", - /* 207 */ "CONTAINS", - /* 208 */ "JOIN", - /* 209 */ "INNER", - /* 210 */ "SELECT", - /* 211 */ "DISTINCT", - /* 212 */ "WHERE", - /* 213 */ "PARTITION", - /* 214 */ "BY", - /* 215 */ "SESSION", - /* 216 */ "STATE_WINDOW", - /* 217 */ "SLIDING", - /* 218 */ "FILL", - /* 219 */ "VALUE", - /* 220 */ "NONE", - /* 221 */ "PREV", - /* 222 */ "LINEAR", - /* 223 */ "NEXT", - /* 224 */ "HAVING", - /* 225 */ "ORDER", - /* 226 */ "SLIMIT", - /* 227 */ "SOFFSET", - /* 228 */ "LIMIT", - /* 229 */ "OFFSET", - /* 230 */ "ASC", - /* 231 */ "NULLS", - /* 232 */ "ID", - /* 233 */ "NK_BITNOT", - /* 234 */ "INSERT", - /* 235 */ "VALUES", - /* 236 */ "IMPORT", - /* 237 */ "NK_SEMI", - /* 238 */ "FILE", - /* 239 */ "cmd", - /* 240 */ "account_options", - /* 241 */ "alter_account_options", - /* 242 */ "literal", - /* 243 */ "alter_account_option", - /* 244 */ "user_name", - /* 245 */ "privileges", - /* 246 */ "priv_level", - /* 247 */ "priv_type_list", - /* 248 */ "priv_type", - /* 249 */ "db_name", - /* 250 */ "dnode_endpoint", - /* 251 */ "not_exists_opt", - /* 252 */ "db_options", - /* 253 */ "exists_opt", - /* 254 */ "alter_db_options", - /* 255 */ "integer_list", - /* 256 */ "variable_list", - /* 257 */ "retention_list", - /* 258 */ "alter_db_option", - /* 259 */ "retention", - /* 260 */ "full_table_name", - /* 261 */ "column_def_list", - /* 262 */ "tags_def_opt", - /* 263 */ "table_options", - /* 264 */ "multi_create_clause", - /* 265 */ "tags_def", - /* 266 */ "multi_drop_clause", - /* 267 */ "alter_table_clause", - /* 268 */ "alter_table_options", - /* 269 */ "column_name", - /* 270 */ "type_name", - /* 271 */ "signed_literal", - /* 272 */ "create_subtable_clause", - /* 273 */ "specific_tags_opt", - /* 274 */ "literal_list", - /* 275 */ "drop_table_clause", - /* 276 */ "col_name_list", - /* 277 */ "table_name", - /* 278 */ "column_def", - /* 279 */ "duration_list", - /* 280 */ "rollup_func_list", - /* 281 */ "alter_table_option", - /* 282 */ "duration_literal", - /* 283 */ "rollup_func_name", - /* 284 */ "function_name", - /* 285 */ "col_name", - /* 286 */ "db_name_cond_opt", - /* 287 */ "like_pattern_opt", - /* 288 */ "table_name_cond", - /* 289 */ "from_db_opt", - /* 290 */ "index_name", - /* 291 */ "index_options", - /* 292 */ "func_list", - /* 293 */ "sliding_opt", - /* 294 */ "func", - /* 295 */ "expression_list", - /* 296 */ "topic_name", - /* 297 */ "query_expression", - /* 298 */ "cgroup_name", - /* 299 */ "analyze_opt", - /* 300 */ "explain_options", - /* 301 */ "agg_func_opt", - /* 302 */ "bufsize_opt", - /* 303 */ "stream_name", - /* 304 */ "stream_options", - /* 305 */ "into_opt", - /* 306 */ "dnode_list", - /* 307 */ "where_clause_opt", - /* 308 */ "signed", - /* 309 */ "literal_func", - /* 310 */ "table_alias", - /* 311 */ "column_alias", - /* 312 */ "expression", - /* 313 */ "pseudo_column", - /* 314 */ "column_reference", - /* 315 */ "function_expression", - /* 316 */ "subquery", - /* 317 */ "star_func", - /* 318 */ "star_func_para_list", - /* 319 */ "noarg_func", - /* 320 */ "other_para_list", - /* 321 */ "star_func_para", - /* 322 */ "predicate", - /* 323 */ "compare_op", - /* 324 */ "in_op", - /* 325 */ "in_predicate_value", - /* 326 */ "boolean_value_expression", - /* 327 */ "boolean_primary", - /* 328 */ "common_expression", - /* 329 */ "from_clause", - /* 330 */ "table_reference_list", - /* 331 */ "table_reference", - /* 332 */ "table_primary", - /* 333 */ "joined_table", - /* 334 */ "alias_opt", - /* 335 */ "parenthesized_joined_table", - /* 336 */ "join_type", - /* 337 */ "search_condition", - /* 338 */ "query_specification", - /* 339 */ "set_quantifier_opt", - /* 340 */ "select_list", - /* 341 */ "partition_by_clause_opt", - /* 342 */ "twindow_clause_opt", - /* 343 */ "group_by_clause_opt", - /* 344 */ "having_clause_opt", - /* 345 */ "select_sublist", - /* 346 */ "select_item", + /* 141 */ "DISTRIBUTED", + /* 142 */ "LIKE", + /* 143 */ "INDEX", + /* 144 */ "FULLTEXT", + /* 145 */ "FUNCTION", + /* 146 */ "INTERVAL", + /* 147 */ "TOPIC", + /* 148 */ "AS", + /* 149 */ "CONSUMER", + /* 150 */ "GROUP", + /* 151 */ "DESC", + /* 152 */ "DESCRIBE", + /* 153 */ "RESET", + /* 154 */ "QUERY", + /* 155 */ "CACHE", + /* 156 */ "EXPLAIN", + /* 157 */ "ANALYZE", + /* 158 */ "VERBOSE", + /* 159 */ "NK_BOOL", + /* 160 */ "RATIO", + /* 161 */ "NK_FLOAT", + /* 162 */ "COMPACT", + /* 163 */ "VNODES", + /* 164 */ "IN", + /* 165 */ "OUTPUTTYPE", + /* 166 */ "AGGREGATE", + /* 167 */ "BUFSIZE", + /* 168 */ "STREAM", + /* 169 */ "INTO", + /* 170 */ "TRIGGER", + /* 171 */ "AT_ONCE", + /* 172 */ "WINDOW_CLOSE", + /* 173 */ "KILL", + /* 174 */ "CONNECTION", + /* 175 */ "TRANSACTION", + /* 176 */ "BALANCE", + /* 177 */ "VGROUP", + /* 178 */ "MERGE", + /* 179 */ "REDISTRIBUTE", + /* 180 */ "SPLIT", + /* 181 */ "SYNCDB", + /* 182 */ "DELETE", + /* 183 */ "NULL", + /* 184 */ "NK_QUESTION", + /* 185 */ "NK_ARROW", + /* 186 */ "ROWTS", + /* 187 */ "TBNAME", + /* 188 */ "QSTARTTS", + /* 189 */ "QENDTS", + /* 190 */ "WSTARTTS", + /* 191 */ "WENDTS", + /* 192 */ "WDURATION", + /* 193 */ "CAST", + /* 194 */ "NOW", + /* 195 */ "TODAY", + /* 196 */ "TIMEZONE", + /* 197 */ "COUNT", + /* 198 */ "LAST_ROW", + /* 199 */ "BETWEEN", + /* 200 */ "IS", + /* 201 */ "NK_LT", + /* 202 */ "NK_GT", + /* 203 */ "NK_LE", + /* 204 */ "NK_GE", + /* 205 */ "NK_NE", + /* 206 */ "MATCH", + /* 207 */ "NMATCH", + /* 208 */ "CONTAINS", + /* 209 */ "JOIN", + /* 210 */ "INNER", + /* 211 */ "SELECT", + /* 212 */ "DISTINCT", + /* 213 */ "WHERE", + /* 214 */ "PARTITION", + /* 215 */ "BY", + /* 216 */ "SESSION", + /* 217 */ "STATE_WINDOW", + /* 218 */ "SLIDING", + /* 219 */ "FILL", + /* 220 */ "VALUE", + /* 221 */ "NONE", + /* 222 */ "PREV", + /* 223 */ "LINEAR", + /* 224 */ "NEXT", + /* 225 */ "HAVING", + /* 226 */ "RANGE", + /* 227 */ "EVERY", + /* 228 */ "ORDER", + /* 229 */ "SLIMIT", + /* 230 */ "SOFFSET", + /* 231 */ "LIMIT", + /* 232 */ "OFFSET", + /* 233 */ "ASC", + /* 234 */ "NULLS", + /* 235 */ "ID", + /* 236 */ "NK_BITNOT", + /* 237 */ "INSERT", + /* 238 */ "VALUES", + /* 239 */ "IMPORT", + /* 240 */ "NK_SEMI", + /* 241 */ "FILE", + /* 242 */ "cmd", + /* 243 */ "account_options", + /* 244 */ "alter_account_options", + /* 245 */ "literal", + /* 246 */ "alter_account_option", + /* 247 */ "user_name", + /* 248 */ "privileges", + /* 249 */ "priv_level", + /* 250 */ "priv_type_list", + /* 251 */ "priv_type", + /* 252 */ "db_name", + /* 253 */ "dnode_endpoint", + /* 254 */ "not_exists_opt", + /* 255 */ "db_options", + /* 256 */ "exists_opt", + /* 257 */ "alter_db_options", + /* 258 */ "integer_list", + /* 259 */ "variable_list", + /* 260 */ "retention_list", + /* 261 */ "alter_db_option", + /* 262 */ "retention", + /* 263 */ "full_table_name", + /* 264 */ "column_def_list", + /* 265 */ "tags_def_opt", + /* 266 */ "table_options", + /* 267 */ "multi_create_clause", + /* 268 */ "tags_def", + /* 269 */ "multi_drop_clause", + /* 270 */ "alter_table_clause", + /* 271 */ "alter_table_options", + /* 272 */ "column_name", + /* 273 */ "type_name", + /* 274 */ "signed_literal", + /* 275 */ "create_subtable_clause", + /* 276 */ "specific_tags_opt", + /* 277 */ "literal_list", + /* 278 */ "drop_table_clause", + /* 279 */ "col_name_list", + /* 280 */ "table_name", + /* 281 */ "column_def", + /* 282 */ "duration_list", + /* 283 */ "rollup_func_list", + /* 284 */ "alter_table_option", + /* 285 */ "duration_literal", + /* 286 */ "rollup_func_name", + /* 287 */ "function_name", + /* 288 */ "col_name", + /* 289 */ "db_name_cond_opt", + /* 290 */ "like_pattern_opt", + /* 291 */ "table_name_cond", + /* 292 */ "from_db_opt", + /* 293 */ "index_name", + /* 294 */ "index_options", + /* 295 */ "func_list", + /* 296 */ "sliding_opt", + /* 297 */ "func", + /* 298 */ "expression_list", + /* 299 */ "topic_name", + /* 300 */ "query_expression", + /* 301 */ "cgroup_name", + /* 302 */ "analyze_opt", + /* 303 */ "explain_options", + /* 304 */ "agg_func_opt", + /* 305 */ "bufsize_opt", + /* 306 */ "stream_name", + /* 307 */ "stream_options", + /* 308 */ "into_opt", + /* 309 */ "dnode_list", + /* 310 */ "where_clause_opt", + /* 311 */ "signed", + /* 312 */ "literal_func", + /* 313 */ "table_alias", + /* 314 */ "column_alias", + /* 315 */ "expression", + /* 316 */ "pseudo_column", + /* 317 */ "column_reference", + /* 318 */ "function_expression", + /* 319 */ "subquery", + /* 320 */ "star_func", + /* 321 */ "star_func_para_list", + /* 322 */ "noarg_func", + /* 323 */ "other_para_list", + /* 324 */ "star_func_para", + /* 325 */ "predicate", + /* 326 */ "compare_op", + /* 327 */ "in_op", + /* 328 */ "in_predicate_value", + /* 329 */ "boolean_value_expression", + /* 330 */ "boolean_primary", + /* 331 */ "common_expression", + /* 332 */ "from_clause", + /* 333 */ "table_reference_list", + /* 334 */ "table_reference", + /* 335 */ "table_primary", + /* 336 */ "joined_table", + /* 337 */ "alias_opt", + /* 338 */ "parenthesized_joined_table", + /* 339 */ "join_type", + /* 340 */ "search_condition", + /* 341 */ "query_specification", + /* 342 */ "set_quantifier_opt", + /* 343 */ "select_list", + /* 344 */ "partition_by_clause_opt", + /* 345 */ "range_opt", + /* 346 */ "every_opt", /* 347 */ "fill_opt", - /* 348 */ "fill_mode", - /* 349 */ "group_by_list", - /* 350 */ "query_expression_body", - /* 351 */ "order_by_clause_opt", - /* 352 */ "slimit_clause_opt", - /* 353 */ "limit_clause_opt", - /* 354 */ "query_primary", - /* 355 */ "sort_specification_list", - /* 356 */ "sort_specification", - /* 357 */ "ordering_specification_opt", - /* 358 */ "null_ordering_opt", + /* 348 */ "twindow_clause_opt", + /* 349 */ "group_by_clause_opt", + /* 350 */ "having_clause_opt", + /* 351 */ "select_sublist", + /* 352 */ "select_item", + /* 353 */ "fill_mode", + /* 354 */ "group_by_list", + /* 355 */ "query_expression_body", + /* 356 */ "order_by_clause_opt", + /* 357 */ "slimit_clause_opt", + /* 358 */ "limit_clause_opt", + /* 359 */ "query_primary", + /* 360 */ "sort_specification_list", + /* 361 */ "sort_specification", + /* 362 */ "ordering_specification_opt", + /* 363 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1726,253 +1743,258 @@ static const char *const yyRuleName[] = { /* 209 */ "cmd ::= SHOW SNODES", /* 210 */ "cmd ::= SHOW CLUSTER", /* 211 */ "cmd ::= SHOW TRANSACTIONS", - /* 212 */ "db_name_cond_opt ::=", - /* 213 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 214 */ "like_pattern_opt ::=", - /* 215 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 216 */ "table_name_cond ::= table_name", - /* 217 */ "from_db_opt ::=", - /* 218 */ "from_db_opt ::= FROM db_name", - /* 219 */ "cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options", - /* 220 */ "cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP", - /* 221 */ "cmd ::= DROP INDEX exists_opt index_name ON table_name", - /* 222 */ "index_options ::=", - /* 223 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt", - /* 224 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt", - /* 225 */ "func_list ::= func", - /* 226 */ "func_list ::= func_list NK_COMMA func", - /* 227 */ "func ::= function_name NK_LP expression_list NK_RP", - /* 228 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression", - /* 229 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 230 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 231 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 232 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 233 */ "cmd ::= DESC full_table_name", - /* 234 */ "cmd ::= DESCRIBE full_table_name", - /* 235 */ "cmd ::= RESET QUERY CACHE", - /* 236 */ "cmd ::= EXPLAIN analyze_opt explain_options query_expression", - /* 237 */ "analyze_opt ::=", - /* 238 */ "analyze_opt ::= ANALYZE", - /* 239 */ "explain_options ::=", - /* 240 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 241 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 242 */ "cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP", - /* 243 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", - /* 244 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 245 */ "agg_func_opt ::=", - /* 246 */ "agg_func_opt ::= AGGREGATE", - /* 247 */ "bufsize_opt ::=", - /* 248 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 249 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression", - /* 250 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 251 */ "into_opt ::=", - /* 252 */ "into_opt ::= INTO full_table_name", - /* 253 */ "stream_options ::=", - /* 254 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 255 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 256 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 257 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 258 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 259 */ "cmd ::= KILL QUERY NK_STRING", - /* 260 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 261 */ "cmd ::= BALANCE VGROUP", - /* 262 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 263 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 264 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 265 */ "dnode_list ::= DNODE NK_INTEGER", - /* 266 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 267 */ "cmd ::= SYNCDB db_name REPLICA", - /* 268 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 269 */ "cmd ::= query_expression", - /* 270 */ "literal ::= NK_INTEGER", - /* 271 */ "literal ::= NK_FLOAT", - /* 272 */ "literal ::= NK_STRING", - /* 273 */ "literal ::= NK_BOOL", - /* 274 */ "literal ::= TIMESTAMP NK_STRING", - /* 275 */ "literal ::= duration_literal", - /* 276 */ "literal ::= NULL", - /* 277 */ "literal ::= NK_QUESTION", - /* 278 */ "duration_literal ::= NK_VARIABLE", - /* 279 */ "signed ::= NK_INTEGER", - /* 280 */ "signed ::= NK_PLUS NK_INTEGER", - /* 281 */ "signed ::= NK_MINUS NK_INTEGER", - /* 282 */ "signed ::= NK_FLOAT", - /* 283 */ "signed ::= NK_PLUS NK_FLOAT", - /* 284 */ "signed ::= NK_MINUS NK_FLOAT", - /* 285 */ "signed_literal ::= signed", - /* 286 */ "signed_literal ::= NK_STRING", - /* 287 */ "signed_literal ::= NK_BOOL", - /* 288 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 289 */ "signed_literal ::= duration_literal", - /* 290 */ "signed_literal ::= NULL", - /* 291 */ "signed_literal ::= literal_func", - /* 292 */ "literal_list ::= signed_literal", - /* 293 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 294 */ "db_name ::= NK_ID", - /* 295 */ "table_name ::= NK_ID", - /* 296 */ "column_name ::= NK_ID", - /* 297 */ "function_name ::= NK_ID", - /* 298 */ "table_alias ::= NK_ID", - /* 299 */ "column_alias ::= NK_ID", - /* 300 */ "user_name ::= NK_ID", - /* 301 */ "index_name ::= NK_ID", - /* 302 */ "topic_name ::= NK_ID", - /* 303 */ "stream_name ::= NK_ID", - /* 304 */ "cgroup_name ::= NK_ID", - /* 305 */ "expression ::= literal", - /* 306 */ "expression ::= pseudo_column", - /* 307 */ "expression ::= column_reference", - /* 308 */ "expression ::= function_expression", - /* 309 */ "expression ::= subquery", - /* 310 */ "expression ::= NK_LP expression NK_RP", - /* 311 */ "expression ::= NK_PLUS expression", - /* 312 */ "expression ::= NK_MINUS expression", - /* 313 */ "expression ::= expression NK_PLUS expression", - /* 314 */ "expression ::= expression NK_MINUS expression", - /* 315 */ "expression ::= expression NK_STAR expression", - /* 316 */ "expression ::= expression NK_SLASH expression", - /* 317 */ "expression ::= expression NK_REM expression", - /* 318 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 319 */ "expression_list ::= expression", - /* 320 */ "expression_list ::= expression_list NK_COMMA expression", - /* 321 */ "column_reference ::= column_name", - /* 322 */ "column_reference ::= table_name NK_DOT column_name", - /* 323 */ "pseudo_column ::= ROWTS", - /* 324 */ "pseudo_column ::= TBNAME", - /* 325 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 326 */ "pseudo_column ::= QSTARTTS", - /* 327 */ "pseudo_column ::= QENDTS", - /* 328 */ "pseudo_column ::= WSTARTTS", - /* 329 */ "pseudo_column ::= WENDTS", - /* 330 */ "pseudo_column ::= WDURATION", - /* 331 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 332 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 333 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP", - /* 334 */ "function_expression ::= literal_func", - /* 335 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 336 */ "literal_func ::= NOW", - /* 337 */ "noarg_func ::= NOW", - /* 338 */ "noarg_func ::= TODAY", - /* 339 */ "noarg_func ::= TIMEZONE", - /* 340 */ "star_func ::= COUNT", - /* 341 */ "star_func ::= FIRST", - /* 342 */ "star_func ::= LAST", - /* 343 */ "star_func ::= LAST_ROW", - /* 344 */ "star_func_para_list ::= NK_STAR", - /* 345 */ "star_func_para_list ::= other_para_list", - /* 346 */ "other_para_list ::= star_func_para", - /* 347 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 348 */ "star_func_para ::= expression", - /* 349 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 350 */ "predicate ::= expression compare_op expression", - /* 351 */ "predicate ::= expression BETWEEN expression AND expression", - /* 352 */ "predicate ::= expression NOT BETWEEN expression AND expression", - /* 353 */ "predicate ::= expression IS NULL", - /* 354 */ "predicate ::= expression IS NOT NULL", - /* 355 */ "predicate ::= expression in_op in_predicate_value", - /* 356 */ "compare_op ::= NK_LT", - /* 357 */ "compare_op ::= NK_GT", - /* 358 */ "compare_op ::= NK_LE", - /* 359 */ "compare_op ::= NK_GE", - /* 360 */ "compare_op ::= NK_NE", - /* 361 */ "compare_op ::= NK_EQ", - /* 362 */ "compare_op ::= LIKE", - /* 363 */ "compare_op ::= NOT LIKE", - /* 364 */ "compare_op ::= MATCH", - /* 365 */ "compare_op ::= NMATCH", - /* 366 */ "compare_op ::= CONTAINS", - /* 367 */ "in_op ::= IN", - /* 368 */ "in_op ::= NOT IN", - /* 369 */ "in_predicate_value ::= NK_LP expression_list NK_RP", - /* 370 */ "boolean_value_expression ::= boolean_primary", - /* 371 */ "boolean_value_expression ::= NOT boolean_primary", - /* 372 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 373 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 374 */ "boolean_primary ::= predicate", - /* 375 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 376 */ "common_expression ::= expression", - /* 377 */ "common_expression ::= boolean_value_expression", - /* 378 */ "from_clause ::= FROM table_reference_list", - /* 379 */ "table_reference_list ::= table_reference", - /* 380 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 381 */ "table_reference ::= table_primary", - /* 382 */ "table_reference ::= joined_table", - /* 383 */ "table_primary ::= table_name alias_opt", - /* 384 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 385 */ "table_primary ::= subquery alias_opt", - /* 386 */ "table_primary ::= parenthesized_joined_table", - /* 387 */ "alias_opt ::=", - /* 388 */ "alias_opt ::= table_alias", - /* 389 */ "alias_opt ::= AS table_alias", - /* 390 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 391 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 392 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 393 */ "join_type ::=", - /* 394 */ "join_type ::= INNER", - /* 395 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 396 */ "set_quantifier_opt ::=", - /* 397 */ "set_quantifier_opt ::= DISTINCT", - /* 398 */ "set_quantifier_opt ::= ALL", - /* 399 */ "select_list ::= NK_STAR", - /* 400 */ "select_list ::= select_sublist", - /* 401 */ "select_sublist ::= select_item", - /* 402 */ "select_sublist ::= select_sublist NK_COMMA select_item", - /* 403 */ "select_item ::= common_expression", - /* 404 */ "select_item ::= common_expression column_alias", - /* 405 */ "select_item ::= common_expression AS column_alias", - /* 406 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 407 */ "where_clause_opt ::=", - /* 408 */ "where_clause_opt ::= WHERE search_condition", - /* 409 */ "partition_by_clause_opt ::=", - /* 410 */ "partition_by_clause_opt ::= PARTITION BY expression_list", - /* 411 */ "twindow_clause_opt ::=", - /* 412 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 413 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", - /* 414 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 415 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 416 */ "sliding_opt ::=", - /* 417 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 418 */ "fill_opt ::=", - /* 419 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 420 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 421 */ "fill_mode ::= NONE", - /* 422 */ "fill_mode ::= PREV", - /* 423 */ "fill_mode ::= NULL", - /* 424 */ "fill_mode ::= LINEAR", - /* 425 */ "fill_mode ::= NEXT", - /* 426 */ "group_by_clause_opt ::=", - /* 427 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 428 */ "group_by_list ::= expression", - /* 429 */ "group_by_list ::= group_by_list NK_COMMA expression", - /* 430 */ "having_clause_opt ::=", - /* 431 */ "having_clause_opt ::= HAVING search_condition", - /* 432 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 433 */ "query_expression_body ::= query_primary", - /* 434 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", - /* 435 */ "query_expression_body ::= query_expression_body UNION query_expression_body", - /* 436 */ "query_primary ::= query_specification", - /* 437 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", - /* 438 */ "order_by_clause_opt ::=", - /* 439 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 440 */ "slimit_clause_opt ::=", - /* 441 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 442 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 443 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 444 */ "limit_clause_opt ::=", - /* 445 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 446 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 447 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 448 */ "subquery ::= NK_LP query_expression NK_RP", - /* 449 */ "search_condition ::= common_expression", - /* 450 */ "sort_specification_list ::= sort_specification", - /* 451 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 452 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", - /* 453 */ "ordering_specification_opt ::=", - /* 454 */ "ordering_specification_opt ::= ASC", - /* 455 */ "ordering_specification_opt ::= DESC", - /* 456 */ "null_ordering_opt ::=", - /* 457 */ "null_ordering_opt ::= NULLS FIRST", - /* 458 */ "null_ordering_opt ::= NULLS LAST", + /* 212 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 213 */ "db_name_cond_opt ::=", + /* 214 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 215 */ "like_pattern_opt ::=", + /* 216 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 217 */ "table_name_cond ::= table_name", + /* 218 */ "from_db_opt ::=", + /* 219 */ "from_db_opt ::= FROM db_name", + /* 220 */ "cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options", + /* 221 */ "cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP", + /* 222 */ "cmd ::= DROP INDEX exists_opt index_name ON table_name", + /* 223 */ "index_options ::=", + /* 224 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt", + /* 225 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt", + /* 226 */ "func_list ::= func", + /* 227 */ "func_list ::= func_list NK_COMMA func", + /* 228 */ "func ::= function_name NK_LP expression_list NK_RP", + /* 229 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression", + /* 230 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 231 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 232 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 233 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 234 */ "cmd ::= DESC full_table_name", + /* 235 */ "cmd ::= DESCRIBE full_table_name", + /* 236 */ "cmd ::= RESET QUERY CACHE", + /* 237 */ "cmd ::= EXPLAIN analyze_opt explain_options query_expression", + /* 238 */ "analyze_opt ::=", + /* 239 */ "analyze_opt ::= ANALYZE", + /* 240 */ "explain_options ::=", + /* 241 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 242 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 243 */ "cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP", + /* 244 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", + /* 245 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 246 */ "agg_func_opt ::=", + /* 247 */ "agg_func_opt ::= AGGREGATE", + /* 248 */ "bufsize_opt ::=", + /* 249 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 250 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression", + /* 251 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 252 */ "into_opt ::=", + /* 253 */ "into_opt ::= INTO full_table_name", + /* 254 */ "stream_options ::=", + /* 255 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 256 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 257 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 258 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 259 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 260 */ "cmd ::= KILL QUERY NK_STRING", + /* 261 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 262 */ "cmd ::= BALANCE VGROUP", + /* 263 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 264 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 265 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 266 */ "dnode_list ::= DNODE NK_INTEGER", + /* 267 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 268 */ "cmd ::= SYNCDB db_name REPLICA", + /* 269 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 270 */ "cmd ::= query_expression", + /* 271 */ "literal ::= NK_INTEGER", + /* 272 */ "literal ::= NK_FLOAT", + /* 273 */ "literal ::= NK_STRING", + /* 274 */ "literal ::= NK_BOOL", + /* 275 */ "literal ::= TIMESTAMP NK_STRING", + /* 276 */ "literal ::= duration_literal", + /* 277 */ "literal ::= NULL", + /* 278 */ "literal ::= NK_QUESTION", + /* 279 */ "duration_literal ::= NK_VARIABLE", + /* 280 */ "signed ::= NK_INTEGER", + /* 281 */ "signed ::= NK_PLUS NK_INTEGER", + /* 282 */ "signed ::= NK_MINUS NK_INTEGER", + /* 283 */ "signed ::= NK_FLOAT", + /* 284 */ "signed ::= NK_PLUS NK_FLOAT", + /* 285 */ "signed ::= NK_MINUS NK_FLOAT", + /* 286 */ "signed_literal ::= signed", + /* 287 */ "signed_literal ::= NK_STRING", + /* 288 */ "signed_literal ::= NK_BOOL", + /* 289 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 290 */ "signed_literal ::= duration_literal", + /* 291 */ "signed_literal ::= NULL", + /* 292 */ "signed_literal ::= literal_func", + /* 293 */ "literal_list ::= signed_literal", + /* 294 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 295 */ "db_name ::= NK_ID", + /* 296 */ "table_name ::= NK_ID", + /* 297 */ "column_name ::= NK_ID", + /* 298 */ "function_name ::= NK_ID", + /* 299 */ "table_alias ::= NK_ID", + /* 300 */ "column_alias ::= NK_ID", + /* 301 */ "user_name ::= NK_ID", + /* 302 */ "index_name ::= NK_ID", + /* 303 */ "topic_name ::= NK_ID", + /* 304 */ "stream_name ::= NK_ID", + /* 305 */ "cgroup_name ::= NK_ID", + /* 306 */ "expression ::= literal", + /* 307 */ "expression ::= pseudo_column", + /* 308 */ "expression ::= column_reference", + /* 309 */ "expression ::= function_expression", + /* 310 */ "expression ::= subquery", + /* 311 */ "expression ::= NK_LP expression NK_RP", + /* 312 */ "expression ::= NK_PLUS expression", + /* 313 */ "expression ::= NK_MINUS expression", + /* 314 */ "expression ::= expression NK_PLUS expression", + /* 315 */ "expression ::= expression NK_MINUS expression", + /* 316 */ "expression ::= expression NK_STAR expression", + /* 317 */ "expression ::= expression NK_SLASH expression", + /* 318 */ "expression ::= expression NK_REM expression", + /* 319 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 320 */ "expression_list ::= expression", + /* 321 */ "expression_list ::= expression_list NK_COMMA expression", + /* 322 */ "column_reference ::= column_name", + /* 323 */ "column_reference ::= table_name NK_DOT column_name", + /* 324 */ "pseudo_column ::= ROWTS", + /* 325 */ "pseudo_column ::= TBNAME", + /* 326 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 327 */ "pseudo_column ::= QSTARTTS", + /* 328 */ "pseudo_column ::= QENDTS", + /* 329 */ "pseudo_column ::= WSTARTTS", + /* 330 */ "pseudo_column ::= WENDTS", + /* 331 */ "pseudo_column ::= WDURATION", + /* 332 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 333 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 334 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP", + /* 335 */ "function_expression ::= literal_func", + /* 336 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 337 */ "literal_func ::= NOW", + /* 338 */ "noarg_func ::= NOW", + /* 339 */ "noarg_func ::= TODAY", + /* 340 */ "noarg_func ::= TIMEZONE", + /* 341 */ "star_func ::= COUNT", + /* 342 */ "star_func ::= FIRST", + /* 343 */ "star_func ::= LAST", + /* 344 */ "star_func ::= LAST_ROW", + /* 345 */ "star_func_para_list ::= NK_STAR", + /* 346 */ "star_func_para_list ::= other_para_list", + /* 347 */ "other_para_list ::= star_func_para", + /* 348 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 349 */ "star_func_para ::= expression", + /* 350 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 351 */ "predicate ::= expression compare_op expression", + /* 352 */ "predicate ::= expression BETWEEN expression AND expression", + /* 353 */ "predicate ::= expression NOT BETWEEN expression AND expression", + /* 354 */ "predicate ::= expression IS NULL", + /* 355 */ "predicate ::= expression IS NOT NULL", + /* 356 */ "predicate ::= expression in_op in_predicate_value", + /* 357 */ "compare_op ::= NK_LT", + /* 358 */ "compare_op ::= NK_GT", + /* 359 */ "compare_op ::= NK_LE", + /* 360 */ "compare_op ::= NK_GE", + /* 361 */ "compare_op ::= NK_NE", + /* 362 */ "compare_op ::= NK_EQ", + /* 363 */ "compare_op ::= LIKE", + /* 364 */ "compare_op ::= NOT LIKE", + /* 365 */ "compare_op ::= MATCH", + /* 366 */ "compare_op ::= NMATCH", + /* 367 */ "compare_op ::= CONTAINS", + /* 368 */ "in_op ::= IN", + /* 369 */ "in_op ::= NOT IN", + /* 370 */ "in_predicate_value ::= NK_LP expression_list NK_RP", + /* 371 */ "boolean_value_expression ::= boolean_primary", + /* 372 */ "boolean_value_expression ::= NOT boolean_primary", + /* 373 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 374 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 375 */ "boolean_primary ::= predicate", + /* 376 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 377 */ "common_expression ::= expression", + /* 378 */ "common_expression ::= boolean_value_expression", + /* 379 */ "from_clause ::= FROM table_reference_list", + /* 380 */ "table_reference_list ::= table_reference", + /* 381 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 382 */ "table_reference ::= table_primary", + /* 383 */ "table_reference ::= joined_table", + /* 384 */ "table_primary ::= table_name alias_opt", + /* 385 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 386 */ "table_primary ::= subquery alias_opt", + /* 387 */ "table_primary ::= parenthesized_joined_table", + /* 388 */ "alias_opt ::=", + /* 389 */ "alias_opt ::= table_alias", + /* 390 */ "alias_opt ::= AS table_alias", + /* 391 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 392 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 393 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 394 */ "join_type ::=", + /* 395 */ "join_type ::= INNER", + /* 396 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 397 */ "set_quantifier_opt ::=", + /* 398 */ "set_quantifier_opt ::= DISTINCT", + /* 399 */ "set_quantifier_opt ::= ALL", + /* 400 */ "select_list ::= NK_STAR", + /* 401 */ "select_list ::= select_sublist", + /* 402 */ "select_sublist ::= select_item", + /* 403 */ "select_sublist ::= select_sublist NK_COMMA select_item", + /* 404 */ "select_item ::= common_expression", + /* 405 */ "select_item ::= common_expression column_alias", + /* 406 */ "select_item ::= common_expression AS column_alias", + /* 407 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 408 */ "where_clause_opt ::=", + /* 409 */ "where_clause_opt ::= WHERE search_condition", + /* 410 */ "partition_by_clause_opt ::=", + /* 411 */ "partition_by_clause_opt ::= PARTITION BY expression_list", + /* 412 */ "twindow_clause_opt ::=", + /* 413 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 414 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", + /* 415 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 416 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 417 */ "sliding_opt ::=", + /* 418 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 419 */ "fill_opt ::=", + /* 420 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 421 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 422 */ "fill_mode ::= NONE", + /* 423 */ "fill_mode ::= PREV", + /* 424 */ "fill_mode ::= NULL", + /* 425 */ "fill_mode ::= LINEAR", + /* 426 */ "fill_mode ::= NEXT", + /* 427 */ "group_by_clause_opt ::=", + /* 428 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 429 */ "group_by_list ::= expression", + /* 430 */ "group_by_list ::= group_by_list NK_COMMA expression", + /* 431 */ "having_clause_opt ::=", + /* 432 */ "having_clause_opt ::= HAVING search_condition", + /* 433 */ "range_opt ::=", + /* 434 */ "range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP", + /* 435 */ "every_opt ::=", + /* 436 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 437 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 438 */ "query_expression_body ::= query_primary", + /* 439 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", + /* 440 */ "query_expression_body ::= query_expression_body UNION query_expression_body", + /* 441 */ "query_primary ::= query_specification", + /* 442 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", + /* 443 */ "order_by_clause_opt ::=", + /* 444 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 445 */ "slimit_clause_opt ::=", + /* 446 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 447 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 448 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 449 */ "limit_clause_opt ::=", + /* 450 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 451 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 452 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 453 */ "subquery ::= NK_LP query_expression NK_RP", + /* 454 */ "search_condition ::= common_expression", + /* 455 */ "sort_specification_list ::= sort_specification", + /* 456 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 457 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", + /* 458 */ "ordering_specification_opt ::=", + /* 459 */ "ordering_specification_opt ::= ASC", + /* 460 */ "ordering_specification_opt ::= DESC", + /* 461 */ "null_ordering_opt ::=", + /* 462 */ "null_ordering_opt ::= NULLS FIRST", + /* 463 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2099,174 +2121,176 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 239: /* cmd */ - case 242: /* literal */ - case 252: /* db_options */ - case 254: /* alter_db_options */ - case 259: /* retention */ - case 260: /* full_table_name */ - case 263: /* table_options */ - case 267: /* alter_table_clause */ - case 268: /* alter_table_options */ - case 271: /* signed_literal */ - case 272: /* create_subtable_clause */ - case 275: /* drop_table_clause */ - case 278: /* column_def */ - case 282: /* duration_literal */ - case 283: /* rollup_func_name */ - case 285: /* col_name */ - case 286: /* db_name_cond_opt */ - case 287: /* like_pattern_opt */ - case 288: /* table_name_cond */ - case 289: /* from_db_opt */ - case 291: /* index_options */ - case 293: /* sliding_opt */ - case 294: /* func */ - case 297: /* query_expression */ - case 300: /* explain_options */ - case 304: /* stream_options */ - case 305: /* into_opt */ - case 307: /* where_clause_opt */ - case 308: /* signed */ - case 309: /* literal_func */ - case 312: /* expression */ - case 313: /* pseudo_column */ - case 314: /* column_reference */ - case 315: /* function_expression */ - case 316: /* subquery */ - case 321: /* star_func_para */ - case 322: /* predicate */ - case 325: /* in_predicate_value */ - case 326: /* boolean_value_expression */ - case 327: /* boolean_primary */ - case 328: /* common_expression */ - case 329: /* from_clause */ - case 330: /* table_reference_list */ - case 331: /* table_reference */ - case 332: /* table_primary */ - case 333: /* joined_table */ - case 335: /* parenthesized_joined_table */ - case 337: /* search_condition */ - case 338: /* query_specification */ - case 342: /* twindow_clause_opt */ - case 344: /* having_clause_opt */ - case 346: /* select_item */ + case 242: /* cmd */ + case 245: /* literal */ + case 255: /* db_options */ + case 257: /* alter_db_options */ + case 262: /* retention */ + case 263: /* full_table_name */ + case 266: /* table_options */ + case 270: /* alter_table_clause */ + case 271: /* alter_table_options */ + case 274: /* signed_literal */ + case 275: /* create_subtable_clause */ + case 278: /* drop_table_clause */ + case 281: /* column_def */ + case 285: /* duration_literal */ + case 286: /* rollup_func_name */ + case 288: /* col_name */ + case 289: /* db_name_cond_opt */ + case 290: /* like_pattern_opt */ + case 291: /* table_name_cond */ + case 292: /* from_db_opt */ + case 294: /* index_options */ + case 296: /* sliding_opt */ + case 297: /* func */ + case 300: /* query_expression */ + case 303: /* explain_options */ + case 307: /* stream_options */ + case 308: /* into_opt */ + case 310: /* where_clause_opt */ + case 311: /* signed */ + case 312: /* literal_func */ + case 315: /* expression */ + case 316: /* pseudo_column */ + case 317: /* column_reference */ + case 318: /* function_expression */ + case 319: /* subquery */ + case 324: /* star_func_para */ + case 325: /* predicate */ + case 328: /* in_predicate_value */ + case 329: /* boolean_value_expression */ + case 330: /* boolean_primary */ + case 331: /* common_expression */ + case 332: /* from_clause */ + case 333: /* table_reference_list */ + case 334: /* table_reference */ + case 335: /* table_primary */ + case 336: /* joined_table */ + case 338: /* parenthesized_joined_table */ + case 340: /* search_condition */ + case 341: /* query_specification */ + case 345: /* range_opt */ + case 346: /* every_opt */ case 347: /* fill_opt */ - case 350: /* query_expression_body */ - case 352: /* slimit_clause_opt */ - case 353: /* limit_clause_opt */ - case 354: /* query_primary */ - case 356: /* sort_specification */ + case 348: /* twindow_clause_opt */ + case 350: /* having_clause_opt */ + case 352: /* select_item */ + case 355: /* query_expression_body */ + case 357: /* slimit_clause_opt */ + case 358: /* limit_clause_opt */ + case 359: /* query_primary */ + case 361: /* sort_specification */ { - nodesDestroyNode((yypminor->yy674)); + nodesDestroyNode((yypminor->yy392)); } break; - case 240: /* account_options */ - case 241: /* alter_account_options */ - case 243: /* alter_account_option */ - case 302: /* bufsize_opt */ + case 243: /* account_options */ + case 244: /* alter_account_options */ + case 246: /* alter_account_option */ + case 305: /* bufsize_opt */ { } break; - case 244: /* user_name */ - case 246: /* priv_level */ - case 249: /* db_name */ - case 250: /* dnode_endpoint */ - case 269: /* column_name */ - case 277: /* table_name */ - case 284: /* function_name */ - case 290: /* index_name */ - case 296: /* topic_name */ - case 298: /* cgroup_name */ - case 303: /* stream_name */ - case 310: /* table_alias */ - case 311: /* column_alias */ - case 317: /* star_func */ - case 319: /* noarg_func */ - case 334: /* alias_opt */ + case 247: /* user_name */ + case 249: /* priv_level */ + case 252: /* db_name */ + case 253: /* dnode_endpoint */ + case 272: /* column_name */ + case 280: /* table_name */ + case 287: /* function_name */ + case 293: /* index_name */ + case 299: /* topic_name */ + case 301: /* cgroup_name */ + case 306: /* stream_name */ + case 313: /* table_alias */ + case 314: /* column_alias */ + case 320: /* star_func */ + case 322: /* noarg_func */ + case 337: /* alias_opt */ { } break; - case 245: /* privileges */ - case 247: /* priv_type_list */ - case 248: /* priv_type */ + case 248: /* privileges */ + case 250: /* priv_type_list */ + case 251: /* priv_type */ { } break; - case 251: /* not_exists_opt */ - case 253: /* exists_opt */ - case 299: /* analyze_opt */ - case 301: /* agg_func_opt */ - case 339: /* set_quantifier_opt */ + case 254: /* not_exists_opt */ + case 256: /* exists_opt */ + case 302: /* analyze_opt */ + case 304: /* agg_func_opt */ + case 342: /* set_quantifier_opt */ { } break; - case 255: /* integer_list */ - case 256: /* variable_list */ - case 257: /* retention_list */ - case 261: /* column_def_list */ - case 262: /* tags_def_opt */ - case 264: /* multi_create_clause */ - case 265: /* tags_def */ - case 266: /* multi_drop_clause */ - case 273: /* specific_tags_opt */ - case 274: /* literal_list */ - case 276: /* col_name_list */ - case 279: /* duration_list */ - case 280: /* rollup_func_list */ - case 292: /* func_list */ - case 295: /* expression_list */ - case 306: /* dnode_list */ - case 318: /* star_func_para_list */ - case 320: /* other_para_list */ - case 340: /* select_list */ - case 341: /* partition_by_clause_opt */ - case 343: /* group_by_clause_opt */ - case 345: /* select_sublist */ - case 349: /* group_by_list */ - case 351: /* order_by_clause_opt */ - case 355: /* sort_specification_list */ + case 258: /* integer_list */ + case 259: /* variable_list */ + case 260: /* retention_list */ + case 264: /* column_def_list */ + case 265: /* tags_def_opt */ + case 267: /* multi_create_clause */ + case 268: /* tags_def */ + case 269: /* multi_drop_clause */ + case 276: /* specific_tags_opt */ + case 277: /* literal_list */ + case 279: /* col_name_list */ + case 282: /* duration_list */ + case 283: /* rollup_func_list */ + case 295: /* func_list */ + case 298: /* expression_list */ + case 309: /* dnode_list */ + case 321: /* star_func_para_list */ + case 323: /* other_para_list */ + case 343: /* select_list */ + case 344: /* partition_by_clause_opt */ + case 349: /* group_by_clause_opt */ + case 351: /* select_sublist */ + case 354: /* group_by_list */ + case 356: /* order_by_clause_opt */ + case 360: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy530)); + nodesDestroyList((yypminor->yy600)); } break; - case 258: /* alter_db_option */ - case 281: /* alter_table_option */ + case 261: /* alter_db_option */ + case 284: /* alter_table_option */ { } break; - case 270: /* type_name */ + case 273: /* type_name */ { } break; - case 323: /* compare_op */ - case 324: /* in_op */ + case 326: /* compare_op */ + case 327: /* in_op */ { } break; - case 336: /* join_type */ + case 339: /* join_type */ { } break; - case 348: /* fill_mode */ + case 353: /* fill_mode */ { } break; - case 357: /* ordering_specification_opt */ + case 362: /* ordering_specification_opt */ { } break; - case 358: /* null_ordering_opt */ + case 363: /* null_ordering_opt */ { } @@ -2565,465 +2589,470 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */ } yyRuleInfo[] = { - { 239, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - { 239, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - { 240, 0 }, /* (2) account_options ::= */ - { 240, -3 }, /* (3) account_options ::= account_options PPS literal */ - { 240, -3 }, /* (4) account_options ::= account_options TSERIES literal */ - { 240, -3 }, /* (5) account_options ::= account_options STORAGE literal */ - { 240, -3 }, /* (6) account_options ::= account_options STREAMS literal */ - { 240, -3 }, /* (7) account_options ::= account_options QTIME literal */ - { 240, -3 }, /* (8) account_options ::= account_options DBS literal */ - { 240, -3 }, /* (9) account_options ::= account_options USERS literal */ - { 240, -3 }, /* (10) account_options ::= account_options CONNS literal */ - { 240, -3 }, /* (11) account_options ::= account_options STATE literal */ - { 241, -1 }, /* (12) alter_account_options ::= alter_account_option */ - { 241, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - { 243, -2 }, /* (14) alter_account_option ::= PASS literal */ - { 243, -2 }, /* (15) alter_account_option ::= PPS literal */ - { 243, -2 }, /* (16) alter_account_option ::= TSERIES literal */ - { 243, -2 }, /* (17) alter_account_option ::= STORAGE literal */ - { 243, -2 }, /* (18) alter_account_option ::= STREAMS literal */ - { 243, -2 }, /* (19) alter_account_option ::= QTIME literal */ - { 243, -2 }, /* (20) alter_account_option ::= DBS literal */ - { 243, -2 }, /* (21) alter_account_option ::= USERS literal */ - { 243, -2 }, /* (22) alter_account_option ::= CONNS literal */ - { 243, -2 }, /* (23) alter_account_option ::= STATE literal */ - { 239, -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */ - { 239, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ - { 239, -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ - { 239, -3 }, /* (27) cmd ::= DROP USER user_name */ - { 239, -6 }, /* (28) cmd ::= GRANT privileges ON priv_level TO user_name */ - { 239, -6 }, /* (29) cmd ::= REVOKE privileges ON priv_level FROM user_name */ - { 245, -1 }, /* (30) privileges ::= ALL */ - { 245, -1 }, /* (31) privileges ::= priv_type_list */ - { 247, -1 }, /* (32) priv_type_list ::= priv_type */ - { 247, -3 }, /* (33) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - { 248, -1 }, /* (34) priv_type ::= READ */ - { 248, -1 }, /* (35) priv_type ::= WRITE */ - { 246, -3 }, /* (36) priv_level ::= NK_STAR NK_DOT NK_STAR */ - { 246, -3 }, /* (37) priv_level ::= db_name NK_DOT NK_STAR */ - { 239, -3 }, /* (38) cmd ::= CREATE DNODE dnode_endpoint */ - { 239, -5 }, /* (39) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - { 239, -3 }, /* (40) cmd ::= DROP DNODE NK_INTEGER */ - { 239, -3 }, /* (41) cmd ::= DROP DNODE dnode_endpoint */ - { 239, -4 }, /* (42) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - { 239, -5 }, /* (43) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - { 239, -4 }, /* (44) cmd ::= ALTER ALL DNODES NK_STRING */ - { 239, -5 }, /* (45) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - { 250, -1 }, /* (46) dnode_endpoint ::= NK_STRING */ - { 250, -1 }, /* (47) dnode_endpoint ::= NK_ID */ - { 250, -1 }, /* (48) dnode_endpoint ::= NK_IPTOKEN */ - { 239, -3 }, /* (49) cmd ::= ALTER LOCAL NK_STRING */ - { 239, -4 }, /* (50) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - { 239, -5 }, /* (51) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (52) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (53) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (54) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (55) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (56) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (57) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (58) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (59) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - { 239, -4 }, /* (60) cmd ::= DROP DATABASE exists_opt db_name */ - { 239, -2 }, /* (61) cmd ::= USE db_name */ - { 239, -4 }, /* (62) cmd ::= ALTER DATABASE db_name alter_db_options */ - { 251, -3 }, /* (63) not_exists_opt ::= IF NOT EXISTS */ - { 251, 0 }, /* (64) not_exists_opt ::= */ - { 253, -2 }, /* (65) exists_opt ::= IF EXISTS */ - { 253, 0 }, /* (66) exists_opt ::= */ - { 252, 0 }, /* (67) db_options ::= */ - { 252, -3 }, /* (68) db_options ::= db_options BUFFER NK_INTEGER */ - { 252, -3 }, /* (69) db_options ::= db_options CACHELAST NK_INTEGER */ - { 252, -3 }, /* (70) db_options ::= db_options COMP NK_INTEGER */ - { 252, -3 }, /* (71) db_options ::= db_options DURATION NK_INTEGER */ - { 252, -3 }, /* (72) db_options ::= db_options DURATION NK_VARIABLE */ - { 252, -3 }, /* (73) db_options ::= db_options FSYNC NK_INTEGER */ - { 252, -3 }, /* (74) db_options ::= db_options MAXROWS NK_INTEGER */ - { 252, -3 }, /* (75) db_options ::= db_options MINROWS NK_INTEGER */ - { 252, -3 }, /* (76) db_options ::= db_options KEEP integer_list */ - { 252, -3 }, /* (77) db_options ::= db_options KEEP variable_list */ - { 252, -3 }, /* (78) db_options ::= db_options PAGES NK_INTEGER */ - { 252, -3 }, /* (79) db_options ::= db_options PAGESIZE NK_INTEGER */ - { 252, -3 }, /* (80) db_options ::= db_options PRECISION NK_STRING */ - { 252, -3 }, /* (81) db_options ::= db_options REPLICA NK_INTEGER */ - { 252, -3 }, /* (82) db_options ::= db_options STRICT NK_INTEGER */ - { 252, -3 }, /* (83) db_options ::= db_options WAL NK_INTEGER */ - { 252, -3 }, /* (84) db_options ::= db_options VGROUPS NK_INTEGER */ - { 252, -3 }, /* (85) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 252, -3 }, /* (86) db_options ::= db_options RETENTIONS retention_list */ - { 252, -3 }, /* (87) db_options ::= db_options SCHEMALESS NK_INTEGER */ - { 254, -1 }, /* (88) alter_db_options ::= alter_db_option */ - { 254, -2 }, /* (89) alter_db_options ::= alter_db_options alter_db_option */ - { 258, -2 }, /* (90) alter_db_option ::= BUFFER NK_INTEGER */ - { 258, -2 }, /* (91) alter_db_option ::= CACHELAST NK_INTEGER */ - { 258, -2 }, /* (92) alter_db_option ::= FSYNC NK_INTEGER */ - { 258, -2 }, /* (93) alter_db_option ::= KEEP integer_list */ - { 258, -2 }, /* (94) alter_db_option ::= KEEP variable_list */ - { 258, -2 }, /* (95) alter_db_option ::= PAGES NK_INTEGER */ - { 258, -2 }, /* (96) alter_db_option ::= REPLICA NK_INTEGER */ - { 258, -2 }, /* (97) alter_db_option ::= STRICT NK_INTEGER */ - { 258, -2 }, /* (98) alter_db_option ::= WAL NK_INTEGER */ - { 255, -1 }, /* (99) integer_list ::= NK_INTEGER */ - { 255, -3 }, /* (100) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 256, -1 }, /* (101) variable_list ::= NK_VARIABLE */ - { 256, -3 }, /* (102) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 257, -1 }, /* (103) retention_list ::= retention */ - { 257, -3 }, /* (104) retention_list ::= retention_list NK_COMMA retention */ - { 259, -3 }, /* (105) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 239, -9 }, /* (106) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 239, -3 }, /* (107) cmd ::= CREATE TABLE multi_create_clause */ - { 239, -9 }, /* (108) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 239, -3 }, /* (109) cmd ::= DROP TABLE multi_drop_clause */ - { 239, -4 }, /* (110) cmd ::= DROP STABLE exists_opt full_table_name */ - { 239, -3 }, /* (111) cmd ::= ALTER TABLE alter_table_clause */ - { 239, -3 }, /* (112) cmd ::= ALTER STABLE alter_table_clause */ - { 267, -2 }, /* (113) alter_table_clause ::= full_table_name alter_table_options */ - { 267, -5 }, /* (114) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 267, -4 }, /* (115) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 267, -5 }, /* (116) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 267, -5 }, /* (117) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 267, -5 }, /* (118) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 267, -4 }, /* (119) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 267, -5 }, /* (120) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 267, -5 }, /* (121) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 267, -6 }, /* (122) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 264, -1 }, /* (123) multi_create_clause ::= create_subtable_clause */ - { 264, -2 }, /* (124) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 272, -10 }, /* (125) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */ - { 266, -1 }, /* (126) multi_drop_clause ::= drop_table_clause */ - { 266, -2 }, /* (127) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 275, -2 }, /* (128) drop_table_clause ::= exists_opt full_table_name */ - { 273, 0 }, /* (129) specific_tags_opt ::= */ - { 273, -3 }, /* (130) specific_tags_opt ::= NK_LP col_name_list NK_RP */ - { 260, -1 }, /* (131) full_table_name ::= table_name */ - { 260, -3 }, /* (132) full_table_name ::= db_name NK_DOT table_name */ - { 261, -1 }, /* (133) column_def_list ::= column_def */ - { 261, -3 }, /* (134) column_def_list ::= column_def_list NK_COMMA column_def */ - { 278, -2 }, /* (135) column_def ::= column_name type_name */ - { 278, -4 }, /* (136) column_def ::= column_name type_name COMMENT NK_STRING */ - { 270, -1 }, /* (137) type_name ::= BOOL */ - { 270, -1 }, /* (138) type_name ::= TINYINT */ - { 270, -1 }, /* (139) type_name ::= SMALLINT */ - { 270, -1 }, /* (140) type_name ::= INT */ - { 270, -1 }, /* (141) type_name ::= INTEGER */ - { 270, -1 }, /* (142) type_name ::= BIGINT */ - { 270, -1 }, /* (143) type_name ::= FLOAT */ - { 270, -1 }, /* (144) type_name ::= DOUBLE */ - { 270, -4 }, /* (145) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 270, -1 }, /* (146) type_name ::= TIMESTAMP */ - { 270, -4 }, /* (147) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 270, -2 }, /* (148) type_name ::= TINYINT UNSIGNED */ - { 270, -2 }, /* (149) type_name ::= SMALLINT UNSIGNED */ - { 270, -2 }, /* (150) type_name ::= INT UNSIGNED */ - { 270, -2 }, /* (151) type_name ::= BIGINT UNSIGNED */ - { 270, -1 }, /* (152) type_name ::= JSON */ - { 270, -4 }, /* (153) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 270, -1 }, /* (154) type_name ::= MEDIUMBLOB */ - { 270, -1 }, /* (155) type_name ::= BLOB */ - { 270, -4 }, /* (156) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 270, -1 }, /* (157) type_name ::= DECIMAL */ - { 270, -4 }, /* (158) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 270, -6 }, /* (159) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 262, 0 }, /* (160) tags_def_opt ::= */ - { 262, -1 }, /* (161) tags_def_opt ::= tags_def */ - { 265, -4 }, /* (162) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 263, 0 }, /* (163) table_options ::= */ - { 263, -3 }, /* (164) table_options ::= table_options COMMENT NK_STRING */ - { 263, -3 }, /* (165) table_options ::= table_options MAX_DELAY duration_list */ - { 263, -3 }, /* (166) table_options ::= table_options WATERMARK duration_list */ - { 263, -5 }, /* (167) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - { 263, -3 }, /* (168) table_options ::= table_options TTL NK_INTEGER */ - { 263, -5 }, /* (169) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 268, -1 }, /* (170) alter_table_options ::= alter_table_option */ - { 268, -2 }, /* (171) alter_table_options ::= alter_table_options alter_table_option */ - { 281, -2 }, /* (172) alter_table_option ::= COMMENT NK_STRING */ - { 281, -2 }, /* (173) alter_table_option ::= TTL NK_INTEGER */ - { 279, -1 }, /* (174) duration_list ::= duration_literal */ - { 279, -3 }, /* (175) duration_list ::= duration_list NK_COMMA duration_literal */ - { 280, -1 }, /* (176) rollup_func_list ::= rollup_func_name */ - { 280, -3 }, /* (177) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - { 283, -1 }, /* (178) rollup_func_name ::= function_name */ - { 283, -1 }, /* (179) rollup_func_name ::= FIRST */ - { 283, -1 }, /* (180) rollup_func_name ::= LAST */ - { 276, -1 }, /* (181) col_name_list ::= col_name */ - { 276, -3 }, /* (182) col_name_list ::= col_name_list NK_COMMA col_name */ - { 285, -1 }, /* (183) col_name ::= column_name */ - { 239, -2 }, /* (184) cmd ::= SHOW DNODES */ - { 239, -2 }, /* (185) cmd ::= SHOW USERS */ - { 239, -2 }, /* (186) cmd ::= SHOW DATABASES */ - { 239, -4 }, /* (187) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 239, -4 }, /* (188) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 239, -3 }, /* (189) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 239, -2 }, /* (190) cmd ::= SHOW MNODES */ - { 239, -2 }, /* (191) cmd ::= SHOW MODULES */ - { 239, -2 }, /* (192) cmd ::= SHOW QNODES */ - { 239, -2 }, /* (193) cmd ::= SHOW FUNCTIONS */ - { 239, -5 }, /* (194) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 239, -2 }, /* (195) cmd ::= SHOW STREAMS */ - { 239, -2 }, /* (196) cmd ::= SHOW ACCOUNTS */ - { 239, -2 }, /* (197) cmd ::= SHOW APPS */ - { 239, -2 }, /* (198) cmd ::= SHOW CONNECTIONS */ - { 239, -2 }, /* (199) cmd ::= SHOW LICENCE */ - { 239, -2 }, /* (200) cmd ::= SHOW GRANTS */ - { 239, -4 }, /* (201) cmd ::= SHOW CREATE DATABASE db_name */ - { 239, -4 }, /* (202) cmd ::= SHOW CREATE TABLE full_table_name */ - { 239, -4 }, /* (203) cmd ::= SHOW CREATE STABLE full_table_name */ - { 239, -2 }, /* (204) cmd ::= SHOW QUERIES */ - { 239, -2 }, /* (205) cmd ::= SHOW SCORES */ - { 239, -2 }, /* (206) cmd ::= SHOW TOPICS */ - { 239, -2 }, /* (207) cmd ::= SHOW VARIABLES */ - { 239, -2 }, /* (208) cmd ::= SHOW BNODES */ - { 239, -2 }, /* (209) cmd ::= SHOW SNODES */ - { 239, -2 }, /* (210) cmd ::= SHOW CLUSTER */ - { 239, -2 }, /* (211) cmd ::= SHOW TRANSACTIONS */ - { 286, 0 }, /* (212) db_name_cond_opt ::= */ - { 286, -2 }, /* (213) db_name_cond_opt ::= db_name NK_DOT */ - { 287, 0 }, /* (214) like_pattern_opt ::= */ - { 287, -2 }, /* (215) like_pattern_opt ::= LIKE NK_STRING */ - { 288, -1 }, /* (216) table_name_cond ::= table_name */ - { 289, 0 }, /* (217) from_db_opt ::= */ - { 289, -2 }, /* (218) from_db_opt ::= FROM db_name */ - { 239, -8 }, /* (219) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */ - { 239, -10 }, /* (220) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */ - { 239, -6 }, /* (221) cmd ::= DROP INDEX exists_opt index_name ON table_name */ - { 291, 0 }, /* (222) index_options ::= */ - { 291, -9 }, /* (223) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ - { 291, -11 }, /* (224) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ - { 292, -1 }, /* (225) func_list ::= func */ - { 292, -3 }, /* (226) func_list ::= func_list NK_COMMA func */ - { 294, -4 }, /* (227) func ::= function_name NK_LP expression_list NK_RP */ - { 239, -6 }, /* (228) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ - { 239, -7 }, /* (229) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 239, -7 }, /* (230) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 239, -4 }, /* (231) cmd ::= DROP TOPIC exists_opt topic_name */ - { 239, -7 }, /* (232) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 239, -2 }, /* (233) cmd ::= DESC full_table_name */ - { 239, -2 }, /* (234) cmd ::= DESCRIBE full_table_name */ - { 239, -3 }, /* (235) cmd ::= RESET QUERY CACHE */ - { 239, -4 }, /* (236) cmd ::= EXPLAIN analyze_opt explain_options query_expression */ - { 299, 0 }, /* (237) analyze_opt ::= */ - { 299, -1 }, /* (238) analyze_opt ::= ANALYZE */ - { 300, 0 }, /* (239) explain_options ::= */ - { 300, -3 }, /* (240) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 300, -3 }, /* (241) explain_options ::= explain_options RATIO NK_FLOAT */ - { 239, -6 }, /* (242) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */ - { 239, -10 }, /* (243) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 239, -4 }, /* (244) cmd ::= DROP FUNCTION exists_opt function_name */ - { 301, 0 }, /* (245) agg_func_opt ::= */ - { 301, -1 }, /* (246) agg_func_opt ::= AGGREGATE */ - { 302, 0 }, /* (247) bufsize_opt ::= */ - { 302, -2 }, /* (248) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 239, -8 }, /* (249) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ - { 239, -4 }, /* (250) cmd ::= DROP STREAM exists_opt stream_name */ - { 305, 0 }, /* (251) into_opt ::= */ - { 305, -2 }, /* (252) into_opt ::= INTO full_table_name */ - { 304, 0 }, /* (253) stream_options ::= */ - { 304, -3 }, /* (254) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 304, -3 }, /* (255) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 304, -4 }, /* (256) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 304, -3 }, /* (257) stream_options ::= stream_options WATERMARK duration_literal */ - { 239, -3 }, /* (258) cmd ::= KILL CONNECTION NK_INTEGER */ - { 239, -3 }, /* (259) cmd ::= KILL QUERY NK_STRING */ - { 239, -3 }, /* (260) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 239, -2 }, /* (261) cmd ::= BALANCE VGROUP */ - { 239, -4 }, /* (262) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 239, -4 }, /* (263) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 239, -3 }, /* (264) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 306, -2 }, /* (265) dnode_list ::= DNODE NK_INTEGER */ - { 306, -3 }, /* (266) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 239, -3 }, /* (267) cmd ::= SYNCDB db_name REPLICA */ - { 239, -4 }, /* (268) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 239, -1 }, /* (269) cmd ::= query_expression */ - { 242, -1 }, /* (270) literal ::= NK_INTEGER */ - { 242, -1 }, /* (271) literal ::= NK_FLOAT */ - { 242, -1 }, /* (272) literal ::= NK_STRING */ - { 242, -1 }, /* (273) literal ::= NK_BOOL */ - { 242, -2 }, /* (274) literal ::= TIMESTAMP NK_STRING */ - { 242, -1 }, /* (275) literal ::= duration_literal */ - { 242, -1 }, /* (276) literal ::= NULL */ - { 242, -1 }, /* (277) literal ::= NK_QUESTION */ - { 282, -1 }, /* (278) duration_literal ::= NK_VARIABLE */ - { 308, -1 }, /* (279) signed ::= NK_INTEGER */ - { 308, -2 }, /* (280) signed ::= NK_PLUS NK_INTEGER */ - { 308, -2 }, /* (281) signed ::= NK_MINUS NK_INTEGER */ - { 308, -1 }, /* (282) signed ::= NK_FLOAT */ - { 308, -2 }, /* (283) signed ::= NK_PLUS NK_FLOAT */ - { 308, -2 }, /* (284) signed ::= NK_MINUS NK_FLOAT */ - { 271, -1 }, /* (285) signed_literal ::= signed */ - { 271, -1 }, /* (286) signed_literal ::= NK_STRING */ - { 271, -1 }, /* (287) signed_literal ::= NK_BOOL */ - { 271, -2 }, /* (288) signed_literal ::= TIMESTAMP NK_STRING */ - { 271, -1 }, /* (289) signed_literal ::= duration_literal */ - { 271, -1 }, /* (290) signed_literal ::= NULL */ - { 271, -1 }, /* (291) signed_literal ::= literal_func */ - { 274, -1 }, /* (292) literal_list ::= signed_literal */ - { 274, -3 }, /* (293) literal_list ::= literal_list NK_COMMA signed_literal */ - { 249, -1 }, /* (294) db_name ::= NK_ID */ - { 277, -1 }, /* (295) table_name ::= NK_ID */ - { 269, -1 }, /* (296) column_name ::= NK_ID */ - { 284, -1 }, /* (297) function_name ::= NK_ID */ - { 310, -1 }, /* (298) table_alias ::= NK_ID */ - { 311, -1 }, /* (299) column_alias ::= NK_ID */ - { 244, -1 }, /* (300) user_name ::= NK_ID */ - { 290, -1 }, /* (301) index_name ::= NK_ID */ - { 296, -1 }, /* (302) topic_name ::= NK_ID */ - { 303, -1 }, /* (303) stream_name ::= NK_ID */ - { 298, -1 }, /* (304) cgroup_name ::= NK_ID */ - { 312, -1 }, /* (305) expression ::= literal */ - { 312, -1 }, /* (306) expression ::= pseudo_column */ - { 312, -1 }, /* (307) expression ::= column_reference */ - { 312, -1 }, /* (308) expression ::= function_expression */ - { 312, -1 }, /* (309) expression ::= subquery */ - { 312, -3 }, /* (310) expression ::= NK_LP expression NK_RP */ - { 312, -2 }, /* (311) expression ::= NK_PLUS expression */ - { 312, -2 }, /* (312) expression ::= NK_MINUS expression */ - { 312, -3 }, /* (313) expression ::= expression NK_PLUS expression */ - { 312, -3 }, /* (314) expression ::= expression NK_MINUS expression */ - { 312, -3 }, /* (315) expression ::= expression NK_STAR expression */ - { 312, -3 }, /* (316) expression ::= expression NK_SLASH expression */ - { 312, -3 }, /* (317) expression ::= expression NK_REM expression */ - { 312, -3 }, /* (318) expression ::= column_reference NK_ARROW NK_STRING */ - { 295, -1 }, /* (319) expression_list ::= expression */ - { 295, -3 }, /* (320) expression_list ::= expression_list NK_COMMA expression */ - { 314, -1 }, /* (321) column_reference ::= column_name */ - { 314, -3 }, /* (322) column_reference ::= table_name NK_DOT column_name */ - { 313, -1 }, /* (323) pseudo_column ::= ROWTS */ - { 313, -1 }, /* (324) pseudo_column ::= TBNAME */ - { 313, -3 }, /* (325) pseudo_column ::= table_name NK_DOT TBNAME */ - { 313, -1 }, /* (326) pseudo_column ::= QSTARTTS */ - { 313, -1 }, /* (327) pseudo_column ::= QENDTS */ - { 313, -1 }, /* (328) pseudo_column ::= WSTARTTS */ - { 313, -1 }, /* (329) pseudo_column ::= WENDTS */ - { 313, -1 }, /* (330) pseudo_column ::= WDURATION */ - { 315, -4 }, /* (331) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 315, -4 }, /* (332) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 315, -6 }, /* (333) function_expression ::= CAST NK_LP expression AS type_name NK_RP */ - { 315, -1 }, /* (334) function_expression ::= literal_func */ - { 309, -3 }, /* (335) literal_func ::= noarg_func NK_LP NK_RP */ - { 309, -1 }, /* (336) literal_func ::= NOW */ - { 319, -1 }, /* (337) noarg_func ::= NOW */ - { 319, -1 }, /* (338) noarg_func ::= TODAY */ - { 319, -1 }, /* (339) noarg_func ::= TIMEZONE */ - { 317, -1 }, /* (340) star_func ::= COUNT */ - { 317, -1 }, /* (341) star_func ::= FIRST */ - { 317, -1 }, /* (342) star_func ::= LAST */ - { 317, -1 }, /* (343) star_func ::= LAST_ROW */ - { 318, -1 }, /* (344) star_func_para_list ::= NK_STAR */ - { 318, -1 }, /* (345) star_func_para_list ::= other_para_list */ - { 320, -1 }, /* (346) other_para_list ::= star_func_para */ - { 320, -3 }, /* (347) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 321, -1 }, /* (348) star_func_para ::= expression */ - { 321, -3 }, /* (349) star_func_para ::= table_name NK_DOT NK_STAR */ - { 322, -3 }, /* (350) predicate ::= expression compare_op expression */ - { 322, -5 }, /* (351) predicate ::= expression BETWEEN expression AND expression */ - { 322, -6 }, /* (352) predicate ::= expression NOT BETWEEN expression AND expression */ - { 322, -3 }, /* (353) predicate ::= expression IS NULL */ - { 322, -4 }, /* (354) predicate ::= expression IS NOT NULL */ - { 322, -3 }, /* (355) predicate ::= expression in_op in_predicate_value */ - { 323, -1 }, /* (356) compare_op ::= NK_LT */ - { 323, -1 }, /* (357) compare_op ::= NK_GT */ - { 323, -1 }, /* (358) compare_op ::= NK_LE */ - { 323, -1 }, /* (359) compare_op ::= NK_GE */ - { 323, -1 }, /* (360) compare_op ::= NK_NE */ - { 323, -1 }, /* (361) compare_op ::= NK_EQ */ - { 323, -1 }, /* (362) compare_op ::= LIKE */ - { 323, -2 }, /* (363) compare_op ::= NOT LIKE */ - { 323, -1 }, /* (364) compare_op ::= MATCH */ - { 323, -1 }, /* (365) compare_op ::= NMATCH */ - { 323, -1 }, /* (366) compare_op ::= CONTAINS */ - { 324, -1 }, /* (367) in_op ::= IN */ - { 324, -2 }, /* (368) in_op ::= NOT IN */ - { 325, -3 }, /* (369) in_predicate_value ::= NK_LP expression_list NK_RP */ - { 326, -1 }, /* (370) boolean_value_expression ::= boolean_primary */ - { 326, -2 }, /* (371) boolean_value_expression ::= NOT boolean_primary */ - { 326, -3 }, /* (372) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 326, -3 }, /* (373) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 327, -1 }, /* (374) boolean_primary ::= predicate */ - { 327, -3 }, /* (375) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 328, -1 }, /* (376) common_expression ::= expression */ - { 328, -1 }, /* (377) common_expression ::= boolean_value_expression */ - { 329, -2 }, /* (378) from_clause ::= FROM table_reference_list */ - { 330, -1 }, /* (379) table_reference_list ::= table_reference */ - { 330, -3 }, /* (380) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 331, -1 }, /* (381) table_reference ::= table_primary */ - { 331, -1 }, /* (382) table_reference ::= joined_table */ - { 332, -2 }, /* (383) table_primary ::= table_name alias_opt */ - { 332, -4 }, /* (384) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 332, -2 }, /* (385) table_primary ::= subquery alias_opt */ - { 332, -1 }, /* (386) table_primary ::= parenthesized_joined_table */ - { 334, 0 }, /* (387) alias_opt ::= */ - { 334, -1 }, /* (388) alias_opt ::= table_alias */ - { 334, -2 }, /* (389) alias_opt ::= AS table_alias */ - { 335, -3 }, /* (390) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 335, -3 }, /* (391) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 333, -6 }, /* (392) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 336, 0 }, /* (393) join_type ::= */ - { 336, -1 }, /* (394) join_type ::= INNER */ - { 338, -9 }, /* (395) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - { 339, 0 }, /* (396) set_quantifier_opt ::= */ - { 339, -1 }, /* (397) set_quantifier_opt ::= DISTINCT */ - { 339, -1 }, /* (398) set_quantifier_opt ::= ALL */ - { 340, -1 }, /* (399) select_list ::= NK_STAR */ - { 340, -1 }, /* (400) select_list ::= select_sublist */ - { 345, -1 }, /* (401) select_sublist ::= select_item */ - { 345, -3 }, /* (402) select_sublist ::= select_sublist NK_COMMA select_item */ - { 346, -1 }, /* (403) select_item ::= common_expression */ - { 346, -2 }, /* (404) select_item ::= common_expression column_alias */ - { 346, -3 }, /* (405) select_item ::= common_expression AS column_alias */ - { 346, -3 }, /* (406) select_item ::= table_name NK_DOT NK_STAR */ - { 307, 0 }, /* (407) where_clause_opt ::= */ - { 307, -2 }, /* (408) where_clause_opt ::= WHERE search_condition */ - { 341, 0 }, /* (409) partition_by_clause_opt ::= */ - { 341, -3 }, /* (410) partition_by_clause_opt ::= PARTITION BY expression_list */ - { 342, 0 }, /* (411) twindow_clause_opt ::= */ - { 342, -6 }, /* (412) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 342, -4 }, /* (413) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ - { 342, -6 }, /* (414) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 342, -8 }, /* (415) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 293, 0 }, /* (416) sliding_opt ::= */ - { 293, -4 }, /* (417) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 347, 0 }, /* (418) fill_opt ::= */ - { 347, -4 }, /* (419) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 347, -6 }, /* (420) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 348, -1 }, /* (421) fill_mode ::= NONE */ - { 348, -1 }, /* (422) fill_mode ::= PREV */ - { 348, -1 }, /* (423) fill_mode ::= NULL */ - { 348, -1 }, /* (424) fill_mode ::= LINEAR */ - { 348, -1 }, /* (425) fill_mode ::= NEXT */ - { 343, 0 }, /* (426) group_by_clause_opt ::= */ - { 343, -3 }, /* (427) group_by_clause_opt ::= GROUP BY group_by_list */ - { 349, -1 }, /* (428) group_by_list ::= expression */ - { 349, -3 }, /* (429) group_by_list ::= group_by_list NK_COMMA expression */ - { 344, 0 }, /* (430) having_clause_opt ::= */ - { 344, -2 }, /* (431) having_clause_opt ::= HAVING search_condition */ - { 297, -4 }, /* (432) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 350, -1 }, /* (433) query_expression_body ::= query_primary */ - { 350, -4 }, /* (434) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ - { 350, -3 }, /* (435) query_expression_body ::= query_expression_body UNION query_expression_body */ - { 354, -1 }, /* (436) query_primary ::= query_specification */ - { 354, -6 }, /* (437) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ - { 351, 0 }, /* (438) order_by_clause_opt ::= */ - { 351, -3 }, /* (439) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 352, 0 }, /* (440) slimit_clause_opt ::= */ - { 352, -2 }, /* (441) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 352, -4 }, /* (442) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 352, -4 }, /* (443) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 353, 0 }, /* (444) limit_clause_opt ::= */ - { 353, -2 }, /* (445) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 353, -4 }, /* (446) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 353, -4 }, /* (447) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 316, -3 }, /* (448) subquery ::= NK_LP query_expression NK_RP */ - { 337, -1 }, /* (449) search_condition ::= common_expression */ - { 355, -1 }, /* (450) sort_specification_list ::= sort_specification */ - { 355, -3 }, /* (451) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 356, -3 }, /* (452) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ - { 357, 0 }, /* (453) ordering_specification_opt ::= */ - { 357, -1 }, /* (454) ordering_specification_opt ::= ASC */ - { 357, -1 }, /* (455) ordering_specification_opt ::= DESC */ - { 358, 0 }, /* (456) null_ordering_opt ::= */ - { 358, -2 }, /* (457) null_ordering_opt ::= NULLS FIRST */ - { 358, -2 }, /* (458) null_ordering_opt ::= NULLS LAST */ + { 242, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + { 242, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + { 243, 0 }, /* (2) account_options ::= */ + { 243, -3 }, /* (3) account_options ::= account_options PPS literal */ + { 243, -3 }, /* (4) account_options ::= account_options TSERIES literal */ + { 243, -3 }, /* (5) account_options ::= account_options STORAGE literal */ + { 243, -3 }, /* (6) account_options ::= account_options STREAMS literal */ + { 243, -3 }, /* (7) account_options ::= account_options QTIME literal */ + { 243, -3 }, /* (8) account_options ::= account_options DBS literal */ + { 243, -3 }, /* (9) account_options ::= account_options USERS literal */ + { 243, -3 }, /* (10) account_options ::= account_options CONNS literal */ + { 243, -3 }, /* (11) account_options ::= account_options STATE literal */ + { 244, -1 }, /* (12) alter_account_options ::= alter_account_option */ + { 244, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + { 246, -2 }, /* (14) alter_account_option ::= PASS literal */ + { 246, -2 }, /* (15) alter_account_option ::= PPS literal */ + { 246, -2 }, /* (16) alter_account_option ::= TSERIES literal */ + { 246, -2 }, /* (17) alter_account_option ::= STORAGE literal */ + { 246, -2 }, /* (18) alter_account_option ::= STREAMS literal */ + { 246, -2 }, /* (19) alter_account_option ::= QTIME literal */ + { 246, -2 }, /* (20) alter_account_option ::= DBS literal */ + { 246, -2 }, /* (21) alter_account_option ::= USERS literal */ + { 246, -2 }, /* (22) alter_account_option ::= CONNS literal */ + { 246, -2 }, /* (23) alter_account_option ::= STATE literal */ + { 242, -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */ + { 242, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ + { 242, -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ + { 242, -3 }, /* (27) cmd ::= DROP USER user_name */ + { 242, -6 }, /* (28) cmd ::= GRANT privileges ON priv_level TO user_name */ + { 242, -6 }, /* (29) cmd ::= REVOKE privileges ON priv_level FROM user_name */ + { 248, -1 }, /* (30) privileges ::= ALL */ + { 248, -1 }, /* (31) privileges ::= priv_type_list */ + { 250, -1 }, /* (32) priv_type_list ::= priv_type */ + { 250, -3 }, /* (33) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + { 251, -1 }, /* (34) priv_type ::= READ */ + { 251, -1 }, /* (35) priv_type ::= WRITE */ + { 249, -3 }, /* (36) priv_level ::= NK_STAR NK_DOT NK_STAR */ + { 249, -3 }, /* (37) priv_level ::= db_name NK_DOT NK_STAR */ + { 242, -3 }, /* (38) cmd ::= CREATE DNODE dnode_endpoint */ + { 242, -5 }, /* (39) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + { 242, -3 }, /* (40) cmd ::= DROP DNODE NK_INTEGER */ + { 242, -3 }, /* (41) cmd ::= DROP DNODE dnode_endpoint */ + { 242, -4 }, /* (42) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + { 242, -5 }, /* (43) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + { 242, -4 }, /* (44) cmd ::= ALTER ALL DNODES NK_STRING */ + { 242, -5 }, /* (45) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + { 253, -1 }, /* (46) dnode_endpoint ::= NK_STRING */ + { 253, -1 }, /* (47) dnode_endpoint ::= NK_ID */ + { 253, -1 }, /* (48) dnode_endpoint ::= NK_IPTOKEN */ + { 242, -3 }, /* (49) cmd ::= ALTER LOCAL NK_STRING */ + { 242, -4 }, /* (50) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + { 242, -5 }, /* (51) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + { 242, -5 }, /* (52) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + { 242, -5 }, /* (53) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + { 242, -5 }, /* (54) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + { 242, -5 }, /* (55) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + { 242, -5 }, /* (56) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + { 242, -5 }, /* (57) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + { 242, -5 }, /* (58) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + { 242, -5 }, /* (59) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { 242, -4 }, /* (60) cmd ::= DROP DATABASE exists_opt db_name */ + { 242, -2 }, /* (61) cmd ::= USE db_name */ + { 242, -4 }, /* (62) cmd ::= ALTER DATABASE db_name alter_db_options */ + { 254, -3 }, /* (63) not_exists_opt ::= IF NOT EXISTS */ + { 254, 0 }, /* (64) not_exists_opt ::= */ + { 256, -2 }, /* (65) exists_opt ::= IF EXISTS */ + { 256, 0 }, /* (66) exists_opt ::= */ + { 255, 0 }, /* (67) db_options ::= */ + { 255, -3 }, /* (68) db_options ::= db_options BUFFER NK_INTEGER */ + { 255, -3 }, /* (69) db_options ::= db_options CACHELAST NK_INTEGER */ + { 255, -3 }, /* (70) db_options ::= db_options COMP NK_INTEGER */ + { 255, -3 }, /* (71) db_options ::= db_options DURATION NK_INTEGER */ + { 255, -3 }, /* (72) db_options ::= db_options DURATION NK_VARIABLE */ + { 255, -3 }, /* (73) db_options ::= db_options FSYNC NK_INTEGER */ + { 255, -3 }, /* (74) db_options ::= db_options MAXROWS NK_INTEGER */ + { 255, -3 }, /* (75) db_options ::= db_options MINROWS NK_INTEGER */ + { 255, -3 }, /* (76) db_options ::= db_options KEEP integer_list */ + { 255, -3 }, /* (77) db_options ::= db_options KEEP variable_list */ + { 255, -3 }, /* (78) db_options ::= db_options PAGES NK_INTEGER */ + { 255, -3 }, /* (79) db_options ::= db_options PAGESIZE NK_INTEGER */ + { 255, -3 }, /* (80) db_options ::= db_options PRECISION NK_STRING */ + { 255, -3 }, /* (81) db_options ::= db_options REPLICA NK_INTEGER */ + { 255, -3 }, /* (82) db_options ::= db_options STRICT NK_INTEGER */ + { 255, -3 }, /* (83) db_options ::= db_options WAL NK_INTEGER */ + { 255, -3 }, /* (84) db_options ::= db_options VGROUPS NK_INTEGER */ + { 255, -3 }, /* (85) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 255, -3 }, /* (86) db_options ::= db_options RETENTIONS retention_list */ + { 255, -3 }, /* (87) db_options ::= db_options SCHEMALESS NK_INTEGER */ + { 257, -1 }, /* (88) alter_db_options ::= alter_db_option */ + { 257, -2 }, /* (89) alter_db_options ::= alter_db_options alter_db_option */ + { 261, -2 }, /* (90) alter_db_option ::= BUFFER NK_INTEGER */ + { 261, -2 }, /* (91) alter_db_option ::= CACHELAST NK_INTEGER */ + { 261, -2 }, /* (92) alter_db_option ::= FSYNC NK_INTEGER */ + { 261, -2 }, /* (93) alter_db_option ::= KEEP integer_list */ + { 261, -2 }, /* (94) alter_db_option ::= KEEP variable_list */ + { 261, -2 }, /* (95) alter_db_option ::= PAGES NK_INTEGER */ + { 261, -2 }, /* (96) alter_db_option ::= REPLICA NK_INTEGER */ + { 261, -2 }, /* (97) alter_db_option ::= STRICT NK_INTEGER */ + { 261, -2 }, /* (98) alter_db_option ::= WAL NK_INTEGER */ + { 258, -1 }, /* (99) integer_list ::= NK_INTEGER */ + { 258, -3 }, /* (100) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + { 259, -1 }, /* (101) variable_list ::= NK_VARIABLE */ + { 259, -3 }, /* (102) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { 260, -1 }, /* (103) retention_list ::= retention */ + { 260, -3 }, /* (104) retention_list ::= retention_list NK_COMMA retention */ + { 262, -3 }, /* (105) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + { 242, -9 }, /* (106) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 242, -3 }, /* (107) cmd ::= CREATE TABLE multi_create_clause */ + { 242, -9 }, /* (108) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 242, -3 }, /* (109) cmd ::= DROP TABLE multi_drop_clause */ + { 242, -4 }, /* (110) cmd ::= DROP STABLE exists_opt full_table_name */ + { 242, -3 }, /* (111) cmd ::= ALTER TABLE alter_table_clause */ + { 242, -3 }, /* (112) cmd ::= ALTER STABLE alter_table_clause */ + { 270, -2 }, /* (113) alter_table_clause ::= full_table_name alter_table_options */ + { 270, -5 }, /* (114) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 270, -4 }, /* (115) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 270, -5 }, /* (116) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 270, -5 }, /* (117) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 270, -5 }, /* (118) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 270, -4 }, /* (119) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 270, -5 }, /* (120) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 270, -5 }, /* (121) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 270, -6 }, /* (122) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + { 267, -1 }, /* (123) multi_create_clause ::= create_subtable_clause */ + { 267, -2 }, /* (124) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 275, -10 }, /* (125) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */ + { 269, -1 }, /* (126) multi_drop_clause ::= drop_table_clause */ + { 269, -2 }, /* (127) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 278, -2 }, /* (128) drop_table_clause ::= exists_opt full_table_name */ + { 276, 0 }, /* (129) specific_tags_opt ::= */ + { 276, -3 }, /* (130) specific_tags_opt ::= NK_LP col_name_list NK_RP */ + { 263, -1 }, /* (131) full_table_name ::= table_name */ + { 263, -3 }, /* (132) full_table_name ::= db_name NK_DOT table_name */ + { 264, -1 }, /* (133) column_def_list ::= column_def */ + { 264, -3 }, /* (134) column_def_list ::= column_def_list NK_COMMA column_def */ + { 281, -2 }, /* (135) column_def ::= column_name type_name */ + { 281, -4 }, /* (136) column_def ::= column_name type_name COMMENT NK_STRING */ + { 273, -1 }, /* (137) type_name ::= BOOL */ + { 273, -1 }, /* (138) type_name ::= TINYINT */ + { 273, -1 }, /* (139) type_name ::= SMALLINT */ + { 273, -1 }, /* (140) type_name ::= INT */ + { 273, -1 }, /* (141) type_name ::= INTEGER */ + { 273, -1 }, /* (142) type_name ::= BIGINT */ + { 273, -1 }, /* (143) type_name ::= FLOAT */ + { 273, -1 }, /* (144) type_name ::= DOUBLE */ + { 273, -4 }, /* (145) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 273, -1 }, /* (146) type_name ::= TIMESTAMP */ + { 273, -4 }, /* (147) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 273, -2 }, /* (148) type_name ::= TINYINT UNSIGNED */ + { 273, -2 }, /* (149) type_name ::= SMALLINT UNSIGNED */ + { 273, -2 }, /* (150) type_name ::= INT UNSIGNED */ + { 273, -2 }, /* (151) type_name ::= BIGINT UNSIGNED */ + { 273, -1 }, /* (152) type_name ::= JSON */ + { 273, -4 }, /* (153) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 273, -1 }, /* (154) type_name ::= MEDIUMBLOB */ + { 273, -1 }, /* (155) type_name ::= BLOB */ + { 273, -4 }, /* (156) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 273, -1 }, /* (157) type_name ::= DECIMAL */ + { 273, -4 }, /* (158) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 273, -6 }, /* (159) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 265, 0 }, /* (160) tags_def_opt ::= */ + { 265, -1 }, /* (161) tags_def_opt ::= tags_def */ + { 268, -4 }, /* (162) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 266, 0 }, /* (163) table_options ::= */ + { 266, -3 }, /* (164) table_options ::= table_options COMMENT NK_STRING */ + { 266, -3 }, /* (165) table_options ::= table_options MAX_DELAY duration_list */ + { 266, -3 }, /* (166) table_options ::= table_options WATERMARK duration_list */ + { 266, -5 }, /* (167) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + { 266, -3 }, /* (168) table_options ::= table_options TTL NK_INTEGER */ + { 266, -5 }, /* (169) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 271, -1 }, /* (170) alter_table_options ::= alter_table_option */ + { 271, -2 }, /* (171) alter_table_options ::= alter_table_options alter_table_option */ + { 284, -2 }, /* (172) alter_table_option ::= COMMENT NK_STRING */ + { 284, -2 }, /* (173) alter_table_option ::= TTL NK_INTEGER */ + { 282, -1 }, /* (174) duration_list ::= duration_literal */ + { 282, -3 }, /* (175) duration_list ::= duration_list NK_COMMA duration_literal */ + { 283, -1 }, /* (176) rollup_func_list ::= rollup_func_name */ + { 283, -3 }, /* (177) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + { 286, -1 }, /* (178) rollup_func_name ::= function_name */ + { 286, -1 }, /* (179) rollup_func_name ::= FIRST */ + { 286, -1 }, /* (180) rollup_func_name ::= LAST */ + { 279, -1 }, /* (181) col_name_list ::= col_name */ + { 279, -3 }, /* (182) col_name_list ::= col_name_list NK_COMMA col_name */ + { 288, -1 }, /* (183) col_name ::= column_name */ + { 242, -2 }, /* (184) cmd ::= SHOW DNODES */ + { 242, -2 }, /* (185) cmd ::= SHOW USERS */ + { 242, -2 }, /* (186) cmd ::= SHOW DATABASES */ + { 242, -4 }, /* (187) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 242, -4 }, /* (188) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 242, -3 }, /* (189) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 242, -2 }, /* (190) cmd ::= SHOW MNODES */ + { 242, -2 }, /* (191) cmd ::= SHOW MODULES */ + { 242, -2 }, /* (192) cmd ::= SHOW QNODES */ + { 242, -2 }, /* (193) cmd ::= SHOW FUNCTIONS */ + { 242, -5 }, /* (194) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 242, -2 }, /* (195) cmd ::= SHOW STREAMS */ + { 242, -2 }, /* (196) cmd ::= SHOW ACCOUNTS */ + { 242, -2 }, /* (197) cmd ::= SHOW APPS */ + { 242, -2 }, /* (198) cmd ::= SHOW CONNECTIONS */ + { 242, -2 }, /* (199) cmd ::= SHOW LICENCE */ + { 242, -2 }, /* (200) cmd ::= SHOW GRANTS */ + { 242, -4 }, /* (201) cmd ::= SHOW CREATE DATABASE db_name */ + { 242, -4 }, /* (202) cmd ::= SHOW CREATE TABLE full_table_name */ + { 242, -4 }, /* (203) cmd ::= SHOW CREATE STABLE full_table_name */ + { 242, -2 }, /* (204) cmd ::= SHOW QUERIES */ + { 242, -2 }, /* (205) cmd ::= SHOW SCORES */ + { 242, -2 }, /* (206) cmd ::= SHOW TOPICS */ + { 242, -2 }, /* (207) cmd ::= SHOW VARIABLES */ + { 242, -2 }, /* (208) cmd ::= SHOW BNODES */ + { 242, -2 }, /* (209) cmd ::= SHOW SNODES */ + { 242, -2 }, /* (210) cmd ::= SHOW CLUSTER */ + { 242, -2 }, /* (211) cmd ::= SHOW TRANSACTIONS */ + { 242, -4 }, /* (212) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + { 289, 0 }, /* (213) db_name_cond_opt ::= */ + { 289, -2 }, /* (214) db_name_cond_opt ::= db_name NK_DOT */ + { 290, 0 }, /* (215) like_pattern_opt ::= */ + { 290, -2 }, /* (216) like_pattern_opt ::= LIKE NK_STRING */ + { 291, -1 }, /* (217) table_name_cond ::= table_name */ + { 292, 0 }, /* (218) from_db_opt ::= */ + { 292, -2 }, /* (219) from_db_opt ::= FROM db_name */ + { 242, -8 }, /* (220) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */ + { 242, -10 }, /* (221) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */ + { 242, -6 }, /* (222) cmd ::= DROP INDEX exists_opt index_name ON table_name */ + { 294, 0 }, /* (223) index_options ::= */ + { 294, -9 }, /* (224) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ + { 294, -11 }, /* (225) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ + { 295, -1 }, /* (226) func_list ::= func */ + { 295, -3 }, /* (227) func_list ::= func_list NK_COMMA func */ + { 297, -4 }, /* (228) func ::= function_name NK_LP expression_list NK_RP */ + { 242, -6 }, /* (229) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ + { 242, -7 }, /* (230) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + { 242, -7 }, /* (231) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + { 242, -4 }, /* (232) cmd ::= DROP TOPIC exists_opt topic_name */ + { 242, -7 }, /* (233) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { 242, -2 }, /* (234) cmd ::= DESC full_table_name */ + { 242, -2 }, /* (235) cmd ::= DESCRIBE full_table_name */ + { 242, -3 }, /* (236) cmd ::= RESET QUERY CACHE */ + { 242, -4 }, /* (237) cmd ::= EXPLAIN analyze_opt explain_options query_expression */ + { 302, 0 }, /* (238) analyze_opt ::= */ + { 302, -1 }, /* (239) analyze_opt ::= ANALYZE */ + { 303, 0 }, /* (240) explain_options ::= */ + { 303, -3 }, /* (241) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 303, -3 }, /* (242) explain_options ::= explain_options RATIO NK_FLOAT */ + { 242, -6 }, /* (243) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */ + { 242, -10 }, /* (244) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + { 242, -4 }, /* (245) cmd ::= DROP FUNCTION exists_opt function_name */ + { 304, 0 }, /* (246) agg_func_opt ::= */ + { 304, -1 }, /* (247) agg_func_opt ::= AGGREGATE */ + { 305, 0 }, /* (248) bufsize_opt ::= */ + { 305, -2 }, /* (249) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 242, -8 }, /* (250) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ + { 242, -4 }, /* (251) cmd ::= DROP STREAM exists_opt stream_name */ + { 308, 0 }, /* (252) into_opt ::= */ + { 308, -2 }, /* (253) into_opt ::= INTO full_table_name */ + { 307, 0 }, /* (254) stream_options ::= */ + { 307, -3 }, /* (255) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 307, -3 }, /* (256) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 307, -4 }, /* (257) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 307, -3 }, /* (258) stream_options ::= stream_options WATERMARK duration_literal */ + { 242, -3 }, /* (259) cmd ::= KILL CONNECTION NK_INTEGER */ + { 242, -3 }, /* (260) cmd ::= KILL QUERY NK_STRING */ + { 242, -3 }, /* (261) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 242, -2 }, /* (262) cmd ::= BALANCE VGROUP */ + { 242, -4 }, /* (263) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 242, -4 }, /* (264) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 242, -3 }, /* (265) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 309, -2 }, /* (266) dnode_list ::= DNODE NK_INTEGER */ + { 309, -3 }, /* (267) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 242, -3 }, /* (268) cmd ::= SYNCDB db_name REPLICA */ + { 242, -4 }, /* (269) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 242, -1 }, /* (270) cmd ::= query_expression */ + { 245, -1 }, /* (271) literal ::= NK_INTEGER */ + { 245, -1 }, /* (272) literal ::= NK_FLOAT */ + { 245, -1 }, /* (273) literal ::= NK_STRING */ + { 245, -1 }, /* (274) literal ::= NK_BOOL */ + { 245, -2 }, /* (275) literal ::= TIMESTAMP NK_STRING */ + { 245, -1 }, /* (276) literal ::= duration_literal */ + { 245, -1 }, /* (277) literal ::= NULL */ + { 245, -1 }, /* (278) literal ::= NK_QUESTION */ + { 285, -1 }, /* (279) duration_literal ::= NK_VARIABLE */ + { 311, -1 }, /* (280) signed ::= NK_INTEGER */ + { 311, -2 }, /* (281) signed ::= NK_PLUS NK_INTEGER */ + { 311, -2 }, /* (282) signed ::= NK_MINUS NK_INTEGER */ + { 311, -1 }, /* (283) signed ::= NK_FLOAT */ + { 311, -2 }, /* (284) signed ::= NK_PLUS NK_FLOAT */ + { 311, -2 }, /* (285) signed ::= NK_MINUS NK_FLOAT */ + { 274, -1 }, /* (286) signed_literal ::= signed */ + { 274, -1 }, /* (287) signed_literal ::= NK_STRING */ + { 274, -1 }, /* (288) signed_literal ::= NK_BOOL */ + { 274, -2 }, /* (289) signed_literal ::= TIMESTAMP NK_STRING */ + { 274, -1 }, /* (290) signed_literal ::= duration_literal */ + { 274, -1 }, /* (291) signed_literal ::= NULL */ + { 274, -1 }, /* (292) signed_literal ::= literal_func */ + { 277, -1 }, /* (293) literal_list ::= signed_literal */ + { 277, -3 }, /* (294) literal_list ::= literal_list NK_COMMA signed_literal */ + { 252, -1 }, /* (295) db_name ::= NK_ID */ + { 280, -1 }, /* (296) table_name ::= NK_ID */ + { 272, -1 }, /* (297) column_name ::= NK_ID */ + { 287, -1 }, /* (298) function_name ::= NK_ID */ + { 313, -1 }, /* (299) table_alias ::= NK_ID */ + { 314, -1 }, /* (300) column_alias ::= NK_ID */ + { 247, -1 }, /* (301) user_name ::= NK_ID */ + { 293, -1 }, /* (302) index_name ::= NK_ID */ + { 299, -1 }, /* (303) topic_name ::= NK_ID */ + { 306, -1 }, /* (304) stream_name ::= NK_ID */ + { 301, -1 }, /* (305) cgroup_name ::= NK_ID */ + { 315, -1 }, /* (306) expression ::= literal */ + { 315, -1 }, /* (307) expression ::= pseudo_column */ + { 315, -1 }, /* (308) expression ::= column_reference */ + { 315, -1 }, /* (309) expression ::= function_expression */ + { 315, -1 }, /* (310) expression ::= subquery */ + { 315, -3 }, /* (311) expression ::= NK_LP expression NK_RP */ + { 315, -2 }, /* (312) expression ::= NK_PLUS expression */ + { 315, -2 }, /* (313) expression ::= NK_MINUS expression */ + { 315, -3 }, /* (314) expression ::= expression NK_PLUS expression */ + { 315, -3 }, /* (315) expression ::= expression NK_MINUS expression */ + { 315, -3 }, /* (316) expression ::= expression NK_STAR expression */ + { 315, -3 }, /* (317) expression ::= expression NK_SLASH expression */ + { 315, -3 }, /* (318) expression ::= expression NK_REM expression */ + { 315, -3 }, /* (319) expression ::= column_reference NK_ARROW NK_STRING */ + { 298, -1 }, /* (320) expression_list ::= expression */ + { 298, -3 }, /* (321) expression_list ::= expression_list NK_COMMA expression */ + { 317, -1 }, /* (322) column_reference ::= column_name */ + { 317, -3 }, /* (323) column_reference ::= table_name NK_DOT column_name */ + { 316, -1 }, /* (324) pseudo_column ::= ROWTS */ + { 316, -1 }, /* (325) pseudo_column ::= TBNAME */ + { 316, -3 }, /* (326) pseudo_column ::= table_name NK_DOT TBNAME */ + { 316, -1 }, /* (327) pseudo_column ::= QSTARTTS */ + { 316, -1 }, /* (328) pseudo_column ::= QENDTS */ + { 316, -1 }, /* (329) pseudo_column ::= WSTARTTS */ + { 316, -1 }, /* (330) pseudo_column ::= WENDTS */ + { 316, -1 }, /* (331) pseudo_column ::= WDURATION */ + { 318, -4 }, /* (332) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 318, -4 }, /* (333) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 318, -6 }, /* (334) function_expression ::= CAST NK_LP expression AS type_name NK_RP */ + { 318, -1 }, /* (335) function_expression ::= literal_func */ + { 312, -3 }, /* (336) literal_func ::= noarg_func NK_LP NK_RP */ + { 312, -1 }, /* (337) literal_func ::= NOW */ + { 322, -1 }, /* (338) noarg_func ::= NOW */ + { 322, -1 }, /* (339) noarg_func ::= TODAY */ + { 322, -1 }, /* (340) noarg_func ::= TIMEZONE */ + { 320, -1 }, /* (341) star_func ::= COUNT */ + { 320, -1 }, /* (342) star_func ::= FIRST */ + { 320, -1 }, /* (343) star_func ::= LAST */ + { 320, -1 }, /* (344) star_func ::= LAST_ROW */ + { 321, -1 }, /* (345) star_func_para_list ::= NK_STAR */ + { 321, -1 }, /* (346) star_func_para_list ::= other_para_list */ + { 323, -1 }, /* (347) other_para_list ::= star_func_para */ + { 323, -3 }, /* (348) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 324, -1 }, /* (349) star_func_para ::= expression */ + { 324, -3 }, /* (350) star_func_para ::= table_name NK_DOT NK_STAR */ + { 325, -3 }, /* (351) predicate ::= expression compare_op expression */ + { 325, -5 }, /* (352) predicate ::= expression BETWEEN expression AND expression */ + { 325, -6 }, /* (353) predicate ::= expression NOT BETWEEN expression AND expression */ + { 325, -3 }, /* (354) predicate ::= expression IS NULL */ + { 325, -4 }, /* (355) predicate ::= expression IS NOT NULL */ + { 325, -3 }, /* (356) predicate ::= expression in_op in_predicate_value */ + { 326, -1 }, /* (357) compare_op ::= NK_LT */ + { 326, -1 }, /* (358) compare_op ::= NK_GT */ + { 326, -1 }, /* (359) compare_op ::= NK_LE */ + { 326, -1 }, /* (360) compare_op ::= NK_GE */ + { 326, -1 }, /* (361) compare_op ::= NK_NE */ + { 326, -1 }, /* (362) compare_op ::= NK_EQ */ + { 326, -1 }, /* (363) compare_op ::= LIKE */ + { 326, -2 }, /* (364) compare_op ::= NOT LIKE */ + { 326, -1 }, /* (365) compare_op ::= MATCH */ + { 326, -1 }, /* (366) compare_op ::= NMATCH */ + { 326, -1 }, /* (367) compare_op ::= CONTAINS */ + { 327, -1 }, /* (368) in_op ::= IN */ + { 327, -2 }, /* (369) in_op ::= NOT IN */ + { 328, -3 }, /* (370) in_predicate_value ::= NK_LP expression_list NK_RP */ + { 329, -1 }, /* (371) boolean_value_expression ::= boolean_primary */ + { 329, -2 }, /* (372) boolean_value_expression ::= NOT boolean_primary */ + { 329, -3 }, /* (373) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 329, -3 }, /* (374) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 330, -1 }, /* (375) boolean_primary ::= predicate */ + { 330, -3 }, /* (376) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 331, -1 }, /* (377) common_expression ::= expression */ + { 331, -1 }, /* (378) common_expression ::= boolean_value_expression */ + { 332, -2 }, /* (379) from_clause ::= FROM table_reference_list */ + { 333, -1 }, /* (380) table_reference_list ::= table_reference */ + { 333, -3 }, /* (381) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 334, -1 }, /* (382) table_reference ::= table_primary */ + { 334, -1 }, /* (383) table_reference ::= joined_table */ + { 335, -2 }, /* (384) table_primary ::= table_name alias_opt */ + { 335, -4 }, /* (385) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 335, -2 }, /* (386) table_primary ::= subquery alias_opt */ + { 335, -1 }, /* (387) table_primary ::= parenthesized_joined_table */ + { 337, 0 }, /* (388) alias_opt ::= */ + { 337, -1 }, /* (389) alias_opt ::= table_alias */ + { 337, -2 }, /* (390) alias_opt ::= AS table_alias */ + { 338, -3 }, /* (391) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 338, -3 }, /* (392) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 336, -6 }, /* (393) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 339, 0 }, /* (394) join_type ::= */ + { 339, -1 }, /* (395) join_type ::= INNER */ + { 341, -12 }, /* (396) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { 342, 0 }, /* (397) set_quantifier_opt ::= */ + { 342, -1 }, /* (398) set_quantifier_opt ::= DISTINCT */ + { 342, -1 }, /* (399) set_quantifier_opt ::= ALL */ + { 343, -1 }, /* (400) select_list ::= NK_STAR */ + { 343, -1 }, /* (401) select_list ::= select_sublist */ + { 351, -1 }, /* (402) select_sublist ::= select_item */ + { 351, -3 }, /* (403) select_sublist ::= select_sublist NK_COMMA select_item */ + { 352, -1 }, /* (404) select_item ::= common_expression */ + { 352, -2 }, /* (405) select_item ::= common_expression column_alias */ + { 352, -3 }, /* (406) select_item ::= common_expression AS column_alias */ + { 352, -3 }, /* (407) select_item ::= table_name NK_DOT NK_STAR */ + { 310, 0 }, /* (408) where_clause_opt ::= */ + { 310, -2 }, /* (409) where_clause_opt ::= WHERE search_condition */ + { 344, 0 }, /* (410) partition_by_clause_opt ::= */ + { 344, -3 }, /* (411) partition_by_clause_opt ::= PARTITION BY expression_list */ + { 348, 0 }, /* (412) twindow_clause_opt ::= */ + { 348, -6 }, /* (413) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 348, -4 }, /* (414) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ + { 348, -6 }, /* (415) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 348, -8 }, /* (416) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 296, 0 }, /* (417) sliding_opt ::= */ + { 296, -4 }, /* (418) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 347, 0 }, /* (419) fill_opt ::= */ + { 347, -4 }, /* (420) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 347, -6 }, /* (421) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 353, -1 }, /* (422) fill_mode ::= NONE */ + { 353, -1 }, /* (423) fill_mode ::= PREV */ + { 353, -1 }, /* (424) fill_mode ::= NULL */ + { 353, -1 }, /* (425) fill_mode ::= LINEAR */ + { 353, -1 }, /* (426) fill_mode ::= NEXT */ + { 349, 0 }, /* (427) group_by_clause_opt ::= */ + { 349, -3 }, /* (428) group_by_clause_opt ::= GROUP BY group_by_list */ + { 354, -1 }, /* (429) group_by_list ::= expression */ + { 354, -3 }, /* (430) group_by_list ::= group_by_list NK_COMMA expression */ + { 350, 0 }, /* (431) having_clause_opt ::= */ + { 350, -2 }, /* (432) having_clause_opt ::= HAVING search_condition */ + { 345, 0 }, /* (433) range_opt ::= */ + { 345, -6 }, /* (434) range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ + { 346, 0 }, /* (435) every_opt ::= */ + { 346, -4 }, /* (436) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 300, -4 }, /* (437) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 355, -1 }, /* (438) query_expression_body ::= query_primary */ + { 355, -4 }, /* (439) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ + { 355, -3 }, /* (440) query_expression_body ::= query_expression_body UNION query_expression_body */ + { 359, -1 }, /* (441) query_primary ::= query_specification */ + { 359, -6 }, /* (442) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ + { 356, 0 }, /* (443) order_by_clause_opt ::= */ + { 356, -3 }, /* (444) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 357, 0 }, /* (445) slimit_clause_opt ::= */ + { 357, -2 }, /* (446) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 357, -4 }, /* (447) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 357, -4 }, /* (448) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 358, 0 }, /* (449) limit_clause_opt ::= */ + { 358, -2 }, /* (450) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 358, -4 }, /* (451) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 358, -4 }, /* (452) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 319, -3 }, /* (453) subquery ::= NK_LP query_expression NK_RP */ + { 340, -1 }, /* (454) search_condition ::= common_expression */ + { 360, -1 }, /* (455) sort_specification_list ::= sort_specification */ + { 360, -3 }, /* (456) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 361, -3 }, /* (457) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ + { 362, 0 }, /* (458) ordering_specification_opt ::= */ + { 362, -1 }, /* (459) ordering_specification_opt ::= ASC */ + { 362, -1 }, /* (460) ordering_specification_opt ::= DESC */ + { 363, 0 }, /* (461) null_ordering_opt ::= */ + { 363, -2 }, /* (462) null_ordering_opt ::= NULLS FIRST */ + { 363, -2 }, /* (463) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3112,11 +3141,11 @@ static YYACTIONTYPE yy_reduce( YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,240,&yymsp[0].minor); + yy_destructor(yypParser,243,&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,241,&yymsp[0].minor); + yy_destructor(yypParser,244,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -3130,20 +3159,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,240,&yymsp[-2].minor); +{ yy_destructor(yypParser,243,&yymsp[-2].minor); { } - yy_destructor(yypParser,242,&yymsp[0].minor); + yy_destructor(yypParser,245,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,243,&yymsp[0].minor); +{ yy_destructor(yypParser,246,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,241,&yymsp[-1].minor); +{ yy_destructor(yypParser,244,&yymsp[-1].minor); { } - yy_destructor(yypParser,243,&yymsp[0].minor); + yy_destructor(yypParser,246,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -3157,63 +3186,63 @@ static YYACTIONTYPE yy_reduce( case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); { } - yy_destructor(yypParser,242,&yymsp[0].minor); + yy_destructor(yypParser,245,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy57, &yymsp[0].minor.yy0); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy421, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy57, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy421, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy57, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy57); } break; case 28: /* cmd ::= GRANT privileges ON priv_level TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy669, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy389, &yymsp[-2].minor.yy57, &yymsp[0].minor.yy57); } break; case 29: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy669, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy389, &yymsp[-2].minor.yy57, &yymsp[0].minor.yy57); } break; case 30: /* privileges ::= ALL */ -{ yymsp[0].minor.yy669 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy389 = PRIVILEGE_TYPE_ALL; } break; case 31: /* privileges ::= priv_type_list */ case 32: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==32); -{ yylhsminor.yy669 = yymsp[0].minor.yy669; } - yymsp[0].minor.yy669 = yylhsminor.yy669; +{ yylhsminor.yy389 = yymsp[0].minor.yy389; } + yymsp[0].minor.yy389 = yylhsminor.yy389; break; case 33: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy669 = yymsp[-2].minor.yy669 | yymsp[0].minor.yy669; } - yymsp[-2].minor.yy669 = yylhsminor.yy669; +{ yylhsminor.yy389 = yymsp[-2].minor.yy389 | yymsp[0].minor.yy389; } + yymsp[-2].minor.yy389 = yylhsminor.yy389; break; case 34: /* priv_type ::= READ */ -{ yymsp[0].minor.yy669 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy389 = PRIVILEGE_TYPE_READ; } break; case 35: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy669 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy389 = PRIVILEGE_TYPE_WRITE; } break; case 36: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy421 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy421 = yylhsminor.yy421; +{ yylhsminor.yy57 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy57 = yylhsminor.yy57; break; case 37: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy421 = yymsp[-2].minor.yy421; } - yymsp[-2].minor.yy421 = yylhsminor.yy421; +{ yylhsminor.yy57 = yymsp[-2].minor.yy57; } + yymsp[-2].minor.yy57 = yylhsminor.yy57; break; case 38: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy421, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy57, NULL); } break; case 39: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy57, &yymsp[0].minor.yy0); } break; case 40: /* cmd ::= DROP DNODE NK_INTEGER */ { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; case 41: /* cmd ::= DROP DNODE dnode_endpoint */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy57); } break; case 42: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3230,26 +3259,26 @@ static YYACTIONTYPE yy_reduce( case 46: /* dnode_endpoint ::= NK_STRING */ case 47: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==47); case 48: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==48); - case 294: /* db_name ::= NK_ID */ yytestcase(yyruleno==294); - case 295: /* table_name ::= NK_ID */ yytestcase(yyruleno==295); - case 296: /* column_name ::= NK_ID */ yytestcase(yyruleno==296); - case 297: /* function_name ::= NK_ID */ yytestcase(yyruleno==297); - case 298: /* table_alias ::= NK_ID */ yytestcase(yyruleno==298); - case 299: /* column_alias ::= NK_ID */ yytestcase(yyruleno==299); - case 300: /* user_name ::= NK_ID */ yytestcase(yyruleno==300); - case 301: /* index_name ::= NK_ID */ yytestcase(yyruleno==301); - case 302: /* topic_name ::= NK_ID */ yytestcase(yyruleno==302); - case 303: /* stream_name ::= NK_ID */ yytestcase(yyruleno==303); - case 304: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==304); - case 337: /* noarg_func ::= NOW */ yytestcase(yyruleno==337); - case 338: /* noarg_func ::= TODAY */ yytestcase(yyruleno==338); - case 339: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==339); - case 340: /* star_func ::= COUNT */ yytestcase(yyruleno==340); - case 341: /* star_func ::= FIRST */ yytestcase(yyruleno==341); - case 342: /* star_func ::= LAST */ yytestcase(yyruleno==342); - case 343: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==343); -{ yylhsminor.yy421 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy421 = yylhsminor.yy421; + case 295: /* db_name ::= NK_ID */ yytestcase(yyruleno==295); + case 296: /* table_name ::= NK_ID */ yytestcase(yyruleno==296); + case 297: /* column_name ::= NK_ID */ yytestcase(yyruleno==297); + case 298: /* function_name ::= NK_ID */ yytestcase(yyruleno==298); + case 299: /* table_alias ::= NK_ID */ yytestcase(yyruleno==299); + case 300: /* column_alias ::= NK_ID */ yytestcase(yyruleno==300); + case 301: /* user_name ::= NK_ID */ yytestcase(yyruleno==301); + case 302: /* index_name ::= NK_ID */ yytestcase(yyruleno==302); + case 303: /* topic_name ::= NK_ID */ yytestcase(yyruleno==303); + case 304: /* stream_name ::= NK_ID */ yytestcase(yyruleno==304); + case 305: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==305); + case 338: /* noarg_func ::= NOW */ yytestcase(yyruleno==338); + case 339: /* noarg_func ::= TODAY */ yytestcase(yyruleno==339); + case 340: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==340); + case 341: /* star_func ::= COUNT */ yytestcase(yyruleno==341); + case 342: /* star_func ::= FIRST */ yytestcase(yyruleno==342); + case 343: /* star_func ::= LAST */ yytestcase(yyruleno==343); + case 344: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==344); +{ yylhsminor.yy57 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy57 = yylhsminor.yy57; break; case 49: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3282,156 +3311,156 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 59: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy621, &yymsp[-1].minor.yy421, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy481, &yymsp[-1].minor.yy57, yymsp[0].minor.yy392); } break; case 60: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy621, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy481, &yymsp[0].minor.yy57); } break; case 61: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy57); } break; case 62: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy421, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy57, yymsp[0].minor.yy392); } break; case 63: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy621 = true; } +{ yymsp[-2].minor.yy481 = true; } break; case 64: /* not_exists_opt ::= */ case 66: /* exists_opt ::= */ yytestcase(yyruleno==66); - case 237: /* analyze_opt ::= */ yytestcase(yyruleno==237); - case 245: /* agg_func_opt ::= */ yytestcase(yyruleno==245); - case 396: /* set_quantifier_opt ::= */ yytestcase(yyruleno==396); -{ yymsp[1].minor.yy621 = false; } + case 238: /* analyze_opt ::= */ yytestcase(yyruleno==238); + case 246: /* agg_func_opt ::= */ yytestcase(yyruleno==246); + case 397: /* set_quantifier_opt ::= */ yytestcase(yyruleno==397); +{ yymsp[1].minor.yy481 = false; } break; case 65: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy621 = true; } +{ yymsp[-1].minor.yy481 = true; } break; case 67: /* db_options ::= */ -{ yymsp[1].minor.yy674 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy392 = createDefaultDatabaseOptions(pCxt); } break; case 68: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 69: /* db_options ::= db_options CACHELAST NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 70: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 71: /* db_options ::= db_options DURATION NK_INTEGER */ case 72: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==72); -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 73: /* db_options ::= db_options FSYNC NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 74: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 75: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 76: /* db_options ::= db_options KEEP integer_list */ case 77: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==77); -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_KEEP, yymsp[0].minor.yy530); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_KEEP, yymsp[0].minor.yy600); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 78: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 79: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 80: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 81: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 82: /* db_options ::= db_options STRICT NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 83: /* db_options ::= db_options WAL NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 84: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 85: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 86: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_RETENTIONS, yymsp[0].minor.yy530); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_RETENTIONS, yymsp[0].minor.yy600); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 87: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 88: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy674 = createAlterDatabaseOptions(pCxt); yylhsminor.yy674 = setAlterDatabaseOption(pCxt, yylhsminor.yy674, &yymsp[0].minor.yy557); } - yymsp[0].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createAlterDatabaseOptions(pCxt); yylhsminor.yy392 = setAlterDatabaseOption(pCxt, yylhsminor.yy392, &yymsp[0].minor.yy221); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; case 89: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy674 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy674, &yymsp[0].minor.yy557); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy392, &yymsp[0].minor.yy221); } + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; case 90: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy221.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy221.val = yymsp[0].minor.yy0; } break; case 91: /* alter_db_option ::= CACHELAST NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy221.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy221.val = yymsp[0].minor.yy0; } break; case 92: /* alter_db_option ::= FSYNC NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy221.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy221.val = yymsp[0].minor.yy0; } break; case 93: /* alter_db_option ::= KEEP integer_list */ case 94: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==94); -{ yymsp[-1].minor.yy557.type = DB_OPTION_KEEP; yymsp[-1].minor.yy557.pList = yymsp[0].minor.yy530; } +{ yymsp[-1].minor.yy221.type = DB_OPTION_KEEP; yymsp[-1].minor.yy221.pList = yymsp[0].minor.yy600; } break; case 95: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_PAGES; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy221.type = DB_OPTION_PAGES; yymsp[-1].minor.yy221.val = yymsp[0].minor.yy0; } break; case 96: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy221.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy221.val = yymsp[0].minor.yy0; } break; case 97: /* alter_db_option ::= STRICT NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_STRICT; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy221.type = DB_OPTION_STRICT; yymsp[-1].minor.yy221.val = yymsp[0].minor.yy0; } break; case 98: /* alter_db_option ::= WAL NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_WAL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy221.type = DB_OPTION_WAL; yymsp[-1].minor.yy221.val = yymsp[0].minor.yy0; } break; case 99: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy530 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy530 = yylhsminor.yy530; +{ yylhsminor.yy600 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; case 100: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 266: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==266); -{ yylhsminor.yy530 = addNodeToList(pCxt, yymsp[-2].minor.yy530, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy530 = yylhsminor.yy530; + case 267: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==267); +{ yylhsminor.yy600 = addNodeToList(pCxt, yymsp[-2].minor.yy600, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 101: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy530 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy530 = yylhsminor.yy530; +{ yylhsminor.yy600 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; case 102: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy530 = addNodeToList(pCxt, yymsp[-2].minor.yy530, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy530 = yylhsminor.yy530; +{ yylhsminor.yy600 = addNodeToList(pCxt, yymsp[-2].minor.yy600, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 103: /* retention_list ::= retention */ case 123: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==123); @@ -3439,1009 +3468,1021 @@ static YYACTIONTYPE yy_reduce( case 133: /* column_def_list ::= column_def */ yytestcase(yyruleno==133); case 176: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==176); case 181: /* col_name_list ::= col_name */ yytestcase(yyruleno==181); - case 225: /* func_list ::= func */ yytestcase(yyruleno==225); - case 292: /* literal_list ::= signed_literal */ yytestcase(yyruleno==292); - case 346: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==346); - case 401: /* select_sublist ::= select_item */ yytestcase(yyruleno==401); - case 450: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==450); -{ yylhsminor.yy530 = createNodeList(pCxt, yymsp[0].minor.yy674); } - yymsp[0].minor.yy530 = yylhsminor.yy530; + case 226: /* func_list ::= func */ yytestcase(yyruleno==226); + case 293: /* literal_list ::= signed_literal */ yytestcase(yyruleno==293); + case 347: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==347); + case 402: /* select_sublist ::= select_item */ yytestcase(yyruleno==402); + case 455: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==455); +{ yylhsminor.yy600 = createNodeList(pCxt, yymsp[0].minor.yy392); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; case 104: /* retention_list ::= retention_list NK_COMMA retention */ case 134: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==134); case 177: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==177); case 182: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==182); - case 226: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==226); - case 293: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==293); - case 347: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==347); - case 402: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==402); - case 451: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==451); -{ yylhsminor.yy530 = addNodeToList(pCxt, yymsp[-2].minor.yy530, yymsp[0].minor.yy674); } - yymsp[-2].minor.yy530 = yylhsminor.yy530; + case 227: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==227); + case 294: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==294); + case 348: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==348); + case 403: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==403); + case 456: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==456); +{ yylhsminor.yy600 = addNodeToList(pCxt, yymsp[-2].minor.yy600, yymsp[0].minor.yy392); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 105: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy674 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 106: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 108: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==108); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy621, yymsp[-5].minor.yy674, yymsp[-3].minor.yy530, yymsp[-1].minor.yy530, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy481, yymsp[-5].minor.yy392, yymsp[-3].minor.yy600, yymsp[-1].minor.yy600, yymsp[0].minor.yy392); } break; case 107: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy530); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy600); } break; case 109: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy530); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy600); } break; case 110: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy621, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy481, yymsp[0].minor.yy392); } break; case 111: /* cmd ::= ALTER TABLE alter_table_clause */ case 112: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==112); - case 269: /* cmd ::= query_expression */ yytestcase(yyruleno==269); -{ pCxt->pRootNode = yymsp[0].minor.yy674; } + case 270: /* cmd ::= query_expression */ yytestcase(yyruleno==270); +{ pCxt->pRootNode = yymsp[0].minor.yy392; } break; case 113: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy674 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy674, yymsp[0].minor.yy674); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; case 114: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy674 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy674, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy421, yymsp[0].minor.yy690); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy392, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy57, yymsp[0].minor.yy448); } + yymsp[-4].minor.yy392 = yylhsminor.yy392; break; case 115: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy674 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy674, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy421); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy392, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy57); } + yymsp[-3].minor.yy392 = yylhsminor.yy392; break; case 116: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy674 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy674, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy421, yymsp[0].minor.yy690); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy392, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy57, yymsp[0].minor.yy448); } + yymsp[-4].minor.yy392 = yylhsminor.yy392; break; case 117: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy674 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy674, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy421, &yymsp[0].minor.yy421); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy392, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy57, &yymsp[0].minor.yy57); } + yymsp[-4].minor.yy392 = yylhsminor.yy392; break; case 118: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy674 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy674, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy421, yymsp[0].minor.yy690); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy392, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy57, yymsp[0].minor.yy448); } + yymsp[-4].minor.yy392 = yylhsminor.yy392; break; case 119: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy674 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy674, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy421); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy392, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy57); } + yymsp[-3].minor.yy392 = yylhsminor.yy392; break; case 120: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy674 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy674, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy421, yymsp[0].minor.yy690); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy392, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy57, yymsp[0].minor.yy448); } + yymsp[-4].minor.yy392 = yylhsminor.yy392; break; case 121: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy674 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy674, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy421, &yymsp[0].minor.yy421); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy392, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy57, &yymsp[0].minor.yy57); } + yymsp[-4].minor.yy392 = yylhsminor.yy392; break; case 122: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy674 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy674, &yymsp[-2].minor.yy421, yymsp[0].minor.yy674); } - yymsp[-5].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy392, &yymsp[-2].minor.yy57, yymsp[0].minor.yy392); } + yymsp[-5].minor.yy392 = yylhsminor.yy392; break; case 124: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 127: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==127); -{ yylhsminor.yy530 = addNodeToList(pCxt, yymsp[-1].minor.yy530, yymsp[0].minor.yy674); } - yymsp[-1].minor.yy530 = yylhsminor.yy530; +{ yylhsminor.yy600 = addNodeToList(pCxt, yymsp[-1].minor.yy600, yymsp[0].minor.yy392); } + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; case 125: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */ -{ yylhsminor.yy674 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy621, yymsp[-8].minor.yy674, yymsp[-6].minor.yy674, yymsp[-5].minor.yy530, yymsp[-2].minor.yy530, yymsp[0].minor.yy674); } - yymsp[-9].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy481, yymsp[-8].minor.yy392, yymsp[-6].minor.yy392, yymsp[-5].minor.yy600, yymsp[-2].minor.yy600, yymsp[0].minor.yy392); } + yymsp[-9].minor.yy392 = yylhsminor.yy392; break; case 128: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy674 = createDropTableClause(pCxt, yymsp[-1].minor.yy621, yymsp[0].minor.yy674); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createDropTableClause(pCxt, yymsp[-1].minor.yy481, yymsp[0].minor.yy392); } + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; case 129: /* specific_tags_opt ::= */ case 160: /* tags_def_opt ::= */ yytestcase(yyruleno==160); - case 409: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==409); - case 426: /* group_by_clause_opt ::= */ yytestcase(yyruleno==426); - case 438: /* order_by_clause_opt ::= */ yytestcase(yyruleno==438); -{ yymsp[1].minor.yy530 = NULL; } + case 410: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==410); + case 427: /* group_by_clause_opt ::= */ yytestcase(yyruleno==427); + case 443: /* order_by_clause_opt ::= */ yytestcase(yyruleno==443); +{ yymsp[1].minor.yy600 = NULL; } break; case 130: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy530 = yymsp[-1].minor.yy530; } +{ yymsp[-2].minor.yy600 = yymsp[-1].minor.yy600; } break; case 131: /* full_table_name ::= table_name */ -{ yylhsminor.yy674 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy421, NULL); } - yymsp[0].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy57, NULL); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; case 132: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy674 = createRealTableNode(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421, NULL); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createRealTableNode(pCxt, &yymsp[-2].minor.yy57, &yymsp[0].minor.yy57, NULL); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 135: /* column_def ::= column_name type_name */ -{ yylhsminor.yy674 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy421, yymsp[0].minor.yy690, NULL); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy57, yymsp[0].minor.yy448, NULL); } + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; case 136: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy674 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy421, yymsp[-2].minor.yy690, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy57, yymsp[-2].minor.yy448, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy392 = yylhsminor.yy392; break; case 137: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 138: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 139: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 140: /* type_name ::= INT */ case 141: /* type_name ::= INTEGER */ yytestcase(yyruleno==141); -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_INT); } break; case 142: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 143: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 144: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 145: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy690 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy448 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 146: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 147: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy690 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy448 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 148: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy690 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy448 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 149: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy690 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy448 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 150: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy690 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy448 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 151: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy690 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy448 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 152: /* type_name ::= JSON */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 153: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy690 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy448 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 154: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 155: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 156: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy690 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy448 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 157: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 158: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy690 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy448 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 159: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy690 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy448 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 161: /* tags_def_opt ::= tags_def */ - case 345: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==345); - case 400: /* select_list ::= select_sublist */ yytestcase(yyruleno==400); -{ yylhsminor.yy530 = yymsp[0].minor.yy530; } - yymsp[0].minor.yy530 = yylhsminor.yy530; + case 346: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==346); + case 401: /* select_list ::= select_sublist */ yytestcase(yyruleno==401); +{ yylhsminor.yy600 = yymsp[0].minor.yy600; } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; case 162: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy530 = yymsp[-1].minor.yy530; } +{ yymsp[-3].minor.yy600 = yymsp[-1].minor.yy600; } break; case 163: /* table_options ::= */ -{ yymsp[1].minor.yy674 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy392 = createDefaultTableOptions(pCxt); } break; case 164: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-2].minor.yy674, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-2].minor.yy392, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 165: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-2].minor.yy674, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy530); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-2].minor.yy392, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy600); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 166: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-2].minor.yy674, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy530); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-2].minor.yy392, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy600); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 167: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-4].minor.yy674, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy530); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-4].minor.yy392, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy600); } + yymsp[-4].minor.yy392 = yylhsminor.yy392; break; case 168: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-2].minor.yy674, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-2].minor.yy392, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; case 169: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-4].minor.yy674, TABLE_OPTION_SMA, yymsp[-1].minor.yy530); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-4].minor.yy392, TABLE_OPTION_SMA, yymsp[-1].minor.yy600); } + yymsp[-4].minor.yy392 = yylhsminor.yy392; break; case 170: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy674 = createAlterTableOptions(pCxt); yylhsminor.yy674 = setTableOption(pCxt, yylhsminor.yy674, yymsp[0].minor.yy557.type, &yymsp[0].minor.yy557.val); } - yymsp[0].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createAlterTableOptions(pCxt); yylhsminor.yy392 = setTableOption(pCxt, yylhsminor.yy392, yymsp[0].minor.yy221.type, &yymsp[0].minor.yy221.val); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; case 171: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-1].minor.yy674, yymsp[0].minor.yy557.type, &yymsp[0].minor.yy557.val); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-1].minor.yy392, yymsp[0].minor.yy221.type, &yymsp[0].minor.yy221.val); } + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; case 172: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy557.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy221.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy221.val = yymsp[0].minor.yy0; } break; case 173: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy221.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy221.val = yymsp[0].minor.yy0; } break; case 174: /* duration_list ::= duration_literal */ - case 319: /* expression_list ::= expression */ yytestcase(yyruleno==319); -{ yylhsminor.yy530 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy674)); } - yymsp[0].minor.yy530 = yylhsminor.yy530; + case 320: /* expression_list ::= expression */ yytestcase(yyruleno==320); +{ yylhsminor.yy600 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy392)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; case 175: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 320: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==320); -{ yylhsminor.yy530 = addNodeToList(pCxt, yymsp[-2].minor.yy530, releaseRawExprNode(pCxt, yymsp[0].minor.yy674)); } - yymsp[-2].minor.yy530 = yylhsminor.yy530; + case 321: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==321); +{ yylhsminor.yy600 = addNodeToList(pCxt, yymsp[-2].minor.yy600, releaseRawExprNode(pCxt, yymsp[0].minor.yy392)); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 178: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy674 = createFunctionNode(pCxt, &yymsp[0].minor.yy421, NULL); } - yymsp[0].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createFunctionNode(pCxt, &yymsp[0].minor.yy57, NULL); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; case 179: /* rollup_func_name ::= FIRST */ case 180: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==180); -{ yylhsminor.yy674 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; case 183: /* col_name ::= column_name */ -{ yylhsminor.yy674 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy421); } - yymsp[0].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy392 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy57); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; case 184: /* cmd ::= SHOW DNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; case 185: /* cmd ::= SHOW USERS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; case 186: /* cmd ::= SHOW DATABASES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; case 187: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy674, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy392, yymsp[0].minor.yy392, OP_TYPE_LIKE); } break; case 188: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy674, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy392, yymsp[0].minor.yy392, OP_TYPE_LIKE); } break; case 189: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy674, NULL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy392, NULL, OP_TYPE_LIKE); } break; case 190: /* cmd ::= SHOW MNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; case 191: /* cmd ::= SHOW MODULES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT); } break; case 192: /* cmd ::= SHOW QNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; case 193: /* cmd ::= SHOW FUNCTIONS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; case 194: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy674, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy392, yymsp[-1].minor.yy392, OP_TYPE_EQUAL); } break; case 195: /* cmd ::= SHOW STREAMS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; case 196: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; case 197: /* cmd ::= SHOW APPS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; case 198: /* cmd ::= SHOW CONNECTIONS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; case 199: /* cmd ::= SHOW LICENCE */ case 200: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==200); -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT); } break; case 201: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy57); } break; case 202: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy392); } break; case 203: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy392); } break; case 204: /* cmd ::= SHOW QUERIES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; case 205: /* cmd ::= SHOW SCORES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; case 206: /* cmd ::= SHOW TOPICS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; case 207: /* cmd ::= SHOW VARIABLES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLE_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLE_STMT); } break; case 208: /* cmd ::= SHOW BNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; case 209: /* cmd ::= SHOW SNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; case 210: /* cmd ::= SHOW CLUSTER */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; case 211: /* cmd ::= SHOW TRANSACTIONS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT, NULL, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 212: /* db_name_cond_opt ::= */ - case 217: /* from_db_opt ::= */ yytestcase(yyruleno==217); -{ yymsp[1].minor.yy674 = createDefaultDatabaseCondValue(pCxt); } + case 212: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy392); } break; - case 213: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy421); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + case 213: /* db_name_cond_opt ::= */ + case 218: /* from_db_opt ::= */ yytestcase(yyruleno==218); +{ yymsp[1].minor.yy392 = createDefaultDatabaseCondValue(pCxt); } break; - case 214: /* like_pattern_opt ::= */ - case 222: /* index_options ::= */ yytestcase(yyruleno==222); - case 251: /* into_opt ::= */ yytestcase(yyruleno==251); - case 407: /* where_clause_opt ::= */ yytestcase(yyruleno==407); - case 411: /* twindow_clause_opt ::= */ yytestcase(yyruleno==411); - case 416: /* sliding_opt ::= */ yytestcase(yyruleno==416); - case 418: /* fill_opt ::= */ yytestcase(yyruleno==418); - case 430: /* having_clause_opt ::= */ yytestcase(yyruleno==430); - case 440: /* slimit_clause_opt ::= */ yytestcase(yyruleno==440); - case 444: /* limit_clause_opt ::= */ yytestcase(yyruleno==444); -{ yymsp[1].minor.yy674 = NULL; } + case 214: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy57); } + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 215: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 215: /* like_pattern_opt ::= */ + case 223: /* index_options ::= */ yytestcase(yyruleno==223); + case 252: /* into_opt ::= */ yytestcase(yyruleno==252); + case 408: /* where_clause_opt ::= */ yytestcase(yyruleno==408); + case 412: /* twindow_clause_opt ::= */ yytestcase(yyruleno==412); + case 417: /* sliding_opt ::= */ yytestcase(yyruleno==417); + case 419: /* fill_opt ::= */ yytestcase(yyruleno==419); + case 431: /* having_clause_opt ::= */ yytestcase(yyruleno==431); + case 433: /* range_opt ::= */ yytestcase(yyruleno==433); + case 435: /* every_opt ::= */ yytestcase(yyruleno==435); + case 445: /* slimit_clause_opt ::= */ yytestcase(yyruleno==445); + case 449: /* limit_clause_opt ::= */ yytestcase(yyruleno==449); +{ yymsp[1].minor.yy392 = NULL; } break; - case 216: /* table_name_cond ::= table_name */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy421); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 216: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 218: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy421); } + case 217: /* table_name_cond ::= table_name */ +{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy57); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 219: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy621, &yymsp[-3].minor.yy421, &yymsp[-1].minor.yy421, NULL, yymsp[0].minor.yy674); } + case 219: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy57); } break; - case 220: /* cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy621, &yymsp[-5].minor.yy421, &yymsp[-3].minor.yy421, yymsp[-1].minor.yy530, NULL); } + case 220: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy481, &yymsp[-3].minor.yy57, &yymsp[-1].minor.yy57, NULL, yymsp[0].minor.yy392); } break; - case 221: /* cmd ::= DROP INDEX exists_opt index_name ON table_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy621, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421); } + case 221: /* cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy481, &yymsp[-5].minor.yy57, &yymsp[-3].minor.yy57, yymsp[-1].minor.yy600, NULL); } break; - case 223: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ -{ yymsp[-8].minor.yy674 = createIndexOption(pCxt, yymsp[-6].minor.yy530, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), NULL, yymsp[0].minor.yy674); } + case 222: /* cmd ::= DROP INDEX exists_opt index_name ON table_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy481, &yymsp[-2].minor.yy57, &yymsp[0].minor.yy57); } break; - case 224: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ -{ yymsp[-10].minor.yy674 = createIndexOption(pCxt, yymsp[-8].minor.yy530, releaseRawExprNode(pCxt, yymsp[-4].minor.yy674), releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), yymsp[0].minor.yy674); } + case 224: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ +{ yymsp[-8].minor.yy392 = createIndexOption(pCxt, yymsp[-6].minor.yy600, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), NULL, yymsp[0].minor.yy392); } break; - case 227: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy674 = createFunctionNode(pCxt, &yymsp[-3].minor.yy421, yymsp[-1].minor.yy530); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; + case 225: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ +{ yymsp[-10].minor.yy392 = createIndexOption(pCxt, yymsp[-8].minor.yy600, releaseRawExprNode(pCxt, yymsp[-4].minor.yy392), releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), yymsp[0].minor.yy392); } break; - case 228: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ -{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy621, &yymsp[-2].minor.yy421, yymsp[0].minor.yy674, NULL, NULL); } + case 228: /* func ::= function_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy392 = createFunctionNode(pCxt, &yymsp[-3].minor.yy57, yymsp[-1].minor.yy600); } + yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 229: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy621, &yymsp[-3].minor.yy421, NULL, &yymsp[0].minor.yy421, NULL); } + case 229: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy481, &yymsp[-2].minor.yy57, yymsp[0].minor.yy392, NULL, NULL); } break; - case 230: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy621, &yymsp[-3].minor.yy421, NULL, NULL, yymsp[0].minor.yy674); } + case 230: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy481, &yymsp[-3].minor.yy57, NULL, &yymsp[0].minor.yy57, NULL); } break; - case 231: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy621, &yymsp[0].minor.yy421); } + case 231: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy481, &yymsp[-3].minor.yy57, NULL, NULL, yymsp[0].minor.yy392); } break; - case 232: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy621, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421); } + case 232: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy481, &yymsp[0].minor.yy57); } break; - case 233: /* cmd ::= DESC full_table_name */ - case 234: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==234); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy674); } + case 233: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy481, &yymsp[-2].minor.yy57, &yymsp[0].minor.yy57); } break; - case 235: /* cmd ::= RESET QUERY CACHE */ + case 234: /* cmd ::= DESC full_table_name */ + case 235: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==235); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy392); } + break; + case 236: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 236: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy621, yymsp[-1].minor.yy674, yymsp[0].minor.yy674); } + case 237: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */ +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy481, yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } break; - case 238: /* analyze_opt ::= ANALYZE */ - case 246: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==246); - case 397: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==397); -{ yymsp[0].minor.yy621 = true; } + case 239: /* analyze_opt ::= ANALYZE */ + case 247: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==247); + case 398: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==398); +{ yymsp[0].minor.yy481 = true; } break; - case 239: /* explain_options ::= */ -{ yymsp[1].minor.yy674 = createDefaultExplainOptions(pCxt); } + case 240: /* explain_options ::= */ +{ yymsp[1].minor.yy392 = createDefaultExplainOptions(pCxt); } break; - case 240: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy674 = setExplainVerbose(pCxt, yymsp[-2].minor.yy674, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 241: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy392 = setExplainVerbose(pCxt, yymsp[-2].minor.yy392, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 241: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy674 = setExplainRatio(pCxt, yymsp[-2].minor.yy674, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 242: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy392 = setExplainRatio(pCxt, yymsp[-2].minor.yy392, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 242: /* cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */ -{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy530); } + case 243: /* cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */ +{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy600); } break; - case 243: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy621, yymsp[-8].minor.yy621, &yymsp[-5].minor.yy421, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy690, yymsp[0].minor.yy42); } + case 244: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy481, yymsp[-8].minor.yy481, &yymsp[-5].minor.yy57, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy448, yymsp[0].minor.yy228); } break; - case 244: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy621, &yymsp[0].minor.yy421); } + case 245: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy481, &yymsp[0].minor.yy57); } break; - case 247: /* bufsize_opt ::= */ -{ yymsp[1].minor.yy42 = 0; } + case 248: /* bufsize_opt ::= */ +{ yymsp[1].minor.yy228 = 0; } break; - case 248: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ -{ yymsp[-1].minor.yy42 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + case 249: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ +{ yymsp[-1].minor.yy228 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 249: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy621, &yymsp[-4].minor.yy421, yymsp[-2].minor.yy674, yymsp[-3].minor.yy674, yymsp[0].minor.yy674); } + case 250: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy481, &yymsp[-4].minor.yy57, yymsp[-2].minor.yy392, yymsp[-3].minor.yy392, yymsp[0].minor.yy392); } break; - case 250: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy621, &yymsp[0].minor.yy421); } + case 251: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy481, &yymsp[0].minor.yy57); } break; - case 252: /* into_opt ::= INTO full_table_name */ - case 378: /* from_clause ::= FROM table_reference_list */ yytestcase(yyruleno==378); - case 408: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==408); - case 431: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==431); -{ yymsp[-1].minor.yy674 = yymsp[0].minor.yy674; } + case 253: /* into_opt ::= INTO full_table_name */ + case 379: /* from_clause ::= FROM table_reference_list */ yytestcase(yyruleno==379); + case 409: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==409); + case 432: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==432); +{ yymsp[-1].minor.yy392 = yymsp[0].minor.yy392; } break; - case 253: /* stream_options ::= */ -{ yymsp[1].minor.yy674 = createStreamOptions(pCxt); } + case 254: /* stream_options ::= */ +{ yymsp[1].minor.yy392 = createStreamOptions(pCxt); } break; - case 254: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy674)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy674 = yymsp[-2].minor.yy674; } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 255: /* stream_options ::= stream_options TRIGGER AT_ONCE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy392)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy392 = yymsp[-2].minor.yy392; } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 255: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy674)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy674 = yymsp[-2].minor.yy674; } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 256: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy392)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy392 = yymsp[-2].minor.yy392; } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 256: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-3].minor.yy674)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy674)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy674); yylhsminor.yy674 = yymsp[-3].minor.yy674; } - yymsp[-3].minor.yy674 = yylhsminor.yy674; + case 257: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-3].minor.yy392)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy392)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy392); yylhsminor.yy392 = yymsp[-3].minor.yy392; } + yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 257: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy674)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy674); yylhsminor.yy674 = yymsp[-2].minor.yy674; } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 258: /* stream_options ::= stream_options WATERMARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy392)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy392); yylhsminor.yy392 = yymsp[-2].minor.yy392; } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 258: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 259: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 259: /* cmd ::= KILL QUERY NK_STRING */ + case 260: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 260: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 261: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 261: /* cmd ::= BALANCE VGROUP */ + case 262: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 262: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 263: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 263: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy530); } + case 264: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy600); } break; - case 264: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 265: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 265: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy530 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 266: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy600 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 267: /* cmd ::= SYNCDB db_name REPLICA */ -{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy421); } + case 268: /* cmd ::= SYNCDB db_name REPLICA */ +{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy57); } break; - case 268: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy674, yymsp[0].minor.yy674); } + case 269: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } break; - case 270: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 271: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 271: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 272: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 272: /* literal ::= NK_STRING */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 273: /* literal ::= NK_STRING */ +{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 273: /* literal ::= NK_BOOL */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 274: /* literal ::= NK_BOOL */ +{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 274: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + case 275: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 275: /* literal ::= duration_literal */ - case 285: /* signed_literal ::= signed */ yytestcase(yyruleno==285); - case 305: /* expression ::= literal */ yytestcase(yyruleno==305); - case 306: /* expression ::= pseudo_column */ yytestcase(yyruleno==306); - case 307: /* expression ::= column_reference */ yytestcase(yyruleno==307); - case 308: /* expression ::= function_expression */ yytestcase(yyruleno==308); - case 309: /* expression ::= subquery */ yytestcase(yyruleno==309); - case 334: /* function_expression ::= literal_func */ yytestcase(yyruleno==334); - case 370: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==370); - case 374: /* boolean_primary ::= predicate */ yytestcase(yyruleno==374); - case 376: /* common_expression ::= expression */ yytestcase(yyruleno==376); - case 377: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==377); - case 379: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==379); - case 381: /* table_reference ::= table_primary */ yytestcase(yyruleno==381); - case 382: /* table_reference ::= joined_table */ yytestcase(yyruleno==382); - case 386: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==386); - case 433: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==433); - case 436: /* query_primary ::= query_specification */ yytestcase(yyruleno==436); -{ yylhsminor.yy674 = yymsp[0].minor.yy674; } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 276: /* literal ::= duration_literal */ + case 286: /* signed_literal ::= signed */ yytestcase(yyruleno==286); + case 306: /* expression ::= literal */ yytestcase(yyruleno==306); + case 307: /* expression ::= pseudo_column */ yytestcase(yyruleno==307); + case 308: /* expression ::= column_reference */ yytestcase(yyruleno==308); + case 309: /* expression ::= function_expression */ yytestcase(yyruleno==309); + case 310: /* expression ::= subquery */ yytestcase(yyruleno==310); + case 335: /* function_expression ::= literal_func */ yytestcase(yyruleno==335); + case 371: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==371); + case 375: /* boolean_primary ::= predicate */ yytestcase(yyruleno==375); + case 377: /* common_expression ::= expression */ yytestcase(yyruleno==377); + case 378: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==378); + case 380: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==380); + case 382: /* table_reference ::= table_primary */ yytestcase(yyruleno==382); + case 383: /* table_reference ::= joined_table */ yytestcase(yyruleno==383); + case 387: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==387); + case 438: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==438); + case 441: /* query_primary ::= query_specification */ yytestcase(yyruleno==441); +{ yylhsminor.yy392 = yymsp[0].minor.yy392; } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 276: /* literal ::= NULL */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 277: /* literal ::= NULL */ +{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 277: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 278: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 278: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 279: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 279: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 280: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 280: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + case 281: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } break; - case 281: /* signed ::= NK_MINUS NK_INTEGER */ + case 282: /* signed ::= NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 282: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 283: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 283: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 284: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 284: /* signed ::= NK_MINUS NK_FLOAT */ + case 285: /* signed ::= NK_MINUS NK_FLOAT */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 286: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 287: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 287: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 288: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 288: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 289: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 289: /* signed_literal ::= duration_literal */ - case 291: /* signed_literal ::= literal_func */ yytestcase(yyruleno==291); - case 348: /* star_func_para ::= expression */ yytestcase(yyruleno==348); - case 403: /* select_item ::= common_expression */ yytestcase(yyruleno==403); - case 449: /* search_condition ::= common_expression */ yytestcase(yyruleno==449); -{ yylhsminor.yy674 = releaseRawExprNode(pCxt, yymsp[0].minor.yy674); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 290: /* signed_literal ::= duration_literal */ + case 292: /* signed_literal ::= literal_func */ yytestcase(yyruleno==292); + case 349: /* star_func_para ::= expression */ yytestcase(yyruleno==349); + case 404: /* select_item ::= common_expression */ yytestcase(yyruleno==404); + case 454: /* search_condition ::= common_expression */ yytestcase(yyruleno==454); +{ yylhsminor.yy392 = releaseRawExprNode(pCxt, yymsp[0].minor.yy392); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 290: /* signed_literal ::= NULL */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 291: /* signed_literal ::= NULL */ +{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 310: /* expression ::= NK_LP expression NK_RP */ - case 375: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==375); -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy674)); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 311: /* expression ::= NK_LP expression NK_RP */ + case 376: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==376); +{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy392)); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 311: /* expression ::= NK_PLUS expression */ + case 312: /* expression ::= NK_PLUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy674)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy392)); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 312: /* expression ::= NK_MINUS expression */ + case 313: /* expression ::= NK_MINUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy674), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy392), NULL)); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 313: /* expression ::= expression NK_PLUS expression */ + case 314: /* expression ::= expression NK_PLUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 314: /* expression ::= expression NK_MINUS expression */ + case 315: /* expression ::= expression NK_MINUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 315: /* expression ::= expression NK_STAR expression */ + case 316: /* expression ::= expression NK_STAR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 316: /* expression ::= expression NK_SLASH expression */ + case 317: /* expression ::= expression NK_SLASH expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 317: /* expression ::= expression NK_REM expression */ + case 318: /* expression ::= expression NK_REM expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 318: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 319: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 321: /* column_reference ::= column_name */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy421, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy421)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 322: /* column_reference ::= column_name */ +{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy57, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy57)); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 322: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421, createColumnNode(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421)); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 323: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy57, &yymsp[0].minor.yy57, createColumnNode(pCxt, &yymsp[-2].minor.yy57, &yymsp[0].minor.yy57)); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 323: /* pseudo_column ::= ROWTS */ - case 324: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==324); - case 326: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==326); - case 327: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==327); - case 328: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==328); - case 329: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==329); - case 330: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==330); - case 336: /* literal_func ::= NOW */ yytestcase(yyruleno==336); -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 324: /* pseudo_column ::= ROWTS */ + case 325: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==325); + case 327: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==327); + case 328: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==328); + case 329: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==329); + case 330: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==330); + case 331: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==331); + case 337: /* literal_func ::= NOW */ yytestcase(yyruleno==337); +{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 325: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy421)))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 326: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy57, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy57)))); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 331: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 332: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==332); -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy421, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy421, yymsp[-1].minor.yy530)); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; + case 332: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 333: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==333); +{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy57, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy57, yymsp[-1].minor.yy600)); } + yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 333: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy674), yymsp[-1].minor.yy690)); } - yymsp[-5].minor.yy674 = yylhsminor.yy674; + case 334: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ +{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), yymsp[-1].minor.yy448)); } + yymsp[-5].minor.yy392 = yylhsminor.yy392; break; - case 335: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy421, NULL)); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 336: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy57, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy57, NULL)); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 344: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy530 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy530 = yylhsminor.yy530; + case 345: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy600 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - case 349: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 406: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==406); -{ yylhsminor.yy674 = createColumnNode(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 350: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 407: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==407); +{ yylhsminor.yy392 = createColumnNode(pCxt, &yymsp[-2].minor.yy57, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 350: /* predicate ::= expression compare_op expression */ - case 355: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==355); + case 351: /* predicate ::= expression compare_op expression */ + case 356: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==356); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy28, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy324, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 351: /* predicate ::= expression BETWEEN expression AND expression */ + case 352: /* predicate ::= expression BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy674), releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy392); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy392), releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; + yymsp[-4].minor.yy392 = yylhsminor.yy392; break; - case 352: /* predicate ::= expression NOT BETWEEN expression AND expression */ + case 353: /* predicate ::= expression NOT BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy674), releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy392); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy392), releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } - yymsp[-5].minor.yy674 = yylhsminor.yy674; + yymsp[-5].minor.yy392 = yylhsminor.yy392; break; - case 353: /* predicate ::= expression IS NULL */ + case 354: /* predicate ::= expression IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), NULL)); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 354: /* predicate ::= expression IS NOT NULL */ + case 355: /* predicate ::= expression IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy674), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), NULL)); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; + yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 356: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy28 = OP_TYPE_LOWER_THAN; } + case 357: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy324 = OP_TYPE_LOWER_THAN; } break; - case 357: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy28 = OP_TYPE_GREATER_THAN; } + case 358: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy324 = OP_TYPE_GREATER_THAN; } break; - case 358: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy28 = OP_TYPE_LOWER_EQUAL; } + case 359: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy324 = OP_TYPE_LOWER_EQUAL; } break; - case 359: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy28 = OP_TYPE_GREATER_EQUAL; } + case 360: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy324 = OP_TYPE_GREATER_EQUAL; } break; - case 360: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy28 = OP_TYPE_NOT_EQUAL; } + case 361: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy324 = OP_TYPE_NOT_EQUAL; } break; - case 361: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy28 = OP_TYPE_EQUAL; } + case 362: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy324 = OP_TYPE_EQUAL; } break; - case 362: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy28 = OP_TYPE_LIKE; } + case 363: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy324 = OP_TYPE_LIKE; } break; - case 363: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy28 = OP_TYPE_NOT_LIKE; } + case 364: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy324 = OP_TYPE_NOT_LIKE; } break; - case 364: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy28 = OP_TYPE_MATCH; } + case 365: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy324 = OP_TYPE_MATCH; } break; - case 365: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy28 = OP_TYPE_NMATCH; } + case 366: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy324 = OP_TYPE_NMATCH; } break; - case 366: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy28 = OP_TYPE_JSON_CONTAINS; } + case 367: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy324 = OP_TYPE_JSON_CONTAINS; } break; - case 367: /* in_op ::= IN */ -{ yymsp[0].minor.yy28 = OP_TYPE_IN; } + case 368: /* in_op ::= IN */ +{ yymsp[0].minor.yy324 = OP_TYPE_IN; } break; - case 368: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy28 = OP_TYPE_NOT_IN; } + case 369: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy324 = OP_TYPE_NOT_IN; } break; - case 369: /* in_predicate_value ::= NK_LP expression_list NK_RP */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy530)); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 370: /* in_predicate_value ::= NK_LP expression_list NK_RP */ +{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy600)); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 371: /* boolean_value_expression ::= NOT boolean_primary */ + case 372: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy674), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy392), NULL)); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 372: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 373: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 373: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 374: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); + yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 380: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy674 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy674, yymsp[0].minor.yy674, NULL); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 381: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy392 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy392, yymsp[0].minor.yy392, NULL); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 383: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy674 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy421, &yymsp[0].minor.yy421); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + case 384: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy392 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy57, &yymsp[0].minor.yy57); } + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 384: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy674 = createRealTableNode(pCxt, &yymsp[-3].minor.yy421, &yymsp[-1].minor.yy421, &yymsp[0].minor.yy421); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; + case 385: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy392 = createRealTableNode(pCxt, &yymsp[-3].minor.yy57, &yymsp[-1].minor.yy57, &yymsp[0].minor.yy57); } + yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 385: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy674 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy674), &yymsp[0].minor.yy421); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + case 386: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy392 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy392), &yymsp[0].minor.yy57); } + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 387: /* alias_opt ::= */ -{ yymsp[1].minor.yy421 = nil_token; } + case 388: /* alias_opt ::= */ +{ yymsp[1].minor.yy57 = nil_token; } break; - case 388: /* alias_opt ::= table_alias */ -{ yylhsminor.yy421 = yymsp[0].minor.yy421; } - yymsp[0].minor.yy421 = yylhsminor.yy421; + case 389: /* alias_opt ::= table_alias */ +{ yylhsminor.yy57 = yymsp[0].minor.yy57; } + yymsp[0].minor.yy57 = yylhsminor.yy57; break; - case 389: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy421 = yymsp[0].minor.yy421; } + case 390: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy57 = yymsp[0].minor.yy57; } break; - case 390: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 391: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==391); -{ yymsp[-2].minor.yy674 = yymsp[-1].minor.yy674; } + case 391: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 392: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==392); +{ yymsp[-2].minor.yy392 = yymsp[-1].minor.yy392; } break; - case 392: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy674 = createJoinTableNode(pCxt, yymsp[-4].minor.yy636, yymsp[-5].minor.yy674, yymsp[-2].minor.yy674, yymsp[0].minor.yy674); } - yymsp[-5].minor.yy674 = yylhsminor.yy674; + case 393: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy392 = createJoinTableNode(pCxt, yymsp[-4].minor.yy204, yymsp[-5].minor.yy392, yymsp[-2].minor.yy392, yymsp[0].minor.yy392); } + yymsp[-5].minor.yy392 = yylhsminor.yy392; break; - case 393: /* join_type ::= */ -{ yymsp[1].minor.yy636 = JOIN_TYPE_INNER; } + case 394: /* join_type ::= */ +{ yymsp[1].minor.yy204 = JOIN_TYPE_INNER; } break; - case 394: /* join_type ::= INNER */ -{ yymsp[0].minor.yy636 = JOIN_TYPE_INNER; } + case 395: /* join_type ::= INNER */ +{ yymsp[0].minor.yy204 = JOIN_TYPE_INNER; } break; - case 395: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 396: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-8].minor.yy674 = createSelectStmt(pCxt, yymsp[-7].minor.yy621, yymsp[-6].minor.yy530, yymsp[-5].minor.yy674); - yymsp[-8].minor.yy674 = addWhereClause(pCxt, yymsp[-8].minor.yy674, yymsp[-4].minor.yy674); - yymsp[-8].minor.yy674 = addPartitionByClause(pCxt, yymsp[-8].minor.yy674, yymsp[-3].minor.yy530); - yymsp[-8].minor.yy674 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy674, yymsp[-2].minor.yy674); - yymsp[-8].minor.yy674 = addGroupByClause(pCxt, yymsp[-8].minor.yy674, yymsp[-1].minor.yy530); - yymsp[-8].minor.yy674 = addHavingClause(pCxt, yymsp[-8].minor.yy674, yymsp[0].minor.yy674); + yymsp[-11].minor.yy392 = createSelectStmt(pCxt, yymsp[-10].minor.yy481, yymsp[-9].minor.yy600, yymsp[-8].minor.yy392); + yymsp[-11].minor.yy392 = addWhereClause(pCxt, yymsp[-11].minor.yy392, yymsp[-7].minor.yy392); + yymsp[-11].minor.yy392 = addPartitionByClause(pCxt, yymsp[-11].minor.yy392, yymsp[-6].minor.yy600); + yymsp[-11].minor.yy392 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy392, yymsp[-2].minor.yy392); + yymsp[-11].minor.yy392 = addGroupByClause(pCxt, yymsp[-11].minor.yy392, yymsp[-1].minor.yy600); + yymsp[-11].minor.yy392 = addHavingClause(pCxt, yymsp[-11].minor.yy392, yymsp[0].minor.yy392); + yymsp[-11].minor.yy392 = addRangeClause(pCxt, yymsp[-11].minor.yy392, yymsp[-5].minor.yy392); + yymsp[-11].minor.yy392 = addEveryClause(pCxt, yymsp[-11].minor.yy392, yymsp[-4].minor.yy392); + yymsp[-11].minor.yy392 = addFillClause(pCxt, yymsp[-11].minor.yy392, yymsp[-3].minor.yy392); } break; - case 398: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy621 = false; } + case 399: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy481 = false; } break; - case 399: /* select_list ::= NK_STAR */ -{ yymsp[0].minor.yy530 = NULL; } + case 400: /* select_list ::= NK_STAR */ +{ yymsp[0].minor.yy600 = NULL; } break; - case 404: /* select_item ::= common_expression column_alias */ -{ yylhsminor.yy674 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy674), &yymsp[0].minor.yy421); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + case 405: /* select_item ::= common_expression column_alias */ +{ yylhsminor.yy392 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy392), &yymsp[0].minor.yy57); } + yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 405: /* select_item ::= common_expression AS column_alias */ -{ yylhsminor.yy674 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), &yymsp[0].minor.yy421); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 406: /* select_item ::= common_expression AS column_alias */ +{ yylhsminor.yy392 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), &yymsp[0].minor.yy57); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 410: /* partition_by_clause_opt ::= PARTITION BY expression_list */ - case 427: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==427); - case 439: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==439); -{ yymsp[-2].minor.yy530 = yymsp[0].minor.yy530; } + case 411: /* partition_by_clause_opt ::= PARTITION BY expression_list */ + case 428: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==428); + case 444: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==444); +{ yymsp[-2].minor.yy600 = yymsp[0].minor.yy600; } break; - case 412: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy674 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy674), releaseRawExprNode(pCxt, yymsp[-1].minor.yy674)); } + case 413: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy392 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), releaseRawExprNode(pCxt, yymsp[-1].minor.yy392)); } break; - case 413: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ -{ yymsp[-3].minor.yy674 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy674)); } + case 414: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ +{ yymsp[-3].minor.yy392 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy392)); } break; - case 414: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy674 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy674), NULL, yymsp[-1].minor.yy674, yymsp[0].minor.yy674); } + case 415: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy392 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), NULL, yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } break; - case 415: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy674 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy674), releaseRawExprNode(pCxt, yymsp[-3].minor.yy674), yymsp[-1].minor.yy674, yymsp[0].minor.yy674); } + case 416: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy392 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy392), releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } break; - case 417: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ -{ yymsp[-3].minor.yy674 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy674); } + case 418: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + case 436: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==436); +{ yymsp[-3].minor.yy392 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy392); } break; - case 419: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy674 = createFillNode(pCxt, yymsp[-1].minor.yy320, NULL); } + case 420: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy392 = createFillNode(pCxt, yymsp[-1].minor.yy270, NULL); } break; - case 420: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy674 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy530)); } + case 421: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy392 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy600)); } break; - case 421: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy320 = FILL_MODE_NONE; } + case 422: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy270 = FILL_MODE_NONE; } break; - case 422: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy320 = FILL_MODE_PREV; } + case 423: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy270 = FILL_MODE_PREV; } break; - case 423: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy320 = FILL_MODE_NULL; } + case 424: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy270 = FILL_MODE_NULL; } break; - case 424: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy320 = FILL_MODE_LINEAR; } + case 425: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy270 = FILL_MODE_LINEAR; } break; - case 425: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy320 = FILL_MODE_NEXT; } + case 426: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy270 = FILL_MODE_NEXT; } break; - case 428: /* group_by_list ::= expression */ -{ yylhsminor.yy530 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); } - yymsp[0].minor.yy530 = yylhsminor.yy530; + case 429: /* group_by_list ::= expression */ +{ yylhsminor.yy600 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - case 429: /* group_by_list ::= group_by_list NK_COMMA expression */ -{ yylhsminor.yy530 = addNodeToList(pCxt, yymsp[-2].minor.yy530, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); } - yymsp[-2].minor.yy530 = yylhsminor.yy530; + case 430: /* group_by_list ::= group_by_list NK_COMMA expression */ +{ yylhsminor.yy600 = addNodeToList(pCxt, yymsp[-2].minor.yy600, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 432: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 434: /* range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ +{ yymsp[-5].minor.yy392 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), releaseRawExprNode(pCxt, yymsp[-1].minor.yy392)); } + break; + case 437: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy674 = addOrderByClause(pCxt, yymsp[-3].minor.yy674, yymsp[-2].minor.yy530); - yylhsminor.yy674 = addSlimitClause(pCxt, yylhsminor.yy674, yymsp[-1].minor.yy674); - yylhsminor.yy674 = addLimitClause(pCxt, yylhsminor.yy674, yymsp[0].minor.yy674); + yylhsminor.yy392 = addOrderByClause(pCxt, yymsp[-3].minor.yy392, yymsp[-2].minor.yy600); + yylhsminor.yy392 = addSlimitClause(pCxt, yylhsminor.yy392, yymsp[-1].minor.yy392); + yylhsminor.yy392 = addLimitClause(pCxt, yylhsminor.yy392, yymsp[0].minor.yy392); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; + yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 434: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ -{ yylhsminor.yy674 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy674, yymsp[0].minor.yy674); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; + case 439: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ +{ yylhsminor.yy392 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy392, yymsp[0].minor.yy392); } + yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 435: /* query_expression_body ::= query_expression_body UNION query_expression_body */ -{ yylhsminor.yy674 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy674, yymsp[0].minor.yy674); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 440: /* query_expression_body ::= query_expression_body UNION query_expression_body */ +{ yylhsminor.yy392 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy392, yymsp[0].minor.yy392); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 437: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ -{ yymsp[-5].minor.yy674 = yymsp[-4].minor.yy674; } - yy_destructor(yypParser,351,&yymsp[-3].minor); - yy_destructor(yypParser,352,&yymsp[-2].minor); - yy_destructor(yypParser,353,&yymsp[-1].minor); + case 442: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ +{ yymsp[-5].minor.yy392 = yymsp[-4].minor.yy392; } + yy_destructor(yypParser,356,&yymsp[-3].minor); + yy_destructor(yypParser,357,&yymsp[-2].minor); + yy_destructor(yypParser,358,&yymsp[-1].minor); break; - case 441: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 445: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==445); -{ yymsp[-1].minor.yy674 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 446: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 450: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==450); +{ yymsp[-1].minor.yy392 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 442: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 446: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==446); -{ yymsp[-3].minor.yy674 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 447: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 451: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==451); +{ yymsp[-3].minor.yy392 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 443: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 447: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==447); -{ yymsp[-3].minor.yy674 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 448: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 452: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==452); +{ yymsp[-3].minor.yy392 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 448: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy674); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 453: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy392); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 452: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy674 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), yymsp[-1].minor.yy610, yymsp[0].minor.yy107); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 457: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy392 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), yymsp[-1].minor.yy162, yymsp[0].minor.yy529); } + yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 453: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy610 = ORDER_ASC; } + case 458: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy162 = ORDER_ASC; } break; - case 454: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy610 = ORDER_ASC; } + case 459: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy162 = ORDER_ASC; } break; - case 455: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy610 = ORDER_DESC; } + case 460: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy162 = ORDER_DESC; } break; - case 456: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy107 = NULL_ORDER_DEFAULT; } + case 461: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy529 = NULL_ORDER_DEFAULT; } break; - case 457: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy107 = NULL_ORDER_FIRST; } + case 462: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy529 = NULL_ORDER_FIRST; } break; - case 458: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy107 = NULL_ORDER_LAST; } + case 463: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy529 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/parInitialATest.cpp b/source/libs/parser/test/parInitialATest.cpp index 3247ff352e..021348dcc7 100644 --- a/source/libs/parser/test/parInitialATest.cpp +++ b/source/libs/parser/test/parInitialATest.cpp @@ -121,10 +121,10 @@ TEST_F(ParserInitialATest, alterSTable) { int32_t len = snprintf(expect.name, sizeof(expect.name), "0.test.%s", pTbname); expect.name[len] = '\0'; expect.alterType = alterType; - expect.ttl = ttl; +// expect.ttl = ttl; if (nullptr != pComment) { expect.comment = strdup(pComment); - expect.commentLen = strlen(pComment) + 1; + expect.commentLen = strlen(pComment); } expect.numOfFields = numOfFields; @@ -180,9 +180,9 @@ TEST_F(ParserInitialATest, alterSTable) { tFreeSMAltertbReq(&req); }); - setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_UPDATE_OPTIONS, 0, nullptr, 0, 0, nullptr, nullptr, 10); - run("ALTER TABLE st1 TTL 10"); - clearAlterStbReq(); +// setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_UPDATE_OPTIONS, 0, nullptr, 0, 0, nullptr, nullptr, 10); +// run("ALTER TABLE st1 TTL 10"); +// clearAlterStbReq(); setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_UPDATE_OPTIONS, 0, nullptr, 0, 0, nullptr, "test"); run("ALTER TABLE st1 COMMENT 'test'"); @@ -289,7 +289,7 @@ TEST_F(ParserInitialATest, alterTable) { expect.newTTL = ttl; } if (nullptr != pComment) { - expect.updateComment = true; + expect.newCommentLen = strlen(pComment); expect.newComment = pComment; } }; @@ -328,9 +328,10 @@ TEST_F(ParserInitialATest, alterTable) { ASSERT_EQ(memcmp(req.pTagVal, expect.pTagVal, expect.nTagVal), 0); ASSERT_EQ(req.updateTTL, expect.updateTTL); ASSERT_EQ(req.newTTL, expect.newTTL); - ASSERT_EQ(req.updateComment, expect.updateComment); if (nullptr != expect.newComment) { ASSERT_EQ(std::string(req.newComment), std::string(expect.newComment)); + ASSERT_EQ(req.newCommentLen, strlen(req.newComment)); + ASSERT_EQ(expect.newCommentLen, strlen(expect.newComment)); } tDecoderClear(&coder); diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp index 1ab251fa48..d188744adf 100644 --- a/source/libs/parser/test/parInitialCTest.cpp +++ b/source/libs/parser/test/parInitialCTest.cpp @@ -370,10 +370,10 @@ TEST_F(ParserInitialCTest, createStable) { expect.delay2 = delay2; expect.watermark1 = watermark1; expect.watermark2 = watermark2; - expect.ttl = ttl; +// expect.ttl = ttl; if (nullptr != pComment) { expect.comment = strdup(pComment); - expect.commentLen = strlen(pComment) + 1; + expect.commentLen = strlen(pComment); } }; @@ -414,7 +414,7 @@ TEST_F(ParserInitialCTest, createStable) { ASSERT_EQ(req.ttl, expect.ttl); ASSERT_EQ(req.numOfColumns, expect.numOfColumns); ASSERT_EQ(req.numOfTags, expect.numOfTags); - ASSERT_EQ(req.commentLen, expect.commentLen); +// ASSERT_EQ(req.commentLen, expect.commentLen); ASSERT_EQ(req.ast1Len, expect.ast1Len); ASSERT_EQ(req.ast2Len, expect.ast2Len); diff --git a/source/libs/parser/test/parSelectTest.cpp b/source/libs/parser/test/parSelectTest.cpp index a69b012574..693c422ae0 100644 --- a/source/libs/parser/test/parSelectTest.cpp +++ b/source/libs/parser/test/parSelectTest.cpp @@ -256,6 +256,24 @@ TEST_F(ParserSelectTest, intervalSemanticCheck) { run("SELECT _WSTARTTS, _WENDTS, _WDURATION, sum(c1) FROM t1", TSDB_CODE_PAR_INVALID_WINDOW_PC); } +TEST_F(ParserSelectTest, interp) { + useDb("root", "test"); + + run("SELECT INTERP(c1) FROM t1"); + + run("SELECT INTERP(c1) FROM t1 RANGE('2017-7-14 18:00:00', '2017-7-14 19:00:00')"); + + run("SELECT INTERP(c1) FROM t1 RANGE('2017-7-14 18:00:00', '2017-7-14 19:00:00') FILL(LINEAR)"); + + run("SELECT INTERP(c1) FROM t1 EVERY(5s)"); + + run("SELECT INTERP(c1) FROM t1 EVERY(5s) FILL(LINEAR)"); + + run("SELECT INTERP(c1) FROM t1 RANGE('2017-7-14 18:00:00', '2017-7-14 19:00:00') EVERY(5s)"); + + run("SELECT INTERP(c1) FROM t1 RANGE('2017-7-14 18:00:00', '2017-7-14 19:00:00') EVERY(5s) FILL(LINEAR)"); +} + TEST_F(ParserSelectTest, subquery) { useDb("root", "test"); diff --git a/source/libs/planner/inc/planInt.h b/source/libs/planner/inc/planInt.h index e0728c8654..b7fba83235 100644 --- a/source/libs/planner/inc/planInt.h +++ b/source/libs/planner/inc/planInt.h @@ -23,10 +23,6 @@ extern "C" { #include "planner.h" #include "taoserror.h" -#define QUERY_POLICY_VNODE 1 -#define QUERY_POLICY_HYBRID 2 -#define QUERY_POLICY_QNODE 3 - #define planFatal(param, ...) qFatal("PLAN: " param, __VA_ARGS__) #define planError(param, ...) qError("PLAN: " param, __VA_ARGS__) #define planWarn(param, ...) qWarn("PLAN: " param, __VA_ARGS__) diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index 3cd5eeb655..b365afff02 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -91,7 +91,7 @@ static EDealRes doNameExpr(SNode* pNode, void* pContext) { return DEAL_RES_CONTINUE; } -static int32_t rewriteExprForSelect(SNodeList* pExprs, SSelectStmt* pSelect, ESqlClause clause) { +static int32_t rewriteExprsForSelect(SNodeList* pExprs, SSelectStmt* pSelect, ESqlClause clause) { nodesWalkExprs(pExprs, doNameExpr, NULL); SRewriteExprCxt cxt = {.errCode = TSDB_CODE_SUCCESS, .pExprs = pExprs}; nodesRewriteSelectStmt(pSelect, clause, doRewriteExpr, &cxt); @@ -156,7 +156,11 @@ static EScanType getScanType(SLogicPlanContext* pCxt, SNodeList* pScanPseudoCols if (NULL == pScanCols) { // select count(*) from t - return NULL == pScanPseudoCols ? SCAN_TYPE_TABLE : SCAN_TYPE_TAG; + return NULL == pScanPseudoCols + ? SCAN_TYPE_TABLE + : ((FUNCTION_TYPE_BLOCK_DIST_INFO == ((SFunctionNode*)nodesListGetNode(pScanPseudoCols, 0))->funcType) + ? SCAN_TYPE_BLOCK_INFO + : SCAN_TYPE_TAG); } if (TSDB_SYSTEM_TABLE == tableType) { @@ -262,7 +266,7 @@ static int32_t createScanLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect // rewrite the expression in subsequent clauses if (TSDB_CODE_SUCCESS == code) { - code = rewriteExprForSelect(pScan->pScanPseudoCols, pSelect, SQL_CLAUSE_FROM); + code = rewriteExprsForSelect(pScan->pScanPseudoCols, pSelect, SQL_CLAUSE_FROM); } pScan->scanType = getScanType(pCxt, pScan->pScanPseudoCols, pScan->pScanCols, pScan->tableType); @@ -421,7 +425,7 @@ static int32_t createAggLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, // rewrite the expression in subsequent clauses if (TSDB_CODE_SUCCESS == code) { - code = rewriteExprForSelect(pAgg->pGroupKeys, pSelect, SQL_CLAUSE_GROUP_BY); + code = rewriteExprsForSelect(pAgg->pGroupKeys, pSelect, SQL_CLAUSE_GROUP_BY); } if (TSDB_CODE_SUCCESS == code && pSelect->hasAggFuncs) { @@ -430,7 +434,7 @@ static int32_t createAggLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, // rewrite the expression in subsequent clauses if (TSDB_CODE_SUCCESS == code) { - code = rewriteExprForSelect(pAgg->pAggFuncs, pSelect, SQL_CLAUSE_GROUP_BY); + code = rewriteExprsForSelect(pAgg->pAggFuncs, pSelect, SQL_CLAUSE_GROUP_BY); } if (TSDB_CODE_SUCCESS == code && NULL != pSelect->pHaving) { @@ -469,14 +473,15 @@ static int32_t createIndefRowsFuncLogicNode(SLogicPlanContext* pCxt, SSelectStmt return TSDB_CODE_OUT_OF_MEMORY; } - int32_t code = nodesCollectFuncs(pSelect, SQL_CLAUSE_SELECT, fmIsVectorFunc, &pIdfRowsFunc->pVectorFuncs); + // indefinite rows functions and _select_values functions + int32_t code = nodesCollectFuncs(pSelect, SQL_CLAUSE_SELECT, fmIsVectorFunc, &pIdfRowsFunc->pFuncs); if (TSDB_CODE_SUCCESS == code) { - code = rewriteExprForSelect(pIdfRowsFunc->pVectorFuncs, pSelect, SQL_CLAUSE_SELECT); + code = rewriteExprsForSelect(pIdfRowsFunc->pFuncs, pSelect, SQL_CLAUSE_SELECT); } // set the output if (TSDB_CODE_SUCCESS == code) { - code = createColumnByRewriteExprs(pIdfRowsFunc->pVectorFuncs, &pIdfRowsFunc->node.pTargets); + code = createColumnByRewriteExprs(pIdfRowsFunc->pFuncs, &pIdfRowsFunc->node.pTargets); } if (TSDB_CODE_SUCCESS == code) { @@ -488,6 +493,45 @@ static int32_t createIndefRowsFuncLogicNode(SLogicPlanContext* pCxt, SSelectStmt return code; } +static int32_t createInterpFuncLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SLogicNode** pLogicNode) { + if (!pSelect->hasInterpFunc) { + return TSDB_CODE_SUCCESS; + } + + SInterpFuncLogicNode* pInterpFunc = (SInterpFuncLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_INTERP_FUNC); + if (NULL == pInterpFunc) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + int32_t code = nodesCollectFuncs(pSelect, SQL_CLAUSE_SELECT, fmIsInterpFunc, &pInterpFunc->pFuncs); + if (TSDB_CODE_SUCCESS == code) { + code = rewriteExprsForSelect(pInterpFunc->pFuncs, pSelect, SQL_CLAUSE_SELECT); + } + + if (TSDB_CODE_SUCCESS == code && NULL != pSelect->pRange) { + // SRangeNode* pRange = (SRangeNode*)pSelect->pRange; + // pInterpFunc->timeRange.skey = ((SValueNode*)pRange->pStart)->datum.i; + // pInterpFunc->timeRange.ekey = ((SValueNode*)pRange->pEnd)->datum.i; + } + + if (TSDB_CODE_SUCCESS == code && NULL != pSelect->pEvery) { + pInterpFunc->interval = ((SValueNode*)pSelect->pEvery)->datum.i; + } + + // set the output + if (TSDB_CODE_SUCCESS == code) { + code = createColumnByRewriteExprs(pInterpFunc->pFuncs, &pInterpFunc->node.pTargets); + } + + if (TSDB_CODE_SUCCESS == code) { + *pLogicNode = (SLogicNode*)pInterpFunc; + } else { + nodesDestroyNode((SNode*)pInterpFunc); + } + + return code; +} + static int32_t createWindowLogicNodeFinalize(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SWindowLogicNode* pWindow, SLogicNode** pLogicNode) { int32_t code = nodesCollectFuncs(pSelect, SQL_CLAUSE_WINDOW, fmIsWindowClauseFunc, &pWindow->pFuncs); @@ -502,7 +546,7 @@ static int32_t createWindowLogicNodeFinalize(SLogicPlanContext* pCxt, SSelectStm } if (TSDB_CODE_SUCCESS == code) { - code = rewriteExprForSelect(pWindow->pFuncs, pSelect, SQL_CLAUSE_WINDOW); + code = rewriteExprsForSelect(pWindow->pFuncs, pSelect, SQL_CLAUSE_WINDOW); } if (TSDB_CODE_SUCCESS == code) { @@ -555,6 +599,7 @@ static int32_t createWindowLogicNodeBySession(SLogicPlanContext* pCxt, SSessionW nodesDestroyNode((SNode*)pWindow); return TSDB_CODE_OUT_OF_MEMORY; } + pWindow->pTsEnd = nodesCloneNode((SNode*)pSession->pCol); return createWindowLogicNodeFinalize(pCxt, pSelect, pWindow, pLogicNode); } @@ -773,7 +818,7 @@ static int32_t createDistinctLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSe // rewrite the expression in subsequent clauses if (TSDB_CODE_SUCCESS == code) { - code = rewriteExprForSelect(pAgg->pGroupKeys, pSelect, SQL_CLAUSE_DISTINCT); + code = rewriteExprsForSelect(pAgg->pGroupKeys, pSelect, SQL_CLAUSE_DISTINCT); } // set the output @@ -808,6 +853,9 @@ static int32_t createSelectLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSele if (TSDB_CODE_SUCCESS == code) { code = createSelectRootLogicNode(pCxt, pSelect, createIndefRowsFuncLogicNode, &pRoot); } + if (TSDB_CODE_SUCCESS == code) { + code = createSelectRootLogicNode(pCxt, pSelect, createInterpFuncLogicNode, &pRoot); + } if (TSDB_CODE_SUCCESS == code) { code = createSelectRootLogicNode(pCxt, pSelect, createDistinctLogicNode, &pRoot); } diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 656976b3ca..70a8aca8bd 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -450,34 +450,37 @@ static void vgroupInfoToNodeAddr(const SVgroupInfo* vg, SQueryNodeAddr* pNodeAdd pNodeAddr->epSet = vg->epSet; } -static int32_t createTagScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan, SScanLogicNode* pScanLogicNode, - SPhysiNode** pPhyNode) { - STagScanPhysiNode* pTagScan = - (STagScanPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pScanLogicNode, QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN); - if (NULL == pTagScan) { - return TSDB_CODE_OUT_OF_MEMORY; - } - vgroupInfoToNodeAddr(pScanLogicNode->pVgroupList->vgroups, &pSubplan->execNode); - SQueryNodeLoad node = {.addr = pSubplan->execNode, .load = 0}; - taosArrayPush(pCxt->pExecNodeList, &node); - return createScanPhysiNodeFinalize(pCxt, pSubplan, pScanLogicNode, (SScanPhysiNode*)pTagScan, pPhyNode); -} - static ENodeType getScanOperatorType(EScanType scanType) { switch (scanType) { + case SCAN_TYPE_TAG: + return QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN; case SCAN_TYPE_TABLE: return QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN; case SCAN_TYPE_STREAM: return QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN; case SCAN_TYPE_TABLE_MERGE: - // return QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN; return QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN; + case SCAN_TYPE_BLOCK_INFO: + return QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN; default: break; } return QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN; } +static int32_t createSimpleScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan, SScanLogicNode* pScanLogicNode, + SPhysiNode** pPhyNode) { + SScanPhysiNode* pScan = + (SScanPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pScanLogicNode, getScanOperatorType(pScanLogicNode->scanType)); + if (NULL == pScan) { + return TSDB_CODE_OUT_OF_MEMORY; + } + vgroupInfoToNodeAddr(pScanLogicNode->pVgroupList->vgroups, &pSubplan->execNode); + SQueryNodeLoad node = {.addr = pSubplan->execNode, .load = 0}; + taosArrayPush(pCxt->pExecNodeList, &node); + return createScanPhysiNodeFinalize(pCxt, pSubplan, pScanLogicNode, pScan, pPhyNode); +} + static int32_t createTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan, SScanLogicNode* pScanLogicNode, SPhysiNode** pPhyNode) { STableScanPhysiNode* pTableScan = (STableScanPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pScanLogicNode, @@ -493,10 +496,6 @@ static int32_t createTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubp vgroupInfoToNodeAddr(pScanLogicNode->pVgroupList->vgroups, &pSubplan->execNode); pSubplan->execNodeStat.tableNum = pScanLogicNode->pVgroupList->vgroups[0].numOfTable; } - if (pCxt->pExecNodeList) { - SQueryNodeLoad node = {.addr = pSubplan->execNode, .load = 0}; - taosArrayPush(pCxt->pExecNodeList, &node); - } tNameGetFullDbName(&pScanLogicNode->tableName, pSubplan->dbFName); pTableScan->dataRequired = pScanLogicNode->dataRequired; pTableScan->pDynamicScanFuncs = nodesCloneList(pScanLogicNode->pDynamicScanFuncs); @@ -532,12 +531,9 @@ static int32_t createSystemTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* if (0 == strcmp(pScanLogicNode->tableName.tname, TSDB_INS_TABLE_USER_TABLES) || 0 == strcmp(pScanLogicNode->tableName.tname, TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED)) { vgroupInfoToNodeAddr(pScanLogicNode->pVgroupList->vgroups, &pSubplan->execNode); - SQueryNodeLoad node = {.addr = pSubplan->execNode, .load = 0}; - taosArrayPush(pCxt->pExecNodeList, &node); - } else { - SQueryNodeLoad node = {.addr = {.nodeId = MNODE_HANDLE, .epSet = pCxt->pPlanCxt->mgmtEpSet}, .load = 0}; - taosArrayPush(pCxt->pExecNodeList, &node); } + SQueryNodeLoad node = {.addr = {.nodeId = MNODE_HANDLE, .epSet = pCxt->pPlanCxt->mgmtEpSet}, .load = 0}; + taosArrayPush(pCxt->pExecNodeList, &node); pScan->mgmtEpSet = pCxt->pPlanCxt->mgmtEpSet; tNameGetFullDbName(&pScanLogicNode->tableName, pSubplan->dbFName); @@ -558,7 +554,8 @@ static int32_t createScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan, SPhysiNode** pPhyNode) { switch (pScanLogicNode->scanType) { case SCAN_TYPE_TAG: - return createTagScanPhysiNode(pCxt, pSubplan, pScanLogicNode, pPhyNode); + case SCAN_TYPE_BLOCK_INFO: + return createSimpleScanPhysiNode(pCxt, pSubplan, pScanLogicNode, pPhyNode); case SCAN_TYPE_TABLE: return createTableScanPhysiNode(pCxt, pSubplan, pScanLogicNode, pPhyNode); case SCAN_TYPE_SYSTEM_TABLE: @@ -821,8 +818,8 @@ static int32_t createIndefRowsFuncPhysiNode(SPhysiPlanContext* pCxt, SNodeList* } SNodeList* pPrecalcExprs = NULL; - SNodeList* pVectorFuncs = NULL; - int32_t code = rewritePrecalcExprs(pCxt, pFuncLogicNode->pVectorFuncs, &pPrecalcExprs, &pVectorFuncs); + SNodeList* pFuncs = NULL; + int32_t code = rewritePrecalcExprs(pCxt, pFuncLogicNode->pFuncs, &pPrecalcExprs, &pFuncs); SDataBlockDescNode* pChildTupe = (((SPhysiNode*)nodesListGetNode(pChildren, 0))->pOutputDataBlockDesc); // push down expression to pOutputDataBlockDesc of child node @@ -833,10 +830,10 @@ static int32_t createIndefRowsFuncPhysiNode(SPhysiPlanContext* pCxt, SNodeList* } } - if (TSDB_CODE_SUCCESS == code && NULL != pVectorFuncs) { - code = setListSlotId(pCxt, pChildTupe->dataBlockId, -1, pVectorFuncs, &pIdfRowsFunc->pVectorFuncs); + if (TSDB_CODE_SUCCESS == code) { + code = setListSlotId(pCxt, pChildTupe->dataBlockId, -1, pFuncs, &pIdfRowsFunc->pFuncs); if (TSDB_CODE_SUCCESS == code) { - code = addDataBlockSlots(pCxt, pIdfRowsFunc->pVectorFuncs, pIdfRowsFunc->node.pOutputDataBlockDesc); + code = addDataBlockSlots(pCxt, pIdfRowsFunc->pFuncs, pIdfRowsFunc->node.pOutputDataBlockDesc); } } @@ -849,6 +846,48 @@ static int32_t createIndefRowsFuncPhysiNode(SPhysiPlanContext* pCxt, SNodeList* return code; } +static int32_t createInterpFuncPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, + SInterpFuncLogicNode* pFuncLogicNode, SPhysiNode** pPhyNode) { + SInterpFuncPhysiNode* pInterpFunc = + (SInterpFuncPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pFuncLogicNode, QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC); + if (NULL == pInterpFunc) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + SNodeList* pPrecalcExprs = NULL; + SNodeList* pFuncs = NULL; + int32_t code = rewritePrecalcExprs(pCxt, pFuncLogicNode->pFuncs, &pPrecalcExprs, &pFuncs); + + SDataBlockDescNode* pChildTupe = (((SPhysiNode*)nodesListGetNode(pChildren, 0))->pOutputDataBlockDesc); + // push down expression to pOutputDataBlockDesc of child node + if (TSDB_CODE_SUCCESS == code && NULL != pPrecalcExprs) { + code = setListSlotId(pCxt, pChildTupe->dataBlockId, -1, pPrecalcExprs, &pInterpFunc->pExprs); + if (TSDB_CODE_SUCCESS == code) { + code = pushdownDataBlockSlots(pCxt, pInterpFunc->pExprs, pChildTupe); + } + } + + if (TSDB_CODE_SUCCESS == code) { + code = setListSlotId(pCxt, pChildTupe->dataBlockId, -1, pFuncs, &pInterpFunc->pFuncs); + if (TSDB_CODE_SUCCESS == code) { + code = addDataBlockSlots(pCxt, pInterpFunc->pFuncs, pInterpFunc->node.pOutputDataBlockDesc); + } + } + + if (TSDB_CODE_SUCCESS == code) { + pInterpFunc->timeRange = pFuncLogicNode->timeRange; + pInterpFunc->interval = pFuncLogicNode->interval; + } + + if (TSDB_CODE_SUCCESS == code) { + *pPhyNode = (SPhysiNode*)pInterpFunc; + } else { + nodesDestroyNode((SNode*)pInterpFunc); + } + + return code; +} + static int32_t createProjectPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, SProjectLogicNode* pProjectLogicNode, SPhysiNode** pPhyNode) { SProjectPhysiNode* pProject = @@ -957,6 +996,9 @@ static int32_t createWindowPhysiNodeFinalize(SPhysiPlanContext* pCxt, SNodeList* if (TSDB_CODE_SUCCESS == code) { code = setNodeSlotId(pCxt, pChildTupe->dataBlockId, -1, pWindowLogicNode->pTspk, &pWindow->pTspk); } + if (TSDB_CODE_SUCCESS == code && pWindowLogicNode->pTsEnd) { + code = setNodeSlotId(pCxt, pChildTupe->dataBlockId, -1, pWindowLogicNode->pTsEnd, &pWindow->pTsEnd); + } if (TSDB_CODE_SUCCESS == code && NULL != pFuncs) { code = setListSlotId(pCxt, pChildTupe->dataBlockId, -1, pFuncs, &pWindow->pFuncs); @@ -1291,6 +1333,8 @@ static int32_t doCreatePhysiNode(SPhysiPlanContext* pCxt, SLogicNode* pLogicNode return createFillPhysiNode(pCxt, pChildren, (SFillLogicNode*)pLogicNode, pPhyNode); case QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC: return createIndefRowsFuncPhysiNode(pCxt, pChildren, (SIndefRowsFuncLogicNode*)pLogicNode, pPhyNode); + case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: + return createInterpFuncPhysiNode(pCxt, pChildren, (SInterpFuncLogicNode*)pLogicNode, pPhyNode); case QUERY_NODE_LOGIC_PLAN_MERGE: return createMergePhysiNode(pCxt, (SMergeLogicNode*)pLogicNode, pPhyNode); default: @@ -1381,8 +1425,6 @@ static SSubplan* makeSubplan(SPhysiPlanContext* pCxt, SLogicSubplan* pLogicSubpl static int32_t buildInsertSubplan(SPhysiPlanContext* pCxt, SVnodeModifyLogicNode* pModify, SSubplan* pSubplan) { pSubplan->msgType = pModify->msgType; pSubplan->execNode.epSet = pModify->pVgDataBlocks->vg.epSet; - SQueryNodeLoad node = {.addr = pSubplan->execNode, .load = 0}; - taosArrayPush(pCxt->pExecNodeList, &node); return createDataInserter(pCxt, pModify->pVgDataBlocks, &pSubplan->pDataSink); } diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index fe02dd6425..390d665760 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -176,7 +176,7 @@ static bool stbSplNeedSplit(bool streamQuery, SLogicNode* pNode) { return !stbSplHasGatherExecFunc(((SAggLogicNode*)pNode)->pAggFuncs) && stbSplHasMultiTbScan(streamQuery, pNode); case QUERY_NODE_LOGIC_PLAN_WINDOW: { SWindowLogicNode* pWindow = (SWindowLogicNode*)pNode; - if (WINDOW_TYPE_INTERVAL != pWindow->winType) { + if (WINDOW_TYPE_STATE == pWindow->winType || (!streamQuery && WINDOW_TYPE_SESSION == pWindow->winType) ) { return false; } return !stbSplHasGatherExecFunc(pWindow->pFuncs) && stbSplHasMultiTbScan(streamQuery, pNode); @@ -257,6 +257,34 @@ static int32_t stbSplAppendWStart(SNodeList* pFuncs, int32_t* pIndex) { return code; } +static int32_t stbSplAppendWEnd(SWindowLogicNode* pWin, int32_t* pIndex) { + int32_t index = 0; + SNode* pFunc = NULL; + FOREACH(pFunc, pWin->pFuncs) { + if (FUNCTION_TYPE_WENDTS == ((SFunctionNode*)pFunc)->funcType) { + *pIndex = index; + return TSDB_CODE_SUCCESS; + } + ++index; + } + + SFunctionNode* pWEnd = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); + if (NULL == pWEnd) { + return TSDB_CODE_OUT_OF_MEMORY; + } + strcpy(pWEnd->functionName, "_wendts"); + snprintf(pWEnd->node.aliasName, sizeof(pWEnd->node.aliasName), "%s.%p", pWEnd->functionName, pWEnd); + int32_t code = fmGetFuncInfo(pWEnd, NULL, 0); + if (TSDB_CODE_SUCCESS == code) { + code = nodesListStrictAppend(pWin->pFuncs, (SNode*)pWEnd); + } + *pIndex = index; + if (TSDB_CODE_SUCCESS == code) { + code = createColumnByRewriteExpr(nodesListGetNode(pWin->pFuncs, index), &pWin->node.pTargets); + } + return code; +} + static int32_t stbSplCreatePartWindowNode(SWindowLogicNode* pMergeWindow, SLogicNode** pPartWindow) { SNodeList* pFunc = pMergeWindow->pFuncs; pMergeWindow->pFuncs = NULL; @@ -425,8 +453,18 @@ static int32_t stbSplSplitSessionForStream(SSplitContext* pCxt, SStableSplitInfo SLogicNode* pPartWindow = NULL; int32_t code = stbSplCreatePartWindowNode((SWindowLogicNode*)pInfo->pSplitNode, &pPartWindow); if (TSDB_CODE_SUCCESS == code) { - ((SWindowLogicNode*)pPartWindow)->windowAlgo = SESSION_ALGO_STREAM_SEMI; - ((SWindowLogicNode*)pInfo->pSplitNode)->windowAlgo = SESSION_ALGO_STREAM_FINAL; + SWindowLogicNode* pPartWin = (SWindowLogicNode*)pPartWindow; + SWindowLogicNode* pMergeWin = (SWindowLogicNode*)pInfo->pSplitNode; + pPartWin->windowAlgo = SESSION_ALGO_STREAM_SEMI; + pMergeWin->windowAlgo = SESSION_ALGO_STREAM_FINAL; + int32_t index = 0; + int32_t code = stbSplAppendWEnd(pPartWin, &index); + if (TSDB_CODE_SUCCESS == code) { + pMergeWin->pTsEnd = nodesCloneNode(nodesListGetNode(pPartWin->node.pTargets, index)); + if (NULL == pMergeWin->pTsEnd) { + code = TSDB_CODE_OUT_OF_MEMORY; + } + } code = stbSplCreateExchangeNode(pCxt, pInfo->pSplitNode, pPartWindow); } if (TSDB_CODE_SUCCESS == code) { diff --git a/source/libs/planner/test/planBasicTest.cpp b/source/libs/planner/test/planBasicTest.cpp index c075bfeee8..f74c7df355 100644 --- a/source/libs/planner/test/planBasicTest.cpp +++ b/source/libs/planner/test/planBasicTest.cpp @@ -52,6 +52,8 @@ TEST_F(PlanBasicTest, func) { run("SELECT PERCENTILE(c1, 60) FROM t1"); run("SELECT TOP(c1, 60) FROM t1"); + + run("SELECT TOP(c1, 60) FROM st1"); } TEST_F(PlanBasicTest, uniqueFunc) { @@ -73,3 +75,11 @@ TEST_F(PlanBasicTest, tailFunc) { run("SELECT TAIL(c2 + 10, 10, 80) FROM t1 WHERE c1 > 10"); } + +TEST_F(PlanBasicTest, interpFunc) { + useDb("root", "test"); + + run("SELECT INTERP(c1) FROM t1"); + + run("SELECT INTERP(c1) FROM t1 RANGE('2017-7-14 18:00:00', '2017-7-14 19:00:00') EVERY(5s) FILL(LINEAR)"); +} diff --git a/source/libs/planner/test/planOtherTest.cpp b/source/libs/planner/test/planOtherTest.cpp index f9feb8d1fe..0f2540924c 100644 --- a/source/libs/planner/test/planOtherTest.cpp +++ b/source/libs/planner/test/planOtherTest.cpp @@ -70,6 +70,10 @@ TEST_F(PlanOtherTest, show) { useDb("root", "test"); run("SHOW DATABASES"); + + run("SHOW TABLE DISTRIBUTED t1"); + + run("SHOW TABLE DISTRIBUTED st1"); } TEST_F(PlanOtherTest, delete) { diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c index 679a244f31..72809e1f93 100644 --- a/source/libs/scheduler/src/schJob.c +++ b/source/libs/scheduler/src/schJob.c @@ -652,7 +652,7 @@ int32_t schSetAddrsFromNodeList(SSchJob *pJob, SSchTask *pTask) { if (addNum <= 0) { SCH_TASK_ELOG("no available execNode as candidates, nodeNum:%d", nodeNum); - SCH_ERR_RET(TSDB_CODE_QRY_INVALID_INPUT); + SCH_ERR_RET(TSDB_CODE_TSC_NO_EXEC_NODE); } return TSDB_CODE_SUCCESS; @@ -677,7 +677,7 @@ int32_t schSetTaskCandidateAddrs(SSchJob *pJob, SSchTask *pTask) { SCH_ERR_RET(TSDB_CODE_QRY_OUT_OF_MEMORY); } - SCH_TASK_DLOG("use execNode from plan as candidate addr, numOfEps:%d", pTask->plan->execNode.epSet.numOfEps); + SCH_TASK_DLOG("use execNode in plan as candidate addr, numOfEps:%d", pTask->plan->execNode.epSet.numOfEps); return TSDB_CODE_SUCCESS; } diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 15a67adf77..7fb3ba4ac0 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -841,15 +841,6 @@ void syncNodeStart(SSyncNode* pSyncNode) { syncNodeBecomeLeader(pSyncNode, "one replica start"); // Raft 3.6.2 Committing entries from previous terms - - // use this now - syncNodeAppendNoop(pSyncNode); - syncMaybeAdvanceCommitIndex(pSyncNode); // maybe only one replica - - if (gRaftDetailLog) { - syncNodeLog2("==state change become leader immediately==", pSyncNode); - } - return; } @@ -1390,7 +1381,7 @@ void syncNodeUpdateConfig(SSyncNode* pSyncNode, SSyncCfg* pNewConfig, SyncIndex syncUtilU642Addr((pSyncNode->replicasId)[i].addr, host, sizeof(host), &port); do { - char eventLog[128]; + char eventLog[256]; snprintf(eventLog, sizeof(eventLog), "snapshot sender reset for %lu, newIndex:%d, %s:%d, %p", (pSyncNode->replicasId)[i].addr, i, host, port, oldSenders[j]); syncNodeEventLog(pSyncNode, eventLog); @@ -1405,7 +1396,7 @@ void syncNodeUpdateConfig(SSyncNode* pSyncNode, SSyncCfg* pNewConfig, SyncIndex (pSyncNode->senders)[i]->replicaIndex = i; do { - char eventLog[128]; + char eventLog[256]; snprintf(eventLog, sizeof(eventLog), "snapshot sender udpate replicaIndex from %d to %d, %s:%d, %p, reset:%d", oldreplicaIndex, i, host, port, (pSyncNode->senders)[i], reset); syncNodeEventLog(pSyncNode, eventLog); @@ -1583,6 +1574,10 @@ void syncNodeBecomeLeader(SSyncNode* pSyncNode, const char* debugStr) { // start heartbeat timer syncNodeStartHeartbeatTimer(pSyncNode); + // append noop + syncNodeAppendNoop(pSyncNode); + syncMaybeAdvanceCommitIndex(pSyncNode); // maybe only one replica + // trace log do { int32_t debugStrLen = strlen(debugStr); @@ -1608,10 +1603,6 @@ void syncNodeCandidate2Leader(SSyncNode* pSyncNode) { // Raft 3.6.2 Committing entries from previous terms - // use this now - syncNodeAppendNoop(pSyncNode); - syncMaybeAdvanceCommitIndex(pSyncNode); // maybe only one replica - // do not use this // syncNodeEqNoop(pSyncNode); } diff --git a/source/libs/tdb/inc/tdb.h b/source/libs/tdb/inc/tdb.h index 5912fd800c..628bf6d7aa 100644 --- a/source/libs/tdb/inc/tdb.h +++ b/source/libs/tdb/inc/tdb.h @@ -58,6 +58,7 @@ int32_t tdbTbcMoveToPrev(TBC *pTbc); int32_t tdbTbcGet(TBC *pTbc, const void **ppKey, int *pkLen, const void **ppVal, int *pvLen); int32_t tdbTbcDelete(TBC *pTbc); int32_t tdbTbcNext(TBC *pTbc, void **ppKey, int *kLen, void **ppVal, int *vLen); +int32_t tdbTbcPrev(TBC *pTbc, void **ppKey, int *kLen, void **ppVal, int *vLen); int32_t tdbTbcUpsert(TBC *pTbc, const void *pKey, int nKey, const void *pData, int nData, int insert); // TXN diff --git a/source/libs/tdb/src/db/tdbBtree.c b/source/libs/tdb/src/db/tdbBtree.c index fffda68731..9368706378 100644 --- a/source/libs/tdb/src/db/tdbBtree.c +++ b/source/libs/tdb/src/db/tdbBtree.c @@ -1245,6 +1245,52 @@ int tdbBtreeNext(SBTC *pBtc, void **ppKey, int *kLen, void **ppVal, int *vLen) { return 0; } +int tdbBtreePrev(SBTC *pBtc, void **ppKey, int *kLen, void **ppVal, int *vLen) { + SCell *pCell; + SCellDecoder cd; + void *pKey, *pVal; + int ret; + + // current cursor points to an invalid position + if (pBtc->idx < 0) { + return -1; + } + + pCell = tdbPageGetCell(pBtc->pPage, pBtc->idx); + + tdbBtreeDecodeCell(pBtc->pPage, pCell, &cd); + + pKey = tdbRealloc(*ppKey, cd.kLen); + if (pKey == NULL) { + return -1; + } + + *ppKey = pKey; + *kLen = cd.kLen; + memcpy(pKey, cd.pKey, cd.kLen); + + if (ppVal) { + // TODO: vLen may be zero + pVal = tdbRealloc(*ppVal, cd.vLen); + if (pVal == NULL) { + tdbFree(pKey); + return -1; + } + + *ppVal = pVal; + *vLen = cd.vLen; + memcpy(pVal, cd.pVal, cd.vLen); + } + + ret = tdbBtcMoveToPrev(pBtc); + if (ret < 0) { + ASSERT(0); + return -1; + } + + return 0; +} + int tdbBtcMoveToNext(SBTC *pBtc) { int nCells; int ret; diff --git a/source/libs/tdb/src/db/tdbTable.c b/source/libs/tdb/src/db/tdbTable.c index 239aa5d7ef..1575f9f206 100644 --- a/source/libs/tdb/src/db/tdbTable.c +++ b/source/libs/tdb/src/db/tdbTable.c @@ -132,6 +132,10 @@ int tdbTbcNext(TBC *pTbc, void **ppKey, int *kLen, void **ppVal, int *vLen) { return tdbBtreeNext(&pTbc->btc, ppKey, kLen, ppVal, vLen); } +int tdbTbcPrev(TBC *pTbc, void **ppKey, int *kLen, void **ppVal, int *vLen) { + return tdbBtreePrev(&pTbc->btc, ppKey, kLen, ppVal, vLen); +} + int tdbTbcUpsert(TBC *pTbc, const void *pKey, int nKey, const void *pData, int nData, int insert) { return tdbBtcUpsert(&pTbc->btc, pKey, nKey, pData, nData, insert); } diff --git a/source/libs/tdb/src/inc/tdbInt.h b/source/libs/tdb/src/inc/tdbInt.h index 6524e3c9bc..71e009cabf 100644 --- a/source/libs/tdb/src/inc/tdbInt.h +++ b/source/libs/tdb/src/inc/tdbInt.h @@ -156,6 +156,7 @@ int tdbBtcMoveToLast(SBTC *pBtc); int tdbBtcMoveToNext(SBTC *pBtc); int tdbBtcMoveToPrev(SBTC *pBtc); int tdbBtreeNext(SBTC *pBtc, void **ppKey, int *kLen, void **ppVal, int *vLen); +int tdbBtreePrev(SBTC *pBtc, void **ppKey, int *kLen, void **ppVal, int *vLen); int tdbBtcGet(SBTC *pBtc, const void **ppKey, int *kLen, const void **ppVal, int *vLen); int tdbBtcDelete(SBTC *pBtc); int tdbBtcUpsert(SBTC *pBtc, const void *pKey, int kLen, const void *pData, int nData, int insert); diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 7976cb09af..7f949e5b27 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -133,6 +133,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TSC_STMT_API_ERROR, "Stmt API usage error" TAOS_DEFINE_ERROR(TSDB_CODE_TSC_STMT_TBNAME_ERROR, "Stmt table name not set") TAOS_DEFINE_ERROR(TSDB_CODE_TSC_STMT_CLAUSE_ERROR, "not supported stmt clause") TAOS_DEFINE_ERROR(TSDB_CODE_TSC_QUERY_KILLED, "Query killed") +TAOS_DEFINE_ERROR(TSDB_CODE_TSC_NO_EXEC_NODE, "No available execution node") // mnode-common TAOS_DEFINE_ERROR(TSDB_CODE_MND_APP_ERROR, "Mnode internal error") diff --git a/tests/script/tsim/stable/alter_comment.sim b/tests/script/tsim/stable/alter_comment.sim index cfcbb9a1da..19f4858585 100644 --- a/tests/script/tsim/stable/alter_comment.sim +++ b/tests/script/tsim/stable/alter_comment.sim @@ -159,7 +159,7 @@ sql alter table db.stb rename tag t1 tx print ========== alter common sql alter table db.stb comment 'abcde' ; -sql alter table db.stb ttl 10 ; +sql_error alter table db.stb ttl 10 ; sql show db.stables; if $data[0][6] != abcde then diff --git a/tests/script/tsim/stream/session0.sim b/tests/script/tsim/stream/session0.sim index 2a737578bc..24ffe76d2b 100644 --- a/tests/script/tsim/stream/session0.sim +++ b/tests/script/tsim/stream/session0.sim @@ -231,9 +231,10 @@ sql use test3; sql create table t1(ts timestamp, a int, b int , c int, d double); sql create stream streams3 trigger at_once watermark 1d into streamt3 as select _wstartts, min(b), a,c from t1 session(ts,10s); sql create stream streams4 trigger at_once watermark 1d into streamt4 as select _wstartts, max(b), a,c from t1 session(ts,10s); -sql create stream streams5 trigger at_once watermark 1d into streamt5 as select _wstartts, top(b,3), a,c from t1 session(ts,10s); -sql create stream streams6 trigger at_once watermark 1d into streamt6 as select _wstartts, bottom(b,3), a,c from t1 session(ts,10s); -sql create stream streams7 trigger at_once watermark 1d into streamt7 as select _wstartts, spread(a), elapsed(ts), hyperloglog(a) from t1 session(ts,10s); +# sql create stream streams5 trigger at_once watermark 1d into streamt5 as select _wstartts, top(b,3), a,c from t1 session(ts,10s); +# sql create stream streams6 trigger at_once watermark 1d into streamt6 as select _wstartts, bottom(b,3), a,c from t1 session(ts,10s); +# sql create stream streams7 trigger at_once watermark 1d into streamt7 as select _wstartts, spread(a), elapsed(ts), hyperloglog(a) from t1 session(ts,10s); +sql create stream streams7 trigger at_once watermark 1d into streamt7 as select _wstartts, spread(a), hyperloglog(a) from t1 session(ts,10s); sql create stream streams8 trigger at_once watermark 1d into streamt8 as select _wstartts, histogram(a,"user_input", "[1,3,5,7]", 1), histogram(a,"user_input", "[1,3,5,7]", 0) from t1 session(ts,10s); sql insert into t1 values(1648791213001,1,1,1,1.0); sql insert into t1 values(1648791213002,2,3,2,3.4); @@ -269,13 +270,13 @@ if $rows == 0 then goto loop3 endi -sql select * from streamt5; +#sql select * from streamt5; if $rows == 0 then print ======$rows - goto loop3 + # goto loop3 endi -sql select * from streamt6; +# sql select * from streamt6; if $rows == 0 then print ======$rows goto loop3 diff --git a/tests/script/tsim/stream/triggerSession0.sim b/tests/script/tsim/stream/triggerSession0.sim index 69b3dc1704..48827a64a2 100644 --- a/tests/script/tsim/stream/triggerSession0.sim +++ b/tests/script/tsim/stream/triggerSession0.sim @@ -85,7 +85,7 @@ sql insert into t2 values(1648791243003,1,2,3,1.0) (1648791243002,1,2,3,1.0) (16 sleep 500 sql select * from streamt2; if $rows != 3 then - print ======$rows + print =====rows=$rows return -1 endi diff --git a/tests/system-test/2-query/ttl_comment.py b/tests/system-test/2-query/ttl_comment.py new file mode 100644 index 0000000000..8fc582c587 --- /dev/null +++ b/tests/system-test/2-query/ttl_comment.py @@ -0,0 +1,206 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, db_test.stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import sys +import taos +from util.log import tdLog +from util.cases import tdCases +from util.sql import tdSql + +class TDTestCase: + def caseDescription(self): + ''' + ttl/comment test + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + tdSql.prepare() + + tdSql.error("create table ttl_table1(ts timestamp, i int) ttl 1.1") + tdSql.error("create table ttl_table2(ts timestamp, i int) ttl 1e1") + tdSql.error("create table ttl_table3(ts timestamp, i int) ttl -1") + + print("============== STEP 1 ===== test normal table") + + tdSql.execute("create table normal_table1(ts timestamp, i int)") + tdSql.execute("create table normal_table2(ts timestamp, i int) comment '' ttl 3") + tdSql.execute("create table normal_table3(ts timestamp, i int) ttl 2100000000020 comment 'hello'") + + tdSql.query("show tables like 'normal_table1'") + tdSql.checkData(0, 0, 'normal_table1') + tdSql.checkData(0, 7, 0) + tdSql.checkData(0, 8, None) + + + tdSql.query("show tables like 'normal_table2'") + tdSql.checkData(0, 0, 'normal_table2') + tdSql.checkData(0, 7, 3) + tdSql.checkData(0, 8, '') + + + tdSql.query("show tables like 'normal_table3'") + tdSql.checkData(0, 0, 'normal_table3') + tdSql.checkData(0, 7, 2147483647) + tdSql.checkData(0, 8, 'hello') + + tdSql.execute("alter table normal_table1 comment 'nihao'") + tdSql.query("show tables like 'normal_table1'") + tdSql.checkData(0, 0, 'normal_table1') + tdSql.checkData(0, 8, 'nihao') + + tdSql.execute("alter table normal_table1 comment ''") + tdSql.query("show tables like 'normal_table1'") + tdSql.checkData(0, 0, 'normal_table1') + tdSql.checkData(0, 8, '') + + tdSql.execute("alter table normal_table2 comment 'fly'") + tdSql.query("show tables like 'normal_table2'") + tdSql.checkData(0, 0, 'normal_table2') + tdSql.checkData(0, 8, 'fly') + + tdSql.execute("alter table normal_table3 comment 'fly'") + tdSql.query("show tables like 'normal_table3'") + tdSql.checkData(0, 0, 'normal_table3') + tdSql.checkData(0, 8, 'fly') + + tdSql.execute("alter table normal_table1 ttl 1") + tdSql.query("show tables like 'normal_table1'") + tdSql.checkData(0, 0, 'normal_table1') + tdSql.checkData(0, 7, 1) + + tdSql.execute("alter table normal_table3 ttl 0") + tdSql.query("show tables like 'normal_table3'") + tdSql.checkData(0, 0, 'normal_table3') + tdSql.checkData(0, 7, 0) + + + print("============== STEP 2 ===== test super table") + + tdSql.execute("create table super_table1(ts timestamp, i int) tags(t int)") + tdSql.execute("create table super_table2(ts timestamp, i int) tags(t int) comment ''") + tdSql.execute("create table super_table3(ts timestamp, i int) tags(t int) comment 'super'") + + tdSql.query("show stables like 'super_table1'") + tdSql.checkData(0, 0, 'super_table1') + tdSql.checkData(0, 6, None) + + + tdSql.query("show stables like 'super_table2'") + tdSql.checkData(0, 0, 'super_table2') + tdSql.checkData(0, 6, '') + + + tdSql.query("show stables like 'super_table3'") + tdSql.checkData(0, 0, 'super_table3') + tdSql.checkData(0, 6, 'super') + + + tdSql.execute("alter table super_table1 comment 'nihao'") + tdSql.query("show stables like 'super_table1'") + tdSql.checkData(0, 0, 'super_table1') + tdSql.checkData(0, 6, 'nihao') + + tdSql.execute("alter table super_table1 comment ''") + tdSql.query("show stables like 'super_table1'") + tdSql.checkData(0, 0, 'super_table1') + tdSql.checkData(0, 6, '') + + tdSql.execute("alter table super_table2 comment 'fly'") + tdSql.query("show stables like 'super_table2'") + tdSql.checkData(0, 0, 'super_table2') + tdSql.checkData(0, 6, 'fly') + + tdSql.execute("alter table super_table3 comment 'tdengine'") + tdSql.query("show stables like 'super_table3'") + tdSql.checkData(0, 0, 'super_table3') + tdSql.checkData(0, 6, 'tdengine') + + print("============== STEP 3 ===== test child table") + + tdSql.execute("create table child_table1 using super_table1 tags(1) ttl 10") + tdSql.execute("create table child_table2 using super_table1 tags(1) comment ''") + tdSql.execute("create table child_table3 using super_table1 tags(1) comment 'child'") + tdSql.execute("insert into child_table4 using super_table1 tags(1) values(now, 1)") + + + tdSql.query("show tables like 'child_table1'") + tdSql.checkData(0, 0, 'child_table1') + tdSql.checkData(0, 7, 10) + tdSql.checkData(0, 8, None) + + + tdSql.query("show tables like 'child_table2'") + tdSql.checkData(0, 0, 'child_table2') + tdSql.checkData(0, 7, 0) + tdSql.checkData(0, 8, '') + + + tdSql.query("show tables like 'child_table3'") + tdSql.checkData(0, 0, 'child_table3') + tdSql.checkData(0, 8, 'child') + + tdSql.query("show tables like 'child_table4'") + tdSql.checkData(0, 0, 'child_table4') + tdSql.checkData(0, 7, 0) + tdSql.checkData(0, 8, None) + + + tdSql.execute("alter table child_table1 comment 'nihao'") + tdSql.query("show tables like 'child_table1'") + tdSql.checkData(0, 0, 'child_table1') + tdSql.checkData(0, 8, 'nihao') + + tdSql.execute("alter table child_table1 comment ''") + tdSql.query("show tables like 'child_table1'") + tdSql.checkData(0, 0, 'child_table1') + tdSql.checkData(0, 8, '') + + tdSql.execute("alter table child_table2 comment 'fly'") + tdSql.query("show tables like 'child_table2'") + tdSql.checkData(0, 0, 'child_table2') + tdSql.checkData(0, 8, 'fly') + + tdSql.execute("alter table child_table3 comment 'tdengine'") + tdSql.query("show tables like 'child_table3'") + tdSql.checkData(0, 0, 'child_table3') + tdSql.checkData(0, 8, 'tdengine') + + + tdSql.execute("alter table child_table4 comment 'tdengine'") + tdSql.query("show tables like 'child_table4'") + tdSql.checkData(0, 0, 'child_table4') + tdSql.checkData(0, 8, 'tdengine') + + tdSql.execute("alter table child_table4 ttl 9") + tdSql.query("show tables like 'child_table4'") + tdSql.checkData(0, 0, 'child_table4') + tdSql.checkData(0, 7, 9) + + tdSql.execute("alter table child_table3 ttl 9") + tdSql.query("show tables like 'child_table3'") + tdSql.checkData(0, 0, 'child_table3') + tdSql.checkData(0, 7, 9) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) + diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index b5004d41ce..41004cc5a2 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -98,6 +98,7 @@ python3 ./test.py -f 2-query/stateduration.py python3 ./test.py -f 2-query/function_stateduration.py python3 ./test.py -f 2-query/statecount.py python3 ./test.py -f 2-query/tail.py +python3 ./test.py -f 2-query/ttl_comment.py python3 ./test.py -f 2-query/distribute_agg_count.py python3 ./test.py -f 2-query/distribute_agg_max.py python3 ./test.py -f 2-query/distribute_agg_min.py