diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index d2217f7e010713b8dd48e1a7befa8dfe4d4e5ddd..1d7bd091755232eefd3c12779079033647a4635b 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -163,6 +163,8 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_SORT, QUERY_NODE_PHYSICAL_PLAN_INTERVAL, QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW, + QUERY_NODE_PHYSICAL_PLAN_STATE_WINDOW, + QUERY_NODE_PHYSICAL_PLAN_PARTITION, QUERY_NODE_PHYSICAL_PLAN_DISPATCH, QUERY_NODE_PHYSICAL_PLAN_INSERT, QUERY_NODE_PHYSICAL_SUBPLAN, diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 37163f60ddea165075ebf6615bba46993d3d7342..9f8cddfd54cd7f060f161a0dcc11fad6711d26e9 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -104,6 +104,7 @@ typedef struct SWindowLogicNode { SFillNode* pFill; int64_t sessionGap; SNode* pTspk; + SNode* pStateExpr; } SWindowLogicNode; typedef struct SSortLogicNode { @@ -194,11 +195,20 @@ typedef struct SSystemTableScanPhysiNode { int32_t accountId; } SSystemTableScanPhysiNode; +typedef enum EScanRequired { + SCAN_REQUIRED_DATA_NO_NEEDED = 1, + SCAN_REQUIRED_DATA_STATIS_NEEDED, + SCAN_REQUIRED_DATA_ALL_NEEDED, + SCAN_REQUIRED_DATA_DISCARD, +} EScanRequired; + typedef struct STableScanPhysiNode { SScanPhysiNode scan; uint8_t scanFlag; // denotes reversed scan of data or not STimeWindow scanRange; double ratio; + EScanRequired scanRequired; + SNodeList* pScanReferFuncs; } STableScanPhysiNode; typedef STableScanPhysiNode STableSeqScanPhysiNode; @@ -257,17 +267,33 @@ typedef struct SIntervalPhysiNode { SFillNode* pFill; } SIntervalPhysiNode; +typedef struct SMultiTableIntervalPhysiNode { + SIntervalPhysiNode interval; + SNodeList* pPartitionKeys; +} SMultiTableIntervalPhysiNode; + typedef struct SSessionWinodwPhysiNode { SWinodwPhysiNode window; int64_t gap; } SSessionWinodwPhysiNode; +typedef struct SStateWinodwPhysiNode { + SWinodwPhysiNode window; + SNode* pStateKey; +} SStateWinodwPhysiNode; + typedef struct SSortPhysiNode { SPhysiNode node; SNodeList* pExprs; // these are expression list of order_by_clause and parameter expression of aggregate function SNodeList* pSortKeys; // element is SOrderByExprNode, and SOrderByExprNode::pExpr is SColumnNode } SSortPhysiNode; +typedef struct SPartitionPhysiNode { + SPhysiNode node; + SNodeList* pExprs; // these are expression list of partition_by_clause + SNodeList* pPartitionKeys; +} SPartitionPhysiNode; + typedef struct SDataSinkNode { ENodeType type; SDataBlockDescNode* pInputDataBlockDesc; diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index a8ff48072f665c0a3e5f4d88fa56b00b81a9a8e3..82d05853c4623b13181f49e4abea65be9057b17b 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -188,7 +188,7 @@ typedef struct SLimitNode { typedef struct SStateWindowNode { ENodeType type; // QUERY_NODE_STATE_WINDOW - SNode* pCol; + SNode* pExpr; } SStateWindowNode; typedef struct SSessionWindowNode { diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 4e2cb7944a7a155aa1d3aa07c8dfbc6148234c17..e7f440e26f18c54b651f9e683d4b99577b3c1a34 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -483,6 +483,9 @@ int32_t* taosGetErrno(); #define TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME TAOS_DEF_ERROR_CODE(0, 0x2617) #define TSDB_CODE_PAR_CORRESPONDING_STABLE_ERR TAOS_DEF_ERROR_CODE(0, 0x2618) +//planner +#define TSDB_CODE_PLAN_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x2700) + #ifdef __cplusplus } #endif diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index ac78988900ac8bb5bf380174b3eb17788aaa324a..12fe645473efd051c372631a9e100096a453cf42 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -283,6 +283,12 @@ static SNode* logicSortCopy(const SSortLogicNode* pSrc, SSortLogicNode* pDst) { return (SNode*)pDst; } +static SNode* logicPartitionCopy(const SPartitionLogicNode* pSrc, SPartitionLogicNode* pDst) { + COPY_BASE_OBJECT_FIELD(node, logicNodeCopy); + CLONE_NODE_LIST_FIELD(pPartitionKeys); + return (SNode*)pDst; +} + static SNode* logicSubplanCopy(const SLogicSubplan* pSrc, SLogicSubplan* pDst) { CLONE_NODE_FIELD(pNode); COPY_SCALAR_FIELD(subplanType); @@ -367,6 +373,8 @@ SNodeptr nodesCloneNode(const SNodeptr pNode) { return logicWindowCopy((const SWindowLogicNode*)pNode, (SWindowLogicNode*)pDst); case QUERY_NODE_LOGIC_PLAN_SORT: return logicSortCopy((const SSortLogicNode*)pNode, (SSortLogicNode*)pDst); + case QUERY_NODE_LOGIC_PLAN_PARTITION: + return logicPartitionCopy((const SPartitionLogicNode*)pNode, (SPartitionLogicNode*)pDst); case QUERY_NODE_LOGIC_SUBPLAN: return logicSubplanCopy((const SLogicSubplan*)pNode, (SLogicSubplan*)pDst); default: diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 1b16ba92068179e0edb0221834f22a98da3f4bdb..6cb1955307a24571cc6a74d91cf08e58da9be447 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -198,6 +198,10 @@ const char* nodesNodeName(ENodeType type) { return "PhysiInterval"; case QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW: return "PhysiSessionWindow"; + case QUERY_NODE_PHYSICAL_PLAN_STATE_WINDOW: + return "PhysiStateWindow"; + case QUERY_NODE_PHYSICAL_PLAN_PARTITION: + return "PhysiPartition"; case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: return "PhysiDispatch"; case QUERY_NODE_PHYSICAL_PLAN_INSERT: @@ -1147,6 +1151,61 @@ static int32_t jsonToPhysiSessionWindowNode(const SJson* pJson, void* pObj) { return code; } +static const char* jkStateWindowPhysiPlanStateKey = "StateKey"; + +static int32_t physiStateWindowNodeToJson(const void* pObj, SJson* pJson) { + const SStateWinodwPhysiNode* pNode = (const SStateWinodwPhysiNode*)pObj; + + int32_t code = physiWindowNodeToJson(pObj, pJson); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkStateWindowPhysiPlanStateKey, nodeToJson, pNode->pStateKey); + } + + return code; +} + +static int32_t jsonToPhysiStateWindowNode(const SJson* pJson, void* pObj) { + SStateWinodwPhysiNode* pNode = (SStateWinodwPhysiNode*)pObj; + + int32_t code = jsonToPhysiWindowNode(pJson, pObj); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkStateWindowPhysiPlanStateKey, &pNode->pStateKey); + } + + return code; +} + +static const char* jkPartitionPhysiPlanExprs = "Exprs"; +static const char* jkPartitionPhysiPlanPartitionKeys = "PartitionKeys"; + +static int32_t physiPartitionNodeToJson(const void* pObj, SJson* pJson) { + const SPartitionPhysiNode* pNode = (const SPartitionPhysiNode*)pObj; + + int32_t code = physicPlanNodeToJson(pObj, pJson); + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkPartitionPhysiPlanExprs, pNode->pExprs); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkPartitionPhysiPlanPartitionKeys, pNode->pPartitionKeys); + } + + return code; +} + +static int32_t jsonToPhysiPartitionNode(const SJson* pJson, void* pObj) { + SPartitionPhysiNode* pNode = (SPartitionPhysiNode*)pObj; + + int32_t code = jsonToPhysicPlanNode(pJson, pObj); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkPartitionPhysiPlanExprs, &pNode->pExprs); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkPartitionPhysiPlanPartitionKeys, &pNode->pPartitionKeys); + } + + return code; +} + static const char* jkDataSinkInputDataBlockDesc = "InputDataBlockDesc"; static int32_t physicDataSinkNodeToJson(const void* pObj, SJson* pJson) { @@ -2420,6 +2479,10 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return physiIntervalNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW: return physiSessionWindowNodeToJson(pObj, pJson); + case QUERY_NODE_PHYSICAL_PLAN_STATE_WINDOW: + return physiStateWindowNodeToJson(pObj, pJson); + case QUERY_NODE_PHYSICAL_PLAN_PARTITION: + return physiPartitionNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: return physiDispatchNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_INSERT: @@ -2512,6 +2575,10 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToPhysiIntervalNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW: return jsonToPhysiSessionWindowNode(pJson, pObj); + case QUERY_NODE_PHYSICAL_PLAN_STATE_WINDOW: + return jsonToPhysiStateWindowNode(pJson, pObj); + case QUERY_NODE_PHYSICAL_PLAN_PARTITION: + return jsonToPhysiPartitionNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: return jsonToPhysiDispatchNode(pJson, pObj); case QUERY_NODE_PHYSICAL_SUBPLAN: diff --git a/source/libs/nodes/src/nodesTraverseFuncs.c b/source/libs/nodes/src/nodesTraverseFuncs.c index 15c078d8d2fe5d158768ca2377f2cadf32feaff3..e59a76ca3c7709bb883701c404c30b9faeec9266 100644 --- a/source/libs/nodes/src/nodesTraverseFuncs.c +++ b/source/libs/nodes/src/nodesTraverseFuncs.c @@ -78,7 +78,7 @@ static EDealRes walkNode(SNode* pNode, ETraversalOrder order, FNodeWalker walker res = walkNode(((SOrderByExprNode*)pNode)->pExpr, order, walker, pContext); break; case QUERY_NODE_STATE_WINDOW: - res = walkNode(((SStateWindowNode*)pNode)->pCol, order, walker, pContext); + res = walkNode(((SStateWindowNode*)pNode)->pExpr, order, walker, pContext); break; case QUERY_NODE_SESSION_WINDOW: { SSessionWindowNode* pSession = (SSessionWindowNode*)pNode; @@ -212,7 +212,7 @@ static EDealRes rewriteNode(SNode** pRawNode, ETraversalOrder order, FNodeRewrit res = rewriteNode(&(((SOrderByExprNode*)pNode)->pExpr), order, rewriter, pContext); break; case QUERY_NODE_STATE_WINDOW: - res = rewriteNode(&(((SStateWindowNode*)pNode)->pCol), order, rewriter, pContext); + res = rewriteNode(&(((SStateWindowNode*)pNode)->pExpr), order, rewriter, pContext); break; case QUERY_NODE_SESSION_WINDOW: res = rewriteNode(&(((SSessionWindowNode*)pNode)->pCol), order, rewriter, pContext); @@ -301,10 +301,9 @@ void nodesWalkSelectStmt(SSelectStmt* pSelect, ESqlClause clause, FNodeWalker wa case SQL_CLAUSE_GROUP_BY: nodesWalkExpr(pSelect->pHaving, walker, pContext); case SQL_CLAUSE_HAVING: - nodesWalkExprs(pSelect->pOrderByList, walker, pContext); - case SQL_CLAUSE_ORDER_BY: nodesWalkExprs(pSelect->pProjectionList, walker, pContext); case SQL_CLAUSE_SELECT: + nodesWalkExprs(pSelect->pOrderByList, walker, pContext); default: break; } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 90f06c6c9c4eb58cb1f27cd6398f16ad75b6ab72..9bb603e479d1a6de8ce3cbdcd949c48ec10fbbeb 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -169,6 +169,8 @@ SNodeptr nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SWindowLogicNode)); case QUERY_NODE_LOGIC_PLAN_SORT: return makeNode(type, sizeof(SSortLogicNode)); + case QUERY_NODE_LOGIC_PLAN_PARTITION: + return makeNode(type, sizeof(SPartitionLogicNode)); case QUERY_NODE_LOGIC_SUBPLAN: return makeNode(type, sizeof(SLogicSubplan)); case QUERY_NODE_LOGIC_PLAN: @@ -197,6 +199,10 @@ SNodeptr nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SIntervalPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW: return makeNode(type, sizeof(SSessionWinodwPhysiNode)); + case QUERY_NODE_PHYSICAL_PLAN_STATE_WINDOW: + return makeNode(type, sizeof(SStateWinodwPhysiNode)); + case QUERY_NODE_PHYSICAL_PLAN_PARTITION: + return makeNode(type, sizeof(SPartitionPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: return makeNode(type, sizeof(SDataDispatcherNode)); case QUERY_NODE_PHYSICAL_PLAN_INSERT: @@ -302,7 +308,7 @@ void nodesDestroyNode(SNodeptr pNode) { case QUERY_NODE_LIMIT: // no pointer field break; case QUERY_NODE_STATE_WINDOW: - nodesDestroyNode(((SStateWindowNode*)pNode)->pCol); + nodesDestroyNode(((SStateWindowNode*)pNode)->pExpr); break; case QUERY_NODE_SESSION_WINDOW: { SSessionWindowNode* pSession = (SSessionWindowNode*)pNode; diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 1fce11acdfc0bf22bf4c217631590f0c0780dd3b..2fe325f1c5201031d1e7fffd8ae2f1616fa9eff7 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -103,7 +103,7 @@ SNode* createJoinTableNode(SAstCreateContext* pCxt, EJoinType type, SNode* pLeft SNode* createLimitNode(SAstCreateContext* pCxt, const SToken* pLimit, const SToken* pOffset); SNode* createOrderByExprNode(SAstCreateContext* pCxt, SNode* pExpr, EOrder order, ENullOrder nullOrder); SNode* createSessionWindowNode(SAstCreateContext* pCxt, SNode* pCol, SNode* pGap); -SNode* createStateWindowNode(SAstCreateContext* pCxt, SNode* pCol); +SNode* createStateWindowNode(SAstCreateContext* pCxt, SNode* pExpr); SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode* pOffset, SNode* pSliding, SNode* pFill); SNode* createFillNode(SAstCreateContext* pCxt, EFillMode mode, SNode* pValues); SNode* createGroupingSetNode(SAstCreateContext* pCxt, SNode* pNode); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 4ae33e5c5cfa5d0e8a42a2ee542bed2689b123dc..c30a75aa66d971286fc4622ad5135b117c47f0e7 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -716,7 +716,7 @@ partition_by_clause_opt(A) ::= PARTITION BY expression_list(B). twindow_clause_opt(A) ::= . { A = NULL; } twindow_clause_opt(A) ::= SESSION NK_LP column_reference(B) NK_COMMA duration_literal(C) NK_RP. { A = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, B), releaseRawExprNode(pCxt, C)); } -twindow_clause_opt(A) ::= STATE_WINDOW NK_LP column_reference(B) NK_RP. { A = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, B)); } +twindow_clause_opt(A) ::= STATE_WINDOW NK_LP expression(B) NK_RP. { A = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, B)); } twindow_clause_opt(A) ::= INTERVAL NK_LP duration_literal(B) NK_RP sliding_opt(C) fill_opt(D). { A = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, B), NULL, C, D); } twindow_clause_opt(A) ::= diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 07316ddd39e631037228ccf6ca02f3da1e0e6c34..ebcecfe3cb7b5caff6d35252aa567d97397461ed 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -730,10 +730,10 @@ SNode* createSessionWindowNode(SAstCreateContext* pCxt, SNode* pCol, SNode* pGap return (SNode*)session; } -SNode* createStateWindowNode(SAstCreateContext* pCxt, SNode* pCol) { +SNode* createStateWindowNode(SAstCreateContext* pCxt, SNode* pExpr) { SStateWindowNode* state = (SStateWindowNode*)nodesMakeNode(QUERY_NODE_STATE_WINDOW); CHECK_OUT_OF_MEM(state); - state->pCol = pCol; + state->pExpr = pExpr; return (SNode*)state; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 86e564adab9dc983d049269e83409136fd3cd045..30c85e28fe757b2b36b6bb916c1c08efb6300129 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -209,153 +209,155 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (1448) +#define YY_ACTTAB_COUNT (1461) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 1250, 441, 441, 265, 441, 1246, 1413, 72, 304, 306, - /* 10 */ 72, 111, 30, 28, 348, 409, 252, 354, 20, 1263, - /* 20 */ 261, 1153, 990, 1261, 1261, 269, 1261, 1429, 31, 29, - /* 30 */ 27, 26, 25, 1399, 412, 441, 233, 98, 988, 117, - /* 40 */ 409, 305, 1399, 1014, 427, 1395, 1401, 11, 1386, 1429, - /* 50 */ 1301, 30, 28, 1094, 1395, 1401, 425, 1261, 799, 261, + /* 0 */ 1250, 441, 441, 266, 441, 1246, 1413, 72, 305, 307, + /* 10 */ 72, 111, 31, 29, 349, 409, 253, 355, 21, 1263, + /* 20 */ 262, 1153, 990, 1261, 1261, 270, 1261, 1429, 32, 30, + /* 30 */ 28, 27, 26, 1399, 412, 441, 234, 98, 988, 117, + /* 40 */ 409, 306, 1399, 1014, 427, 1395, 1401, 11, 1386, 1429, + /* 50 */ 1301, 31, 29, 1094, 1395, 1401, 425, 1261, 799, 262, /* 60 */ 798, 990, 98, 409, 69, 1414, 1415, 1418, 1462, 1, - /* 70 */ 96, 276, 254, 1458, 120, 1413, 1308, 988, 800, 411, - /* 80 */ 121, 1469, 1470, 1308, 1474, 98, 11, 1340, 399, 251, - /* 90 */ 30, 28, 507, 1490, 1306, 96, 1429, 1252, 261, 325, + /* 70 */ 96, 277, 255, 1458, 120, 1413, 1308, 988, 800, 411, + /* 80 */ 121, 1469, 1470, 1308, 1474, 98, 11, 1340, 402, 252, + /* 90 */ 31, 29, 507, 1490, 1306, 96, 1429, 1252, 262, 326, /* 100 */ 990, 440, 1523, 425, 989, 122, 1469, 1470, 1, 1474, - /* 110 */ 22, 24, 191, 427, 1399, 125, 988, 1386, 96, 1521, - /* 120 */ 31, 29, 27, 26, 25, 11, 1395, 1402, 123, 1469, + /* 110 */ 23, 25, 191, 427, 1399, 125, 988, 1386, 96, 1521, + /* 120 */ 32, 30, 28, 27, 26, 11, 1395, 1402, 123, 1469, /* 130 */ 1470, 507, 1474, 70, 1414, 1415, 1418, 1462, 991, 1386, - /* 140 */ 440, 1461, 1458, 989, 135, 134, 1413, 1, 31, 29, - /* 150 */ 27, 26, 25, 186, 65, 994, 995, 1038, 1039, 1040, - /* 160 */ 1041, 1042, 1043, 1044, 1045, 99, 232, 1429, 1010, 1406, - /* 170 */ 507, 299, 1253, 298, 425, 318, 126, 991, 330, 1010, - /* 180 */ 428, 1404, 989, 264, 427, 1429, 1348, 331, 1386, 12, - /* 190 */ 1413, 398, 425, 131, 994, 995, 1038, 1039, 1040, 1041, + /* 140 */ 440, 1461, 1458, 989, 135, 134, 1413, 1, 32, 30, + /* 150 */ 28, 27, 26, 186, 65, 994, 995, 1038, 1039, 1040, + /* 160 */ 1041, 1042, 1043, 1044, 1045, 99, 233, 1429, 1010, 1406, + /* 170 */ 507, 300, 1253, 299, 425, 319, 126, 991, 331, 1010, + /* 180 */ 428, 1404, 989, 265, 427, 273, 1348, 332, 1386, 12, + /* 190 */ 1413, 126, 1339, 1341, 994, 995, 1038, 1039, 1040, 1041, /* 200 */ 1042, 1043, 1044, 1045, 69, 1414, 1415, 1418, 1462, 441, - /* 210 */ 126, 1429, 254, 1458, 1535, 311, 991, 47, 425, 1308, - /* 220 */ 46, 441, 1336, 1496, 402, 266, 440, 312, 427, 133, + /* 210 */ 126, 1429, 255, 1458, 1535, 312, 991, 1239, 425, 1308, + /* 220 */ 159, 441, 1336, 1496, 352, 267, 440, 313, 427, 133, /* 230 */ 1306, 1261, 1386, 994, 995, 1038, 1039, 1040, 1041, 1042, - /* 240 */ 1043, 1044, 1045, 1261, 404, 400, 30, 28, 70, 1414, - /* 250 */ 1415, 1418, 1462, 64, 261, 329, 990, 1459, 324, 323, - /* 260 */ 322, 321, 320, 60, 317, 316, 315, 314, 310, 309, - /* 270 */ 308, 307, 988, 84, 1118, 12, 83, 82, 81, 80, - /* 280 */ 79, 78, 77, 76, 75, 30, 28, 426, 1156, 361, - /* 290 */ 111, 356, 300, 261, 360, 990, 126, 160, 1264, 357, - /* 300 */ 355, 126, 358, 7, 395, 1116, 1117, 1119, 1120, 84, - /* 310 */ 6, 988, 83, 82, 81, 80, 79, 78, 77, 76, - /* 320 */ 75, 441, 1308, 1523, 30, 28, 507, 338, 273, 503, - /* 330 */ 502, 441, 261, 1306, 990, 126, 125, 1258, 989, 114, - /* 340 */ 1521, 1225, 7, 1261, 272, 31, 29, 27, 26, 25, - /* 350 */ 988, 1339, 1341, 1261, 874, 464, 463, 462, 878, 461, + /* 240 */ 1043, 1044, 1045, 1261, 1237, 354, 31, 29, 70, 1414, + /* 250 */ 1415, 1418, 1462, 340, 262, 330, 990, 1459, 325, 324, + /* 260 */ 323, 322, 321, 340, 318, 317, 316, 315, 311, 310, + /* 270 */ 309, 308, 988, 84, 1118, 12, 83, 82, 81, 80, + /* 280 */ 79, 78, 77, 76, 75, 31, 29, 426, 1156, 362, + /* 290 */ 476, 357, 301, 262, 361, 990, 126, 160, 213, 358, + /* 300 */ 356, 1291, 359, 7, 396, 1116, 1117, 1119, 1120, 84, + /* 310 */ 1178, 988, 83, 82, 81, 80, 79, 78, 77, 76, + /* 320 */ 75, 441, 1308, 1523, 31, 29, 507, 339, 274, 399, + /* 330 */ 476, 441, 262, 1306, 990, 126, 125, 1258, 989, 114, + /* 340 */ 1521, 1225, 7, 1261, 1012, 32, 30, 28, 27, 26, + /* 350 */ 988, 131, 1386, 1261, 874, 464, 463, 462, 878, 461, /* 360 */ 880, 881, 460, 883, 457, 507, 889, 454, 891, 892, - /* 370 */ 451, 448, 991, 27, 26, 25, 113, 989, 1167, 213, - /* 380 */ 1413, 7, 1291, 1375, 31, 29, 27, 26, 25, 994, + /* 370 */ 451, 448, 991, 1177, 113, 48, 1167, 989, 47, 403, + /* 380 */ 1413, 7, 404, 400, 32, 30, 28, 27, 26, 994, /* 390 */ 995, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 441, - /* 400 */ 1523, 1429, 1201, 1026, 507, 438, 339, 384, 425, 1239, - /* 410 */ 126, 991, 1178, 1522, 428, 1012, 989, 1521, 427, 283, - /* 420 */ 1349, 1261, 1386, 31, 29, 27, 26, 25, 994, 995, + /* 400 */ 1523, 1429, 1201, 1108, 507, 438, 111, 385, 425, 1013, + /* 410 */ 126, 991, 1176, 1522, 1264, 1386, 989, 1521, 427, 503, + /* 420 */ 502, 1261, 1386, 32, 30, 28, 27, 26, 994, 995, /* 430 */ 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 115, 1414, - /* 440 */ 1415, 1418, 1089, 31, 29, 27, 26, 25, 385, 271, - /* 450 */ 991, 361, 1015, 356, 1386, 339, 360, 111, 235, 160, - /* 460 */ 245, 357, 355, 1177, 358, 1263, 1413, 994, 995, 1038, - /* 470 */ 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1537, 235, 1523, - /* 480 */ 30, 28, 159, 9, 8, 403, 351, 1429, 261, 1057, - /* 490 */ 990, 1155, 125, 49, 425, 291, 1521, 246, 375, 244, - /* 500 */ 243, 1026, 350, 1148, 427, 1386, 988, 353, 1386, 1057, - /* 510 */ 293, 1257, 1176, 413, 1175, 93, 92, 91, 90, 89, + /* 440 */ 1415, 1418, 6, 32, 30, 28, 27, 26, 386, 272, + /* 450 */ 991, 362, 1015, 357, 1386, 1248, 361, 111, 236, 160, + /* 460 */ 246, 358, 356, 1175, 359, 1263, 1413, 994, 995, 1038, + /* 470 */ 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1537, 236, 1523, + /* 480 */ 31, 29, 159, 9, 8, 1011, 352, 1429, 262, 1057, + /* 490 */ 990, 1155, 125, 1059, 425, 292, 1521, 247, 376, 245, + /* 500 */ 244, 1026, 351, 1148, 427, 1386, 988, 354, 1386, 1057, + /* 510 */ 294, 1063, 1174, 413, 1173, 93, 92, 91, 90, 89, /* 520 */ 88, 87, 86, 85, 68, 1414, 1415, 1418, 1462, 1523, - /* 530 */ 49, 274, 234, 1458, 159, 1058, 416, 1, 351, 111, - /* 540 */ 95, 1093, 125, 1174, 1523, 441, 1521, 1263, 1256, 1013, - /* 550 */ 1059, 439, 1070, 1062, 1386, 1058, 1386, 125, 476, 353, - /* 560 */ 507, 1521, 172, 1308, 441, 441, 1173, 1261, 1063, 1147, - /* 570 */ 205, 275, 989, 1062, 1307, 1172, 23, 259, 1052, 1053, - /* 580 */ 1054, 1055, 1056, 1060, 1061, 1386, 1261, 1261, 1011, 1476, - /* 590 */ 1194, 21, 1171, 1170, 1169, 1166, 23, 259, 1052, 1053, - /* 600 */ 1054, 1055, 1056, 1060, 1061, 1198, 991, 1473, 1386, 1101, - /* 610 */ 1165, 147, 362, 1248, 119, 1012, 112, 1386, 1481, 1089, - /* 620 */ 344, 219, 146, 994, 995, 1038, 1039, 1040, 1041, 1042, - /* 630 */ 1043, 1044, 1045, 217, 1386, 1386, 1386, 1386, 1164, 1163, - /* 640 */ 1162, 1161, 1160, 136, 1159, 1158, 50, 9, 8, 144, - /* 650 */ 1237, 1413, 1386, 420, 495, 494, 493, 492, 491, 490, + /* 530 */ 50, 275, 235, 1458, 22, 1058, 416, 1, 1308, 111, + /* 540 */ 95, 50, 125, 1172, 1523, 441, 1521, 1263, 1256, 1307, + /* 550 */ 798, 439, 1070, 1062, 1386, 1058, 1386, 125, 467, 1257, + /* 560 */ 507, 1521, 172, 417, 441, 441, 347, 1261, 1171, 1147, + /* 570 */ 205, 276, 989, 1062, 1089, 1170, 24, 260, 1052, 1053, + /* 580 */ 1054, 1055, 1056, 1060, 1061, 1386, 1261, 1261, 1244, 32, + /* 590 */ 30, 28, 27, 26, 1169, 1166, 24, 260, 1052, 1053, + /* 600 */ 1054, 1055, 1056, 1060, 1061, 1198, 991, 28, 27, 26, + /* 610 */ 1386, 147, 428, 1101, 119, 1093, 112, 1386, 1349, 1012, + /* 620 */ 345, 219, 146, 994, 995, 1038, 1039, 1040, 1041, 1042, + /* 630 */ 1043, 1044, 1045, 217, 1165, 1476, 1386, 1386, 1164, 1163, + /* 640 */ 1162, 1161, 1160, 136, 1159, 1158, 51, 1026, 420, 144, + /* 650 */ 998, 1413, 1375, 1473, 495, 494, 493, 492, 491, 490, /* 660 */ 489, 488, 207, 485, 484, 483, 482, 481, 480, 479, - /* 670 */ 478, 477, 1429, 1476, 1476, 486, 58, 467, 294, 425, - /* 680 */ 1386, 1386, 1386, 1386, 1386, 798, 1386, 1386, 417, 427, - /* 690 */ 424, 1472, 1471, 1386, 1254, 152, 476, 154, 150, 1413, - /* 700 */ 153, 346, 373, 143, 67, 138, 998, 140, 383, 69, - /* 710 */ 1414, 1415, 1418, 1462, 1092, 371, 1244, 254, 1458, 1535, - /* 720 */ 1429, 1150, 1151, 165, 137, 415, 466, 412, 1519, 45, - /* 730 */ 44, 303, 156, 130, 1189, 155, 104, 427, 297, 387, - /* 740 */ 158, 1386, 1413, 157, 1168, 1226, 241, 1187, 289, 396, - /* 750 */ 285, 281, 127, 188, 1302, 345, 364, 69, 1414, 1415, - /* 760 */ 1418, 1462, 181, 1429, 1492, 254, 1458, 120, 43, 367, - /* 770 */ 425, 1115, 1001, 175, 126, 997, 177, 1430, 1413, 187, - /* 780 */ 427, 410, 421, 190, 1386, 391, 1489, 32, 32, 32, - /* 790 */ 1064, 1023, 957, 194, 2, 1010, 196, 278, 1049, 1429, - /* 800 */ 69, 1414, 1415, 1418, 1462, 1413, 425, 282, 254, 1458, - /* 810 */ 1535, 101, 240, 242, 433, 418, 427, 841, 102, 1480, - /* 820 */ 1386, 202, 966, 211, 313, 413, 1429, 409, 510, 1338, - /* 830 */ 132, 104, 319, 425, 867, 327, 224, 1414, 1415, 1418, - /* 840 */ 326, 1000, 210, 427, 328, 94, 332, 1386, 1019, 98, - /* 850 */ 333, 499, 43, 209, 446, 862, 1523, 895, 102, 103, - /* 860 */ 1413, 899, 905, 70, 1414, 1415, 1418, 1462, 413, 125, - /* 870 */ 334, 423, 1458, 1521, 1018, 335, 139, 66, 1017, 336, - /* 880 */ 203, 1429, 96, 104, 102, 337, 904, 105, 425, 142, - /* 890 */ 48, 145, 184, 1469, 408, 340, 407, 1016, 427, 1523, - /* 900 */ 347, 349, 1386, 74, 1413, 1251, 376, 149, 1247, 1413, - /* 910 */ 437, 377, 125, 151, 106, 107, 1521, 1249, 115, 1414, - /* 920 */ 1415, 1418, 1245, 108, 109, 1429, 352, 359, 378, 250, - /* 930 */ 1429, 1015, 425, 382, 167, 390, 388, 425, 168, 379, - /* 940 */ 170, 397, 427, 1503, 431, 386, 1386, 427, 1493, 260, - /* 950 */ 389, 1386, 995, 974, 392, 164, 414, 1536, 1502, 5, - /* 960 */ 1483, 173, 228, 1414, 1415, 1418, 1413, 228, 1414, 1415, - /* 970 */ 1418, 1413, 406, 394, 393, 176, 253, 4, 401, 1089, - /* 980 */ 97, 1014, 33, 183, 180, 422, 255, 1429, 118, 1477, - /* 990 */ 419, 429, 1429, 182, 425, 17, 1347, 1346, 430, 425, - /* 1000 */ 263, 434, 1444, 435, 427, 198, 1538, 1413, 1386, 427, - /* 1010 */ 200, 57, 436, 1386, 1520, 1413, 258, 59, 1262, 212, - /* 1020 */ 473, 189, 444, 214, 227, 1414, 1415, 1418, 1429, 228, - /* 1030 */ 1414, 1415, 1418, 487, 208, 425, 1429, 506, 216, 220, - /* 1040 */ 221, 1413, 39, 425, 218, 427, 1380, 1379, 277, 1386, - /* 1050 */ 1413, 279, 262, 427, 1376, 280, 405, 1386, 984, 985, - /* 1060 */ 128, 284, 1429, 1374, 286, 228, 1414, 1415, 1418, 425, - /* 1070 */ 287, 1429, 288, 226, 1414, 1415, 1418, 1413, 425, 427, - /* 1080 */ 1373, 290, 1372, 1386, 1363, 1413, 292, 129, 427, 295, - /* 1090 */ 296, 969, 1386, 968, 1357, 1356, 302, 1355, 1429, 229, - /* 1100 */ 1414, 1415, 1418, 301, 1354, 425, 1429, 1331, 222, 1414, - /* 1110 */ 1415, 1418, 940, 425, 1330, 427, 1329, 1328, 1327, 1386, - /* 1120 */ 1326, 1413, 1325, 427, 1324, 1323, 1413, 1386, 1322, 1321, - /* 1130 */ 1320, 1319, 100, 1318, 1317, 230, 1414, 1415, 1418, 1316, - /* 1140 */ 1315, 1314, 1429, 223, 1414, 1415, 1418, 1429, 1313, 425, - /* 1150 */ 1312, 1311, 1310, 1309, 425, 1200, 1371, 942, 1365, 427, - /* 1160 */ 1353, 1344, 1413, 1386, 427, 1240, 141, 1413, 1386, 811, - /* 1170 */ 1199, 1197, 1186, 1413, 341, 343, 1185, 1182, 342, 231, - /* 1180 */ 1414, 1415, 1418, 1429, 1426, 1414, 1415, 1418, 1429, 1242, - /* 1190 */ 425, 73, 912, 486, 1429, 425, 910, 1241, 1195, 1190, - /* 1200 */ 427, 425, 1238, 148, 1386, 427, 840, 839, 247, 1386, - /* 1210 */ 248, 427, 365, 838, 1413, 1386, 837, 835, 834, 1188, - /* 1220 */ 1425, 1414, 1415, 1418, 1236, 1424, 1414, 1415, 1418, 1413, - /* 1230 */ 249, 238, 1414, 1415, 1418, 1429, 1181, 370, 268, 267, - /* 1240 */ 1413, 368, 425, 1180, 372, 71, 1370, 163, 1003, 42, - /* 1250 */ 1429, 976, 427, 1364, 990, 1413, 1386, 425, 110, 206, - /* 1260 */ 380, 1429, 1352, 472, 996, 166, 1351, 427, 425, 1343, - /* 1270 */ 988, 1386, 237, 1414, 1415, 1418, 1429, 381, 427, 36, - /* 1280 */ 366, 206, 1386, 425, 474, 472, 51, 239, 1414, 1415, - /* 1290 */ 1418, 169, 171, 427, 3, 374, 32, 1386, 236, 1414, - /* 1300 */ 1415, 1418, 37, 471, 470, 469, 474, 468, 116, 162, - /* 1310 */ 174, 1114, 369, 225, 1414, 1415, 1418, 363, 442, 178, - /* 1320 */ 161, 1108, 1107, 14, 507, 471, 470, 469, 52, 468, - /* 1330 */ 999, 179, 53, 34, 19, 1404, 989, 15, 1086, 185, - /* 1340 */ 1085, 35, 124, 1141, 41, 16, 10, 40, 54, 1136, - /* 1350 */ 1135, 256, 1140, 1139, 257, 8, 1050, 1024, 192, 13, - /* 1360 */ 18, 432, 193, 1112, 1004, 195, 197, 55, 1342, 199, - /* 1370 */ 991, 56, 201, 60, 1005, 38, 1403, 896, 445, 270, - /* 1380 */ 204, 1007, 995, 443, 449, 452, 447, 994, 995, 893, - /* 1390 */ 450, 873, 890, 453, 455, 884, 456, 458, 882, 459, - /* 1400 */ 61, 907, 888, 887, 886, 465, 62, 63, 906, 903, - /* 1410 */ 901, 475, 885, 809, 831, 830, 829, 828, 827, 826, - /* 1420 */ 825, 824, 823, 842, 821, 820, 1196, 819, 818, 817, - /* 1430 */ 1184, 816, 815, 814, 496, 497, 500, 1183, 501, 1179, - /* 1440 */ 498, 504, 505, 1154, 992, 215, 508, 509, + /* 670 */ 478, 477, 1429, 1476, 1476, 424, 1386, 165, 58, 425, + /* 680 */ 1386, 1386, 1386, 1386, 1386, 466, 1386, 1386, 284, 427, + /* 690 */ 418, 1472, 1471, 1386, 1481, 1089, 1254, 486, 152, 1413, + /* 700 */ 295, 150, 374, 143, 67, 138, 384, 140, 1168, 69, + /* 710 */ 1414, 1415, 1418, 1462, 1226, 372, 1001, 255, 1458, 1535, + /* 720 */ 1429, 1194, 1189, 154, 137, 415, 153, 412, 1519, 46, + /* 730 */ 45, 304, 156, 130, 1187, 155, 158, 427, 298, 157, + /* 740 */ 1302, 1386, 1413, 363, 365, 64, 242, 188, 290, 397, + /* 750 */ 286, 282, 127, 9, 8, 60, 368, 69, 1414, 1415, + /* 760 */ 1418, 1462, 181, 1429, 346, 255, 1458, 120, 104, 44, + /* 770 */ 425, 388, 1115, 175, 126, 997, 177, 421, 1413, 187, + /* 780 */ 427, 1150, 1151, 1049, 1386, 392, 1489, 33, 1092, 410, + /* 790 */ 1064, 33, 33, 194, 1023, 957, 196, 1492, 1430, 1429, + /* 800 */ 69, 1414, 1415, 1418, 1462, 1413, 425, 190, 255, 1458, + /* 810 */ 1535, 101, 102, 2, 433, 202, 427, 1010, 104, 1480, + /* 820 */ 1386, 867, 283, 279, 241, 413, 1429, 409, 510, 243, + /* 830 */ 966, 44, 841, 425, 862, 211, 225, 1414, 1415, 1418, + /* 840 */ 320, 1000, 210, 427, 314, 94, 1338, 1386, 132, 98, + /* 850 */ 333, 499, 446, 209, 102, 895, 1523, 899, 103, 104, + /* 860 */ 1413, 905, 904, 70, 1414, 1415, 1418, 1462, 413, 125, + /* 870 */ 328, 423, 1458, 1521, 1019, 327, 329, 66, 334, 1018, + /* 880 */ 203, 1429, 96, 102, 335, 336, 105, 139, 425, 337, + /* 890 */ 1017, 338, 184, 1469, 408, 142, 407, 49, 427, 1523, + /* 900 */ 341, 145, 1386, 1016, 1413, 348, 74, 350, 379, 1413, + /* 910 */ 437, 1251, 125, 149, 378, 380, 1521, 1247, 115, 1414, + /* 920 */ 1415, 1418, 151, 106, 353, 1429, 360, 377, 107, 1249, + /* 930 */ 1429, 1015, 425, 1245, 108, 391, 109, 425, 168, 167, + /* 940 */ 170, 251, 427, 387, 398, 389, 1386, 427, 1493, 261, + /* 950 */ 390, 1386, 431, 974, 393, 164, 414, 1536, 383, 1503, + /* 960 */ 995, 173, 229, 1414, 1415, 1418, 1413, 229, 1414, 1415, + /* 970 */ 1418, 1413, 1502, 395, 5, 176, 1089, 394, 254, 406, + /* 980 */ 1483, 97, 401, 4, 1014, 17, 34, 1429, 256, 1477, + /* 990 */ 422, 183, 1429, 419, 425, 1347, 429, 435, 198, 425, + /* 1000 */ 430, 264, 182, 180, 427, 118, 1346, 1413, 1386, 427, + /* 1010 */ 1444, 434, 1262, 1386, 436, 1413, 259, 200, 59, 57, + /* 1020 */ 212, 1520, 214, 208, 228, 1414, 1415, 1418, 1429, 229, + /* 1030 */ 1414, 1415, 1418, 473, 444, 425, 1429, 189, 487, 506, + /* 1040 */ 220, 1413, 1538, 425, 221, 427, 40, 216, 1380, 1386, + /* 1050 */ 1413, 218, 263, 427, 1379, 278, 405, 1386, 1376, 280, + /* 1060 */ 281, 984, 1429, 285, 985, 229, 1414, 1415, 1418, 425, + /* 1070 */ 128, 1429, 1374, 222, 1414, 1415, 1418, 1413, 425, 427, + /* 1080 */ 287, 288, 289, 1386, 1373, 1413, 1372, 291, 427, 1363, + /* 1090 */ 293, 129, 1386, 296, 297, 969, 1357, 968, 1429, 227, + /* 1100 */ 1414, 1415, 1418, 1356, 303, 425, 1429, 302, 230, 1414, + /* 1110 */ 1415, 1418, 1355, 425, 1354, 427, 940, 1331, 1330, 1386, + /* 1120 */ 1329, 1413, 1328, 427, 1327, 1326, 1413, 1386, 1325, 1324, + /* 1130 */ 1323, 1322, 1321, 1320, 1319, 223, 1414, 1415, 1418, 100, + /* 1140 */ 1318, 1317, 1429, 231, 1414, 1415, 1418, 1429, 1316, 425, + /* 1150 */ 1315, 1314, 1313, 1312, 425, 1311, 1310, 942, 1309, 427, + /* 1160 */ 1200, 1371, 1413, 1386, 427, 1365, 1353, 1413, 1386, 1344, + /* 1170 */ 141, 1240, 1199, 1413, 811, 1197, 342, 1186, 343, 224, + /* 1180 */ 1414, 1415, 1418, 1429, 232, 1414, 1415, 1418, 1429, 344, + /* 1190 */ 425, 1185, 1182, 1242, 1429, 425, 910, 73, 1241, 148, + /* 1200 */ 427, 425, 912, 486, 1386, 427, 840, 1195, 839, 1386, + /* 1210 */ 248, 427, 1190, 1188, 1413, 1386, 838, 837, 835, 834, + /* 1220 */ 1426, 1414, 1415, 1418, 249, 1425, 1414, 1415, 1418, 1413, + /* 1230 */ 250, 1424, 1414, 1415, 1418, 1429, 366, 369, 269, 268, + /* 1240 */ 1413, 371, 425, 1181, 1180, 373, 1370, 71, 1003, 1238, + /* 1250 */ 1429, 43, 427, 163, 976, 1413, 1386, 425, 1364, 110, + /* 1260 */ 381, 1429, 1352, 990, 996, 1236, 1351, 427, 425, 382, + /* 1270 */ 166, 1386, 239, 1414, 1415, 1418, 1429, 37, 427, 988, + /* 1280 */ 1343, 1413, 1386, 425, 52, 169, 116, 238, 1414, 1415, + /* 1290 */ 1418, 3, 367, 427, 178, 33, 38, 1386, 240, 1414, + /* 1300 */ 1415, 1418, 1429, 174, 1114, 19, 206, 375, 171, 425, + /* 1310 */ 472, 1404, 179, 237, 1414, 1415, 1418, 14, 442, 427, + /* 1320 */ 1107, 162, 206, 1386, 370, 53, 472, 20, 185, 364, + /* 1330 */ 999, 474, 161, 507, 15, 124, 35, 1086, 1085, 226, + /* 1340 */ 1414, 1415, 1418, 36, 1141, 989, 16, 474, 54, 1136, + /* 1350 */ 471, 470, 469, 10, 468, 1135, 42, 257, 1140, 41, + /* 1360 */ 1139, 258, 8, 192, 1004, 1050, 471, 470, 469, 1024, + /* 1370 */ 468, 13, 18, 1342, 193, 1112, 195, 197, 55, 991, + /* 1380 */ 432, 1007, 995, 199, 201, 56, 1005, 1403, 896, 60, + /* 1390 */ 39, 445, 271, 204, 443, 447, 994, 995, 893, 449, + /* 1400 */ 450, 452, 890, 453, 455, 884, 456, 458, 882, 888, + /* 1410 */ 459, 873, 465, 907, 61, 62, 63, 906, 887, 886, + /* 1420 */ 903, 885, 901, 831, 809, 475, 830, 823, 829, 828, + /* 1430 */ 827, 826, 825, 824, 842, 821, 820, 819, 1196, 1184, + /* 1440 */ 818, 817, 816, 1183, 815, 814, 496, 497, 500, 501, + /* 1450 */ 1179, 504, 498, 505, 1154, 992, 215, 508, 1154, 1154, + /* 1460 */ 509, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 226, 210, 210, 217, 210, 226, 204, 216, 216, 210, @@ -376,135 +378,135 @@ static const YYCODETYPE yy_lookahead[] = { /* 150 */ 14, 15, 16, 130, 209, 155, 156, 157, 158, 159, /* 160 */ 160, 161, 162, 163, 164, 220, 18, 225, 20, 69, /* 170 */ 92, 137, 227, 139, 232, 27, 176, 138, 30, 20, - /* 180 */ 242, 81, 104, 245, 242, 225, 248, 39, 246, 69, - /* 190 */ 204, 128, 232, 44, 155, 156, 157, 158, 159, 160, + /* 180 */ 242, 81, 104, 245, 242, 234, 248, 39, 246, 69, + /* 190 */ 204, 176, 241, 242, 155, 156, 157, 158, 159, 160, /* 200 */ 161, 162, 163, 164, 262, 263, 264, 265, 266, 210, - /* 210 */ 176, 225, 270, 271, 272, 216, 138, 68, 232, 225, - /* 220 */ 71, 210, 232, 281, 264, 231, 20, 216, 242, 239, + /* 210 */ 176, 225, 270, 271, 272, 216, 138, 0, 232, 225, + /* 220 */ 57, 210, 232, 281, 61, 231, 20, 216, 242, 239, /* 230 */ 236, 232, 246, 155, 156, 157, 158, 159, 160, 161, - /* 240 */ 162, 163, 164, 232, 181, 182, 12, 13, 262, 263, - /* 250 */ 264, 265, 266, 69, 20, 107, 22, 271, 110, 111, - /* 260 */ 112, 113, 114, 79, 116, 117, 118, 119, 120, 121, + /* 240 */ 162, 163, 164, 232, 0, 82, 12, 13, 262, 263, + /* 250 */ 264, 265, 266, 46, 20, 107, 22, 271, 110, 111, + /* 260 */ 112, 113, 114, 46, 116, 117, 118, 119, 120, 121, /* 270 */ 122, 123, 38, 21, 155, 69, 24, 25, 26, 27, /* 280 */ 28, 29, 30, 31, 32, 12, 13, 14, 0, 49, - /* 290 */ 225, 51, 251, 20, 54, 22, 176, 57, 233, 59, - /* 300 */ 60, 176, 62, 69, 185, 186, 187, 188, 189, 21, - /* 310 */ 43, 38, 24, 25, 26, 27, 28, 29, 30, 31, - /* 320 */ 32, 210, 225, 282, 12, 13, 92, 216, 231, 207, - /* 330 */ 208, 210, 20, 236, 22, 176, 295, 216, 104, 213, - /* 340 */ 299, 215, 69, 232, 234, 12, 13, 14, 15, 16, - /* 350 */ 38, 241, 242, 232, 83, 84, 85, 86, 87, 88, + /* 290 */ 46, 51, 251, 20, 54, 22, 176, 57, 218, 59, + /* 300 */ 60, 221, 62, 69, 185, 186, 187, 188, 189, 21, + /* 310 */ 204, 38, 24, 25, 26, 27, 28, 29, 30, 31, + /* 320 */ 32, 210, 225, 282, 12, 13, 92, 216, 231, 128, + /* 330 */ 46, 210, 20, 236, 22, 176, 295, 216, 104, 213, + /* 340 */ 299, 215, 69, 232, 20, 12, 13, 14, 15, 16, + /* 350 */ 38, 44, 246, 232, 83, 84, 85, 86, 87, 88, /* 360 */ 89, 90, 91, 92, 93, 92, 95, 96, 97, 98, - /* 370 */ 99, 100, 138, 14, 15, 16, 203, 104, 205, 218, - /* 380 */ 204, 69, 221, 0, 12, 13, 14, 15, 16, 155, + /* 370 */ 99, 100, 138, 204, 203, 68, 205, 104, 71, 20, + /* 380 */ 204, 69, 181, 182, 12, 13, 14, 15, 16, 155, /* 390 */ 156, 157, 158, 159, 160, 161, 162, 163, 164, 210, - /* 400 */ 282, 225, 0, 70, 92, 216, 46, 210, 232, 0, - /* 410 */ 176, 138, 204, 295, 242, 20, 104, 299, 242, 36, - /* 420 */ 248, 232, 246, 12, 13, 14, 15, 16, 155, 156, + /* 400 */ 282, 225, 0, 70, 92, 216, 225, 210, 232, 20, + /* 410 */ 176, 138, 204, 295, 233, 246, 104, 299, 242, 207, + /* 420 */ 208, 232, 246, 12, 13, 14, 15, 16, 155, 156, /* 430 */ 157, 158, 159, 160, 161, 162, 163, 164, 262, 263, - /* 440 */ 264, 265, 175, 12, 13, 14, 15, 16, 251, 217, - /* 450 */ 138, 49, 20, 51, 246, 46, 54, 225, 47, 57, + /* 440 */ 264, 265, 43, 12, 13, 14, 15, 16, 251, 217, + /* 450 */ 138, 49, 20, 51, 246, 226, 54, 225, 47, 57, /* 460 */ 35, 59, 60, 204, 62, 233, 204, 155, 156, 157, /* 470 */ 158, 159, 160, 161, 162, 163, 164, 301, 47, 282, /* 480 */ 12, 13, 57, 1, 2, 20, 61, 225, 20, 78, - /* 490 */ 22, 0, 295, 212, 232, 134, 299, 72, 251, 74, + /* 490 */ 22, 0, 295, 124, 232, 134, 299, 72, 251, 74, /* 500 */ 75, 70, 77, 131, 242, 246, 38, 82, 246, 78, - /* 510 */ 149, 230, 204, 251, 204, 24, 25, 26, 27, 28, + /* 510 */ 149, 142, 204, 251, 204, 24, 25, 26, 27, 28, /* 520 */ 29, 30, 31, 32, 262, 263, 264, 265, 266, 282, - /* 530 */ 212, 217, 270, 271, 57, 124, 3, 69, 61, 225, - /* 540 */ 222, 4, 295, 204, 282, 210, 299, 233, 230, 20, - /* 550 */ 124, 216, 70, 142, 246, 124, 246, 295, 46, 82, - /* 560 */ 92, 299, 130, 225, 210, 210, 204, 232, 142, 197, - /* 570 */ 216, 216, 104, 142, 236, 204, 165, 166, 167, 168, - /* 580 */ 169, 170, 171, 172, 173, 246, 232, 232, 20, 260, - /* 590 */ 0, 165, 204, 204, 204, 204, 165, 166, 167, 168, - /* 600 */ 169, 170, 171, 172, 173, 0, 138, 278, 246, 14, - /* 610 */ 204, 33, 22, 226, 36, 20, 18, 246, 174, 175, + /* 530 */ 212, 217, 270, 271, 165, 124, 3, 69, 225, 225, + /* 540 */ 222, 212, 295, 204, 282, 210, 299, 233, 230, 236, + /* 550 */ 22, 216, 70, 142, 246, 124, 246, 295, 80, 230, + /* 560 */ 92, 299, 130, 67, 210, 210, 38, 232, 204, 197, + /* 570 */ 216, 216, 104, 142, 175, 204, 165, 166, 167, 168, + /* 580 */ 169, 170, 171, 172, 173, 246, 232, 232, 226, 12, + /* 590 */ 13, 14, 15, 16, 204, 204, 165, 166, 167, 168, + /* 600 */ 169, 170, 171, 172, 173, 0, 138, 14, 15, 16, + /* 610 */ 246, 33, 242, 14, 36, 4, 18, 246, 248, 20, /* 620 */ 42, 23, 44, 155, 156, 157, 158, 159, 160, 161, - /* 630 */ 162, 163, 164, 35, 246, 246, 246, 246, 204, 204, - /* 640 */ 204, 204, 204, 45, 204, 204, 68, 1, 2, 71, - /* 650 */ 0, 204, 246, 67, 49, 50, 51, 52, 53, 54, + /* 630 */ 162, 163, 164, 35, 204, 260, 246, 246, 204, 204, + /* 640 */ 204, 204, 204, 45, 204, 204, 68, 70, 67, 71, + /* 650 */ 38, 204, 0, 278, 49, 50, 51, 52, 53, 54, /* 660 */ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - /* 670 */ 65, 66, 225, 260, 260, 67, 209, 80, 70, 232, - /* 680 */ 246, 246, 246, 246, 246, 22, 246, 246, 67, 242, - /* 690 */ 47, 278, 278, 246, 227, 73, 46, 73, 76, 204, - /* 700 */ 76, 38, 21, 125, 106, 127, 38, 129, 254, 262, - /* 710 */ 263, 264, 265, 266, 177, 34, 226, 270, 271, 272, - /* 720 */ 225, 199, 200, 226, 146, 192, 226, 232, 281, 131, - /* 730 */ 132, 133, 73, 135, 0, 76, 67, 242, 140, 70, - /* 740 */ 73, 246, 204, 76, 205, 215, 148, 0, 150, 293, - /* 750 */ 152, 153, 154, 302, 235, 207, 22, 262, 263, 264, - /* 760 */ 265, 266, 287, 225, 261, 270, 271, 272, 67, 22, - /* 770 */ 232, 70, 104, 67, 176, 38, 70, 225, 204, 284, - /* 780 */ 242, 280, 196, 296, 246, 290, 291, 67, 67, 67, - /* 790 */ 70, 70, 70, 67, 283, 20, 70, 210, 155, 225, - /* 800 */ 262, 263, 264, 265, 266, 204, 232, 36, 270, 271, - /* 810 */ 272, 67, 257, 214, 70, 194, 242, 38, 67, 281, - /* 820 */ 246, 70, 136, 252, 210, 251, 225, 210, 19, 210, - /* 830 */ 115, 67, 240, 232, 70, 124, 262, 263, 264, 265, - /* 840 */ 238, 104, 33, 242, 238, 36, 210, 246, 20, 232, - /* 850 */ 256, 42, 67, 44, 67, 70, 282, 70, 67, 67, + /* 670 */ 65, 66, 225, 260, 260, 47, 246, 226, 209, 232, + /* 680 */ 246, 246, 246, 246, 246, 226, 246, 246, 36, 242, + /* 690 */ 194, 278, 278, 246, 174, 175, 227, 67, 73, 204, + /* 700 */ 70, 76, 21, 125, 106, 127, 254, 129, 205, 262, + /* 710 */ 263, 264, 265, 266, 215, 34, 104, 270, 271, 272, + /* 720 */ 225, 0, 0, 73, 146, 192, 76, 232, 281, 131, + /* 730 */ 132, 133, 73, 135, 0, 76, 73, 242, 140, 76, + /* 740 */ 235, 246, 204, 22, 22, 69, 148, 302, 150, 293, + /* 750 */ 152, 153, 154, 1, 2, 79, 22, 262, 263, 264, + /* 760 */ 265, 266, 287, 225, 207, 270, 271, 272, 67, 67, + /* 770 */ 232, 70, 70, 67, 176, 38, 70, 196, 204, 284, + /* 780 */ 242, 199, 200, 155, 246, 290, 291, 67, 177, 280, + /* 790 */ 70, 67, 67, 67, 70, 70, 70, 261, 225, 225, + /* 800 */ 262, 263, 264, 265, 266, 204, 232, 296, 270, 271, + /* 810 */ 272, 67, 67, 283, 70, 70, 242, 20, 67, 281, + /* 820 */ 246, 70, 36, 210, 257, 251, 225, 210, 19, 214, + /* 830 */ 136, 67, 38, 232, 70, 252, 262, 263, 264, 265, + /* 840 */ 240, 104, 33, 242, 210, 36, 210, 246, 115, 232, + /* 850 */ 210, 42, 67, 44, 67, 70, 282, 70, 67, 67, /* 860 */ 204, 70, 70, 262, 263, 264, 265, 266, 251, 295, - /* 870 */ 242, 270, 271, 299, 20, 250, 212, 68, 20, 232, - /* 880 */ 71, 225, 265, 67, 67, 243, 70, 70, 232, 212, - /* 890 */ 212, 212, 275, 276, 277, 210, 279, 20, 242, 282, - /* 900 */ 206, 225, 246, 210, 204, 225, 232, 225, 225, 204, - /* 910 */ 101, 256, 295, 225, 225, 225, 299, 225, 262, 263, - /* 920 */ 264, 265, 225, 225, 225, 225, 214, 214, 145, 206, - /* 930 */ 225, 20, 232, 242, 209, 126, 232, 232, 129, 255, - /* 940 */ 209, 184, 242, 292, 183, 250, 246, 242, 261, 249, - /* 950 */ 243, 246, 156, 144, 249, 146, 300, 301, 292, 191, - /* 960 */ 289, 247, 262, 263, 264, 265, 204, 262, 263, 264, - /* 970 */ 265, 204, 190, 246, 179, 247, 246, 178, 246, 175, - /* 980 */ 232, 20, 115, 273, 288, 195, 198, 225, 286, 260, - /* 990 */ 193, 246, 225, 285, 232, 69, 247, 247, 246, 232, - /* 1000 */ 246, 127, 269, 244, 242, 232, 303, 204, 246, 242, - /* 1010 */ 209, 209, 243, 246, 298, 204, 249, 69, 232, 221, - /* 1020 */ 214, 297, 228, 210, 262, 263, 264, 265, 225, 262, - /* 1030 */ 263, 264, 265, 214, 209, 232, 225, 206, 211, 219, - /* 1040 */ 219, 204, 253, 232, 202, 242, 0, 0, 60, 246, - /* 1050 */ 204, 38, 249, 242, 0, 151, 294, 246, 38, 38, - /* 1060 */ 38, 151, 225, 0, 38, 262, 263, 264, 265, 232, - /* 1070 */ 38, 225, 151, 262, 263, 264, 265, 204, 232, 242, - /* 1080 */ 0, 38, 0, 246, 0, 204, 38, 69, 242, 142, - /* 1090 */ 141, 104, 246, 138, 0, 0, 134, 0, 225, 262, - /* 1100 */ 263, 264, 265, 50, 0, 232, 225, 0, 262, 263, - /* 1110 */ 264, 265, 81, 232, 0, 242, 0, 0, 0, 246, + /* 870 */ 124, 270, 271, 299, 20, 238, 238, 68, 256, 20, + /* 880 */ 71, 225, 265, 67, 242, 250, 70, 212, 232, 232, + /* 890 */ 20, 243, 275, 276, 277, 212, 279, 212, 242, 282, + /* 900 */ 210, 212, 246, 20, 204, 206, 210, 225, 145, 204, + /* 910 */ 101, 225, 295, 225, 256, 255, 299, 225, 262, 263, + /* 920 */ 264, 265, 225, 225, 214, 225, 214, 232, 225, 225, + /* 930 */ 225, 20, 232, 225, 225, 126, 225, 232, 129, 209, + /* 940 */ 209, 206, 242, 250, 184, 232, 246, 242, 261, 249, + /* 950 */ 243, 246, 183, 144, 249, 146, 300, 301, 242, 292, + /* 960 */ 156, 247, 262, 263, 264, 265, 204, 262, 263, 264, + /* 970 */ 265, 204, 292, 246, 191, 247, 175, 179, 246, 190, + /* 980 */ 289, 232, 246, 178, 20, 69, 115, 225, 198, 260, + /* 990 */ 195, 273, 225, 193, 232, 247, 246, 244, 232, 232, + /* 1000 */ 246, 246, 285, 288, 242, 286, 247, 204, 246, 242, + /* 1010 */ 269, 127, 232, 246, 243, 204, 249, 209, 69, 209, + /* 1020 */ 221, 298, 210, 209, 262, 263, 264, 265, 225, 262, + /* 1030 */ 263, 264, 265, 214, 228, 232, 225, 297, 214, 206, + /* 1040 */ 219, 204, 303, 232, 219, 242, 253, 211, 0, 246, + /* 1050 */ 204, 202, 249, 242, 0, 60, 294, 246, 0, 38, + /* 1060 */ 151, 38, 225, 151, 38, 262, 263, 264, 265, 232, + /* 1070 */ 38, 225, 0, 262, 263, 264, 265, 204, 232, 242, + /* 1080 */ 38, 38, 151, 246, 0, 204, 0, 38, 242, 0, + /* 1090 */ 38, 69, 246, 142, 141, 104, 0, 138, 225, 262, + /* 1100 */ 263, 264, 265, 0, 134, 232, 225, 50, 262, 263, + /* 1110 */ 264, 265, 0, 232, 0, 242, 81, 0, 0, 246, /* 1120 */ 0, 204, 0, 242, 0, 0, 204, 246, 0, 0, - /* 1130 */ 0, 0, 115, 0, 0, 262, 263, 264, 265, 0, + /* 1130 */ 0, 0, 0, 0, 0, 262, 263, 264, 265, 115, /* 1140 */ 0, 0, 225, 262, 263, 264, 265, 225, 0, 232, /* 1150 */ 0, 0, 0, 0, 232, 0, 0, 22, 0, 242, - /* 1160 */ 0, 0, 204, 246, 242, 0, 43, 204, 246, 48, - /* 1170 */ 0, 0, 0, 204, 38, 43, 0, 0, 36, 262, - /* 1180 */ 263, 264, 265, 225, 262, 263, 264, 265, 225, 0, - /* 1190 */ 232, 78, 38, 67, 225, 232, 22, 0, 0, 0, - /* 1200 */ 242, 232, 0, 76, 246, 242, 38, 38, 22, 246, - /* 1210 */ 22, 242, 39, 38, 204, 246, 38, 38, 38, 0, - /* 1220 */ 262, 263, 264, 265, 0, 262, 263, 264, 265, 204, - /* 1230 */ 22, 262, 263, 264, 265, 225, 0, 22, 12, 13, - /* 1240 */ 204, 38, 232, 0, 22, 20, 0, 147, 22, 130, - /* 1250 */ 225, 38, 242, 0, 22, 204, 246, 232, 143, 57, - /* 1260 */ 22, 225, 0, 61, 38, 127, 0, 242, 232, 0, - /* 1270 */ 38, 246, 262, 263, 264, 265, 225, 130, 242, 130, - /* 1280 */ 4, 57, 246, 232, 82, 61, 69, 262, 263, 264, - /* 1290 */ 265, 43, 125, 242, 67, 19, 67, 246, 262, 263, - /* 1300 */ 264, 265, 67, 101, 102, 103, 82, 105, 69, 33, - /* 1310 */ 70, 70, 36, 262, 263, 264, 265, 41, 92, 69, - /* 1320 */ 44, 70, 70, 180, 92, 101, 102, 103, 69, 105, - /* 1330 */ 104, 67, 69, 174, 67, 81, 104, 180, 70, 81, - /* 1340 */ 70, 67, 81, 70, 68, 67, 180, 71, 4, 38, - /* 1350 */ 38, 38, 38, 38, 38, 2, 155, 70, 81, 69, - /* 1360 */ 69, 128, 70, 70, 138, 69, 69, 69, 0, 43, - /* 1370 */ 138, 69, 125, 79, 22, 69, 81, 70, 38, 38, - /* 1380 */ 81, 155, 156, 80, 38, 38, 69, 155, 156, 70, - /* 1390 */ 69, 22, 70, 69, 38, 70, 69, 38, 70, 69, - /* 1400 */ 69, 38, 94, 94, 94, 82, 69, 69, 104, 38, - /* 1410 */ 22, 47, 94, 48, 22, 38, 38, 38, 38, 38, - /* 1420 */ 38, 38, 22, 38, 38, 38, 0, 38, 38, 38, - /* 1430 */ 0, 38, 38, 38, 38, 36, 38, 0, 37, 0, - /* 1440 */ 43, 22, 21, 304, 22, 22, 21, 20, 304, 304, - /* 1450 */ 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, - /* 1460 */ 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + /* 1160 */ 0, 0, 204, 246, 242, 0, 0, 204, 246, 0, + /* 1170 */ 43, 0, 0, 204, 48, 0, 38, 0, 36, 262, + /* 1180 */ 263, 264, 265, 225, 262, 263, 264, 265, 225, 43, + /* 1190 */ 232, 0, 0, 0, 225, 232, 22, 78, 0, 76, + /* 1200 */ 242, 232, 38, 67, 246, 242, 38, 0, 38, 246, + /* 1210 */ 22, 242, 0, 0, 204, 246, 38, 38, 38, 38, + /* 1220 */ 262, 263, 264, 265, 22, 262, 263, 264, 265, 204, + /* 1230 */ 22, 262, 263, 264, 265, 225, 39, 38, 12, 13, + /* 1240 */ 204, 22, 232, 0, 0, 22, 0, 20, 22, 0, + /* 1250 */ 225, 130, 242, 147, 38, 204, 246, 232, 0, 143, + /* 1260 */ 22, 225, 0, 22, 38, 0, 0, 242, 232, 130, + /* 1270 */ 127, 246, 262, 263, 264, 265, 225, 130, 242, 38, + /* 1280 */ 0, 204, 246, 232, 69, 43, 69, 262, 263, 264, + /* 1290 */ 265, 67, 4, 242, 69, 67, 67, 246, 262, 263, + /* 1300 */ 264, 265, 225, 70, 70, 69, 57, 19, 125, 232, + /* 1310 */ 61, 81, 67, 262, 263, 264, 265, 180, 92, 242, + /* 1320 */ 70, 33, 57, 246, 36, 69, 61, 67, 81, 41, + /* 1330 */ 104, 82, 44, 92, 180, 81, 174, 70, 70, 262, + /* 1340 */ 263, 264, 265, 67, 70, 104, 67, 82, 4, 38, + /* 1350 */ 101, 102, 103, 180, 105, 38, 68, 38, 38, 71, + /* 1360 */ 38, 38, 2, 81, 138, 155, 101, 102, 103, 70, + /* 1370 */ 105, 69, 69, 0, 70, 70, 69, 69, 69, 138, + /* 1380 */ 128, 155, 156, 43, 125, 69, 22, 81, 70, 79, + /* 1390 */ 69, 38, 38, 81, 80, 69, 155, 156, 70, 38, + /* 1400 */ 69, 38, 70, 69, 38, 70, 69, 38, 70, 94, + /* 1410 */ 69, 22, 82, 38, 69, 69, 69, 104, 94, 94, + /* 1420 */ 38, 94, 22, 22, 48, 47, 38, 22, 38, 38, + /* 1430 */ 38, 38, 38, 38, 38, 38, 38, 38, 0, 0, + /* 1440 */ 38, 38, 38, 0, 38, 38, 38, 36, 38, 37, + /* 1450 */ 0, 22, 43, 21, 304, 22, 22, 21, 304, 304, + /* 1460 */ 20, 304, 304, 304, 304, 304, 304, 304, 304, 304, /* 1470 */ 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, /* 1480 */ 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, /* 1490 */ 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, @@ -522,91 +524,93 @@ static const YYCODETYPE yy_lookahead[] = { /* 1610 */ 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, /* 1620 */ 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, /* 1630 */ 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, - /* 1640 */ 304, 304, 304, 304, 304, 304, 304, 304, 304, + /* 1640 */ 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + /* 1650 */ 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + /* 1660 */ 304, 304, }; #define YY_SHIFT_COUNT (510) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (1439) +#define YY_SHIFT_MAX (1450) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 598, 0, 39, 78, 78, 78, 78, 234, 78, 78, /* 10 */ 312, 468, 120, 273, 312, 312, 312, 312, 312, 312, /* 20 */ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, - /* 30 */ 312, 312, 312, 206, 206, 206, 159, 1226, 1226, 34, - /* 40 */ 81, 81, 125, 1226, 81, 81, 81, 81, 81, 81, - /* 50 */ 360, 395, 465, 465, 125, 529, 395, 81, 81, 395, - /* 60 */ 81, 395, 529, 395, 395, 81, 512, 148, 431, 411, - /* 70 */ 411, 252, 425, 1232, 240, 1232, 1232, 1232, 1232, 1232, - /* 80 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, - /* 90 */ 1232, 1232, 1232, 1232, 38, 409, 23, 23, 23, 650, - /* 100 */ 568, 529, 395, 395, 395, 597, 271, 271, 271, 271, - /* 110 */ 271, 271, 809, 288, 402, 372, 119, 477, 63, 663, - /* 120 */ 432, 444, 267, 444, 595, 533, 537, 775, 771, 779, - /* 130 */ 686, 775, 775, 715, 711, 711, 775, 828, 529, 854, - /* 140 */ 360, 568, 858, 360, 360, 775, 360, 877, 395, 395, - /* 150 */ 395, 395, 395, 395, 395, 395, 395, 395, 395, 779, - /* 160 */ 779, 775, 877, 568, 828, 783, 529, 854, 512, 568, - /* 170 */ 858, 512, 911, 757, 761, 796, 757, 761, 796, 796, - /* 180 */ 768, 782, 795, 799, 804, 568, 961, 867, 788, 790, - /* 190 */ 797, 926, 395, 761, 796, 796, 761, 796, 874, 568, - /* 200 */ 858, 512, 597, 512, 568, 948, 779, 779, 775, 512, - /* 210 */ 877, 1448, 1448, 1448, 1448, 1448, 605, 578, 491, 1276, - /* 220 */ 1202, 1224, 16, 108, 333, 136, 136, 136, 136, 136, - /* 230 */ 136, 136, 149, 36, 482, 426, 359, 359, 359, 359, - /* 240 */ 383, 361, 608, 622, 624, 659, 667, 590, 734, 747, - /* 250 */ 681, 669, 701, 706, 646, 522, 621, 586, 720, 643, - /* 260 */ 721, 100, 722, 726, 744, 751, 764, 668, 737, 785, - /* 270 */ 787, 791, 792, 816, 817, 184, 1046, 1047, 988, 1054, - /* 280 */ 1013, 904, 1020, 1021, 1022, 910, 1063, 1026, 1032, 921, - /* 290 */ 1080, 1043, 1082, 1048, 1084, 1018, 947, 949, 987, 955, - /* 300 */ 1094, 1095, 1053, 962, 1097, 1104, 1031, 1107, 1114, 1116, - /* 310 */ 1117, 1118, 1120, 1122, 1124, 1125, 1128, 1129, 1130, 1131, - /* 320 */ 1017, 1133, 1134, 1139, 1140, 1141, 1148, 1135, 1150, 1151, - /* 330 */ 1152, 1153, 1155, 1156, 1158, 1160, 1161, 1123, 1165, 1121, - /* 340 */ 1170, 1171, 1136, 1142, 1132, 1172, 1176, 1177, 1189, 1113, - /* 350 */ 1127, 1154, 1126, 1174, 1197, 1168, 1169, 1175, 1178, 1126, - /* 360 */ 1179, 1180, 1198, 1186, 1199, 1188, 1173, 1219, 1208, 1203, - /* 370 */ 1236, 1215, 1243, 1222, 1225, 1246, 1119, 1100, 1213, 1253, - /* 380 */ 1115, 1238, 1147, 1138, 1262, 1266, 1149, 1269, 1217, 1248, - /* 390 */ 1167, 1227, 1229, 1143, 1240, 1235, 1241, 1239, 1250, 1251, - /* 400 */ 1259, 1252, 1264, 1254, 1263, 1267, 1157, 1268, 1270, 1258, - /* 410 */ 1159, 1274, 1261, 1273, 1278, 1166, 1344, 1311, 1312, 1313, - /* 420 */ 1314, 1315, 1316, 1353, 1201, 1277, 1287, 1290, 1291, 1292, - /* 430 */ 1293, 1296, 1297, 1233, 1298, 1368, 1326, 1247, 1302, 1294, - /* 440 */ 1295, 1299, 1352, 1306, 1303, 1307, 1340, 1341, 1317, 1319, - /* 450 */ 1346, 1321, 1322, 1347, 1324, 1325, 1356, 1327, 1328, 1359, - /* 460 */ 1330, 1308, 1309, 1310, 1318, 1369, 1323, 1331, 1363, 1304, - /* 470 */ 1337, 1338, 1371, 1126, 1388, 1365, 1364, 1392, 1377, 1378, - /* 480 */ 1379, 1380, 1381, 1382, 1383, 1400, 1385, 1126, 1386, 1387, - /* 490 */ 1389, 1390, 1391, 1393, 1394, 1395, 1426, 1396, 1399, 1397, - /* 500 */ 1430, 1398, 1401, 1437, 1439, 1419, 1421, 1422, 1423, 1425, - /* 510 */ 1427, + /* 30 */ 312, 312, 312, 312, 206, 206, 206, 159, 1226, 1226, + /* 40 */ 34, 81, 81, 15, 1226, 81, 81, 81, 81, 81, + /* 50 */ 81, 207, 324, 359, 15, 389, 324, 81, 81, 324, + /* 60 */ 81, 324, 389, 324, 324, 81, 284, 148, 431, 411, + /* 70 */ 411, 252, 425, 1241, 240, 1241, 1241, 1241, 1241, 1241, + /* 80 */ 1241, 1241, 1241, 1241, 1241, 1241, 1241, 1241, 1241, 1241, + /* 90 */ 1241, 1241, 1241, 1241, 38, 217, 23, 23, 23, 244, + /* 100 */ 465, 389, 324, 324, 324, 478, 271, 271, 271, 271, + /* 110 */ 271, 271, 809, 288, 402, 372, 119, 163, 201, 528, + /* 120 */ 432, 520, 399, 520, 599, 533, 611, 797, 786, 794, + /* 130 */ 694, 797, 797, 733, 746, 746, 797, 854, 389, 859, + /* 140 */ 207, 465, 870, 207, 207, 797, 207, 883, 324, 324, + /* 150 */ 324, 324, 324, 324, 324, 324, 324, 324, 324, 794, + /* 160 */ 794, 797, 883, 465, 854, 763, 389, 859, 284, 465, + /* 170 */ 870, 284, 911, 760, 769, 804, 760, 769, 804, 804, + /* 180 */ 783, 789, 798, 805, 801, 465, 964, 871, 790, 795, + /* 190 */ 800, 916, 324, 769, 804, 804, 769, 804, 884, 465, + /* 200 */ 870, 284, 478, 284, 465, 949, 794, 794, 797, 284, + /* 210 */ 883, 1461, 1461, 1461, 1461, 1461, 605, 578, 491, 1288, + /* 220 */ 1249, 1265, 333, 16, 108, 577, 136, 136, 136, 136, + /* 230 */ 136, 136, 136, 307, 36, 482, 369, 593, 593, 593, + /* 240 */ 593, 652, 361, 630, 625, 650, 659, 663, 721, 722, + /* 250 */ 734, 681, 701, 702, 706, 752, 582, 496, 581, 720, + /* 260 */ 628, 724, 100, 725, 726, 744, 745, 751, 612, 737, + /* 270 */ 764, 785, 787, 791, 792, 816, 676, 1048, 1054, 995, + /* 280 */ 1058, 1021, 909, 1023, 1026, 1032, 912, 1072, 1042, 1043, + /* 290 */ 931, 1084, 1049, 1086, 1052, 1089, 1022, 951, 953, 991, + /* 300 */ 959, 1096, 1103, 1057, 970, 1112, 1114, 1035, 1117, 1118, + /* 310 */ 1120, 1122, 1124, 1125, 1128, 1129, 1130, 1131, 1132, 1133, + /* 320 */ 1134, 1024, 1140, 1141, 1148, 1150, 1151, 1152, 1135, 1153, + /* 330 */ 1155, 1156, 1158, 1160, 1161, 1165, 1166, 1169, 1127, 1171, + /* 340 */ 1126, 1172, 1175, 1138, 1142, 1146, 1177, 1191, 1192, 1193, + /* 350 */ 1119, 1123, 1164, 1136, 1174, 1198, 1168, 1170, 1178, 1179, + /* 360 */ 1136, 1180, 1181, 1207, 1188, 1212, 1202, 1197, 1213, 1208, + /* 370 */ 1199, 1243, 1219, 1244, 1223, 1227, 1246, 1121, 1106, 1216, + /* 380 */ 1258, 1116, 1238, 1139, 1143, 1262, 1266, 1147, 1280, 1215, + /* 390 */ 1242, 1183, 1224, 1228, 1137, 1233, 1229, 1234, 1217, 1225, + /* 400 */ 1236, 1250, 1245, 1230, 1256, 1260, 1154, 1267, 1268, 1247, + /* 410 */ 1162, 1276, 1254, 1274, 1279, 1173, 1344, 1311, 1317, 1319, + /* 420 */ 1320, 1322, 1323, 1360, 1210, 1282, 1299, 1302, 1303, 1304, + /* 430 */ 1305, 1307, 1308, 1252, 1309, 1373, 1340, 1259, 1316, 1310, + /* 440 */ 1306, 1312, 1364, 1321, 1314, 1318, 1353, 1354, 1326, 1328, + /* 450 */ 1361, 1331, 1332, 1363, 1334, 1335, 1366, 1337, 1338, 1369, + /* 460 */ 1341, 1315, 1324, 1325, 1327, 1389, 1330, 1345, 1375, 1313, + /* 470 */ 1346, 1347, 1382, 1136, 1400, 1376, 1378, 1401, 1388, 1390, + /* 480 */ 1391, 1392, 1393, 1394, 1395, 1405, 1396, 1136, 1397, 1398, + /* 490 */ 1399, 1402, 1403, 1404, 1406, 1407, 1438, 1408, 1411, 1409, + /* 500 */ 1439, 1410, 1412, 1443, 1450, 1429, 1432, 1433, 1434, 1436, + /* 510 */ 1440, }; #define YY_REDUCE_COUNT (215) #define YY_REDUCE_MIN (-226) -#define YY_REDUCE_MAX (1051) +#define YY_REDUCE_MAX (1077) static const short yy_reduce_ofst[] = { /* 0 */ -180, 262, 495, -198, -58, 447, 538, 574, -129, 601, /* 10 */ 656, -14, 617, 700, 705, 762, 176, 767, 803, 811, /* 20 */ 837, 846, 873, 881, 917, 922, 958, 963, 969, 1010, - /* 30 */ 1025, 1036, 1051, -195, -170, -147, 197, -213, -204, 41, - /* 40 */ -209, -206, 247, -132, -208, -175, -1, 11, 111, 121, - /* 50 */ 318, -142, -176, -40, 118, -62, -214, 189, 335, -6, - /* 60 */ 354, 232, 110, 97, 314, 355, -55, -201, -156, -156, - /* 70 */ -156, 173, -185, -107, 126, 208, 259, 308, 310, 339, - /* 80 */ 362, 371, 388, 389, 390, 391, 406, 434, 435, 436, - /* 90 */ 437, 438, 440, 441, 122, 281, 329, 413, 414, 467, - /* 100 */ -10, 172, 65, -149, 338, 161, -226, -221, 387, 490, - /* 110 */ 497, 500, 454, 539, 530, 451, 456, 519, 475, 548, - /* 120 */ 503, 501, 501, 501, 552, 487, 511, 587, 555, 599, - /* 130 */ 571, 614, 619, 592, 602, 606, 636, 594, 628, 625, - /* 140 */ 664, 647, 642, 677, 678, 685, 679, 694, 676, 680, - /* 150 */ 682, 683, 688, 689, 690, 692, 697, 698, 699, 712, - /* 160 */ 713, 693, 723, 674, 655, 684, 691, 695, 725, 704, - /* 170 */ 707, 731, 687, 651, 714, 727, 666, 728, 730, 732, - /* 180 */ 671, 696, 702, 708, 501, 748, 729, 710, 703, 716, - /* 190 */ 724, 733, 552, 749, 745, 752, 750, 754, 759, 773, - /* 200 */ 769, 801, 798, 802, 786, 794, 806, 819, 813, 825, - /* 210 */ 831, 789, 820, 821, 827, 842, + /* 30 */ 1025, 1036, 1051, 1077, -195, -170, -147, 197, -213, -204, + /* 40 */ 41, -209, -206, 247, -132, -208, -175, -1, 11, 111, + /* 50 */ 121, 318, -142, -176, 118, -62, -214, 189, 335, -6, + /* 60 */ 354, 232, -49, 97, 314, 355, -55, -201, -156, -156, + /* 70 */ -156, 171, -185, -107, 126, 106, 169, 208, 259, 308, + /* 80 */ 310, 339, 364, 371, 390, 391, 430, 434, 435, 436, + /* 90 */ 437, 438, 440, 441, 212, 329, 375, 413, 414, 469, + /* 100 */ -10, 370, 181, -149, 313, 80, -226, -221, 229, 362, + /* 110 */ 451, 459, 452, 503, 499, 445, 456, 505, 475, 557, + /* 120 */ 536, 509, 509, 509, 573, 511, 530, 613, 567, 615, + /* 130 */ 583, 634, 636, 600, 637, 638, 640, 622, 642, 635, + /* 140 */ 675, 657, 648, 683, 685, 690, 689, 699, 682, 686, + /* 150 */ 688, 692, 697, 698, 703, 704, 708, 709, 711, 710, + /* 160 */ 712, 696, 735, 695, 658, 660, 716, 693, 730, 713, + /* 170 */ 707, 731, 687, 667, 714, 727, 680, 728, 732, 736, + /* 180 */ 691, 715, 719, 717, 509, 749, 729, 718, 739, 723, + /* 190 */ 740, 741, 573, 748, 750, 754, 759, 755, 753, 766, + /* 200 */ 771, 808, 799, 810, 780, 806, 819, 824, 812, 814, + /* 210 */ 833, 793, 821, 825, 836, 849, }; static const YYACTIONTYPE yy_default[] = { /* 0 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, @@ -614,7 +618,7 @@ static const YYACTIONTYPE yy_default[] = { /* 20 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, /* 30 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, /* 40 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, - /* 50 */ 1205, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, + /* 50 */ 1152, 1205, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, /* 60 */ 1152, 1152, 1152, 1152, 1152, 1152, 1203, 1332, 1152, 1464, /* 70 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, /* 80 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, @@ -631,11 +635,11 @@ static const YYACTIONTYPE yy_default[] = { /* 190 */ 1526, 1152, 1152, 1504, 1152, 1152, 1504, 1152, 1345, 1152, /* 200 */ 1152, 1203, 1152, 1203, 1152, 1259, 1152, 1152, 1152, 1203, /* 210 */ 1152, 1360, 1293, 1293, 1206, 1157, 1152, 1152, 1152, 1152, - /* 220 */ 1152, 1152, 1152, 1152, 1152, 1428, 1517, 1516, 1427, 1441, - /* 230 */ 1440, 1439, 1152, 1152, 1152, 1152, 1422, 1423, 1421, 1420, - /* 240 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, - /* 250 */ 1152, 1152, 1152, 1152, 1465, 1152, 1527, 1531, 1152, 1152, - /* 260 */ 1152, 1405, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, + /* 220 */ 1152, 1152, 1152, 1152, 1152, 1152, 1428, 1517, 1516, 1427, + /* 230 */ 1441, 1440, 1439, 1152, 1152, 1152, 1152, 1422, 1423, 1421, + /* 240 */ 1420, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, + /* 250 */ 1152, 1152, 1152, 1152, 1152, 1465, 1152, 1527, 1531, 1152, + /* 260 */ 1152, 1152, 1405, 1152, 1152, 1152, 1152, 1152, 1152, 1152, /* 270 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, /* 280 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, /* 290 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, @@ -644,11 +648,11 @@ static const YYACTIONTYPE yy_default[] = { /* 320 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, /* 330 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, /* 340 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, - /* 350 */ 1152, 1152, 1304, 1152, 1152, 1152, 1152, 1152, 1152, 1229, - /* 360 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, + /* 350 */ 1152, 1152, 1152, 1304, 1152, 1152, 1152, 1152, 1152, 1152, + /* 360 */ 1229, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, /* 370 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, /* 380 */ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, - /* 390 */ 1152, 1488, 1498, 1152, 1152, 1152, 1152, 1152, 1152, 1152, + /* 390 */ 1152, 1152, 1488, 1498, 1152, 1152, 1152, 1152, 1152, 1152, /* 400 */ 1152, 1152, 1152, 1405, 1152, 1515, 1152, 1474, 1470, 1152, /* 410 */ 1152, 1466, 1152, 1152, 1525, 1152, 1152, 1152, 1152, 1152, /* 420 */ 1152, 1152, 1152, 1460, 1152, 1152, 1152, 1152, 1152, 1152, @@ -1424,7 +1428,7 @@ static const char *const yyRuleName[] = { /* 343 */ "partition_by_clause_opt ::= PARTITION BY expression_list", /* 344 */ "twindow_clause_opt ::=", /* 345 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 346 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP", + /* 346 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", /* 347 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", /* 348 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", /* 349 */ "sliding_opt ::=", @@ -2385,7 +2389,7 @@ static const struct { { 286, -3 }, /* (343) partition_by_clause_opt ::= PARTITION BY expression_list */ { 287, 0 }, /* (344) twindow_clause_opt ::= */ { 287, -6 }, /* (345) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 287, -4 }, /* (346) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ + { 287, -4 }, /* (346) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ { 287, -6 }, /* (347) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ { 287, -8 }, /* (348) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ { 247, 0 }, /* (349) sliding_opt ::= */ @@ -3590,7 +3594,7 @@ static YYACTIONTYPE yy_reduce( case 345: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ { yymsp[-5].minor.yy104 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } break; - case 346: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ + case 346: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ { yymsp[-3].minor.yy104 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } break; case 347: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index 149071bad20752a13c852fd1436b20740ea0e797..819eb6d699320d5797c7fffe5289775911c46b85 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -477,6 +477,18 @@ static int32_t createWindowLogicNodeFinalize(SLogicPlanContext* pCxt, SSelectStm return code; } +static int32_t createWindowLogicNodeByState(SLogicPlanContext* pCxt, SStateWindowNode* pState, SSelectStmt* pSelect, SLogicNode** pLogicNode) { + SWindowLogicNode* pWindow = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW); + if (NULL == pWindow) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + pWindow->winType = WINDOW_TYPE_STATE; + pWindow->pStateExpr = nodesCloneNode(pState->pExpr); + + return createWindowLogicNodeFinalize(pCxt, pSelect, pWindow, pLogicNode); +} + static int32_t createWindowLogicNodeBySession(SLogicPlanContext* pCxt, SSessionWindowNode* pSession, SSelectStmt* pSelect, SLogicNode** pLogicNode) { SWindowLogicNode* pWindow = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW); if (NULL == pWindow) { @@ -525,6 +537,8 @@ static int32_t createWindowLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSele } switch (nodeType(pSelect->pWindow)) { + case QUERY_NODE_STATE_WINDOW: + return createWindowLogicNodeByState(pCxt, (SStateWindowNode*)pSelect->pWindow, pSelect, pLogicNode); case QUERY_NODE_SESSION_WINDOW: return createWindowLogicNodeBySession(pCxt, (SSessionWindowNode*)pSelect->pWindow, pSelect, pLogicNode); case QUERY_NODE_INTERVAL_WINDOW: @@ -642,6 +656,29 @@ static int32_t createPartitionLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pS return TSDB_CODE_OUT_OF_MEMORY; } + SNodeList* pCols = NULL; + int32_t code = nodesCollectColumns(pSelect, SQL_CLAUSE_PARTITION_BY, NULL, &pCols); + if (TSDB_CODE_SUCCESS == code && NULL != pCols) { + pPartition->node.pTargets = nodesCloneList(pCols); + if (NULL == pPartition->node.pTargets) { + code = TSDB_CODE_OUT_OF_MEMORY; + } + } + + if (TSDB_CODE_SUCCESS == code) { + pPartition->pPartitionKeys = nodesCloneList(pSelect->pPartitionByList); + if (NULL == pPartition->pPartitionKeys) { + code = TSDB_CODE_OUT_OF_MEMORY; + } + } + + if (TSDB_CODE_SUCCESS == code) { + *pLogicNode = (SLogicNode*)pPartition; + } else { + nodesDestroyNode(pPartition); + } + + return code; return TSDB_CODE_SUCCESS; } @@ -650,7 +687,35 @@ static int32_t createDistinctLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSe return TSDB_CODE_SUCCESS; } - return TSDB_CODE_SUCCESS; + SAggLogicNode* pAgg = (SAggLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_AGG); + if (NULL == pAgg) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + int32_t code = TSDB_CODE_SUCCESS; + // set grouyp keys, agg funcs and having conditions + pAgg->pGroupKeys = nodesCloneList(pSelect->pProjectionList); + if (NULL == pAgg->pGroupKeys) { + code = TSDB_CODE_OUT_OF_MEMORY; + } + + // rewrite the expression in subsequent clauses + if (TSDB_CODE_SUCCESS == code) { + code = rewriteExpr(pAgg->pGroupKeys, pSelect, SQL_CLAUSE_SELECT); + } + + // set the output + if (TSDB_CODE_SUCCESS == code) { + code = createColumnByRewriteExps(pCxt, pAgg->pGroupKeys, &pAgg->node.pTargets); + } + + if (TSDB_CODE_SUCCESS == code) { + *pLogicNode = (SLogicNode*)pAgg; + } else { + nodesDestroyNode(pAgg); + } + + return code; } static int32_t createSelectLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SLogicNode** pLogicNode) { diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 04fe0d7da403fa64b496fc62244ea312f952d4ea..965c5c957935f4a4a361caf2b12b093aa02ccaf5 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -176,6 +176,10 @@ static int16_t getUnsetSlotId(const SArray* pSlotIdsInfo) { } static int32_t addDataBlockSlotsImpl(SPhysiPlanContext* pCxt, SNodeList* pList, SDataBlockDescNode* pDataBlockDesc, const char* pStmtName, bool output) { + if (NULL == pList) { + return TSDB_CODE_SUCCESS; + } + int32_t code = TSDB_CODE_SUCCESS; SHashObj* pHash = taosArrayGetP(pCxt->pLocationHelper, pDataBlockDesc->dataBlockId); int16_t nextSlotId = taosHashGetSize(pHash), slotId = 0; @@ -219,6 +223,23 @@ static int32_t addDataBlockSlots(SPhysiPlanContext* pCxt, SNodeList* pList, SDat return addDataBlockSlotsImpl(pCxt, pList, pDataBlockDesc, NULL, false); } +static int32_t addDataBlockSlot(SPhysiPlanContext* pCxt, SNode** pNode, SDataBlockDescNode* pDataBlockDesc) { + if (NULL == pNode || NULL == *pNode) { + return TSDB_CODE_SUCCESS; + } + + SNodeList* pList = NULL; + int32_t code = nodesListMakeAppend(&pList, *pNode); + if (TSDB_CODE_SUCCESS == code) { + code = addDataBlockSlots(pCxt, pList, pDataBlockDesc); + } + if (TSDB_CODE_SUCCESS == code) { + *pNode = nodesListGetNode(pList, 0); + } + nodesClearList(pList); + return code; +} + static int32_t addDataBlockSlotsForProject(SPhysiPlanContext* pCxt, const char* pStmtName, SNodeList* pList, SDataBlockDescNode* pDataBlockDesc) { return addDataBlockSlotsImpl(pCxt, pList, pDataBlockDesc, pStmtName, true); } @@ -244,6 +265,7 @@ static EDealRes doSetSlotId(SNode* pNode, void* pContext) { } // pIndex is definitely not NULL, otherwise it is a bug if (NULL == pIndex) { + pCxt->errCode = TSDB_CODE_PLAN_INTERNAL_ERROR; return DEAL_RES_ERROR; } ((SColumnNode*)pNode)->dataBlockId = pIndex->dataBlockId; @@ -614,6 +636,25 @@ static int32_t rewritePrecalcExprs(SPhysiPlanContext* pCxt, SNodeList* pList, SN return cxt.errCode; } +static int32_t rewritePrecalcExpr(SPhysiPlanContext* pCxt, SNode* pNode, SNodeList** pPrecalcExprs, SNode** pRewritten) { + if (NULL == pNode) { + return TSDB_CODE_SUCCESS; + } + + SNodeList* pList = NULL; + int32_t code = nodesListMakeAppend(&pList, pNode); + SNodeList* pRewrittenList = NULL; + if (TSDB_CODE_SUCCESS == code) { + code = rewritePrecalcExprs(pCxt, pList, pPrecalcExprs, &pRewrittenList); + } + if (TSDB_CODE_SUCCESS == code) { + *pRewritten = nodesListGetNode(pRewrittenList, 0); + } + nodesClearList(pList); + nodesClearList(pRewrittenList); + return code; +} + static int32_t createAggPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, SAggLogicNode* pAggLogicNode, SPhysiNode** pPhyNode) { SAggPhysiNode* pAgg = (SAggPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pAggLogicNode, QUERY_NODE_PHYSICAL_PLAN_AGG); if (NULL == pAgg) { @@ -818,6 +859,40 @@ static int32_t createSessionWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* return createWindowPhysiNodeFinalize(pCxt, pChildren, &pSession->window, pWindowLogicNode, pPhyNode); } +static int32_t createStateWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, SWindowLogicNode* pWindowLogicNode, SPhysiNode** pPhyNode) { + SStateWinodwPhysiNode* pState = (SStateWinodwPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pWindowLogicNode, QUERY_NODE_PHYSICAL_PLAN_STATE_WINDOW); + if (NULL == pState) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + SNodeList* pPrecalcExprs = NULL; + SNode* pStateKey = NULL; + int32_t code = rewritePrecalcExpr(pCxt, pWindowLogicNode->pStateExpr, &pPrecalcExprs, &pStateKey); + + 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, &pState->window.pExprs); + if (TSDB_CODE_SUCCESS == code) { + code = addDataBlockSlots(pCxt, pState->window.pExprs, pChildTupe); + } + } + + if (TSDB_CODE_SUCCESS == code) { + code = setNodeSlotId(pCxt, pChildTupe->dataBlockId, -1, pStateKey, &pState->pStateKey); + if (TSDB_CODE_SUCCESS == code) { + code = addDataBlockSlot(pCxt, &pState->pStateKey, pState->window.node.pOutputDataBlockDesc); + } + } + + if (TSDB_CODE_SUCCESS != code) { + nodesDestroyNode(pState); + return code; + } + + return createWindowPhysiNodeFinalize(pCxt, pChildren, &pState->window, pWindowLogicNode, pPhyNode); +} + static int32_t createWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, SWindowLogicNode* pWindowLogicNode, SPhysiNode** pPhyNode) { switch (pWindowLogicNode->winType) { case WINDOW_TYPE_INTERVAL: @@ -825,7 +900,7 @@ static int32_t createWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildr case WINDOW_TYPE_SESSION: return createSessionWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); case WINDOW_TYPE_STATE: - break; + return createStateWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); default: break; } @@ -867,6 +942,41 @@ static int32_t createSortPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren return code; } +static int32_t createPartitionPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, SPartitionLogicNode* pPartLogicNode, SPhysiNode** pPhyNode) { + SPartitionPhysiNode* pPart = (SPartitionPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pPartLogicNode, QUERY_NODE_PHYSICAL_PLAN_PARTITION); + if (NULL == pPart) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + SNodeList* pPrecalcExprs = NULL; + SNodeList* pPartitionKeys = NULL; + int32_t code = rewritePrecalcExprs(pCxt, pPartLogicNode->pPartitionKeys, &pPrecalcExprs, &pPartitionKeys); + + 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, &pPart->pExprs); + if (TSDB_CODE_SUCCESS == code) { + code = addDataBlockSlots(pCxt, pPart->pExprs, pChildTupe); + } + } + + if (TSDB_CODE_SUCCESS == code) { + code = setListSlotId(pCxt, pChildTupe->dataBlockId, -1, pPartitionKeys, &pPart->pPartitionKeys); + if (TSDB_CODE_SUCCESS == code) { + code = addDataBlockSlots(pCxt, pPart->pPartitionKeys, pPart->node.pOutputDataBlockDesc); + } + } + + if (TSDB_CODE_SUCCESS == code) { + *pPhyNode = (SPhysiNode*)pPart; + } else { + nodesDestroyNode(pPart); + } + + return code; +} + static int32_t doCreatePhysiNode(SPhysiPlanContext* pCxt, SLogicNode* pLogicNode, SSubplan* pSubplan, SNodeList* pChildren, SPhysiNode** pPhyNode) { switch (nodeType(pLogicNode)) { case QUERY_NODE_LOGIC_PLAN_SCAN: @@ -883,6 +993,8 @@ static int32_t doCreatePhysiNode(SPhysiPlanContext* pCxt, SLogicNode* pLogicNode return createWindowPhysiNode(pCxt, pChildren, (SWindowLogicNode*)pLogicNode, pPhyNode); case QUERY_NODE_LOGIC_PLAN_SORT: return createSortPhysiNode(pCxt, pChildren, (SSortLogicNode*)pLogicNode, pPhyNode); + case QUERY_NODE_LOGIC_PLAN_PARTITION: + return createPartitionPhysiNode(pCxt, pChildren, (SPartitionLogicNode*)pLogicNode, pPhyNode); default: break; } diff --git a/source/libs/planner/test/plannerTest.cpp b/source/libs/planner/test/plannerTest.cpp index 32b221c4fb36984d5e6f8898a39c4d2a68a52020..7f79fc6a5a4750b746591888796acaf2321f0d25 100644 --- a/source/libs/planner/test/plannerTest.cpp +++ b/source/libs/planner/test/plannerTest.cpp @@ -217,6 +217,32 @@ TEST_F(PlannerTest, sessionWindow) { ASSERT_TRUE(run()); } +TEST_F(PlannerTest, stateWindow) { + setDatabase("root", "test"); + + bind("SELECT count(*) FROM t1 state_window(c1)"); + ASSERT_TRUE(run()); + + bind("SELECT count(*) FROM t1 state_window(c1 + 10)"); + ASSERT_TRUE(run()); +} + +TEST_F(PlannerTest, partitionBy) { + setDatabase("root", "test"); + + bind("SELECT * FROM t1 partition by c1"); + ASSERT_TRUE(run()); + + bind("SELECT count(*) FROM t1 partition by c1"); + ASSERT_TRUE(run()); + + bind("SELECT count(*) FROM t1 partition by c1 group by c2"); + ASSERT_TRUE(run()); + + bind("SELECT count(*) FROM st1 partition by tag1, tag2 interval(10s)"); + ASSERT_TRUE(run()); +} + TEST_F(PlannerTest, orderBy) { setDatabase("root", "test"); @@ -230,6 +256,19 @@ TEST_F(PlannerTest, orderBy) { ASSERT_TRUE(run()); } +TEST_F(PlannerTest, distinct) { + setDatabase("root", "test"); + + bind("SELECT distinct c1 FROM t1"); + ASSERT_TRUE(run()); + + bind("SELECT distinct c1, c2 + 10 FROM t1"); + ASSERT_TRUE(run()); + + bind("SELECT distinct c1 + 10 a FROM t1 order by a"); + ASSERT_TRUE(run()); +} + TEST_F(PlannerTest, limit) { setDatabase("root", "test"); diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 90fa624a8d3bedc224c07912fd1e435217f07bfe..38cd5fad4bbb3f67f2649907804df05ef84e5049 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -432,6 +432,9 @@ TAOS_DEFINE_ERROR(TSDB_CODE_SCH_STATUS_ERROR, "scheduler status erro TAOS_DEFINE_ERROR(TSDB_CODE_SCH_INTERNAL_ERROR, "scheduler internal error") TAOS_DEFINE_ERROR(TSDB_CODE_QW_MSG_ERROR, "Invalid msg order") +//planner +TAOS_DEFINE_ERROR(TSDB_CODE_PLAN_INTERNAL_ERROR, "planner internal error") + #ifdef TAOS_ERROR_C }; #endif