From e17a105eff754d4602d6dbe3f6c8d8228affa70a Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 12 May 2023 18:14:43 +0800 Subject: [PATCH 01/12] feat:[TD-23117] add schema for ins_topics --- include/util/tdef.h | 1 + source/common/src/systable.c | 4 +- source/dnode/mnode/impl/inc/mndDb.h | 1 + source/dnode/mnode/impl/inc/mndDef.h | 1 + source/dnode/mnode/impl/src/mndDb.c | 7 ++ source/dnode/mnode/impl/src/mndDump.c | 1 + source/dnode/mnode/impl/src/mndTopic.c | 81 ++++++++++++++++++++++ tests/system-test/7-tmq/ins_topics_test.py | 59 ++++++++++++++++ 8 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 tests/system-test/7-tmq/ins_topics_test.py diff --git a/include/util/tdef.h b/include/util/tdef.h index 71fb91dbcb..a4d88806a9 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -253,6 +253,7 @@ typedef enum ELogicConditionType { #define TSDB_IPv4ADDR_LEN 16 #define TSDB_FILENAME_LEN 128 #define TSDB_SHOW_SQL_LEN 2048 +#define TSDB_SHOW_SCHEMA_JSON_LEN TSDB_MAX_COLUMNS * 256 #define TSDB_SLOW_QUERY_SQL_LEN 512 #define TSDB_SHOW_SUBQUERY_LEN 1000 diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 062bae68c8..db0cc78de6 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -280,7 +280,9 @@ static const SSysDbTableSchema topicSchema[] = { {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, {.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = false}, {.name = "sql", .bytes = TSDB_SHOW_SQL_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, - // TODO config + {.name = "schema", .bytes = TSDB_SHOW_SCHEMA_JSON_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, + {.name = "meta", .bytes = 4 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, + {.name = "type", .bytes = 8 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, }; diff --git a/source/dnode/mnode/impl/inc/mndDb.h b/source/dnode/mnode/impl/inc/mndDb.h index 97d047d7a3..4411cb4785 100644 --- a/source/dnode/mnode/impl/inc/mndDb.h +++ b/source/dnode/mnode/impl/inc/mndDb.h @@ -32,6 +32,7 @@ bool mndIsDbReady(SMnode *pMnode, SDbObj *pDb); SSdbRaw *mndDbActionEncode(SDbObj *pDb); const char *mndGetDbStr(const char *src); +const char *mndGetStableStr(const char *src); int32_t mndProcessCompactDbReq(SRpcMsg *pReq); diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 8d1a811f14..aee8872393 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -521,6 +521,7 @@ typedef struct { char* physicalPlan; SSchemaWrapper schema; int64_t stbUid; + char stbName[TSDB_TABLE_FNAME_LEN]; // forbid condition int64_t ntbUid; SArray* ntbColIds; diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index df22034068..de23eddbf9 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -1513,6 +1513,13 @@ const char *mndGetDbStr(const char *src) { return pos; } +const char *mndGetStableStr(const char *src) { + char *pos = strstr(src, TS_PATH_DELIMITER); + if (pos != NULL) ++pos; + if (pos == NULL) return src; + return mndGetDbStr(pos); +} + static int64_t getValOfDiffPrecision(int8_t unit, int64_t val) { int64_t v = 0; switch (unit) { diff --git a/source/dnode/mnode/impl/src/mndDump.c b/source/dnode/mnode/impl/src/mndDump.c index a991bddda8..d57053bb5b 100644 --- a/source/dnode/mnode/impl/src/mndDump.c +++ b/source/dnode/mnode/impl/src/mndDump.c @@ -285,6 +285,7 @@ void dumpTopic(SSdb *pSdb, SJson *json) { tjsonAddStringToObject(item, "subType", i642str(pObj->subType)); tjsonAddStringToObject(item, "withMeta", i642str(pObj->withMeta)); tjsonAddStringToObject(item, "stbUid", i642str(pObj->stbUid)); + tjsonAddStringToObject(item, "stbName", mndGetStableStr(pObj->stbName)); tjsonAddStringToObject(item, "sqlLen", i642str(pObj->sqlLen)); tjsonAddStringToObject(item, "astLen", i642str(pObj->astLen)); tjsonAddStringToObject(item, "sqlLen", i642str(pObj->sqlLen)); diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index f6da370916..b3f7176a93 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -109,6 +109,7 @@ SSdbRaw *mndTopicActionEncode(SMqTopicObj *pTopic) { SDB_SET_INT8(pRaw, dataPos, pTopic->withMeta, TOPIC_ENCODE_OVER); SDB_SET_INT64(pRaw, dataPos, pTopic->stbUid, TOPIC_ENCODE_OVER); + SDB_SET_BINARY(pRaw, dataPos, pTopic->stbName, TSDB_TABLE_FNAME_LEN, TOPIC_ENCODE_OVER); SDB_SET_INT32(pRaw, dataPos, pTopic->sqlLen, TOPIC_ENCODE_OVER); SDB_SET_BINARY(pRaw, dataPos, pTopic->sql, pTopic->sqlLen, TOPIC_ENCODE_OVER); SDB_SET_INT32(pRaw, dataPos, pTopic->astLen, TOPIC_ENCODE_OVER); @@ -196,6 +197,7 @@ SSdbRow *mndTopicActionDecode(SSdbRaw *pRaw) { SDB_GET_INT8(pRaw, dataPos, &pTopic->withMeta, TOPIC_DECODE_OVER); SDB_GET_INT64(pRaw, dataPos, &pTopic->stbUid, TOPIC_DECODE_OVER); + SDB_GET_BINARY(pRaw, dataPos, pTopic->stbName, TSDB_TABLE_FNAME_LEN, TOPIC_DECODE_OVER); SDB_GET_INT32(pRaw, dataPos, &pTopic->sqlLen, TOPIC_DECODE_OVER); pTopic->sql = taosMemoryCalloc(pTopic->sqlLen, sizeof(char)); if (pTopic->sql == NULL) { @@ -460,6 +462,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq * return -1; } + strcpy(topicObj.stbName, pCreate->subStbName); topicObj.stbUid = pStb->uid; mndReleaseStb(pMnode, pStb); } @@ -830,6 +833,43 @@ int32_t mndGetNumOfTopics(SMnode *pMnode, char *dbName, int32_t *pNumOfTopics) { return 0; } +static void schemaToJson(SSchema *schema, int32_t nCols, char *schemaJson){ + char* string = NULL; + cJSON* columns = cJSON_CreateArray(); + if (columns == NULL) { + return; + } + for (int i = 0; i < nCols; i++) { + cJSON* column = cJSON_CreateObject(); + SSchema* s = schema + i; + cJSON* cname = cJSON_CreateString(s->name); + cJSON_AddItemToObject(column, "name", cname); + cJSON* ctype = cJSON_CreateString(tDataTypes[s->type].name); + cJSON_AddItemToObject(column, "type", ctype); + int32_t length = 0; + if (s->type == TSDB_DATA_TYPE_BINARY) { + length = s->bytes - VARSTR_HEADER_SIZE; + } else if (s->type == TSDB_DATA_TYPE_NCHAR || s->type == TSDB_DATA_TYPE_JSON) { + length = (s->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE; + } else{ + length = s->bytes; + } + cJSON* cbytes = cJSON_CreateNumber(length); + cJSON_AddItemToObject(column, "length", cbytes); + cJSON_AddItemToArray(columns, column); + } + string = cJSON_PrintUnformatted(columns); + cJSON_Delete(columns); + + size_t len = strlen(string); + if(string && len <= TSDB_SHOW_SCHEMA_JSON_LEN){ + STR_TO_VARSTR(schemaJson, string); + }else{ + mError("mndRetrieveTopic build schema error json:%p, json len:%zu", string, len); + } + taosMemoryFree(string); +} + static int32_t mndRetrieveTopic(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rowsCapacity) { SMnode *pMnode = pReq->info.node; SSdb *pSdb = pMnode->pSdb; @@ -868,6 +908,47 @@ static int32_t mndRetrieveTopic(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataSetVal(pColInfo, numOfRows, (const char *)sql, false); + char schemaJson[TSDB_SHOW_SCHEMA_JSON_LEN + VARSTR_HEADER_SIZE] = {0}; + if(pTopic->subType == TOPIC_SUB_TYPE__COLUMN){ + schemaToJson(pTopic->schema.pSchema, pTopic->schema.nCols, schemaJson); + }else if(pTopic->subType == TOPIC_SUB_TYPE__TABLE){ + SStbObj *pStb = mndAcquireStb(pMnode, pTopic->stbName); + if (pStb == NULL) { + terrno = TSDB_CODE_MND_STB_NOT_EXIST; + return -1; + } + schemaToJson(pStb->pColumns, pStb->numOfColumns, schemaJson); + + mndReleaseStb(pMnode, pStb); + }else{ + STR_TO_VARSTR(schemaJson, "NULL"); + } + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)schemaJson, false); + + char mete[4 + VARSTR_HEADER_SIZE] = {0}; + if(pTopic->withMeta){ + STR_TO_VARSTR(mete, "yes"); + }else{ + STR_TO_VARSTR(mete, "no"); + } + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)mete, false); + + char type[8 + VARSTR_HEADER_SIZE] = {0}; + if(pTopic->subType == TOPIC_SUB_TYPE__COLUMN){ + STR_TO_VARSTR(type, "column"); + }else if(pTopic->subType == TOPIC_SUB_TYPE__TABLE){ + STR_TO_VARSTR(type, "stable"); + }else{ + STR_TO_VARSTR(type, "db"); + } + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)type, false); + numOfRows++; sdbRelease(pSdb, pTopic); } diff --git a/tests/system-test/7-tmq/ins_topics_test.py b/tests/system-test/7-tmq/ins_topics_test.py new file mode 100644 index 0000000000..54b6c141f5 --- /dev/null +++ b/tests/system-test/7-tmq/ins_topics_test.py @@ -0,0 +1,59 @@ + +import taos +import sys +import time +import socket +import os +import threading + +from util.log import * +from util.sql import * +from util.cases import * +from util.dnodes import * + +class TDTestCase: + hostname = socket.gethostname() + # rpcDebugFlagVal = '143' + #clientCfgDict = {'serverPort': '', 'firstEp': '', 'secondEp':'', 'rpcDebugFlag':'135', 'fqdn':''} + #clientCfgDict["rpcDebugFlag"] = rpcDebugFlagVal + #updatecfgDict = {'clientCfg': {}, 'serverPort': '', 'firstEp': '', 'secondEp':'', 'rpcDebugFlag':'135', 'fqdn':''} + # updatecfgDict["rpcDebugFlag"] = rpcDebugFlagVal + #print ("===================: ", updatecfgDict) + + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug(f"start to excute {__file__}") + tdSql.init(conn.cursor()) + #tdSql.init(conn.cursor(), logSql) # output sql.txt file + + def test(self): + tdLog.info("create database, stb, ctb") + tdSql.execute("create database if not exists db1 vgroups 4 wal_retention_period 3600") + tdSql.execute("create table if not exists db1.st(ts timestamp, c1 int, c2 bool, c3 tinyint, c4 double, c5 nchar(8)) tags(t1 int, t2 float, t3 binary(4))") + tdSql.execute("create table if not exists db1.nt(ts timestamp, c1 smallint, c2 float, c3 binary(64), c4 bigint)") + tdSql.execute("create table if not exists db1.st1 using db1.st tags(1, 9.3, \"st1\")") + + tdLog.info("create topic") + tdSql.execute("create topic topic_1 as database db1") + tdSql.execute("create topic topic_2 as stable db1.st") + tdSql.execute("create topic topic_3 as select * from db1.nt") + tdSql.execute("create topic topic_4 as select ts,c3,c5 from db1.st") + + tdSql.query("select * from information_schema.ins_topics") + tdSql.checkRows(4) + # tdSql.checkData(0, 1, 51) + # tdSql.checkData(0, 4, 940) + # tdSql.checkData(1, 1, 23) + # tdSql.checkData(1, 4, None) + + tdLog.printNoPrefix("======== test case end ...... ") + + def run(self): + self.test() + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) From c95e314896a89dca7c4d65ecf07a004a08526fb6 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 12 May 2023 19:43:16 +0800 Subject: [PATCH 02/12] feat:[TD-23117] fix overflow in stack & add test case --- source/dnode/mnode/impl/src/mndTopic.c | 4 +++- tests/system-test/7-tmq/ins_topics_test.py | 22 +++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index b3f7176a93..95524c0323 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -908,13 +908,14 @@ static int32_t mndRetrieveTopic(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataSetVal(pColInfo, numOfRows, (const char *)sql, false); - char schemaJson[TSDB_SHOW_SCHEMA_JSON_LEN + VARSTR_HEADER_SIZE] = {0}; + char *schemaJson = taosMemoryMalloc(TSDB_SHOW_SCHEMA_JSON_LEN + VARSTR_HEADER_SIZE); if(pTopic->subType == TOPIC_SUB_TYPE__COLUMN){ schemaToJson(pTopic->schema.pSchema, pTopic->schema.nCols, schemaJson); }else if(pTopic->subType == TOPIC_SUB_TYPE__TABLE){ SStbObj *pStb = mndAcquireStb(pMnode, pTopic->stbName); if (pStb == NULL) { terrno = TSDB_CODE_MND_STB_NOT_EXIST; + taosMemoryFree(schemaJson); return -1; } schemaToJson(pStb->pColumns, pStb->numOfColumns, schemaJson); @@ -926,6 +927,7 @@ static int32_t mndRetrieveTopic(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataSetVal(pColInfo, numOfRows, (const char *)schemaJson, false); + taosMemoryFree(schemaJson); char mete[4 + VARSTR_HEADER_SIZE] = {0}; if(pTopic->withMeta){ diff --git a/tests/system-test/7-tmq/ins_topics_test.py b/tests/system-test/7-tmq/ins_topics_test.py index 54b6c141f5..8bf0a7e91a 100644 --- a/tests/system-test/7-tmq/ins_topics_test.py +++ b/tests/system-test/7-tmq/ins_topics_test.py @@ -35,16 +35,24 @@ class TDTestCase: tdLog.info("create topic") tdSql.execute("create topic topic_1 as database db1") - tdSql.execute("create topic topic_2 as stable db1.st") + tdSql.execute("create topic topic_2 with meta as stable db1.st") tdSql.execute("create topic topic_3 as select * from db1.nt") - tdSql.execute("create topic topic_4 as select ts,c3,c5 from db1.st") + tdSql.execute("create topic topic_4 as select ts,c3,c5,t2 from db1.st") - tdSql.query("select * from information_schema.ins_topics") + tdSql.query("select * from information_schema.ins_topics order by topic_name") tdSql.checkRows(4) - # tdSql.checkData(0, 1, 51) - # tdSql.checkData(0, 4, 940) - # tdSql.checkData(1, 1, 23) - # tdSql.checkData(1, 4, None) + tdSql.checkData(0, 4, "NULL") + tdSql.checkData(0, 5, "no") + tdSql.checkData(0, 6, "db") + tdSql.checkData(1, 4, "[{\"name\":\"ts\",\"type\":\"TIMESTAMP\",\"length\":8},{\"name\":\"c1\",\"type\":\"INT\",\"length\":4},{\"name\":\"c2\",\"type\":\"BOOL\",\"length\":1},{\"name\":\"c3\",\"type\":\"TINYINT\",\"length\":1},{\"name\":\"c4\",\"type\":\"DOUBLE\",\"length\":8},{\"name\":\"c5\",\"type\":\"NCHAR\",\"length\":8}]") + tdSql.checkData(1, 5, "yes") + tdSql.checkData(1, 6, "stable") + tdSql.checkData(2, 4, "[{\"name\":\"ts\",\"type\":\"TIMESTAMP\",\"length\":8},{\"name\":\"c1\",\"type\":\"SMALLINT\",\"length\":2},{\"name\":\"c2\",\"type\":\"FLOAT\",\"length\":4},{\"name\":\"c3\",\"type\":\"VARCHAR\",\"length\":64},{\"name\":\"c4\",\"type\":\"BIGINT\",\"length\":8}]") + tdSql.checkData(2, 5, "no") + tdSql.checkData(2, 6, "column") + tdSql.checkData(3, 4, "[{\"name\":\"ts\",\"type\":\"TIMESTAMP\",\"length\":8},{\"name\":\"c3\",\"type\":\"TINYINT\",\"length\":1},{\"name\":\"c5\",\"type\":\"NCHAR\",\"length\":8},{\"name\":\"t2\",\"type\":\"FLOAT\",\"length\":4}]") + tdSql.checkData(3, 5, "no") + tdSql.checkData(3, 6, "column") tdLog.printNoPrefix("======== test case end ...... ") From b9c613da75d8d2b0d83b62ddb5a4b62a8c75965b Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Mon, 22 May 2023 18:36:47 +0800 Subject: [PATCH 03/12] fix:ci error --- tests/system-test/2-query/odbc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/2-query/odbc.py b/tests/system-test/2-query/odbc.py index f7851ad04b..c8ece250d5 100644 --- a/tests/system-test/2-query/odbc.py +++ b/tests/system-test/2-query/odbc.py @@ -23,7 +23,7 @@ class TDTestCase: tdSql.query("select count(*) from information_schema.ins_columns") # enterprise version: 285, community version: 277 - tdSql.checkData(0, 0, 285) + tdSql.checkData(0, 0, 288) tdSql.query("select * from information_schema.ins_columns where table_name = 'ntb'") tdSql.checkRows(14) From 18e83173c8c58f9edbc56b6ab45961bf3f133b1c Mon Sep 17 00:00:00 2001 From: kailixu Date: Tue, 23 May 2023 17:21:45 +0800 Subject: [PATCH 04/12] fix: delete index filter for desc query --- source/dnode/vnode/src/tsdb/tsdbRead.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 247bc5d0b2..1263140b1c 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -1767,6 +1767,9 @@ static bool overlapWithDelSkyline(STableBlockScanInfo* pBlockScanInfo, const SDa if (p->ts > pBlock->minKey.ts && index > 0) { index -= 1; } else { // find the first point that is smaller than the minKey.ts of dataBlock. + if (p->version == 0 && p->ts == pBlock->minKey.ts && index > 0) { + --index; + } break; } } From fc618d7978ee54435e494ae07bf51561b8368219 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 23 May 2023 17:52:24 +0800 Subject: [PATCH 05/12] fix:modify ci --- tests/system-test/2-query/odbc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/2-query/odbc.py b/tests/system-test/2-query/odbc.py index c8ece250d5..5241406b65 100644 --- a/tests/system-test/2-query/odbc.py +++ b/tests/system-test/2-query/odbc.py @@ -22,7 +22,7 @@ class TDTestCase: tdSql.execute("insert into db.ctb using db.stb tags(1) (ts, c1) values (now, 1)") tdSql.query("select count(*) from information_schema.ins_columns") - # enterprise version: 285, community version: 277 + # enterprise version: 288, community version: 280 tdSql.checkData(0, 0, 288) tdSql.query("select * from information_schema.ins_columns where table_name = 'ntb'") From 82b8c3c3d1f41ff81f80db3fbad241931c5953d4 Mon Sep 17 00:00:00 2001 From: kailixu Date: Tue, 23 May 2023 18:21:21 +0800 Subject: [PATCH 06/12] fix: delete index filter for desc query --- source/dnode/vnode/src/tsdb/tsdbRead.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 1263140b1c..5637fe1eaf 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -1767,8 +1767,8 @@ static bool overlapWithDelSkyline(STableBlockScanInfo* pBlockScanInfo, const SDa if (p->ts > pBlock->minKey.ts && index > 0) { index -= 1; } else { // find the first point that is smaller than the minKey.ts of dataBlock. - if (p->version == 0 && p->ts == pBlock->minKey.ts && index > 0) { - --index; + if (p->version == 0 && p->ts == pBlock->minKey.ts) { + index -= 1; // index always larger than 0 if p->version equals 0 } break; } From ab3d54aae3bb629e3ab57bf96efb3de5ca6c863a Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 24 May 2023 11:08:41 +0800 Subject: [PATCH 07/12] comfirm msg when add learner --- source/dnode/mnode/impl/src/mndVgroup.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 7691f0f8f4..b7a6378bd8 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -2117,27 +2117,32 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb mInfo("db:%s, vgId:%d, will add 2 vnodes, vn:0 dnode:%d", pVgroup->dbName, pVgroup->vgId, pVgroup->vnodeGid[0].dnodeId); - //add first + //add second if (mndAddVnodeToVgroup(pMnode, pTrans, &newVgroup, pArray) != 0) return -1; + //learner stage newVgroup.vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_LEARNER; if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[1]) != 0) return -1; + + //follower stage newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; if (mndAddAlterVnodeTypeAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; - //add second + //add third if (mndAddVnodeToVgroup(pMnode, pTrans, &newVgroup, pArray) != 0) return -1; + newVgroup.vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; newVgroup.vnodeGid[2].nodeRole = TAOS_SYNC_ROLE_VOTER; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) From ef899a0cc3cb9ff0366dc902678d109c57d4972d Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 24 May 2023 11:28:45 +0800 Subject: [PATCH 08/12] fix: delete index filter for desc query --- source/dnode/vnode/src/tsdb/tsdbRead.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 5637fe1eaf..b4b090249e 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -1767,8 +1767,8 @@ static bool overlapWithDelSkyline(STableBlockScanInfo* pBlockScanInfo, const SDa if (p->ts > pBlock->minKey.ts && index > 0) { index -= 1; } else { // find the first point that is smaller than the minKey.ts of dataBlock. - if (p->version == 0 && p->ts == pBlock->minKey.ts) { - index -= 1; // index always larger than 0 if p->version equals 0 + if (p->ts == pBlock->minKey.ts && p->version < pBlock->maxVer && index > 0) { + index -= 1; } break; } From 984211f3b49aef880d51c1cdab4bb6a65e2804a0 Mon Sep 17 00:00:00 2001 From: Dingle Zhang Date: Wed, 24 May 2023 15:36:46 +0800 Subject: [PATCH 09/12] Feature/3.0 geometry (#21037) * Add GEOMETRY data type and make sql.c able to parse it. The GEMETRY works like BINARY so far. * add GEOMETRY type into gConvertTypes to fix some issues like DELETE calling * change some test cases to make sure no same timestamp is inserted, and add my smoketest.sh * Add a function MakePoint() and introduce a lib geometry * implement sql functions GeomFromText() and AsText() * Use GEOS *_r funcions instead for thread safety * Handle with TSDB_DATA_TYPE_GEOMETRY when INSERT geometry data by converting WKT. Add geosWrapper to wrap the basic GEOS functions for TDEngine. * refactor AsText and MakePoint functions to be like GeomFromText * Show WKT when print geometry data in screen Dump hex data when dump geometry data in a file * define TYPE_BYTES item for TSDB_DATA_TYPE_GEOMETRY, which casued some strange issues. * set number of decimals of WKT to 6 * Implement SQL function Intersects() * refactor geometry sql functions * Add geosErrMsgeHandler() to get the GEOS error detail * use threadlocal to instantiate SGeosContext call destroyGeosContext() only if the thread exists * remove SGeosContext *context param for all geometry functions since we use thread local one, so that all caller do not need to know the context. * Modify Intersects() to call PreparedIntersects() when one of param is a constant, which has higher performance. * rename prepareFn() to initCtxFn() to avoid confusion with PreparedFn * Add prefix "ST_" for all geometry functions * move getThreadLocalGeosCtx() and destroyThreadLocalGeosCtx() into util, so that all unit test tools can compile * Add unit test for geometry lib, only test MakePoint so far * refactor and enhance existing cases in geomFuncTest * implement NULL type and NULL value test for geomFuncTest * add test on geomFromText() * add unit test on AsText() in geomFuncTest * combine some makePointFunction test items * add intersectsFunctionTwoColumns test refactor on callGeomFromTextWrapper functions * enhance intersectsFunction test to add cases like input constant , NULL type, NULL value, or wrong content * add more cases into intersectsFunction test * Add basic test on geometry in system test * Add ST_GeomFromText and ST_AsText function test in system test on geometry * add ST_Intersects function test in system test on geometry * support to check expectedErrno in system test on geometry * adjust geomTest unit test and geometry system test * add geometry data type and functions in doc english version * implement touchesFunction() in geometry lib refactor geometry relation functions model * separate gemFuncTest into several src files * add unit test on touchesFunction * support sql function ST_Touches() add system test on ST_Touches * add docs for ST_Touches() * Add ST_Contains() * Add ST_Covers() * Add ST_Equals() * add swapAllowed param for geomRelationFunction() read geom2 earlier intead of at doGeosRelation() * Add ST_ContainsProperly() * build on windows * Merge from 3.0 to 3.0_geometry * change macro definition TSDB_DATA_TYPE_GEOMETRY as the last one for compatibility * change '\\NULL' to 'NULL' back in shellDumpFieldToFile() * add /usr/local/include into include directory * add /usr/local/inlcude and /usr/local/lib in cmake.platform for DARWIN --- README-CN.md | 6 +- README.md | 6 +- cmake/cmake.options | 7 + cmake/cmake.platform | 2 + cmake/geos_CMakeLists.txt.in | 12 + cmake/stub_CMakeLists.txt.in | 1 + contrib/CMakeLists.txt | 14 + docs/doxgen/CMakeLists.txt | 2 +- docs/en/12-taos-sql/01-data-type.md | 1 + docs/en/12-taos-sql/11-geometry-function.md | 160 + docs/examples/c/async_query_example.c | 3 +- docs/examples/c/query_example.c | 3 +- examples/lua/lua51/lua_connector51.c | 1 + examples/lua/lua_connector.c | 1 + include/client/taos.h | 3 +- include/common/ttokendef.h | 412 +- include/common/ttypes.h | 4 +- include/libs/function/functionMgt.h | 11 + include/libs/function/taosudf.h | 2 +- include/libs/geometry/geomFunc.h | 41 + include/libs/geometry/geosWrapper.h | 60 + include/util/tdef.h | 13 +- include/util/tgeosctx.h | 44 + source/client/src/clientImpl.c | 3 +- source/client/src/clientJniConnector.c | 3 +- source/client/src/clientMain.c | 7 +- source/client/src/clientRawBlockWrite.c | 12 +- source/client/src/clientSml.c | 8 +- source/common/src/tdatablock.c | 9 +- source/common/src/tdataformat.c | 6 +- source/common/src/trow.c | 5 +- source/common/src/ttszip.c | 4 +- source/common/src/ttypes.c | 5 +- source/common/src/tvariant.c | 10 +- source/common/test/dataformatTest.cpp | 6 +- source/dnode/mnode/impl/src/mndFunc.c | 2 +- source/dnode/mnode/impl/src/mndStb.c | 4 +- source/libs/CMakeLists.txt | 1 + source/libs/command/src/command.c | 7 +- source/libs/executor/src/executorInt.c | 2 +- source/libs/executor/src/timewindowoperator.c | 3 +- source/libs/executor/test/sortTests.cpp | 6 +- source/libs/function/CMakeLists.txt | 1 + source/libs/function/inc/functionMgtInt.h | 1 + source/libs/function/src/builtins.c | 155 + source/libs/geometry/CMakeLists.txt | 17 + source/libs/geometry/src/geomFunc.c | 444 + source/libs/geometry/src/geosWrapper.c | 352 + source/libs/geometry/test/CMakeLists.txt | 19 + source/libs/geometry/test/geomFuncTest.cpp | 24 + .../libs/geometry/test/geomFuncTestUtil.cpp | 129 + source/libs/geometry/test/geomFuncTestUtil.h | 28 + source/libs/geometry/test/geomIoFuncTest.cpp | 321 + .../geometry/test/geomRelationFuncTest.cpp | 239 + source/libs/index/src/indexCache.c | 2 +- source/libs/index/src/indexComm.c | 11 +- source/libs/index/src/indexJson.c | 4 +- source/libs/index/src/indexTfile.c | 3 +- source/libs/index/test/indexBench.cc | 2 +- source/libs/index/test/indexTests.cc | 2 +- source/libs/index/test/jsonUT.cc | 2 +- source/libs/nodes/src/nodesCloneFuncs.c | 3 +- source/libs/nodes/src/nodesCodeFuncs.c | 4 +- source/libs/nodes/src/nodesEqualFuncs.c | 1 + source/libs/nodes/src/nodesMsgFuncs.c | 4 +- source/libs/nodes/src/nodesUtilFuncs.c | 6 +- source/libs/parser/CMakeLists.txt | 2 +- source/libs/parser/inc/sql.y | 1 + source/libs/parser/src/parAstCreater.c | 2 +- source/libs/parser/src/parInsertSml.c | 7 +- source/libs/parser/src/parInsertSql.c | 55 +- source/libs/parser/src/parInsertStmt.c | 3 +- source/libs/parser/src/parTokenizer.c | 1 + source/libs/parser/src/parTranslater.c | 12 +- source/libs/parser/src/parser.c | 1 + source/libs/parser/src/sql.c | 7406 ++++++++--------- source/libs/planner/test/planStmtTest.cpp | 1 + source/libs/qcom/src/queryUtil.c | 5 + source/libs/scalar/src/filter.c | 16 +- source/libs/scalar/src/sclfunc.c | 5 +- source/libs/scalar/src/sclvector.c | 61 +- source/util/CMakeLists.txt | 4 +- source/util/src/tcompare.c | 8 +- source/util/src/tcompression.c | 8 + source/util/src/tgeosctx.c | 50 + source/util/src/thashutil.c | 1 + source/util/src/tsched.c | 3 + source/util/src/tskiplist.c | 1 + source/util/src/tworker.c | 3 + tests/pytest/util/sql.py | 21 +- tests/script/api/batchprepare.c | 28 +- tests/script/api/demoapi.c | 3 +- tests/script/api/stmt_function.c | 1 + tests/system-test/2-query/geometry.py | 257 + tools/shell/CMakeLists.txt | 2 +- tools/shell/src/shellEngine.c | 75 +- utils/test/c/tmqSim.c | 3 +- utils/tsim/src/simExe.c | 1 + 98 files changed, 6659 insertions(+), 4074 deletions(-) create mode 100644 cmake/geos_CMakeLists.txt.in create mode 100644 docs/en/12-taos-sql/11-geometry-function.md create mode 100644 include/libs/geometry/geomFunc.h create mode 100644 include/libs/geometry/geosWrapper.h create mode 100644 include/util/tgeosctx.h create mode 100644 source/libs/geometry/CMakeLists.txt create mode 100644 source/libs/geometry/src/geomFunc.c create mode 100644 source/libs/geometry/src/geosWrapper.c create mode 100644 source/libs/geometry/test/CMakeLists.txt create mode 100644 source/libs/geometry/test/geomFuncTest.cpp create mode 100644 source/libs/geometry/test/geomFuncTestUtil.cpp create mode 100644 source/libs/geometry/test/geomFuncTestUtil.h create mode 100644 source/libs/geometry/test/geomIoFuncTest.cpp create mode 100644 source/libs/geometry/test/geomRelationFuncTest.cpp create mode 100644 source/util/src/tgeosctx.c create mode 100644 tests/system-test/2-query/geometry.py diff --git a/README-CN.md b/README-CN.md index a6dfefc47a..aa52f38f0e 100644 --- a/README-CN.md +++ b/README-CN.md @@ -60,7 +60,7 @@ sudo apt-get install -y gcc cmake build-essential git libssl-dev libgflags2.2 li 为了在 Ubuntu/Debian 系统上编译 [taos-tools](https://github.com/taosdata/taos-tools) 需要安装如下软件: ```bash -sudo apt install build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config +sudo apt install build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config libgeos-dev ``` ### CentOS 7.9 @@ -85,7 +85,7 @@ sudo dnf install -y gcc gcc-c++ make cmake epel-release git openssl-devel ``` -sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel +sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel geos geos-devel ``` #### CentOS 8/Rocky Linux @@ -94,7 +94,7 @@ sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson sudo yum install -y epel-release sudo yum install -y dnf-plugins-core sudo yum config-manager --set-enabled powertools -sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel +sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel geos geos-devel ``` 注意:由于 snappy 缺乏 pkg-config 支持(参考 [链接](https://github.com/google/snappy/pull/86)),会导致 cmake 提示无法发现 libsnappy,实际上工作正常。 diff --git a/README.md b/README.md index a088404c85..50785dbb8e 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ sudo apt-get install -y gcc cmake build-essential git libssl-dev libgflags2.2 li To build the [taosTools](https://github.com/taosdata/taos-tools) on Ubuntu/Debian, the following packages need to be installed. ```bash -sudo apt install build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config +sudo apt install build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config libgeos-dev ``` ### CentOS 7.9 @@ -91,7 +91,7 @@ sudo dnf install -y gcc gcc-c++ make cmake epel-release git openssl-devel #### CentOS 7.9 ``` -sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel +sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel geos geos-devel ``` #### CentOS 8/Rocky Linux @@ -100,7 +100,7 @@ sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson sudo yum install -y epel-release sudo yum install -y dnf-plugins-core sudo yum config-manager --set-enabled powertools -sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel +sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel geos geos-devel ``` Note: Since snappy lacks pkg-config support (refer to [link](https://github.com/google/snappy/pull/86)), it leads a cmake prompt libsnappy not found. But snappy still works well. diff --git a/cmake/cmake.options b/cmake/cmake.options index a7e62350df..3bc5e202a5 100644 --- a/cmake/cmake.options +++ b/cmake/cmake.options @@ -64,6 +64,13 @@ IF(${TD_WINDOWS}) ON ) + MESSAGE("build geos Win32") + option( + BUILD_GEOS + "If build geos on Windows" + ON + ) + ELSEIF (TD_DARWIN_64) IF(${BUILD_TEST}) add_definitions(-DCOMPILER_SUPPORTS_CXX13) diff --git a/cmake/cmake.platform b/cmake/cmake.platform index ba747c6134..cb09bf2085 100644 --- a/cmake/cmake.platform +++ b/cmake/cmake.platform @@ -57,6 +57,8 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin SET(TD_DARWIN TRUE) SET(OSTYPE "macOS") ADD_DEFINITIONS("-DDARWIN -Wno-tautological-pointer-compare") + INCLUDE_DIRECTORIES(/usr/local/include) + LINK_DIRECTORIES(/usr/local/lib) IF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64") MESSAGE("Current system arch is arm64") diff --git a/cmake/geos_CMakeLists.txt.in b/cmake/geos_CMakeLists.txt.in new file mode 100644 index 0000000000..44b3ec027c --- /dev/null +++ b/cmake/geos_CMakeLists.txt.in @@ -0,0 +1,12 @@ + +# geos +ExternalProject_Add(geos + GIT_REPOSITORY https://github.com/libgeos/geos.git + GIT_TAG 3.11.2 + SOURCE_DIR "${TD_CONTRIB_DIR}/geos" + BINARY_DIR "" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) \ No newline at end of file diff --git a/cmake/stub_CMakeLists.txt.in b/cmake/stub_CMakeLists.txt.in index cf175aab42..96cc924d81 100644 --- a/cmake/stub_CMakeLists.txt.in +++ b/cmake/stub_CMakeLists.txt.in @@ -2,6 +2,7 @@ # stub ExternalProject_Add(stub GIT_REPOSITORY https://github.com/coolxv/cpp-stub.git + GIT_TAG 5e903b8e GIT_SUBMODULES "src" SOURCE_DIR "${TD_CONTRIB_DIR}/cpp-stub" BINARY_DIR "${TD_CONTRIB_DIR}/cpp-stub/src" diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 536d4eae8e..b3333dee99 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -134,6 +134,11 @@ if(${BUILD_ADDR2LINE}) endif(NOT ${TD_WINDOWS}) endif(${BUILD_ADDR2LINE}) +# geos +if(${BUILD_GEOS}) + cat("${TD_SUPPORT_DIR}/geos_CMakeLists.txt.in" ${CONTRIB_TMP_FILE}) +endif() + # download dependencies configure_file(${CONTRIB_TMP_FILE} "${TD_CONTRIB_DIR}/deps-download/CMakeLists.txt") execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . @@ -470,6 +475,15 @@ if(${BUILD_ADDR2LINE}) endif(NOT ${TD_WINDOWS}) endif(${BUILD_ADDR2LINE}) +# geos +if(${BUILD_GEOS}) + option(BUILD_SHARED_LIBS "Build GEOS with shared libraries" OFF) + add_subdirectory(geos EXCLUDE_FROM_ALL) + target_include_directories( + geos_c + PUBLIC $ + ) +endif(${BUILD_GEOS}) # ================================================================================================ # Build test diff --git a/docs/doxgen/CMakeLists.txt b/docs/doxgen/CMakeLists.txt index da76b2c3fd..9100137bb8 100644 --- a/docs/doxgen/CMakeLists.txt +++ b/docs/doxgen/CMakeLists.txt @@ -4,7 +4,7 @@ if(${BUILD_DOCS}) find_package(Doxygen) if (DOXYGEN_FOUND) # Build the doc - set(DOXYGEN_IN ${TD_SOURCE_DIR}/docs/Doxyfile.in) + set(DOXYGEN_IN ${TD_SOURCE_DIR}/docs/doxgen/Doxyfile.in) set(DOXYGEN_OUT ${CMAKE_BINARY_DIR}/Doxyfile) configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) diff --git a/docs/en/12-taos-sql/01-data-type.md b/docs/en/12-taos-sql/01-data-type.md index cca256139d..a870d7b530 100644 --- a/docs/en/12-taos-sql/01-data-type.md +++ b/docs/en/12-taos-sql/01-data-type.md @@ -42,6 +42,7 @@ In TDengine, the data types below can be used when specifying a column or tag. | 14 | NCHAR | User Defined | Multi-byte string that can include multi byte characters like Chinese characters. Each character of NCHAR type consumes 4 bytes storage. The string value should be quoted with single quotes. Literal single quote inside the string must be preceded with backslash, like `\'`. The length must be specified when defining a column or tag of NCHAR type, for example nchar(10) means it can store at most 10 characters of nchar type and will consume fixed storage of 40 bytes. An error will be reported if the string value exceeds the length defined. | | 15 | JSON | | JSON type can only be used on tags. A tag of json type is excluded with any other tags of any other type. | | 16 | VARCHAR | User-defined | Alias of BINARY | +| 17 | GEOMETRY | User-defined | Geometry data type, like POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION. | :::note diff --git a/docs/en/12-taos-sql/11-geometry-function.md b/docs/en/12-taos-sql/11-geometry-function.md new file mode 100644 index 0000000000..4f9f9ce56d --- /dev/null +++ b/docs/en/12-taos-sql/11-geometry-function.md @@ -0,0 +1,160 @@ +--- +sidebar_label: Geometry Functions +title: Geometry Functions +toc_max_heading_level: 4 +--- + +## Geometry Input Functions + +Geometry input functions create geometry data from WTK. + +### ST_GeomFromText + +```sql +ST_GeomFromText(VARCHAR WKT expr) +``` + +**Description**: Return a specified GEOMETRY value from Well-Known Text representation (WKT). + +**Return value type**: GEOMETRY + +**Applicable data types**: VARCHAR + +**Applicable table types**: standard tables and supertables + +**Explanations**: +- The input can be one of WTK string, like POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION. +- The output is a GEOMETRY data type, internal defined as binary string. + +## Geometry Output Functions + +Geometry output functions convert geometry data into WTK. + +### ST_AsText + +```sql +ST_AsText(GEOMETRY geom) +``` + +**Description**: Return a specified Well-Known Text representation (WKT) value from GEOMETRY data. + +**Return value type**: VARCHAR + +**Applicable data types**: GEOMETRY + +**Applicable table types**: standard tables and supertables + +**Explanations**: +- The output can be one of WTK string, like POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION. + +## Geometry Relationships Functions + +Geometry relationships functions determine spatial relationships between geometries. + +### ST_Intersects + +```sql +ST_Intersects(GEOMETRY geomA, GEOMETRY geomB) +``` + +**Description**: Compares two geometries and returns true if they intersect. + +**Return value type**: BOOL + +**Applicable data types**: GEOMETRY, GEOMETRY + +**Applicable table types**: standard tables and supertables + +**Explanations**: +- Geometries intersect if they have any point in common. + + +### ST_Equals + +```sql +ST_Equals(GEOMETRY geomA, GEOMETRY geomB) +``` + +**Description**: Returns TRUE if the given geometries are "spatially equal". + +**Return value type**: BOOL + +**Applicable data types**: GEOMETRY, GEOMETRY + +**Applicable table types**: standard tables and supertables + +**Explanations**: +- 'Spatially equal' means ST_Contains(A,B) = true and ST_Contains(B,A) = true, and the ordering of points can be different but represent the same geometry structure. + + +### ST_Touches + +```sql +ST_Touches(GEOMETRY geomA, GEOMETRY geomB) +``` + +**Description**: Returns TRUE if A and B intersect, but their interiors do not intersect. + +**Return value type**: BOOL + +**Applicable data types**: GEOMETRY, GEOMETRY + +**Applicable table types**: standard tables and supertables + +**Explanations**: +- A and B have at least one point in common, and the common points lie in at least one boundary. +- For Point/Point inputs the relationship is always FALSE, since points do not have a boundary. + + +### ST_Covers + +```sql +ST_Covers(GEOMETRY geomA, GEOMETRY geomB) +``` + +**Description**: Returns TRUE if every point in Geometry B lies inside (intersects the interior or boundary of) Geometry A. + +**Return value type**: BOOL + +**Applicable data types**: GEOMETRY, GEOMETRY + +**Applicable table types**: standard tables and supertables + +**Explanations**: +- A covers B means no point of B lies outside (in the exterior of) A. + + +### ST_Contains + +```sql +ST_Contains(GEOMETRY geomA, GEOMETRY geomB) +``` + +**Description**: Returns TRUE if geometry A contains geometry B. + +**Return value type**: BOOL + +**Applicable data types**: GEOMETRY, GEOMETRY + +**Applicable table types**: standard tables and supertables + +**Explanations**: +- A contains B if and only if all points of B lie inside (i.e. in the interior or boundary of) A (or equivalently, no points of B lie in the exterior of A), and the interiors of A and B have at least one point in common. + + +### ST_ContainsProperly + +```sql +ST_ContainsProperly(GEOMETRY geomA, GEOMETRY geomB) +``` + +**Description**: Returns TRUE if every point of B lies inside A. + +**Return value type**: BOOL + +**Applicable data types**: GEOMETRY, GEOMETRY + +**Applicable table types**: standard tables and supertables + +**Explanations**: +- There is no point of B lies in the the boundary or exterior of A. diff --git a/docs/examples/c/async_query_example.c b/docs/examples/c/async_query_example.c index 3807c4bfd7..0618c09f36 100644 --- a/docs/examples/c/async_query_example.c +++ b/docs/examples/c/async_query_example.c @@ -78,7 +78,8 @@ int printRow(char *str, TAOS_ROW row, TAOS_FIELD *fields, int numFields) { } break; case TSDB_DATA_TYPE_BINARY: - case TSDB_DATA_TYPE_NCHAR: { + case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: { int32_t charLen = varDataLen((char *)row[i] - VARSTR_HEADER_SIZE); memcpy(str + len, row[i], charLen); len += charLen; diff --git a/docs/examples/c/query_example.c b/docs/examples/c/query_example.c index c7d52115b5..88c031abc6 100644 --- a/docs/examples/c/query_example.c +++ b/docs/examples/c/query_example.c @@ -76,7 +76,8 @@ int printRow(char *str, TAOS_ROW row, TAOS_FIELD *fields, int numFields) { } break; case TSDB_DATA_TYPE_BINARY: - case TSDB_DATA_TYPE_NCHAR: { + case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: { int32_t charLen = varDataLen((char *)row[i] - VARSTR_HEADER_SIZE); memcpy(str + len, row[i], charLen); len += charLen; diff --git a/examples/lua/lua51/lua_connector51.c b/examples/lua/lua51/lua_connector51.c index c5ef9126a6..a8f051a790 100644 --- a/examples/lua/lua51/lua_connector51.c +++ b/examples/lua/lua51/lua_connector51.c @@ -162,6 +162,7 @@ static int l_query(lua_State *L){ case TSDB_DATA_TYPE_JSON: case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: //printf("type:%d, max len:%d, current len:%d\n",fields[i].type, fields[i].bytes, length[i]); lua_pushlstring(L,(char *)row[i], length[i]); break; diff --git a/examples/lua/lua_connector.c b/examples/lua/lua_connector.c index 5d8226f262..1422d1eb03 100644 --- a/examples/lua/lua_connector.c +++ b/examples/lua/lua_connector.c @@ -161,6 +161,7 @@ static int l_query(lua_State *L){ case TSDB_DATA_TYPE_JSON: case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: //printf("type:%d, max len:%d, current len:%d\n",fields[i].type, fields[i].bytes, length[i]); lua_pushlstring(L,(char *)row[i], length[i]); break; diff --git a/include/client/taos.h b/include/client/taos.h index 9f5a84fb22..7bdf16ed38 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -51,7 +51,8 @@ typedef void TAOS_SUB; #define TSDB_DATA_TYPE_BLOB 18 // binary #define TSDB_DATA_TYPE_MEDIUMBLOB 19 #define TSDB_DATA_TYPE_BINARY TSDB_DATA_TYPE_VARCHAR // string -#define TSDB_DATA_TYPE_MAX 20 +#define TSDB_DATA_TYPE_GEOMETRY 20 // geometry +#define TSDB_DATA_TYPE_MAX 21 typedef enum { TSDB_OPTION_LOCALE, diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index f055ff14dd..8e6c014be9 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -146,212 +146,212 @@ #define TK_MEDIUMBLOB 128 #define TK_BLOB 129 #define TK_VARBINARY 130 -#define TK_DECIMAL 131 -#define TK_COMMENT 132 -#define TK_MAX_DELAY 133 -#define TK_WATERMARK 134 -#define TK_ROLLUP 135 -#define TK_TTL 136 -#define TK_SMA 137 -#define TK_DELETE_MARK 138 -#define TK_FIRST 139 -#define TK_LAST 140 -#define TK_SHOW 141 -#define TK_PRIVILEGES 142 -#define TK_DATABASES 143 -#define TK_TABLES 144 -#define TK_STABLES 145 -#define TK_MNODES 146 -#define TK_QNODES 147 -#define TK_FUNCTIONS 148 -#define TK_INDEXES 149 -#define TK_ACCOUNTS 150 -#define TK_APPS 151 -#define TK_CONNECTIONS 152 -#define TK_LICENCES 153 -#define TK_GRANTS 154 -#define TK_QUERIES 155 -#define TK_SCORES 156 -#define TK_TOPICS 157 -#define TK_VARIABLES 158 -#define TK_CLUSTER 159 -#define TK_BNODES 160 -#define TK_SNODES 161 -#define TK_TRANSACTIONS 162 -#define TK_DISTRIBUTED 163 -#define TK_CONSUMERS 164 -#define TK_SUBSCRIPTIONS 165 -#define TK_VNODES 166 -#define TK_ALIVE 167 -#define TK_LIKE 168 -#define TK_TBNAME 169 -#define TK_QTAGS 170 -#define TK_AS 171 -#define TK_INDEX 172 -#define TK_FUNCTION 173 -#define TK_INTERVAL 174 -#define TK_COUNT 175 -#define TK_LAST_ROW 176 -#define TK_TOPIC 177 -#define TK_META 178 -#define TK_CONSUMER 179 -#define TK_GROUP 180 -#define TK_DESC 181 -#define TK_DESCRIBE 182 -#define TK_RESET 183 -#define TK_QUERY 184 -#define TK_CACHE 185 -#define TK_EXPLAIN 186 -#define TK_ANALYZE 187 -#define TK_VERBOSE 188 -#define TK_NK_BOOL 189 -#define TK_RATIO 190 -#define TK_NK_FLOAT 191 -#define TK_OUTPUTTYPE 192 -#define TK_AGGREGATE 193 -#define TK_BUFSIZE 194 -#define TK_LANGUAGE 195 -#define TK_REPLACE 196 -#define TK_STREAM 197 -#define TK_INTO 198 -#define TK_PAUSE 199 -#define TK_RESUME 200 -#define TK_TRIGGER 201 -#define TK_AT_ONCE 202 -#define TK_WINDOW_CLOSE 203 -#define TK_IGNORE 204 -#define TK_EXPIRED 205 -#define TK_FILL_HISTORY 206 -#define TK_UPDATE 207 -#define TK_SUBTABLE 208 -#define TK_UNTREATED 209 -#define TK_KILL 210 -#define TK_CONNECTION 211 -#define TK_TRANSACTION 212 -#define TK_BALANCE 213 -#define TK_VGROUP 214 -#define TK_LEADER 215 -#define TK_MERGE 216 -#define TK_REDISTRIBUTE 217 -#define TK_SPLIT 218 -#define TK_DELETE 219 -#define TK_INSERT 220 -#define TK_NULL 221 -#define TK_NK_QUESTION 222 -#define TK_NK_ARROW 223 -#define TK_ROWTS 224 -#define TK_QSTART 225 -#define TK_QEND 226 -#define TK_QDURATION 227 -#define TK_WSTART 228 -#define TK_WEND 229 -#define TK_WDURATION 230 -#define TK_IROWTS 231 -#define TK_ISFILLED 232 -#define TK_CAST 233 -#define TK_NOW 234 -#define TK_TODAY 235 -#define TK_TIMEZONE 236 -#define TK_CLIENT_VERSION 237 -#define TK_SERVER_VERSION 238 -#define TK_SERVER_STATUS 239 -#define TK_CURRENT_USER 240 -#define TK_CASE 241 -#define TK_WHEN 242 -#define TK_THEN 243 -#define TK_ELSE 244 -#define TK_BETWEEN 245 -#define TK_IS 246 -#define TK_NK_LT 247 -#define TK_NK_GT 248 -#define TK_NK_LE 249 -#define TK_NK_GE 250 -#define TK_NK_NE 251 -#define TK_MATCH 252 -#define TK_NMATCH 253 -#define TK_CONTAINS 254 -#define TK_IN 255 -#define TK_JOIN 256 -#define TK_INNER 257 -#define TK_SELECT 258 -#define TK_DISTINCT 259 -#define TK_WHERE 260 -#define TK_PARTITION 261 -#define TK_BY 262 -#define TK_SESSION 263 -#define TK_STATE_WINDOW 264 -#define TK_EVENT_WINDOW 265 -#define TK_SLIDING 266 -#define TK_FILL 267 -#define TK_VALUE 268 -#define TK_VALUE_F 269 -#define TK_NONE 270 -#define TK_PREV 271 -#define TK_NULL_F 272 -#define TK_LINEAR 273 -#define TK_NEXT 274 -#define TK_HAVING 275 -#define TK_RANGE 276 -#define TK_EVERY 277 -#define TK_ORDER 278 -#define TK_SLIMIT 279 -#define TK_SOFFSET 280 -#define TK_LIMIT 281 -#define TK_OFFSET 282 -#define TK_ASC 283 -#define TK_NULLS 284 -#define TK_ABORT 285 -#define TK_AFTER 286 -#define TK_ATTACH 287 -#define TK_BEFORE 288 -#define TK_BEGIN 289 -#define TK_BITAND 290 -#define TK_BITNOT 291 -#define TK_BITOR 292 -#define TK_BLOCKS 293 -#define TK_CHANGE 294 -#define TK_COMMA 295 -#define TK_CONCAT 296 -#define TK_CONFLICT 297 -#define TK_COPY 298 -#define TK_DEFERRED 299 -#define TK_DELIMITERS 300 -#define TK_DETACH 301 -#define TK_DIVIDE 302 -#define TK_DOT 303 -#define TK_EACH 304 -#define TK_FAIL 305 -#define TK_FILE 306 -#define TK_FOR 307 -#define TK_GLOB 308 -#define TK_ID 309 -#define TK_IMMEDIATE 310 -#define TK_IMPORT 311 -#define TK_INITIALLY 312 -#define TK_INSTEAD 313 -#define TK_ISNULL 314 -#define TK_KEY 315 -#define TK_MODULES 316 -#define TK_NK_BITNOT 317 -#define TK_NK_SEMI 318 -#define TK_NOTNULL 319 -#define TK_OF 320 -#define TK_PLUS 321 -#define TK_PRIVILEGE 322 -#define TK_RAISE 323 -#define TK_RESTRICT 324 -#define TK_ROW 325 -#define TK_SEMI 326 -#define TK_STAR 327 -#define TK_STATEMENT 328 -#define TK_STRICT 329 -#define TK_STRING 330 -#define TK_TIMES 331 -#define TK_VALUES 332 -#define TK_VARIABLE 333 -#define TK_VIEW 334 -#define TK_WAL 335 - +#define TK_GEOMETRY 131 +#define TK_DECIMAL 132 +#define TK_COMMENT 133 +#define TK_MAX_DELAY 134 +#define TK_WATERMARK 135 +#define TK_ROLLUP 136 +#define TK_TTL 137 +#define TK_SMA 138 +#define TK_DELETE_MARK 139 +#define TK_FIRST 140 +#define TK_LAST 141 +#define TK_SHOW 142 +#define TK_PRIVILEGES 143 +#define TK_DATABASES 144 +#define TK_TABLES 145 +#define TK_STABLES 146 +#define TK_MNODES 147 +#define TK_QNODES 148 +#define TK_FUNCTIONS 149 +#define TK_INDEXES 150 +#define TK_ACCOUNTS 151 +#define TK_APPS 152 +#define TK_CONNECTIONS 153 +#define TK_LICENCES 154 +#define TK_GRANTS 155 +#define TK_QUERIES 156 +#define TK_SCORES 157 +#define TK_TOPICS 158 +#define TK_VARIABLES 159 +#define TK_CLUSTER 160 +#define TK_BNODES 161 +#define TK_SNODES 162 +#define TK_TRANSACTIONS 163 +#define TK_DISTRIBUTED 164 +#define TK_CONSUMERS 165 +#define TK_SUBSCRIPTIONS 166 +#define TK_VNODES 167 +#define TK_ALIVE 168 +#define TK_LIKE 169 +#define TK_TBNAME 170 +#define TK_QTAGS 171 +#define TK_AS 172 +#define TK_INDEX 173 +#define TK_FUNCTION 174 +#define TK_INTERVAL 175 +#define TK_COUNT 176 +#define TK_LAST_ROW 177 +#define TK_TOPIC 178 +#define TK_META 179 +#define TK_CONSUMER 180 +#define TK_GROUP 181 +#define TK_DESC 182 +#define TK_DESCRIBE 183 +#define TK_RESET 184 +#define TK_QUERY 185 +#define TK_CACHE 186 +#define TK_EXPLAIN 187 +#define TK_ANALYZE 188 +#define TK_VERBOSE 189 +#define TK_NK_BOOL 190 +#define TK_RATIO 191 +#define TK_NK_FLOAT 192 +#define TK_OUTPUTTYPE 193 +#define TK_AGGREGATE 194 +#define TK_BUFSIZE 195 +#define TK_LANGUAGE 196 +#define TK_REPLACE 197 +#define TK_STREAM 198 +#define TK_INTO 199 +#define TK_PAUSE 200 +#define TK_RESUME 201 +#define TK_TRIGGER 202 +#define TK_AT_ONCE 203 +#define TK_WINDOW_CLOSE 204 +#define TK_IGNORE 205 +#define TK_EXPIRED 206 +#define TK_FILL_HISTORY 207 +#define TK_UPDATE 208 +#define TK_SUBTABLE 209 +#define TK_UNTREATED 210 +#define TK_KILL 211 +#define TK_CONNECTION 212 +#define TK_TRANSACTION 213 +#define TK_BALANCE 214 +#define TK_VGROUP 215 +#define TK_LEADER 216 +#define TK_MERGE 217 +#define TK_REDISTRIBUTE 218 +#define TK_SPLIT 219 +#define TK_DELETE 220 +#define TK_INSERT 221 +#define TK_NULL 222 +#define TK_NK_QUESTION 223 +#define TK_NK_ARROW 224 +#define TK_ROWTS 225 +#define TK_QSTART 226 +#define TK_QEND 227 +#define TK_QDURATION 228 +#define TK_WSTART 229 +#define TK_WEND 230 +#define TK_WDURATION 231 +#define TK_IROWTS 232 +#define TK_ISFILLED 233 +#define TK_CAST 234 +#define TK_NOW 235 +#define TK_TODAY 236 +#define TK_TIMEZONE 237 +#define TK_CLIENT_VERSION 238 +#define TK_SERVER_VERSION 239 +#define TK_SERVER_STATUS 240 +#define TK_CURRENT_USER 241 +#define TK_CASE 242 +#define TK_WHEN 243 +#define TK_THEN 244 +#define TK_ELSE 245 +#define TK_BETWEEN 246 +#define TK_IS 247 +#define TK_NK_LT 248 +#define TK_NK_GT 249 +#define TK_NK_LE 250 +#define TK_NK_GE 251 +#define TK_NK_NE 252 +#define TK_MATCH 253 +#define TK_NMATCH 254 +#define TK_CONTAINS 255 +#define TK_IN 256 +#define TK_JOIN 257 +#define TK_INNER 258 +#define TK_SELECT 259 +#define TK_DISTINCT 260 +#define TK_WHERE 261 +#define TK_PARTITION 262 +#define TK_BY 263 +#define TK_SESSION 264 +#define TK_STATE_WINDOW 265 +#define TK_EVENT_WINDOW 266 +#define TK_SLIDING 267 +#define TK_FILL 268 +#define TK_VALUE 269 +#define TK_VALUE_F 270 +#define TK_NONE 271 +#define TK_PREV 272 +#define TK_NULL_F 273 +#define TK_LINEAR 274 +#define TK_NEXT 275 +#define TK_HAVING 276 +#define TK_RANGE 277 +#define TK_EVERY 278 +#define TK_ORDER 279 +#define TK_SLIMIT 280 +#define TK_SOFFSET 281 +#define TK_LIMIT 282 +#define TK_OFFSET 283 +#define TK_ASC 284 +#define TK_NULLS 285 +#define TK_ABORT 286 +#define TK_AFTER 287 +#define TK_ATTACH 288 +#define TK_BEFORE 289 +#define TK_BEGIN 290 +#define TK_BITAND 291 +#define TK_BITNOT 292 +#define TK_BITOR 293 +#define TK_BLOCKS 294 +#define TK_CHANGE 295 +#define TK_COMMA 296 +#define TK_CONCAT 297 +#define TK_CONFLICT 298 +#define TK_COPY 299 +#define TK_DEFERRED 300 +#define TK_DELIMITERS 301 +#define TK_DETACH 302 +#define TK_DIVIDE 303 +#define TK_DOT 304 +#define TK_EACH 305 +#define TK_FAIL 306 +#define TK_FILE 307 +#define TK_FOR 308 +#define TK_GLOB 309 +#define TK_ID 310 +#define TK_IMMEDIATE 311 +#define TK_IMPORT 312 +#define TK_INITIALLY 313 +#define TK_INSTEAD 314 +#define TK_ISNULL 315 +#define TK_KEY 316 +#define TK_MODULES 317 +#define TK_NK_BITNOT 318 +#define TK_NK_SEMI 319 +#define TK_NOTNULL 320 +#define TK_OF 321 +#define TK_PLUS 322 +#define TK_PRIVILEGE 323 +#define TK_RAISE 324 +#define TK_RESTRICT 325 +#define TK_ROW 326 +#define TK_SEMI 327 +#define TK_STAR 328 +#define TK_STATEMENT 329 +#define TK_STRICT 330 +#define TK_STRING 331 +#define TK_TIMES 332 +#define TK_VALUES 333 +#define TK_VARIABLE 334 +#define TK_VIEW 335 +#define TK_WAL 336 #define TK_NK_SPACE 600 diff --git a/include/common/ttypes.h b/include/common/ttypes.h index f8a85ee1b0..dd8033eb43 100644 --- a/include/common/ttypes.h +++ b/include/common/ttypes.h @@ -269,7 +269,7 @@ typedef struct { (IS_NUMERIC_TYPE(_t) || (_t) == (TSDB_DATA_TYPE_BOOL) || (_t) == (TSDB_DATA_TYPE_TIMESTAMP)) #define IS_VAR_DATA_TYPE(t) \ - (((t) == TSDB_DATA_TYPE_VARCHAR) || ((t) == TSDB_DATA_TYPE_NCHAR) || ((t) == TSDB_DATA_TYPE_JSON)) + (((t) == TSDB_DATA_TYPE_VARCHAR) || ((t) == TSDB_DATA_TYPE_NCHAR) || ((t) == TSDB_DATA_TYPE_JSON) || ((t) == TSDB_DATA_TYPE_GEOMETRY)) #define IS_STR_DATA_TYPE(t) (((t) == TSDB_DATA_TYPE_VARCHAR) || ((t) == TSDB_DATA_TYPE_NCHAR)) #define IS_VALID_TINYINT(_t) ((_t) >= INT8_MIN && (_t) <= INT8_MAX) @@ -316,6 +316,8 @@ static FORCE_INLINE bool isNull(const void *val, int32_t type) { return *(uint32_t *)val == TSDB_DATA_UINT_NULL; case TSDB_DATA_TYPE_UBIGINT: return *(uint64_t *)val == TSDB_DATA_UBIGINT_NULL; + case TSDB_DATA_TYPE_GEOMETRY: + return varDataLen(val) == sizeof(int8_t) && *(uint8_t *)varDataVal(val) == TSDB_DATA_GEOMETRY_NULL; default: return false; diff --git a/include/libs/function/functionMgt.h b/include/libs/function/functionMgt.h index f097a2b2df..f0c9cffd0f 100644 --- a/include/libs/function/functionMgt.h +++ b/include/libs/function/functionMgt.h @@ -158,6 +158,17 @@ typedef enum EFunctionType { FUNCTION_TYPE_STDDEV_PARTIAL, FUNCTION_TYPE_STDDEV_MERGE, + // geometry functions + FUNCTION_TYPE_GEOM_FROM_TEXT = 4250, + FUNCTION_TYPE_AS_TEXT, + FUNCTION_TYPE_MAKE_POINT, + FUNCTION_TYPE_INTERSECTS, + FUNCTION_TYPE_EQUALS, + FUNCTION_TYPE_TOUCHES, + FUNCTION_TYPE_COVERS, + FUNCTION_TYPE_CONTAINS, + FUNCTION_TYPE_CONTAINS_PROPERLY, + // user defined funcion FUNCTION_TYPE_UDF = 10000 } EFunctionType; diff --git a/include/libs/function/taosudf.h b/include/libs/function/taosudf.h index c825574fa6..995198bc9e 100644 --- a/include/libs/function/taosudf.h +++ b/include/libs/function/taosudf.h @@ -109,7 +109,7 @@ typedef uint16_t VarDataLenT; // maxVarDataLen: 65535 #define varDataLenByData(v) (*(VarDataLenT *)(((char *)(v)) - VARSTR_HEADER_SIZE)) #define varDataSetLen(v, _len) (((VarDataLenT *)(v))[0] = (VarDataLenT)(_len)) #define IS_VAR_DATA_TYPE(t) \ - (((t) == TSDB_DATA_TYPE_VARCHAR) || ((t) == TSDB_DATA_TYPE_NCHAR) || ((t) == TSDB_DATA_TYPE_JSON)) + (((t) == TSDB_DATA_TYPE_VARCHAR) || ((t) == TSDB_DATA_TYPE_NCHAR) || ((t) == TSDB_DATA_TYPE_JSON) || ((t) == TSDB_DATA_TYPE_GEOMETRY)) #define IS_STR_DATA_TYPE(t) (((t) == TSDB_DATA_TYPE_VARCHAR) || ((t) == TSDB_DATA_TYPE_NCHAR)) static FORCE_INLINE char *udfColDataGetData(const SUdfColumn *pColumn, int32_t row) { diff --git a/include/libs/geometry/geomFunc.h b/include/libs/geometry/geomFunc.h new file mode 100644 index 0000000000..05627e71f5 --- /dev/null +++ b/include/libs/geometry/geomFunc.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef TDENGINE_GEOM_FUNC_H +#define TDENGINE_GEOM_FUNC_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "function.h" + +int32_t makePointFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); + +int32_t geomFromTextFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t asTextFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); + +int32_t intersectsFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t equalsFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t touchesFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t coversFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t containsFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t containsProperlyFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); + +#ifdef __cplusplus +} +#endif + +#endif // TDENGINE_GEOM_FUNC_H diff --git a/include/libs/geometry/geosWrapper.h b/include/libs/geometry/geosWrapper.h new file mode 100644 index 0000000000..a5bc0cec17 --- /dev/null +++ b/include/libs/geometry/geosWrapper.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef TDENGINE_GEOS_WRAPPER_H +#define TDENGINE_GEOS_WRAPPER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include "os.h" + +#include "tgeosctx.h" + +void geosFreeBuffer(void *buffer); + +int32_t initCtxMakePoint(); +int32_t doMakePoint(double x, double y, unsigned char **outputGeom, size_t *size); + +int32_t initCtxGeomFromText(); +int32_t doGeomFromText(const char *inputWKT, unsigned char **outputGeom, size_t *size); + +int32_t initCtxAsText(); +int32_t doAsText(const unsigned char *inputGeom, size_t size, char **outputWKT); + +int32_t initCtxRelationFunc(); +int32_t doIntersects(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res); +int32_t doEquals(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res); +int32_t doTouches(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res); +int32_t doCovers(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res); +int32_t doContains(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res); +int32_t doContainsProperly(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res); + +int32_t readGeometry(const unsigned char *input, GEOSGeometry **outputGeom, const GEOSPreparedGeometry **outputPreparedGeom); +void destroyGeometry(GEOSGeometry **geom, const GEOSPreparedGeometry **preparedGeom); + +#ifdef __cplusplus +} +#endif + +#endif /*TDENGINE_GEOS_WRAPPER_H*/ diff --git a/include/util/tdef.h b/include/util/tdef.h index 070af1e190..0b0569e2d1 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -32,7 +32,7 @@ extern "C" { #define TD_VER_MAX UINT64_MAX // TODO: use the real max version from query handle // Bytes for each type. -extern const int32_t TYPE_BYTES[16]; +extern const int32_t TYPE_BYTES[17]; // TODO: replace and remove code below #define CHAR_BYTES sizeof(char) @@ -53,10 +53,11 @@ extern const int32_t TYPE_BYTES[16]; #define TSDB_DATA_BIGINT_NULL 0x8000000000000000LL #define TSDB_DATA_TIMESTAMP_NULL TSDB_DATA_BIGINT_NULL -#define TSDB_DATA_FLOAT_NULL 0x7FF00000 // it is an NAN -#define TSDB_DATA_DOUBLE_NULL 0x7FFFFF0000000000LL // an NAN -#define TSDB_DATA_NCHAR_NULL 0xFFFFFFFF -#define TSDB_DATA_BINARY_NULL 0xFF +#define TSDB_DATA_FLOAT_NULL 0x7FF00000 // it is an NAN +#define TSDB_DATA_DOUBLE_NULL 0x7FFFFF0000000000LL // an NAN +#define TSDB_DATA_NCHAR_NULL 0xFFFFFFFF +#define TSDB_DATA_BINARY_NULL 0xFF +#define TSDB_DATA_GEOMETRY_NULL 0xFF #define TSDB_DATA_UTINYINT_NULL 0xFF #define TSDB_DATA_USMALLINT_NULL 0xFFFF @@ -411,6 +412,8 @@ typedef enum ELogicConditionType { #define TSDB_MAX_FIELD_LEN 65519 // 16384:65519 #define TSDB_MAX_BINARY_LEN TSDB_MAX_FIELD_LEN // 16384-8:65519 #define TSDB_MAX_NCHAR_LEN TSDB_MAX_FIELD_LEN // 16384-8:65519 +#define TSDB_MAX_GEOMETRY_LEN TSDB_MAX_FIELD_LEN // 16384-8:65519 + #define PRIMARYKEY_TIMESTAMP_COL_ID 1 #define COL_REACH_END(colId, maxColId) ((colId) > (maxColId)) diff --git a/include/util/tgeosctx.h b/include/util/tgeosctx.h new file mode 100644 index 0000000000..b5ac5a9333 --- /dev/null +++ b/include/util/tgeosctx.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef _TD_UTIL_GEOS_CTX_H_ +#define _TD_UTIL_GEOS_CTX_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +typedef struct SGeosContext { + GEOSContextHandle_t handle; + + GEOSWKTReader *WKTReader; + GEOSWKTWriter *WKTWriter; + + GEOSWKBReader *WKBReader; + GEOSWKBWriter *WKBWriter; + + char errMsg[512]; +} SGeosContext; + +SGeosContext* getThreadLocalGeosCtx(); +void destroyThreadLocalGeosCtx(); + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_UTIL_GEOS_CTX_H_*/ diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 6f129d7418..82177302c7 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -491,7 +491,8 @@ void setResSchemaInfo(SReqResultInfo* pResInfo, const SSchema* pSchema, int32_t pResInfo->userFields[i].bytes = pSchema[i].bytes; pResInfo->userFields[i].type = pSchema[i].type; - if (pSchema[i].type == TSDB_DATA_TYPE_VARCHAR) { + if (pSchema[i].type == TSDB_DATA_TYPE_VARCHAR || + pSchema[i].type == TSDB_DATA_TYPE_GEOMETRY) { pResInfo->userFields[i].bytes -= VARSTR_HEADER_SIZE; } else if (pSchema[i].type == TSDB_DATA_TYPE_NCHAR || pSchema[i].type == TSDB_DATA_TYPE_JSON) { pResInfo->userFields[i].bytes = (pResInfo->userFields[i].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE; diff --git a/source/client/src/clientJniConnector.c b/source/client/src/clientJniConnector.c index b613354751..4ad2d4d51f 100644 --- a/source/client/src/clientJniConnector.c +++ b/source/client/src/clientJniConnector.c @@ -579,7 +579,8 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn dv = GET_DOUBLE_VAL(row[i]); (*env)->CallVoidMethod(env, rowobj, g_rowdataSetDoubleFp, i, (jdouble)dv); } break; - case TSDB_DATA_TYPE_BINARY: { + case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: { memcpy(tmp, row[i], length[i]); // handle the case that terminated does not exist (*env)->CallVoidMethod(env, rowobj, g_rowdataSetStringFp, i, (*env)->NewStringUTF(env, tmp)); diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 55337d4a0b..63a4e5d2e5 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -393,9 +393,10 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields) } break; case TSDB_DATA_TYPE_BINARY: - case TSDB_DATA_TYPE_NCHAR: { + case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: { int32_t charLen = varDataLen((char *)row[i] - VARSTR_HEADER_SIZE); - if (fields[i].type == TSDB_DATA_TYPE_BINARY) { + if (fields[i].type == TSDB_DATA_TYPE_BINARY || fields[i].type == TSDB_DATA_TYPE_GEOMETRY) { if (ASSERT(charLen <= fields[i].bytes && charLen >= 0)) { tscError("taos_print_row error binary. charLen:%d, fields[i].bytes:%d", charLen, fields[i].bytes); } @@ -475,6 +476,8 @@ const char *taos_data_type(int type) { return "TSDB_DATA_TYPE_NCHAR"; case TSDB_DATA_TYPE_JSON: return "TSDB_DATA_TYPE_JSON"; + case TSDB_DATA_TYPE_GEOMETRY: + return "TSDB_DATA_TYPE_GEOMETRY"; case TSDB_DATA_TYPE_UTINYINT: return "TSDB_DATA_TYPE_UTINYINT"; case TSDB_DATA_TYPE_USMALLINT: diff --git a/source/client/src/clientRawBlockWrite.c b/source/client/src/clientRawBlockWrite.c index 32f28e4563..cfc8ae9186 100644 --- a/source/client/src/clientRawBlockWrite.c +++ b/source/client/src/clientRawBlockWrite.c @@ -56,7 +56,7 @@ static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* sch cJSON_AddItemToObject(column, "name", cname); cJSON* ctype = cJSON_CreateNumber(s->type); cJSON_AddItemToObject(column, "type", ctype); - if (s->type == TSDB_DATA_TYPE_BINARY) { + if (s->type == TSDB_DATA_TYPE_BINARY || s->type == TSDB_DATA_TYPE_GEOMETRY) { int32_t length = s->bytes - VARSTR_HEADER_SIZE; cJSON* cbytes = cJSON_CreateNumber(length); cJSON_AddItemToObject(column, "length", cbytes); @@ -77,7 +77,7 @@ static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* sch cJSON_AddItemToObject(tag, "name", tname); cJSON* ttype = cJSON_CreateNumber(s->type); cJSON_AddItemToObject(tag, "type", ttype); - if (s->type == TSDB_DATA_TYPE_BINARY) { + if (s->type == TSDB_DATA_TYPE_BINARY || s->type == TSDB_DATA_TYPE_GEOMETRY) { int32_t length = s->bytes - VARSTR_HEADER_SIZE; cJSON* cbytes = cJSON_CreateNumber(length); cJSON_AddItemToObject(tag, "length", cbytes); @@ -130,7 +130,7 @@ static char* buildAlterSTableJson(void* alterData, int32_t alterDataLen) { cJSON* colType = cJSON_CreateNumber(field->type); cJSON_AddItemToObject(json, "colType", colType); - if (field->type == TSDB_DATA_TYPE_BINARY) { + if (field->type == TSDB_DATA_TYPE_BINARY || field->type == TSDB_DATA_TYPE_GEOMETRY) { int32_t length = field->bytes - VARSTR_HEADER_SIZE; cJSON* cbytes = cJSON_CreateNumber(length); cJSON_AddItemToObject(json, "colLength", cbytes); @@ -155,7 +155,7 @@ static char* buildAlterSTableJson(void* alterData, int32_t alterDataLen) { cJSON_AddItemToObject(json, "colName", colName); cJSON* colType = cJSON_CreateNumber(field->type); cJSON_AddItemToObject(json, "colType", colType); - if (field->type == TSDB_DATA_TYPE_BINARY) { + if (field->type == TSDB_DATA_TYPE_BINARY || field->type == TSDB_DATA_TYPE_GEOMETRY) { int32_t length = field->bytes - VARSTR_HEADER_SIZE; cJSON* cbytes = cJSON_CreateNumber(length); cJSON_AddItemToObject(json, "colLength", cbytes); @@ -457,7 +457,7 @@ static char* processAlterTable(SMqMetaRsp* metaRsp) { cJSON* colType = cJSON_CreateNumber(vAlterTbReq.type); cJSON_AddItemToObject(json, "colType", colType); - if (vAlterTbReq.type == TSDB_DATA_TYPE_BINARY) { + if (vAlterTbReq.type == TSDB_DATA_TYPE_BINARY || vAlterTbReq.type == TSDB_DATA_TYPE_GEOMETRY) { int32_t length = vAlterTbReq.bytes - VARSTR_HEADER_SIZE; cJSON* cbytes = cJSON_CreateNumber(length); cJSON_AddItemToObject(json, "colLength", cbytes); @@ -478,7 +478,7 @@ static char* processAlterTable(SMqMetaRsp* metaRsp) { cJSON_AddItemToObject(json, "colName", colName); cJSON* colType = cJSON_CreateNumber(vAlterTbReq.colModType); cJSON_AddItemToObject(json, "colType", colType); - if (vAlterTbReq.colModType == TSDB_DATA_TYPE_BINARY) { + if (vAlterTbReq.colModType == TSDB_DATA_TYPE_BINARY || vAlterTbReq.colModType == TSDB_DATA_TYPE_GEOMETRY) { int32_t length = vAlterTbReq.colModBytes - VARSTR_HEADER_SIZE; cJSON* cbytes = cJSON_CreateNumber(length); cJSON_AddItemToObject(json, "colLength", cbytes); diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 6170b0a056..3ea471fbf8 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -555,7 +555,7 @@ static int32_t smlGenerateSchemaAction(SSchema *colField, SHashObj *colHash, SSm return TSDB_CODE_SML_INVALID_DATA; } - if ((colField[*index].type == TSDB_DATA_TYPE_VARCHAR && + if (((colField[*index].type == TSDB_DATA_TYPE_VARCHAR || colField[*index].type == TSDB_DATA_TYPE_GEOMETRY) && (colField[*index].bytes - VARSTR_HEADER_SIZE) < kv->length) || (colField[*index].type == TSDB_DATA_TYPE_NCHAR && ((colField[*index].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE < kv->length))) { @@ -586,7 +586,7 @@ static int32_t smlFindNearestPowerOf2(int32_t length, uint8_t type) { } } - if (type == TSDB_DATA_TYPE_BINARY && result > TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE) { + if ((type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_GEOMETRY) && result > TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE) { result = TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE; } else if (type == TSDB_DATA_TYPE_NCHAR && result > (TSDB_MAX_NCHAR_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE) { result = (TSDB_MAX_NCHAR_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE; @@ -594,7 +594,7 @@ static int32_t smlFindNearestPowerOf2(int32_t length, uint8_t type) { if (type == TSDB_DATA_TYPE_NCHAR) { result = result * TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE; - } else if (type == TSDB_DATA_TYPE_BINARY) { + } else if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_GEOMETRY) { result = result + VARSTR_HEADER_SIZE; } return result; @@ -638,7 +638,7 @@ static int32_t smlCheckMeta(SSchema *schema, int32_t length, SArray *cols, bool } static int32_t getBytes(uint8_t type, int32_t length) { - if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_NCHAR) { + if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_NCHAR || type == TSDB_DATA_TYPE_GEOMETRY) { return smlFindNearestPowerOf2(length, type); } else { return tDataTypes[type].bytes; diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 42424b6436..4a872482b4 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -1927,7 +1927,8 @@ void blockDebugShowDataBlocks(const SArray* dataBlocks, const char* flag) { case TSDB_DATA_TYPE_DOUBLE: printf(" %15lf |", *(double*)var); break; - case TSDB_DATA_TYPE_VARCHAR: { + case TSDB_DATA_TYPE_VARCHAR: + case TSDB_DATA_TYPE_GEOMETRY: { char* pData = colDataGetVarData(pColInfoData, j); int32_t dataSize = TMIN(sizeof(pBuf) - 1, varDataLen(pData)); memset(pBuf, 0, dataSize + 1); @@ -2032,7 +2033,8 @@ char* dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf) len += snprintf(dumpBuf + len, size - len, " %15d |", *(bool*)var); if (len >= size - 1) return dumpBuf; break; - case TSDB_DATA_TYPE_VARCHAR: { + case TSDB_DATA_TYPE_VARCHAR: + case TSDB_DATA_TYPE_GEOMETRY: { memset(pBuf, 0, sizeof(pBuf)); char* pData = colDataGetVarData(pColInfoData, j); int32_t dataSize = TMIN(sizeof(pBuf), varDataLen(pData)); @@ -2138,7 +2140,8 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SSDataBlock* pDataB } break; case TSDB_DATA_TYPE_NCHAR: - case TSDB_DATA_TYPE_VARCHAR: { // TSDB_DATA_TYPE_BINARY + case TSDB_DATA_TYPE_VARCHAR: // TSDB_DATA_TYPE_BINARY + case TSDB_DATA_TYPE_GEOMETRY: { if (colDataIsNull_s(pColInfoData, j)) { tdAppendColValToRow(&rb, PRIMARYKEY_TIMESTAMP_COL_ID + k, pColInfoData->info.type, TD_VTYPE_NULL, NULL, false, offset, k); diff --git a/source/common/src/tdataformat.c b/source/common/src/tdataformat.c index 846ca44b83..f30557e4ef 100644 --- a/source/common/src/tdataformat.c +++ b/source/common/src/tdataformat.c @@ -1148,7 +1148,8 @@ static void debugPrintTagVal(int8_t type, const void *val, int32_t vlen, const c switch (type) { case TSDB_DATA_TYPE_JSON: case TSDB_DATA_TYPE_VARCHAR: - case TSDB_DATA_TYPE_NCHAR: { + case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: { char tmpVal[32] = {0}; strncpy(tmpVal, val, vlen > 31 ? 31 : vlen); printf("%s:%d type:%d vlen:%d, val:\"%s\"\n", tag, ln, (int32_t)type, vlen, tmpVal); @@ -3542,5 +3543,6 @@ void (*tColDataCalcSMA[])(SColData *pColData, int64_t *sum, int64_t *max, int64_ NULL, // TSDB_DATA_TYPE_VARBINARY NULL, // TSDB_DATA_TYPE_DECIMAL NULL, // TSDB_DATA_TYPE_BLOB - NULL // TSDB_DATA_TYPE_MEDIUMBLOB + NULL, // TSDB_DATA_TYPE_MEDIUMBLOB + NULL // TSDB_DATA_TYPE_GEOMETRY }; diff --git a/source/common/src/trow.c b/source/common/src/trow.c index 9d381ce15f..8ae77bcd0a 100644 --- a/source/common/src/trow.c +++ b/source/common/src/trow.c @@ -126,6 +126,9 @@ void tdSCellValPrint(SCellVal *pVal, int8_t colType) { case TSDB_DATA_TYPE_JSON: printf("JSON "); break; + case TSDB_DATA_TYPE_GEOMETRY: + printf("GEOMETRY "); + break; case TSDB_DATA_TYPE_VARBINARY: printf("VARBIN "); break; @@ -353,7 +356,7 @@ int32_t tdSTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow **ppRow) { } } else { varDataLen += sizeof(VarDataLenT); - if (pTColumn->type == TSDB_DATA_TYPE_VARCHAR) { + if (pTColumn->type == TSDB_DATA_TYPE_VARCHAR || pTColumn->type == TSDB_DATA_TYPE_GEOMETRY) { varDataLen += CHAR_BYTES; if (maxVarDataLen < CHAR_BYTES + sizeof(VarDataLenT)) { maxVarDataLen = CHAR_BYTES + sizeof(VarDataLenT); diff --git a/source/common/src/ttszip.c b/source/common/src/ttszip.c index f415bd20cd..aabbff6f04 100644 --- a/source/common/src/ttszip.c +++ b/source/common/src/ttszip.c @@ -296,7 +296,7 @@ static void writeDataToDisk(STSBuf* pTSBuf) { metaLen += (int32_t)taosWriteFile(pTSBuf->pFile, &pBlock->tag.nType, sizeof(pBlock->tag.nType)); int32_t trueLen = pBlock->tag.nLen; - if (pBlock->tag.nType == TSDB_DATA_TYPE_BINARY || pBlock->tag.nType == TSDB_DATA_TYPE_NCHAR) { + if (pBlock->tag.nType == TSDB_DATA_TYPE_BINARY || pBlock->tag.nType == TSDB_DATA_TYPE_NCHAR || pBlock->tag.nType == TSDB_DATA_TYPE_GEOMETRY) { metaLen += (int32_t)taosWriteFile(pTSBuf->pFile, &pBlock->tag.nLen, sizeof(pBlock->tag.nLen)); metaLen += (int32_t)taosWriteFile(pTSBuf->pFile, pBlock->tag.pz, (size_t)pBlock->tag.nLen); } else if (pBlock->tag.nType == TSDB_DATA_TYPE_FLOAT) { @@ -378,7 +378,7 @@ STSBlock* readDataFromDisk(STSBuf* pTSBuf, int32_t order, bool decomp) { // NOTE: mix types tags are not supported size_t sz = 0; - if (pBlock->tag.nType == TSDB_DATA_TYPE_BINARY || pBlock->tag.nType == TSDB_DATA_TYPE_NCHAR) { + if (pBlock->tag.nType == TSDB_DATA_TYPE_BINARY || pBlock->tag.nType == TSDB_DATA_TYPE_NCHAR || pBlock->tag.nType == TSDB_DATA_TYPE_GEOMETRY) { char* tp = taosMemoryRealloc(pBlock->tag.pz, pBlock->tag.nLen + 1); ASSERT(tp != NULL); diff --git a/source/common/src/ttypes.c b/source/common/src/ttypes.c index c83bdc0e32..33b972594e 100644 --- a/source/common/src/ttypes.c +++ b/source/common/src/ttypes.c @@ -17,7 +17,7 @@ #include "ttypes.h" #include "tcompression.h" -const int32_t TYPE_BYTES[16] = { +const int32_t TYPE_BYTES[17] = { -1, // TSDB_DATA_TYPE_NULL CHAR_BYTES, // TSDB_DATA_TYPE_BOOL CHAR_BYTES, // TSDB_DATA_TYPE_TINYINT @@ -34,6 +34,7 @@ const int32_t TYPE_BYTES[16] = { INT_BYTES, // TSDB_DATA_TYPE_UINT sizeof(uint64_t), // TSDB_DATA_TYPE_UBIGINT TSDB_MAX_JSON_TAG_LEN, // TSDB_DATA_TYPE_JSON + sizeof(VarDataOffsetT), // TSDB_DATA_TYPE_GEOMETRY }; tDataTypeDescriptor tDataTypes[TSDB_DATA_TYPE_MAX] = { @@ -56,6 +57,7 @@ tDataTypeDescriptor tDataTypes[TSDB_DATA_TYPE_MAX] = { {TSDB_DATA_TYPE_UINT, 12, INT_BYTES, "INT UNSIGNED", 0, UINT32_MAX, tsCompressInt, tsDecompressInt}, {TSDB_DATA_TYPE_UBIGINT, 15, LONG_BYTES, "BIGINT UNSIGNED", 0, UINT64_MAX, tsCompressBigint, tsDecompressBigint}, {TSDB_DATA_TYPE_JSON, 4, TSDB_MAX_JSON_TAG_LEN, "JSON", 0, 0, tsCompressString, tsDecompressString}, + {TSDB_DATA_TYPE_GEOMETRY, 8, 1, "GEOMETRY", 0, 0, tsCompressString, tsDecompressString}, }; static float floatMin = -FLT_MAX, floatMax = FLT_MAX; @@ -125,6 +127,7 @@ void assignVal(char *val, const char *src, int32_t len, int32_t type) { *((int64_t *)val) = GET_INT64_VAL(src); break; case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: varDataCopy(val, src); break; case TSDB_DATA_TYPE_NCHAR: diff --git a/source/common/src/tvariant.c b/source/common/src/tvariant.c index db69fe9d48..cb4a42eb10 100644 --- a/source/common/src/tvariant.c +++ b/source/common/src/tvariant.c @@ -121,7 +121,8 @@ void taosVariantCreateFromBinary(SVariant *pVar, const char *pz, size_t len, uin break; } - case TSDB_DATA_TYPE_BINARY: { // todo refactor, extract a method + case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: { // todo refactor, extract a method pVar->pz = taosMemoryCalloc(len + 1, sizeof(char)); memcpy(pVar->pz, pz, len); pVar->nLen = (int32_t)len; @@ -140,7 +141,7 @@ void taosVariantDestroy(SVariant *pVar) { if (pVar == NULL) return; if (pVar->nType == TSDB_DATA_TYPE_BINARY || pVar->nType == TSDB_DATA_TYPE_NCHAR || - pVar->nType == TSDB_DATA_TYPE_JSON) { + pVar->nType == TSDB_DATA_TYPE_JSON || pVar->nType == TSDB_DATA_TYPE_GEOMETRY) { taosMemoryFreeClear(pVar->pz); pVar->nLen = 0; } @@ -152,7 +153,7 @@ void taosVariantAssign(SVariant *pDst, const SVariant *pSrc) { pDst->nType = pSrc->nType; if (pSrc->nType == TSDB_DATA_TYPE_BINARY || pSrc->nType == TSDB_DATA_TYPE_NCHAR || - pSrc->nType == TSDB_DATA_TYPE_JSON) { + pSrc->nType == TSDB_DATA_TYPE_JSON || pSrc->nType == TSDB_DATA_TYPE_GEOMETRY) { int32_t len = pSrc->nLen + TSDB_NCHAR_SIZE; char *p = taosMemoryRealloc(pDst->pz, len); ASSERT(p); @@ -184,7 +185,7 @@ int32_t taosVariantCompare(const SVariant *p1, const SVariant *p2) { return 1; } - if (p1->nType == TSDB_DATA_TYPE_BINARY || p1->nType == TSDB_DATA_TYPE_NCHAR) { + if (p1->nType == TSDB_DATA_TYPE_BINARY || p1->nType == TSDB_DATA_TYPE_NCHAR || p1->nType == TSDB_DATA_TYPE_GEOMETRY) { if (p1->nLen == p2->nLen) { return memcmp(p1->pz, p2->pz, p1->nLen); } else { @@ -237,6 +238,7 @@ char *taosVariantGet(SVariant *pVar, int32_t type) { return (char *)&pVar->f; case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_JSON: + case TSDB_DATA_TYPE_GEOMETRY: return (char *)pVar->pz; case TSDB_DATA_TYPE_NCHAR: return (char *)pVar->ucs4; diff --git a/source/common/test/dataformatTest.cpp b/source/common/test/dataformatTest.cpp index 4f8652d02c..b1083e4590 100644 --- a/source/common/test/dataformatTest.cpp +++ b/source/common/test/dataformatTest.cpp @@ -235,7 +235,8 @@ int32_t debugPrintSColVal(SColVal *cv, int8_t type) { case TSDB_DATA_TYPE_DOUBLE: printf("%lf ", cv->value.d); break; - case TSDB_DATA_TYPE_VARCHAR: { + case TSDB_DATA_TYPE_VARCHAR: + case TSDB_DATA_TYPE_GEOMETRY: { char tv[15] = {0}; snprintf(tv, 15, "%s", cv->value.pData); printf("%s ", tv); @@ -337,7 +338,8 @@ static int32_t checkSColVal(const char *rawVal, SColVal *cv, int8_t type) { sscanf(rawVal, "%lf", &rawSVal.d); EXPECT_DOUBLE_EQ(cv->value.d, rawSVal.d); } break; - case TSDB_DATA_TYPE_VARCHAR: { + case TSDB_DATA_TYPE_VARCHAR: + case TSDB_DATA_TYPE_GEOMETRY: { EXPECT_STRCASEEQ(rawVal, (const char *)cv->value.pData); } break; case TSDB_DATA_TYPE_TIMESTAMP: { diff --git a/source/dnode/mnode/impl/src/mndFunc.c b/source/dnode/mnode/impl/src/mndFunc.c index af9bedd220..4ffc7a20c2 100644 --- a/source/dnode/mnode/impl/src/mndFunc.c +++ b/source/dnode/mnode/impl/src/mndFunc.c @@ -562,7 +562,7 @@ static void *mnodeGenTypeStr(char *buf, int32_t buflen, uint8_t type, int32_t le return msg; } - if (type == TSDB_DATA_TYPE_NCHAR || type == TSDB_DATA_TYPE_BINARY) { + if (type == TSDB_DATA_TYPE_NCHAR || type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_GEOMETRY) { int32_t bytes = len > 0 ? (int32_t)(len - VARSTR_HEADER_SIZE) : len; snprintf(buf, buflen - 1, "%s(%d)", tDataTypes[type].name, type == TSDB_DATA_TYPE_NCHAR ? bytes / 4 : bytes); diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index 8525724fad..03616aaace 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -1473,7 +1473,7 @@ static int32_t mndAlterStbTagBytes(SMnode *pMnode, const SStbObj *pOld, SStbObj SSchema *pTag = pNew->pTags + tag; - if (!(pTag->type == TSDB_DATA_TYPE_BINARY || pTag->type == TSDB_DATA_TYPE_NCHAR)) { + if (!(pTag->type == TSDB_DATA_TYPE_BINARY || pTag->type == TSDB_DATA_TYPE_NCHAR || pTag->type == TSDB_DATA_TYPE_GEOMETRY)) { terrno = TSDB_CODE_MND_INVALID_STB_OPTION; return -1; } @@ -1593,7 +1593,7 @@ static int32_t mndAlterStbColumnBytes(SMnode *pMnode, const SStbObj *pOld, SStbO } SSchema *pCol = pNew->pColumns + col; - if (!(pCol->type == TSDB_DATA_TYPE_BINARY || pCol->type == TSDB_DATA_TYPE_NCHAR)) { + if (!(pCol->type == TSDB_DATA_TYPE_BINARY || pCol->type == TSDB_DATA_TYPE_NCHAR || pCol->type == TSDB_DATA_TYPE_GEOMETRY)) { terrno = TSDB_CODE_MND_INVALID_STB_OPTION; return -1; } diff --git a/source/libs/CMakeLists.txt b/source/libs/CMakeLists.txt index e18be94ace..4a95629d59 100644 --- a/source/libs/CMakeLists.txt +++ b/source/libs/CMakeLists.txt @@ -17,4 +17,5 @@ add_subdirectory(executor) add_subdirectory(stream) add_subdirectory(planner) add_subdirectory(qworker) +add_subdirectory(geometry) add_subdirectory(command) \ No newline at end of file diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c index 8574bc1123..f59653700b 100644 --- a/source/libs/command/src/command.c +++ b/source/libs/command/src/command.c @@ -48,6 +48,7 @@ static int32_t buildRetrieveTableRsp(SSDataBlock* pBlock, int32_t numOfCols, SRe static int32_t getSchemaBytes(const SSchema* pSchema) { switch (pSchema->type) { case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: return (pSchema->bytes - VARSTR_HEADER_SIZE); case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_JSON: @@ -448,7 +449,7 @@ void appendColumnFields(char* buf, int32_t* len, STableCfg* pCfg) { SSchema* pSchema = pCfg->pSchemas + i; char type[32]; sprintf(type, "%s", tDataTypes[pSchema->type].name); - if (TSDB_DATA_TYPE_VARCHAR == pSchema->type) { + if (TSDB_DATA_TYPE_VARCHAR == pSchema->type || TSDB_DATA_TYPE_GEOMETRY == pSchema->type) { sprintf(type + strlen(type), "(%d)", (int32_t)(pSchema->bytes - VARSTR_HEADER_SIZE)); } else if (TSDB_DATA_TYPE_NCHAR == pSchema->type) { sprintf(type + strlen(type), "(%d)", (int32_t)((pSchema->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); @@ -463,7 +464,7 @@ void appendTagFields(char* buf, int32_t* len, STableCfg* pCfg) { SSchema* pSchema = pCfg->pSchemas + pCfg->numOfColumns + i; char type[32]; sprintf(type, "%s", tDataTypes[pSchema->type].name); - if (TSDB_DATA_TYPE_VARCHAR == pSchema->type) { + if (TSDB_DATA_TYPE_VARCHAR == pSchema->type || TSDB_DATA_TYPE_GEOMETRY == pSchema->type) { sprintf(type + strlen(type), "(%d)", (int32_t)(pSchema->bytes - VARSTR_HEADER_SIZE)); } else if (TSDB_DATA_TYPE_NCHAR == pSchema->type) { sprintf(type + strlen(type), "(%d)", (int32_t)((pSchema->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); @@ -539,7 +540,7 @@ int32_t appendTagValues(char* buf, int32_t* len, STableCfg* pCfg) { } /* - if (type == TSDB_DATA_TYPE_BINARY) { + if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_GEOMETRY) { if (pTagVal->nData > 0) { if (num) { *len += sprintf(buf + VARSTR_HEADER_SIZE + *len, ", "); diff --git a/source/libs/executor/src/executorInt.c b/source/libs/executor/src/executorInt.c index d229f7d0ee..ad7258ae1f 100644 --- a/source/libs/executor/src/executorInt.c +++ b/source/libs/executor/src/executorInt.c @@ -275,7 +275,7 @@ static int32_t doCreateConstantValColumnInfo(SInputColumnInfoData* pInput, SFunc for (int32_t i = 0; i < numOfRows; ++i) { colDataSetDouble(pColInfo, i, &v); } - } else if (type == TSDB_DATA_TYPE_VARCHAR) { + } else if (type == TSDB_DATA_TYPE_VARCHAR || type == TSDB_DATA_TYPE_GEOMETRY) { char* tmp = taosMemoryMalloc(pFuncParam->param.nLen + VARSTR_HEADER_SIZE); STR_WITH_SIZE_TO_VARSTR(tmp, pFuncParam->param.pz, pFuncParam->param.nLen); for (int32_t i = 0; i < numOfRows; ++i) { diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 7a9efde4f3..903975a618 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -343,7 +343,8 @@ void doTimeWindowInterpolation(SArray* pPrevValues, SArray* pDataBlock, TSKEY pr pCtx[k].end.key = curTs; pCtx[k].end.val = v2; - if (pColInfo->info.type == TSDB_DATA_TYPE_BINARY || pColInfo->info.type == TSDB_DATA_TYPE_NCHAR) { + if (pColInfo->info.type == TSDB_DATA_TYPE_BINARY || pColInfo->info.type == TSDB_DATA_TYPE_NCHAR || + pColInfo->info.type == TSDB_DATA_TYPE_GEOMETRY) { if (prevRowIndex == -1) { // pCtx[k].start.ptr = (char*)pRuntimeEnv->prevRow[index]; } else { diff --git a/source/libs/executor/test/sortTests.cpp b/source/libs/executor/test/sortTests.cpp index 8122d7d6a9..b4d1884597 100644 --- a/source/libs/executor/test/sortTests.cpp +++ b/source/libs/executor/test/sortTests.cpp @@ -66,7 +66,7 @@ SSDataBlock* getSingleColDummyBlock(void* param) { colInfo.info.type = pInfo->type; if (pInfo->type == TSDB_DATA_TYPE_NCHAR) { colInfo.info.bytes = TSDB_NCHAR_SIZE * VARCOUNT + VARSTR_HEADER_SIZE; - } else if (pInfo->type == TSDB_DATA_TYPE_BINARY) { + } else if (pInfo->type == TSDB_DATA_TYPE_BINARY || pInfo->type == TSDB_DATA_TYPE_GEOMETRY) { colInfo.info.bytes = VARCOUNT + VARSTR_HEADER_SIZE; } else { colInfo.info.bytes = tDataTypes[pInfo->type].bytes; @@ -94,7 +94,7 @@ SSDataBlock* getSingleColDummyBlock(void* param) { colDataSetVal(pColInfo, i, reinterpret_cast(str), false); pBlock->info.hasVarCol = true; printf("nchar: %s\n", strOri); - } else if (pInfo->type == TSDB_DATA_TYPE_BINARY) { + } else if (pInfo->type == TSDB_DATA_TYPE_BINARY || pInfo->type == TSDB_DATA_TYPE_GEOMETRY) { int32_t size = taosRand() % VARCOUNT; char str[64] = {0}; taosRandStr(varDataVal(str), size); @@ -317,7 +317,7 @@ TEST(testCase, external_mem_sort_Test) { char buf[128] = {0}; int32_t len = taosUcs4ToMbs((TdUcs4 *)varDataVal(v), varDataLen(v), buf); printf("%d: %s\n", row++, buf); - }else if(pInfo[i].type == TSDB_DATA_TYPE_BINARY){ + }else if(pInfo[i].type == TSDB_DATA_TYPE_BINARY || pInfo[i]->type == TSDB_DATA_TYPE_GEOMETRY){ char buf[128] = {0}; memcpy(buf, varDataVal(v), varDataLen(v)); printf("%d: %s\n", row++, buf); diff --git a/source/libs/function/CMakeLists.txt b/source/libs/function/CMakeLists.txt index f23b4d3e87..3e1e84bdc5 100644 --- a/source/libs/function/CMakeLists.txt +++ b/source/libs/function/CMakeLists.txt @@ -32,6 +32,7 @@ target_link_libraries( PRIVATE nodes PRIVATE qcom PRIVATE scalar + PRIVATE geometry PRIVATE transport PRIVATE stream ${LINK_JEMALLOC} PUBLIC uv_a diff --git a/source/libs/function/inc/functionMgtInt.h b/source/libs/function/inc/functionMgtInt.h index a07038384e..2a8f60d4d2 100644 --- a/source/libs/function/inc/functionMgtInt.h +++ b/source/libs/function/inc/functionMgtInt.h @@ -50,6 +50,7 @@ extern "C" { #define FUNC_MGT_KEEP_ORDER_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(21) #define FUNC_MGT_CUMULATIVE_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(22) #define FUNC_MGT_INTERP_PC_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(23) +#define FUNC_MGT_GEOMETRY_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(24) #define FUNC_MGT_TEST_MASK(val, mask) (((val) & (mask)) != 0) diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 752b84b5ad..657b02c205 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -18,6 +18,7 @@ #include "cJSON.h" #include "querynodes.h" #include "scalar.h" +#include "geomFunc.h" #include "taoserror.h" #include "ttime.h" @@ -2107,6 +2108,70 @@ static int32_t translateToJson(SFunctionNode* pFunc, char* pErrBuf, int32_t len) return TSDB_CODE_SUCCESS; } +static int32_t translateInStrOutGeom(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (1 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t para1Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType.type; + if (!IS_STR_DATA_TYPE(para1Type) && !IS_NULL_TYPE(para1Type)) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_GEOMETRY].bytes, .type = TSDB_DATA_TYPE_GEOMETRY}; + + return TSDB_CODE_SUCCESS; +} + +static int32_t translateInGeomOutStr(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (1 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t para1Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType.type; + if (para1Type != TSDB_DATA_TYPE_GEOMETRY && !IS_NULL_TYPE(para1Type)) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_VARCHAR].bytes, .type = TSDB_DATA_TYPE_VARCHAR}; + + return TSDB_CODE_SUCCESS; +} + +static int32_t translateIn2NumOutGeom(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (2 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t para1Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType.type; + uint8_t para2Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 1))->resType.type; + if ((!IS_NUMERIC_TYPE(para1Type) && !IS_NULL_TYPE(para1Type)) || + (!IS_NUMERIC_TYPE(para2Type) && !IS_NULL_TYPE(para2Type))) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_GEOMETRY].bytes, .type = TSDB_DATA_TYPE_GEOMETRY}; + + return TSDB_CODE_SUCCESS; +} + +static int32_t translateIn2GeomOutBool(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (2 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t para1Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType.type; + uint8_t para2Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 1))->resType.type; + if ((para1Type != TSDB_DATA_TYPE_GEOMETRY && !IS_NULL_TYPE(para1Type)) || + (para2Type != TSDB_DATA_TYPE_GEOMETRY && !IS_NULL_TYPE(para2Type))) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BOOL].bytes, .type = TSDB_DATA_TYPE_BOOL}; + + return TSDB_CODE_SUCCESS; +} + static int32_t translateSelectValue(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { pFunc->node.resType = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType; return TSDB_CODE_SUCCESS; @@ -3362,6 +3427,96 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .sprocessFunc = NULL, .finalizeFunc = NULL }, + { + .name = "st_geomfromtext", + .type = FUNCTION_TYPE_GEOM_FROM_TEXT, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_GEOMETRY_FUNC, + .translateFunc = translateInStrOutGeom, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = geomFromTextFunction, + .finalizeFunc = NULL + }, + { + .name = "st_astext", + .type = FUNCTION_TYPE_AS_TEXT, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_GEOMETRY_FUNC, + .translateFunc = translateInGeomOutStr, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = asTextFunction, + .finalizeFunc = NULL + }, + { + .name = "st_makepoint", + .type = FUNCTION_TYPE_MAKE_POINT, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_GEOMETRY_FUNC, + .translateFunc = translateIn2NumOutGeom, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = makePointFunction, + .finalizeFunc = NULL + }, + { + .name = "st_intersects", + .type = FUNCTION_TYPE_INTERSECTS, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_GEOMETRY_FUNC, + .translateFunc = translateIn2GeomOutBool, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = intersectsFunction, + .finalizeFunc = NULL + }, + { + .name = "st_equals", + .type = FUNCTION_TYPE_EQUALS, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_GEOMETRY_FUNC, + .translateFunc = translateIn2GeomOutBool, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = equalsFunction, + .finalizeFunc = NULL + }, + { + .name = "st_touches", + .type = FUNCTION_TYPE_TOUCHES, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_GEOMETRY_FUNC, + .translateFunc = translateIn2GeomOutBool, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = touchesFunction, + .finalizeFunc = NULL + }, + { + .name = "st_covers", + .type = FUNCTION_TYPE_COVERS, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_GEOMETRY_FUNC, + .translateFunc = translateIn2GeomOutBool, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = coversFunction, + .finalizeFunc = NULL + }, + { + .name = "st_contains", + .type = FUNCTION_TYPE_CONTAINS, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_GEOMETRY_FUNC, + .translateFunc = translateIn2GeomOutBool, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = containsFunction, + .finalizeFunc = NULL + }, + { + .name = "st_containsproperly", + .type = FUNCTION_TYPE_CONTAINS_PROPERLY, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_GEOMETRY_FUNC, + .translateFunc = translateIn2GeomOutBool, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = containsProperlyFunction, + .finalizeFunc = NULL + }, }; // clang-format on diff --git a/source/libs/geometry/CMakeLists.txt b/source/libs/geometry/CMakeLists.txt new file mode 100644 index 0000000000..679c73f508 --- /dev/null +++ b/source/libs/geometry/CMakeLists.txt @@ -0,0 +1,17 @@ +aux_source_directory(src GEOMETRY_SRC) + +add_library(geometry STATIC ${GEOMETRY_SRC}) +target_include_directories( + geometry + PUBLIC "${TD_SOURCE_DIR}/include/libs/geometry" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../scalar/inc" +) + +target_link_libraries( + geometry + PRIVATE os util nodes function scalar qcom +) + +if(${BUILD_TEST}) + ADD_SUBDIRECTORY(test) +endif(${BUILD_TEST}) diff --git a/source/libs/geometry/src/geomFunc.c b/source/libs/geometry/src/geomFunc.c new file mode 100644 index 0000000000..0e2bac584d --- /dev/null +++ b/source/libs/geometry/src/geomFunc.c @@ -0,0 +1,444 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include "geosWrapper.h" +#include "geomFunc.h" +#include "querynodes.h" +#include "tdatablock.h" +#include "sclInt.h" +#include "sclvector.h" + +typedef int32_t (*_geomDoRelationFunc_t)(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res); + +typedef int32_t (*_geomInitCtxFunc_t)(); +typedef int32_t (*_geomExecuteOneParamFunc_t)(SColumnInfoData *pInputData, int32_t i, SColumnInfoData *pOutputData); +typedef int32_t (*_geomExecuteTwoParamsFunc_t)(SColumnInfoData *pInputData[], int32_t iLeft, int32_t iRight, + SColumnInfoData *pOutputData); + +// output is with VARSTR format +// need to call taosMemoryFree(*output) later +int32_t doMakePointFunc(double x, double y, unsigned char **output) { + int32_t code = TSDB_CODE_FAILED; + + unsigned char *outputGeom = NULL; + size_t size = 0; + code = doMakePoint(x, y, &outputGeom, &size); + if (code != TSDB_CODE_SUCCESS) { + goto _exit; + } + + *output = taosMemoryCalloc(1, size + VARSTR_HEADER_SIZE); + if (*output == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } + + memcpy(varDataVal(*output), outputGeom, size); + varDataSetLen(*output, size); + code = TSDB_CODE_SUCCESS; + +_exit: + geosFreeBuffer(outputGeom); + + return code; +} + +// both input and output are with VARSTR format +// need to call taosMemoryFree(*output) later +int32_t doGeomFromTextFunc(const char *input, unsigned char **output) { + int32_t code = TSDB_CODE_FAILED; + + if ((varDataLen(input)) == 0) { //empty value + *output = NULL; + return TSDB_CODE_SUCCESS; + } + + // make input as a zero ending string + char *end = varDataVal(input) + varDataLen(input); + char endValue = *end; + *end = 0; + + unsigned char *outputGeom = NULL; + size_t size = 0; + + code = doGeomFromText(varDataVal(input), &outputGeom, &size); + if (code != TSDB_CODE_SUCCESS) { + goto _exit; + } + + *output = taosMemoryCalloc(1, size + VARSTR_HEADER_SIZE); + if (*output == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } + + memcpy(varDataVal(*output), outputGeom, size); + varDataSetLen(*output, size); + code = TSDB_CODE_SUCCESS; + +_exit: + geosFreeBuffer(outputGeom); + + *end = endValue; //recover the input string + + return code; +} + +// both input and output are with VARSTR format +// need to call taosMemoryFree(*output) later +int32_t doAsTextFunc(unsigned char *input, char **output) { + int32_t code = TSDB_CODE_FAILED; + + if ((varDataLen(input)) == 0) { //empty value + *output = NULL; + return TSDB_CODE_SUCCESS; + } + + char *outputWKT = NULL; + code = doAsText(varDataVal(input), varDataLen(input), &outputWKT); + if (code != TSDB_CODE_SUCCESS) { + goto _exit; + } + + size_t size = strlen(outputWKT); + *output = taosMemoryCalloc(1, size + VARSTR_HEADER_SIZE); + if (*output == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } + + memcpy(varDataVal(*output), outputWKT, size); + varDataSetLen(*output, size); + code = TSDB_CODE_SUCCESS; + +_exit: + geosFreeBuffer(outputWKT); + + return code; +} + +int32_t executeMakePointFunc(SColumnInfoData *pInputData[], int32_t iLeft, int32_t iRight, + SColumnInfoData *pOutputData) { + int32_t code = TSDB_CODE_FAILED; + + _getDoubleValue_fn_t getDoubleValueFn[2]; + getDoubleValueFn[0]= getVectorDoubleValueFn(pInputData[0]->info.type); + getDoubleValueFn[1]= getVectorDoubleValueFn(pInputData[1]->info.type); + + unsigned char *output = NULL; + code = doMakePointFunc(getDoubleValueFn[0](pInputData[0]->pData, iLeft), getDoubleValueFn[1](pInputData[1]->pData, iRight), &output); + if (code != TSDB_CODE_SUCCESS) { + goto _exit; + } + + colDataAppend(pOutputData, TMAX(iLeft, iRight), output, (output == NULL)); + +_exit: + if (output) { + taosMemoryFree(output); + } + + return code; +} + +int32_t executeGeomFromTextFunc(SColumnInfoData *pInputData, int32_t i, SColumnInfoData *pOutputData) { + int32_t code = TSDB_CODE_FAILED; + + char *input = colDataGetData(pInputData, i); + unsigned char *output = NULL; + code = doGeomFromTextFunc(input, &output); + if (code != TSDB_CODE_SUCCESS) { + goto _exit; + } + + colDataAppend(pOutputData, i, output, (output == NULL)); + +_exit: + if (output) { + taosMemoryFree(output); + } + + return code; +} + +int32_t executeAsTextFunc(SColumnInfoData *pInputData, int32_t i, SColumnInfoData *pOutputData) { + int32_t code = TSDB_CODE_FAILED; + + unsigned char *input = colDataGetData(pInputData, i); + char *output = NULL; + code = doAsTextFunc(input, &output); + if (code != TSDB_CODE_SUCCESS) { + goto _exit; + } + + colDataAppend(pOutputData, i, output, (output == NULL)); + +_exit: + if (output) { + taosMemoryFree(output); + } + + return code; +} + +int32_t executeRelationFunc(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, + const GEOSGeometry *geom2, int32_t i, + bool swapped, SColumnInfoData *pOutputData, + _geomDoRelationFunc_t doRelationFn) { + int32_t code = TSDB_CODE_FAILED; + char res = 0; + + if (!geom1 || !geom2) { //if empty input value + res = -1; + code = TSDB_CODE_SUCCESS; + } + else { + code = doRelationFn(geom1, preparedGeom1, geom2, swapped, &res); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + } + + colDataAppend(pOutputData, i, &res, (res==-1)); + + return code; +} + +int32_t geomOneParamFunction(SScalarParam *pInput, SScalarParam *pOutput, + _geomInitCtxFunc_t initCtxFn, _geomExecuteOneParamFunc_t executeOneParamFn) { + int32_t code = TSDB_CODE_FAILED; + + code = initCtxFn(); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + SColumnInfoData *pInputData = pInput->columnData; + SColumnInfoData *pOutputData = pOutput->columnData; + pOutput->numOfRows = pInput->numOfRows; + + if (IS_NULL_TYPE(GET_PARAM_TYPE(pInput))) { + colDataSetNNULL(pOutputData, 0, pInput->numOfRows); + code = TSDB_CODE_SUCCESS; + } + else { + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + if (colDataIsNull_s(pInputData, i)) { + colDataSetNULL(pOutputData, i); + code = TSDB_CODE_SUCCESS; + continue; + } + + code = executeOneParamFn(pInputData, i, pOutputData); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + } + } + + return code; +} + +int32_t geomTwoParamsFunction(SScalarParam *pInput, SScalarParam *pOutput, + _geomInitCtxFunc_t initCtxFn, _geomExecuteTwoParamsFunc_t executeTwoParamsFn) { + int32_t code = TSDB_CODE_FAILED; + + code = initCtxFn(); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + SColumnInfoData *pInputData[2]; + SColumnInfoData *pOutputData = pOutput->columnData; + pInputData[0] = pInput[0].columnData; + pInputData[1] = pInput[1].columnData; + + bool hasNullType = (IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[0])) || + IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[1]))); + bool isConstantLeft = (pInput[0].numOfRows == 1); + bool isConstantRight = (pInput[1].numOfRows == 1); + int32_t numOfRows = TMAX(pInput[0].numOfRows, pInput[1].numOfRows); + pOutput->numOfRows = numOfRows; + + if (hasNullType || // one of operant is NULL type + (isConstantLeft && colDataIsNull_s(pInputData[0], 0)) || // left operand is constant NULL + (isConstantRight && colDataIsNull_s(pInputData[1], 0))) { // right operand is constant NULL + colDataSetNNULL(pOutputData, 0, numOfRows); + code = TSDB_CODE_SUCCESS; + } + else { + int32_t iLeft = 0; + int32_t iRight = 0; + for (int32_t i = 0; i < numOfRows; ++i) { + iLeft = isConstantLeft ? 0 : i; + iRight = isConstantRight ? 0 : i; + + if ((!isConstantLeft && colDataIsNull_s(pInputData[0], iLeft)) || + (!isConstantRight && colDataIsNull_s(pInputData[1], iRight))) { + colDataSetNULL(pOutputData, i); + code = TSDB_CODE_SUCCESS; + continue; + } + + code = executeTwoParamsFn(pInputData, iLeft, iRight, pOutputData); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + } + } + + return code; +} + +int32_t geomRelationFunction(SScalarParam *pInput, SScalarParam *pOutput, + bool swapAllowed, _geomDoRelationFunc_t doRelationFn) { + int32_t code = TSDB_CODE_FAILED; + + code = initCtxRelationFunc(); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + // handle with all NULL output + bool hasNullType = (IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[0])) || + IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[1]))); + bool isConstant1 = (pInput[0].numOfRows == 1); + bool isConstant2 = (pInput[1].numOfRows == 1); + int32_t numOfRows = TMAX(pInput[0].numOfRows, pInput[1].numOfRows); + pOutput->numOfRows = numOfRows; + SColumnInfoData *pOutputData = pOutput->columnData; + + if (hasNullType || // at least one of operant is NULL type + (isConstant1 && colDataIsNull_s(pInput[0].columnData, 0)) || // left operand is constant NULL + (isConstant2 && colDataIsNull_s(pInput[1].columnData, 0))) { // right operand is constant NULL + colDataSetNNULL(pOutputData, 0, numOfRows); + code = TSDB_CODE_SUCCESS; + return code; + } + + bool swapped = false; + SColumnInfoData *pInputData[2]; + + // swap two input data to make sure input data 0 is constant if swapAllowed and only isConstant2 is true + if (swapAllowed && + !isConstant1 && isConstant2) { + pInputData[0] = pInput[1].columnData; + pInputData[1] = pInput[0].columnData; + + isConstant1 = true; + isConstant2 = false; + swapped = true; + } + else { + pInputData[0] = pInput[0].columnData; + pInputData[1] = pInput[1].columnData; + } + + GEOSGeometry *geom1 = NULL; + GEOSGeometry *geom2 = NULL; + const GEOSPreparedGeometry *preparedGeom1 = NULL; + + // if there is constant, make PreparedGeometry from pInputData 0 + if (isConstant1) { + code = readGeometry(colDataGetData(pInputData[0], 0), &geom1, &preparedGeom1); + if (code != TSDB_CODE_SUCCESS) { + goto _exit; + } + } + if (isConstant2) { + code = readGeometry(colDataGetData(pInputData[1], 0), &geom2, NULL); + if (code != TSDB_CODE_SUCCESS) { + goto _exit; + } + } + + for (int32_t i = 0; i < numOfRows; ++i) { + if ((!isConstant1 && colDataIsNull_s(pInputData[0], i)) || + (!isConstant2 && colDataIsNull_s(pInputData[1], i))) { + colDataSetNULL(pOutputData, i); + code = TSDB_CODE_SUCCESS; + continue; + } + + if (!isConstant1) { + code = readGeometry(colDataGetData(pInputData[0], i), &geom1, &preparedGeom1); + if (code != TSDB_CODE_SUCCESS) { + goto _exit; + } + } + if (!isConstant2) { + code = readGeometry(colDataGetData(pInputData[1], i), &geom2, NULL); + if (code != TSDB_CODE_SUCCESS) { + goto _exit; + } + } + + code = executeRelationFunc(geom1, preparedGeom1, geom2, i, swapped, pOutputData, doRelationFn); + if (code != TSDB_CODE_SUCCESS) { + goto _exit; + } + + if (!isConstant1) { + destroyGeometry(&geom1, &preparedGeom1); + } + if (!isConstant2) { + destroyGeometry(&geom2, NULL); + } + } + +_exit: + destroyGeometry(&geom1, &preparedGeom1); + destroyGeometry(&geom2, NULL); + + return code; +} + +int32_t makePointFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return geomTwoParamsFunction(pInput, pOutput, initCtxMakePoint, executeMakePointFunc); +} + +int32_t geomFromTextFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return geomOneParamFunction(pInput, pOutput, initCtxGeomFromText, executeGeomFromTextFunc); +} + +int32_t asTextFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return geomOneParamFunction(pInput, pOutput, initCtxAsText, executeAsTextFunc); +} + +int32_t intersectsFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return geomRelationFunction(pInput, pOutput, true, doIntersects); +} + +int32_t equalsFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return geomRelationFunction(pInput, pOutput, true, doEquals); +} + +int32_t touchesFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return geomRelationFunction(pInput, pOutput, true, doTouches); +} + +int32_t coversFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return geomRelationFunction(pInput, pOutput, true, doCovers); +} + +int32_t containsFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return geomRelationFunction(pInput, pOutput, true, doContains); +} + +int32_t containsProperlyFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return geomRelationFunction(pInput, pOutput, false, doContainsProperly); +} diff --git a/source/libs/geometry/src/geosWrapper.c b/source/libs/geometry/src/geosWrapper.c new file mode 100644 index 0000000000..dd83083ec9 --- /dev/null +++ b/source/libs/geometry/src/geosWrapper.c @@ -0,0 +1,352 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include "geosWrapper.h" +#include "tdef.h" +#include "types.h" + +typedef char (*_geosRelationFunc_t)(GEOSContextHandle_t handle, const GEOSGeometry *g1, const GEOSGeometry *g2); +typedef char (*_geosPreparedRelationFunc_t)(GEOSContextHandle_t handle, const GEOSPreparedGeometry *pg1, const GEOSGeometry *g2); + +void geosFreeBuffer(void *buffer) { + if (buffer) { + GEOSFree_r(getThreadLocalGeosCtx()->handle, buffer); + } +} + +void geosErrMsgeHandler(const char *errMsg, void *userData) { + char* targetErrMsg = userData; + snprintf(targetErrMsg, 512, "%s", errMsg); +} + +int32_t initCtxMakePoint() { + int32_t code = TSDB_CODE_FAILED; + SGeosContext* geosCtx = getThreadLocalGeosCtx(); + + if (geosCtx->handle == NULL) { + geosCtx->handle = GEOS_init_r(); + if (geosCtx->handle == NULL) { + return code; + } + + GEOSContext_setErrorMessageHandler_r(geosCtx->handle, geosErrMsgeHandler, geosCtx->errMsg); + } + + if (geosCtx->WKBWriter == NULL) { + geosCtx->WKBWriter = GEOSWKBWriter_create_r(geosCtx->handle); + if (geosCtx->WKBWriter == NULL) { + return code; + } + } + + return TSDB_CODE_SUCCESS; +} + +// outputWKT is a zero ending string +// need to call geosFreeBuffer(*outputGeom) later +int32_t doMakePoint(double x, double y, unsigned char **outputGeom, size_t *size) { + int32_t code = TSDB_CODE_FAILED; + SGeosContext* geosCtx = getThreadLocalGeosCtx(); + + GEOSGeometry *geom = NULL; + unsigned char *wkb = NULL; + + geom = GEOSGeom_createPointFromXY_r(geosCtx->handle, x, y); + if (geom == NULL) { + code = TSDB_CODE_FUNC_FUNTION_PARA_VALUE; + goto _exit; + } + + wkb = GEOSWKBWriter_write_r(geosCtx->handle, geosCtx->WKBWriter, geom, size); + if (wkb == NULL) { + goto _exit; + } + *outputGeom = wkb; + + code = TSDB_CODE_SUCCESS; + +_exit: + if (geom) { + GEOSGeom_destroy_r(geosCtx->handle, geom); + geom = NULL; + } + + return code; +} + +int32_t initCtxGeomFromText() { + int32_t code = TSDB_CODE_FAILED; + SGeosContext* geosCtx = getThreadLocalGeosCtx(); + + if (geosCtx->handle == NULL) { + geosCtx->handle = GEOS_init_r(); + if (geosCtx->handle == NULL) { + return code; + } + + GEOSContext_setErrorMessageHandler_r(geosCtx->handle, geosErrMsgeHandler, geosCtx->errMsg); + } + + if (geosCtx->WKTReader == NULL) { + geosCtx->WKTReader = GEOSWKTReader_create_r(geosCtx->handle); + if (geosCtx->WKTReader == NULL) { + return code; + } + } + + if (geosCtx->WKBWriter == NULL) { + geosCtx->WKBWriter = GEOSWKBWriter_create_r(geosCtx->handle); + if (geosCtx->WKBWriter == NULL) { + return code; + } + } + + return TSDB_CODE_SUCCESS; +} + +// inputWKT is a zero ending string +// need to call geosFreeBuffer(*outputGeom) later +int32_t doGeomFromText(const char *inputWKT, unsigned char **outputGeom, size_t *size) { + int32_t code = TSDB_CODE_FAILED; + SGeosContext* geosCtx = getThreadLocalGeosCtx(); + + GEOSGeometry *geom = NULL; + unsigned char *wkb = NULL; + + geom = GEOSWKTReader_read_r(geosCtx->handle, geosCtx->WKTReader, inputWKT); + if (geom == NULL) { + code = TSDB_CODE_FUNC_FUNTION_PARA_VALUE; + goto _exit; + } + + wkb = GEOSWKBWriter_write_r(geosCtx->handle, geosCtx->WKBWriter, geom, size); + if (wkb == NULL) { + goto _exit; + } + *outputGeom = wkb; + + code = TSDB_CODE_SUCCESS; + +_exit: + if (geom) { + GEOSGeom_destroy_r(geosCtx->handle, geom); + geom = NULL; + } + + return code; +} + +int32_t initCtxAsText() { + int32_t code = TSDB_CODE_FAILED; + SGeosContext* geosCtx = getThreadLocalGeosCtx(); + + if (geosCtx->handle == NULL) { + geosCtx->handle = GEOS_init_r(); + if (geosCtx->handle == NULL) { + return code; + } + + GEOSContext_setErrorMessageHandler_r(geosCtx->handle, geosErrMsgeHandler, geosCtx->errMsg); + } + + if (geosCtx->WKBReader == NULL) { + geosCtx->WKBReader = GEOSWKBReader_create_r(geosCtx->handle); + if (geosCtx->WKBReader == NULL) { + return code; + } + } + + if (geosCtx->WKTWriter == NULL) { + geosCtx->WKTWriter = GEOSWKTWriter_create_r(geosCtx->handle); + + if (geosCtx->WKTWriter) { + GEOSWKTWriter_setRoundingPrecision_r(geosCtx->handle, geosCtx->WKTWriter, 6); + } else { + return code; + } + } + + return TSDB_CODE_SUCCESS; +} + +// outputWKT is a zero ending string +// need to call geosFreeBuffer(*outputWKT) later +int32_t doAsText(const unsigned char *inputGeom, size_t size, char **outputWKT) { + int32_t code = TSDB_CODE_FAILED; + SGeosContext* geosCtx = getThreadLocalGeosCtx(); + + GEOSGeometry *geom = NULL; + unsigned char *wkt = NULL; + + geom = GEOSWKBReader_read_r(geosCtx->handle, geosCtx->WKBReader, inputGeom, size); + if (geom == NULL) { + code = TSDB_CODE_FUNC_FUNTION_PARA_VALUE; + goto _exit; + } + + wkt = GEOSWKTWriter_write_r(geosCtx->handle, geosCtx->WKTWriter, geom); + if (wkt == NULL) { + goto _exit; + } + *outputWKT = wkt; + + code = TSDB_CODE_SUCCESS; + +_exit: + if (geom) { + GEOSGeom_destroy_r(geosCtx->handle, geom); + geom = NULL; + } + + return code; +} + +int32_t initCtxRelationFunc() { + int32_t code = TSDB_CODE_FAILED; + SGeosContext* geosCtx = getThreadLocalGeosCtx(); + + if (geosCtx->handle == NULL) { + geosCtx->handle = GEOS_init_r(); + if (geosCtx->handle == NULL) { + return code; + } + + GEOSContext_setErrorMessageHandler_r(geosCtx->handle, geosErrMsgeHandler, geosCtx->errMsg); + } + + if (geosCtx->WKBReader == NULL) { + geosCtx->WKBReader = GEOSWKBReader_create_r(geosCtx->handle); + if (geosCtx->WKBReader == NULL) { + return code; + } + } + + return TSDB_CODE_SUCCESS; +} + +int32_t doGeosRelation(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res, + _geosRelationFunc_t relationFn, + _geosRelationFunc_t swappedRelationFn, + _geosPreparedRelationFunc_t preparedRelationFn, + _geosPreparedRelationFunc_t swappedPreparedRelationFn) { + int32_t code = TSDB_CODE_FAILED; + SGeosContext* geosCtx = getThreadLocalGeosCtx(); + + if (!preparedGeom1) { + if (!swapped) { + ASSERT(relationFn); + *res = relationFn(geosCtx->handle, geom1, geom2); + } + else { + ASSERT(swappedRelationFn); + *res = swappedRelationFn(geosCtx->handle, geom1, geom2); + } + } + else { + if (!swapped) { + ASSERT(preparedRelationFn); + *res = preparedRelationFn(geosCtx->handle, preparedGeom1, geom2); + } + else { + ASSERT(swappedPreparedRelationFn); + *res = swappedPreparedRelationFn(geosCtx->handle, preparedGeom1, geom2); + } + } + + code = TSDB_CODE_SUCCESS; + return code; +} + +int32_t doIntersects(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res) { + return doGeosRelation(geom1, preparedGeom1, geom2, swapped, res, + GEOSIntersects_r, GEOSIntersects_r, GEOSPreparedIntersects_r, GEOSPreparedIntersects_r); +} + +int32_t doEquals(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res) { + return doGeosRelation(geom1, NULL, geom2, swapped, res, + GEOSEquals_r, GEOSEquals_r, NULL, NULL); // no prepared version for eguals() +} + +int32_t doTouches(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res) { + return doGeosRelation(geom1, preparedGeom1, geom2, swapped, res, + GEOSTouches_r, GEOSTouches_r, GEOSPreparedTouches_r, GEOSPreparedTouches_r); +} + +int32_t doCovers(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res) { + return doGeosRelation(geom1, preparedGeom1, geom2, swapped, res, + GEOSCovers_r, GEOSCoveredBy_r, GEOSPreparedCovers_r, GEOSPreparedCoveredBy_r); +} + +int32_t doContains(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res) { + return doGeosRelation(geom1, preparedGeom1, geom2, swapped, res, + GEOSContains_r, GEOSWithin_r, GEOSPreparedContains_r, GEOSPreparedWithin_r); +} + +int32_t doContainsProperly(const GEOSGeometry *geom1, const GEOSPreparedGeometry *preparedGeom1, const GEOSGeometry *geom2, + bool swapped, char *res) { + return doGeosRelation(geom1, preparedGeom1, geom2, swapped, res, + NULL, NULL, GEOSPreparedContainsProperly_r, NULL); +} + +// input is with VARSTR format +// need to call destroyGeometry(outputGeom, outputPreparedGeom) later +int32_t readGeometry(const unsigned char *input, GEOSGeometry **outputGeom, const GEOSPreparedGeometry **outputPreparedGeom) { + SGeosContext* geosCtx = getThreadLocalGeosCtx(); + + ASSERT(outputGeom); //it is not allowed if outputGeom is NULL + *outputGeom = NULL; + + if (outputPreparedGeom) { //it means not to generate PreparedGeometry if outputPreparedGeom is NULL + *outputPreparedGeom = NULL; + } + + if (varDataLen(input) == 0) { //empty value + return TSDB_CODE_SUCCESS; + } + + *outputGeom = GEOSWKBReader_read_r(geosCtx->handle, geosCtx->WKBReader, varDataVal(input), varDataLen(input)); + if (*outputGeom == NULL) { + return TSDB_CODE_FUNC_FUNTION_PARA_VALUE; + } + + if (outputPreparedGeom) { + *outputPreparedGeom = GEOSPrepare_r(geosCtx->handle, *outputGeom); + if (*outputPreparedGeom == NULL) { + return TSDB_CODE_FAILED; + } + } + + return TSDB_CODE_SUCCESS; +} + +void destroyGeometry(GEOSGeometry **geom, const GEOSPreparedGeometry **preparedGeom) { + SGeosContext* geosCtx = getThreadLocalGeosCtx(); + + if (preparedGeom && *preparedGeom) { + GEOSPreparedGeom_destroy_r(geosCtx->handle, *preparedGeom); + *preparedGeom = NULL; + } + + if (geom && *geom) { + GEOSGeom_destroy_r(geosCtx->handle, *geom); + *geom = NULL; + } +} diff --git a/source/libs/geometry/test/CMakeLists.txt b/source/libs/geometry/test/CMakeLists.txt new file mode 100644 index 0000000000..ba849a9dc8 --- /dev/null +++ b/source/libs/geometry/test/CMakeLists.txt @@ -0,0 +1,19 @@ +MESSAGE(STATUS "build geometry unit test") + +IF(NOT TD_DARWIN) + # GoogleTest requires at least C++11 + SET(CMAKE_CXX_STANDARD 11) + + AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST) + ADD_EXECUTABLE(geomTest ${SOURCE_LIST}) + + TARGET_LINK_LIBRARIES( + geomTest + PUBLIC os util gtest qcom nodes geometry scalar function scalar + ) + + add_test( + NAME geomTest + COMMAND geomTest + ) +ENDIF() diff --git a/source/libs/geometry/test/geomFuncTest.cpp b/source/libs/geometry/test/geomFuncTest.cpp new file mode 100644 index 0000000000..459c7499cc --- /dev/null +++ b/source/libs/geometry/test/geomFuncTest.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include + +#include "os.h" + +int main(int argc, char **argv) { + taosSeedRand(taosGetTimestampSec()); + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/source/libs/geometry/test/geomFuncTestUtil.cpp b/source/libs/geometry/test/geomFuncTestUtil.cpp new file mode 100644 index 0000000000..cb59ea098f --- /dev/null +++ b/source/libs/geometry/test/geomFuncTestUtil.cpp @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include "geomFuncTestUtil.h" + +void setColumnInfo(SColumnInfo *info, int32_t colId, int32_t type, int32_t bytes) { + memset(info, 0, sizeof(SColumnInfo)); + info->colId = colId; + info->type = type; + info->bytes = bytes; +} + +void setScalarParam(SScalarParam *sclParam, int32_t type, void *valueArray, TDRowValT valTypeArray[], int32_t rowNum) { + int32_t bytes = 0; + switch (type) { + case TSDB_DATA_TYPE_NULL: { + bytes = -1; + break; + } + case TSDB_DATA_TYPE_BOOL: { + bytes = sizeof(int8_t); + break; + } + case TSDB_DATA_TYPE_TINYINT: { + bytes = sizeof(int8_t); + break; + } + case TSDB_DATA_TYPE_SMALLINT: { + bytes = sizeof(int16_t); + break; + } + case TSDB_DATA_TYPE_INT: { + bytes = sizeof(int32_t); + break; + } + case TSDB_DATA_TYPE_BIGINT: { + bytes = sizeof(int64_t); + break; + } + case TSDB_DATA_TYPE_FLOAT: { + bytes = sizeof(float); + break; + } + case TSDB_DATA_TYPE_DOUBLE: { + bytes = sizeof(double); + break; + } + case TSDB_DATA_TYPE_VARCHAR: { + bytes = TSDB_MAX_BINARY_LEN; + break; + } + case TSDB_DATA_TYPE_GEOMETRY: { + bytes = TSDB_MAX_GEOMETRY_LEN; + break; + } + default: { + ASSERT(0); + break; + } + } + + sclParam->columnData = (SColumnInfoData *)taosMemoryCalloc(1, sizeof(SColumnInfoData)); + sclParam->numOfRows = rowNum; + + setColumnInfo(&sclParam->columnData->info, 0, type, bytes); + colInfoDataEnsureCapacity(sclParam->columnData, rowNum, false); + + if (type != TSDB_DATA_TYPE_NULL && valueArray) { + for (int32_t i = 0; i < rowNum; ++i) { + if (tdValTypeIsNull(valTypeArray[i])) { + colDataSetNULL(sclParam->columnData, i); + } + else { + const char *val = (const char *)valueArray + (i * bytes); + colDataAppend(sclParam->columnData, i, val, false); + } + } + } +} + +void destroyScalarParam(SScalarParam *sclParam, int32_t colNum) { + for (int32_t i = 0; i < colNum; ++i) { + colDataDestroy((sclParam + i)->columnData); + taosMemoryFree((sclParam + i)->columnData); + } + taosMemoryFree(sclParam); +} + +void makeOneScalarParam(SScalarParam **pSclParam, int32_t type, void *valueArray, TDRowValT valTypeArray[], int32_t rowNum) { + *pSclParam = (SScalarParam *)taosMemoryCalloc(1, sizeof(SScalarParam)); + setScalarParam(*pSclParam, type, valueArray, valTypeArray, rowNum); +} + +bool compareVarData(unsigned char *varData1, unsigned char *varData2) { + if (varDataLen(varData1) == 0 || varDataLen(varData2) == 0) { + return false; + } + if(varDataLen(varData1) != varDataLen(varData2)) { + return false; + } + + return (memcmp(varDataVal(varData1), varDataVal(varData2), varDataLen(varData1)) == 0); +} + +void compareVarDataColumn(SColumnInfoData *columnData1, SColumnInfoData *columnData2, int32_t rowNum) { + for (int32_t i = 0; i < rowNum; ++i) { + bool isNull1 = colDataIsNull_s(columnData1, i); + bool isNull2 = colDataIsNull_s(columnData2, i); + ASSERT_EQ((isNull1 == isNull2), true); + + if (!isNull1) { + bool res = compareVarData((unsigned char *)colDataGetData(columnData1, i), + (unsigned char *)colDataGetData(columnData2, i)); + ASSERT_EQ(res, true); + } + } +} diff --git a/source/libs/geometry/test/geomFuncTestUtil.h b/source/libs/geometry/test/geomFuncTestUtil.h new file mode 100644 index 0000000000..1d7c6d77be --- /dev/null +++ b/source/libs/geometry/test/geomFuncTestUtil.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include + +#include "tdatablock.h" +#include "geomFunc.h" + +void setScalarParam(SScalarParam *sclParam, int32_t type, void *valueArray, TDRowValT valTypeArray[], int32_t rowNum); +void destroyScalarParam(SScalarParam *sclParam, int32_t colNum); + +void makeOneScalarParam(SScalarParam **pSclParam, int32_t type, void *valueArray, TDRowValT valTypeArray[], int32_t rowNum); + +void compareVarDataColumn(SColumnInfoData *columnData1, SColumnInfoData *columnData2, int32_t rowNum); + +void callGeomFromTextWrapper5(void *strArray, TDRowValT valTypeArray[], int32_t rowNum, SScalarParam *pOutputGeomFromText); diff --git a/source/libs/geometry/test/geomIoFuncTest.cpp b/source/libs/geometry/test/geomIoFuncTest.cpp new file mode 100644 index 0000000000..fcb7a4d12a --- /dev/null +++ b/source/libs/geometry/test/geomIoFuncTest.cpp @@ -0,0 +1,321 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include "geomFuncTestUtil.h" + +void callGeomFromText(int32_t inputType, void *strArray, TDRowValT valTypeArray[], int32_t rowNum, + SScalarParam **pInputGeomFromText, SScalarParam **pOutputGeomFromText, + int32_t expectedCode) { + makeOneScalarParam(pInputGeomFromText, inputType, strArray, valTypeArray, rowNum); + makeOneScalarParam(pOutputGeomFromText, TSDB_DATA_TYPE_GEOMETRY, 0, 0, rowNum); + + int32_t code = geomFromTextFunction(*pInputGeomFromText, 1, *pOutputGeomFromText); + ASSERT_EQ(code, expectedCode); +} + +void callGeomFromTextWrapper1(int32_t inputType, void *strArray, TDRowValT valTypeArray[], int32_t rowNum, SScalarParam **pOutputGeomFromText) { + SScalarParam *pInputGeomFromText; + callGeomFromText(inputType, strArray, valTypeArray, rowNum, &pInputGeomFromText, pOutputGeomFromText, TSDB_CODE_SUCCESS); + destroyScalarParam(pInputGeomFromText, 1); +} + +void callGeomFromTextWrapper2(void *strArray, TDRowValT valTypeArray[], int32_t rowNum, SScalarParam **pOutputGeomFromText) { + callGeomFromTextWrapper1(TSDB_DATA_TYPE_VARCHAR, strArray, valTypeArray, rowNum, pOutputGeomFromText); +} + +void callGeomFromTextWrapper3(int32_t inputType, void *strArray, TDRowValT valTypeArray[], int32_t rowNum, int32_t expectedCode) { + SScalarParam *pInputGeomFromText; + SScalarParam *pOutputGeomFromText; + + callGeomFromText(inputType, strArray, valTypeArray, rowNum, &pInputGeomFromText, &pOutputGeomFromText, expectedCode); + + destroyScalarParam(pInputGeomFromText, 1); + destroyScalarParam(pOutputGeomFromText, 1); +} + +void callGeomFromTextWrapper4(void *strArray, TDRowValT valTypeArray[], int32_t rowNum, int32_t expectedCode) { + callGeomFromTextWrapper3(TSDB_DATA_TYPE_VARCHAR, strArray, valTypeArray, rowNum, expectedCode); +} + +void callGeomFromTextWrapper5(void *strArray, TDRowValT valTypeArray[], int32_t rowNum, SScalarParam *pOutputGeomFromText) { + SScalarParam *pInputGeomFromText; + makeOneScalarParam(&pInputGeomFromText, TSDB_DATA_TYPE_VARCHAR, strArray, valTypeArray, rowNum); + + setScalarParam(pOutputGeomFromText, TSDB_DATA_TYPE_GEOMETRY, 0, 0, rowNum); + + int32_t code = geomFromTextFunction(pInputGeomFromText, 1, pOutputGeomFromText); + ASSERT_EQ(code, TSDB_CODE_SUCCESS); + + destroyScalarParam(pInputGeomFromText, 1); +} + +void callAsText(int32_t inputType, void *strArray, TDRowValT valTypeArray[], int32_t rowNum, + SScalarParam **pInputAsText, SScalarParam **pOutputAsText, + int32_t expectedCode) { + makeOneScalarParam(pInputAsText, inputType, strArray, valTypeArray, rowNum); + makeOneScalarParam(pOutputAsText, TSDB_DATA_TYPE_VARCHAR, 0, 0, rowNum); + + int32_t code = geomFromTextFunction(*pInputAsText, 1, *pOutputAsText); + ASSERT_EQ(code, expectedCode); +} + +void callAsTextWrapper1(int32_t inputType, void *strArray, TDRowValT valTypeArray[], int32_t rowNum, SScalarParam **pOutputAsText) { + SScalarParam *pInputAsText; + callAsText(inputType, strArray, valTypeArray, rowNum, &pInputAsText, pOutputAsText, TSDB_CODE_SUCCESS); + destroyScalarParam(pInputAsText, 1); +} + +void callAsTextWrapper2(int32_t inputType, void *strArray, TDRowValT valTypeArray[], int32_t rowNum, int32_t expectedCode) { + SScalarParam *pInputAsText; + SScalarParam *pOutputASText; + + callAsText(inputType, strArray, valTypeArray, rowNum, &pInputAsText, &pOutputASText, expectedCode); + + destroyScalarParam(pInputAsText, 1); + destroyScalarParam(pOutputASText, 1); +} + +void callMakePointAndCompareResult(int32_t type1, void *valueArray1, TDRowValT valTypeArray1[], bool isConstant1, + int32_t type2, void *valueArray2, TDRowValT valTypeArray2[], bool isConstant2, + SScalarParam *pExpectedResult, int32_t rowNum) { + int32_t rowNum1 = isConstant1 ? 1 : rowNum; + int32_t rowNum2 = isConstant2 ? 1 : rowNum; + + SScalarParam *pInputMakePoint = (SScalarParam *)taosMemoryCalloc(2, sizeof(SScalarParam)); + setScalarParam(pInputMakePoint, type1, valueArray1, valTypeArray1, rowNum1); + setScalarParam(pInputMakePoint + 1, type2, valueArray2, valTypeArray2, rowNum2); + + SScalarParam *pOutputMakePoint; + makeOneScalarParam(&pOutputMakePoint, TSDB_DATA_TYPE_GEOMETRY, 0, 0, rowNum); + + int32_t code = makePointFunction(pInputMakePoint, 2, pOutputMakePoint); + ASSERT_EQ(code, TSDB_CODE_SUCCESS); + + ASSERT_EQ(pOutputMakePoint->columnData->info.type, TSDB_DATA_TYPE_GEOMETRY); + ASSERT_EQ(pExpectedResult->columnData->info.type, TSDB_DATA_TYPE_GEOMETRY); + + compareVarDataColumn(pOutputMakePoint->columnData, pExpectedResult->columnData, rowNum); + + destroyScalarParam(pInputMakePoint, 2); + destroyScalarParam(pOutputMakePoint, 1); +} + +#define MAKE_POINT_FIRST_COLUMN_VALUES {2, 3, -4} +#define MAKE_POINT_SECOND_COLUMN_VALUES {5, -6, -7} + +TEST(GeomIoFuncTest, makePointFunctionTwoColumns) { + const int32_t rowNum = 3; + SScalarParam *pExpectedResult; + TDRowValT valTypeArray[rowNum] = {TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM}; + + // call GeomFromText() and generate pExpectedResult to compare later + char strArray[rowNum][TSDB_MAX_BINARY_LEN]; + STR_TO_VARSTR(strArray[0], "POINT(2.0 5.0)"); + STR_TO_VARSTR(strArray[1], "POINT(3.0 -6.0)"); + STR_TO_VARSTR(strArray[2], "POINT(-4.0 -7.0)"); + callGeomFromTextWrapper2(strArray, valTypeArray, rowNum, &pExpectedResult); + + // call MakePoint() with TINYINT and SMALLINT, and compare with result of GeomFromText() + int8_t tinyIntArray1[rowNum] = MAKE_POINT_FIRST_COLUMN_VALUES; + int16_t smallIntArray2[rowNum] = MAKE_POINT_SECOND_COLUMN_VALUES; + callMakePointAndCompareResult(TSDB_DATA_TYPE_TINYINT, tinyIntArray1, valTypeArray, false, + TSDB_DATA_TYPE_SMALLINT, smallIntArray2, valTypeArray, false, + pExpectedResult, rowNum); + + // call MakePoint() with INT and BIGINT, and compare with result of GeomFromText() + int32_t intArray1[rowNum] = MAKE_POINT_FIRST_COLUMN_VALUES; + int64_t bigIntArray2[rowNum] = MAKE_POINT_SECOND_COLUMN_VALUES; + callMakePointAndCompareResult(TSDB_DATA_TYPE_INT, intArray1, valTypeArray, false, + TSDB_DATA_TYPE_BIGINT, bigIntArray2, valTypeArray, false, + pExpectedResult, rowNum); + + // call MakePoint() with FLOAT and DOUBLE, and compare with result of GeomFromText() + float floatArray1[rowNum] = MAKE_POINT_FIRST_COLUMN_VALUES; + double doubleArray2[rowNum] = MAKE_POINT_SECOND_COLUMN_VALUES; + callMakePointAndCompareResult(TSDB_DATA_TYPE_FLOAT, floatArray1, valTypeArray, false, + TSDB_DATA_TYPE_DOUBLE, doubleArray2, valTypeArray, false, + pExpectedResult, rowNum); + + destroyScalarParam(pExpectedResult, 1); +} + +TEST(GeomIoFuncTest, makePointFunctionConstant) { + const int32_t rowNum = 3; + SScalarParam *pExpectedResult; + TDRowValT valTypeArray[rowNum] = {TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM}; + + // 1. call GeomFromText() and generate pExpectedResult with first constant + char strArray[rowNum][TSDB_MAX_BINARY_LEN]; + STR_TO_VARSTR(strArray[0], "POINT(3.0 5.0)"); + STR_TO_VARSTR(strArray[1], "POINT(3.0 -6.0)"); + STR_TO_VARSTR(strArray[2], "POINT(3.0 -7.0)"); + callGeomFromTextWrapper2(strArray, valTypeArray, rowNum, &pExpectedResult); + + // call MakePoint() with TINYINT constant and BIGINT column, and compare with result of GeomFromText() + int8_t tinyIntConstant = 3; + int64_t bigIntArray[rowNum] = MAKE_POINT_SECOND_COLUMN_VALUES; + callMakePointAndCompareResult(TSDB_DATA_TYPE_TINYINT, &tinyIntConstant, valTypeArray, true, + TSDB_DATA_TYPE_BIGINT, bigIntArray, valTypeArray, false, + pExpectedResult, rowNum); + + destroyScalarParam(pExpectedResult, 1); + + // 2. call GeomFromText() and generate pExpectedResult with second constant + STR_TO_VARSTR(strArray[0], "POINT(2.0 3.0)"); + STR_TO_VARSTR(strArray[1], "POINT(3.0 3.0)"); + STR_TO_VARSTR(strArray[2], "POINT(-4.0 3.0)"); + callGeomFromTextWrapper2(strArray, valTypeArray, rowNum, &pExpectedResult); + + // call MakePoint() with INT column and FLOAT constant, and compare with result of GeomFromText() + int32_t intArray[rowNum] = MAKE_POINT_FIRST_COLUMN_VALUES; + float floatConstant = 3; + callMakePointAndCompareResult(TSDB_DATA_TYPE_INT, intArray, valTypeArray, false, + TSDB_DATA_TYPE_FLOAT, &floatConstant, valTypeArray, true, + pExpectedResult, rowNum); + + destroyScalarParam(pExpectedResult, 1); +} + +TEST(GeomIoFuncTest, makePointFunctionWithNull) { + const int32_t rowNum = 3; + SScalarParam *pExpectedResult; + TDRowValT valTypeNormArray[rowNum] = {TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM}; + + // call GeomFromText() and generate pExpectedResult with all NULL values + char strArray[rowNum][TSDB_MAX_BINARY_LEN]; + TDRowValT valTypeNullArray[rowNum] = {TD_VTYPE_NULL, TD_VTYPE_NULL, TD_VTYPE_NULL}; + callGeomFromTextWrapper2(strArray, valTypeNullArray, rowNum, &pExpectedResult); + + // 1. call MakePoint() with NULL type and INT column, and compare all NULL results + int64_t intArray[rowNum] = MAKE_POINT_SECOND_COLUMN_VALUES; + callMakePointAndCompareResult(TSDB_DATA_TYPE_NULL, 0, 0, true, + TSDB_DATA_TYPE_INT, intArray, valTypeNormArray, false, + pExpectedResult, rowNum); + // swap params and compare + callMakePointAndCompareResult(TSDB_DATA_TYPE_INT, intArray, valTypeNormArray, false, + TSDB_DATA_TYPE_NULL, 0, 0, true, + pExpectedResult, rowNum); + + // call MakePoint() with SMALLINT NULL constant and BIGINT column, and compare all NULL results + int16_t smallIntConstant = 0; + int64_t bigIntArray[rowNum] = MAKE_POINT_SECOND_COLUMN_VALUES; + callMakePointAndCompareResult(TSDB_DATA_TYPE_SMALLINT, &smallIntConstant, valTypeNullArray, true, + TSDB_DATA_TYPE_BIGINT, bigIntArray, valTypeNormArray, false, + pExpectedResult, rowNum); + // swap params and compare + callMakePointAndCompareResult(TSDB_DATA_TYPE_BIGINT, bigIntArray, valTypeNormArray, false, + TSDB_DATA_TYPE_SMALLINT, &smallIntConstant, valTypeNullArray, true, + pExpectedResult, rowNum); + + destroyScalarParam(pExpectedResult, 1); + + // 2. call GeomFromText() and generate pExpectedResult with NULL value + STR_TO_VARSTR(strArray[0], "POINT(2.0 5.0)"); + STR_TO_VARSTR(strArray[2], "POINT(-4.0 -7.0)"); + TDRowValT valTypeWithNullArray[rowNum] = {TD_VTYPE_NORM, TD_VTYPE_NULL, TD_VTYPE_NORM}; + callGeomFromTextWrapper2(strArray, valTypeWithNullArray, rowNum, &pExpectedResult); + + // call MakePoint() with TINYINT column with NULL value and FLOAT column, and compare results with NULL value + int8_t tinyIntArray[rowNum] = MAKE_POINT_FIRST_COLUMN_VALUES; + float floatArray[rowNum] = MAKE_POINT_SECOND_COLUMN_VALUES; + callMakePointAndCompareResult(TSDB_DATA_TYPE_TINYINT, tinyIntArray, valTypeWithNullArray, false, + TSDB_DATA_TYPE_FLOAT, floatArray, valTypeNormArray, false, + pExpectedResult, rowNum); + + // call MakePoint() with SMALLINT column and DOUBLE column with NULL value, and compare results with NULL value + int16_t smallIntArray[rowNum] = MAKE_POINT_FIRST_COLUMN_VALUES; + double doubleArray[rowNum] = MAKE_POINT_SECOND_COLUMN_VALUES; + callMakePointAndCompareResult(TSDB_DATA_TYPE_SMALLINT, smallIntArray, valTypeNormArray, false, + TSDB_DATA_TYPE_DOUBLE, doubleArray, valTypeWithNullArray, false, + pExpectedResult, rowNum); + + destroyScalarParam(pExpectedResult, 1); +} + +TEST(GeomIoFuncTest, geomFromTextFunction) { + const int32_t rowNum = 4; + char strArray[rowNum][TSDB_MAX_BINARY_LEN]; + TDRowValT valTypeNormArray[rowNum] = {TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM}; + + // column input + // input of GeomFromText (with NULL value) and output of AsText should be same after calling GeomFromText() and AsText() + SScalarParam *pInputGeomFromText; + SScalarParam *pOutputGeomFromText; + SScalarParam *pOutputAsText; + + STR_TO_VARSTR(strArray[0], "POINT (2.000000 5.000000)"); + STR_TO_VARSTR(strArray[2], "LINESTRING (3.000000 -6.000000, -71.160837 42.259113)"); + STR_TO_VARSTR(strArray[3], "POLYGON ((-71.177658 42.390290, -71.177682 42.390370, -71.177606 42.390382, -71.177582 42.390303, -71.177658 42.390290))"); + TDRowValT valTypeWithNullArray[rowNum] = {TD_VTYPE_NORM, TD_VTYPE_NULL, TD_VTYPE_NORM, TD_VTYPE_NORM}; + callGeomFromText(TSDB_DATA_TYPE_VARCHAR, strArray, valTypeWithNullArray, rowNum, &pInputGeomFromText, &pOutputGeomFromText, TSDB_CODE_SUCCESS); + + makeOneScalarParam(&pOutputAsText, TSDB_DATA_TYPE_VARCHAR, 0, 0, rowNum); + int32_t code = asTextFunction(pOutputGeomFromText, 1, pOutputAsText); // pOutputGeomFromText is input for AsText() + ASSERT_EQ(code, TSDB_CODE_SUCCESS); + + compareVarDataColumn(pInputGeomFromText->columnData, pOutputAsText->columnData, rowNum); + + destroyScalarParam(pInputGeomFromText, 1); + destroyScalarParam(pOutputGeomFromText, 1); + destroyScalarParam(pOutputAsText, 1); + + // empty input + STR_TO_VARSTR(strArray[0], ""); + callGeomFromTextWrapper4(strArray, valTypeNormArray, 1, TSDB_CODE_SUCCESS); + + // NULL type input + callGeomFromTextWrapper1(TSDB_DATA_TYPE_NULL, 0, 0, 1, &pOutputGeomFromText); + ASSERT_EQ(colDataIsNull_s(pOutputGeomFromText->columnData, 0), true); + destroyScalarParam(pOutputGeomFromText, 1); + + // wrong type input [ToDo] make sure it is handled in geomFunc + int32_t intInput = 3; + callGeomFromTextWrapper3(TSDB_DATA_TYPE_INT, &intInput, valTypeNormArray, 1, TSDB_CODE_FUNC_FUNTION_PARA_VALUE); + + // wrong content input + STR_TO_VARSTR(strArray[0], "POIN(2 5)"); // lack of the last letter of 'POINT' + callGeomFromTextWrapper4(strArray, valTypeNormArray, 1, TSDB_CODE_FUNC_FUNTION_PARA_VALUE); + STR_TO_VARSTR(strArray[0], "LINESTRING(3 -6.1,-7.1 4.2,)"); // redundant comma at the end + callGeomFromTextWrapper4(strArray, valTypeNormArray, 1, TSDB_CODE_FUNC_FUNTION_PARA_VALUE); + STR_TO_VARSTR(strArray[0], "POLYGON((-71.1 42.3,-71.2 42.4,-71.3 42.5,-71.1 42.8))"); // the first point and last one are not same + callGeomFromTextWrapper4(strArray, valTypeNormArray, 1, TSDB_CODE_FUNC_FUNTION_PARA_VALUE); +} + +TEST(GeomIoFuncTest, asTextFunction) { + // column input has been tested in geomFromTextFunction + + TDRowValT valTypeArray[1] = {TD_VTYPE_NORM}; + + // empty input + char strInput[TSDB_MAX_BINARY_LEN]; + STR_TO_VARSTR(strInput, ""); + SScalarParam *pOutputAsText; + callAsTextWrapper1(TSDB_DATA_TYPE_GEOMETRY, strInput, valTypeArray, 1, &pOutputAsText); + ASSERT_EQ(colDataIsNull_s(pOutputAsText->columnData, 0), true); + destroyScalarParam(pOutputAsText, 1); + + // NULL type input + callAsTextWrapper1(TSDB_DATA_TYPE_NULL, 0, 0, 1, &pOutputAsText); + ASSERT_EQ(colDataIsNull_s(pOutputAsText->columnData, 0), true); + destroyScalarParam(pOutputAsText, 1); + + // wrong type input [ToDo] make sure it is handled in geomFunc + int32_t intInput = 3; + callAsTextWrapper2(TSDB_DATA_TYPE_INT, &intInput, valTypeArray, 1, TSDB_CODE_FUNC_FUNTION_PARA_VALUE); + + // wrong content input + STR_TO_VARSTR(strInput, "XXX"); + callAsTextWrapper2(TSDB_DATA_TYPE_GEOMETRY, strInput, valTypeArray, 1, TSDB_CODE_FUNC_FUNTION_PARA_VALUE); +} diff --git a/source/libs/geometry/test/geomRelationFuncTest.cpp b/source/libs/geometry/test/geomRelationFuncTest.cpp new file mode 100644 index 0000000000..1084c94178 --- /dev/null +++ b/source/libs/geometry/test/geomRelationFuncTest.cpp @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include "geomFuncTestUtil.h" + +void callGeomRelationFuncAndCompareResult(FScalarExecProcess geomRelationFunc, + SScalarParam *pInput, int32_t rowNum, + int32_t expectedCode, int8_t expectedResult[]) { + SScalarParam *pOutput; + makeOneScalarParam(&pOutput, TSDB_DATA_TYPE_BOOL, 0, 0, rowNum); + int32_t code = geomRelationFunc(pInput, 2, pOutput); + ASSERT_EQ(code, expectedCode); + + if (code == TSDB_CODE_SUCCESS) { + int8_t res = -1; + for (int32_t i = 0; i < rowNum; ++i) { + bool isNull1 = colDataIsNull_s(pOutput->columnData, i); + if (isNull1) { + res = -1; + } + else { + res = *(bool*)colDataGetData(pOutput->columnData, i); + } + + ASSERT_EQ(res, expectedResult[i]); + } + } + + destroyScalarParam(pOutput, 1); + destroyScalarParam(pInput, 2); +} + +/* +-- Use the following SQL to get expected results for all relation functions in PostgreSQL with PostGIS +WITH geom_str AS +(SELECT 'POINT(3.5 7.0)' AS g1, 'POINT(3.5 7.0)' AS g2 +UNION ALL +SELECT 'POINT(3.0 3.0)' AS g1, 'LINESTRING(1.0 1.0, 2.0 2.0, 5.0 6.0)' AS g2 +UNION ALL +SELECT 'POINT(3.0 6.0)' AS g1, 'POLYGON((3.0 6.0, 5.0 6.0, 5.0 8.0, 3.0 8.0, 3.0 6.0))' AS g2 +UNION ALL +SELECT 'LINESTRING(1.0 1.0, 2.0 2.0, 5.0 5.0)' AS g1, 'LINESTRING(1.0 4.0, 2.0 3.0, 5.0 0.0)' AS g2 +UNION ALL +SELECT 'LINESTRING(3.0 7.0, 4.0 7.0, 5.0 7.0)' AS g1, 'POLYGON((3.0 6.0, 5.0 6.0, 5.0 8.0, 3.0 8.0, 3.0 6.0))' AS g2 +UNION ALL +SELECT 'POLYGON((3.0 6.0, 5.0 6.0, 5.0 8.0, 3.0 8.0, 3.0 6.0))' AS g1, 'POLYGON((5.0 6.0, 7.0 6.0, 7.0 8.0, 5.0 8.0, 5.0 6.0))' AS g2 +) +SELECT ST_Intersects(g1, g2), ST_Equals(g1, g2), ST_Touches(g1, g2), ST_Covers(g1, g2), ST_Contains(g1, g2), ST_ContainsProperly(g1, g2) FROM geom_str +*/ +void geomRelationFuncTest(FScalarExecProcess geomRelationFunc, int8_t expectedResults[6][6]) { + const int32_t rowNum = 6; + + char strArray1[rowNum][TSDB_MAX_BINARY_LEN]; + STR_TO_VARSTR(strArray1[0], "POINT(3.5 7.0)"); + STR_TO_VARSTR(strArray1[1], "POINT(3.0 3.0)"); + STR_TO_VARSTR(strArray1[2], "POINT(3.0 6.0)"); + STR_TO_VARSTR(strArray1[3], "LINESTRING(1.0 1.0, 2.0 2.0, 5.0 5.0)"); + STR_TO_VARSTR(strArray1[4], "LINESTRING(3.0 7.0, 4.0 7.0, 5.0 7.0)"); + STR_TO_VARSTR(strArray1[5], "POLYGON((3.0 6.0, 5.0 6.0, 5.0 8.0, 3.0 8.0, 3.0 6.0))"); + TDRowValT valTypeArray1[rowNum] = {TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM}; + + char strArray2[rowNum][TSDB_MAX_BINARY_LEN]; + STR_TO_VARSTR(strArray2[0], "POINT(3.5 7.0)"); + STR_TO_VARSTR(strArray2[1], "LINESTRING(1.0 1.0, 2.0 2.0, 5.0 6.0)"); + STR_TO_VARSTR(strArray2[2], "POLYGON((3.0 6.0, 5.0 6.0, 5.0 8.0, 3.0 8.0, 3.0 6.0))"); + STR_TO_VARSTR(strArray2[3], "LINESTRING(1.0 4.0, 2.0 3.0, 5.0 0.0)"); + STR_TO_VARSTR(strArray2[4], "POLYGON((3.0 6.0, 5.0 6.0, 5.0 8.0, 3.0 8.0, 3.0 6.0))"); + STR_TO_VARSTR(strArray2[5], "POLYGON((5.0 6.0, 7.0 6.0, 7.0 8.0, 5.0 8.0, 5.0 6.0))"); + TDRowValT valTypeArray2[rowNum] = {TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM, TD_VTYPE_NORM}; + + // two columns input + SScalarParam *pInput = (SScalarParam *)taosMemoryCalloc(2, sizeof(SScalarParam)); + callGeomFromTextWrapper5(strArray1, valTypeArray1, rowNum, pInput); //pInput come from GeomFromText() + callGeomFromTextWrapper5(strArray2, valTypeArray2, rowNum, pInput + 1); + callGeomRelationFuncAndCompareResult(geomRelationFunc, pInput, rowNum, TSDB_CODE_SUCCESS, expectedResults[0]); + + // swap two columns + pInput = (SScalarParam *)taosMemoryCalloc(2, sizeof(SScalarParam)); + callGeomFromTextWrapper5(strArray2, valTypeArray2, rowNum, pInput); + callGeomFromTextWrapper5(strArray1, valTypeArray1, rowNum, pInput + 1); + callGeomRelationFuncAndCompareResult(geomRelationFunc, pInput, rowNum, TSDB_CODE_SUCCESS, expectedResults[1]); + + // constant and column input + pInput = (SScalarParam *)taosMemoryCalloc(2, sizeof(SScalarParam)); + callGeomFromTextWrapper5(strArray1, valTypeArray1, 1, pInput); + callGeomFromTextWrapper5(strArray2, valTypeArray2, rowNum, pInput + 1); + callGeomRelationFuncAndCompareResult(geomRelationFunc, pInput, rowNum, TSDB_CODE_SUCCESS, expectedResults[2]); + + // column and constant input + pInput = (SScalarParam *)taosMemoryCalloc(2, sizeof(SScalarParam)); + callGeomFromTextWrapper5(strArray1, valTypeArray1, rowNum, pInput); + callGeomFromTextWrapper5(strArray2, valTypeArray2, 1, pInput + 1); + callGeomRelationFuncAndCompareResult(geomRelationFunc, pInput, rowNum, TSDB_CODE_SUCCESS, expectedResults[3]); + + // two constants input + pInput = (SScalarParam *)taosMemoryCalloc(2, sizeof(SScalarParam)); + callGeomFromTextWrapper5(strArray1, valTypeArray1, 1, pInput); + callGeomFromTextWrapper5(strArray2, valTypeArray2, 1, pInput + 1); + callGeomRelationFuncAndCompareResult(geomRelationFunc, pInput, 1, TSDB_CODE_SUCCESS, expectedResults[4]); + + // two columns with NULL value input + pInput = (SScalarParam *)taosMemoryCalloc(2, sizeof(SScalarParam)); + valTypeArray1[2] = TD_VTYPE_NULL; + valTypeArray2[4] = TD_VTYPE_NULL; + callGeomFromTextWrapper5(strArray1, valTypeArray1, rowNum, pInput); + callGeomFromTextWrapper5(strArray2, valTypeArray2, rowNum, pInput + 1); + callGeomRelationFuncAndCompareResult(geomRelationFunc, pInput, rowNum, TSDB_CODE_SUCCESS, expectedResults[5]); + + // first NULL type input + pInput = (SScalarParam *)taosMemoryCalloc(2, sizeof(SScalarParam)); + setScalarParam(pInput, TSDB_DATA_TYPE_NULL, 0, 0, 1); + callGeomFromTextWrapper5(strArray2, valTypeArray2, rowNum, pInput + 1); + int8_t expectedResultNullType[rowNum] = {-1, -1, -1, -1, -1, -1}; + callGeomRelationFuncAndCompareResult(geomRelationFunc, pInput, rowNum, TSDB_CODE_SUCCESS, expectedResultNullType); + + // second NULL type input + pInput = (SScalarParam *)taosMemoryCalloc(2, sizeof(SScalarParam)); + callGeomFromTextWrapper5(strArray1, valTypeArray1, rowNum, pInput); + setScalarParam(pInput + 1, TSDB_DATA_TYPE_NULL, 0, 0, 1); + callGeomRelationFuncAndCompareResult(geomRelationFunc, pInput, rowNum, TSDB_CODE_SUCCESS, expectedResultNullType); + + // first empty content input + pInput = (SScalarParam *)taosMemoryCalloc(2, sizeof(SScalarParam)); + char strInput[TSDB_MAX_BINARY_LEN]; + STR_TO_VARSTR(strInput, ""); + setScalarParam(pInput, TSDB_DATA_TYPE_GEOMETRY, strInput, valTypeArray1, 1); + callGeomFromTextWrapper5(strArray2, valTypeArray2, rowNum, pInput + 1); + callGeomRelationFuncAndCompareResult(geomRelationFunc, pInput, rowNum, TSDB_CODE_SUCCESS, expectedResultNullType); + + // first wrong type input + pInput = (SScalarParam *)taosMemoryCalloc(2, sizeof(SScalarParam)); + int32_t intInput = 3; + setScalarParam(pInput, TSDB_DATA_TYPE_INT, &intInput, valTypeArray1, 1); + callGeomFromTextWrapper5(strArray2, valTypeArray2, rowNum, pInput + 1); + callGeomRelationFuncAndCompareResult(geomRelationFunc, pInput, rowNum, TSDB_CODE_FUNC_FUNTION_PARA_VALUE, 0); + + // second wrong content input + pInput = (SScalarParam *)taosMemoryCalloc(2, sizeof(SScalarParam)); + STR_TO_VARSTR(strInput, "XXX"); + callGeomFromTextWrapper5(strArray1, valTypeArray1, rowNum, pInput); + setScalarParam(pInput + 1, TSDB_DATA_TYPE_GEOMETRY, strInput, valTypeArray2, 1); + callGeomRelationFuncAndCompareResult(geomRelationFunc, pInput, rowNum, TSDB_CODE_FUNC_FUNTION_PARA_VALUE, 0); +} + +TEST(GeomRelationFuncTest, intersectsFunction) { + // 1: true, 0: false, -1: null + int8_t expectedResults[6][6] = { + {1, 0, 1, 1, 1, 1}, // two columns + {1, 0, 1, 1, 1, 1}, // two columns swpped + {1, 0, 1, 0, 1, 0}, // first constant + {1, 0, 0, 0, 1, 1}, // second constant + {1}, // two constant + {1, 0, -1, 1, -1, 1} // with Null value + }; + + geomRelationFuncTest(intersectsFunction, expectedResults); +} + +TEST(GeomRelationFuncTest, equalsFunction) { + // 1: true, 0: false, -1: null + int8_t expectedResults[6][6] = { + {1, 0, 0, 0, 0, 0}, // two columns + {1, 0, 0, 0, 0, 0}, // two columns swapped + {1, 0, 0, 0, 0, 0}, // first constant + {1, 0, 0, 0, 0, 0}, // second constant + {1}, // two constant + {1, 0, -1, 0, -1, 0} // with Null value + }; + + geomRelationFuncTest(equalsFunction, expectedResults); +} + +TEST(GeomRelationFuncTest, touchesFunction) { + // 1: true, 0: false, -1: null + int8_t expectedResults[6][6] = { + {0, 0, 1, 0, 0, 1}, // two columns + {0, 0, 1, 0, 0, 1}, // two columns swapped + {0, 0, 0, 0, 0, 0}, // first constant + {0, 0, 0, 0, 0, 0}, // second constant + {0}, // two constant + {0, 0, -1, 0, -1, 1} // with Null value + }; + + geomRelationFuncTest(touchesFunction, expectedResults); +} + +TEST(GeomRelationFuncTest, coversFunction) { + // 1: true, 0: false, -1: null + int8_t expectedResults[6][6] = { + {1, 0, 0, 0, 0, 0}, // two columns + {1, 0, 1, 0, 1, 0}, // two columns swapped + {1, 0, 0, 0, 0, 0}, // first constant + {1, 0, 0, 0, 1, 1}, // second constant + {1}, // two constant + {1, 0, -1, 0, -1, 0} // with Null value + }; + + geomRelationFuncTest(coversFunction, expectedResults); +} + +TEST(GeomRelationFuncTest, containsFunction) { + // 1: true, 0: false, -1: null + int8_t expectedResults[6][6] = { + {1, 0, 0, 0, 0, 0}, // two columns + {1, 0, 0, 0, 1, 0}, // two columns swapped + {1, 0, 0, 0, 0, 0}, // first constant + {1, 0, 0, 0, 1, 1}, // second constant + {1}, // two constant + {1, 0, -1, 0, -1, 0} // with Null value + }; + + geomRelationFuncTest(containsFunction, expectedResults); +} + +TEST(GeomRelationFuncTest, containsProperlyFunction) { + // 1: true, 0: false, -1: null + int8_t expectedResults[6][6] = { + {1, 0, 0, 0, 0, 0}, // two columns + {1, 0, 0, 0, 0, 0}, // two columns swapped + {1, 0, 0, 0, 0, 0}, // first constant + {1, 0, 0, 0, 1, 1}, // second constant + {1}, // two constant + {1, 0, -1, 0, -1, 0} // with Null value + }; + + geomRelationFuncTest(containsProperlyFunction, expectedResults); +} diff --git a/source/libs/index/src/indexCache.c b/source/libs/index/src/indexCache.c index 8b0e712553..a6fbc73332 100644 --- a/source/libs/index/src/indexCache.c +++ b/source/libs/index/src/indexCache.c @@ -738,7 +738,7 @@ static MemTable* idxInternalCacheCreate(int8_t type) { MemTable* tbl = taosMemoryCalloc(1, sizeof(MemTable)); idxMemRef(tbl); - // if (ttype == TSDB_DATA_TYPE_BINARY || ttype == TSDB_DATA_TYPE_NCHAR) { + // if (ttype == TSDB_DATA_TYPE_BINARY || ttype == TSDB_DATA_TYPE_NCHAR || ttype == TSDB_DATA_TYPE_GEOMETRY) { tbl->mem = tSkipListCreate(MAX_SKIP_LIST_LEVEL, ttype, MAX_INDEX_KEY_LEN, cmpFn, SL_ALLOW_DUP_KEY, idxCacheTermGet); //} return tbl; diff --git a/source/libs/index/src/indexComm.c b/source/libs/index/src/indexComm.c index c2ac7f4478..a0310a9f0e 100644 --- a/source/libs/index/src/indexComm.c +++ b/source/libs/index/src/indexComm.c @@ -76,7 +76,7 @@ char* idxInt2str(int64_t val, char* dst, int radix) { return dst - 1; } __compar_fn_t idxGetCompar(int8_t type) { - if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_NCHAR) { + if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_NCHAR || type == TSDB_DATA_TYPE_GEOMETRY) { return (__compar_fn_t)strcmp; } return getComparFunc(type, 0); @@ -107,7 +107,8 @@ static FORCE_INLINE TExeCond tCompareEqual(void* a, void* b, int8_t type) { return tCompare(func, QUERY_TERM, a, b, type); } TExeCond tCompare(__compar_fn_t func, int8_t cmptype, void* a, void* b, int8_t dtype) { - if (dtype == TSDB_DATA_TYPE_BINARY || dtype == TSDB_DATA_TYPE_NCHAR || dtype == TSDB_DATA_TYPE_VARBINARY) { + if (dtype == TSDB_DATA_TYPE_BINARY || dtype == TSDB_DATA_TYPE_NCHAR || + dtype == TSDB_DATA_TYPE_VARBINARY || dtype == TSDB_DATA_TYPE_GEOMETRY) { return tDoCompare(func, cmptype, a, b); } #if 1 @@ -354,7 +355,8 @@ int32_t idxConvertData(void* src, int8_t type, void** dst) { break; } - case TSDB_DATA_TYPE_VARCHAR: { // TSDB_DATA_TYPE_BINARY + case TSDB_DATA_TYPE_VARCHAR: // TSDB_DATA_TYPE_BINARY + case TSDB_DATA_TYPE_GEOMETRY: { tlen = taosEncodeBinary(NULL, src, strlen(src)); *dst = taosMemoryCalloc(1, tlen + 1); tlen = taosEncodeBinary(dst, src, strlen(src)); @@ -444,7 +446,8 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) { *dst = (char*)*dst - tlen; break; } - case TSDB_DATA_TYPE_VARCHAR: { // TSDB_DATA_TYPE_BINARY + case TSDB_DATA_TYPE_VARCHAR: // TSDB_DATA_TYPE_BINARY + case TSDB_DATA_TYPE_GEOMETRY: { tlen = taosEncodeBinary(NULL, varDataVal(src), varDataLen(src)); *dst = taosMemoryCalloc(1, tlen + 1); tlen = taosEncodeBinary(dst, varDataVal(src), varDataLen(src)); diff --git a/source/libs/index/src/indexJson.c b/source/libs/index/src/indexJson.c index 32b794cb71..1b4f847919 100644 --- a/source/libs/index/src/indexJson.c +++ b/source/libs/index/src/indexJson.c @@ -25,7 +25,7 @@ int indexJsonPut(SIndexJson *index, SIndexJsonMultiTerm *terms, uint64_t uid) { if (p->colType == TSDB_DATA_TYPE_BOOL) { p->colType = TSDB_DATA_TYPE_INT; } else if (p->colType == TSDB_DATA_TYPE_VARCHAR || p->colType == TSDB_DATA_TYPE_NCHAR || - p->colType == TSDB_DATA_TYPE_BINARY) { + p->colType == TSDB_DATA_TYPE_BINARY || p->colType == TSDB_DATA_TYPE_GEOMETRY) { // p->colType = TSDB_DATA_TYPE_NCHAR; } else { p->colType = TSDB_DATA_TYPE_DOUBLE; @@ -43,7 +43,7 @@ int indexJsonSearch(SIndexJson *index, SIndexJsonMultiTermQuery *tq, SArray *res if (p->colType == TSDB_DATA_TYPE_BOOL) { p->colType = TSDB_DATA_TYPE_INT; } else if (p->colType == TSDB_DATA_TYPE_VARCHAR || p->colType == TSDB_DATA_TYPE_NCHAR || - p->colType == TSDB_DATA_TYPE_BINARY) { + p->colType == TSDB_DATA_TYPE_BINARY || p->colType == TSDB_DATA_TYPE_GEOMETRY) { // p->colType = TSDB_DATA_TYPE_NCHAR; } else { p->colType = TSDB_DATA_TYPE_DOUBLE; diff --git a/source/libs/index/src/indexTfile.c b/source/libs/index/src/indexTfile.c index cdd1cc7386..9b6ba40318 100644 --- a/source/libs/index/src/indexTfile.c +++ b/source/libs/index/src/indexTfile.c @@ -545,7 +545,8 @@ int tfileWriterPut(TFileWriter* tw, void* data, bool order) { int8_t colType = tw->header.colType; colType = IDX_TYPE_GET_TYPE(colType); - if (colType == TSDB_DATA_TYPE_BINARY || colType == TSDB_DATA_TYPE_NCHAR) { + if (colType == TSDB_DATA_TYPE_BINARY || colType == TSDB_DATA_TYPE_NCHAR || + colType == TSDB_DATA_TYPE_GEOMETRY) { fn = tfileStrCompare; } else { fn = getComparFunc(colType, 0); diff --git a/source/libs/index/test/indexBench.cc b/source/libs/index/test/indexBench.cc index b828be0ffe..78c687029c 100644 --- a/source/libs/index/test/indexBench.cc +++ b/source/libs/index/test/indexBench.cc @@ -87,7 +87,7 @@ SIndexTerm *indexTermCreateT(int64_t suid, SIndexOperOnColumn oper, uint8_t colT int16_t sz = nColVal; memcpy(buf, (uint16_t *)&sz, 2); memcpy(buf + 2, colVal, nColVal); - if (colType == TSDB_DATA_TYPE_BINARY) { + if (colType == TSDB_DATA_TYPE_BINARY || colType == TSDB_DATA_TYPE_GEOMETRY) { return indexTermCreate(suid, oper, colType, colName, nColName, buf, sizeof(buf)); } else { return indexTermCreate(suid, oper, colType, colName, nColName, colVal, nColVal); diff --git a/source/libs/index/test/indexTests.cc b/source/libs/index/test/indexTests.cc index 08bf84ff60..612ce107c7 100644 --- a/source/libs/index/test/indexTests.cc +++ b/source/libs/index/test/indexTests.cc @@ -574,7 +574,7 @@ SIndexTerm* indexTermCreateT(int64_t suid, SIndexOperOnColumn oper, uint8_t colT int16_t sz = nColVal; memcpy(buf, (uint16_t*)&sz, 2); memcpy(buf + 2, colVal, nColVal); - if (colType == TSDB_DATA_TYPE_BINARY) { + if (colType == TSDB_DATA_TYPE_BINARY || colType == TSDB_DATA_TYPE_GEOMETRY) { return indexTermCreate(suid, oper, colType, colName, nColName, buf, sizeof(buf)); } else { return indexTermCreate(suid, oper, colType, colName, nColName, colVal, nColVal); diff --git a/source/libs/index/test/jsonUT.cc b/source/libs/index/test/jsonUT.cc index 8ae3fd4135..0e76980799 100644 --- a/source/libs/index/test/jsonUT.cc +++ b/source/libs/index/test/jsonUT.cc @@ -24,7 +24,7 @@ SIndexTerm* indexTermCreateT(int64_t suid, SIndexOperOnColumn oper, uint8_t colT int16_t sz = nColVal; memcpy(buf, (uint16_t*)&sz, 2); memcpy(buf + 2, colVal, nColVal); - if (colType == TSDB_DATA_TYPE_BINARY) { + if (colType == TSDB_DATA_TYPE_BINARY || colType == TSDB_DATA_TYPE_GEOMETRY) { return indexTermCreate(suid, oper, colType, colName, nColName, buf, sizeof(buf)); } else { return indexTermCreate(suid, oper, colType, colName, nColName, colVal, nColVal); diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 0f4e7bde63..2115044228 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -157,7 +157,8 @@ static int32_t valueNodeCopy(const SValueNode* pSrc, SValueNode* pDst) { break; case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_VARCHAR: - case TSDB_DATA_TYPE_VARBINARY: { + case TSDB_DATA_TYPE_VARBINARY: + case TSDB_DATA_TYPE_GEOMETRY: { int32_t len = pSrc->node.resType.bytes + 1; pDst->datum.p = taosMemoryCalloc(1, len); if (NULL == pDst->datum.p) { diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 459e389c9c..a6d808608d 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -3176,6 +3176,7 @@ static int32_t datumToJson(const void* pObj, SJson* pJson) { } case TSDB_DATA_TYPE_VARCHAR: case TSDB_DATA_TYPE_VARBINARY: + case TSDB_DATA_TYPE_GEOMETRY: code = tjsonAddStringToObject(pJson, jkValueDatum, varDataVal(pNode->datum.p)); break; case TSDB_DATA_TYPE_JSON: { @@ -3289,7 +3290,8 @@ static int32_t jsonToDatum(const SJson* pJson, void* pObj) { break; case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_VARCHAR: - case TSDB_DATA_TYPE_VARBINARY: { + case TSDB_DATA_TYPE_VARBINARY: + case TSDB_DATA_TYPE_GEOMETRY: { pNode->datum.p = taosMemoryCalloc(1, pNode->node.resType.bytes + 1); if (NULL == pNode->datum.p) { code = TSDB_CODE_OUT_OF_MEMORY; diff --git a/source/libs/nodes/src/nodesEqualFuncs.c b/source/libs/nodes/src/nodesEqualFuncs.c index 156744ef1d..eed70cfccf 100644 --- a/source/libs/nodes/src/nodesEqualFuncs.c +++ b/source/libs/nodes/src/nodesEqualFuncs.c @@ -109,6 +109,7 @@ static bool valueNodeEqual(const SValueNode* a, const SValueNode* b) { case TSDB_DATA_TYPE_VARCHAR: case TSDB_DATA_TYPE_VARBINARY: case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: COMPARE_VARDATA_FIELD(datum.p); break; case TSDB_DATA_TYPE_JSON: diff --git a/source/libs/nodes/src/nodesMsgFuncs.c b/source/libs/nodes/src/nodesMsgFuncs.c index c06eb62771..4ffd38ee36 100644 --- a/source/libs/nodes/src/nodesMsgFuncs.c +++ b/source/libs/nodes/src/nodesMsgFuncs.c @@ -825,6 +825,7 @@ static int32_t datumToMsg(const void* pObj, STlvEncoder* pEncoder) { case TSDB_DATA_TYPE_VARCHAR: case TSDB_DATA_TYPE_VARBINARY: case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: code = tlvEncodeBinary(pEncoder, VALUE_CODE_DATUM, pNode->datum.p, varDataTLen(pNode->datum.p)); break; case TSDB_DATA_TYPE_JSON: @@ -923,7 +924,8 @@ static int32_t msgToDatum(STlv* pTlv, void* pObj) { break; case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_VARCHAR: - case TSDB_DATA_TYPE_VARBINARY: { + case TSDB_DATA_TYPE_VARBINARY: + case TSDB_DATA_TYPE_GEOMETRY: { if (pTlv->len > pNode->node.resType.bytes + VARSTR_HEADER_SIZE) { code = TSDB_CODE_FAILED; break; diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index d29afd82a9..17a5677987 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -1575,6 +1575,7 @@ void* nodesGetValueFromNode(SValueNode* pNode) { case TSDB_DATA_TYPE_VARCHAR: case TSDB_DATA_TYPE_VARBINARY: case TSDB_DATA_TYPE_JSON: + case TSDB_DATA_TYPE_GEOMETRY: return (void*)pNode->datum.p; default: break; @@ -1637,6 +1638,7 @@ int32_t nodesSetValueNodeValue(SValueNode* pNode, void* value) { case TSDB_DATA_TYPE_VARCHAR: case TSDB_DATA_TYPE_VARBINARY: case TSDB_DATA_TYPE_JSON: + case TSDB_DATA_TYPE_GEOMETRY: pNode->datum.p = (char*)value; break; default: @@ -1694,7 +1696,8 @@ char* nodesGetStrValueFromNode(SValueNode* pNode) { } case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_VARCHAR: - case TSDB_DATA_TYPE_VARBINARY: { + case TSDB_DATA_TYPE_VARBINARY: + case TSDB_DATA_TYPE_GEOMETRY: { int32_t bufSize = varDataLen(pNode->datum.p) + 2 + 1; void* buf = taosMemoryMalloc(bufSize); if (NULL == buf) { @@ -2130,6 +2133,7 @@ void nodesValueNodeToVariant(const SValueNode* pNode, SVariant* pVal) { case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_VARCHAR: case TSDB_DATA_TYPE_VARBINARY: + case TSDB_DATA_TYPE_GEOMETRY: pVal->pz = taosMemoryMalloc(pVal->nLen + 1); memcpy(pVal->pz, pNode->datum.p, pVal->nLen); pVal->pz[pVal->nLen] = 0; diff --git a/source/libs/parser/CMakeLists.txt b/source/libs/parser/CMakeLists.txt index 860250df85..41553918e1 100644 --- a/source/libs/parser/CMakeLists.txt +++ b/source/libs/parser/CMakeLists.txt @@ -8,7 +8,7 @@ target_include_directories( target_link_libraries( parser - PRIVATE os util nodes catalog function scalar transport qcom + PRIVATE os util nodes catalog function scalar geometry transport qcom ) if(${BUILD_TEST}) diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 62a5a54a4a..9b8393f624 100755 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -382,6 +382,7 @@ type_name(A) ::= VARCHAR NK_LP NK_INTEGER(B) NK_RP. type_name(A) ::= MEDIUMBLOB. { A = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } type_name(A) ::= BLOB. { A = createDataType(TSDB_DATA_TYPE_BLOB); } type_name(A) ::= VARBINARY NK_LP NK_INTEGER(B) NK_RP. { A = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &B); } +type_name(A) ::= GEOMETRY NK_LP NK_INTEGER(B) NK_RP. { A = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &B); } type_name(A) ::= DECIMAL. { A = createDataType(TSDB_DATA_TYPE_DECIMAL); } type_name(A) ::= DECIMAL NK_LP NK_INTEGER NK_RP. { A = createDataType(TSDB_DATA_TYPE_DECIMAL); } type_name(A) ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP. { A = createDataType(TSDB_DATA_TYPE_DECIMAL); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index d0c8355b01..4223455b65 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -498,7 +498,7 @@ SNode* createCastFunctionNode(SAstCreateContext* pCxt, SNode* pExpr, SDataType d CHECK_OUT_OF_MEM(func); strcpy(func->functionName, "cast"); func->node.resType = dt; - if (TSDB_DATA_TYPE_VARCHAR == dt.type) { + if (TSDB_DATA_TYPE_VARCHAR == dt.type || TSDB_DATA_TYPE_GEOMETRY == dt.type) { func->node.resType.bytes = func->node.resType.bytes + VARSTR_HEADER_SIZE; } else if (TSDB_DATA_TYPE_NCHAR == dt.type) { func->node.resType.bytes = func->node.resType.bytes * TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE; diff --git a/source/libs/parser/src/parInsertSml.c b/source/libs/parser/src/parInsertSml.c index dbf5931e8a..0e5ffc57da 100644 --- a/source/libs/parser/src/parInsertSml.c +++ b/source/libs/parser/src/parInsertSml.c @@ -134,7 +134,8 @@ static int32_t smlBuildTagRow(SArray* cols, SBoundColInfo* tags, SSchema* pSchem taosArrayPush(*tagName, pTagSchema->name); STagVal val = {.cid = pTagSchema->colId, .type = pTagSchema->type}; // strcpy(val.colName, pTagSchema->name); - if (pTagSchema->type == TSDB_DATA_TYPE_BINARY) { + if (pTagSchema->type == TSDB_DATA_TYPE_BINARY || + pTagSchema->type == TSDB_DATA_TYPE_GEOMETRY) { val.pData = (uint8_t*)kv->value; val.nData = kv->length; } else if (pTagSchema->type == TSDB_DATA_TYPE_NCHAR) { @@ -236,7 +237,7 @@ int32_t smlBuildCol(STableDataCxt* pTableCxt, SSchema* schema, void* data, int32 } pVal->value.pData = pUcs4; pVal->value.nData = len; - } else if (kv->type == TSDB_DATA_TYPE_BINARY) { + } else if (kv->type == TSDB_DATA_TYPE_BINARY || kv->type == TSDB_DATA_TYPE_GEOMETRY) { pVal->value.nData = kv->length; pVal->value.pData = (uint8_t*)kv->value; } else { @@ -363,7 +364,7 @@ int32_t smlBindData(SQuery* query, bool dataFormat, SArray* tags, SArray* colsSc } pVal->value.pData = pUcs4; pVal->value.nData = len; - } else if (kv->type == TSDB_DATA_TYPE_BINARY) { + } else if (kv->type == TSDB_DATA_TYPE_BINARY || kv->type == TSDB_DATA_TYPE_GEOMETRY) { pVal->value.nData = kv->length; pVal->value.pData = (uint8_t*)kv->value; } else { diff --git a/source/libs/parser/src/parInsertSql.c b/source/libs/parser/src/parInsertSql.c index 02de9f227d..43a73af3c3 100644 --- a/source/libs/parser/src/parInsertSql.c +++ b/source/libs/parser/src/parInsertSql.c @@ -18,6 +18,7 @@ #include "scalar.h" #include "tglobal.h" #include "ttime.h" +#include "geosWrapper.h" #define NEXT_TOKEN_WITH_PREV(pSql, token) \ do { \ @@ -305,6 +306,26 @@ static int parseTime(const char** end, SToken* pToken, int16_t timePrec, int64_t return TSDB_CODE_SUCCESS; } +// need to call geosFreeBuffer(*output) later +static int parseGeometry(SToken *pToken, unsigned char **output, size_t *size) { + int32_t code = TSDB_CODE_FAILED; + + //[ToDo] support to parse WKB as well as WKT + if (pToken->type == TK_NK_STRING) { + code = initCtxGeomFromText(); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + code = doGeomFromText(pToken->z, output, size); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + } + + return code; +} + static int32_t parseTagToken(const char** end, SToken* pToken, SSchema* pSchema, int16_t timePrec, STagVal* val, SMsgBuf* pMsgBuf) { int64_t iv; @@ -446,7 +467,8 @@ static int32_t parseTagToken(const char** end, SToken* pToken, SSchema* pSchema, break; } - case TSDB_DATA_TYPE_BINARY: { + case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: { // Too long values will raise the invalid sql error message if (pToken->n + VARSTR_HEADER_SIZE > pSchema->bytes) { return generateSyntaxErrMsg(pMsgBuf, TSDB_CODE_PAR_VALUE_TOO_LONG, pSchema->name); @@ -1350,6 +1372,37 @@ static int32_t parseValueTokenImpl(SInsertParseContext* pCxt, const char** pSql, pVal->value.nData = pToken->n; break; } + case TSDB_DATA_TYPE_GEOMETRY: { + int32_t code = TSDB_CODE_FAILED; + unsigned char *output = NULL; + size_t size = 0; + + code = parseGeometry(pToken, &output, &size); + if (code != TSDB_CODE_SUCCESS) { + code = buildSyntaxErrMsg(&pCxt->msg, getThreadLocalGeosCtx()->errMsg, pToken->z); + } + // Too long values will raise the invalid sql error message + else if (size > pSchema->bytes) { + code = generateSyntaxErrMsg(&pCxt->msg, TSDB_CODE_PAR_VALUE_TOO_LONG, pSchema->name); + } + else { + pVal->value.pData = taosMemoryMalloc(size); + if (NULL == pVal->value.pData) { + code = TSDB_CODE_OUT_OF_MEMORY; + } + else { + memcpy(pVal->value.pData, output, size); + pVal->value.nData = size; + } + } + + geosFreeBuffer(output); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + break; + } case TSDB_DATA_TYPE_TIMESTAMP: { if (parseTime(pSql, pToken, timePrec, &pVal->value.val, &pCxt->msg) != TSDB_CODE_SUCCESS) { return buildSyntaxErrMsg(&pCxt->msg, "invalid timestamp", pToken->z); diff --git a/source/libs/parser/src/parInsertStmt.c b/source/libs/parser/src/parInsertStmt.c index 922a0f45ff..f654d2527f 100644 --- a/source/libs/parser/src/parInsertStmt.c +++ b/source/libs/parser/src/parInsertStmt.c @@ -128,7 +128,8 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch } else { STagVal val = {.cid = pTagSchema->colId, .type = pTagSchema->type}; // strcpy(val.colName, pTagSchema->name); - if (pTagSchema->type == TSDB_DATA_TYPE_BINARY) { + if (pTagSchema->type == TSDB_DATA_TYPE_BINARY || + pTagSchema->type == TSDB_DATA_TYPE_GEOMETRY) { val.pData = (uint8_t*)bind[c].buffer; val.nData = colLen; } else if (pTagSchema->type == TSDB_DATA_TYPE_NCHAR) { diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index e1a1244b98..3af2d440c9 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -103,6 +103,7 @@ static SKeyword keywordTable[] = { {"FORCE", TK_FORCE}, {"FUNCTION", TK_FUNCTION}, {"FUNCTIONS", TK_FUNCTIONS}, + {"GEOMETRY", TK_GEOMETRY}, {"GRANT", TK_GRANT}, {"GRANTS", TK_GRANTS}, {"GROUP", TK_GROUP}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index a8edee4a33..864513f15d 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -1168,7 +1168,8 @@ static EDealRes translateNormalValue(STranslateContext* pCxt, SValueNode* pVal, break; } case TSDB_DATA_TYPE_VARCHAR: - case TSDB_DATA_TYPE_VARBINARY: { + case TSDB_DATA_TYPE_VARBINARY: + case TSDB_DATA_TYPE_GEOMETRY: { if (strict && (pVal->node.resType.bytes > targetDt.bytes - VARSTR_HEADER_SIZE)) { return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_WRONG_VALUE_TYPE, pVal->literal); } @@ -1241,7 +1242,7 @@ static EDealRes translateValueImpl(STranslateContext* pCxt, SValueNode* pVal, SD } static int32_t calcTypeBytes(SDataType dt) { - if (TSDB_DATA_TYPE_BINARY == dt.type) { + if (TSDB_DATA_TYPE_BINARY == dt.type || TSDB_DATA_TYPE_GEOMETRY == dt.type) { return dt.bytes + VARSTR_HEADER_SIZE; } else if (TSDB_DATA_TYPE_NCHAR == dt.type) { return dt.bytes * TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE; @@ -2920,6 +2921,7 @@ static int32_t getPositionValue(const SValueNode* pVal) { case TSDB_DATA_TYPE_VARCHAR: case TSDB_DATA_TYPE_VARBINARY: case TSDB_DATA_TYPE_JSON: + case TSDB_DATA_TYPE_GEOMETRY: return -1; case TSDB_DATA_TYPE_BOOL: return (pVal->datum.b ? 1 : 0); @@ -4615,7 +4617,8 @@ static int32_t checkTableTagsSchema(STranslateContext* pCxt, SHashObj* pHash, SN } if (TSDB_CODE_SUCCESS == code) { if ((TSDB_DATA_TYPE_VARCHAR == pTag->dataType.type && calcTypeBytes(pTag->dataType) > TSDB_MAX_TAGS_LEN) || - (TSDB_DATA_TYPE_NCHAR == pTag->dataType.type && calcTypeBytes(pTag->dataType) > TSDB_MAX_TAGS_LEN)) { + (TSDB_DATA_TYPE_NCHAR == pTag->dataType.type && calcTypeBytes(pTag->dataType) > TSDB_MAX_TAGS_LEN) || + (TSDB_DATA_TYPE_GEOMETRY == pTag->dataType.type && calcTypeBytes(pTag->dataType) > TSDB_MAX_TAGS_LEN)) { code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN); } } @@ -4666,7 +4669,8 @@ static int32_t checkTableColsSchema(STranslateContext* pCxt, SHashObj* pHash, in } if (TSDB_CODE_SUCCESS == code) { if ((TSDB_DATA_TYPE_VARCHAR == pCol->dataType.type && calcTypeBytes(pCol->dataType) > TSDB_MAX_BINARY_LEN) || - (TSDB_DATA_TYPE_NCHAR == pCol->dataType.type && calcTypeBytes(pCol->dataType) > TSDB_MAX_NCHAR_LEN)) { + (TSDB_DATA_TYPE_NCHAR == pCol->dataType.type && calcTypeBytes(pCol->dataType) > TSDB_MAX_NCHAR_LEN) || + (TSDB_DATA_TYPE_GEOMETRY == pCol->dataType.type && calcTypeBytes(pCol->dataType) > TSDB_MAX_GEOMETRY_LEN)) { code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN); } } diff --git a/source/libs/parser/src/parser.c b/source/libs/parser/src/parser.c index 47482db740..28d116c381 100644 --- a/source/libs/parser/src/parser.c +++ b/source/libs/parser/src/parser.c @@ -99,6 +99,7 @@ static int32_t setValueByBindParam(SValueNode* pVal, TAOS_MULTI_BIND* pParam) { switch (pParam->buffer_type) { case TSDB_DATA_TYPE_VARCHAR: case TSDB_DATA_TYPE_VARBINARY: + case TSDB_DATA_TYPE_GEOMETRY: pVal->datum.p = taosMemoryCalloc(1, pVal->node.resType.bytes + VARSTR_HEADER_SIZE + 1); if (NULL == pVal->datum.p) { return TSDB_CODE_OUT_OF_MEMORY; diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 0aebd8f47f..43ef166c41 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,27 +104,27 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 484 +#define YYNOCODE 485 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - int64_t yy85; - ENullOrder yy257; - EFillMode yy470; - STokenPair yy489; - SNode* yy520; - EOperatorType yy524; - bool yy537; - int8_t yy575; - EJoinType yy596; - SAlterOption yy805; - SToken yy833; - SDataType yy840; - int32_t yy860; - SNodeList* yy904; - EOrder yy906; + EOrder yy48; + EOperatorType yy70; + int8_t yy73; + int32_t yy120; + SNodeList* yy174; + EFillMode yy204; + SNode* yy242; + STokenPair yy257; + int64_t yy349; + EJoinType yy482; + SAlterOption yy535; + SToken yy669; + ENullOrder yy687; + bool yy777; + SDataType yy794; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -140,18 +140,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 789 -#define YYNRULE 594 -#define YYNRULE_WITH_ACTION 594 -#define YYNTOKEN 336 -#define YY_MAX_SHIFT 788 -#define YY_MIN_SHIFTREDUCE 1165 -#define YY_MAX_SHIFTREDUCE 1758 -#define YY_ERROR_ACTION 1759 -#define YY_ACCEPT_ACTION 1760 -#define YY_NO_ACTION 1761 -#define YY_MIN_REDUCE 1762 -#define YY_MAX_REDUCE 2355 +#define YYNSTATE 792 +#define YYNRULE 595 +#define YYNRULE_WITH_ACTION 595 +#define YYNTOKEN 337 +#define YY_MAX_SHIFT 791 +#define YY_MIN_SHIFTREDUCE 1169 +#define YY_MAX_SHIFTREDUCE 1763 +#define YY_ERROR_ACTION 1764 +#define YY_ACCEPT_ACTION 1765 +#define YY_NO_ACTION 1766 +#define YY_MIN_REDUCE 1767 +#define YY_MAX_REDUCE 2361 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -218,840 +218,792 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2969) +#define YY_ACTTAB_COUNT (2716) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 2167, 445, 2145, 2057, 404, 444, 144, 1984, 1986, 2226, - /* 10 */ 696, 451, 48, 46, 1686, 1763, 2153, 218, 2055, 669, - /* 20 */ 399, 529, 1535, 1805, 41, 40, 2149, 639, 47, 45, - /* 30 */ 44, 43, 42, 1616, 1838, 1533, 123, 1560, 2185, 122, - /* 40 */ 121, 120, 119, 118, 117, 116, 115, 114, 620, 681, - /* 50 */ 2135, 2326, 698, 41, 40, 2185, 345, 47, 45, 44, - /* 60 */ 43, 42, 1611, 2151, 396, 649, 2332, 188, 19, 1560, - /* 70 */ 2057, 2327, 646, 692, 681, 1541, 47, 45, 44, 43, - /* 80 */ 42, 170, 392, 1774, 2166, 2054, 669, 2202, 1561, 30, - /* 90 */ 339, 2168, 702, 2170, 2171, 697, 695, 692, 683, 2220, - /* 100 */ 785, 66, 2118, 15, 762, 761, 760, 759, 411, 638, - /* 110 */ 758, 757, 146, 752, 751, 750, 749, 748, 747, 746, - /* 120 */ 159, 742, 741, 740, 410, 409, 737, 736, 735, 177, - /* 130 */ 176, 2100, 51, 526, 2270, 1356, 527, 1798, 123, 1618, - /* 140 */ 1619, 122, 121, 120, 119, 118, 117, 116, 115, 114, - /* 150 */ 1347, 724, 723, 722, 1351, 721, 1353, 1354, 720, 717, - /* 160 */ 2267, 1362, 714, 1364, 1365, 711, 708, 38, 303, 1591, - /* 170 */ 1601, 2331, 181, 1991, 2326, 1617, 1620, 285, 251, 62, - /* 180 */ 364, 1760, 667, 657, 142, 1762, 1445, 1446, 1989, 1536, - /* 190 */ 2330, 1534, 366, 2040, 2327, 2329, 543, 1755, 41, 40, - /* 200 */ 62, 1562, 47, 45, 44, 43, 42, 1390, 1391, 132, - /* 210 */ 131, 130, 129, 128, 127, 126, 125, 124, 62, 640, - /* 220 */ 93, 1539, 1540, 181, 1590, 1593, 1594, 1595, 1596, 1597, - /* 230 */ 1598, 1599, 1600, 694, 690, 1609, 1610, 1612, 1613, 1614, - /* 240 */ 1615, 2, 48, 46, 2041, 2167, 1223, 349, 1222, 1558, - /* 250 */ 399, 645, 1535, 414, 2326, 660, 482, 413, 358, 496, - /* 260 */ 393, 138, 495, 1616, 443, 1533, 442, 62, 167, 644, - /* 270 */ 188, 408, 407, 402, 2327, 646, 1941, 1561, 465, 1224, - /* 280 */ 497, 167, 681, 2185, 1560, 467, 282, 2263, 656, 1941, - /* 290 */ 134, 655, 1611, 2326, 1542, 2135, 441, 698, 19, 1754, - /* 300 */ 620, 650, 1645, 2326, 523, 1541, 9, 534, 644, 188, - /* 310 */ 527, 1798, 521, 2327, 646, 517, 513, 428, 2332, 188, - /* 320 */ 1985, 1986, 2331, 2327, 646, 2326, 44, 43, 42, 2166, - /* 330 */ 785, 367, 2202, 15, 191, 110, 2168, 702, 2170, 2171, - /* 340 */ 697, 2330, 692, 455, 1991, 2327, 2328, 185, 12, 2255, - /* 350 */ 10, 379, 284, 395, 2251, 191, 41, 40, 1646, 1989, - /* 360 */ 47, 45, 44, 43, 42, 51, 190, 62, 1563, 1618, - /* 370 */ 1619, 1198, 493, 191, 2281, 487, 486, 485, 484, 481, - /* 380 */ 480, 479, 478, 477, 473, 472, 471, 470, 348, 462, - /* 390 */ 461, 460, 531, 457, 456, 365, 1462, 1463, 528, 1591, - /* 400 */ 1601, 657, 142, 682, 1939, 1617, 1620, 584, 583, 582, - /* 410 */ 1200, 452, 1203, 1204, 574, 139, 578, 371, 489, 1536, - /* 420 */ 577, 1534, 191, 133, 453, 576, 581, 374, 373, 734, - /* 430 */ 566, 575, 1461, 1464, 598, 37, 397, 1640, 1641, 1642, - /* 440 */ 1643, 1644, 1648, 1649, 1650, 1651, 2021, 596, 52, 594, - /* 450 */ 1545, 1539, 1540, 1559, 1590, 1593, 1594, 1595, 1596, 1597, - /* 460 */ 1598, 1599, 1600, 694, 690, 1609, 1610, 1612, 1613, 1614, - /* 470 */ 1615, 2, 12, 48, 46, 682, 1939, 1991, 209, 208, - /* 480 */ 635, 399, 726, 1535, 389, 1982, 372, 668, 370, 369, - /* 490 */ 2167, 568, 1989, 1785, 1616, 133, 1533, 1714, 682, 1939, - /* 500 */ 699, 488, 571, 659, 186, 2263, 2264, 220, 140, 2268, - /* 510 */ 2331, 529, 570, 1805, 645, 2167, 569, 2326, 193, 262, - /* 520 */ 191, 1915, 191, 1611, 1679, 699, 663, 1562, 2185, 19, - /* 530 */ 1226, 1227, 644, 188, 682, 1939, 1541, 2327, 646, 541, - /* 540 */ 2135, 2050, 698, 2135, 632, 631, 1712, 1713, 1715, 1716, - /* 550 */ 1717, 41, 40, 2185, 57, 47, 45, 44, 43, 42, - /* 560 */ 87, 785, 249, 184, 15, 2135, 248, 698, 1841, 641, - /* 570 */ 636, 629, 87, 620, 2166, 1978, 2326, 2202, 1784, 607, - /* 580 */ 171, 2168, 702, 2170, 2171, 697, 1935, 692, 734, 368, - /* 590 */ 668, 2332, 188, 12, 682, 1939, 2327, 646, 1934, 2166, - /* 600 */ 1618, 1619, 2202, 191, 469, 110, 2168, 702, 2170, 2171, - /* 610 */ 697, 1748, 692, 468, 449, 145, 107, 152, 2226, 2255, - /* 620 */ 621, 2292, 1783, 395, 2251, 2167, 90, 668, 2135, 353, - /* 630 */ 1591, 1601, 378, 143, 600, 660, 1617, 1620, 584, 583, - /* 640 */ 582, 1931, 666, 433, 2050, 574, 139, 578, 562, 561, - /* 650 */ 1536, 577, 1534, 682, 1939, 1541, 576, 581, 374, 373, - /* 660 */ 41, 40, 575, 2185, 47, 45, 44, 43, 42, 1991, - /* 670 */ 435, 431, 2135, 450, 2156, 2135, 394, 698, 284, 677, - /* 680 */ 1647, 2050, 1539, 1540, 1989, 1590, 1593, 1594, 1595, 1596, - /* 690 */ 1597, 1598, 1599, 1600, 694, 690, 1609, 1610, 1612, 1613, - /* 700 */ 1614, 1615, 2, 48, 46, 1621, 684, 744, 2227, 2166, - /* 710 */ 250, 399, 2202, 1535, 166, 110, 2168, 702, 2170, 2171, - /* 720 */ 697, 1991, 692, 402, 1616, 2167, 1533, 185, 403, 2255, - /* 730 */ 2158, 164, 1311, 395, 2251, 699, 1989, 1807, 380, 1941, - /* 740 */ 589, 1916, 1563, 41, 40, 1310, 1989, 47, 45, 44, - /* 750 */ 43, 42, 405, 1611, 2282, 599, 1725, 35, 682, 1939, - /* 760 */ 167, 2167, 169, 2185, 682, 1939, 1541, 1652, 1941, 247, - /* 770 */ 1880, 699, 725, 2289, 1300, 2135, 34, 698, 459, 1506, - /* 780 */ 1507, 1928, 41, 40, 474, 592, 47, 45, 44, 43, - /* 790 */ 42, 785, 586, 686, 49, 2227, 1782, 2167, 246, 2185, - /* 800 */ 732, 157, 156, 729, 728, 727, 154, 699, 1315, 2166, - /* 810 */ 498, 2135, 2202, 698, 1302, 110, 2168, 702, 2170, 2171, - /* 820 */ 697, 1314, 692, 682, 1939, 564, 563, 2346, 1914, 2255, - /* 830 */ 1618, 1619, 167, 395, 2251, 2185, 580, 579, 70, 1702, - /* 840 */ 1942, 69, 572, 475, 1991, 2166, 2135, 2135, 2202, 698, - /* 850 */ 1781, 110, 2168, 702, 2170, 2171, 697, 2270, 692, 1990, - /* 860 */ 1591, 1601, 1690, 2346, 1298, 2255, 1617, 1620, 1560, 395, - /* 870 */ 2251, 14, 13, 732, 157, 156, 729, 728, 727, 154, - /* 880 */ 1536, 2166, 1534, 2266, 2202, 1780, 500, 110, 2168, 702, - /* 890 */ 2170, 2171, 697, 202, 692, 657, 142, 36, 1779, 2230, - /* 900 */ 2135, 2255, 1778, 41, 40, 395, 2251, 47, 45, 44, - /* 910 */ 43, 42, 1539, 1540, 1924, 1590, 1593, 1594, 1595, 1596, - /* 920 */ 1597, 1598, 1599, 1600, 694, 690, 1609, 1610, 1612, 1613, - /* 930 */ 1614, 1615, 2, 48, 46, 2135, 1223, 155, 1222, 2167, - /* 940 */ 1535, 399, 2036, 1535, 1777, 2128, 657, 142, 2135, 699, - /* 950 */ 2330, 2302, 2135, 1533, 1616, 1776, 1533, 1773, 682, 1939, - /* 960 */ 732, 157, 156, 729, 728, 727, 154, 294, 295, 1224, - /* 970 */ 682, 1939, 293, 730, 1659, 2167, 1982, 2185, 542, 205, - /* 980 */ 1683, 682, 1939, 1611, 101, 699, 2270, 627, 201, 2135, - /* 990 */ 1936, 698, 620, 1541, 2135, 2326, 1541, 56, 187, 2263, - /* 1000 */ 2264, 252, 140, 2268, 1926, 2135, 1772, 2135, 1771, 1932, - /* 1010 */ 2332, 188, 2265, 2185, 1206, 2327, 646, 1592, 785, 84, - /* 1020 */ 1559, 785, 83, 2166, 49, 2135, 2202, 698, 2129, 110, - /* 1030 */ 2168, 702, 2170, 2171, 697, 2167, 692, 682, 1939, 756, - /* 1040 */ 754, 2346, 1770, 2255, 54, 699, 3, 395, 2251, 189, - /* 1050 */ 2263, 2264, 1563, 140, 2268, 1769, 2135, 616, 2135, 2166, - /* 1060 */ 1618, 1619, 2202, 1203, 1204, 110, 2168, 702, 2170, 2171, - /* 1070 */ 697, 731, 692, 2185, 1982, 620, 1626, 2346, 2326, 2255, - /* 1080 */ 682, 1939, 1560, 395, 2251, 2135, 1768, 698, 682, 1939, - /* 1090 */ 1591, 1601, 2135, 2332, 188, 2121, 1617, 1620, 2327, 646, - /* 1100 */ 661, 682, 1939, 682, 1939, 2135, 1560, 1536, 665, 1534, - /* 1110 */ 1536, 652, 1534, 682, 1939, 1767, 1766, 2145, 259, 2166, - /* 1120 */ 1765, 406, 2202, 298, 1922, 172, 2168, 702, 2170, 2171, - /* 1130 */ 697, 1930, 692, 679, 2036, 605, 2135, 2036, 1943, 1539, - /* 1140 */ 1540, 2149, 1539, 1540, 421, 1590, 1593, 1594, 1595, 1596, - /* 1150 */ 1597, 1598, 1599, 1600, 694, 690, 1609, 1610, 1612, 1613, - /* 1160 */ 1614, 1615, 2, 48, 46, 2135, 2135, 682, 1939, 2167, - /* 1170 */ 2135, 399, 148, 1535, 135, 2145, 647, 2347, 2151, 699, - /* 1180 */ 203, 2320, 620, 207, 1616, 2326, 1533, 680, 692, 2154, - /* 1190 */ 41, 40, 2167, 1917, 47, 45, 44, 43, 42, 2149, - /* 1200 */ 2332, 188, 699, 261, 2274, 2327, 646, 2185, 317, 682, - /* 1210 */ 1939, 1968, 570, 1611, 745, 155, 569, 1901, 74, 2135, - /* 1220 */ 155, 698, 2275, 1679, 239, 648, 1541, 237, 573, 304, - /* 1230 */ 2185, 1592, 602, 50, 601, 1682, 2151, 150, 241, 50, - /* 1240 */ 243, 240, 2135, 242, 698, 245, 692, 1825, 244, 689, - /* 1250 */ 1296, 785, 1816, 2166, 15, 1592, 2202, 266, 155, 110, - /* 1260 */ 2168, 702, 2170, 2171, 697, 260, 692, 82, 256, 585, - /* 1270 */ 1814, 2346, 1544, 2255, 587, 1501, 2166, 395, 2251, 2202, - /* 1280 */ 1504, 619, 110, 2168, 702, 2170, 2171, 697, 50, 692, - /* 1290 */ 1618, 1619, 590, 1711, 2346, 1881, 2255, 1757, 1758, 1710, - /* 1300 */ 395, 2251, 291, 71, 153, 155, 14, 13, 91, 168, - /* 1310 */ 64, 50, 106, 1543, 323, 693, 633, 268, 664, 1257, - /* 1320 */ 1591, 1601, 103, 738, 1808, 739, 1617, 1620, 321, 73, - /* 1330 */ 1775, 2295, 72, 50, 279, 137, 273, 706, 153, 155, - /* 1340 */ 1536, 136, 1534, 346, 1879, 1276, 153, 1274, 1459, 653, - /* 1350 */ 1878, 2186, 2045, 412, 216, 508, 506, 503, 1799, 1258, - /* 1360 */ 1979, 1804, 296, 674, 300, 1341, 2285, 658, 278, 281, - /* 1370 */ 1653, 1602, 1539, 1540, 780, 1590, 1593, 1594, 1595, 1596, - /* 1380 */ 1597, 1598, 1599, 1600, 694, 690, 1609, 1610, 1612, 1613, - /* 1390 */ 1614, 1615, 2, 316, 62, 408, 407, 1368, 1372, 1379, - /* 1400 */ 1, 1377, 1637, 5, 55, 1549, 158, 415, 420, 1566, - /* 1410 */ 362, 437, 436, 195, 196, 439, 1616, 234, 1542, 1482, - /* 1420 */ 198, 206, 454, 311, 1563, 458, 1558, 2046, 1547, 463, - /* 1430 */ 2167, 491, 109, 174, 483, 476, 2038, 490, 492, 501, - /* 1440 */ 699, 560, 556, 552, 548, 1611, 233, 499, 211, 504, - /* 1450 */ 502, 213, 210, 505, 507, 509, 1564, 524, 1541, 4, - /* 1460 */ 525, 532, 535, 533, 1561, 221, 536, 223, 2185, 1546, - /* 1470 */ 1565, 537, 81, 80, 448, 1567, 226, 200, 538, 540, - /* 1480 */ 2135, 228, 698, 688, 85, 86, 88, 544, 565, 231, - /* 1490 */ 440, 438, 2167, 232, 112, 604, 352, 606, 2109, 567, - /* 1500 */ 1929, 347, 699, 236, 429, 89, 610, 427, 423, 419, - /* 1510 */ 416, 441, 1925, 611, 2166, 151, 312, 2202, 238, 160, - /* 1520 */ 110, 2168, 702, 2170, 2171, 697, 161, 692, 253, 1927, - /* 1530 */ 2185, 1923, 2228, 162, 2255, 609, 163, 2106, 395, 2251, - /* 1540 */ 255, 614, 2135, 257, 698, 1489, 2105, 617, 615, 191, - /* 1550 */ 634, 624, 672, 630, 2301, 8, 230, 224, 384, 2167, - /* 1560 */ 2286, 229, 2296, 539, 264, 2300, 637, 643, 272, 699, - /* 1570 */ 267, 654, 1550, 625, 1545, 274, 2166, 175, 2277, 2202, - /* 1580 */ 623, 222, 110, 2168, 702, 2170, 2171, 697, 622, 692, - /* 1590 */ 277, 385, 651, 276, 685, 141, 2255, 2185, 1562, 275, - /* 1600 */ 395, 2251, 1679, 2271, 1553, 1555, 388, 1568, 286, 2135, - /* 1610 */ 662, 698, 96, 2051, 313, 670, 280, 690, 1609, 1610, - /* 1620 */ 1612, 1613, 1614, 1615, 2167, 671, 314, 2349, 2065, 2064, - /* 1630 */ 2063, 391, 675, 61, 699, 676, 98, 315, 2236, 102, - /* 1640 */ 1983, 781, 1902, 2166, 2325, 342, 2202, 100, 1940, 111, - /* 1650 */ 2168, 702, 2170, 2171, 697, 704, 692, 318, 307, 782, - /* 1660 */ 2167, 784, 2185, 2255, 320, 53, 322, 2254, 2251, 327, - /* 1670 */ 699, 341, 331, 354, 2135, 2127, 698, 355, 2126, 2125, - /* 1680 */ 78, 2122, 417, 418, 1526, 1527, 194, 422, 2120, 424, - /* 1690 */ 425, 426, 2119, 363, 2117, 430, 2167, 434, 2185, 2116, - /* 1700 */ 2115, 1517, 432, 2096, 197, 2095, 699, 199, 2166, 79, - /* 1710 */ 2135, 2202, 698, 1485, 111, 2168, 702, 2170, 2171, 697, - /* 1720 */ 2167, 692, 1484, 2077, 2076, 2075, 446, 447, 2255, 2074, - /* 1730 */ 699, 2073, 687, 2251, 2185, 2029, 1436, 2028, 2026, 2025, - /* 1740 */ 147, 2024, 2027, 2023, 700, 2022, 2135, 2202, 698, 2020, - /* 1750 */ 111, 2168, 702, 2170, 2171, 697, 2019, 692, 2185, 2018, - /* 1760 */ 204, 464, 2017, 2031, 2255, 466, 2016, 2015, 357, 2251, - /* 1770 */ 2135, 2014, 698, 2013, 2012, 2011, 2010, 2009, 2008, 2007, - /* 1780 */ 2166, 2006, 2005, 2202, 2004, 2167, 111, 2168, 702, 2170, - /* 1790 */ 2171, 697, 2003, 692, 2002, 699, 149, 2001, 2000, 1999, - /* 1800 */ 2255, 2030, 1998, 1997, 2166, 2252, 1996, 2202, 1995, 1438, - /* 1810 */ 171, 2168, 702, 2170, 2171, 697, 1994, 692, 494, 1993, - /* 1820 */ 1992, 1844, 1312, 2185, 1308, 1843, 1316, 212, 382, 1842, - /* 1830 */ 214, 350, 215, 351, 1840, 2135, 1837, 698, 1836, 511, - /* 1840 */ 515, 1829, 510, 1818, 519, 514, 1794, 2167, 512, 518, - /* 1850 */ 516, 2293, 520, 522, 217, 1793, 76, 699, 1205, 182, - /* 1860 */ 2094, 2084, 219, 2167, 2072, 77, 227, 225, 2071, 2166, - /* 1870 */ 2155, 183, 2202, 699, 530, 340, 2168, 702, 2170, 2171, - /* 1880 */ 697, 2049, 692, 1918, 1839, 2185, 1835, 545, 546, 547, - /* 1890 */ 383, 549, 551, 1831, 550, 1828, 554, 2135, 1833, 698, - /* 1900 */ 1250, 2185, 553, 558, 555, 557, 1813, 1811, 559, 1812, - /* 1910 */ 1810, 1790, 1920, 2135, 2167, 698, 1383, 1384, 1919, 753, - /* 1920 */ 1299, 755, 1297, 1295, 699, 1294, 1286, 1293, 1826, 588, - /* 1930 */ 1815, 2166, 1292, 1817, 2202, 1291, 2167, 340, 2168, 702, - /* 1940 */ 2170, 2171, 697, 1288, 692, 63, 699, 2166, 1287, 1285, - /* 1950 */ 2202, 375, 2185, 333, 2168, 702, 2170, 2171, 697, 235, - /* 1960 */ 692, 591, 376, 377, 2135, 1789, 698, 593, 1788, 595, - /* 1970 */ 1787, 597, 113, 1511, 2185, 1515, 29, 1513, 1510, 390, - /* 1980 */ 2093, 1491, 67, 1493, 1495, 2083, 2135, 2331, 698, 612, - /* 1990 */ 2070, 2068, 20, 1727, 17, 6, 642, 21, 2166, 31, - /* 2000 */ 2167, 2202, 263, 608, 172, 2168, 702, 2170, 2171, 697, - /* 2010 */ 696, 692, 7, 58, 23, 618, 626, 22, 628, 613, - /* 2020 */ 2166, 788, 165, 2202, 258, 265, 340, 2168, 702, 2170, - /* 2030 */ 2171, 697, 270, 692, 381, 310, 2167, 33, 2185, 1709, - /* 2040 */ 173, 271, 2156, 65, 24, 1742, 699, 269, 32, 1741, - /* 2050 */ 2135, 180, 698, 386, 1701, 1747, 2348, 92, 2167, 778, - /* 2060 */ 774, 770, 766, 1748, 308, 1746, 1745, 387, 699, 283, - /* 2070 */ 1676, 60, 178, 1675, 2185, 94, 95, 25, 292, 398, - /* 2080 */ 2069, 2067, 2066, 2048, 2166, 289, 2135, 2202, 698, 297, - /* 2090 */ 339, 2168, 702, 2170, 2171, 697, 2185, 692, 673, 2221, - /* 2100 */ 290, 400, 18, 1707, 108, 2047, 68, 301, 2135, 97, - /* 2110 */ 698, 99, 302, 59, 103, 26, 1628, 1627, 13, 11, - /* 2120 */ 2166, 1551, 1638, 2202, 2205, 2167, 340, 2168, 702, 2170, - /* 2130 */ 2171, 697, 299, 692, 179, 699, 192, 1606, 691, 678, - /* 2140 */ 1604, 1583, 2166, 1603, 2167, 2202, 39, 16, 340, 2168, - /* 2150 */ 702, 2170, 2171, 697, 699, 692, 27, 705, 1575, 701, - /* 2160 */ 28, 703, 1369, 2185, 401, 707, 709, 1366, 1363, 710, - /* 2170 */ 712, 713, 715, 1357, 288, 2135, 716, 698, 1355, 287, - /* 2180 */ 718, 719, 2185, 305, 1361, 1360, 1359, 104, 105, 1378, - /* 2190 */ 1374, 75, 1358, 1248, 2135, 733, 698, 1280, 1279, 254, - /* 2200 */ 1278, 1277, 1275, 1306, 1273, 1272, 1271, 743, 306, 603, - /* 2210 */ 1266, 1269, 2202, 2167, 1268, 335, 2168, 702, 2170, 2171, - /* 2220 */ 697, 1267, 692, 699, 1265, 1264, 1263, 1303, 2166, 1301, - /* 2230 */ 2167, 2202, 1260, 1259, 324, 2168, 702, 2170, 2171, 697, - /* 2240 */ 699, 692, 1256, 1255, 1254, 1253, 1834, 763, 764, 1832, - /* 2250 */ 765, 2185, 767, 768, 769, 1830, 771, 773, 772, 1827, - /* 2260 */ 775, 1809, 776, 2135, 779, 698, 777, 1195, 2185, 1786, - /* 2270 */ 309, 783, 1761, 1537, 319, 786, 787, 1761, 2167, 1761, - /* 2280 */ 2135, 1761, 698, 1761, 1761, 1761, 1761, 1761, 699, 1761, - /* 2290 */ 1761, 1761, 1761, 1761, 1761, 1761, 1761, 2166, 1761, 1761, - /* 2300 */ 2202, 1761, 1761, 325, 2168, 702, 2170, 2171, 697, 1761, - /* 2310 */ 692, 1761, 1761, 1761, 2166, 1761, 2185, 2202, 1761, 1761, - /* 2320 */ 326, 2168, 702, 2170, 2171, 697, 2167, 692, 2135, 1761, - /* 2330 */ 698, 1761, 1761, 1761, 1761, 1761, 699, 1761, 1761, 1761, - /* 2340 */ 1761, 1761, 1761, 2167, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2350 */ 1761, 1761, 1761, 699, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2360 */ 1761, 1761, 2166, 1761, 2185, 2202, 1761, 1761, 332, 2168, - /* 2370 */ 702, 2170, 2171, 697, 1761, 692, 2135, 1761, 698, 1761, - /* 2380 */ 1761, 2185, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2390 */ 1761, 2167, 1761, 2135, 1761, 698, 1761, 1761, 1761, 1761, - /* 2400 */ 1761, 699, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2410 */ 2166, 1761, 1761, 2202, 2167, 1761, 336, 2168, 702, 2170, - /* 2420 */ 2171, 697, 1761, 692, 699, 1761, 1761, 2166, 1761, 2185, - /* 2430 */ 2202, 1761, 1761, 328, 2168, 702, 2170, 2171, 697, 2167, - /* 2440 */ 692, 2135, 1761, 698, 1761, 1761, 1761, 1761, 1761, 699, - /* 2450 */ 1761, 1761, 2185, 1761, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2460 */ 1761, 1761, 1761, 1761, 2135, 1761, 698, 1761, 1761, 1761, - /* 2470 */ 1761, 1761, 1761, 1761, 1761, 2166, 1761, 2185, 2202, 1761, - /* 2480 */ 1761, 337, 2168, 702, 2170, 2171, 697, 1761, 692, 2135, - /* 2490 */ 2167, 698, 1761, 1761, 1761, 1761, 1761, 1761, 2166, 1761, - /* 2500 */ 699, 2202, 1761, 1761, 329, 2168, 702, 2170, 2171, 697, - /* 2510 */ 1761, 692, 1761, 1761, 2167, 1761, 1761, 1761, 1761, 1761, - /* 2520 */ 1761, 1761, 1761, 2166, 699, 1761, 2202, 1761, 2185, 338, - /* 2530 */ 2168, 702, 2170, 2171, 697, 1761, 692, 1761, 1761, 1761, - /* 2540 */ 2135, 1761, 698, 1761, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2550 */ 1761, 1761, 2185, 1761, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2560 */ 1761, 1761, 2167, 1761, 2135, 1761, 698, 1761, 1761, 1761, - /* 2570 */ 1761, 1761, 699, 1761, 2166, 1761, 1761, 2202, 2167, 1761, - /* 2580 */ 330, 2168, 702, 2170, 2171, 697, 1761, 692, 699, 1761, - /* 2590 */ 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 2166, 1761, - /* 2600 */ 2185, 2202, 1761, 1761, 343, 2168, 702, 2170, 2171, 697, - /* 2610 */ 1761, 692, 2135, 1761, 698, 1761, 2185, 1761, 1761, 1761, - /* 2620 */ 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 2135, 1761, - /* 2630 */ 698, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2640 */ 2167, 1761, 1761, 1761, 1761, 1761, 2166, 1761, 1761, 2202, - /* 2650 */ 699, 1761, 344, 2168, 702, 2170, 2171, 697, 1761, 692, - /* 2660 */ 1761, 1761, 2166, 1761, 2167, 2202, 1761, 1761, 2179, 2168, - /* 2670 */ 702, 2170, 2171, 697, 699, 692, 1761, 1761, 2185, 1761, - /* 2680 */ 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2690 */ 2135, 1761, 698, 1761, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2700 */ 1761, 1761, 2185, 1761, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2710 */ 1761, 1761, 2167, 1761, 2135, 1761, 698, 1761, 1761, 1761, - /* 2720 */ 1761, 1761, 699, 1761, 2166, 1761, 1761, 2202, 1761, 1761, - /* 2730 */ 2178, 2168, 702, 2170, 2171, 697, 1761, 692, 1761, 1761, - /* 2740 */ 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 2166, 1761, - /* 2750 */ 2185, 2202, 1761, 1761, 2177, 2168, 702, 2170, 2171, 697, - /* 2760 */ 2167, 692, 2135, 1761, 698, 1761, 1761, 1761, 1761, 1761, - /* 2770 */ 699, 1761, 1761, 1761, 1761, 2167, 1761, 1761, 1761, 1761, - /* 2780 */ 1761, 1761, 1761, 1761, 1761, 699, 1761, 1761, 1761, 1761, - /* 2790 */ 1761, 1761, 1761, 1761, 1761, 1761, 2166, 1761, 2185, 2202, - /* 2800 */ 1761, 1761, 359, 2168, 702, 2170, 2171, 697, 1761, 692, - /* 2810 */ 2135, 1761, 698, 2185, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2820 */ 1761, 1761, 1761, 2167, 1761, 2135, 1761, 698, 1761, 1761, - /* 2830 */ 1761, 1761, 1761, 699, 1761, 1761, 1761, 1761, 2167, 1761, - /* 2840 */ 1761, 1761, 1761, 1761, 2166, 1761, 1761, 2202, 699, 1761, - /* 2850 */ 360, 2168, 702, 2170, 2171, 697, 1761, 692, 1761, 2166, - /* 2860 */ 1761, 2185, 2202, 1761, 1761, 356, 2168, 702, 2170, 2171, - /* 2870 */ 697, 2167, 692, 2135, 1761, 698, 2185, 1761, 1761, 1761, - /* 2880 */ 1761, 699, 1761, 1761, 1761, 1761, 1761, 1761, 2135, 1761, - /* 2890 */ 698, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2900 */ 1761, 1761, 1761, 1761, 1761, 1761, 1761, 2166, 1761, 2185, - /* 2910 */ 2202, 1761, 1761, 361, 2168, 702, 2170, 2171, 697, 1761, - /* 2920 */ 692, 2135, 700, 698, 1761, 2202, 1761, 1761, 335, 2168, - /* 2930 */ 702, 2170, 2171, 697, 1761, 692, 1761, 1761, 1761, 1761, - /* 2940 */ 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, - /* 2950 */ 1761, 1761, 1761, 1761, 1761, 2166, 1761, 1761, 2202, 1761, - /* 2960 */ 1761, 334, 2168, 702, 2170, 2171, 697, 1761, 692, + /* 0 */ 2173, 169, 2337, 38, 303, 2332, 170, 445, 1779, 1885, + /* 10 */ 660, 444, 48, 46, 1691, 1933, 181, 2337, 2151, 1790, + /* 20 */ 399, 2336, 1540, 41, 40, 2333, 2335, 47, 45, 44, + /* 30 */ 43, 42, 2159, 1621, 1567, 1538, 366, 2046, 2191, 41, + /* 40 */ 40, 451, 2155, 47, 45, 44, 43, 42, 402, 663, + /* 50 */ 2141, 1568, 698, 1566, 620, 526, 164, 2332, 527, 1803, + /* 60 */ 2173, 218, 1616, 380, 1946, 529, 167, 1810, 19, 2141, + /* 70 */ 699, 1995, 2338, 188, 1947, 1546, 184, 2333, 646, 2157, + /* 80 */ 396, 2106, 2337, 358, 2172, 2332, 345, 2208, 1984, 692, + /* 90 */ 110, 2174, 702, 2176, 2177, 697, 620, 692, 2191, 2332, + /* 100 */ 788, 2336, 185, 15, 2261, 2333, 2334, 220, 395, 2257, + /* 110 */ 2141, 529, 698, 1810, 2338, 188, 48, 46, 1753, 2333, + /* 120 */ 646, 190, 682, 1944, 399, 1789, 1540, 1650, 251, 2287, + /* 130 */ 47, 45, 44, 43, 42, 668, 1567, 1621, 205, 1538, + /* 140 */ 1623, 1624, 133, 2063, 2172, 682, 1944, 2208, 1304, 566, + /* 150 */ 110, 2174, 702, 2176, 2177, 697, 2124, 692, 2061, 669, + /* 160 */ 145, 1565, 152, 2232, 2261, 193, 1616, 668, 395, 2257, + /* 170 */ 1596, 1606, 19, 1395, 1396, 2141, 1622, 1625, 84, 1546, + /* 180 */ 1920, 83, 657, 142, 1651, 1768, 284, 541, 1306, 2056, + /* 190 */ 1541, 123, 1539, 681, 122, 121, 120, 119, 118, 117, + /* 200 */ 116, 115, 114, 262, 788, 668, 123, 15, 2173, 122, + /* 210 */ 121, 120, 119, 118, 117, 116, 115, 114, 699, 666, + /* 220 */ 1812, 2056, 1544, 1545, 1767, 1595, 1598, 1599, 1600, 1601, + /* 230 */ 1602, 1603, 1604, 1605, 694, 690, 1614, 1615, 1617, 1618, + /* 240 */ 1619, 1620, 2, 681, 1623, 1624, 2191, 737, 132, 131, + /* 250 */ 130, 129, 128, 127, 126, 125, 124, 677, 2141, 2056, + /* 260 */ 698, 37, 397, 1645, 1646, 1647, 1648, 1649, 1653, 1654, + /* 270 */ 1655, 1656, 543, 2173, 1596, 1606, 51, 682, 1944, 66, + /* 280 */ 1622, 1625, 9, 660, 659, 186, 2269, 2270, 284, 140, + /* 290 */ 2274, 1227, 2172, 1226, 1541, 2208, 1539, 133, 110, 2174, + /* 300 */ 702, 2176, 2177, 697, 571, 692, 138, 531, 682, 1944, + /* 310 */ 2352, 2191, 2261, 528, 41, 40, 395, 2257, 47, 45, + /* 320 */ 44, 43, 42, 2141, 1228, 698, 1544, 1545, 57, 1595, + /* 330 */ 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 694, 690, + /* 340 */ 1614, 1615, 1617, 1618, 1619, 1620, 2, 12, 48, 46, + /* 350 */ 1227, 2173, 1226, 408, 407, 2336, 399, 2172, 1540, 2276, + /* 360 */ 2208, 696, 1922, 110, 2174, 702, 2176, 2177, 697, 1621, + /* 370 */ 692, 1538, 428, 1997, 181, 185, 1547, 2261, 62, 639, + /* 380 */ 379, 395, 2257, 1228, 2063, 2273, 41, 40, 1995, 2191, + /* 390 */ 47, 45, 44, 43, 42, 2047, 392, 1360, 1616, 2060, + /* 400 */ 669, 2141, 2288, 698, 19, 534, 150, 2191, 527, 1803, + /* 410 */ 1730, 1546, 1351, 727, 726, 725, 1355, 724, 1357, 1358, + /* 420 */ 723, 720, 30, 1366, 717, 1368, 1369, 714, 711, 708, + /* 430 */ 667, 1695, 191, 1565, 107, 2172, 788, 1565, 2208, 15, + /* 440 */ 101, 339, 2174, 702, 2176, 2177, 697, 695, 692, 683, + /* 450 */ 2226, 143, 48, 46, 1626, 87, 635, 34, 234, 1936, + /* 460 */ 399, 638, 1540, 41, 40, 1937, 681, 47, 45, 44, + /* 470 */ 43, 42, 368, 1621, 174, 1538, 1623, 1624, 640, 682, + /* 480 */ 1944, 1939, 560, 556, 552, 548, 2042, 233, 285, 393, + /* 490 */ 735, 157, 156, 732, 731, 730, 154, 167, 2173, 449, + /* 500 */ 1202, 1684, 1616, 1565, 1719, 1946, 1596, 1606, 699, 12, + /* 510 */ 2295, 10, 1622, 1625, 2042, 1546, 41, 40, 682, 1944, + /* 520 */ 47, 45, 44, 43, 42, 1564, 1541, 88, 1539, 62, + /* 530 */ 231, 93, 201, 1550, 191, 489, 2191, 1568, 450, 1204, + /* 540 */ 788, 1207, 1208, 49, 1788, 641, 636, 629, 2141, 51, + /* 550 */ 698, 632, 631, 1717, 1718, 1720, 1721, 1722, 1544, 1545, + /* 560 */ 203, 1595, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, + /* 570 */ 694, 690, 1614, 1615, 1617, 1618, 1619, 1620, 2, 62, + /* 580 */ 1623, 1624, 2172, 1450, 1451, 2208, 62, 1597, 110, 2174, + /* 590 */ 702, 2176, 2177, 697, 2141, 692, 209, 208, 230, 224, + /* 600 */ 2352, 523, 2261, 229, 737, 539, 395, 2257, 2173, 521, + /* 610 */ 1596, 1606, 517, 513, 682, 1944, 1622, 1625, 699, 488, + /* 620 */ 2308, 682, 1944, 222, 607, 2151, 52, 62, 294, 295, + /* 630 */ 1541, 648, 1539, 293, 459, 584, 583, 582, 684, 1935, + /* 640 */ 2233, 474, 574, 139, 578, 2127, 2191, 1787, 577, 2155, + /* 650 */ 657, 142, 1549, 576, 581, 374, 373, 2027, 2141, 575, + /* 660 */ 698, 2134, 1544, 1545, 1566, 1595, 1598, 1599, 1600, 1601, + /* 670 */ 1602, 1603, 1604, 1605, 694, 690, 1614, 1615, 1617, 1618, + /* 680 */ 1619, 1620, 2, 48, 46, 191, 2157, 682, 1944, 202, + /* 690 */ 1760, 399, 2172, 1540, 421, 2208, 692, 2141, 110, 2174, + /* 700 */ 702, 2176, 2177, 697, 1621, 692, 1538, 475, 620, 2173, + /* 710 */ 2352, 2332, 2261, 443, 402, 442, 395, 2257, 1921, 699, + /* 720 */ 404, 589, 167, 1990, 1992, 2276, 2338, 188, 682, 1944, + /* 730 */ 1946, 2333, 646, 1616, 1631, 191, 599, 1991, 1992, 2173, + /* 740 */ 1565, 433, 191, 682, 1944, 441, 1546, 2191, 542, 699, + /* 750 */ 247, 2272, 598, 282, 2269, 656, 12, 134, 655, 2141, + /* 760 */ 2332, 698, 405, 1941, 2276, 596, 592, 594, 435, 431, + /* 770 */ 167, 788, 1546, 586, 49, 644, 188, 2191, 1946, 246, + /* 780 */ 2333, 646, 191, 191, 1467, 1468, 747, 48, 46, 2141, + /* 790 */ 2271, 698, 1759, 2172, 1315, 399, 2208, 1540, 250, 111, + /* 800 */ 2174, 702, 2176, 2177, 697, 1652, 692, 1314, 1621, 1552, + /* 810 */ 1538, 1623, 1624, 2261, 657, 142, 469, 2260, 2257, 70, + /* 820 */ 1466, 1469, 69, 2172, 1919, 468, 2208, 728, 1997, 171, + /* 830 */ 2174, 702, 2176, 2177, 697, 389, 692, 1616, 1786, 2173, + /* 840 */ 1210, 1596, 1606, 1995, 682, 1944, 1564, 1622, 1625, 699, + /* 850 */ 1546, 735, 157, 156, 732, 731, 730, 154, 452, 1997, + /* 860 */ 686, 1541, 2233, 1539, 252, 155, 394, 1511, 1512, 621, + /* 870 */ 2298, 453, 498, 36, 1995, 788, 1929, 2191, 15, 41, + /* 880 */ 40, 1931, 35, 47, 45, 44, 43, 42, 2141, 2141, + /* 890 */ 1597, 698, 1657, 1544, 1545, 1927, 1595, 1598, 1599, 1600, + /* 900 */ 1601, 1602, 1603, 1604, 1605, 694, 690, 1614, 1615, 1617, + /* 910 */ 1618, 1619, 1620, 2, 1785, 1623, 1624, 187, 2269, 2270, + /* 920 */ 1765, 140, 2274, 2172, 1784, 56, 2208, 1783, 1782, 171, + /* 930 */ 2174, 702, 2176, 2177, 697, 349, 692, 1563, 44, 43, + /* 940 */ 42, 1997, 259, 2173, 482, 1596, 1606, 496, 403, 1781, + /* 950 */ 495, 1622, 1625, 699, 1997, 627, 1995, 735, 157, 156, + /* 960 */ 732, 731, 730, 154, 2141, 1541, 465, 1539, 497, 1996, + /* 970 */ 2299, 682, 1944, 467, 2141, 1540, 1319, 2141, 2141, 41, + /* 980 */ 40, 2191, 1778, 47, 45, 44, 43, 42, 1538, 1318, + /* 990 */ 1568, 616, 414, 2141, 1777, 698, 413, 1544, 1545, 2141, + /* 1000 */ 1595, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 694, + /* 1010 */ 690, 1614, 1615, 1617, 1618, 1619, 1620, 2, 1843, 367, + /* 1020 */ 1565, 682, 1944, 657, 142, 580, 579, 2172, 1546, 1948, + /* 1030 */ 2208, 455, 2141, 110, 2174, 702, 2176, 2177, 697, 620, + /* 1040 */ 692, 661, 2332, 1776, 2141, 2352, 570, 2261, 1230, 1231, + /* 1050 */ 569, 395, 2257, 788, 500, 562, 561, 2338, 188, 564, + /* 1060 */ 563, 493, 2333, 646, 487, 486, 485, 484, 481, 480, + /* 1070 */ 479, 478, 477, 473, 472, 471, 470, 348, 462, 461, + /* 1080 */ 460, 652, 457, 456, 365, 759, 757, 1775, 765, 764, + /* 1090 */ 763, 762, 411, 2141, 761, 760, 146, 755, 754, 753, + /* 1100 */ 752, 751, 750, 749, 159, 745, 744, 743, 410, 409, + /* 1110 */ 740, 739, 738, 177, 176, 168, 682, 1944, 2135, 1774, + /* 1120 */ 323, 1773, 1772, 408, 407, 256, 189, 2269, 2270, 2173, + /* 1130 */ 140, 2274, 371, 1554, 321, 73, 665, 2141, 72, 699, + /* 1140 */ 693, 2326, 261, 1541, 1621, 1539, 1547, 41, 40, 346, + /* 1150 */ 1688, 47, 45, 44, 43, 42, 2042, 1771, 682, 1944, + /* 1160 */ 216, 508, 506, 503, 54, 620, 3, 2191, 2332, 2141, + /* 1170 */ 1597, 2141, 2141, 1616, 649, 1544, 1545, 2173, 298, 2141, + /* 1180 */ 1770, 698, 260, 2338, 188, 2151, 1546, 699, 2333, 646, + /* 1190 */ 41, 40, 14, 13, 47, 45, 44, 43, 42, 2160, + /* 1200 */ 62, 372, 207, 370, 369, 74, 568, 2141, 87, 2155, + /* 1210 */ 689, 688, 605, 2172, 144, 2191, 2208, 2232, 1886, 110, + /* 1220 */ 2174, 702, 2176, 2177, 697, 91, 692, 2141, 570, 698, + /* 1230 */ 2141, 2352, 569, 2261, 1940, 2173, 572, 395, 2257, 109, + /* 1240 */ 148, 729, 135, 1707, 1988, 699, 2157, 2280, 733, 734, + /* 1250 */ 317, 1988, 1988, 1974, 748, 82, 692, 1906, 1302, 620, + /* 1260 */ 239, 2172, 2332, 237, 2208, 2281, 1684, 333, 2174, 702, + /* 1270 */ 2176, 2177, 697, 2191, 692, 1207, 1208, 2338, 188, 81, + /* 1280 */ 80, 448, 2333, 646, 200, 2141, 2173, 698, 241, 1780, + /* 1290 */ 573, 240, 619, 682, 1944, 1664, 699, 440, 438, 243, + /* 1300 */ 2301, 1555, 242, 1550, 245, 1762, 1763, 244, 347, 1830, + /* 1310 */ 642, 429, 1300, 679, 427, 423, 419, 416, 441, 2172, + /* 1320 */ 653, 602, 2208, 601, 2191, 110, 2174, 702, 2176, 2177, + /* 1330 */ 697, 585, 692, 1558, 1560, 1821, 2141, 2352, 698, 2261, + /* 1340 */ 1819, 155, 645, 395, 2257, 2332, 690, 1614, 1615, 1617, + /* 1350 */ 1618, 1619, 1620, 2173, 166, 249, 191, 587, 155, 248, + /* 1360 */ 644, 188, 590, 699, 1642, 2333, 646, 279, 50, 50, + /* 1370 */ 2172, 266, 155, 2208, 50, 291, 110, 2174, 702, 2176, + /* 1380 */ 2177, 697, 633, 692, 682, 1944, 2173, 137, 2236, 106, + /* 1390 */ 2261, 2191, 682, 1944, 395, 2257, 699, 682, 1944, 103, + /* 1400 */ 71, 1506, 2162, 2141, 680, 698, 1687, 153, 155, 14, + /* 1410 */ 13, 650, 304, 2173, 64, 273, 55, 406, 1509, 90, + /* 1420 */ 1548, 1813, 353, 699, 2191, 378, 50, 600, 1716, 1715, + /* 1430 */ 741, 268, 664, 50, 1464, 296, 2141, 2172, 698, 2192, + /* 1440 */ 2208, 1884, 706, 110, 2174, 702, 2176, 2177, 697, 2173, + /* 1450 */ 692, 2191, 1280, 1883, 153, 2234, 155, 2261, 2164, 699, + /* 1460 */ 674, 395, 2257, 2141, 136, 698, 412, 300, 1345, 153, + /* 1470 */ 2172, 783, 1261, 2208, 1658, 2173, 110, 2174, 702, 2176, + /* 1480 */ 2177, 697, 2051, 692, 1804, 699, 1607, 2191, 685, 742, + /* 1490 */ 2261, 1809, 1985, 316, 395, 2257, 2291, 2172, 658, 2141, + /* 1500 */ 2208, 698, 1373, 111, 2174, 702, 2176, 2177, 697, 281, + /* 1510 */ 692, 1278, 1262, 2191, 1377, 278, 1384, 2261, 1, 5, + /* 1520 */ 415, 687, 2257, 420, 1382, 2141, 362, 698, 1571, 158, + /* 1530 */ 437, 436, 196, 700, 439, 198, 2208, 195, 1487, 111, + /* 1540 */ 2174, 702, 2176, 2177, 697, 311, 692, 206, 454, 1568, + /* 1550 */ 2052, 458, 491, 2261, 2173, 463, 1563, 357, 2257, 2172, + /* 1560 */ 476, 2044, 2208, 483, 699, 172, 2174, 702, 2176, 2177, + /* 1570 */ 697, 490, 692, 492, 501, 502, 499, 1551, 210, 504, + /* 1580 */ 2173, 211, 505, 213, 507, 509, 1569, 524, 4, 525, + /* 1590 */ 699, 532, 2191, 533, 1566, 221, 536, 535, 1570, 223, + /* 1600 */ 1572, 537, 565, 538, 2141, 1997, 698, 540, 544, 226, + /* 1610 */ 228, 85, 364, 86, 2115, 232, 647, 2353, 2191, 112, + /* 1620 */ 1995, 2112, 352, 382, 567, 604, 1934, 606, 2111, 89, + /* 1630 */ 2141, 610, 698, 609, 312, 151, 611, 253, 2172, 236, + /* 1640 */ 1930, 2208, 2173, 238, 111, 2174, 702, 2176, 2177, 697, + /* 1650 */ 160, 692, 699, 161, 1932, 255, 1928, 162, 2261, 2173, + /* 1660 */ 163, 614, 257, 2258, 2172, 1494, 617, 2208, 2292, 699, + /* 1670 */ 340, 2174, 702, 2176, 2177, 697, 672, 692, 2173, 615, + /* 1680 */ 2191, 624, 634, 645, 2302, 383, 2332, 8, 699, 630, + /* 1690 */ 2307, 2306, 2141, 264, 698, 267, 2283, 2191, 384, 643, + /* 1700 */ 637, 644, 188, 385, 625, 623, 2333, 646, 622, 2141, + /* 1710 */ 1684, 698, 654, 277, 651, 141, 2191, 2355, 1567, 175, + /* 1720 */ 2331, 390, 2277, 662, 388, 286, 2172, 274, 2141, 2208, + /* 1730 */ 698, 96, 340, 2174, 702, 2176, 2177, 697, 272, 692, + /* 1740 */ 1573, 313, 2057, 2172, 280, 276, 2208, 670, 275, 172, + /* 1750 */ 2174, 702, 2176, 2177, 697, 675, 692, 671, 2071, 314, + /* 1760 */ 676, 2070, 2172, 98, 2173, 2208, 2069, 391, 340, 2174, + /* 1770 */ 702, 2176, 2177, 697, 696, 692, 315, 1945, 100, 61, + /* 1780 */ 2242, 2173, 102, 704, 1989, 318, 784, 1907, 307, 322, + /* 1790 */ 785, 699, 787, 53, 354, 327, 355, 342, 2133, 320, + /* 1800 */ 2173, 2354, 2191, 341, 2132, 331, 2131, 78, 2128, 417, + /* 1810 */ 699, 418, 1531, 1532, 2141, 194, 698, 422, 2126, 2191, + /* 1820 */ 424, 425, 426, 2125, 398, 363, 2123, 430, 2122, 432, + /* 1830 */ 2121, 2141, 434, 698, 2102, 1522, 197, 2101, 2191, 199, + /* 1840 */ 1490, 79, 1489, 400, 2083, 2082, 2081, 446, 2172, 447, + /* 1850 */ 2141, 2208, 698, 2080, 339, 2174, 702, 2176, 2177, 697, + /* 1860 */ 2079, 692, 1441, 2227, 2035, 2172, 147, 608, 2208, 2034, + /* 1870 */ 2032, 340, 2174, 702, 2176, 2177, 697, 2031, 692, 2030, + /* 1880 */ 2033, 2029, 2028, 2026, 2172, 791, 2025, 2208, 2024, 204, + /* 1890 */ 340, 2174, 702, 2176, 2177, 697, 464, 692, 2173, 310, + /* 1900 */ 2023, 466, 2037, 2022, 2021, 2020, 2019, 2018, 699, 2017, + /* 1910 */ 2016, 2015, 2014, 2013, 2012, 180, 149, 2007, 2006, 2005, + /* 1920 */ 2036, 2004, 2003, 781, 777, 773, 769, 2011, 308, 2010, + /* 1930 */ 2009, 2173, 2008, 2002, 2001, 2000, 2191, 1443, 494, 1999, + /* 1940 */ 1998, 699, 350, 351, 1849, 1316, 1320, 212, 2141, 1848, + /* 1950 */ 698, 214, 1847, 215, 1845, 1842, 1841, 511, 1834, 1823, + /* 1960 */ 1312, 510, 1799, 1798, 2173, 227, 514, 512, 108, 2191, + /* 1970 */ 2100, 301, 2090, 2078, 699, 516, 518, 522, 2077, 1209, + /* 1980 */ 2055, 2141, 603, 698, 1923, 2208, 520, 515, 335, 2174, + /* 1990 */ 702, 2176, 2177, 697, 519, 692, 1844, 182, 2161, 217, + /* 2000 */ 2173, 1840, 2191, 77, 678, 547, 76, 183, 530, 219, + /* 2010 */ 699, 545, 1254, 225, 2141, 2172, 698, 546, 2208, 1838, + /* 2020 */ 549, 324, 2174, 702, 2176, 2177, 697, 551, 692, 1836, + /* 2030 */ 550, 554, 553, 2173, 555, 1833, 558, 557, 2191, 288, + /* 2040 */ 1818, 1816, 559, 699, 287, 1817, 1815, 1795, 2172, 1925, + /* 2050 */ 2141, 2208, 698, 1389, 325, 2174, 702, 2176, 2177, 697, + /* 2060 */ 63, 692, 2173, 1924, 254, 1388, 1303, 1301, 1299, 1298, + /* 2070 */ 756, 2191, 699, 1297, 1296, 1831, 1290, 1295, 375, 1292, + /* 2080 */ 758, 235, 1822, 2141, 2172, 698, 1291, 2208, 376, 1820, + /* 2090 */ 326, 2174, 702, 2176, 2177, 697, 1289, 692, 377, 588, + /* 2100 */ 2191, 597, 591, 1794, 593, 1793, 595, 1792, 113, 1516, + /* 2110 */ 1520, 29, 2141, 1518, 698, 1515, 2099, 2172, 58, 67, + /* 2120 */ 2208, 1496, 2173, 332, 2174, 702, 2176, 2177, 697, 2089, + /* 2130 */ 692, 1498, 699, 612, 2076, 2074, 2337, 20, 17, 6, + /* 2140 */ 31, 2173, 7, 21, 22, 271, 2172, 1500, 270, 2208, + /* 2150 */ 33, 699, 336, 2174, 702, 2176, 2177, 697, 613, 692, + /* 2160 */ 2191, 1732, 381, 258, 265, 263, 626, 628, 165, 2162, + /* 2170 */ 618, 65, 2141, 173, 698, 24, 1714, 1706, 1747, 2191, + /* 2180 */ 269, 1746, 386, 1751, 32, 1750, 92, 283, 387, 2173, + /* 2190 */ 2075, 2141, 178, 698, 1752, 60, 1753, 2073, 2072, 699, + /* 2200 */ 1681, 1680, 2054, 95, 289, 94, 2172, 2053, 2173, 2208, + /* 2210 */ 97, 25, 328, 2174, 702, 2176, 2177, 697, 699, 692, + /* 2220 */ 26, 290, 1712, 292, 297, 2172, 68, 2191, 2208, 99, + /* 2230 */ 673, 337, 2174, 702, 2176, 2177, 697, 299, 692, 2141, + /* 2240 */ 23, 698, 1846, 103, 11, 1633, 2191, 13, 302, 1556, + /* 2250 */ 59, 179, 1643, 1611, 1588, 18, 2173, 1632, 2141, 1609, + /* 2260 */ 698, 2211, 691, 39, 192, 1608, 699, 1580, 16, 27, + /* 2270 */ 28, 705, 401, 2172, 701, 707, 2208, 2173, 709, 329, + /* 2280 */ 2174, 702, 2176, 2177, 697, 1374, 692, 699, 703, 1371, + /* 2290 */ 710, 712, 2172, 1370, 2191, 2208, 713, 715, 338, 2174, + /* 2300 */ 702, 2176, 2177, 697, 718, 692, 2141, 1367, 698, 716, + /* 2310 */ 721, 719, 584, 583, 582, 2191, 1361, 1359, 722, 574, + /* 2320 */ 139, 578, 104, 305, 1365, 577, 105, 2141, 1383, 698, + /* 2330 */ 576, 581, 374, 373, 1364, 1363, 575, 75, 1379, 1362, + /* 2340 */ 2172, 1252, 736, 2208, 1284, 2173, 330, 2174, 702, 2176, + /* 2350 */ 2177, 697, 1283, 692, 1282, 699, 1281, 1279, 1277, 1276, + /* 2360 */ 1275, 2172, 1310, 2173, 2208, 746, 1270, 343, 2174, 702, + /* 2370 */ 2176, 2177, 697, 699, 692, 306, 1273, 1272, 1271, 1307, + /* 2380 */ 1269, 1268, 1267, 2191, 1305, 1264, 1263, 1260, 1259, 1258, + /* 2390 */ 1257, 1839, 766, 2173, 1837, 2141, 770, 698, 768, 772, + /* 2400 */ 1835, 2191, 776, 699, 774, 767, 1832, 771, 778, 780, + /* 2410 */ 1814, 775, 782, 2141, 779, 698, 1199, 1791, 309, 786, + /* 2420 */ 1766, 1542, 790, 319, 2173, 789, 1766, 1766, 1766, 2172, + /* 2430 */ 1766, 2191, 2208, 1766, 699, 344, 2174, 702, 2176, 2177, + /* 2440 */ 697, 2173, 692, 2141, 1766, 698, 1766, 2172, 1766, 1766, + /* 2450 */ 2208, 699, 1766, 2185, 2174, 702, 2176, 2177, 697, 1766, + /* 2460 */ 692, 1766, 2191, 1766, 1766, 1766, 1766, 1766, 1766, 1766, + /* 2470 */ 1766, 1766, 1766, 1766, 2141, 1766, 698, 2172, 1766, 2191, + /* 2480 */ 2208, 1766, 1766, 2184, 2174, 702, 2176, 2177, 697, 1766, + /* 2490 */ 692, 2141, 2173, 698, 1766, 1766, 1766, 1766, 1766, 1766, + /* 2500 */ 1766, 1766, 699, 1766, 1766, 1766, 1766, 1766, 2172, 1766, + /* 2510 */ 1766, 2208, 1766, 2173, 2183, 2174, 702, 2176, 2177, 697, + /* 2520 */ 1766, 692, 1766, 699, 1766, 2172, 1766, 1766, 2208, 1766, + /* 2530 */ 2191, 359, 2174, 702, 2176, 2177, 697, 1766, 692, 1766, + /* 2540 */ 2173, 1766, 2141, 1766, 698, 1766, 1766, 1766, 1766, 1766, + /* 2550 */ 699, 2191, 1766, 1766, 1766, 1766, 1766, 1766, 1766, 1766, + /* 2560 */ 1766, 1766, 1766, 2141, 1766, 698, 1766, 1766, 1766, 1766, + /* 2570 */ 1766, 1766, 1766, 1766, 1766, 1766, 2172, 1766, 2191, 2208, + /* 2580 */ 1766, 1766, 360, 2174, 702, 2176, 2177, 697, 1766, 692, + /* 2590 */ 2141, 1766, 698, 1766, 1766, 1766, 1766, 2172, 1766, 1766, + /* 2600 */ 2208, 2173, 1766, 356, 2174, 702, 2176, 2177, 697, 1766, + /* 2610 */ 692, 699, 1766, 1766, 1766, 1766, 1766, 1766, 2173, 1766, + /* 2620 */ 1766, 1766, 1766, 1766, 2172, 1766, 1766, 2208, 699, 1766, + /* 2630 */ 361, 2174, 702, 2176, 2177, 697, 1766, 692, 1766, 2191, + /* 2640 */ 1766, 1766, 1766, 1766, 1766, 1766, 1766, 1766, 1766, 1766, + /* 2650 */ 1766, 2141, 1766, 698, 1766, 1766, 2191, 1766, 1766, 1766, + /* 2660 */ 1766, 1766, 1766, 1766, 1766, 1766, 1766, 1766, 2141, 1766, + /* 2670 */ 698, 1766, 1766, 1766, 1766, 1766, 1766, 1766, 1766, 1766, + /* 2680 */ 1766, 1766, 1766, 1766, 1766, 700, 1766, 1766, 2208, 1766, + /* 2690 */ 1766, 335, 2174, 702, 2176, 2177, 697, 1766, 692, 1766, + /* 2700 */ 1766, 1766, 2172, 1766, 1766, 2208, 1766, 1766, 334, 2174, + /* 2710 */ 702, 2176, 2177, 697, 1766, 692, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 339, 408, 365, 391, 387, 412, 439, 390, 391, 442, - /* 10 */ 349, 348, 12, 13, 14, 0, 379, 344, 406, 407, - /* 20 */ 20, 348, 22, 350, 8, 9, 389, 349, 12, 13, - /* 30 */ 14, 15, 16, 33, 0, 35, 21, 20, 377, 24, - /* 40 */ 25, 26, 27, 28, 29, 30, 31, 32, 455, 20, - /* 50 */ 389, 458, 391, 8, 9, 377, 393, 12, 13, 14, - /* 60 */ 15, 16, 62, 426, 427, 44, 473, 474, 68, 20, - /* 70 */ 391, 478, 479, 436, 20, 75, 12, 13, 14, 15, - /* 80 */ 16, 338, 403, 340, 423, 406, 407, 426, 20, 44, - /* 90 */ 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - /* 100 */ 100, 4, 0, 103, 70, 71, 72, 73, 74, 431, - /* 110 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - /* 120 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - /* 130 */ 96, 373, 103, 343, 428, 100, 346, 347, 21, 139, - /* 140 */ 140, 24, 25, 26, 27, 28, 29, 30, 31, 32, - /* 150 */ 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - /* 160 */ 454, 126, 127, 128, 129, 130, 131, 444, 445, 169, - /* 170 */ 170, 455, 377, 377, 458, 175, 176, 62, 420, 103, - /* 180 */ 384, 336, 20, 348, 349, 0, 169, 170, 392, 189, - /* 190 */ 474, 191, 397, 398, 478, 479, 67, 181, 8, 9, - /* 200 */ 103, 20, 12, 13, 14, 15, 16, 139, 140, 24, - /* 210 */ 25, 26, 27, 28, 29, 30, 31, 32, 103, 20, - /* 220 */ 105, 221, 222, 377, 224, 225, 226, 227, 228, 229, + /* 0 */ 340, 359, 456, 445, 446, 459, 339, 409, 341, 367, + /* 10 */ 350, 413, 12, 13, 14, 379, 378, 3, 366, 340, + /* 20 */ 20, 475, 22, 8, 9, 479, 480, 12, 13, 14, + /* 30 */ 15, 16, 380, 33, 20, 35, 398, 399, 378, 8, + /* 40 */ 9, 349, 390, 12, 13, 14, 15, 16, 370, 409, + /* 50 */ 390, 20, 392, 20, 456, 344, 378, 459, 347, 348, + /* 60 */ 340, 345, 62, 385, 386, 349, 378, 351, 68, 390, + /* 70 */ 350, 393, 474, 475, 386, 75, 377, 479, 480, 427, + /* 80 */ 428, 374, 456, 68, 424, 459, 394, 427, 389, 437, + /* 90 */ 430, 431, 432, 433, 434, 435, 456, 437, 378, 459, + /* 100 */ 100, 475, 442, 103, 444, 479, 480, 345, 448, 449, + /* 110 */ 390, 349, 392, 351, 474, 475, 12, 13, 104, 479, + /* 120 */ 480, 461, 349, 350, 20, 340, 22, 112, 421, 469, + /* 130 */ 12, 13, 14, 15, 16, 349, 20, 33, 62, 35, + /* 140 */ 140, 141, 369, 392, 424, 349, 350, 427, 35, 376, + /* 150 */ 430, 431, 432, 433, 434, 435, 0, 437, 407, 408, + /* 160 */ 440, 20, 442, 443, 444, 369, 62, 349, 448, 449, + /* 170 */ 170, 171, 68, 140, 141, 390, 176, 177, 102, 75, + /* 180 */ 0, 105, 349, 350, 169, 0, 172, 401, 75, 403, + /* 190 */ 190, 21, 192, 20, 24, 25, 26, 27, 28, 29, + /* 200 */ 30, 31, 32, 172, 100, 349, 21, 103, 340, 24, + /* 210 */ 25, 26, 27, 28, 29, 30, 31, 32, 350, 401, + /* 220 */ 352, 403, 222, 223, 0, 225, 226, 227, 228, 229, /* 230 */ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - /* 240 */ 240, 241, 12, 13, 398, 339, 20, 18, 22, 20, - /* 250 */ 20, 455, 22, 408, 458, 349, 27, 412, 68, 30, - /* 260 */ 369, 35, 33, 33, 188, 35, 190, 103, 377, 473, - /* 270 */ 474, 12, 13, 369, 478, 479, 385, 20, 49, 53, - /* 280 */ 51, 377, 20, 377, 20, 56, 451, 452, 453, 385, - /* 290 */ 455, 456, 62, 458, 35, 389, 220, 391, 68, 283, - /* 300 */ 455, 280, 112, 458, 49, 75, 39, 343, 473, 474, - /* 310 */ 346, 347, 57, 478, 479, 60, 61, 215, 473, 474, - /* 320 */ 390, 391, 455, 478, 479, 458, 14, 15, 16, 423, - /* 330 */ 100, 102, 426, 103, 258, 429, 430, 431, 432, 433, - /* 340 */ 434, 474, 436, 114, 377, 478, 479, 441, 242, 443, - /* 350 */ 244, 384, 171, 447, 448, 258, 8, 9, 168, 392, - /* 360 */ 12, 13, 14, 15, 16, 103, 460, 103, 20, 139, - /* 370 */ 140, 4, 143, 258, 468, 146, 147, 148, 149, 150, - /* 380 */ 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - /* 390 */ 161, 162, 14, 164, 165, 166, 139, 140, 20, 169, - /* 400 */ 170, 348, 349, 348, 349, 175, 176, 70, 71, 72, - /* 410 */ 43, 22, 45, 46, 77, 78, 79, 37, 84, 189, - /* 420 */ 83, 191, 258, 368, 35, 88, 89, 90, 91, 67, - /* 430 */ 375, 94, 175, 176, 21, 245, 246, 247, 248, 249, - /* 440 */ 250, 251, 252, 253, 254, 255, 0, 34, 103, 36, - /* 450 */ 191, 221, 222, 20, 224, 225, 226, 227, 228, 229, - /* 460 */ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - /* 470 */ 240, 241, 242, 12, 13, 348, 349, 377, 144, 145, - /* 480 */ 174, 20, 386, 22, 384, 389, 106, 348, 108, 109, - /* 490 */ 339, 111, 392, 339, 33, 368, 35, 221, 348, 349, - /* 500 */ 349, 167, 375, 450, 451, 452, 453, 344, 455, 456, - /* 510 */ 3, 348, 132, 350, 455, 339, 136, 458, 368, 171, - /* 520 */ 258, 0, 258, 62, 257, 349, 408, 20, 377, 68, - /* 530 */ 54, 55, 473, 474, 348, 349, 75, 478, 479, 400, - /* 540 */ 389, 402, 391, 389, 268, 269, 270, 271, 272, 273, - /* 550 */ 274, 8, 9, 377, 368, 12, 13, 14, 15, 16, - /* 560 */ 357, 100, 134, 376, 103, 389, 138, 391, 0, 263, - /* 570 */ 264, 265, 357, 455, 423, 388, 458, 426, 339, 114, - /* 580 */ 429, 430, 431, 432, 433, 434, 383, 436, 67, 374, - /* 590 */ 348, 473, 474, 242, 348, 349, 478, 479, 383, 423, - /* 600 */ 139, 140, 426, 258, 158, 429, 430, 431, 432, 433, - /* 610 */ 434, 104, 436, 167, 368, 439, 355, 441, 442, 443, - /* 620 */ 469, 470, 339, 447, 448, 339, 198, 348, 389, 201, - /* 630 */ 169, 170, 204, 372, 206, 349, 175, 176, 70, 71, - /* 640 */ 72, 380, 400, 184, 402, 77, 78, 79, 353, 354, - /* 650 */ 189, 83, 191, 348, 349, 75, 88, 89, 90, 91, - /* 660 */ 8, 9, 94, 377, 12, 13, 14, 15, 16, 377, - /* 670 */ 211, 212, 389, 368, 47, 389, 384, 391, 171, 400, - /* 680 */ 168, 402, 221, 222, 392, 224, 225, 226, 227, 228, - /* 690 */ 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - /* 700 */ 239, 240, 241, 12, 13, 14, 440, 75, 442, 423, - /* 710 */ 133, 20, 426, 22, 171, 429, 430, 431, 432, 433, - /* 720 */ 434, 377, 436, 369, 33, 339, 35, 441, 384, 443, - /* 730 */ 103, 377, 22, 447, 448, 349, 392, 351, 384, 385, - /* 740 */ 4, 0, 20, 8, 9, 35, 392, 12, 13, 14, - /* 750 */ 15, 16, 369, 62, 468, 19, 104, 245, 348, 349, - /* 760 */ 377, 339, 358, 377, 348, 349, 75, 255, 385, 33, - /* 770 */ 366, 349, 114, 351, 35, 389, 2, 391, 368, 202, - /* 780 */ 203, 378, 8, 9, 368, 49, 12, 13, 14, 15, - /* 790 */ 16, 100, 56, 440, 103, 442, 339, 339, 62, 377, - /* 800 */ 132, 133, 134, 135, 136, 137, 138, 349, 22, 423, - /* 810 */ 100, 389, 426, 391, 75, 429, 430, 431, 432, 433, - /* 820 */ 434, 35, 436, 348, 349, 353, 354, 441, 0, 443, - /* 830 */ 139, 140, 377, 447, 448, 377, 362, 363, 102, 104, - /* 840 */ 385, 105, 13, 368, 377, 423, 389, 389, 426, 391, - /* 850 */ 339, 429, 430, 431, 432, 433, 434, 428, 436, 392, - /* 860 */ 169, 170, 14, 441, 35, 443, 175, 176, 20, 447, - /* 870 */ 448, 1, 2, 132, 133, 134, 135, 136, 137, 138, - /* 880 */ 189, 423, 191, 454, 426, 339, 100, 429, 430, 431, - /* 890 */ 432, 433, 434, 171, 436, 348, 349, 2, 339, 441, - /* 900 */ 389, 443, 339, 8, 9, 447, 448, 12, 13, 14, - /* 910 */ 15, 16, 221, 222, 378, 224, 225, 226, 227, 228, - /* 920 */ 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - /* 930 */ 239, 240, 241, 12, 13, 389, 20, 44, 22, 339, - /* 940 */ 22, 20, 349, 22, 339, 408, 348, 349, 389, 349, - /* 950 */ 3, 351, 389, 35, 33, 339, 35, 339, 348, 349, - /* 960 */ 132, 133, 134, 135, 136, 137, 138, 133, 134, 53, - /* 970 */ 348, 349, 138, 386, 104, 339, 389, 377, 368, 62, - /* 980 */ 4, 348, 349, 62, 355, 349, 428, 351, 395, 389, - /* 990 */ 368, 391, 455, 75, 389, 458, 75, 104, 451, 452, - /* 1000 */ 453, 368, 455, 456, 378, 389, 339, 389, 339, 380, - /* 1010 */ 473, 474, 454, 377, 14, 478, 479, 169, 100, 102, - /* 1020 */ 20, 100, 105, 423, 103, 389, 426, 391, 408, 429, - /* 1030 */ 430, 431, 432, 433, 434, 339, 436, 348, 349, 362, - /* 1040 */ 363, 441, 339, 443, 42, 349, 44, 447, 448, 451, - /* 1050 */ 452, 453, 20, 455, 456, 339, 389, 368, 389, 423, - /* 1060 */ 139, 140, 426, 45, 46, 429, 430, 431, 432, 433, - /* 1070 */ 434, 386, 436, 377, 389, 455, 14, 441, 458, 443, - /* 1080 */ 348, 349, 20, 447, 448, 389, 339, 391, 348, 349, - /* 1090 */ 169, 170, 389, 473, 474, 0, 175, 176, 478, 479, - /* 1100 */ 368, 348, 349, 348, 349, 389, 20, 189, 368, 191, - /* 1110 */ 189, 44, 191, 348, 349, 339, 339, 365, 413, 423, - /* 1120 */ 339, 368, 426, 368, 378, 429, 430, 431, 432, 433, - /* 1130 */ 434, 379, 436, 368, 349, 408, 389, 349, 378, 221, - /* 1140 */ 222, 389, 221, 222, 49, 224, 225, 226, 227, 228, - /* 1150 */ 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - /* 1160 */ 239, 240, 241, 12, 13, 389, 389, 348, 349, 339, - /* 1170 */ 389, 20, 42, 22, 44, 365, 480, 481, 426, 349, - /* 1180 */ 395, 351, 455, 395, 33, 458, 35, 368, 436, 379, - /* 1190 */ 8, 9, 339, 0, 12, 13, 14, 15, 16, 389, - /* 1200 */ 473, 474, 349, 171, 351, 478, 479, 377, 370, 348, - /* 1210 */ 349, 373, 132, 62, 364, 44, 136, 367, 114, 389, - /* 1220 */ 44, 391, 256, 257, 107, 278, 75, 110, 13, 368, - /* 1230 */ 377, 169, 205, 44, 207, 259, 426, 44, 107, 44, - /* 1240 */ 107, 110, 389, 110, 391, 107, 436, 0, 110, 68, - /* 1250 */ 35, 100, 0, 423, 103, 169, 426, 44, 44, 429, - /* 1260 */ 430, 431, 432, 433, 434, 62, 436, 163, 378, 22, - /* 1270 */ 0, 441, 35, 443, 22, 104, 423, 447, 448, 426, - /* 1280 */ 104, 48, 429, 430, 431, 432, 433, 434, 44, 436, - /* 1290 */ 139, 140, 22, 104, 441, 366, 443, 139, 140, 104, - /* 1300 */ 447, 448, 44, 44, 44, 44, 1, 2, 105, 18, - /* 1310 */ 44, 44, 103, 35, 23, 378, 471, 104, 104, 35, - /* 1320 */ 169, 170, 113, 13, 0, 13, 175, 176, 37, 38, - /* 1330 */ 340, 399, 41, 44, 482, 352, 465, 44, 44, 44, - /* 1340 */ 189, 44, 191, 52, 365, 35, 44, 35, 104, 282, - /* 1350 */ 365, 377, 399, 352, 63, 64, 65, 66, 347, 75, - /* 1360 */ 388, 349, 104, 104, 104, 104, 399, 457, 449, 475, - /* 1370 */ 104, 104, 221, 222, 50, 224, 225, 226, 227, 228, - /* 1380 */ 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - /* 1390 */ 239, 240, 241, 104, 103, 12, 13, 104, 104, 104, - /* 1400 */ 459, 104, 221, 260, 171, 22, 104, 425, 49, 20, - /* 1410 */ 424, 417, 204, 422, 357, 417, 33, 33, 35, 187, - /* 1420 */ 357, 42, 396, 410, 20, 396, 20, 399, 191, 394, - /* 1430 */ 339, 168, 141, 49, 396, 348, 348, 394, 394, 101, - /* 1440 */ 349, 57, 58, 59, 60, 62, 62, 99, 348, 98, - /* 1450 */ 361, 348, 360, 359, 348, 348, 20, 341, 75, 48, - /* 1460 */ 345, 341, 417, 345, 20, 357, 391, 357, 377, 191, - /* 1470 */ 20, 350, 181, 182, 183, 20, 357, 186, 409, 350, - /* 1480 */ 389, 357, 391, 100, 357, 357, 102, 348, 341, 105, - /* 1490 */ 199, 200, 339, 357, 348, 208, 341, 421, 389, 377, - /* 1500 */ 377, 210, 349, 377, 213, 103, 195, 216, 217, 218, - /* 1510 */ 219, 220, 377, 416, 423, 419, 417, 426, 377, 377, - /* 1520 */ 429, 430, 431, 432, 433, 434, 377, 436, 355, 377, - /* 1530 */ 377, 377, 441, 377, 443, 194, 377, 389, 447, 448, - /* 1540 */ 415, 391, 389, 355, 391, 193, 389, 348, 414, 258, - /* 1550 */ 267, 389, 266, 389, 464, 275, 172, 173, 389, 339, - /* 1560 */ 399, 177, 399, 179, 404, 464, 389, 180, 466, 349, - /* 1570 */ 404, 281, 189, 277, 191, 463, 423, 464, 467, 426, - /* 1580 */ 276, 197, 429, 430, 431, 432, 433, 434, 261, 436, - /* 1590 */ 425, 284, 279, 461, 441, 349, 443, 377, 20, 462, - /* 1600 */ 447, 448, 257, 428, 221, 222, 350, 20, 355, 389, - /* 1610 */ 348, 391, 355, 402, 404, 389, 476, 234, 235, 236, - /* 1620 */ 237, 238, 239, 240, 339, 389, 404, 483, 389, 389, - /* 1630 */ 389, 389, 173, 103, 349, 401, 355, 373, 446, 103, - /* 1640 */ 389, 36, 367, 423, 477, 418, 426, 355, 349, 429, - /* 1650 */ 430, 431, 432, 433, 434, 381, 436, 348, 355, 342, - /* 1660 */ 339, 341, 377, 443, 356, 411, 337, 447, 448, 371, - /* 1670 */ 349, 371, 371, 405, 389, 0, 391, 405, 0, 0, - /* 1680 */ 42, 0, 35, 214, 35, 35, 35, 214, 0, 35, - /* 1690 */ 35, 214, 0, 214, 0, 35, 339, 35, 377, 0, - /* 1700 */ 0, 209, 22, 0, 197, 0, 349, 197, 423, 198, - /* 1710 */ 389, 426, 391, 191, 429, 430, 431, 432, 433, 434, - /* 1720 */ 339, 436, 189, 0, 0, 0, 185, 184, 443, 0, - /* 1730 */ 349, 0, 447, 448, 377, 0, 47, 0, 0, 0, - /* 1740 */ 42, 0, 0, 0, 423, 0, 389, 426, 391, 0, - /* 1750 */ 429, 430, 431, 432, 433, 434, 0, 436, 377, 0, - /* 1760 */ 158, 35, 0, 0, 443, 158, 0, 0, 447, 448, - /* 1770 */ 389, 0, 391, 0, 0, 0, 0, 0, 0, 0, - /* 1780 */ 423, 0, 0, 426, 0, 339, 429, 430, 431, 432, - /* 1790 */ 433, 434, 0, 436, 0, 349, 42, 0, 0, 0, - /* 1800 */ 443, 0, 0, 0, 423, 448, 0, 426, 0, 22, - /* 1810 */ 429, 430, 431, 432, 433, 434, 0, 436, 142, 0, - /* 1820 */ 0, 0, 22, 377, 35, 0, 22, 62, 382, 0, - /* 1830 */ 62, 48, 62, 48, 0, 389, 0, 391, 0, 49, - /* 1840 */ 49, 0, 35, 0, 49, 35, 0, 339, 39, 35, - /* 1850 */ 39, 470, 39, 35, 42, 0, 39, 349, 14, 44, - /* 1860 */ 0, 0, 40, 339, 0, 39, 180, 39, 0, 423, - /* 1870 */ 47, 47, 426, 349, 47, 429, 430, 431, 432, 433, - /* 1880 */ 434, 0, 436, 0, 0, 377, 0, 35, 49, 39, - /* 1890 */ 382, 35, 39, 0, 49, 0, 49, 389, 0, 391, - /* 1900 */ 69, 377, 35, 49, 39, 35, 0, 0, 39, 0, - /* 1910 */ 0, 0, 0, 389, 339, 391, 22, 35, 0, 44, - /* 1920 */ 35, 44, 35, 35, 349, 35, 22, 35, 0, 51, - /* 1930 */ 0, 423, 35, 0, 426, 35, 339, 429, 430, 431, - /* 1940 */ 432, 433, 434, 35, 436, 112, 349, 423, 35, 35, - /* 1950 */ 426, 22, 377, 429, 430, 431, 432, 433, 434, 110, - /* 1960 */ 436, 35, 22, 22, 389, 0, 391, 35, 0, 35, - /* 1970 */ 0, 22, 20, 35, 377, 104, 103, 35, 35, 382, - /* 1980 */ 0, 35, 103, 22, 196, 0, 389, 3, 391, 22, - /* 1990 */ 0, 0, 44, 104, 262, 48, 472, 44, 423, 103, - /* 2000 */ 339, 426, 103, 1, 429, 430, 431, 432, 433, 434, - /* 2010 */ 349, 436, 48, 171, 262, 178, 101, 44, 99, 171, - /* 2020 */ 423, 19, 192, 426, 173, 104, 429, 430, 431, 432, - /* 2030 */ 433, 434, 44, 436, 171, 33, 339, 44, 377, 104, - /* 2040 */ 103, 47, 47, 3, 44, 35, 349, 103, 103, 35, - /* 2050 */ 389, 49, 391, 35, 104, 104, 481, 103, 339, 57, - /* 2060 */ 58, 59, 60, 104, 62, 35, 35, 35, 349, 47, - /* 2070 */ 104, 44, 47, 104, 377, 103, 39, 103, 103, 382, - /* 2080 */ 0, 0, 0, 0, 423, 47, 389, 426, 391, 103, - /* 2090 */ 429, 430, 431, 432, 433, 434, 377, 436, 174, 438, - /* 2100 */ 104, 382, 262, 104, 102, 0, 103, 105, 389, 39, - /* 2110 */ 391, 103, 47, 256, 113, 44, 101, 101, 2, 243, - /* 2120 */ 423, 22, 221, 426, 103, 339, 429, 430, 431, 432, - /* 2130 */ 433, 434, 172, 436, 47, 349, 47, 104, 103, 137, - /* 2140 */ 104, 22, 423, 104, 339, 426, 103, 103, 429, 430, - /* 2150 */ 431, 432, 433, 434, 349, 436, 103, 35, 104, 223, - /* 2160 */ 103, 114, 104, 377, 35, 103, 35, 104, 104, 103, - /* 2170 */ 35, 103, 35, 104, 172, 389, 103, 391, 104, 177, - /* 2180 */ 35, 103, 377, 44, 125, 125, 125, 103, 103, 35, - /* 2190 */ 22, 103, 125, 69, 389, 68, 391, 35, 35, 197, - /* 2200 */ 35, 35, 35, 75, 35, 35, 35, 97, 44, 423, - /* 2210 */ 22, 35, 426, 339, 35, 429, 430, 431, 432, 433, - /* 2220 */ 434, 35, 436, 349, 35, 35, 35, 75, 423, 35, - /* 2230 */ 339, 426, 35, 35, 429, 430, 431, 432, 433, 434, - /* 2240 */ 349, 436, 35, 35, 22, 35, 0, 35, 49, 0, - /* 2250 */ 39, 377, 35, 49, 39, 0, 35, 39, 49, 0, - /* 2260 */ 35, 0, 49, 389, 35, 391, 39, 35, 377, 0, - /* 2270 */ 22, 21, 484, 22, 22, 21, 20, 484, 339, 484, - /* 2280 */ 389, 484, 391, 484, 484, 484, 484, 484, 349, 484, - /* 2290 */ 484, 484, 484, 484, 484, 484, 484, 423, 484, 484, - /* 2300 */ 426, 484, 484, 429, 430, 431, 432, 433, 434, 484, - /* 2310 */ 436, 484, 484, 484, 423, 484, 377, 426, 484, 484, - /* 2320 */ 429, 430, 431, 432, 433, 434, 339, 436, 389, 484, - /* 2330 */ 391, 484, 484, 484, 484, 484, 349, 484, 484, 484, - /* 2340 */ 484, 484, 484, 339, 484, 484, 484, 484, 484, 484, - /* 2350 */ 484, 484, 484, 349, 484, 484, 484, 484, 484, 484, - /* 2360 */ 484, 484, 423, 484, 377, 426, 484, 484, 429, 430, - /* 2370 */ 431, 432, 433, 434, 484, 436, 389, 484, 391, 484, - /* 2380 */ 484, 377, 484, 484, 484, 484, 484, 484, 484, 484, - /* 2390 */ 484, 339, 484, 389, 484, 391, 484, 484, 484, 484, - /* 2400 */ 484, 349, 484, 484, 484, 484, 484, 484, 484, 484, - /* 2410 */ 423, 484, 484, 426, 339, 484, 429, 430, 431, 432, - /* 2420 */ 433, 434, 484, 436, 349, 484, 484, 423, 484, 377, - /* 2430 */ 426, 484, 484, 429, 430, 431, 432, 433, 434, 339, - /* 2440 */ 436, 389, 484, 391, 484, 484, 484, 484, 484, 349, - /* 2450 */ 484, 484, 377, 484, 484, 484, 484, 484, 484, 484, - /* 2460 */ 484, 484, 484, 484, 389, 484, 391, 484, 484, 484, - /* 2470 */ 484, 484, 484, 484, 484, 423, 484, 377, 426, 484, - /* 2480 */ 484, 429, 430, 431, 432, 433, 434, 484, 436, 389, - /* 2490 */ 339, 391, 484, 484, 484, 484, 484, 484, 423, 484, - /* 2500 */ 349, 426, 484, 484, 429, 430, 431, 432, 433, 434, - /* 2510 */ 484, 436, 484, 484, 339, 484, 484, 484, 484, 484, - /* 2520 */ 484, 484, 484, 423, 349, 484, 426, 484, 377, 429, - /* 2530 */ 430, 431, 432, 433, 434, 484, 436, 484, 484, 484, - /* 2540 */ 389, 484, 391, 484, 484, 484, 484, 484, 484, 484, - /* 2550 */ 484, 484, 377, 484, 484, 484, 484, 484, 484, 484, - /* 2560 */ 484, 484, 339, 484, 389, 484, 391, 484, 484, 484, - /* 2570 */ 484, 484, 349, 484, 423, 484, 484, 426, 339, 484, - /* 2580 */ 429, 430, 431, 432, 433, 434, 484, 436, 349, 484, - /* 2590 */ 484, 484, 484, 484, 484, 484, 484, 484, 423, 484, - /* 2600 */ 377, 426, 484, 484, 429, 430, 431, 432, 433, 434, - /* 2610 */ 484, 436, 389, 484, 391, 484, 377, 484, 484, 484, - /* 2620 */ 484, 484, 484, 484, 484, 484, 484, 484, 389, 484, - /* 2630 */ 391, 484, 484, 484, 484, 484, 484, 484, 484, 484, - /* 2640 */ 339, 484, 484, 484, 484, 484, 423, 484, 484, 426, - /* 2650 */ 349, 484, 429, 430, 431, 432, 433, 434, 484, 436, - /* 2660 */ 484, 484, 423, 484, 339, 426, 484, 484, 429, 430, - /* 2670 */ 431, 432, 433, 434, 349, 436, 484, 484, 377, 484, - /* 2680 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, - /* 2690 */ 389, 484, 391, 484, 484, 484, 484, 484, 484, 484, - /* 2700 */ 484, 484, 377, 484, 484, 484, 484, 484, 484, 484, - /* 2710 */ 484, 484, 339, 484, 389, 484, 391, 484, 484, 484, - /* 2720 */ 484, 484, 349, 484, 423, 484, 484, 426, 484, 484, - /* 2730 */ 429, 430, 431, 432, 433, 434, 484, 436, 484, 484, - /* 2740 */ 484, 484, 484, 484, 484, 484, 484, 484, 423, 484, - /* 2750 */ 377, 426, 484, 484, 429, 430, 431, 432, 433, 434, - /* 2760 */ 339, 436, 389, 484, 391, 484, 484, 484, 484, 484, - /* 2770 */ 349, 484, 484, 484, 484, 339, 484, 484, 484, 484, - /* 2780 */ 484, 484, 484, 484, 484, 349, 484, 484, 484, 484, - /* 2790 */ 484, 484, 484, 484, 484, 484, 423, 484, 377, 426, - /* 2800 */ 484, 484, 429, 430, 431, 432, 433, 434, 484, 436, - /* 2810 */ 389, 484, 391, 377, 484, 484, 484, 484, 484, 484, - /* 2820 */ 484, 484, 484, 339, 484, 389, 484, 391, 484, 484, - /* 2830 */ 484, 484, 484, 349, 484, 484, 484, 484, 339, 484, - /* 2840 */ 484, 484, 484, 484, 423, 484, 484, 426, 349, 484, - /* 2850 */ 429, 430, 431, 432, 433, 434, 484, 436, 484, 423, - /* 2860 */ 484, 377, 426, 484, 484, 429, 430, 431, 432, 433, - /* 2870 */ 434, 339, 436, 389, 484, 391, 377, 484, 484, 484, - /* 2880 */ 484, 349, 484, 484, 484, 484, 484, 484, 389, 484, - /* 2890 */ 391, 484, 484, 484, 484, 484, 484, 484, 484, 484, - /* 2900 */ 484, 484, 484, 484, 484, 484, 484, 423, 484, 377, - /* 2910 */ 426, 484, 484, 429, 430, 431, 432, 433, 434, 484, - /* 2920 */ 436, 389, 423, 391, 484, 426, 484, 484, 429, 430, - /* 2930 */ 431, 432, 433, 434, 484, 436, 484, 484, 484, 484, - /* 2940 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, - /* 2950 */ 484, 484, 484, 484, 484, 423, 484, 484, 426, 484, - /* 2960 */ 484, 429, 430, 431, 432, 433, 434, 484, 436, 336, - /* 2970 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 2980 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 2990 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3000 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3010 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3020 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3030 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3040 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3050 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3060 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3070 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3080 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3090 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3100 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3110 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3120 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3130 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3140 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3150 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3160 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3170 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3180 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3190 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3200 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3210 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3220 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3230 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3240 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3250 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3260 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3270 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3280 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3290 */ 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - /* 3300 */ 336, 336, 336, 336, 336, + /* 240 */ 240, 241, 242, 20, 140, 141, 378, 67, 24, 25, + /* 250 */ 26, 27, 28, 29, 30, 31, 32, 401, 390, 403, + /* 260 */ 392, 246, 247, 248, 249, 250, 251, 252, 253, 254, + /* 270 */ 255, 256, 67, 340, 170, 171, 103, 349, 350, 4, + /* 280 */ 176, 177, 39, 350, 451, 452, 453, 454, 172, 456, + /* 290 */ 457, 20, 424, 22, 190, 427, 192, 369, 430, 431, + /* 300 */ 432, 433, 434, 435, 376, 437, 35, 14, 349, 350, + /* 310 */ 442, 378, 444, 20, 8, 9, 448, 449, 12, 13, + /* 320 */ 14, 15, 16, 390, 53, 392, 222, 223, 369, 225, + /* 330 */ 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + /* 340 */ 236, 237, 238, 239, 240, 241, 242, 243, 12, 13, + /* 350 */ 20, 340, 22, 12, 13, 3, 20, 424, 22, 429, + /* 360 */ 427, 350, 0, 430, 431, 432, 433, 434, 435, 33, + /* 370 */ 437, 35, 216, 378, 378, 442, 35, 444, 103, 350, + /* 380 */ 385, 448, 449, 53, 392, 455, 8, 9, 393, 378, + /* 390 */ 12, 13, 14, 15, 16, 399, 404, 100, 62, 407, + /* 400 */ 408, 390, 469, 392, 68, 344, 44, 378, 347, 348, + /* 410 */ 104, 75, 115, 116, 117, 118, 119, 120, 121, 122, + /* 420 */ 123, 124, 44, 126, 127, 128, 129, 130, 131, 132, + /* 430 */ 20, 14, 259, 20, 356, 424, 100, 20, 427, 103, + /* 440 */ 356, 430, 431, 432, 433, 434, 435, 436, 437, 438, + /* 450 */ 439, 373, 12, 13, 14, 358, 175, 2, 33, 381, + /* 460 */ 20, 432, 22, 8, 9, 381, 20, 12, 13, 14, + /* 470 */ 15, 16, 375, 33, 49, 35, 140, 141, 20, 349, + /* 480 */ 350, 384, 57, 58, 59, 60, 350, 62, 62, 370, + /* 490 */ 133, 134, 135, 136, 137, 138, 139, 378, 340, 369, + /* 500 */ 4, 258, 62, 20, 222, 386, 170, 171, 350, 243, + /* 510 */ 352, 245, 176, 177, 350, 75, 8, 9, 349, 350, + /* 520 */ 12, 13, 14, 15, 16, 20, 190, 102, 192, 103, + /* 530 */ 105, 105, 396, 192, 259, 84, 378, 20, 369, 43, + /* 540 */ 100, 45, 46, 103, 340, 264, 265, 266, 390, 103, + /* 550 */ 392, 269, 270, 271, 272, 273, 274, 275, 222, 223, + /* 560 */ 396, 225, 226, 227, 228, 229, 230, 231, 232, 233, + /* 570 */ 234, 235, 236, 237, 238, 239, 240, 241, 242, 103, + /* 580 */ 140, 141, 424, 170, 171, 427, 103, 170, 430, 431, + /* 590 */ 432, 433, 434, 435, 390, 437, 145, 146, 173, 174, + /* 600 */ 442, 49, 444, 178, 67, 180, 448, 449, 340, 57, + /* 610 */ 170, 171, 60, 61, 349, 350, 176, 177, 350, 168, + /* 620 */ 352, 349, 350, 198, 114, 366, 103, 103, 134, 135, + /* 630 */ 190, 279, 192, 139, 369, 70, 71, 72, 441, 380, + /* 640 */ 443, 369, 77, 78, 79, 0, 378, 340, 83, 390, + /* 650 */ 349, 350, 35, 88, 89, 90, 91, 0, 390, 94, + /* 660 */ 392, 409, 222, 223, 20, 225, 226, 227, 228, 229, + /* 670 */ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + /* 680 */ 240, 241, 242, 12, 13, 259, 427, 349, 350, 172, + /* 690 */ 182, 20, 424, 22, 49, 427, 437, 390, 430, 431, + /* 700 */ 432, 433, 434, 435, 33, 437, 35, 369, 456, 340, + /* 710 */ 442, 459, 444, 189, 370, 191, 448, 449, 0, 350, + /* 720 */ 388, 4, 378, 391, 392, 429, 474, 475, 349, 350, + /* 730 */ 386, 479, 480, 62, 14, 259, 19, 391, 392, 340, + /* 740 */ 20, 185, 259, 349, 350, 221, 75, 378, 369, 350, + /* 750 */ 33, 455, 21, 452, 453, 454, 243, 456, 457, 390, + /* 760 */ 459, 392, 370, 369, 429, 34, 49, 36, 212, 213, + /* 770 */ 378, 100, 75, 56, 103, 474, 475, 378, 386, 62, + /* 780 */ 479, 480, 259, 259, 140, 141, 75, 12, 13, 390, + /* 790 */ 455, 392, 284, 424, 22, 20, 427, 22, 134, 430, + /* 800 */ 431, 432, 433, 434, 435, 169, 437, 35, 33, 192, + /* 810 */ 35, 140, 141, 444, 349, 350, 159, 448, 449, 102, + /* 820 */ 176, 177, 105, 424, 0, 168, 427, 114, 378, 430, + /* 830 */ 431, 432, 433, 434, 435, 385, 437, 62, 340, 340, + /* 840 */ 14, 170, 171, 393, 349, 350, 20, 176, 177, 350, + /* 850 */ 75, 133, 134, 135, 136, 137, 138, 139, 22, 378, + /* 860 */ 441, 190, 443, 192, 369, 44, 385, 203, 204, 470, + /* 870 */ 471, 35, 100, 2, 393, 100, 379, 378, 103, 8, + /* 880 */ 9, 379, 246, 12, 13, 14, 15, 16, 390, 390, + /* 890 */ 170, 392, 256, 222, 223, 379, 225, 226, 227, 228, + /* 900 */ 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + /* 910 */ 239, 240, 241, 242, 340, 140, 141, 452, 453, 454, + /* 920 */ 337, 456, 457, 424, 340, 104, 427, 340, 340, 430, + /* 930 */ 431, 432, 433, 434, 435, 18, 437, 20, 14, 15, + /* 940 */ 16, 378, 414, 340, 27, 170, 171, 30, 385, 340, + /* 950 */ 33, 176, 177, 350, 378, 352, 393, 133, 134, 135, + /* 960 */ 136, 137, 138, 139, 390, 190, 49, 192, 51, 393, + /* 970 */ 471, 349, 350, 56, 390, 22, 22, 390, 390, 8, + /* 980 */ 9, 378, 340, 12, 13, 14, 15, 16, 35, 35, + /* 990 */ 20, 369, 409, 390, 340, 392, 413, 222, 223, 390, + /* 1000 */ 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + /* 1010 */ 235, 236, 237, 238, 239, 240, 241, 242, 0, 102, + /* 1020 */ 20, 349, 350, 349, 350, 363, 364, 424, 75, 379, + /* 1030 */ 427, 114, 390, 430, 431, 432, 433, 434, 435, 456, + /* 1040 */ 437, 369, 459, 340, 390, 442, 133, 444, 54, 55, + /* 1050 */ 137, 448, 449, 100, 100, 354, 355, 474, 475, 354, + /* 1060 */ 355, 144, 479, 480, 147, 148, 149, 150, 151, 152, + /* 1070 */ 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + /* 1080 */ 163, 44, 165, 166, 167, 363, 364, 340, 70, 71, + /* 1090 */ 72, 73, 74, 390, 76, 77, 78, 79, 80, 81, + /* 1100 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + /* 1110 */ 92, 93, 94, 95, 96, 18, 349, 350, 409, 340, + /* 1120 */ 23, 340, 340, 12, 13, 379, 452, 453, 454, 340, + /* 1130 */ 456, 457, 37, 22, 37, 38, 369, 390, 41, 350, + /* 1140 */ 379, 352, 172, 190, 33, 192, 35, 8, 9, 52, + /* 1150 */ 4, 12, 13, 14, 15, 16, 350, 340, 349, 350, + /* 1160 */ 63, 64, 65, 66, 42, 456, 44, 378, 459, 390, + /* 1170 */ 170, 390, 390, 62, 44, 222, 223, 340, 369, 390, + /* 1180 */ 340, 392, 62, 474, 475, 366, 75, 350, 479, 480, + /* 1190 */ 8, 9, 1, 2, 12, 13, 14, 15, 16, 380, + /* 1200 */ 103, 106, 396, 108, 109, 114, 111, 390, 358, 390, + /* 1210 */ 68, 100, 409, 424, 440, 378, 427, 443, 367, 430, + /* 1220 */ 431, 432, 433, 434, 435, 105, 437, 390, 133, 392, + /* 1230 */ 390, 442, 137, 444, 384, 340, 13, 448, 449, 142, + /* 1240 */ 42, 387, 44, 104, 390, 350, 427, 352, 387, 387, + /* 1250 */ 371, 390, 390, 374, 365, 164, 437, 368, 35, 456, + /* 1260 */ 107, 424, 459, 110, 427, 257, 258, 430, 431, 432, + /* 1270 */ 433, 434, 435, 378, 437, 45, 46, 474, 475, 182, + /* 1280 */ 183, 184, 479, 480, 187, 390, 340, 392, 107, 341, + /* 1290 */ 13, 110, 48, 349, 350, 104, 350, 200, 201, 107, + /* 1300 */ 400, 190, 110, 192, 107, 140, 141, 110, 211, 0, + /* 1310 */ 473, 214, 35, 369, 217, 218, 219, 220, 221, 424, + /* 1320 */ 283, 206, 427, 208, 378, 430, 431, 432, 433, 434, + /* 1330 */ 435, 22, 437, 222, 223, 0, 390, 442, 392, 444, + /* 1340 */ 0, 44, 456, 448, 449, 459, 235, 236, 237, 238, + /* 1350 */ 239, 240, 241, 340, 172, 135, 259, 22, 44, 139, + /* 1360 */ 474, 475, 22, 350, 222, 479, 480, 483, 44, 44, + /* 1370 */ 424, 44, 44, 427, 44, 44, 430, 431, 432, 433, + /* 1380 */ 434, 435, 472, 437, 349, 350, 340, 353, 442, 103, + /* 1390 */ 444, 378, 349, 350, 448, 449, 350, 349, 350, 113, + /* 1400 */ 44, 104, 47, 390, 369, 392, 260, 44, 44, 1, + /* 1410 */ 2, 281, 369, 340, 44, 466, 172, 369, 104, 199, + /* 1420 */ 35, 0, 202, 350, 378, 205, 44, 207, 104, 104, + /* 1430 */ 13, 104, 104, 44, 104, 104, 390, 424, 392, 378, + /* 1440 */ 427, 366, 44, 430, 431, 432, 433, 434, 435, 340, + /* 1450 */ 437, 378, 35, 366, 44, 442, 44, 444, 103, 350, + /* 1460 */ 104, 448, 449, 390, 44, 392, 353, 104, 104, 44, + /* 1470 */ 424, 50, 35, 427, 104, 340, 430, 431, 432, 433, + /* 1480 */ 434, 435, 400, 437, 348, 350, 104, 378, 442, 13, + /* 1490 */ 444, 350, 389, 104, 448, 449, 400, 424, 458, 390, + /* 1500 */ 427, 392, 104, 430, 431, 432, 433, 434, 435, 476, + /* 1510 */ 437, 35, 75, 378, 104, 450, 104, 444, 460, 261, + /* 1520 */ 426, 448, 449, 49, 104, 390, 425, 392, 20, 104, + /* 1530 */ 418, 205, 358, 424, 418, 358, 427, 423, 188, 430, + /* 1540 */ 431, 432, 433, 434, 435, 411, 437, 42, 397, 20, + /* 1550 */ 400, 397, 169, 444, 340, 395, 20, 448, 449, 424, + /* 1560 */ 349, 349, 427, 397, 350, 430, 431, 432, 433, 434, + /* 1570 */ 435, 395, 437, 395, 101, 362, 99, 192, 361, 98, + /* 1580 */ 340, 349, 360, 349, 349, 349, 20, 342, 48, 346, + /* 1590 */ 350, 342, 378, 346, 20, 358, 392, 418, 20, 358, + /* 1600 */ 20, 351, 342, 410, 390, 378, 392, 351, 349, 358, + /* 1610 */ 358, 358, 385, 358, 390, 358, 481, 482, 378, 349, + /* 1620 */ 393, 390, 342, 383, 378, 209, 378, 422, 390, 103, + /* 1630 */ 390, 196, 392, 195, 418, 420, 417, 356, 424, 378, + /* 1640 */ 378, 427, 340, 378, 430, 431, 432, 433, 434, 435, + /* 1650 */ 378, 437, 350, 378, 378, 416, 378, 378, 444, 340, + /* 1660 */ 378, 392, 356, 449, 424, 194, 349, 427, 400, 350, + /* 1670 */ 430, 431, 432, 433, 434, 435, 267, 437, 340, 415, + /* 1680 */ 378, 390, 268, 456, 400, 383, 459, 276, 350, 390, + /* 1690 */ 465, 465, 390, 405, 392, 405, 468, 378, 390, 181, + /* 1700 */ 390, 474, 475, 285, 278, 277, 479, 480, 262, 390, + /* 1710 */ 258, 392, 282, 426, 280, 350, 378, 484, 20, 465, + /* 1720 */ 478, 383, 429, 349, 351, 356, 424, 464, 390, 427, + /* 1730 */ 392, 356, 430, 431, 432, 433, 434, 435, 467, 437, + /* 1740 */ 20, 405, 403, 424, 477, 462, 427, 390, 463, 430, + /* 1750 */ 431, 432, 433, 434, 435, 174, 437, 390, 390, 405, + /* 1760 */ 402, 390, 424, 356, 340, 427, 390, 390, 430, 431, + /* 1770 */ 432, 433, 434, 435, 350, 437, 374, 350, 356, 103, + /* 1780 */ 447, 340, 103, 382, 390, 349, 36, 368, 356, 338, + /* 1790 */ 343, 350, 342, 412, 406, 372, 406, 419, 0, 357, + /* 1800 */ 340, 482, 378, 372, 0, 372, 0, 42, 0, 35, + /* 1810 */ 350, 215, 35, 35, 390, 35, 392, 215, 0, 378, + /* 1820 */ 35, 35, 215, 0, 383, 215, 0, 35, 0, 22, + /* 1830 */ 0, 390, 35, 392, 0, 210, 198, 0, 378, 198, + /* 1840 */ 192, 199, 190, 383, 0, 0, 0, 186, 424, 185, + /* 1850 */ 390, 427, 392, 0, 430, 431, 432, 433, 434, 435, + /* 1860 */ 0, 437, 47, 439, 0, 424, 42, 1, 427, 0, + /* 1870 */ 0, 430, 431, 432, 433, 434, 435, 0, 437, 0, + /* 1880 */ 0, 0, 0, 0, 424, 19, 0, 427, 0, 159, + /* 1890 */ 430, 431, 432, 433, 434, 435, 35, 437, 340, 33, + /* 1900 */ 0, 159, 0, 0, 0, 0, 0, 0, 350, 0, + /* 1910 */ 0, 0, 0, 0, 0, 49, 42, 0, 0, 0, + /* 1920 */ 0, 0, 0, 57, 58, 59, 60, 0, 62, 0, + /* 1930 */ 0, 340, 0, 0, 0, 0, 378, 22, 143, 0, + /* 1940 */ 0, 350, 48, 48, 0, 22, 22, 62, 390, 0, + /* 1950 */ 392, 62, 0, 62, 0, 0, 0, 49, 0, 0, + /* 1960 */ 35, 35, 0, 0, 340, 181, 35, 39, 102, 378, + /* 1970 */ 0, 105, 0, 0, 350, 39, 35, 35, 0, 14, + /* 1980 */ 0, 390, 424, 392, 0, 427, 39, 49, 430, 431, + /* 1990 */ 432, 433, 434, 435, 49, 437, 0, 44, 47, 42, + /* 2000 */ 340, 0, 378, 39, 138, 39, 39, 47, 47, 40, + /* 2010 */ 350, 35, 69, 39, 390, 424, 392, 49, 427, 0, + /* 2020 */ 35, 430, 431, 432, 433, 434, 435, 39, 437, 0, + /* 2030 */ 49, 49, 35, 340, 39, 0, 49, 35, 378, 173, + /* 2040 */ 0, 0, 39, 350, 178, 0, 0, 0, 424, 0, + /* 2050 */ 390, 427, 392, 35, 430, 431, 432, 433, 434, 435, + /* 2060 */ 112, 437, 340, 0, 198, 22, 35, 35, 35, 35, + /* 2070 */ 44, 378, 350, 35, 35, 0, 22, 35, 22, 35, + /* 2080 */ 44, 110, 0, 390, 424, 392, 35, 427, 22, 0, + /* 2090 */ 430, 431, 432, 433, 434, 435, 35, 437, 22, 51, + /* 2100 */ 378, 22, 35, 0, 35, 0, 35, 0, 20, 35, + /* 2110 */ 104, 103, 390, 35, 392, 35, 0, 424, 172, 103, + /* 2120 */ 427, 35, 340, 430, 431, 432, 433, 434, 435, 0, + /* 2130 */ 437, 22, 350, 22, 0, 0, 3, 44, 263, 48, + /* 2140 */ 103, 340, 48, 44, 44, 47, 424, 197, 44, 427, + /* 2150 */ 44, 350, 430, 431, 432, 433, 434, 435, 172, 437, + /* 2160 */ 378, 104, 172, 174, 104, 103, 101, 99, 193, 47, + /* 2170 */ 179, 3, 390, 103, 392, 44, 104, 104, 35, 378, + /* 2180 */ 103, 35, 35, 35, 103, 35, 103, 47, 35, 340, + /* 2190 */ 0, 390, 47, 392, 104, 44, 104, 0, 0, 350, + /* 2200 */ 104, 104, 0, 39, 47, 103, 424, 0, 340, 427, + /* 2210 */ 39, 103, 430, 431, 432, 433, 434, 435, 350, 437, + /* 2220 */ 44, 104, 104, 103, 103, 424, 103, 378, 427, 103, + /* 2230 */ 175, 430, 431, 432, 433, 434, 435, 173, 437, 390, + /* 2240 */ 263, 392, 0, 113, 244, 101, 378, 2, 47, 22, + /* 2250 */ 257, 47, 222, 104, 22, 263, 340, 101, 390, 104, + /* 2260 */ 392, 103, 103, 103, 47, 104, 350, 104, 103, 103, + /* 2270 */ 103, 35, 35, 424, 224, 103, 427, 340, 35, 430, + /* 2280 */ 431, 432, 433, 434, 435, 104, 437, 350, 114, 104, + /* 2290 */ 103, 35, 424, 104, 378, 427, 103, 35, 430, 431, + /* 2300 */ 432, 433, 434, 435, 35, 437, 390, 104, 392, 103, + /* 2310 */ 35, 103, 70, 71, 72, 378, 104, 104, 103, 77, + /* 2320 */ 78, 79, 103, 44, 125, 83, 103, 390, 35, 392, + /* 2330 */ 88, 89, 90, 91, 125, 125, 94, 103, 22, 125, + /* 2340 */ 424, 69, 68, 427, 35, 340, 430, 431, 432, 433, + /* 2350 */ 434, 435, 35, 437, 35, 350, 35, 35, 35, 35, + /* 2360 */ 35, 424, 75, 340, 427, 97, 22, 430, 431, 432, + /* 2370 */ 433, 434, 435, 350, 437, 44, 35, 35, 35, 75, + /* 2380 */ 35, 35, 35, 378, 35, 35, 35, 35, 35, 22, + /* 2390 */ 35, 0, 35, 340, 0, 390, 35, 392, 39, 39, + /* 2400 */ 0, 378, 39, 350, 35, 49, 0, 49, 35, 39, + /* 2410 */ 0, 49, 35, 390, 49, 392, 35, 0, 22, 21, + /* 2420 */ 485, 22, 20, 22, 340, 21, 485, 485, 485, 424, + /* 2430 */ 485, 378, 427, 485, 350, 430, 431, 432, 433, 434, + /* 2440 */ 435, 340, 437, 390, 485, 392, 485, 424, 485, 485, + /* 2450 */ 427, 350, 485, 430, 431, 432, 433, 434, 435, 485, + /* 2460 */ 437, 485, 378, 485, 485, 485, 485, 485, 485, 485, + /* 2470 */ 485, 485, 485, 485, 390, 485, 392, 424, 485, 378, + /* 2480 */ 427, 485, 485, 430, 431, 432, 433, 434, 435, 485, + /* 2490 */ 437, 390, 340, 392, 485, 485, 485, 485, 485, 485, + /* 2500 */ 485, 485, 350, 485, 485, 485, 485, 485, 424, 485, + /* 2510 */ 485, 427, 485, 340, 430, 431, 432, 433, 434, 435, + /* 2520 */ 485, 437, 485, 350, 485, 424, 485, 485, 427, 485, + /* 2530 */ 378, 430, 431, 432, 433, 434, 435, 485, 437, 485, + /* 2540 */ 340, 485, 390, 485, 392, 485, 485, 485, 485, 485, + /* 2550 */ 350, 378, 485, 485, 485, 485, 485, 485, 485, 485, + /* 2560 */ 485, 485, 485, 390, 485, 392, 485, 485, 485, 485, + /* 2570 */ 485, 485, 485, 485, 485, 485, 424, 485, 378, 427, + /* 2580 */ 485, 485, 430, 431, 432, 433, 434, 435, 485, 437, + /* 2590 */ 390, 485, 392, 485, 485, 485, 485, 424, 485, 485, + /* 2600 */ 427, 340, 485, 430, 431, 432, 433, 434, 435, 485, + /* 2610 */ 437, 350, 485, 485, 485, 485, 485, 485, 340, 485, + /* 2620 */ 485, 485, 485, 485, 424, 485, 485, 427, 350, 485, + /* 2630 */ 430, 431, 432, 433, 434, 435, 485, 437, 485, 378, + /* 2640 */ 485, 485, 485, 485, 485, 485, 485, 485, 485, 485, + /* 2650 */ 485, 390, 485, 392, 485, 485, 378, 485, 485, 485, + /* 2660 */ 485, 485, 485, 485, 485, 485, 485, 485, 390, 485, + /* 2670 */ 392, 485, 485, 485, 485, 485, 485, 485, 485, 485, + /* 2680 */ 485, 485, 485, 485, 485, 424, 485, 485, 427, 485, + /* 2690 */ 485, 430, 431, 432, 433, 434, 435, 485, 437, 485, + /* 2700 */ 485, 485, 424, 485, 485, 427, 485, 485, 430, 431, + /* 2710 */ 432, 433, 434, 435, 485, 437, 485, 485, 485, 485, + /* 2720 */ 485, 485, 485, 485, 485, 485, 485, 485, 485, 485, + /* 2730 */ 485, 485, 485, 485, 485, 485, 485, 485, 485, 485, + /* 2740 */ 485, 485, 485, 485, 485, 485, 485, 485, 485, 485, + /* 2750 */ 485, 485, 485, 485, 485, 485, 485, 485, 485, 485, + /* 2760 */ 485, 485, 485, 337, 337, 337, 337, 337, 337, 337, + /* 2770 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2780 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2790 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2800 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2810 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2820 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2830 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2840 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2850 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2860 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2870 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2880 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2890 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2900 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2910 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2920 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2930 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2940 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2950 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2960 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2970 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2980 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 2990 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 3000 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 3010 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 3020 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 3030 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 3040 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 3050 */ 337, 337, 337, }; -#define YY_SHIFT_COUNT (788) +#define YY_SHIFT_COUNT (791) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2269) +#define YY_SHIFT_MAX (2417) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 1291, 0, 230, 0, 461, 461, 461, 461, 461, 461, - /* 10 */ 461, 461, 461, 461, 461, 461, 691, 921, 921, 1151, - /* 20 */ 921, 921, 921, 921, 921, 921, 921, 921, 921, 921, - /* 30 */ 921, 921, 921, 921, 921, 921, 921, 921, 921, 921, - /* 40 */ 921, 921, 921, 921, 921, 921, 921, 921, 921, 921, - /* 50 */ 921, 262, 264, 76, 29, 115, 164, 345, 164, 29, - /* 60 */ 29, 1383, 164, 1383, 1383, 97, 164, 49, 257, 54, - /* 70 */ 54, 257, 367, 367, 17, 68, 378, 378, 54, 54, - /* 80 */ 54, 54, 54, 54, 54, 162, 54, 54, 129, 49, - /* 90 */ 54, 54, 199, 54, 49, 54, 162, 54, 162, 49, - /* 100 */ 54, 54, 49, 54, 49, 49, 49, 54, 362, 229, - /* 110 */ 190, 190, 337, 117, 918, 918, 918, 918, 918, 918, - /* 120 */ 918, 918, 918, 918, 918, 918, 918, 918, 918, 918, - /* 130 */ 918, 918, 918, 380, 507, 17, 68, 476, 476, 739, - /* 140 */ 181, 181, 181, 521, 106, 106, 739, 433, 433, 433, - /* 150 */ 129, 465, 351, 49, 580, 49, 580, 580, 658, 632, - /* 160 */ 35, 35, 35, 35, 35, 35, 35, 35, 2002, 568, - /* 170 */ 15, 348, 16, 276, 226, 306, 259, 259, 848, 1062, - /* 180 */ 916, 722, 1018, 1000, 1080, 1032, 966, 267, 947, 966, - /* 190 */ 1002, 976, 1086, 1143, 1359, 1389, 1208, 129, 1389, 129, - /* 200 */ 1232, 1379, 1404, 1379, 1263, 1406, 1406, 1379, 1263, 1263, - /* 210 */ 1338, 1348, 1406, 1351, 1406, 1406, 1406, 1436, 1411, 1436, - /* 220 */ 1411, 1389, 129, 1444, 129, 1450, 1455, 129, 1450, 129, - /* 230 */ 129, 129, 1406, 129, 1436, 49, 49, 49, 49, 49, - /* 240 */ 49, 49, 49, 49, 49, 49, 1406, 1436, 580, 580, - /* 250 */ 580, 1287, 1402, 1389, 362, 1311, 1341, 1444, 362, 1352, - /* 260 */ 1406, 1404, 1404, 580, 1283, 1286, 580, 1283, 1286, 580, - /* 270 */ 580, 49, 1280, 1387, 1283, 1296, 1304, 1327, 1143, 1307, - /* 280 */ 1290, 1313, 1345, 433, 1578, 1406, 1450, 362, 362, 1587, - /* 290 */ 1286, 580, 580, 580, 580, 580, 1286, 580, 1459, 362, - /* 300 */ 658, 362, 433, 1530, 1536, 580, 632, 1406, 362, 1605, - /* 310 */ 1436, 2969, 2969, 2969, 2969, 2969, 2969, 2969, 2969, 2969, - /* 320 */ 34, 1384, 185, 736, 652, 45, 735, 741, 774, 895, - /* 330 */ 543, 828, 1182, 1182, 1182, 1182, 1182, 1182, 1182, 1182, - /* 340 */ 1182, 668, 428, 64, 64, 334, 255, 459, 446, 917, - /* 350 */ 710, 786, 413, 577, 834, 834, 312, 870, 512, 312, - /* 360 */ 312, 312, 1095, 102, 893, 389, 1130, 1104, 1193, 1117, - /* 370 */ 1131, 1133, 1138, 829, 1215, 1247, 1252, 1270, 1027, 1171, - /* 380 */ 1176, 1203, 1189, 1195, 1213, 1158, 21, 1067, 1233, 1214, - /* 390 */ 1244, 1258, 1259, 1260, 1261, 1305, 1266, 1181, 1267, 627, - /* 400 */ 1289, 1293, 1294, 1295, 1297, 1302, 1209, 1237, 1278, 1310, - /* 410 */ 1312, 1284, 1324, 1675, 1678, 1679, 1638, 1681, 1647, 1469, - /* 420 */ 1649, 1650, 1651, 1473, 1688, 1654, 1655, 1477, 1692, 1479, - /* 430 */ 1694, 1660, 1699, 1680, 1700, 1662, 1492, 1703, 1507, 1705, - /* 440 */ 1510, 1511, 1522, 1533, 1723, 1724, 1725, 1541, 1543, 1729, - /* 450 */ 1731, 1689, 1735, 1737, 1738, 1698, 1739, 1741, 1742, 1743, - /* 460 */ 1745, 1749, 1756, 1759, 1602, 1726, 1762, 1607, 1763, 1766, - /* 470 */ 1767, 1771, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1781, - /* 480 */ 1782, 1784, 1792, 1794, 1754, 1797, 1798, 1799, 1801, 1802, - /* 490 */ 1803, 1787, 1806, 1808, 1816, 1676, 1819, 1820, 1800, 1783, - /* 500 */ 1804, 1785, 1821, 1765, 1789, 1825, 1768, 1829, 1770, 1834, - /* 510 */ 1836, 1807, 1790, 1809, 1838, 1810, 1791, 1811, 1841, 1814, - /* 520 */ 1795, 1813, 1843, 1818, 1846, 1812, 1817, 1815, 1823, 1824, - /* 530 */ 1844, 1827, 1855, 1822, 1826, 1860, 1861, 1864, 1828, 1686, - /* 540 */ 1868, 1881, 1883, 1831, 1884, 1886, 1852, 1839, 1850, 1898, - /* 550 */ 1856, 1845, 1853, 1893, 1867, 1847, 1865, 1895, 1870, 1854, - /* 560 */ 1869, 1906, 1907, 1909, 1910, 1911, 1912, 1833, 1849, 1882, - /* 570 */ 1894, 1918, 1885, 1887, 1888, 1890, 1892, 1897, 1900, 1875, - /* 580 */ 1877, 1908, 1913, 1904, 1914, 1928, 1929, 1933, 1940, 1878, - /* 590 */ 1930, 1941, 1926, 1965, 1932, 1968, 1934, 1970, 1949, 1952, - /* 600 */ 1938, 1942, 1943, 1871, 1873, 1980, 1842, 1879, 1788, 1946, - /* 610 */ 1961, 1985, 1830, 1967, 1848, 1851, 1990, 1991, 1863, 1837, - /* 620 */ 1984, 1948, 1732, 1896, 1889, 1899, 1947, 1915, 1964, 1919, - /* 630 */ 1921, 1953, 1973, 1935, 1937, 1944, 1945, 1950, 1988, 1994, - /* 640 */ 1995, 1954, 1993, 1752, 1951, 1959, 2040, 2000, 1840, 2010, - /* 650 */ 2014, 2018, 2030, 2031, 2032, 1966, 1969, 2022, 1857, 2027, - /* 660 */ 2025, 2080, 2081, 2082, 2083, 1972, 2037, 1823, 2038, 1974, - /* 670 */ 1996, 1999, 1975, 1986, 1924, 2003, 2105, 2070, 1960, 2008, - /* 680 */ 2001, 1823, 2065, 2071, 2015, 1876, 2016, 2116, 2099, 1901, - /* 690 */ 2021, 2033, 2035, 2036, 2043, 2039, 2087, 2044, 2053, 2089, - /* 700 */ 2054, 2119, 1936, 2057, 2047, 2058, 2122, 2129, 2062, 2063, - /* 710 */ 2131, 2066, 2064, 2135, 2068, 2069, 2137, 2073, 2074, 2145, - /* 720 */ 2078, 2059, 2060, 2061, 2067, 2084, 2139, 2085, 2154, 2088, - /* 730 */ 2139, 2139, 2168, 2124, 2127, 2162, 2163, 2165, 2166, 2167, - /* 740 */ 2169, 2170, 2171, 2128, 2110, 2164, 2176, 2179, 2186, 2188, - /* 750 */ 2189, 2190, 2191, 2152, 1875, 2194, 1877, 2197, 2198, 2207, - /* 760 */ 2208, 2222, 2210, 2246, 2212, 2199, 2211, 2249, 2217, 2204, - /* 770 */ 2215, 2255, 2221, 2209, 2218, 2259, 2225, 2213, 2227, 2261, - /* 780 */ 2229, 2232, 2269, 2248, 2250, 2251, 2252, 2254, 2256, + /* 0 */ 1097, 0, 104, 0, 336, 336, 336, 336, 336, 336, + /* 10 */ 336, 336, 336, 336, 336, 336, 440, 671, 671, 775, + /* 20 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, + /* 30 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, + /* 40 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, + /* 50 */ 671, 173, 483, 524, 446, 426, 476, 523, 476, 446, + /* 60 */ 446, 1111, 476, 1111, 1111, 275, 476, 141, 644, 223, + /* 70 */ 223, 644, 496, 496, 413, 33, 293, 293, 223, 223, + /* 80 */ 223, 223, 223, 223, 223, 410, 223, 223, 205, 141, + /* 90 */ 223, 223, 458, 223, 141, 223, 410, 223, 410, 141, + /* 100 */ 223, 223, 141, 223, 141, 141, 141, 223, 537, 917, + /* 110 */ 15, 15, 565, 170, 953, 953, 953, 953, 953, 953, + /* 120 */ 953, 953, 953, 953, 953, 953, 953, 953, 953, 953, + /* 130 */ 953, 953, 953, 1095, 14, 413, 33, 994, 994, 113, + /* 140 */ 116, 116, 116, 180, 266, 266, 113, 505, 505, 505, + /* 150 */ 205, 510, 513, 141, 697, 141, 697, 697, 713, 711, + /* 160 */ 297, 297, 297, 297, 297, 297, 297, 297, 1866, 2242, + /* 170 */ 185, 31, 508, 282, 271, 281, 341, 341, 417, 720, + /* 180 */ 330, 517, 1230, 826, 913, 970, 1008, 243, 352, 1008, + /* 190 */ 1122, 1146, 1000, 1258, 1474, 1508, 1326, 205, 1508, 205, + /* 200 */ 1350, 1505, 1529, 1505, 1383, 1536, 1536, 1505, 1383, 1383, + /* 210 */ 1473, 1477, 1536, 1481, 1536, 1536, 1536, 1566, 1540, 1566, + /* 220 */ 1540, 1508, 205, 1574, 205, 1578, 1580, 205, 1578, 205, + /* 230 */ 205, 205, 1536, 205, 1566, 141, 141, 141, 141, 141, + /* 240 */ 141, 141, 141, 141, 141, 141, 1536, 1566, 697, 697, + /* 250 */ 697, 1416, 1526, 1508, 537, 1435, 1438, 1574, 537, 1471, + /* 260 */ 1536, 1529, 1529, 697, 1414, 1409, 697, 1414, 1409, 697, + /* 270 */ 697, 141, 1411, 1518, 1414, 1426, 1428, 1446, 1258, 1418, + /* 280 */ 1430, 1434, 1452, 505, 1698, 1536, 1578, 537, 537, 1720, + /* 290 */ 1409, 697, 697, 697, 697, 697, 1409, 697, 1581, 537, + /* 300 */ 713, 537, 505, 1676, 1679, 697, 711, 1536, 537, 1750, + /* 310 */ 1566, 2716, 2716, 2716, 2716, 2716, 2716, 2716, 2716, 2716, + /* 320 */ 1018, 425, 224, 717, 306, 378, 1139, 718, 455, 871, + /* 330 */ 1182, 824, 971, 971, 971, 971, 971, 971, 971, 971, + /* 340 */ 971, 357, 1220, 118, 118, 451, 552, 556, 657, 76, + /* 350 */ 772, 954, 731, 664, 494, 494, 924, 1191, 636, 924, + /* 360 */ 924, 924, 645, 156, 821, 836, 1198, 1091, 362, 1153, + /* 370 */ 1181, 1192, 1197, 1223, 1277, 1309, 1335, 1340, 1115, 1297, + /* 380 */ 1314, 1120, 1324, 1325, 1327, 1165, 1130, 1037, 1244, 1328, + /* 390 */ 1330, 1331, 1356, 1363, 1364, 1408, 1370, 1142, 1382, 1355, + /* 400 */ 1389, 1398, 1410, 1412, 1420, 1425, 1286, 617, 1385, 1417, + /* 410 */ 1476, 1437, 1421, 1798, 1804, 1806, 1765, 1808, 1774, 1596, + /* 420 */ 1777, 1778, 1780, 1602, 1818, 1785, 1786, 1607, 1823, 1610, + /* 430 */ 1826, 1792, 1828, 1807, 1830, 1797, 1625, 1834, 1638, 1837, + /* 440 */ 1641, 1642, 1648, 1652, 1844, 1845, 1846, 1661, 1664, 1853, + /* 450 */ 1860, 1815, 1864, 1869, 1870, 1824, 1877, 1879, 1880, 1881, + /* 460 */ 1882, 1883, 1886, 1888, 1730, 1861, 1900, 1742, 1902, 1903, + /* 470 */ 1904, 1905, 1906, 1907, 1909, 1910, 1911, 1912, 1913, 1914, + /* 480 */ 1927, 1929, 1930, 1932, 1874, 1917, 1918, 1919, 1920, 1921, + /* 490 */ 1922, 1915, 1933, 1934, 1935, 1795, 1939, 1940, 1923, 1894, + /* 500 */ 1924, 1895, 1944, 1885, 1925, 1949, 1889, 1952, 1891, 1954, + /* 510 */ 1955, 1926, 1908, 1928, 1956, 1931, 1938, 1936, 1958, 1941, + /* 520 */ 1945, 1947, 1959, 1942, 1962, 1957, 1967, 1953, 1951, 1960, + /* 530 */ 1965, 1961, 1963, 1969, 1964, 1970, 1972, 1973, 1974, 1784, + /* 540 */ 1978, 1980, 1984, 1943, 1996, 2001, 1976, 1968, 1966, 2019, + /* 550 */ 1985, 1981, 1988, 2029, 1997, 1982, 1995, 2035, 2002, 1987, + /* 560 */ 2003, 2040, 2041, 2045, 2046, 2047, 2049, 1948, 1971, 2018, + /* 570 */ 2043, 2063, 2031, 2032, 2033, 2034, 2038, 2039, 2042, 2026, + /* 580 */ 2036, 2044, 2051, 2054, 2061, 2075, 2056, 2082, 2066, 2048, + /* 590 */ 2089, 2076, 2067, 2103, 2069, 2105, 2071, 2107, 2079, 2088, + /* 600 */ 2074, 2078, 2080, 2006, 2008, 2116, 1946, 2016, 1950, 2086, + /* 610 */ 2109, 2129, 1975, 2111, 1986, 1989, 2134, 2135, 1990, 1991, + /* 620 */ 2133, 2093, 1875, 2037, 2057, 2062, 2091, 2065, 2094, 2068, + /* 630 */ 2060, 2099, 2100, 2072, 2070, 2077, 2081, 2073, 2104, 2098, + /* 640 */ 2122, 2083, 2106, 1977, 2090, 2092, 2168, 2131, 1992, 2143, + /* 650 */ 2146, 2147, 2148, 2150, 2153, 2096, 2097, 2140, 1993, 2151, + /* 660 */ 2145, 2190, 2197, 2198, 2202, 2102, 2164, 1951, 2157, 2108, + /* 670 */ 2117, 2118, 2120, 2121, 2055, 2123, 2207, 2171, 2064, 2126, + /* 680 */ 2130, 1951, 2201, 2176, 2144, 2000, 2156, 2245, 2227, 2030, + /* 690 */ 2158, 2149, 2159, 2155, 2160, 2161, 2204, 2165, 2166, 2217, + /* 700 */ 2163, 2232, 2050, 2167, 2174, 2181, 2236, 2237, 2172, 2185, + /* 710 */ 2243, 2187, 2189, 2256, 2193, 2203, 2262, 2206, 2212, 2269, + /* 720 */ 2208, 2213, 2275, 2215, 2199, 2209, 2210, 2214, 2219, 2279, + /* 730 */ 2223, 2293, 2234, 2279, 2279, 2316, 2272, 2274, 2309, 2317, + /* 740 */ 2319, 2321, 2322, 2323, 2324, 2325, 2287, 2268, 2331, 2341, + /* 750 */ 2342, 2343, 2344, 2345, 2346, 2347, 2304, 2026, 2349, 2036, + /* 760 */ 2350, 2351, 2352, 2353, 2367, 2355, 2391, 2357, 2356, 2359, + /* 770 */ 2394, 2361, 2358, 2360, 2400, 2369, 2362, 2363, 2406, 2373, + /* 780 */ 2365, 2370, 2410, 2377, 2381, 2417, 2396, 2398, 2399, 2401, + /* 790 */ 2404, 2402, }; #define YY_REDUCE_COUNT (319) -#define YY_REDUCE_MIN (-433) -#define YY_REDUCE_MAX (2532) +#define YY_REDUCE_MIN (-454) +#define YY_REDUCE_MAX (2278) static const short yy_reduce_ofst[] = { - /* 0 */ -155, -94, 176, 286, 386, 422, 600, 636, 830, 853, - /* 10 */ 458, 1091, 1153, 1220, 1285, 1321, -339, 151, 696, 1357, - /* 20 */ 1381, 1446, 1508, 1524, 1575, 1597, 1661, 1697, 1719, 1786, - /* 30 */ 1805, 1874, 1891, 1939, 1987, 2004, 2052, 2075, 2100, 2151, - /* 40 */ 2175, 2223, 2239, 2301, 2325, 2373, 2421, 2436, 2484, 2499, - /* 50 */ 2532, -165, -204, -407, 53, 118, 537, 620, 727, 547, - /* 60 */ 598, -363, 59, 752, 810, -284, -133, 354, -321, 55, - /* 70 */ 127, -388, -210, -36, -205, -383, -327, 163, 150, 186, - /* 80 */ 246, 305, 410, 416, 475, 139, 610, 622, 215, -33, - /* 90 */ 633, 689, -322, 732, 100, 740, 242, 755, 279, -109, - /* 100 */ 765, 819, 292, 861, -96, 344, 383, 753, 261, -337, - /* 110 */ -277, -277, 404, -257, 154, 239, 283, 457, 511, 546, - /* 120 */ 559, 563, 605, 616, 618, 667, 669, 703, 716, 747, - /* 130 */ 776, 777, 781, 187, -294, -154, -70, 295, 472, 474, - /* 140 */ -294, 429, 558, 629, 266, 353, 677, 593, 785, 788, - /* 150 */ 203, -242, -433, 455, 96, 467, 587, 685, 838, 850, - /* 160 */ 403, 536, 626, 746, 760, 890, 937, 760, 705, 929, - /* 170 */ 990, 932, 852, 845, 983, 871, 979, 985, 974, 974, - /* 180 */ 1001, 953, 1011, 1012, 972, 967, 910, 910, 894, 910, - /* 190 */ 919, 941, 974, 982, 986, 994, 991, 1057, 998, 1063, - /* 200 */ 1013, 1026, 1028, 1029, 1035, 1087, 1088, 1038, 1043, 1044, - /* 210 */ 1089, 1092, 1100, 1094, 1103, 1106, 1107, 1116, 1115, 1120, - /* 220 */ 1118, 1045, 1108, 1075, 1110, 1121, 1069, 1119, 1129, 1124, - /* 230 */ 1127, 1128, 1139, 1136, 1147, 1122, 1123, 1126, 1135, 1141, - /* 240 */ 1142, 1149, 1152, 1154, 1156, 1159, 1146, 1155, 1109, 1148, - /* 250 */ 1157, 1076, 1096, 1099, 1173, 1097, 1125, 1150, 1188, 1134, - /* 260 */ 1199, 1161, 1163, 1162, 1090, 1160, 1164, 1101, 1166, 1169, - /* 270 */ 1177, 974, 1111, 1102, 1113, 1112, 1137, 1132, 1165, 1144, - /* 280 */ 1167, 1140, 910, 1246, 1175, 1262, 1256, 1253, 1257, 1211, - /* 290 */ 1210, 1226, 1236, 1239, 1240, 1241, 1222, 1242, 1234, 1281, - /* 300 */ 1264, 1292, 1299, 1192, 1274, 1251, 1275, 1309, 1303, 1317, - /* 310 */ 1320, 1254, 1227, 1268, 1272, 1298, 1300, 1301, 1308, 1329, + /* 0 */ 583, -340, -280, -67, -132, 158, 268, 603, 789, 895, + /* 10 */ 946, 1013, 1046, 369, 1073, 1109, 11, 399, 1135, 1214, + /* 20 */ 499, 1240, 1302, 837, 1319, 1338, 1424, 1441, 1460, 1558, + /* 30 */ 1591, 1624, 1660, 1693, 1722, 1782, 1801, 1849, 1868, 1916, + /* 40 */ 1937, 2005, 2023, 2053, 2084, 2101, 2152, 2173, 2200, 2261, + /* 50 */ 2278, 301, 1227, -402, -167, -360, 252, 709, 803, 465, + /* 60 */ 674, -348, 886, 259, 819, -454, -374, -322, -8, -227, + /* 70 */ -72, -249, -289, 61, -362, 332, -284, -238, -204, -41, + /* 80 */ 130, 169, 265, 272, 338, -214, 379, 394, 97, -5, + /* 90 */ 495, 622, 29, 672, 450, 767, -182, 809, -144, 119, + /* 100 */ 944, 1035, 481, 1043, 344, 563, 392, 1048, 78, -308, + /* 110 */ -442, -442, -358, -333, -321, -215, 204, 307, 498, 574, + /* 120 */ 584, 587, 588, 609, 642, 654, 703, 747, 779, 781, + /* 130 */ 782, 817, 840, -301, -70, -4, 346, 701, 705, 662, + /* 140 */ -70, 296, 335, 84, 197, 419, 722, 136, 164, 806, + /* 150 */ 850, -293, 774, -312, 854, 576, 861, 862, 879, 889, + /* 160 */ -364, 497, 502, 516, 650, 746, 761, 650, 528, 851, + /* 170 */ 948, 900, 884, 910, 1034, 949, 1075, 1087, 1061, 1061, + /* 180 */ 1113, 1082, 1136, 1141, 1103, 1096, 1040, 1040, 1033, 1040, + /* 190 */ 1065, 1058, 1061, 1094, 1101, 1112, 1114, 1174, 1116, 1177, + /* 200 */ 1134, 1151, 1150, 1154, 1160, 1211, 1212, 1166, 1176, 1178, + /* 210 */ 1213, 1217, 1232, 1222, 1234, 1235, 1236, 1245, 1243, 1249, + /* 220 */ 1247, 1179, 1237, 1204, 1241, 1250, 1193, 1251, 1256, 1252, + /* 230 */ 1253, 1255, 1259, 1257, 1260, 1246, 1248, 1261, 1262, 1265, + /* 240 */ 1272, 1275, 1276, 1278, 1279, 1282, 1270, 1280, 1224, 1231, + /* 250 */ 1238, 1205, 1215, 1216, 1281, 1219, 1239, 1269, 1306, 1264, + /* 260 */ 1317, 1268, 1284, 1291, 1225, 1288, 1299, 1226, 1290, 1308, + /* 270 */ 1310, 1061, 1228, 1271, 1254, 1263, 1285, 1283, 1287, 1233, + /* 280 */ 1242, 1267, 1040, 1365, 1293, 1374, 1373, 1369, 1375, 1339, + /* 290 */ 1336, 1357, 1367, 1368, 1371, 1376, 1354, 1377, 1358, 1407, + /* 300 */ 1402, 1422, 1427, 1333, 1401, 1394, 1419, 1436, 1432, 1447, + /* 310 */ 1450, 1381, 1378, 1388, 1390, 1423, 1431, 1433, 1442, 1451, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 10 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 20 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 30 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 40 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 50 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 60 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 70 */ 1759, 1759, 1759, 1759, 2039, 1759, 1759, 1759, 1759, 1759, - /* 80 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1848, 1759, - /* 90 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 100 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1846, 2032, - /* 110 */ 2257, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 120 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 130 */ 1759, 1759, 1759, 1759, 2269, 1759, 1759, 1822, 1822, 1759, - /* 140 */ 2269, 2269, 2269, 1846, 2229, 2229, 1759, 1759, 1759, 1759, - /* 150 */ 1848, 2099, 1759, 1759, 1759, 1759, 1759, 1759, 1967, 1759, - /* 160 */ 1759, 1759, 1759, 1759, 1991, 1759, 1759, 1759, 2091, 1759, - /* 170 */ 1759, 2294, 2350, 1759, 1759, 2297, 1759, 1759, 1759, 1759, - /* 180 */ 1759, 2044, 1759, 1759, 1921, 2284, 2261, 2275, 2334, 2262, - /* 190 */ 2259, 2278, 1759, 2288, 1759, 1759, 2113, 1848, 1759, 1848, - /* 200 */ 2078, 2037, 1759, 2037, 2034, 1759, 1759, 2037, 2034, 2034, - /* 210 */ 1910, 1906, 1759, 1904, 1759, 1759, 1759, 1759, 1806, 1759, - /* 220 */ 1806, 1759, 1848, 1759, 1848, 1759, 1759, 1848, 1759, 1848, - /* 230 */ 1848, 1848, 1759, 1848, 1759, 1759, 1759, 1759, 1759, 1759, - /* 240 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 250 */ 1759, 2111, 2097, 1759, 1846, 2089, 2087, 1759, 1846, 2085, - /* 260 */ 1759, 1759, 1759, 1759, 2305, 2303, 1759, 2305, 2303, 1759, - /* 270 */ 1759, 1759, 2319, 2315, 2305, 2323, 2321, 2290, 2288, 2353, - /* 280 */ 2340, 2336, 2275, 1759, 1759, 1759, 1759, 1846, 1846, 1759, - /* 290 */ 2303, 1759, 1759, 1759, 1759, 1759, 2303, 1759, 1759, 1846, - /* 300 */ 1759, 1846, 1759, 1759, 1937, 1759, 1759, 1759, 1846, 1791, - /* 310 */ 1759, 2080, 2102, 2062, 2062, 1970, 1970, 1970, 1849, 1764, - /* 320 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 330 */ 1759, 1759, 2318, 2317, 2184, 1759, 2233, 2232, 2231, 2222, - /* 340 */ 2183, 1933, 1759, 2182, 2181, 1759, 1759, 1759, 1759, 1759, - /* 350 */ 1759, 1759, 1759, 1759, 2053, 2052, 2175, 1759, 1759, 2176, - /* 360 */ 2174, 2173, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 370 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 380 */ 1759, 1759, 1759, 1759, 1759, 1759, 2337, 2341, 1759, 1759, - /* 390 */ 1759, 1759, 1759, 1759, 1759, 2258, 1759, 1759, 1759, 2157, - /* 400 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 410 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 420 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 430 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 440 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 450 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 460 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 470 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 480 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 490 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 500 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 510 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 520 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1796, 2162, 1759, - /* 530 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 540 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 550 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 560 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 570 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1887, - /* 580 */ 1886, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 590 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 600 */ 1759, 1759, 1759, 2166, 1759, 1759, 1759, 1759, 1759, 1759, - /* 610 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 620 */ 2333, 2291, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 630 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 640 */ 2157, 1759, 2316, 1759, 1759, 2331, 1759, 2335, 1759, 1759, - /* 650 */ 1759, 1759, 1759, 1759, 1759, 2268, 2264, 1759, 1759, 2260, - /* 660 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 2165, 1759, 1759, - /* 670 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 680 */ 1759, 2156, 1759, 2219, 1759, 1759, 1759, 2253, 1759, 1759, - /* 690 */ 2204, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 700 */ 2166, 1759, 2169, 1759, 1759, 1759, 1759, 1759, 1964, 1759, - /* 710 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 720 */ 1759, 1949, 1947, 1946, 1945, 1759, 1977, 1759, 1759, 1759, - /* 730 */ 1973, 1972, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 740 */ 1759, 1759, 1759, 1759, 1759, 1867, 1759, 1759, 1759, 1759, - /* 750 */ 1759, 1759, 1759, 1759, 1859, 1759, 1858, 1759, 1759, 1759, - /* 760 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 770 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, - /* 780 */ 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, 1759, + /* 0 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 10 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 20 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 30 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 40 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 50 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 60 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 70 */ 1764, 1764, 1764, 1764, 2045, 1764, 1764, 1764, 1764, 1764, + /* 80 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1853, 1764, + /* 90 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 100 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1851, 2038, + /* 110 */ 2263, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 120 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 130 */ 1764, 1764, 1764, 1764, 2275, 1764, 1764, 1827, 1827, 1764, + /* 140 */ 2275, 2275, 2275, 1851, 2235, 2235, 1764, 1764, 1764, 1764, + /* 150 */ 1853, 2105, 1764, 1764, 1764, 1764, 1764, 1764, 1973, 1764, + /* 160 */ 1764, 1764, 1764, 1764, 1997, 1764, 1764, 1764, 2097, 1764, + /* 170 */ 1764, 2300, 2356, 1764, 1764, 2303, 1764, 1764, 1764, 1764, + /* 180 */ 1764, 2050, 1764, 1764, 1926, 2290, 2267, 2281, 2340, 2268, + /* 190 */ 2265, 2284, 1764, 2294, 1764, 1764, 2119, 1853, 1764, 1853, + /* 200 */ 2084, 2043, 1764, 2043, 2040, 1764, 1764, 2043, 2040, 2040, + /* 210 */ 1915, 1911, 1764, 1909, 1764, 1764, 1764, 1764, 1811, 1764, + /* 220 */ 1811, 1764, 1853, 1764, 1853, 1764, 1764, 1853, 1764, 1853, + /* 230 */ 1853, 1853, 1764, 1853, 1764, 1764, 1764, 1764, 1764, 1764, + /* 240 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 250 */ 1764, 2117, 2103, 1764, 1851, 2095, 2093, 1764, 1851, 2091, + /* 260 */ 1764, 1764, 1764, 1764, 2311, 2309, 1764, 2311, 2309, 1764, + /* 270 */ 1764, 1764, 2325, 2321, 2311, 2329, 2327, 2296, 2294, 2359, + /* 280 */ 2346, 2342, 2281, 1764, 1764, 1764, 1764, 1851, 1851, 1764, + /* 290 */ 2309, 1764, 1764, 1764, 1764, 1764, 2309, 1764, 1764, 1851, + /* 300 */ 1764, 1851, 1764, 1764, 1942, 1764, 1764, 1764, 1851, 1796, + /* 310 */ 1764, 2086, 2108, 2068, 2068, 1976, 1976, 1976, 1854, 1769, + /* 320 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 330 */ 1764, 1764, 2324, 2323, 2190, 1764, 2239, 2238, 2237, 2228, + /* 340 */ 2189, 1938, 1764, 2188, 2187, 1764, 1764, 1764, 1764, 1764, + /* 350 */ 1764, 1764, 1764, 1764, 2059, 2058, 2181, 1764, 1764, 2182, + /* 360 */ 2180, 2179, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 370 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 380 */ 1764, 1764, 1764, 1764, 1764, 1764, 2343, 2347, 1764, 1764, + /* 390 */ 1764, 1764, 1764, 1764, 1764, 2264, 1764, 1764, 1764, 2163, + /* 400 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 410 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 420 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 430 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 440 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 450 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 460 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 470 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 480 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 490 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 500 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 510 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 520 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1801, 2168, 1764, + /* 530 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 540 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 550 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 560 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 570 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1892, + /* 580 */ 1891, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 590 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 600 */ 1764, 1764, 1764, 2172, 1764, 1764, 1764, 1764, 1764, 1764, + /* 610 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 620 */ 2339, 2297, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 630 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 640 */ 2163, 1764, 2322, 1764, 1764, 2337, 1764, 2341, 1764, 1764, + /* 650 */ 1764, 1764, 1764, 1764, 1764, 2274, 2270, 1764, 1764, 2266, + /* 660 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 2171, 1764, 1764, + /* 670 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 680 */ 1764, 2162, 1764, 2225, 1764, 1764, 1764, 2259, 1764, 1764, + /* 690 */ 2210, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 700 */ 2172, 1764, 2175, 1764, 1764, 1764, 1764, 1764, 1970, 1764, + /* 710 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 720 */ 1764, 1764, 1764, 1764, 1954, 1952, 1951, 1950, 1764, 1983, + /* 730 */ 1764, 1764, 1764, 1979, 1978, 1764, 1764, 1764, 1764, 1764, + /* 740 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1872, 1764, + /* 750 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1864, 1764, 1863, + /* 760 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 770 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 780 */ 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1764, + /* 790 */ 1764, 1764, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1172,7 +1124,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* MAX_SPEED => nothing */ 0, /* START => nothing */ 0, /* TIMESTAMP => nothing */ - 285, /* END => ABORT */ + 286, /* END => ABORT */ 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ 0, /* NK_RP => nothing */ @@ -1202,6 +1154,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* MEDIUMBLOB => nothing */ 0, /* BLOB => nothing */ 0, /* VARBINARY => nothing */ + 0, /* GEOMETRY => nothing */ 0, /* DECIMAL => nothing */ 0, /* COMMENT => nothing */ 0, /* MAX_DELAY => nothing */ @@ -1357,56 +1310,56 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 285, /* AFTER => ABORT */ - 285, /* ATTACH => ABORT */ - 285, /* BEFORE => ABORT */ - 285, /* BEGIN => ABORT */ - 285, /* BITAND => ABORT */ - 285, /* BITNOT => ABORT */ - 285, /* BITOR => ABORT */ - 285, /* BLOCKS => ABORT */ - 285, /* CHANGE => ABORT */ - 285, /* COMMA => ABORT */ - 285, /* CONCAT => ABORT */ - 285, /* CONFLICT => ABORT */ - 285, /* COPY => ABORT */ - 285, /* DEFERRED => ABORT */ - 285, /* DELIMITERS => ABORT */ - 285, /* DETACH => ABORT */ - 285, /* DIVIDE => ABORT */ - 285, /* DOT => ABORT */ - 285, /* EACH => ABORT */ - 285, /* FAIL => ABORT */ - 285, /* FILE => ABORT */ - 285, /* FOR => ABORT */ - 285, /* GLOB => ABORT */ - 285, /* ID => ABORT */ - 285, /* IMMEDIATE => ABORT */ - 285, /* IMPORT => ABORT */ - 285, /* INITIALLY => ABORT */ - 285, /* INSTEAD => ABORT */ - 285, /* ISNULL => ABORT */ - 285, /* KEY => ABORT */ - 285, /* MODULES => ABORT */ - 285, /* NK_BITNOT => ABORT */ - 285, /* NK_SEMI => ABORT */ - 285, /* NOTNULL => ABORT */ - 285, /* OF => ABORT */ - 285, /* PLUS => ABORT */ - 285, /* PRIVILEGE => ABORT */ - 285, /* RAISE => ABORT */ - 285, /* RESTRICT => ABORT */ - 285, /* ROW => ABORT */ - 285, /* SEMI => ABORT */ - 285, /* STAR => ABORT */ - 285, /* STATEMENT => ABORT */ - 285, /* STRICT => ABORT */ - 285, /* STRING => ABORT */ - 285, /* TIMES => ABORT */ - 285, /* VALUES => ABORT */ - 285, /* VARIABLE => ABORT */ - 285, /* VIEW => ABORT */ - 285, /* WAL => ABORT */ + 286, /* AFTER => ABORT */ + 286, /* ATTACH => ABORT */ + 286, /* BEFORE => ABORT */ + 286, /* BEGIN => ABORT */ + 286, /* BITAND => ABORT */ + 286, /* BITNOT => ABORT */ + 286, /* BITOR => ABORT */ + 286, /* BLOCKS => ABORT */ + 286, /* CHANGE => ABORT */ + 286, /* COMMA => ABORT */ + 286, /* CONCAT => ABORT */ + 286, /* CONFLICT => ABORT */ + 286, /* COPY => ABORT */ + 286, /* DEFERRED => ABORT */ + 286, /* DELIMITERS => ABORT */ + 286, /* DETACH => ABORT */ + 286, /* DIVIDE => ABORT */ + 286, /* DOT => ABORT */ + 286, /* EACH => ABORT */ + 286, /* FAIL => ABORT */ + 286, /* FILE => ABORT */ + 286, /* FOR => ABORT */ + 286, /* GLOB => ABORT */ + 286, /* ID => ABORT */ + 286, /* IMMEDIATE => ABORT */ + 286, /* IMPORT => ABORT */ + 286, /* INITIALLY => ABORT */ + 286, /* INSTEAD => ABORT */ + 286, /* ISNULL => ABORT */ + 286, /* KEY => ABORT */ + 286, /* MODULES => ABORT */ + 286, /* NK_BITNOT => ABORT */ + 286, /* NK_SEMI => ABORT */ + 286, /* NOTNULL => ABORT */ + 286, /* OF => ABORT */ + 286, /* PLUS => ABORT */ + 286, /* PRIVILEGE => ABORT */ + 286, /* RAISE => ABORT */ + 286, /* RESTRICT => ABORT */ + 286, /* ROW => ABORT */ + 286, /* SEMI => ABORT */ + 286, /* STAR => ABORT */ + 286, /* STATEMENT => ABORT */ + 286, /* STRICT => ABORT */ + 286, /* STRING => ABORT */ + 286, /* TIMES => ABORT */ + 286, /* VALUES => ABORT */ + 286, /* VARIABLE => ABORT */ + 286, /* VIEW => ABORT */ + 286, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1625,359 +1578,360 @@ static const char *const yyTokenName[] = { /* 128 */ "MEDIUMBLOB", /* 129 */ "BLOB", /* 130 */ "VARBINARY", - /* 131 */ "DECIMAL", - /* 132 */ "COMMENT", - /* 133 */ "MAX_DELAY", - /* 134 */ "WATERMARK", - /* 135 */ "ROLLUP", - /* 136 */ "TTL", - /* 137 */ "SMA", - /* 138 */ "DELETE_MARK", - /* 139 */ "FIRST", - /* 140 */ "LAST", - /* 141 */ "SHOW", - /* 142 */ "PRIVILEGES", - /* 143 */ "DATABASES", - /* 144 */ "TABLES", - /* 145 */ "STABLES", - /* 146 */ "MNODES", - /* 147 */ "QNODES", - /* 148 */ "FUNCTIONS", - /* 149 */ "INDEXES", - /* 150 */ "ACCOUNTS", - /* 151 */ "APPS", - /* 152 */ "CONNECTIONS", - /* 153 */ "LICENCES", - /* 154 */ "GRANTS", - /* 155 */ "QUERIES", - /* 156 */ "SCORES", - /* 157 */ "TOPICS", - /* 158 */ "VARIABLES", - /* 159 */ "CLUSTER", - /* 160 */ "BNODES", - /* 161 */ "SNODES", - /* 162 */ "TRANSACTIONS", - /* 163 */ "DISTRIBUTED", - /* 164 */ "CONSUMERS", - /* 165 */ "SUBSCRIPTIONS", - /* 166 */ "VNODES", - /* 167 */ "ALIVE", - /* 168 */ "LIKE", - /* 169 */ "TBNAME", - /* 170 */ "QTAGS", - /* 171 */ "AS", - /* 172 */ "INDEX", - /* 173 */ "FUNCTION", - /* 174 */ "INTERVAL", - /* 175 */ "COUNT", - /* 176 */ "LAST_ROW", - /* 177 */ "TOPIC", - /* 178 */ "META", - /* 179 */ "CONSUMER", - /* 180 */ "GROUP", - /* 181 */ "DESC", - /* 182 */ "DESCRIBE", - /* 183 */ "RESET", - /* 184 */ "QUERY", - /* 185 */ "CACHE", - /* 186 */ "EXPLAIN", - /* 187 */ "ANALYZE", - /* 188 */ "VERBOSE", - /* 189 */ "NK_BOOL", - /* 190 */ "RATIO", - /* 191 */ "NK_FLOAT", - /* 192 */ "OUTPUTTYPE", - /* 193 */ "AGGREGATE", - /* 194 */ "BUFSIZE", - /* 195 */ "LANGUAGE", - /* 196 */ "REPLACE", - /* 197 */ "STREAM", - /* 198 */ "INTO", - /* 199 */ "PAUSE", - /* 200 */ "RESUME", - /* 201 */ "TRIGGER", - /* 202 */ "AT_ONCE", - /* 203 */ "WINDOW_CLOSE", - /* 204 */ "IGNORE", - /* 205 */ "EXPIRED", - /* 206 */ "FILL_HISTORY", - /* 207 */ "UPDATE", - /* 208 */ "SUBTABLE", - /* 209 */ "UNTREATED", - /* 210 */ "KILL", - /* 211 */ "CONNECTION", - /* 212 */ "TRANSACTION", - /* 213 */ "BALANCE", - /* 214 */ "VGROUP", - /* 215 */ "LEADER", - /* 216 */ "MERGE", - /* 217 */ "REDISTRIBUTE", - /* 218 */ "SPLIT", - /* 219 */ "DELETE", - /* 220 */ "INSERT", - /* 221 */ "NULL", - /* 222 */ "NK_QUESTION", - /* 223 */ "NK_ARROW", - /* 224 */ "ROWTS", - /* 225 */ "QSTART", - /* 226 */ "QEND", - /* 227 */ "QDURATION", - /* 228 */ "WSTART", - /* 229 */ "WEND", - /* 230 */ "WDURATION", - /* 231 */ "IROWTS", - /* 232 */ "ISFILLED", - /* 233 */ "CAST", - /* 234 */ "NOW", - /* 235 */ "TODAY", - /* 236 */ "TIMEZONE", - /* 237 */ "CLIENT_VERSION", - /* 238 */ "SERVER_VERSION", - /* 239 */ "SERVER_STATUS", - /* 240 */ "CURRENT_USER", - /* 241 */ "CASE", - /* 242 */ "WHEN", - /* 243 */ "THEN", - /* 244 */ "ELSE", - /* 245 */ "BETWEEN", - /* 246 */ "IS", - /* 247 */ "NK_LT", - /* 248 */ "NK_GT", - /* 249 */ "NK_LE", - /* 250 */ "NK_GE", - /* 251 */ "NK_NE", - /* 252 */ "MATCH", - /* 253 */ "NMATCH", - /* 254 */ "CONTAINS", - /* 255 */ "IN", - /* 256 */ "JOIN", - /* 257 */ "INNER", - /* 258 */ "SELECT", - /* 259 */ "DISTINCT", - /* 260 */ "WHERE", - /* 261 */ "PARTITION", - /* 262 */ "BY", - /* 263 */ "SESSION", - /* 264 */ "STATE_WINDOW", - /* 265 */ "EVENT_WINDOW", - /* 266 */ "SLIDING", - /* 267 */ "FILL", - /* 268 */ "VALUE", - /* 269 */ "VALUE_F", - /* 270 */ "NONE", - /* 271 */ "PREV", - /* 272 */ "NULL_F", - /* 273 */ "LINEAR", - /* 274 */ "NEXT", - /* 275 */ "HAVING", - /* 276 */ "RANGE", - /* 277 */ "EVERY", - /* 278 */ "ORDER", - /* 279 */ "SLIMIT", - /* 280 */ "SOFFSET", - /* 281 */ "LIMIT", - /* 282 */ "OFFSET", - /* 283 */ "ASC", - /* 284 */ "NULLS", - /* 285 */ "ABORT", - /* 286 */ "AFTER", - /* 287 */ "ATTACH", - /* 288 */ "BEFORE", - /* 289 */ "BEGIN", - /* 290 */ "BITAND", - /* 291 */ "BITNOT", - /* 292 */ "BITOR", - /* 293 */ "BLOCKS", - /* 294 */ "CHANGE", - /* 295 */ "COMMA", - /* 296 */ "CONCAT", - /* 297 */ "CONFLICT", - /* 298 */ "COPY", - /* 299 */ "DEFERRED", - /* 300 */ "DELIMITERS", - /* 301 */ "DETACH", - /* 302 */ "DIVIDE", - /* 303 */ "DOT", - /* 304 */ "EACH", - /* 305 */ "FAIL", - /* 306 */ "FILE", - /* 307 */ "FOR", - /* 308 */ "GLOB", - /* 309 */ "ID", - /* 310 */ "IMMEDIATE", - /* 311 */ "IMPORT", - /* 312 */ "INITIALLY", - /* 313 */ "INSTEAD", - /* 314 */ "ISNULL", - /* 315 */ "KEY", - /* 316 */ "MODULES", - /* 317 */ "NK_BITNOT", - /* 318 */ "NK_SEMI", - /* 319 */ "NOTNULL", - /* 320 */ "OF", - /* 321 */ "PLUS", - /* 322 */ "PRIVILEGE", - /* 323 */ "RAISE", - /* 324 */ "RESTRICT", - /* 325 */ "ROW", - /* 326 */ "SEMI", - /* 327 */ "STAR", - /* 328 */ "STATEMENT", - /* 329 */ "STRICT", - /* 330 */ "STRING", - /* 331 */ "TIMES", - /* 332 */ "VALUES", - /* 333 */ "VARIABLE", - /* 334 */ "VIEW", - /* 335 */ "WAL", - /* 336 */ "cmd", - /* 337 */ "account_options", - /* 338 */ "alter_account_options", - /* 339 */ "literal", - /* 340 */ "alter_account_option", - /* 341 */ "user_name", - /* 342 */ "sysinfo_opt", - /* 343 */ "privileges", - /* 344 */ "priv_level", - /* 345 */ "with_opt", - /* 346 */ "priv_type_list", - /* 347 */ "priv_type", - /* 348 */ "db_name", - /* 349 */ "table_name", - /* 350 */ "topic_name", - /* 351 */ "search_condition", - /* 352 */ "dnode_endpoint", - /* 353 */ "force_opt", - /* 354 */ "unsafe_opt", - /* 355 */ "not_exists_opt", - /* 356 */ "db_options", - /* 357 */ "exists_opt", - /* 358 */ "alter_db_options", - /* 359 */ "speed_opt", - /* 360 */ "start_opt", - /* 361 */ "end_opt", - /* 362 */ "integer_list", - /* 363 */ "variable_list", - /* 364 */ "retention_list", - /* 365 */ "signed", - /* 366 */ "alter_db_option", - /* 367 */ "retention", - /* 368 */ "full_table_name", - /* 369 */ "column_def_list", - /* 370 */ "tags_def_opt", - /* 371 */ "table_options", - /* 372 */ "multi_create_clause", - /* 373 */ "tags_def", - /* 374 */ "multi_drop_clause", - /* 375 */ "alter_table_clause", - /* 376 */ "alter_table_options", - /* 377 */ "column_name", - /* 378 */ "type_name", - /* 379 */ "signed_literal", - /* 380 */ "create_subtable_clause", - /* 381 */ "specific_cols_opt", - /* 382 */ "expression_list", - /* 383 */ "drop_table_clause", - /* 384 */ "col_name_list", - /* 385 */ "column_def", - /* 386 */ "duration_list", - /* 387 */ "rollup_func_list", - /* 388 */ "alter_table_option", - /* 389 */ "duration_literal", - /* 390 */ "rollup_func_name", - /* 391 */ "function_name", - /* 392 */ "col_name", - /* 393 */ "db_name_cond_opt", - /* 394 */ "like_pattern_opt", - /* 395 */ "table_name_cond", - /* 396 */ "from_db_opt", - /* 397 */ "tag_list_opt", - /* 398 */ "tag_item", - /* 399 */ "column_alias", - /* 400 */ "full_index_name", - /* 401 */ "index_options", - /* 402 */ "index_name", - /* 403 */ "func_list", - /* 404 */ "sliding_opt", - /* 405 */ "sma_stream_opt", - /* 406 */ "func", - /* 407 */ "sma_func_name", - /* 408 */ "query_or_subquery", - /* 409 */ "cgroup_name", - /* 410 */ "analyze_opt", - /* 411 */ "explain_options", - /* 412 */ "insert_query", - /* 413 */ "or_replace_opt", - /* 414 */ "agg_func_opt", - /* 415 */ "bufsize_opt", - /* 416 */ "language_opt", - /* 417 */ "stream_name", - /* 418 */ "stream_options", - /* 419 */ "col_list_opt", - /* 420 */ "tag_def_or_ref_opt", - /* 421 */ "subtable_opt", - /* 422 */ "ignore_opt", - /* 423 */ "expression", - /* 424 */ "dnode_list", - /* 425 */ "where_clause_opt", - /* 426 */ "literal_func", - /* 427 */ "literal_list", - /* 428 */ "table_alias", - /* 429 */ "expr_or_subquery", - /* 430 */ "pseudo_column", - /* 431 */ "column_reference", - /* 432 */ "function_expression", - /* 433 */ "case_when_expression", - /* 434 */ "star_func", - /* 435 */ "star_func_para_list", - /* 436 */ "noarg_func", - /* 437 */ "other_para_list", - /* 438 */ "star_func_para", - /* 439 */ "when_then_list", - /* 440 */ "case_when_else_opt", - /* 441 */ "common_expression", - /* 442 */ "when_then_expr", - /* 443 */ "predicate", - /* 444 */ "compare_op", - /* 445 */ "in_op", - /* 446 */ "in_predicate_value", - /* 447 */ "boolean_value_expression", - /* 448 */ "boolean_primary", - /* 449 */ "from_clause_opt", - /* 450 */ "table_reference_list", - /* 451 */ "table_reference", - /* 452 */ "table_primary", - /* 453 */ "joined_table", - /* 454 */ "alias_opt", - /* 455 */ "subquery", - /* 456 */ "parenthesized_joined_table", - /* 457 */ "join_type", - /* 458 */ "query_specification", - /* 459 */ "set_quantifier_opt", - /* 460 */ "select_list", - /* 461 */ "partition_by_clause_opt", - /* 462 */ "range_opt", - /* 463 */ "every_opt", - /* 464 */ "fill_opt", - /* 465 */ "twindow_clause_opt", - /* 466 */ "group_by_clause_opt", - /* 467 */ "having_clause_opt", - /* 468 */ "select_item", - /* 469 */ "partition_list", - /* 470 */ "partition_item", - /* 471 */ "fill_mode", - /* 472 */ "group_by_list", - /* 473 */ "query_expression", - /* 474 */ "query_simple", - /* 475 */ "order_by_clause_opt", - /* 476 */ "slimit_clause_opt", - /* 477 */ "limit_clause_opt", - /* 478 */ "union_query_expression", - /* 479 */ "query_simple_or_subquery", - /* 480 */ "sort_specification_list", - /* 481 */ "sort_specification", - /* 482 */ "ordering_specification_opt", - /* 483 */ "null_ordering_opt", + /* 131 */ "GEOMETRY", + /* 132 */ "DECIMAL", + /* 133 */ "COMMENT", + /* 134 */ "MAX_DELAY", + /* 135 */ "WATERMARK", + /* 136 */ "ROLLUP", + /* 137 */ "TTL", + /* 138 */ "SMA", + /* 139 */ "DELETE_MARK", + /* 140 */ "FIRST", + /* 141 */ "LAST", + /* 142 */ "SHOW", + /* 143 */ "PRIVILEGES", + /* 144 */ "DATABASES", + /* 145 */ "TABLES", + /* 146 */ "STABLES", + /* 147 */ "MNODES", + /* 148 */ "QNODES", + /* 149 */ "FUNCTIONS", + /* 150 */ "INDEXES", + /* 151 */ "ACCOUNTS", + /* 152 */ "APPS", + /* 153 */ "CONNECTIONS", + /* 154 */ "LICENCES", + /* 155 */ "GRANTS", + /* 156 */ "QUERIES", + /* 157 */ "SCORES", + /* 158 */ "TOPICS", + /* 159 */ "VARIABLES", + /* 160 */ "CLUSTER", + /* 161 */ "BNODES", + /* 162 */ "SNODES", + /* 163 */ "TRANSACTIONS", + /* 164 */ "DISTRIBUTED", + /* 165 */ "CONSUMERS", + /* 166 */ "SUBSCRIPTIONS", + /* 167 */ "VNODES", + /* 168 */ "ALIVE", + /* 169 */ "LIKE", + /* 170 */ "TBNAME", + /* 171 */ "QTAGS", + /* 172 */ "AS", + /* 173 */ "INDEX", + /* 174 */ "FUNCTION", + /* 175 */ "INTERVAL", + /* 176 */ "COUNT", + /* 177 */ "LAST_ROW", + /* 178 */ "TOPIC", + /* 179 */ "META", + /* 180 */ "CONSUMER", + /* 181 */ "GROUP", + /* 182 */ "DESC", + /* 183 */ "DESCRIBE", + /* 184 */ "RESET", + /* 185 */ "QUERY", + /* 186 */ "CACHE", + /* 187 */ "EXPLAIN", + /* 188 */ "ANALYZE", + /* 189 */ "VERBOSE", + /* 190 */ "NK_BOOL", + /* 191 */ "RATIO", + /* 192 */ "NK_FLOAT", + /* 193 */ "OUTPUTTYPE", + /* 194 */ "AGGREGATE", + /* 195 */ "BUFSIZE", + /* 196 */ "LANGUAGE", + /* 197 */ "REPLACE", + /* 198 */ "STREAM", + /* 199 */ "INTO", + /* 200 */ "PAUSE", + /* 201 */ "RESUME", + /* 202 */ "TRIGGER", + /* 203 */ "AT_ONCE", + /* 204 */ "WINDOW_CLOSE", + /* 205 */ "IGNORE", + /* 206 */ "EXPIRED", + /* 207 */ "FILL_HISTORY", + /* 208 */ "UPDATE", + /* 209 */ "SUBTABLE", + /* 210 */ "UNTREATED", + /* 211 */ "KILL", + /* 212 */ "CONNECTION", + /* 213 */ "TRANSACTION", + /* 214 */ "BALANCE", + /* 215 */ "VGROUP", + /* 216 */ "LEADER", + /* 217 */ "MERGE", + /* 218 */ "REDISTRIBUTE", + /* 219 */ "SPLIT", + /* 220 */ "DELETE", + /* 221 */ "INSERT", + /* 222 */ "NULL", + /* 223 */ "NK_QUESTION", + /* 224 */ "NK_ARROW", + /* 225 */ "ROWTS", + /* 226 */ "QSTART", + /* 227 */ "QEND", + /* 228 */ "QDURATION", + /* 229 */ "WSTART", + /* 230 */ "WEND", + /* 231 */ "WDURATION", + /* 232 */ "IROWTS", + /* 233 */ "ISFILLED", + /* 234 */ "CAST", + /* 235 */ "NOW", + /* 236 */ "TODAY", + /* 237 */ "TIMEZONE", + /* 238 */ "CLIENT_VERSION", + /* 239 */ "SERVER_VERSION", + /* 240 */ "SERVER_STATUS", + /* 241 */ "CURRENT_USER", + /* 242 */ "CASE", + /* 243 */ "WHEN", + /* 244 */ "THEN", + /* 245 */ "ELSE", + /* 246 */ "BETWEEN", + /* 247 */ "IS", + /* 248 */ "NK_LT", + /* 249 */ "NK_GT", + /* 250 */ "NK_LE", + /* 251 */ "NK_GE", + /* 252 */ "NK_NE", + /* 253 */ "MATCH", + /* 254 */ "NMATCH", + /* 255 */ "CONTAINS", + /* 256 */ "IN", + /* 257 */ "JOIN", + /* 258 */ "INNER", + /* 259 */ "SELECT", + /* 260 */ "DISTINCT", + /* 261 */ "WHERE", + /* 262 */ "PARTITION", + /* 263 */ "BY", + /* 264 */ "SESSION", + /* 265 */ "STATE_WINDOW", + /* 266 */ "EVENT_WINDOW", + /* 267 */ "SLIDING", + /* 268 */ "FILL", + /* 269 */ "VALUE", + /* 270 */ "VALUE_F", + /* 271 */ "NONE", + /* 272 */ "PREV", + /* 273 */ "NULL_F", + /* 274 */ "LINEAR", + /* 275 */ "NEXT", + /* 276 */ "HAVING", + /* 277 */ "RANGE", + /* 278 */ "EVERY", + /* 279 */ "ORDER", + /* 280 */ "SLIMIT", + /* 281 */ "SOFFSET", + /* 282 */ "LIMIT", + /* 283 */ "OFFSET", + /* 284 */ "ASC", + /* 285 */ "NULLS", + /* 286 */ "ABORT", + /* 287 */ "AFTER", + /* 288 */ "ATTACH", + /* 289 */ "BEFORE", + /* 290 */ "BEGIN", + /* 291 */ "BITAND", + /* 292 */ "BITNOT", + /* 293 */ "BITOR", + /* 294 */ "BLOCKS", + /* 295 */ "CHANGE", + /* 296 */ "COMMA", + /* 297 */ "CONCAT", + /* 298 */ "CONFLICT", + /* 299 */ "COPY", + /* 300 */ "DEFERRED", + /* 301 */ "DELIMITERS", + /* 302 */ "DETACH", + /* 303 */ "DIVIDE", + /* 304 */ "DOT", + /* 305 */ "EACH", + /* 306 */ "FAIL", + /* 307 */ "FILE", + /* 308 */ "FOR", + /* 309 */ "GLOB", + /* 310 */ "ID", + /* 311 */ "IMMEDIATE", + /* 312 */ "IMPORT", + /* 313 */ "INITIALLY", + /* 314 */ "INSTEAD", + /* 315 */ "ISNULL", + /* 316 */ "KEY", + /* 317 */ "MODULES", + /* 318 */ "NK_BITNOT", + /* 319 */ "NK_SEMI", + /* 320 */ "NOTNULL", + /* 321 */ "OF", + /* 322 */ "PLUS", + /* 323 */ "PRIVILEGE", + /* 324 */ "RAISE", + /* 325 */ "RESTRICT", + /* 326 */ "ROW", + /* 327 */ "SEMI", + /* 328 */ "STAR", + /* 329 */ "STATEMENT", + /* 330 */ "STRICT", + /* 331 */ "STRING", + /* 332 */ "TIMES", + /* 333 */ "VALUES", + /* 334 */ "VARIABLE", + /* 335 */ "VIEW", + /* 336 */ "WAL", + /* 337 */ "cmd", + /* 338 */ "account_options", + /* 339 */ "alter_account_options", + /* 340 */ "literal", + /* 341 */ "alter_account_option", + /* 342 */ "user_name", + /* 343 */ "sysinfo_opt", + /* 344 */ "privileges", + /* 345 */ "priv_level", + /* 346 */ "with_opt", + /* 347 */ "priv_type_list", + /* 348 */ "priv_type", + /* 349 */ "db_name", + /* 350 */ "table_name", + /* 351 */ "topic_name", + /* 352 */ "search_condition", + /* 353 */ "dnode_endpoint", + /* 354 */ "force_opt", + /* 355 */ "unsafe_opt", + /* 356 */ "not_exists_opt", + /* 357 */ "db_options", + /* 358 */ "exists_opt", + /* 359 */ "alter_db_options", + /* 360 */ "speed_opt", + /* 361 */ "start_opt", + /* 362 */ "end_opt", + /* 363 */ "integer_list", + /* 364 */ "variable_list", + /* 365 */ "retention_list", + /* 366 */ "signed", + /* 367 */ "alter_db_option", + /* 368 */ "retention", + /* 369 */ "full_table_name", + /* 370 */ "column_def_list", + /* 371 */ "tags_def_opt", + /* 372 */ "table_options", + /* 373 */ "multi_create_clause", + /* 374 */ "tags_def", + /* 375 */ "multi_drop_clause", + /* 376 */ "alter_table_clause", + /* 377 */ "alter_table_options", + /* 378 */ "column_name", + /* 379 */ "type_name", + /* 380 */ "signed_literal", + /* 381 */ "create_subtable_clause", + /* 382 */ "specific_cols_opt", + /* 383 */ "expression_list", + /* 384 */ "drop_table_clause", + /* 385 */ "col_name_list", + /* 386 */ "column_def", + /* 387 */ "duration_list", + /* 388 */ "rollup_func_list", + /* 389 */ "alter_table_option", + /* 390 */ "duration_literal", + /* 391 */ "rollup_func_name", + /* 392 */ "function_name", + /* 393 */ "col_name", + /* 394 */ "db_name_cond_opt", + /* 395 */ "like_pattern_opt", + /* 396 */ "table_name_cond", + /* 397 */ "from_db_opt", + /* 398 */ "tag_list_opt", + /* 399 */ "tag_item", + /* 400 */ "column_alias", + /* 401 */ "full_index_name", + /* 402 */ "index_options", + /* 403 */ "index_name", + /* 404 */ "func_list", + /* 405 */ "sliding_opt", + /* 406 */ "sma_stream_opt", + /* 407 */ "func", + /* 408 */ "sma_func_name", + /* 409 */ "query_or_subquery", + /* 410 */ "cgroup_name", + /* 411 */ "analyze_opt", + /* 412 */ "explain_options", + /* 413 */ "insert_query", + /* 414 */ "or_replace_opt", + /* 415 */ "agg_func_opt", + /* 416 */ "bufsize_opt", + /* 417 */ "language_opt", + /* 418 */ "stream_name", + /* 419 */ "stream_options", + /* 420 */ "col_list_opt", + /* 421 */ "tag_def_or_ref_opt", + /* 422 */ "subtable_opt", + /* 423 */ "ignore_opt", + /* 424 */ "expression", + /* 425 */ "dnode_list", + /* 426 */ "where_clause_opt", + /* 427 */ "literal_func", + /* 428 */ "literal_list", + /* 429 */ "table_alias", + /* 430 */ "expr_or_subquery", + /* 431 */ "pseudo_column", + /* 432 */ "column_reference", + /* 433 */ "function_expression", + /* 434 */ "case_when_expression", + /* 435 */ "star_func", + /* 436 */ "star_func_para_list", + /* 437 */ "noarg_func", + /* 438 */ "other_para_list", + /* 439 */ "star_func_para", + /* 440 */ "when_then_list", + /* 441 */ "case_when_else_opt", + /* 442 */ "common_expression", + /* 443 */ "when_then_expr", + /* 444 */ "predicate", + /* 445 */ "compare_op", + /* 446 */ "in_op", + /* 447 */ "in_predicate_value", + /* 448 */ "boolean_value_expression", + /* 449 */ "boolean_primary", + /* 450 */ "from_clause_opt", + /* 451 */ "table_reference_list", + /* 452 */ "table_reference", + /* 453 */ "table_primary", + /* 454 */ "joined_table", + /* 455 */ "alias_opt", + /* 456 */ "subquery", + /* 457 */ "parenthesized_joined_table", + /* 458 */ "join_type", + /* 459 */ "query_specification", + /* 460 */ "set_quantifier_opt", + /* 461 */ "select_list", + /* 462 */ "partition_by_clause_opt", + /* 463 */ "range_opt", + /* 464 */ "every_opt", + /* 465 */ "fill_opt", + /* 466 */ "twindow_clause_opt", + /* 467 */ "group_by_clause_opt", + /* 468 */ "having_clause_opt", + /* 469 */ "select_item", + /* 470 */ "partition_list", + /* 471 */ "partition_item", + /* 472 */ "fill_mode", + /* 473 */ "group_by_list", + /* 474 */ "query_expression", + /* 475 */ "query_simple", + /* 476 */ "order_by_clause_opt", + /* 477 */ "slimit_clause_opt", + /* 478 */ "limit_clause_opt", + /* 479 */ "union_query_expression", + /* 480 */ "query_simple_or_subquery", + /* 481 */ "sort_specification_list", + /* 482 */ "sort_specification", + /* 483 */ "ordering_specification_opt", + /* 484 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2187,398 +2141,399 @@ static const char *const yyRuleName[] = { /* 199 */ "type_name ::= MEDIUMBLOB", /* 200 */ "type_name ::= BLOB", /* 201 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 202 */ "type_name ::= DECIMAL", - /* 203 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 204 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 205 */ "tags_def_opt ::=", - /* 206 */ "tags_def_opt ::= tags_def", - /* 207 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 208 */ "table_options ::=", - /* 209 */ "table_options ::= table_options COMMENT NK_STRING", - /* 210 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 211 */ "table_options ::= table_options WATERMARK duration_list", - /* 212 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 213 */ "table_options ::= table_options TTL NK_INTEGER", - /* 214 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 215 */ "table_options ::= table_options DELETE_MARK duration_list", - /* 216 */ "alter_table_options ::= alter_table_option", - /* 217 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 218 */ "alter_table_option ::= COMMENT NK_STRING", - /* 219 */ "alter_table_option ::= TTL NK_INTEGER", - /* 220 */ "duration_list ::= duration_literal", - /* 221 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 222 */ "rollup_func_list ::= rollup_func_name", - /* 223 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 224 */ "rollup_func_name ::= function_name", - /* 225 */ "rollup_func_name ::= FIRST", - /* 226 */ "rollup_func_name ::= LAST", - /* 227 */ "col_name_list ::= col_name", - /* 228 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 229 */ "col_name ::= column_name", - /* 230 */ "cmd ::= SHOW DNODES", - /* 231 */ "cmd ::= SHOW USERS", - /* 232 */ "cmd ::= SHOW USER PRIVILEGES", - /* 233 */ "cmd ::= SHOW DATABASES", - /* 234 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", - /* 235 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 236 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 237 */ "cmd ::= SHOW MNODES", - /* 238 */ "cmd ::= SHOW QNODES", - /* 239 */ "cmd ::= SHOW FUNCTIONS", - /* 240 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 241 */ "cmd ::= SHOW STREAMS", - /* 242 */ "cmd ::= SHOW ACCOUNTS", - /* 243 */ "cmd ::= SHOW APPS", - /* 244 */ "cmd ::= SHOW CONNECTIONS", - /* 245 */ "cmd ::= SHOW LICENCES", - /* 246 */ "cmd ::= SHOW GRANTS", - /* 247 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 248 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 249 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 250 */ "cmd ::= SHOW QUERIES", - /* 251 */ "cmd ::= SHOW SCORES", - /* 252 */ "cmd ::= SHOW TOPICS", - /* 253 */ "cmd ::= SHOW VARIABLES", - /* 254 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 255 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 256 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 257 */ "cmd ::= SHOW BNODES", - /* 258 */ "cmd ::= SHOW SNODES", - /* 259 */ "cmd ::= SHOW CLUSTER", - /* 260 */ "cmd ::= SHOW TRANSACTIONS", - /* 261 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 262 */ "cmd ::= SHOW CONSUMERS", - /* 263 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 264 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 265 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 266 */ "cmd ::= SHOW VNODES NK_INTEGER", - /* 267 */ "cmd ::= SHOW VNODES NK_STRING", - /* 268 */ "cmd ::= SHOW db_name_cond_opt ALIVE", - /* 269 */ "cmd ::= SHOW CLUSTER ALIVE", - /* 270 */ "db_name_cond_opt ::=", - /* 271 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 272 */ "like_pattern_opt ::=", - /* 273 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 274 */ "table_name_cond ::= table_name", - /* 275 */ "from_db_opt ::=", - /* 276 */ "from_db_opt ::= FROM db_name", - /* 277 */ "tag_list_opt ::=", - /* 278 */ "tag_list_opt ::= tag_item", - /* 279 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 280 */ "tag_item ::= TBNAME", - /* 281 */ "tag_item ::= QTAGS", - /* 282 */ "tag_item ::= column_name", - /* 283 */ "tag_item ::= column_name column_alias", - /* 284 */ "tag_item ::= column_name AS column_alias", - /* 285 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options", - /* 286 */ "cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP", - /* 287 */ "cmd ::= DROP INDEX exists_opt full_index_name", - /* 288 */ "full_index_name ::= index_name", - /* 289 */ "full_index_name ::= db_name NK_DOT index_name", - /* 290 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 291 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", - /* 292 */ "func_list ::= func", - /* 293 */ "func_list ::= func_list NK_COMMA func", - /* 294 */ "func ::= sma_func_name NK_LP expression_list NK_RP", - /* 295 */ "sma_func_name ::= function_name", - /* 296 */ "sma_func_name ::= COUNT", - /* 297 */ "sma_func_name ::= FIRST", - /* 298 */ "sma_func_name ::= LAST", - /* 299 */ "sma_func_name ::= LAST_ROW", - /* 300 */ "sma_stream_opt ::=", - /* 301 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 302 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 303 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 304 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 305 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 306 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", - /* 307 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 308 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", - /* 309 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 310 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 311 */ "cmd ::= DESC full_table_name", - /* 312 */ "cmd ::= DESCRIBE full_table_name", - /* 313 */ "cmd ::= RESET QUERY CACHE", - /* 314 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 315 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", - /* 316 */ "analyze_opt ::=", - /* 317 */ "analyze_opt ::= ANALYZE", - /* 318 */ "explain_options ::=", - /* 319 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 320 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 321 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", - /* 322 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 323 */ "agg_func_opt ::=", - /* 324 */ "agg_func_opt ::= AGGREGATE", - /* 325 */ "bufsize_opt ::=", - /* 326 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 327 */ "language_opt ::=", - /* 328 */ "language_opt ::= LANGUAGE NK_STRING", - /* 329 */ "or_replace_opt ::=", - /* 330 */ "or_replace_opt ::= OR REPLACE", - /* 331 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery", - /* 332 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 333 */ "cmd ::= PAUSE STREAM exists_opt stream_name", - /* 334 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", - /* 335 */ "col_list_opt ::=", - /* 336 */ "col_list_opt ::= NK_LP col_name_list NK_RP", - /* 337 */ "tag_def_or_ref_opt ::=", - /* 338 */ "tag_def_or_ref_opt ::= tags_def", - /* 339 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", - /* 340 */ "stream_options ::=", - /* 341 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 342 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 343 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 344 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 345 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 346 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 347 */ "stream_options ::= stream_options DELETE_MARK duration_literal", - /* 348 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", - /* 349 */ "subtable_opt ::=", - /* 350 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 351 */ "ignore_opt ::=", - /* 352 */ "ignore_opt ::= IGNORE UNTREATED", - /* 353 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 354 */ "cmd ::= KILL QUERY NK_STRING", - /* 355 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 356 */ "cmd ::= BALANCE VGROUP", - /* 357 */ "cmd ::= BALANCE VGROUP LEADER", - /* 358 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 359 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 360 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 361 */ "dnode_list ::= DNODE NK_INTEGER", - /* 362 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 363 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 364 */ "cmd ::= query_or_subquery", - /* 365 */ "cmd ::= insert_query", - /* 366 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 367 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 368 */ "literal ::= NK_INTEGER", - /* 369 */ "literal ::= NK_FLOAT", - /* 370 */ "literal ::= NK_STRING", - /* 371 */ "literal ::= NK_BOOL", - /* 372 */ "literal ::= TIMESTAMP NK_STRING", - /* 373 */ "literal ::= duration_literal", - /* 374 */ "literal ::= NULL", - /* 375 */ "literal ::= NK_QUESTION", - /* 376 */ "duration_literal ::= NK_VARIABLE", - /* 377 */ "signed ::= NK_INTEGER", - /* 378 */ "signed ::= NK_PLUS NK_INTEGER", - /* 379 */ "signed ::= NK_MINUS NK_INTEGER", - /* 380 */ "signed ::= NK_FLOAT", - /* 381 */ "signed ::= NK_PLUS NK_FLOAT", - /* 382 */ "signed ::= NK_MINUS NK_FLOAT", - /* 383 */ "signed_literal ::= signed", - /* 384 */ "signed_literal ::= NK_STRING", - /* 385 */ "signed_literal ::= NK_BOOL", - /* 386 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 387 */ "signed_literal ::= duration_literal", - /* 388 */ "signed_literal ::= NULL", - /* 389 */ "signed_literal ::= literal_func", - /* 390 */ "signed_literal ::= NK_QUESTION", - /* 391 */ "literal_list ::= signed_literal", - /* 392 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 393 */ "db_name ::= NK_ID", - /* 394 */ "table_name ::= NK_ID", - /* 395 */ "column_name ::= NK_ID", - /* 396 */ "function_name ::= NK_ID", - /* 397 */ "table_alias ::= NK_ID", - /* 398 */ "column_alias ::= NK_ID", - /* 399 */ "user_name ::= NK_ID", - /* 400 */ "topic_name ::= NK_ID", - /* 401 */ "stream_name ::= NK_ID", - /* 402 */ "cgroup_name ::= NK_ID", - /* 403 */ "index_name ::= NK_ID", - /* 404 */ "expr_or_subquery ::= expression", - /* 405 */ "expression ::= literal", - /* 406 */ "expression ::= pseudo_column", - /* 407 */ "expression ::= column_reference", - /* 408 */ "expression ::= function_expression", - /* 409 */ "expression ::= case_when_expression", - /* 410 */ "expression ::= NK_LP expression NK_RP", - /* 411 */ "expression ::= NK_PLUS expr_or_subquery", - /* 412 */ "expression ::= NK_MINUS expr_or_subquery", - /* 413 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 414 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 415 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 416 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 417 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 418 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 419 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 420 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 421 */ "expression_list ::= expr_or_subquery", - /* 422 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 423 */ "column_reference ::= column_name", - /* 424 */ "column_reference ::= table_name NK_DOT column_name", - /* 425 */ "pseudo_column ::= ROWTS", - /* 426 */ "pseudo_column ::= TBNAME", - /* 427 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 428 */ "pseudo_column ::= QSTART", - /* 429 */ "pseudo_column ::= QEND", - /* 430 */ "pseudo_column ::= QDURATION", - /* 431 */ "pseudo_column ::= WSTART", - /* 432 */ "pseudo_column ::= WEND", - /* 433 */ "pseudo_column ::= WDURATION", - /* 434 */ "pseudo_column ::= IROWTS", - /* 435 */ "pseudo_column ::= ISFILLED", - /* 436 */ "pseudo_column ::= QTAGS", - /* 437 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 438 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 439 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 440 */ "function_expression ::= literal_func", - /* 441 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 442 */ "literal_func ::= NOW", - /* 443 */ "noarg_func ::= NOW", - /* 444 */ "noarg_func ::= TODAY", - /* 445 */ "noarg_func ::= TIMEZONE", - /* 446 */ "noarg_func ::= DATABASE", - /* 447 */ "noarg_func ::= CLIENT_VERSION", - /* 448 */ "noarg_func ::= SERVER_VERSION", - /* 449 */ "noarg_func ::= SERVER_STATUS", - /* 450 */ "noarg_func ::= CURRENT_USER", - /* 451 */ "noarg_func ::= USER", - /* 452 */ "star_func ::= COUNT", - /* 453 */ "star_func ::= FIRST", - /* 454 */ "star_func ::= LAST", - /* 455 */ "star_func ::= LAST_ROW", - /* 456 */ "star_func_para_list ::= NK_STAR", - /* 457 */ "star_func_para_list ::= other_para_list", - /* 458 */ "other_para_list ::= star_func_para", - /* 459 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 460 */ "star_func_para ::= expr_or_subquery", - /* 461 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 462 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 463 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 464 */ "when_then_list ::= when_then_expr", - /* 465 */ "when_then_list ::= when_then_list when_then_expr", - /* 466 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 467 */ "case_when_else_opt ::=", - /* 468 */ "case_when_else_opt ::= ELSE common_expression", - /* 469 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 470 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 471 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 472 */ "predicate ::= expr_or_subquery IS NULL", - /* 473 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 474 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 475 */ "compare_op ::= NK_LT", - /* 476 */ "compare_op ::= NK_GT", - /* 477 */ "compare_op ::= NK_LE", - /* 478 */ "compare_op ::= NK_GE", - /* 479 */ "compare_op ::= NK_NE", - /* 480 */ "compare_op ::= NK_EQ", - /* 481 */ "compare_op ::= LIKE", - /* 482 */ "compare_op ::= NOT LIKE", - /* 483 */ "compare_op ::= MATCH", - /* 484 */ "compare_op ::= NMATCH", - /* 485 */ "compare_op ::= CONTAINS", - /* 486 */ "in_op ::= IN", - /* 487 */ "in_op ::= NOT IN", - /* 488 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 489 */ "boolean_value_expression ::= boolean_primary", - /* 490 */ "boolean_value_expression ::= NOT boolean_primary", - /* 491 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 492 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 493 */ "boolean_primary ::= predicate", - /* 494 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 495 */ "common_expression ::= expr_or_subquery", - /* 496 */ "common_expression ::= boolean_value_expression", - /* 497 */ "from_clause_opt ::=", - /* 498 */ "from_clause_opt ::= FROM table_reference_list", - /* 499 */ "table_reference_list ::= table_reference", - /* 500 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 501 */ "table_reference ::= table_primary", - /* 502 */ "table_reference ::= joined_table", - /* 503 */ "table_primary ::= table_name alias_opt", - /* 504 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 505 */ "table_primary ::= subquery alias_opt", - /* 506 */ "table_primary ::= parenthesized_joined_table", - /* 507 */ "alias_opt ::=", - /* 508 */ "alias_opt ::= table_alias", - /* 509 */ "alias_opt ::= AS table_alias", - /* 510 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 511 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 512 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 513 */ "join_type ::=", - /* 514 */ "join_type ::= INNER", - /* 515 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 516 */ "set_quantifier_opt ::=", - /* 517 */ "set_quantifier_opt ::= DISTINCT", - /* 518 */ "set_quantifier_opt ::= ALL", - /* 519 */ "select_list ::= select_item", - /* 520 */ "select_list ::= select_list NK_COMMA select_item", - /* 521 */ "select_item ::= NK_STAR", - /* 522 */ "select_item ::= common_expression", - /* 523 */ "select_item ::= common_expression column_alias", - /* 524 */ "select_item ::= common_expression AS column_alias", - /* 525 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 526 */ "where_clause_opt ::=", - /* 527 */ "where_clause_opt ::= WHERE search_condition", - /* 528 */ "partition_by_clause_opt ::=", - /* 529 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 530 */ "partition_list ::= partition_item", - /* 531 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 532 */ "partition_item ::= expr_or_subquery", - /* 533 */ "partition_item ::= expr_or_subquery column_alias", - /* 534 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 535 */ "twindow_clause_opt ::=", - /* 536 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 537 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 538 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 539 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 540 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 541 */ "sliding_opt ::=", - /* 542 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 543 */ "fill_opt ::=", - /* 544 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 545 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 546 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 547 */ "fill_mode ::= NONE", - /* 548 */ "fill_mode ::= PREV", - /* 549 */ "fill_mode ::= NULL", - /* 550 */ "fill_mode ::= NULL_F", - /* 551 */ "fill_mode ::= LINEAR", - /* 552 */ "fill_mode ::= NEXT", - /* 553 */ "group_by_clause_opt ::=", - /* 554 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 555 */ "group_by_list ::= expr_or_subquery", - /* 556 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 557 */ "having_clause_opt ::=", - /* 558 */ "having_clause_opt ::= HAVING search_condition", - /* 559 */ "range_opt ::=", - /* 560 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 561 */ "every_opt ::=", - /* 562 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 563 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 564 */ "query_simple ::= query_specification", - /* 565 */ "query_simple ::= union_query_expression", - /* 566 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 567 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 568 */ "query_simple_or_subquery ::= query_simple", - /* 569 */ "query_simple_or_subquery ::= subquery", - /* 570 */ "query_or_subquery ::= query_expression", - /* 571 */ "query_or_subquery ::= subquery", - /* 572 */ "order_by_clause_opt ::=", - /* 573 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 574 */ "slimit_clause_opt ::=", - /* 575 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 576 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 577 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 578 */ "limit_clause_opt ::=", - /* 579 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 580 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 581 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 582 */ "subquery ::= NK_LP query_expression NK_RP", - /* 583 */ "subquery ::= NK_LP subquery NK_RP", - /* 584 */ "search_condition ::= common_expression", - /* 585 */ "sort_specification_list ::= sort_specification", - /* 586 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 587 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 588 */ "ordering_specification_opt ::=", - /* 589 */ "ordering_specification_opt ::= ASC", - /* 590 */ "ordering_specification_opt ::= DESC", - /* 591 */ "null_ordering_opt ::=", - /* 592 */ "null_ordering_opt ::= NULLS FIRST", - /* 593 */ "null_ordering_opt ::= NULLS LAST", + /* 202 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP", + /* 203 */ "type_name ::= DECIMAL", + /* 204 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 205 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 206 */ "tags_def_opt ::=", + /* 207 */ "tags_def_opt ::= tags_def", + /* 208 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 209 */ "table_options ::=", + /* 210 */ "table_options ::= table_options COMMENT NK_STRING", + /* 211 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 212 */ "table_options ::= table_options WATERMARK duration_list", + /* 213 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 214 */ "table_options ::= table_options TTL NK_INTEGER", + /* 215 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 216 */ "table_options ::= table_options DELETE_MARK duration_list", + /* 217 */ "alter_table_options ::= alter_table_option", + /* 218 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 219 */ "alter_table_option ::= COMMENT NK_STRING", + /* 220 */ "alter_table_option ::= TTL NK_INTEGER", + /* 221 */ "duration_list ::= duration_literal", + /* 222 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 223 */ "rollup_func_list ::= rollup_func_name", + /* 224 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 225 */ "rollup_func_name ::= function_name", + /* 226 */ "rollup_func_name ::= FIRST", + /* 227 */ "rollup_func_name ::= LAST", + /* 228 */ "col_name_list ::= col_name", + /* 229 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 230 */ "col_name ::= column_name", + /* 231 */ "cmd ::= SHOW DNODES", + /* 232 */ "cmd ::= SHOW USERS", + /* 233 */ "cmd ::= SHOW USER PRIVILEGES", + /* 234 */ "cmd ::= SHOW DATABASES", + /* 235 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", + /* 236 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 237 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 238 */ "cmd ::= SHOW MNODES", + /* 239 */ "cmd ::= SHOW QNODES", + /* 240 */ "cmd ::= SHOW FUNCTIONS", + /* 241 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 242 */ "cmd ::= SHOW STREAMS", + /* 243 */ "cmd ::= SHOW ACCOUNTS", + /* 244 */ "cmd ::= SHOW APPS", + /* 245 */ "cmd ::= SHOW CONNECTIONS", + /* 246 */ "cmd ::= SHOW LICENCES", + /* 247 */ "cmd ::= SHOW GRANTS", + /* 248 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 249 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 250 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 251 */ "cmd ::= SHOW QUERIES", + /* 252 */ "cmd ::= SHOW SCORES", + /* 253 */ "cmd ::= SHOW TOPICS", + /* 254 */ "cmd ::= SHOW VARIABLES", + /* 255 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 256 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 257 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 258 */ "cmd ::= SHOW BNODES", + /* 259 */ "cmd ::= SHOW SNODES", + /* 260 */ "cmd ::= SHOW CLUSTER", + /* 261 */ "cmd ::= SHOW TRANSACTIONS", + /* 262 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 263 */ "cmd ::= SHOW CONSUMERS", + /* 264 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 265 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 266 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 267 */ "cmd ::= SHOW VNODES NK_INTEGER", + /* 268 */ "cmd ::= SHOW VNODES NK_STRING", + /* 269 */ "cmd ::= SHOW db_name_cond_opt ALIVE", + /* 270 */ "cmd ::= SHOW CLUSTER ALIVE", + /* 271 */ "db_name_cond_opt ::=", + /* 272 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 273 */ "like_pattern_opt ::=", + /* 274 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 275 */ "table_name_cond ::= table_name", + /* 276 */ "from_db_opt ::=", + /* 277 */ "from_db_opt ::= FROM db_name", + /* 278 */ "tag_list_opt ::=", + /* 279 */ "tag_list_opt ::= tag_item", + /* 280 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 281 */ "tag_item ::= TBNAME", + /* 282 */ "tag_item ::= QTAGS", + /* 283 */ "tag_item ::= column_name", + /* 284 */ "tag_item ::= column_name column_alias", + /* 285 */ "tag_item ::= column_name AS column_alias", + /* 286 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options", + /* 287 */ "cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP", + /* 288 */ "cmd ::= DROP INDEX exists_opt full_index_name", + /* 289 */ "full_index_name ::= index_name", + /* 290 */ "full_index_name ::= db_name NK_DOT index_name", + /* 291 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 292 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", + /* 293 */ "func_list ::= func", + /* 294 */ "func_list ::= func_list NK_COMMA func", + /* 295 */ "func ::= sma_func_name NK_LP expression_list NK_RP", + /* 296 */ "sma_func_name ::= function_name", + /* 297 */ "sma_func_name ::= COUNT", + /* 298 */ "sma_func_name ::= FIRST", + /* 299 */ "sma_func_name ::= LAST", + /* 300 */ "sma_func_name ::= LAST_ROW", + /* 301 */ "sma_stream_opt ::=", + /* 302 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 303 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 304 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 305 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 306 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 307 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", + /* 308 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 309 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", + /* 310 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 311 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 312 */ "cmd ::= DESC full_table_name", + /* 313 */ "cmd ::= DESCRIBE full_table_name", + /* 314 */ "cmd ::= RESET QUERY CACHE", + /* 315 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 316 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", + /* 317 */ "analyze_opt ::=", + /* 318 */ "analyze_opt ::= ANALYZE", + /* 319 */ "explain_options ::=", + /* 320 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 321 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 322 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", + /* 323 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 324 */ "agg_func_opt ::=", + /* 325 */ "agg_func_opt ::= AGGREGATE", + /* 326 */ "bufsize_opt ::=", + /* 327 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 328 */ "language_opt ::=", + /* 329 */ "language_opt ::= LANGUAGE NK_STRING", + /* 330 */ "or_replace_opt ::=", + /* 331 */ "or_replace_opt ::= OR REPLACE", + /* 332 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery", + /* 333 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 334 */ "cmd ::= PAUSE STREAM exists_opt stream_name", + /* 335 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", + /* 336 */ "col_list_opt ::=", + /* 337 */ "col_list_opt ::= NK_LP col_name_list NK_RP", + /* 338 */ "tag_def_or_ref_opt ::=", + /* 339 */ "tag_def_or_ref_opt ::= tags_def", + /* 340 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", + /* 341 */ "stream_options ::=", + /* 342 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 343 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 344 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 345 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 346 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 347 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 348 */ "stream_options ::= stream_options DELETE_MARK duration_literal", + /* 349 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", + /* 350 */ "subtable_opt ::=", + /* 351 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 352 */ "ignore_opt ::=", + /* 353 */ "ignore_opt ::= IGNORE UNTREATED", + /* 354 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 355 */ "cmd ::= KILL QUERY NK_STRING", + /* 356 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 357 */ "cmd ::= BALANCE VGROUP", + /* 358 */ "cmd ::= BALANCE VGROUP LEADER", + /* 359 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 360 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 361 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 362 */ "dnode_list ::= DNODE NK_INTEGER", + /* 363 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 364 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 365 */ "cmd ::= query_or_subquery", + /* 366 */ "cmd ::= insert_query", + /* 367 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 368 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", + /* 369 */ "literal ::= NK_INTEGER", + /* 370 */ "literal ::= NK_FLOAT", + /* 371 */ "literal ::= NK_STRING", + /* 372 */ "literal ::= NK_BOOL", + /* 373 */ "literal ::= TIMESTAMP NK_STRING", + /* 374 */ "literal ::= duration_literal", + /* 375 */ "literal ::= NULL", + /* 376 */ "literal ::= NK_QUESTION", + /* 377 */ "duration_literal ::= NK_VARIABLE", + /* 378 */ "signed ::= NK_INTEGER", + /* 379 */ "signed ::= NK_PLUS NK_INTEGER", + /* 380 */ "signed ::= NK_MINUS NK_INTEGER", + /* 381 */ "signed ::= NK_FLOAT", + /* 382 */ "signed ::= NK_PLUS NK_FLOAT", + /* 383 */ "signed ::= NK_MINUS NK_FLOAT", + /* 384 */ "signed_literal ::= signed", + /* 385 */ "signed_literal ::= NK_STRING", + /* 386 */ "signed_literal ::= NK_BOOL", + /* 387 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 388 */ "signed_literal ::= duration_literal", + /* 389 */ "signed_literal ::= NULL", + /* 390 */ "signed_literal ::= literal_func", + /* 391 */ "signed_literal ::= NK_QUESTION", + /* 392 */ "literal_list ::= signed_literal", + /* 393 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 394 */ "db_name ::= NK_ID", + /* 395 */ "table_name ::= NK_ID", + /* 396 */ "column_name ::= NK_ID", + /* 397 */ "function_name ::= NK_ID", + /* 398 */ "table_alias ::= NK_ID", + /* 399 */ "column_alias ::= NK_ID", + /* 400 */ "user_name ::= NK_ID", + /* 401 */ "topic_name ::= NK_ID", + /* 402 */ "stream_name ::= NK_ID", + /* 403 */ "cgroup_name ::= NK_ID", + /* 404 */ "index_name ::= NK_ID", + /* 405 */ "expr_or_subquery ::= expression", + /* 406 */ "expression ::= literal", + /* 407 */ "expression ::= pseudo_column", + /* 408 */ "expression ::= column_reference", + /* 409 */ "expression ::= function_expression", + /* 410 */ "expression ::= case_when_expression", + /* 411 */ "expression ::= NK_LP expression NK_RP", + /* 412 */ "expression ::= NK_PLUS expr_or_subquery", + /* 413 */ "expression ::= NK_MINUS expr_or_subquery", + /* 414 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 415 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 416 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 417 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 418 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 419 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 420 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 421 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 422 */ "expression_list ::= expr_or_subquery", + /* 423 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 424 */ "column_reference ::= column_name", + /* 425 */ "column_reference ::= table_name NK_DOT column_name", + /* 426 */ "pseudo_column ::= ROWTS", + /* 427 */ "pseudo_column ::= TBNAME", + /* 428 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 429 */ "pseudo_column ::= QSTART", + /* 430 */ "pseudo_column ::= QEND", + /* 431 */ "pseudo_column ::= QDURATION", + /* 432 */ "pseudo_column ::= WSTART", + /* 433 */ "pseudo_column ::= WEND", + /* 434 */ "pseudo_column ::= WDURATION", + /* 435 */ "pseudo_column ::= IROWTS", + /* 436 */ "pseudo_column ::= ISFILLED", + /* 437 */ "pseudo_column ::= QTAGS", + /* 438 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 439 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 440 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 441 */ "function_expression ::= literal_func", + /* 442 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 443 */ "literal_func ::= NOW", + /* 444 */ "noarg_func ::= NOW", + /* 445 */ "noarg_func ::= TODAY", + /* 446 */ "noarg_func ::= TIMEZONE", + /* 447 */ "noarg_func ::= DATABASE", + /* 448 */ "noarg_func ::= CLIENT_VERSION", + /* 449 */ "noarg_func ::= SERVER_VERSION", + /* 450 */ "noarg_func ::= SERVER_STATUS", + /* 451 */ "noarg_func ::= CURRENT_USER", + /* 452 */ "noarg_func ::= USER", + /* 453 */ "star_func ::= COUNT", + /* 454 */ "star_func ::= FIRST", + /* 455 */ "star_func ::= LAST", + /* 456 */ "star_func ::= LAST_ROW", + /* 457 */ "star_func_para_list ::= NK_STAR", + /* 458 */ "star_func_para_list ::= other_para_list", + /* 459 */ "other_para_list ::= star_func_para", + /* 460 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 461 */ "star_func_para ::= expr_or_subquery", + /* 462 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 463 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 464 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 465 */ "when_then_list ::= when_then_expr", + /* 466 */ "when_then_list ::= when_then_list when_then_expr", + /* 467 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 468 */ "case_when_else_opt ::=", + /* 469 */ "case_when_else_opt ::= ELSE common_expression", + /* 470 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 471 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 472 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 473 */ "predicate ::= expr_or_subquery IS NULL", + /* 474 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 475 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 476 */ "compare_op ::= NK_LT", + /* 477 */ "compare_op ::= NK_GT", + /* 478 */ "compare_op ::= NK_LE", + /* 479 */ "compare_op ::= NK_GE", + /* 480 */ "compare_op ::= NK_NE", + /* 481 */ "compare_op ::= NK_EQ", + /* 482 */ "compare_op ::= LIKE", + /* 483 */ "compare_op ::= NOT LIKE", + /* 484 */ "compare_op ::= MATCH", + /* 485 */ "compare_op ::= NMATCH", + /* 486 */ "compare_op ::= CONTAINS", + /* 487 */ "in_op ::= IN", + /* 488 */ "in_op ::= NOT IN", + /* 489 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 490 */ "boolean_value_expression ::= boolean_primary", + /* 491 */ "boolean_value_expression ::= NOT boolean_primary", + /* 492 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 493 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 494 */ "boolean_primary ::= predicate", + /* 495 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 496 */ "common_expression ::= expr_or_subquery", + /* 497 */ "common_expression ::= boolean_value_expression", + /* 498 */ "from_clause_opt ::=", + /* 499 */ "from_clause_opt ::= FROM table_reference_list", + /* 500 */ "table_reference_list ::= table_reference", + /* 501 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 502 */ "table_reference ::= table_primary", + /* 503 */ "table_reference ::= joined_table", + /* 504 */ "table_primary ::= table_name alias_opt", + /* 505 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 506 */ "table_primary ::= subquery alias_opt", + /* 507 */ "table_primary ::= parenthesized_joined_table", + /* 508 */ "alias_opt ::=", + /* 509 */ "alias_opt ::= table_alias", + /* 510 */ "alias_opt ::= AS table_alias", + /* 511 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 512 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 513 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 514 */ "join_type ::=", + /* 515 */ "join_type ::= INNER", + /* 516 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 517 */ "set_quantifier_opt ::=", + /* 518 */ "set_quantifier_opt ::= DISTINCT", + /* 519 */ "set_quantifier_opt ::= ALL", + /* 520 */ "select_list ::= select_item", + /* 521 */ "select_list ::= select_list NK_COMMA select_item", + /* 522 */ "select_item ::= NK_STAR", + /* 523 */ "select_item ::= common_expression", + /* 524 */ "select_item ::= common_expression column_alias", + /* 525 */ "select_item ::= common_expression AS column_alias", + /* 526 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 527 */ "where_clause_opt ::=", + /* 528 */ "where_clause_opt ::= WHERE search_condition", + /* 529 */ "partition_by_clause_opt ::=", + /* 530 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 531 */ "partition_list ::= partition_item", + /* 532 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 533 */ "partition_item ::= expr_or_subquery", + /* 534 */ "partition_item ::= expr_or_subquery column_alias", + /* 535 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 536 */ "twindow_clause_opt ::=", + /* 537 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 538 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 539 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 540 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 541 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 542 */ "sliding_opt ::=", + /* 543 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 544 */ "fill_opt ::=", + /* 545 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 546 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 547 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 548 */ "fill_mode ::= NONE", + /* 549 */ "fill_mode ::= PREV", + /* 550 */ "fill_mode ::= NULL", + /* 551 */ "fill_mode ::= NULL_F", + /* 552 */ "fill_mode ::= LINEAR", + /* 553 */ "fill_mode ::= NEXT", + /* 554 */ "group_by_clause_opt ::=", + /* 555 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 556 */ "group_by_list ::= expr_or_subquery", + /* 557 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 558 */ "having_clause_opt ::=", + /* 559 */ "having_clause_opt ::= HAVING search_condition", + /* 560 */ "range_opt ::=", + /* 561 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 562 */ "every_opt ::=", + /* 563 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 564 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 565 */ "query_simple ::= query_specification", + /* 566 */ "query_simple ::= union_query_expression", + /* 567 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 568 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 569 */ "query_simple_or_subquery ::= query_simple", + /* 570 */ "query_simple_or_subquery ::= subquery", + /* 571 */ "query_or_subquery ::= query_expression", + /* 572 */ "query_or_subquery ::= subquery", + /* 573 */ "order_by_clause_opt ::=", + /* 574 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 575 */ "slimit_clause_opt ::=", + /* 576 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 577 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 578 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 579 */ "limit_clause_opt ::=", + /* 580 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 581 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 582 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 583 */ "subquery ::= NK_LP query_expression NK_RP", + /* 584 */ "subquery ::= NK_LP subquery NK_RP", + /* 585 */ "search_condition ::= common_expression", + /* 586 */ "sort_specification_list ::= sort_specification", + /* 587 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 588 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 589 */ "ordering_specification_opt ::=", + /* 590 */ "ordering_specification_opt ::= ASC", + /* 591 */ "ordering_specification_opt ::= DESC", + /* 592 */ "null_ordering_opt ::=", + /* 593 */ "null_ordering_opt ::= NULLS FIRST", + /* 594 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2705,210 +2660,210 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 336: /* cmd */ - case 339: /* literal */ - case 345: /* with_opt */ - case 351: /* search_condition */ - case 356: /* db_options */ - case 358: /* alter_db_options */ - case 360: /* start_opt */ - case 361: /* end_opt */ - case 365: /* signed */ - case 367: /* retention */ - case 368: /* full_table_name */ - case 371: /* table_options */ - case 375: /* alter_table_clause */ - case 376: /* alter_table_options */ - case 379: /* signed_literal */ - case 380: /* create_subtable_clause */ - case 383: /* drop_table_clause */ - case 385: /* column_def */ - case 389: /* duration_literal */ - case 390: /* rollup_func_name */ - case 392: /* col_name */ - case 393: /* db_name_cond_opt */ - case 394: /* like_pattern_opt */ - case 395: /* table_name_cond */ - case 396: /* from_db_opt */ - case 398: /* tag_item */ - case 400: /* full_index_name */ - case 401: /* index_options */ - case 404: /* sliding_opt */ - case 405: /* sma_stream_opt */ - case 406: /* func */ - case 408: /* query_or_subquery */ - case 411: /* explain_options */ - case 412: /* insert_query */ - case 418: /* stream_options */ - case 421: /* subtable_opt */ - case 423: /* expression */ - case 425: /* where_clause_opt */ - case 426: /* literal_func */ - case 429: /* expr_or_subquery */ - case 430: /* pseudo_column */ - case 431: /* column_reference */ - case 432: /* function_expression */ - case 433: /* case_when_expression */ - case 438: /* star_func_para */ - case 440: /* case_when_else_opt */ - case 441: /* common_expression */ - case 442: /* when_then_expr */ - case 443: /* predicate */ - case 446: /* in_predicate_value */ - case 447: /* boolean_value_expression */ - case 448: /* boolean_primary */ - case 449: /* from_clause_opt */ - case 450: /* table_reference_list */ - case 451: /* table_reference */ - case 452: /* table_primary */ - case 453: /* joined_table */ - case 455: /* subquery */ - case 456: /* parenthesized_joined_table */ - case 458: /* query_specification */ - case 462: /* range_opt */ - case 463: /* every_opt */ - case 464: /* fill_opt */ - case 465: /* twindow_clause_opt */ - case 467: /* having_clause_opt */ - case 468: /* select_item */ - case 470: /* partition_item */ - case 473: /* query_expression */ - case 474: /* query_simple */ - case 476: /* slimit_clause_opt */ - case 477: /* limit_clause_opt */ - case 478: /* union_query_expression */ - case 479: /* query_simple_or_subquery */ - case 481: /* sort_specification */ + case 337: /* cmd */ + case 340: /* literal */ + case 346: /* with_opt */ + case 352: /* search_condition */ + case 357: /* db_options */ + case 359: /* alter_db_options */ + case 361: /* start_opt */ + case 362: /* end_opt */ + case 366: /* signed */ + case 368: /* retention */ + case 369: /* full_table_name */ + case 372: /* table_options */ + case 376: /* alter_table_clause */ + case 377: /* alter_table_options */ + case 380: /* signed_literal */ + case 381: /* create_subtable_clause */ + case 384: /* drop_table_clause */ + case 386: /* column_def */ + case 390: /* duration_literal */ + case 391: /* rollup_func_name */ + case 393: /* col_name */ + case 394: /* db_name_cond_opt */ + case 395: /* like_pattern_opt */ + case 396: /* table_name_cond */ + case 397: /* from_db_opt */ + case 399: /* tag_item */ + case 401: /* full_index_name */ + case 402: /* index_options */ + case 405: /* sliding_opt */ + case 406: /* sma_stream_opt */ + case 407: /* func */ + case 409: /* query_or_subquery */ + case 412: /* explain_options */ + case 413: /* insert_query */ + case 419: /* stream_options */ + case 422: /* subtable_opt */ + case 424: /* expression */ + case 426: /* where_clause_opt */ + case 427: /* literal_func */ + case 430: /* expr_or_subquery */ + case 431: /* pseudo_column */ + case 432: /* column_reference */ + case 433: /* function_expression */ + case 434: /* case_when_expression */ + case 439: /* star_func_para */ + case 441: /* case_when_else_opt */ + case 442: /* common_expression */ + case 443: /* when_then_expr */ + case 444: /* predicate */ + case 447: /* in_predicate_value */ + case 448: /* boolean_value_expression */ + case 449: /* boolean_primary */ + case 450: /* from_clause_opt */ + case 451: /* table_reference_list */ + case 452: /* table_reference */ + case 453: /* table_primary */ + case 454: /* joined_table */ + case 456: /* subquery */ + case 457: /* parenthesized_joined_table */ + case 459: /* query_specification */ + case 463: /* range_opt */ + case 464: /* every_opt */ + case 465: /* fill_opt */ + case 466: /* twindow_clause_opt */ + case 468: /* having_clause_opt */ + case 469: /* select_item */ + case 471: /* partition_item */ + case 474: /* query_expression */ + case 475: /* query_simple */ + case 477: /* slimit_clause_opt */ + case 478: /* limit_clause_opt */ + case 479: /* union_query_expression */ + case 480: /* query_simple_or_subquery */ + case 482: /* sort_specification */ { - nodesDestroyNode((yypminor->yy520)); + nodesDestroyNode((yypminor->yy242)); } break; - case 337: /* account_options */ - case 338: /* alter_account_options */ - case 340: /* alter_account_option */ - case 359: /* speed_opt */ - case 415: /* bufsize_opt */ + case 338: /* account_options */ + case 339: /* alter_account_options */ + case 341: /* alter_account_option */ + case 360: /* speed_opt */ + case 416: /* bufsize_opt */ { } break; - case 341: /* user_name */ - case 348: /* db_name */ - case 349: /* table_name */ - case 350: /* topic_name */ - case 352: /* dnode_endpoint */ - case 377: /* column_name */ - case 391: /* function_name */ - case 399: /* column_alias */ - case 402: /* index_name */ - case 407: /* sma_func_name */ - case 409: /* cgroup_name */ - case 416: /* language_opt */ - case 417: /* stream_name */ - case 428: /* table_alias */ - case 434: /* star_func */ - case 436: /* noarg_func */ - case 454: /* alias_opt */ + case 342: /* user_name */ + case 349: /* db_name */ + case 350: /* table_name */ + case 351: /* topic_name */ + case 353: /* dnode_endpoint */ + case 378: /* column_name */ + case 392: /* function_name */ + case 400: /* column_alias */ + case 403: /* index_name */ + case 408: /* sma_func_name */ + case 410: /* cgroup_name */ + case 417: /* language_opt */ + case 418: /* stream_name */ + case 429: /* table_alias */ + case 435: /* star_func */ + case 437: /* noarg_func */ + case 455: /* alias_opt */ { } break; - case 342: /* sysinfo_opt */ + case 343: /* sysinfo_opt */ { } break; - case 343: /* privileges */ - case 346: /* priv_type_list */ - case 347: /* priv_type */ + case 344: /* privileges */ + case 347: /* priv_type_list */ + case 348: /* priv_type */ { } break; - case 344: /* priv_level */ + case 345: /* priv_level */ { } break; - case 353: /* force_opt */ - case 354: /* unsafe_opt */ - case 355: /* not_exists_opt */ - case 357: /* exists_opt */ - case 410: /* analyze_opt */ - case 413: /* or_replace_opt */ - case 414: /* agg_func_opt */ - case 422: /* ignore_opt */ - case 459: /* set_quantifier_opt */ + case 354: /* force_opt */ + case 355: /* unsafe_opt */ + case 356: /* not_exists_opt */ + case 358: /* exists_opt */ + case 411: /* analyze_opt */ + case 414: /* or_replace_opt */ + case 415: /* agg_func_opt */ + case 423: /* ignore_opt */ + case 460: /* set_quantifier_opt */ { } break; - case 362: /* integer_list */ - case 363: /* variable_list */ - case 364: /* retention_list */ - case 369: /* column_def_list */ - case 370: /* tags_def_opt */ - case 372: /* multi_create_clause */ - case 373: /* tags_def */ - case 374: /* multi_drop_clause */ - case 381: /* specific_cols_opt */ - case 382: /* expression_list */ - case 384: /* col_name_list */ - case 386: /* duration_list */ - case 387: /* rollup_func_list */ - case 397: /* tag_list_opt */ - case 403: /* func_list */ - case 419: /* col_list_opt */ - case 420: /* tag_def_or_ref_opt */ - case 424: /* dnode_list */ - case 427: /* literal_list */ - case 435: /* star_func_para_list */ - case 437: /* other_para_list */ - case 439: /* when_then_list */ - case 460: /* select_list */ - case 461: /* partition_by_clause_opt */ - case 466: /* group_by_clause_opt */ - case 469: /* partition_list */ - case 472: /* group_by_list */ - case 475: /* order_by_clause_opt */ - case 480: /* sort_specification_list */ + case 363: /* integer_list */ + case 364: /* variable_list */ + case 365: /* retention_list */ + case 370: /* column_def_list */ + case 371: /* tags_def_opt */ + case 373: /* multi_create_clause */ + case 374: /* tags_def */ + case 375: /* multi_drop_clause */ + case 382: /* specific_cols_opt */ + case 383: /* expression_list */ + case 385: /* col_name_list */ + case 387: /* duration_list */ + case 388: /* rollup_func_list */ + case 398: /* tag_list_opt */ + case 404: /* func_list */ + case 420: /* col_list_opt */ + case 421: /* tag_def_or_ref_opt */ + case 425: /* dnode_list */ + case 428: /* literal_list */ + case 436: /* star_func_para_list */ + case 438: /* other_para_list */ + case 440: /* when_then_list */ + case 461: /* select_list */ + case 462: /* partition_by_clause_opt */ + case 467: /* group_by_clause_opt */ + case 470: /* partition_list */ + case 473: /* group_by_list */ + case 476: /* order_by_clause_opt */ + case 481: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy904)); + nodesDestroyList((yypminor->yy174)); } break; - case 366: /* alter_db_option */ - case 388: /* alter_table_option */ + case 367: /* alter_db_option */ + case 389: /* alter_table_option */ { } break; - case 378: /* type_name */ + case 379: /* type_name */ { } break; - case 444: /* compare_op */ - case 445: /* in_op */ + case 445: /* compare_op */ + case 446: /* in_op */ { } break; - case 457: /* join_type */ + case 458: /* join_type */ { } break; - case 471: /* fill_mode */ + case 472: /* fill_mode */ { } break; - case 482: /* ordering_specification_opt */ + case 483: /* ordering_specification_opt */ { } break; - case 483: /* null_ordering_opt */ + case 484: /* null_ordering_opt */ { } @@ -3199,600 +3154,601 @@ static void yy_shift( /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ static const YYCODETYPE yyRuleInfoLhs[] = { - 336, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - 336, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - 337, /* (2) account_options ::= */ - 337, /* (3) account_options ::= account_options PPS literal */ - 337, /* (4) account_options ::= account_options TSERIES literal */ - 337, /* (5) account_options ::= account_options STORAGE literal */ - 337, /* (6) account_options ::= account_options STREAMS literal */ - 337, /* (7) account_options ::= account_options QTIME literal */ - 337, /* (8) account_options ::= account_options DBS literal */ - 337, /* (9) account_options ::= account_options USERS literal */ - 337, /* (10) account_options ::= account_options CONNS literal */ - 337, /* (11) account_options ::= account_options STATE literal */ - 338, /* (12) alter_account_options ::= alter_account_option */ - 338, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - 340, /* (14) alter_account_option ::= PASS literal */ - 340, /* (15) alter_account_option ::= PPS literal */ - 340, /* (16) alter_account_option ::= TSERIES literal */ - 340, /* (17) alter_account_option ::= STORAGE literal */ - 340, /* (18) alter_account_option ::= STREAMS literal */ - 340, /* (19) alter_account_option ::= QTIME literal */ - 340, /* (20) alter_account_option ::= DBS literal */ - 340, /* (21) alter_account_option ::= USERS literal */ - 340, /* (22) alter_account_option ::= CONNS literal */ - 340, /* (23) alter_account_option ::= STATE literal */ - 336, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ - 336, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ - 336, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - 336, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - 336, /* (28) cmd ::= DROP USER user_name */ - 342, /* (29) sysinfo_opt ::= */ - 342, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ - 336, /* (31) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ - 336, /* (32) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ - 343, /* (33) privileges ::= ALL */ - 343, /* (34) privileges ::= priv_type_list */ - 343, /* (35) privileges ::= SUBSCRIBE */ - 346, /* (36) priv_type_list ::= priv_type */ - 346, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - 347, /* (38) priv_type ::= READ */ - 347, /* (39) priv_type ::= WRITE */ - 344, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */ - 344, /* (41) priv_level ::= db_name NK_DOT NK_STAR */ - 344, /* (42) priv_level ::= db_name NK_DOT table_name */ - 344, /* (43) priv_level ::= topic_name */ - 345, /* (44) with_opt ::= */ - 345, /* (45) with_opt ::= WITH search_condition */ - 336, /* (46) cmd ::= CREATE DNODE dnode_endpoint */ - 336, /* (47) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - 336, /* (48) cmd ::= DROP DNODE NK_INTEGER force_opt */ - 336, /* (49) cmd ::= DROP DNODE dnode_endpoint force_opt */ - 336, /* (50) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - 336, /* (51) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - 336, /* (52) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - 336, /* (53) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - 336, /* (54) cmd ::= ALTER ALL DNODES NK_STRING */ - 336, /* (55) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - 336, /* (56) cmd ::= RESTORE DNODE NK_INTEGER */ - 352, /* (57) dnode_endpoint ::= NK_STRING */ - 352, /* (58) dnode_endpoint ::= NK_ID */ - 352, /* (59) dnode_endpoint ::= NK_IPTOKEN */ - 353, /* (60) force_opt ::= */ - 353, /* (61) force_opt ::= FORCE */ - 354, /* (62) unsafe_opt ::= UNSAFE */ - 336, /* (63) cmd ::= ALTER LOCAL NK_STRING */ - 336, /* (64) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - 336, /* (65) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - 336, /* (66) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - 336, /* (67) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - 336, /* (68) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - 336, /* (69) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - 336, /* (70) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - 336, /* (71) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - 336, /* (72) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - 336, /* (73) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - 336, /* (74) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - 336, /* (75) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - 336, /* (76) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - 336, /* (77) cmd ::= DROP DATABASE exists_opt db_name */ - 336, /* (78) cmd ::= USE db_name */ - 336, /* (79) cmd ::= ALTER DATABASE db_name alter_db_options */ - 336, /* (80) cmd ::= FLUSH DATABASE db_name */ - 336, /* (81) cmd ::= TRIM DATABASE db_name speed_opt */ - 336, /* (82) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - 355, /* (83) not_exists_opt ::= IF NOT EXISTS */ - 355, /* (84) not_exists_opt ::= */ - 357, /* (85) exists_opt ::= IF EXISTS */ - 357, /* (86) exists_opt ::= */ - 356, /* (87) db_options ::= */ - 356, /* (88) db_options ::= db_options BUFFER NK_INTEGER */ - 356, /* (89) db_options ::= db_options CACHEMODEL NK_STRING */ - 356, /* (90) db_options ::= db_options CACHESIZE NK_INTEGER */ - 356, /* (91) db_options ::= db_options COMP NK_INTEGER */ - 356, /* (92) db_options ::= db_options DURATION NK_INTEGER */ - 356, /* (93) db_options ::= db_options DURATION NK_VARIABLE */ - 356, /* (94) db_options ::= db_options MAXROWS NK_INTEGER */ - 356, /* (95) db_options ::= db_options MINROWS NK_INTEGER */ - 356, /* (96) db_options ::= db_options KEEP integer_list */ - 356, /* (97) db_options ::= db_options KEEP variable_list */ - 356, /* (98) db_options ::= db_options PAGES NK_INTEGER */ - 356, /* (99) db_options ::= db_options PAGESIZE NK_INTEGER */ - 356, /* (100) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - 356, /* (101) db_options ::= db_options PRECISION NK_STRING */ - 356, /* (102) db_options ::= db_options REPLICA NK_INTEGER */ - 356, /* (103) db_options ::= db_options VGROUPS NK_INTEGER */ - 356, /* (104) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - 356, /* (105) db_options ::= db_options RETENTIONS retention_list */ - 356, /* (106) db_options ::= db_options SCHEMALESS NK_INTEGER */ - 356, /* (107) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - 356, /* (108) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - 356, /* (109) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - 356, /* (110) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 356, /* (111) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - 356, /* (112) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 356, /* (113) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - 356, /* (114) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - 356, /* (115) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - 356, /* (116) db_options ::= db_options TABLE_PREFIX signed */ - 356, /* (117) db_options ::= db_options TABLE_SUFFIX signed */ - 358, /* (118) alter_db_options ::= alter_db_option */ - 358, /* (119) alter_db_options ::= alter_db_options alter_db_option */ - 366, /* (120) alter_db_option ::= BUFFER NK_INTEGER */ - 366, /* (121) alter_db_option ::= CACHEMODEL NK_STRING */ - 366, /* (122) alter_db_option ::= CACHESIZE NK_INTEGER */ - 366, /* (123) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - 366, /* (124) alter_db_option ::= KEEP integer_list */ - 366, /* (125) alter_db_option ::= KEEP variable_list */ - 366, /* (126) alter_db_option ::= PAGES NK_INTEGER */ - 366, /* (127) alter_db_option ::= REPLICA NK_INTEGER */ - 366, /* (128) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - 366, /* (129) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - 366, /* (130) alter_db_option ::= MINROWS NK_INTEGER */ - 366, /* (131) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - 366, /* (132) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 366, /* (133) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - 366, /* (134) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 362, /* (135) integer_list ::= NK_INTEGER */ - 362, /* (136) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - 363, /* (137) variable_list ::= NK_VARIABLE */ - 363, /* (138) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - 364, /* (139) retention_list ::= retention */ - 364, /* (140) retention_list ::= retention_list NK_COMMA retention */ - 367, /* (141) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - 359, /* (142) speed_opt ::= */ - 359, /* (143) speed_opt ::= MAX_SPEED NK_INTEGER */ - 360, /* (144) start_opt ::= */ - 360, /* (145) start_opt ::= START WITH NK_INTEGER */ - 360, /* (146) start_opt ::= START WITH NK_STRING */ - 360, /* (147) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 361, /* (148) end_opt ::= */ - 361, /* (149) end_opt ::= END WITH NK_INTEGER */ - 361, /* (150) end_opt ::= END WITH NK_STRING */ - 361, /* (151) end_opt ::= END WITH TIMESTAMP NK_STRING */ - 336, /* (152) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - 336, /* (153) cmd ::= CREATE TABLE multi_create_clause */ - 336, /* (154) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - 336, /* (155) cmd ::= DROP TABLE multi_drop_clause */ - 336, /* (156) cmd ::= DROP STABLE exists_opt full_table_name */ - 336, /* (157) cmd ::= ALTER TABLE alter_table_clause */ - 336, /* (158) cmd ::= ALTER STABLE alter_table_clause */ - 375, /* (159) alter_table_clause ::= full_table_name alter_table_options */ - 375, /* (160) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - 375, /* (161) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 375, /* (162) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - 375, /* (163) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 375, /* (164) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - 375, /* (165) alter_table_clause ::= full_table_name DROP TAG column_name */ - 375, /* (166) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - 375, /* (167) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - 375, /* (168) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - 372, /* (169) multi_create_clause ::= create_subtable_clause */ - 372, /* (170) multi_create_clause ::= multi_create_clause create_subtable_clause */ - 380, /* (171) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ - 374, /* (172) multi_drop_clause ::= drop_table_clause */ - 374, /* (173) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - 383, /* (174) drop_table_clause ::= exists_opt full_table_name */ - 381, /* (175) specific_cols_opt ::= */ - 381, /* (176) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - 368, /* (177) full_table_name ::= table_name */ - 368, /* (178) full_table_name ::= db_name NK_DOT table_name */ - 369, /* (179) column_def_list ::= column_def */ - 369, /* (180) column_def_list ::= column_def_list NK_COMMA column_def */ - 385, /* (181) column_def ::= column_name type_name */ - 378, /* (182) type_name ::= BOOL */ - 378, /* (183) type_name ::= TINYINT */ - 378, /* (184) type_name ::= SMALLINT */ - 378, /* (185) type_name ::= INT */ - 378, /* (186) type_name ::= INTEGER */ - 378, /* (187) type_name ::= BIGINT */ - 378, /* (188) type_name ::= FLOAT */ - 378, /* (189) type_name ::= DOUBLE */ - 378, /* (190) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 378, /* (191) type_name ::= TIMESTAMP */ - 378, /* (192) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 378, /* (193) type_name ::= TINYINT UNSIGNED */ - 378, /* (194) type_name ::= SMALLINT UNSIGNED */ - 378, /* (195) type_name ::= INT UNSIGNED */ - 378, /* (196) type_name ::= BIGINT UNSIGNED */ - 378, /* (197) type_name ::= JSON */ - 378, /* (198) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 378, /* (199) type_name ::= MEDIUMBLOB */ - 378, /* (200) type_name ::= BLOB */ - 378, /* (201) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 378, /* (202) type_name ::= DECIMAL */ - 378, /* (203) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 378, /* (204) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 370, /* (205) tags_def_opt ::= */ - 370, /* (206) tags_def_opt ::= tags_def */ - 373, /* (207) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - 371, /* (208) table_options ::= */ - 371, /* (209) table_options ::= table_options COMMENT NK_STRING */ - 371, /* (210) table_options ::= table_options MAX_DELAY duration_list */ - 371, /* (211) table_options ::= table_options WATERMARK duration_list */ - 371, /* (212) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 371, /* (213) table_options ::= table_options TTL NK_INTEGER */ - 371, /* (214) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 371, /* (215) table_options ::= table_options DELETE_MARK duration_list */ - 376, /* (216) alter_table_options ::= alter_table_option */ - 376, /* (217) alter_table_options ::= alter_table_options alter_table_option */ - 388, /* (218) alter_table_option ::= COMMENT NK_STRING */ - 388, /* (219) alter_table_option ::= TTL NK_INTEGER */ - 386, /* (220) duration_list ::= duration_literal */ - 386, /* (221) duration_list ::= duration_list NK_COMMA duration_literal */ - 387, /* (222) rollup_func_list ::= rollup_func_name */ - 387, /* (223) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 390, /* (224) rollup_func_name ::= function_name */ - 390, /* (225) rollup_func_name ::= FIRST */ - 390, /* (226) rollup_func_name ::= LAST */ - 384, /* (227) col_name_list ::= col_name */ - 384, /* (228) col_name_list ::= col_name_list NK_COMMA col_name */ - 392, /* (229) col_name ::= column_name */ - 336, /* (230) cmd ::= SHOW DNODES */ - 336, /* (231) cmd ::= SHOW USERS */ - 336, /* (232) cmd ::= SHOW USER PRIVILEGES */ - 336, /* (233) cmd ::= SHOW DATABASES */ - 336, /* (234) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - 336, /* (235) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 336, /* (236) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 336, /* (237) cmd ::= SHOW MNODES */ - 336, /* (238) cmd ::= SHOW QNODES */ - 336, /* (239) cmd ::= SHOW FUNCTIONS */ - 336, /* (240) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 336, /* (241) cmd ::= SHOW STREAMS */ - 336, /* (242) cmd ::= SHOW ACCOUNTS */ - 336, /* (243) cmd ::= SHOW APPS */ - 336, /* (244) cmd ::= SHOW CONNECTIONS */ - 336, /* (245) cmd ::= SHOW LICENCES */ - 336, /* (246) cmd ::= SHOW GRANTS */ - 336, /* (247) cmd ::= SHOW CREATE DATABASE db_name */ - 336, /* (248) cmd ::= SHOW CREATE TABLE full_table_name */ - 336, /* (249) cmd ::= SHOW CREATE STABLE full_table_name */ - 336, /* (250) cmd ::= SHOW QUERIES */ - 336, /* (251) cmd ::= SHOW SCORES */ - 336, /* (252) cmd ::= SHOW TOPICS */ - 336, /* (253) cmd ::= SHOW VARIABLES */ - 336, /* (254) cmd ::= SHOW CLUSTER VARIABLES */ - 336, /* (255) cmd ::= SHOW LOCAL VARIABLES */ - 336, /* (256) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 336, /* (257) cmd ::= SHOW BNODES */ - 336, /* (258) cmd ::= SHOW SNODES */ - 336, /* (259) cmd ::= SHOW CLUSTER */ - 336, /* (260) cmd ::= SHOW TRANSACTIONS */ - 336, /* (261) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 336, /* (262) cmd ::= SHOW CONSUMERS */ - 336, /* (263) cmd ::= SHOW SUBSCRIPTIONS */ - 336, /* (264) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 336, /* (265) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 336, /* (266) cmd ::= SHOW VNODES NK_INTEGER */ - 336, /* (267) cmd ::= SHOW VNODES NK_STRING */ - 336, /* (268) cmd ::= SHOW db_name_cond_opt ALIVE */ - 336, /* (269) cmd ::= SHOW CLUSTER ALIVE */ - 393, /* (270) db_name_cond_opt ::= */ - 393, /* (271) db_name_cond_opt ::= db_name NK_DOT */ - 394, /* (272) like_pattern_opt ::= */ - 394, /* (273) like_pattern_opt ::= LIKE NK_STRING */ - 395, /* (274) table_name_cond ::= table_name */ - 396, /* (275) from_db_opt ::= */ - 396, /* (276) from_db_opt ::= FROM db_name */ - 397, /* (277) tag_list_opt ::= */ - 397, /* (278) tag_list_opt ::= tag_item */ - 397, /* (279) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 398, /* (280) tag_item ::= TBNAME */ - 398, /* (281) tag_item ::= QTAGS */ - 398, /* (282) tag_item ::= column_name */ - 398, /* (283) tag_item ::= column_name column_alias */ - 398, /* (284) tag_item ::= column_name AS column_alias */ - 336, /* (285) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ - 336, /* (286) cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ - 336, /* (287) cmd ::= DROP INDEX exists_opt full_index_name */ - 400, /* (288) full_index_name ::= index_name */ - 400, /* (289) full_index_name ::= db_name NK_DOT index_name */ - 401, /* (290) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 401, /* (291) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - 403, /* (292) func_list ::= func */ - 403, /* (293) func_list ::= func_list NK_COMMA func */ - 406, /* (294) func ::= sma_func_name NK_LP expression_list NK_RP */ - 407, /* (295) sma_func_name ::= function_name */ - 407, /* (296) sma_func_name ::= COUNT */ - 407, /* (297) sma_func_name ::= FIRST */ - 407, /* (298) sma_func_name ::= LAST */ - 407, /* (299) sma_func_name ::= LAST_ROW */ - 405, /* (300) sma_stream_opt ::= */ - 405, /* (301) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 405, /* (302) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 405, /* (303) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 336, /* (304) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 336, /* (305) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - 336, /* (306) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - 336, /* (307) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - 336, /* (308) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - 336, /* (309) cmd ::= DROP TOPIC exists_opt topic_name */ - 336, /* (310) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 336, /* (311) cmd ::= DESC full_table_name */ - 336, /* (312) cmd ::= DESCRIBE full_table_name */ - 336, /* (313) cmd ::= RESET QUERY CACHE */ - 336, /* (314) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 336, /* (315) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 410, /* (316) analyze_opt ::= */ - 410, /* (317) analyze_opt ::= ANALYZE */ - 411, /* (318) explain_options ::= */ - 411, /* (319) explain_options ::= explain_options VERBOSE NK_BOOL */ - 411, /* (320) explain_options ::= explain_options RATIO NK_FLOAT */ - 336, /* (321) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - 336, /* (322) cmd ::= DROP FUNCTION exists_opt function_name */ - 414, /* (323) agg_func_opt ::= */ - 414, /* (324) agg_func_opt ::= AGGREGATE */ - 415, /* (325) bufsize_opt ::= */ - 415, /* (326) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 416, /* (327) language_opt ::= */ - 416, /* (328) language_opt ::= LANGUAGE NK_STRING */ - 413, /* (329) or_replace_opt ::= */ - 413, /* (330) or_replace_opt ::= OR REPLACE */ - 336, /* (331) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - 336, /* (332) cmd ::= DROP STREAM exists_opt stream_name */ - 336, /* (333) cmd ::= PAUSE STREAM exists_opt stream_name */ - 336, /* (334) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 419, /* (335) col_list_opt ::= */ - 419, /* (336) col_list_opt ::= NK_LP col_name_list NK_RP */ - 420, /* (337) tag_def_or_ref_opt ::= */ - 420, /* (338) tag_def_or_ref_opt ::= tags_def */ - 420, /* (339) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 418, /* (340) stream_options ::= */ - 418, /* (341) stream_options ::= stream_options TRIGGER AT_ONCE */ - 418, /* (342) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 418, /* (343) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 418, /* (344) stream_options ::= stream_options WATERMARK duration_literal */ - 418, /* (345) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 418, /* (346) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 418, /* (347) stream_options ::= stream_options DELETE_MARK duration_literal */ - 418, /* (348) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 421, /* (349) subtable_opt ::= */ - 421, /* (350) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 422, /* (351) ignore_opt ::= */ - 422, /* (352) ignore_opt ::= IGNORE UNTREATED */ - 336, /* (353) cmd ::= KILL CONNECTION NK_INTEGER */ - 336, /* (354) cmd ::= KILL QUERY NK_STRING */ - 336, /* (355) cmd ::= KILL TRANSACTION NK_INTEGER */ - 336, /* (356) cmd ::= BALANCE VGROUP */ - 336, /* (357) cmd ::= BALANCE VGROUP LEADER */ - 336, /* (358) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 336, /* (359) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 336, /* (360) cmd ::= SPLIT VGROUP NK_INTEGER */ - 424, /* (361) dnode_list ::= DNODE NK_INTEGER */ - 424, /* (362) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 336, /* (363) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 336, /* (364) cmd ::= query_or_subquery */ - 336, /* (365) cmd ::= insert_query */ - 412, /* (366) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 412, /* (367) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 339, /* (368) literal ::= NK_INTEGER */ - 339, /* (369) literal ::= NK_FLOAT */ - 339, /* (370) literal ::= NK_STRING */ - 339, /* (371) literal ::= NK_BOOL */ - 339, /* (372) literal ::= TIMESTAMP NK_STRING */ - 339, /* (373) literal ::= duration_literal */ - 339, /* (374) literal ::= NULL */ - 339, /* (375) literal ::= NK_QUESTION */ - 389, /* (376) duration_literal ::= NK_VARIABLE */ - 365, /* (377) signed ::= NK_INTEGER */ - 365, /* (378) signed ::= NK_PLUS NK_INTEGER */ - 365, /* (379) signed ::= NK_MINUS NK_INTEGER */ - 365, /* (380) signed ::= NK_FLOAT */ - 365, /* (381) signed ::= NK_PLUS NK_FLOAT */ - 365, /* (382) signed ::= NK_MINUS NK_FLOAT */ - 379, /* (383) signed_literal ::= signed */ - 379, /* (384) signed_literal ::= NK_STRING */ - 379, /* (385) signed_literal ::= NK_BOOL */ - 379, /* (386) signed_literal ::= TIMESTAMP NK_STRING */ - 379, /* (387) signed_literal ::= duration_literal */ - 379, /* (388) signed_literal ::= NULL */ - 379, /* (389) signed_literal ::= literal_func */ - 379, /* (390) signed_literal ::= NK_QUESTION */ - 427, /* (391) literal_list ::= signed_literal */ - 427, /* (392) literal_list ::= literal_list NK_COMMA signed_literal */ - 348, /* (393) db_name ::= NK_ID */ - 349, /* (394) table_name ::= NK_ID */ - 377, /* (395) column_name ::= NK_ID */ - 391, /* (396) function_name ::= NK_ID */ - 428, /* (397) table_alias ::= NK_ID */ - 399, /* (398) column_alias ::= NK_ID */ - 341, /* (399) user_name ::= NK_ID */ - 350, /* (400) topic_name ::= NK_ID */ - 417, /* (401) stream_name ::= NK_ID */ - 409, /* (402) cgroup_name ::= NK_ID */ - 402, /* (403) index_name ::= NK_ID */ - 429, /* (404) expr_or_subquery ::= expression */ - 423, /* (405) expression ::= literal */ - 423, /* (406) expression ::= pseudo_column */ - 423, /* (407) expression ::= column_reference */ - 423, /* (408) expression ::= function_expression */ - 423, /* (409) expression ::= case_when_expression */ - 423, /* (410) expression ::= NK_LP expression NK_RP */ - 423, /* (411) expression ::= NK_PLUS expr_or_subquery */ - 423, /* (412) expression ::= NK_MINUS expr_or_subquery */ - 423, /* (413) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 423, /* (414) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 423, /* (415) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 423, /* (416) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 423, /* (417) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 423, /* (418) expression ::= column_reference NK_ARROW NK_STRING */ - 423, /* (419) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 423, /* (420) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 382, /* (421) expression_list ::= expr_or_subquery */ - 382, /* (422) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 431, /* (423) column_reference ::= column_name */ - 431, /* (424) column_reference ::= table_name NK_DOT column_name */ - 430, /* (425) pseudo_column ::= ROWTS */ - 430, /* (426) pseudo_column ::= TBNAME */ - 430, /* (427) pseudo_column ::= table_name NK_DOT TBNAME */ - 430, /* (428) pseudo_column ::= QSTART */ - 430, /* (429) pseudo_column ::= QEND */ - 430, /* (430) pseudo_column ::= QDURATION */ - 430, /* (431) pseudo_column ::= WSTART */ - 430, /* (432) pseudo_column ::= WEND */ - 430, /* (433) pseudo_column ::= WDURATION */ - 430, /* (434) pseudo_column ::= IROWTS */ - 430, /* (435) pseudo_column ::= ISFILLED */ - 430, /* (436) pseudo_column ::= QTAGS */ - 432, /* (437) function_expression ::= function_name NK_LP expression_list NK_RP */ - 432, /* (438) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 432, /* (439) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 432, /* (440) function_expression ::= literal_func */ - 426, /* (441) literal_func ::= noarg_func NK_LP NK_RP */ - 426, /* (442) literal_func ::= NOW */ - 436, /* (443) noarg_func ::= NOW */ - 436, /* (444) noarg_func ::= TODAY */ - 436, /* (445) noarg_func ::= TIMEZONE */ - 436, /* (446) noarg_func ::= DATABASE */ - 436, /* (447) noarg_func ::= CLIENT_VERSION */ - 436, /* (448) noarg_func ::= SERVER_VERSION */ - 436, /* (449) noarg_func ::= SERVER_STATUS */ - 436, /* (450) noarg_func ::= CURRENT_USER */ - 436, /* (451) noarg_func ::= USER */ - 434, /* (452) star_func ::= COUNT */ - 434, /* (453) star_func ::= FIRST */ - 434, /* (454) star_func ::= LAST */ - 434, /* (455) star_func ::= LAST_ROW */ - 435, /* (456) star_func_para_list ::= NK_STAR */ - 435, /* (457) star_func_para_list ::= other_para_list */ - 437, /* (458) other_para_list ::= star_func_para */ - 437, /* (459) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 438, /* (460) star_func_para ::= expr_or_subquery */ - 438, /* (461) star_func_para ::= table_name NK_DOT NK_STAR */ - 433, /* (462) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 433, /* (463) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 439, /* (464) when_then_list ::= when_then_expr */ - 439, /* (465) when_then_list ::= when_then_list when_then_expr */ - 442, /* (466) when_then_expr ::= WHEN common_expression THEN common_expression */ - 440, /* (467) case_when_else_opt ::= */ - 440, /* (468) case_when_else_opt ::= ELSE common_expression */ - 443, /* (469) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 443, /* (470) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 443, /* (471) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 443, /* (472) predicate ::= expr_or_subquery IS NULL */ - 443, /* (473) predicate ::= expr_or_subquery IS NOT NULL */ - 443, /* (474) predicate ::= expr_or_subquery in_op in_predicate_value */ - 444, /* (475) compare_op ::= NK_LT */ - 444, /* (476) compare_op ::= NK_GT */ - 444, /* (477) compare_op ::= NK_LE */ - 444, /* (478) compare_op ::= NK_GE */ - 444, /* (479) compare_op ::= NK_NE */ - 444, /* (480) compare_op ::= NK_EQ */ - 444, /* (481) compare_op ::= LIKE */ - 444, /* (482) compare_op ::= NOT LIKE */ - 444, /* (483) compare_op ::= MATCH */ - 444, /* (484) compare_op ::= NMATCH */ - 444, /* (485) compare_op ::= CONTAINS */ - 445, /* (486) in_op ::= IN */ - 445, /* (487) in_op ::= NOT IN */ - 446, /* (488) in_predicate_value ::= NK_LP literal_list NK_RP */ - 447, /* (489) boolean_value_expression ::= boolean_primary */ - 447, /* (490) boolean_value_expression ::= NOT boolean_primary */ - 447, /* (491) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 447, /* (492) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 448, /* (493) boolean_primary ::= predicate */ - 448, /* (494) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 441, /* (495) common_expression ::= expr_or_subquery */ - 441, /* (496) common_expression ::= boolean_value_expression */ - 449, /* (497) from_clause_opt ::= */ - 449, /* (498) from_clause_opt ::= FROM table_reference_list */ - 450, /* (499) table_reference_list ::= table_reference */ - 450, /* (500) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 451, /* (501) table_reference ::= table_primary */ - 451, /* (502) table_reference ::= joined_table */ - 452, /* (503) table_primary ::= table_name alias_opt */ - 452, /* (504) table_primary ::= db_name NK_DOT table_name alias_opt */ - 452, /* (505) table_primary ::= subquery alias_opt */ - 452, /* (506) table_primary ::= parenthesized_joined_table */ - 454, /* (507) alias_opt ::= */ - 454, /* (508) alias_opt ::= table_alias */ - 454, /* (509) alias_opt ::= AS table_alias */ - 456, /* (510) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 456, /* (511) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 453, /* (512) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 457, /* (513) join_type ::= */ - 457, /* (514) join_type ::= INNER */ - 458, /* (515) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 459, /* (516) set_quantifier_opt ::= */ - 459, /* (517) set_quantifier_opt ::= DISTINCT */ - 459, /* (518) set_quantifier_opt ::= ALL */ - 460, /* (519) select_list ::= select_item */ - 460, /* (520) select_list ::= select_list NK_COMMA select_item */ - 468, /* (521) select_item ::= NK_STAR */ - 468, /* (522) select_item ::= common_expression */ - 468, /* (523) select_item ::= common_expression column_alias */ - 468, /* (524) select_item ::= common_expression AS column_alias */ - 468, /* (525) select_item ::= table_name NK_DOT NK_STAR */ - 425, /* (526) where_clause_opt ::= */ - 425, /* (527) where_clause_opt ::= WHERE search_condition */ - 461, /* (528) partition_by_clause_opt ::= */ - 461, /* (529) partition_by_clause_opt ::= PARTITION BY partition_list */ - 469, /* (530) partition_list ::= partition_item */ - 469, /* (531) partition_list ::= partition_list NK_COMMA partition_item */ - 470, /* (532) partition_item ::= expr_or_subquery */ - 470, /* (533) partition_item ::= expr_or_subquery column_alias */ - 470, /* (534) partition_item ::= expr_or_subquery AS column_alias */ - 465, /* (535) twindow_clause_opt ::= */ - 465, /* (536) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - 465, /* (537) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 465, /* (538) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - 465, /* (539) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - 465, /* (540) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 404, /* (541) sliding_opt ::= */ - 404, /* (542) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - 464, /* (543) fill_opt ::= */ - 464, /* (544) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 464, /* (545) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 464, /* (546) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 471, /* (547) fill_mode ::= NONE */ - 471, /* (548) fill_mode ::= PREV */ - 471, /* (549) fill_mode ::= NULL */ - 471, /* (550) fill_mode ::= NULL_F */ - 471, /* (551) fill_mode ::= LINEAR */ - 471, /* (552) fill_mode ::= NEXT */ - 466, /* (553) group_by_clause_opt ::= */ - 466, /* (554) group_by_clause_opt ::= GROUP BY group_by_list */ - 472, /* (555) group_by_list ::= expr_or_subquery */ - 472, /* (556) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 467, /* (557) having_clause_opt ::= */ - 467, /* (558) having_clause_opt ::= HAVING search_condition */ - 462, /* (559) range_opt ::= */ - 462, /* (560) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 463, /* (561) every_opt ::= */ - 463, /* (562) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 473, /* (563) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 474, /* (564) query_simple ::= query_specification */ - 474, /* (565) query_simple ::= union_query_expression */ - 478, /* (566) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 478, /* (567) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 479, /* (568) query_simple_or_subquery ::= query_simple */ - 479, /* (569) query_simple_or_subquery ::= subquery */ - 408, /* (570) query_or_subquery ::= query_expression */ - 408, /* (571) query_or_subquery ::= subquery */ - 475, /* (572) order_by_clause_opt ::= */ - 475, /* (573) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 476, /* (574) slimit_clause_opt ::= */ - 476, /* (575) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 476, /* (576) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 476, /* (577) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 477, /* (578) limit_clause_opt ::= */ - 477, /* (579) limit_clause_opt ::= LIMIT NK_INTEGER */ - 477, /* (580) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 477, /* (581) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 455, /* (582) subquery ::= NK_LP query_expression NK_RP */ - 455, /* (583) subquery ::= NK_LP subquery NK_RP */ - 351, /* (584) search_condition ::= common_expression */ - 480, /* (585) sort_specification_list ::= sort_specification */ - 480, /* (586) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 481, /* (587) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 482, /* (588) ordering_specification_opt ::= */ - 482, /* (589) ordering_specification_opt ::= ASC */ - 482, /* (590) ordering_specification_opt ::= DESC */ - 483, /* (591) null_ordering_opt ::= */ - 483, /* (592) null_ordering_opt ::= NULLS FIRST */ - 483, /* (593) null_ordering_opt ::= NULLS LAST */ + 337, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + 337, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + 338, /* (2) account_options ::= */ + 338, /* (3) account_options ::= account_options PPS literal */ + 338, /* (4) account_options ::= account_options TSERIES literal */ + 338, /* (5) account_options ::= account_options STORAGE literal */ + 338, /* (6) account_options ::= account_options STREAMS literal */ + 338, /* (7) account_options ::= account_options QTIME literal */ + 338, /* (8) account_options ::= account_options DBS literal */ + 338, /* (9) account_options ::= account_options USERS literal */ + 338, /* (10) account_options ::= account_options CONNS literal */ + 338, /* (11) account_options ::= account_options STATE literal */ + 339, /* (12) alter_account_options ::= alter_account_option */ + 339, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + 341, /* (14) alter_account_option ::= PASS literal */ + 341, /* (15) alter_account_option ::= PPS literal */ + 341, /* (16) alter_account_option ::= TSERIES literal */ + 341, /* (17) alter_account_option ::= STORAGE literal */ + 341, /* (18) alter_account_option ::= STREAMS literal */ + 341, /* (19) alter_account_option ::= QTIME literal */ + 341, /* (20) alter_account_option ::= DBS literal */ + 341, /* (21) alter_account_option ::= USERS literal */ + 341, /* (22) alter_account_option ::= CONNS literal */ + 341, /* (23) alter_account_option ::= STATE literal */ + 337, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ + 337, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ + 337, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + 337, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + 337, /* (28) cmd ::= DROP USER user_name */ + 343, /* (29) sysinfo_opt ::= */ + 343, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ + 337, /* (31) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ + 337, /* (32) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ + 344, /* (33) privileges ::= ALL */ + 344, /* (34) privileges ::= priv_type_list */ + 344, /* (35) privileges ::= SUBSCRIBE */ + 347, /* (36) priv_type_list ::= priv_type */ + 347, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + 348, /* (38) priv_type ::= READ */ + 348, /* (39) priv_type ::= WRITE */ + 345, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */ + 345, /* (41) priv_level ::= db_name NK_DOT NK_STAR */ + 345, /* (42) priv_level ::= db_name NK_DOT table_name */ + 345, /* (43) priv_level ::= topic_name */ + 346, /* (44) with_opt ::= */ + 346, /* (45) with_opt ::= WITH search_condition */ + 337, /* (46) cmd ::= CREATE DNODE dnode_endpoint */ + 337, /* (47) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + 337, /* (48) cmd ::= DROP DNODE NK_INTEGER force_opt */ + 337, /* (49) cmd ::= DROP DNODE dnode_endpoint force_opt */ + 337, /* (50) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + 337, /* (51) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + 337, /* (52) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + 337, /* (53) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + 337, /* (54) cmd ::= ALTER ALL DNODES NK_STRING */ + 337, /* (55) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + 337, /* (56) cmd ::= RESTORE DNODE NK_INTEGER */ + 353, /* (57) dnode_endpoint ::= NK_STRING */ + 353, /* (58) dnode_endpoint ::= NK_ID */ + 353, /* (59) dnode_endpoint ::= NK_IPTOKEN */ + 354, /* (60) force_opt ::= */ + 354, /* (61) force_opt ::= FORCE */ + 355, /* (62) unsafe_opt ::= UNSAFE */ + 337, /* (63) cmd ::= ALTER LOCAL NK_STRING */ + 337, /* (64) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + 337, /* (65) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + 337, /* (66) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + 337, /* (67) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + 337, /* (68) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + 337, /* (69) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + 337, /* (70) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + 337, /* (71) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + 337, /* (72) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + 337, /* (73) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + 337, /* (74) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + 337, /* (75) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + 337, /* (76) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + 337, /* (77) cmd ::= DROP DATABASE exists_opt db_name */ + 337, /* (78) cmd ::= USE db_name */ + 337, /* (79) cmd ::= ALTER DATABASE db_name alter_db_options */ + 337, /* (80) cmd ::= FLUSH DATABASE db_name */ + 337, /* (81) cmd ::= TRIM DATABASE db_name speed_opt */ + 337, /* (82) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + 356, /* (83) not_exists_opt ::= IF NOT EXISTS */ + 356, /* (84) not_exists_opt ::= */ + 358, /* (85) exists_opt ::= IF EXISTS */ + 358, /* (86) exists_opt ::= */ + 357, /* (87) db_options ::= */ + 357, /* (88) db_options ::= db_options BUFFER NK_INTEGER */ + 357, /* (89) db_options ::= db_options CACHEMODEL NK_STRING */ + 357, /* (90) db_options ::= db_options CACHESIZE NK_INTEGER */ + 357, /* (91) db_options ::= db_options COMP NK_INTEGER */ + 357, /* (92) db_options ::= db_options DURATION NK_INTEGER */ + 357, /* (93) db_options ::= db_options DURATION NK_VARIABLE */ + 357, /* (94) db_options ::= db_options MAXROWS NK_INTEGER */ + 357, /* (95) db_options ::= db_options MINROWS NK_INTEGER */ + 357, /* (96) db_options ::= db_options KEEP integer_list */ + 357, /* (97) db_options ::= db_options KEEP variable_list */ + 357, /* (98) db_options ::= db_options PAGES NK_INTEGER */ + 357, /* (99) db_options ::= db_options PAGESIZE NK_INTEGER */ + 357, /* (100) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + 357, /* (101) db_options ::= db_options PRECISION NK_STRING */ + 357, /* (102) db_options ::= db_options REPLICA NK_INTEGER */ + 357, /* (103) db_options ::= db_options VGROUPS NK_INTEGER */ + 357, /* (104) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + 357, /* (105) db_options ::= db_options RETENTIONS retention_list */ + 357, /* (106) db_options ::= db_options SCHEMALESS NK_INTEGER */ + 357, /* (107) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + 357, /* (108) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + 357, /* (109) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + 357, /* (110) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 357, /* (111) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + 357, /* (112) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 357, /* (113) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + 357, /* (114) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + 357, /* (115) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + 357, /* (116) db_options ::= db_options TABLE_PREFIX signed */ + 357, /* (117) db_options ::= db_options TABLE_SUFFIX signed */ + 359, /* (118) alter_db_options ::= alter_db_option */ + 359, /* (119) alter_db_options ::= alter_db_options alter_db_option */ + 367, /* (120) alter_db_option ::= BUFFER NK_INTEGER */ + 367, /* (121) alter_db_option ::= CACHEMODEL NK_STRING */ + 367, /* (122) alter_db_option ::= CACHESIZE NK_INTEGER */ + 367, /* (123) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + 367, /* (124) alter_db_option ::= KEEP integer_list */ + 367, /* (125) alter_db_option ::= KEEP variable_list */ + 367, /* (126) alter_db_option ::= PAGES NK_INTEGER */ + 367, /* (127) alter_db_option ::= REPLICA NK_INTEGER */ + 367, /* (128) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + 367, /* (129) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + 367, /* (130) alter_db_option ::= MINROWS NK_INTEGER */ + 367, /* (131) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + 367, /* (132) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 367, /* (133) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + 367, /* (134) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 363, /* (135) integer_list ::= NK_INTEGER */ + 363, /* (136) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + 364, /* (137) variable_list ::= NK_VARIABLE */ + 364, /* (138) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + 365, /* (139) retention_list ::= retention */ + 365, /* (140) retention_list ::= retention_list NK_COMMA retention */ + 368, /* (141) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + 360, /* (142) speed_opt ::= */ + 360, /* (143) speed_opt ::= MAX_SPEED NK_INTEGER */ + 361, /* (144) start_opt ::= */ + 361, /* (145) start_opt ::= START WITH NK_INTEGER */ + 361, /* (146) start_opt ::= START WITH NK_STRING */ + 361, /* (147) start_opt ::= START WITH TIMESTAMP NK_STRING */ + 362, /* (148) end_opt ::= */ + 362, /* (149) end_opt ::= END WITH NK_INTEGER */ + 362, /* (150) end_opt ::= END WITH NK_STRING */ + 362, /* (151) end_opt ::= END WITH TIMESTAMP NK_STRING */ + 337, /* (152) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + 337, /* (153) cmd ::= CREATE TABLE multi_create_clause */ + 337, /* (154) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + 337, /* (155) cmd ::= DROP TABLE multi_drop_clause */ + 337, /* (156) cmd ::= DROP STABLE exists_opt full_table_name */ + 337, /* (157) cmd ::= ALTER TABLE alter_table_clause */ + 337, /* (158) cmd ::= ALTER STABLE alter_table_clause */ + 376, /* (159) alter_table_clause ::= full_table_name alter_table_options */ + 376, /* (160) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + 376, /* (161) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + 376, /* (162) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + 376, /* (163) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + 376, /* (164) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + 376, /* (165) alter_table_clause ::= full_table_name DROP TAG column_name */ + 376, /* (166) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + 376, /* (167) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + 376, /* (168) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + 373, /* (169) multi_create_clause ::= create_subtable_clause */ + 373, /* (170) multi_create_clause ::= multi_create_clause create_subtable_clause */ + 381, /* (171) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + 375, /* (172) multi_drop_clause ::= drop_table_clause */ + 375, /* (173) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + 384, /* (174) drop_table_clause ::= exists_opt full_table_name */ + 382, /* (175) specific_cols_opt ::= */ + 382, /* (176) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + 369, /* (177) full_table_name ::= table_name */ + 369, /* (178) full_table_name ::= db_name NK_DOT table_name */ + 370, /* (179) column_def_list ::= column_def */ + 370, /* (180) column_def_list ::= column_def_list NK_COMMA column_def */ + 386, /* (181) column_def ::= column_name type_name */ + 379, /* (182) type_name ::= BOOL */ + 379, /* (183) type_name ::= TINYINT */ + 379, /* (184) type_name ::= SMALLINT */ + 379, /* (185) type_name ::= INT */ + 379, /* (186) type_name ::= INTEGER */ + 379, /* (187) type_name ::= BIGINT */ + 379, /* (188) type_name ::= FLOAT */ + 379, /* (189) type_name ::= DOUBLE */ + 379, /* (190) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 379, /* (191) type_name ::= TIMESTAMP */ + 379, /* (192) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 379, /* (193) type_name ::= TINYINT UNSIGNED */ + 379, /* (194) type_name ::= SMALLINT UNSIGNED */ + 379, /* (195) type_name ::= INT UNSIGNED */ + 379, /* (196) type_name ::= BIGINT UNSIGNED */ + 379, /* (197) type_name ::= JSON */ + 379, /* (198) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 379, /* (199) type_name ::= MEDIUMBLOB */ + 379, /* (200) type_name ::= BLOB */ + 379, /* (201) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 379, /* (202) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 379, /* (203) type_name ::= DECIMAL */ + 379, /* (204) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 379, /* (205) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 371, /* (206) tags_def_opt ::= */ + 371, /* (207) tags_def_opt ::= tags_def */ + 374, /* (208) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + 372, /* (209) table_options ::= */ + 372, /* (210) table_options ::= table_options COMMENT NK_STRING */ + 372, /* (211) table_options ::= table_options MAX_DELAY duration_list */ + 372, /* (212) table_options ::= table_options WATERMARK duration_list */ + 372, /* (213) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 372, /* (214) table_options ::= table_options TTL NK_INTEGER */ + 372, /* (215) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 372, /* (216) table_options ::= table_options DELETE_MARK duration_list */ + 377, /* (217) alter_table_options ::= alter_table_option */ + 377, /* (218) alter_table_options ::= alter_table_options alter_table_option */ + 389, /* (219) alter_table_option ::= COMMENT NK_STRING */ + 389, /* (220) alter_table_option ::= TTL NK_INTEGER */ + 387, /* (221) duration_list ::= duration_literal */ + 387, /* (222) duration_list ::= duration_list NK_COMMA duration_literal */ + 388, /* (223) rollup_func_list ::= rollup_func_name */ + 388, /* (224) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + 391, /* (225) rollup_func_name ::= function_name */ + 391, /* (226) rollup_func_name ::= FIRST */ + 391, /* (227) rollup_func_name ::= LAST */ + 385, /* (228) col_name_list ::= col_name */ + 385, /* (229) col_name_list ::= col_name_list NK_COMMA col_name */ + 393, /* (230) col_name ::= column_name */ + 337, /* (231) cmd ::= SHOW DNODES */ + 337, /* (232) cmd ::= SHOW USERS */ + 337, /* (233) cmd ::= SHOW USER PRIVILEGES */ + 337, /* (234) cmd ::= SHOW DATABASES */ + 337, /* (235) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + 337, /* (236) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 337, /* (237) cmd ::= SHOW db_name_cond_opt VGROUPS */ + 337, /* (238) cmd ::= SHOW MNODES */ + 337, /* (239) cmd ::= SHOW QNODES */ + 337, /* (240) cmd ::= SHOW FUNCTIONS */ + 337, /* (241) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 337, /* (242) cmd ::= SHOW STREAMS */ + 337, /* (243) cmd ::= SHOW ACCOUNTS */ + 337, /* (244) cmd ::= SHOW APPS */ + 337, /* (245) cmd ::= SHOW CONNECTIONS */ + 337, /* (246) cmd ::= SHOW LICENCES */ + 337, /* (247) cmd ::= SHOW GRANTS */ + 337, /* (248) cmd ::= SHOW CREATE DATABASE db_name */ + 337, /* (249) cmd ::= SHOW CREATE TABLE full_table_name */ + 337, /* (250) cmd ::= SHOW CREATE STABLE full_table_name */ + 337, /* (251) cmd ::= SHOW QUERIES */ + 337, /* (252) cmd ::= SHOW SCORES */ + 337, /* (253) cmd ::= SHOW TOPICS */ + 337, /* (254) cmd ::= SHOW VARIABLES */ + 337, /* (255) cmd ::= SHOW CLUSTER VARIABLES */ + 337, /* (256) cmd ::= SHOW LOCAL VARIABLES */ + 337, /* (257) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 337, /* (258) cmd ::= SHOW BNODES */ + 337, /* (259) cmd ::= SHOW SNODES */ + 337, /* (260) cmd ::= SHOW CLUSTER */ + 337, /* (261) cmd ::= SHOW TRANSACTIONS */ + 337, /* (262) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + 337, /* (263) cmd ::= SHOW CONSUMERS */ + 337, /* (264) cmd ::= SHOW SUBSCRIPTIONS */ + 337, /* (265) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 337, /* (266) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 337, /* (267) cmd ::= SHOW VNODES NK_INTEGER */ + 337, /* (268) cmd ::= SHOW VNODES NK_STRING */ + 337, /* (269) cmd ::= SHOW db_name_cond_opt ALIVE */ + 337, /* (270) cmd ::= SHOW CLUSTER ALIVE */ + 394, /* (271) db_name_cond_opt ::= */ + 394, /* (272) db_name_cond_opt ::= db_name NK_DOT */ + 395, /* (273) like_pattern_opt ::= */ + 395, /* (274) like_pattern_opt ::= LIKE NK_STRING */ + 396, /* (275) table_name_cond ::= table_name */ + 397, /* (276) from_db_opt ::= */ + 397, /* (277) from_db_opt ::= FROM db_name */ + 398, /* (278) tag_list_opt ::= */ + 398, /* (279) tag_list_opt ::= tag_item */ + 398, /* (280) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + 399, /* (281) tag_item ::= TBNAME */ + 399, /* (282) tag_item ::= QTAGS */ + 399, /* (283) tag_item ::= column_name */ + 399, /* (284) tag_item ::= column_name column_alias */ + 399, /* (285) tag_item ::= column_name AS column_alias */ + 337, /* (286) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ + 337, /* (287) cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ + 337, /* (288) cmd ::= DROP INDEX exists_opt full_index_name */ + 401, /* (289) full_index_name ::= index_name */ + 401, /* (290) full_index_name ::= db_name NK_DOT index_name */ + 402, /* (291) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 402, /* (292) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + 404, /* (293) func_list ::= func */ + 404, /* (294) func_list ::= func_list NK_COMMA func */ + 407, /* (295) func ::= sma_func_name NK_LP expression_list NK_RP */ + 408, /* (296) sma_func_name ::= function_name */ + 408, /* (297) sma_func_name ::= COUNT */ + 408, /* (298) sma_func_name ::= FIRST */ + 408, /* (299) sma_func_name ::= LAST */ + 408, /* (300) sma_func_name ::= LAST_ROW */ + 406, /* (301) sma_stream_opt ::= */ + 406, /* (302) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + 406, /* (303) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 406, /* (304) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 337, /* (305) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 337, /* (306) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + 337, /* (307) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + 337, /* (308) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + 337, /* (309) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + 337, /* (310) cmd ::= DROP TOPIC exists_opt topic_name */ + 337, /* (311) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 337, /* (312) cmd ::= DESC full_table_name */ + 337, /* (313) cmd ::= DESCRIBE full_table_name */ + 337, /* (314) cmd ::= RESET QUERY CACHE */ + 337, /* (315) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 337, /* (316) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 411, /* (317) analyze_opt ::= */ + 411, /* (318) analyze_opt ::= ANALYZE */ + 412, /* (319) explain_options ::= */ + 412, /* (320) explain_options ::= explain_options VERBOSE NK_BOOL */ + 412, /* (321) explain_options ::= explain_options RATIO NK_FLOAT */ + 337, /* (322) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + 337, /* (323) cmd ::= DROP FUNCTION exists_opt function_name */ + 415, /* (324) agg_func_opt ::= */ + 415, /* (325) agg_func_opt ::= AGGREGATE */ + 416, /* (326) bufsize_opt ::= */ + 416, /* (327) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 417, /* (328) language_opt ::= */ + 417, /* (329) language_opt ::= LANGUAGE NK_STRING */ + 414, /* (330) or_replace_opt ::= */ + 414, /* (331) or_replace_opt ::= OR REPLACE */ + 337, /* (332) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + 337, /* (333) cmd ::= DROP STREAM exists_opt stream_name */ + 337, /* (334) cmd ::= PAUSE STREAM exists_opt stream_name */ + 337, /* (335) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 420, /* (336) col_list_opt ::= */ + 420, /* (337) col_list_opt ::= NK_LP col_name_list NK_RP */ + 421, /* (338) tag_def_or_ref_opt ::= */ + 421, /* (339) tag_def_or_ref_opt ::= tags_def */ + 421, /* (340) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 419, /* (341) stream_options ::= */ + 419, /* (342) stream_options ::= stream_options TRIGGER AT_ONCE */ + 419, /* (343) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 419, /* (344) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 419, /* (345) stream_options ::= stream_options WATERMARK duration_literal */ + 419, /* (346) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 419, /* (347) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 419, /* (348) stream_options ::= stream_options DELETE_MARK duration_literal */ + 419, /* (349) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 422, /* (350) subtable_opt ::= */ + 422, /* (351) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 423, /* (352) ignore_opt ::= */ + 423, /* (353) ignore_opt ::= IGNORE UNTREATED */ + 337, /* (354) cmd ::= KILL CONNECTION NK_INTEGER */ + 337, /* (355) cmd ::= KILL QUERY NK_STRING */ + 337, /* (356) cmd ::= KILL TRANSACTION NK_INTEGER */ + 337, /* (357) cmd ::= BALANCE VGROUP */ + 337, /* (358) cmd ::= BALANCE VGROUP LEADER */ + 337, /* (359) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + 337, /* (360) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + 337, /* (361) cmd ::= SPLIT VGROUP NK_INTEGER */ + 425, /* (362) dnode_list ::= DNODE NK_INTEGER */ + 425, /* (363) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 337, /* (364) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 337, /* (365) cmd ::= query_or_subquery */ + 337, /* (366) cmd ::= insert_query */ + 413, /* (367) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 413, /* (368) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 340, /* (369) literal ::= NK_INTEGER */ + 340, /* (370) literal ::= NK_FLOAT */ + 340, /* (371) literal ::= NK_STRING */ + 340, /* (372) literal ::= NK_BOOL */ + 340, /* (373) literal ::= TIMESTAMP NK_STRING */ + 340, /* (374) literal ::= duration_literal */ + 340, /* (375) literal ::= NULL */ + 340, /* (376) literal ::= NK_QUESTION */ + 390, /* (377) duration_literal ::= NK_VARIABLE */ + 366, /* (378) signed ::= NK_INTEGER */ + 366, /* (379) signed ::= NK_PLUS NK_INTEGER */ + 366, /* (380) signed ::= NK_MINUS NK_INTEGER */ + 366, /* (381) signed ::= NK_FLOAT */ + 366, /* (382) signed ::= NK_PLUS NK_FLOAT */ + 366, /* (383) signed ::= NK_MINUS NK_FLOAT */ + 380, /* (384) signed_literal ::= signed */ + 380, /* (385) signed_literal ::= NK_STRING */ + 380, /* (386) signed_literal ::= NK_BOOL */ + 380, /* (387) signed_literal ::= TIMESTAMP NK_STRING */ + 380, /* (388) signed_literal ::= duration_literal */ + 380, /* (389) signed_literal ::= NULL */ + 380, /* (390) signed_literal ::= literal_func */ + 380, /* (391) signed_literal ::= NK_QUESTION */ + 428, /* (392) literal_list ::= signed_literal */ + 428, /* (393) literal_list ::= literal_list NK_COMMA signed_literal */ + 349, /* (394) db_name ::= NK_ID */ + 350, /* (395) table_name ::= NK_ID */ + 378, /* (396) column_name ::= NK_ID */ + 392, /* (397) function_name ::= NK_ID */ + 429, /* (398) table_alias ::= NK_ID */ + 400, /* (399) column_alias ::= NK_ID */ + 342, /* (400) user_name ::= NK_ID */ + 351, /* (401) topic_name ::= NK_ID */ + 418, /* (402) stream_name ::= NK_ID */ + 410, /* (403) cgroup_name ::= NK_ID */ + 403, /* (404) index_name ::= NK_ID */ + 430, /* (405) expr_or_subquery ::= expression */ + 424, /* (406) expression ::= literal */ + 424, /* (407) expression ::= pseudo_column */ + 424, /* (408) expression ::= column_reference */ + 424, /* (409) expression ::= function_expression */ + 424, /* (410) expression ::= case_when_expression */ + 424, /* (411) expression ::= NK_LP expression NK_RP */ + 424, /* (412) expression ::= NK_PLUS expr_or_subquery */ + 424, /* (413) expression ::= NK_MINUS expr_or_subquery */ + 424, /* (414) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 424, /* (415) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 424, /* (416) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 424, /* (417) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 424, /* (418) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 424, /* (419) expression ::= column_reference NK_ARROW NK_STRING */ + 424, /* (420) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 424, /* (421) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 383, /* (422) expression_list ::= expr_or_subquery */ + 383, /* (423) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 432, /* (424) column_reference ::= column_name */ + 432, /* (425) column_reference ::= table_name NK_DOT column_name */ + 431, /* (426) pseudo_column ::= ROWTS */ + 431, /* (427) pseudo_column ::= TBNAME */ + 431, /* (428) pseudo_column ::= table_name NK_DOT TBNAME */ + 431, /* (429) pseudo_column ::= QSTART */ + 431, /* (430) pseudo_column ::= QEND */ + 431, /* (431) pseudo_column ::= QDURATION */ + 431, /* (432) pseudo_column ::= WSTART */ + 431, /* (433) pseudo_column ::= WEND */ + 431, /* (434) pseudo_column ::= WDURATION */ + 431, /* (435) pseudo_column ::= IROWTS */ + 431, /* (436) pseudo_column ::= ISFILLED */ + 431, /* (437) pseudo_column ::= QTAGS */ + 433, /* (438) function_expression ::= function_name NK_LP expression_list NK_RP */ + 433, /* (439) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 433, /* (440) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 433, /* (441) function_expression ::= literal_func */ + 427, /* (442) literal_func ::= noarg_func NK_LP NK_RP */ + 427, /* (443) literal_func ::= NOW */ + 437, /* (444) noarg_func ::= NOW */ + 437, /* (445) noarg_func ::= TODAY */ + 437, /* (446) noarg_func ::= TIMEZONE */ + 437, /* (447) noarg_func ::= DATABASE */ + 437, /* (448) noarg_func ::= CLIENT_VERSION */ + 437, /* (449) noarg_func ::= SERVER_VERSION */ + 437, /* (450) noarg_func ::= SERVER_STATUS */ + 437, /* (451) noarg_func ::= CURRENT_USER */ + 437, /* (452) noarg_func ::= USER */ + 435, /* (453) star_func ::= COUNT */ + 435, /* (454) star_func ::= FIRST */ + 435, /* (455) star_func ::= LAST */ + 435, /* (456) star_func ::= LAST_ROW */ + 436, /* (457) star_func_para_list ::= NK_STAR */ + 436, /* (458) star_func_para_list ::= other_para_list */ + 438, /* (459) other_para_list ::= star_func_para */ + 438, /* (460) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 439, /* (461) star_func_para ::= expr_or_subquery */ + 439, /* (462) star_func_para ::= table_name NK_DOT NK_STAR */ + 434, /* (463) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 434, /* (464) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 440, /* (465) when_then_list ::= when_then_expr */ + 440, /* (466) when_then_list ::= when_then_list when_then_expr */ + 443, /* (467) when_then_expr ::= WHEN common_expression THEN common_expression */ + 441, /* (468) case_when_else_opt ::= */ + 441, /* (469) case_when_else_opt ::= ELSE common_expression */ + 444, /* (470) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 444, /* (471) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 444, /* (472) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 444, /* (473) predicate ::= expr_or_subquery IS NULL */ + 444, /* (474) predicate ::= expr_or_subquery IS NOT NULL */ + 444, /* (475) predicate ::= expr_or_subquery in_op in_predicate_value */ + 445, /* (476) compare_op ::= NK_LT */ + 445, /* (477) compare_op ::= NK_GT */ + 445, /* (478) compare_op ::= NK_LE */ + 445, /* (479) compare_op ::= NK_GE */ + 445, /* (480) compare_op ::= NK_NE */ + 445, /* (481) compare_op ::= NK_EQ */ + 445, /* (482) compare_op ::= LIKE */ + 445, /* (483) compare_op ::= NOT LIKE */ + 445, /* (484) compare_op ::= MATCH */ + 445, /* (485) compare_op ::= NMATCH */ + 445, /* (486) compare_op ::= CONTAINS */ + 446, /* (487) in_op ::= IN */ + 446, /* (488) in_op ::= NOT IN */ + 447, /* (489) in_predicate_value ::= NK_LP literal_list NK_RP */ + 448, /* (490) boolean_value_expression ::= boolean_primary */ + 448, /* (491) boolean_value_expression ::= NOT boolean_primary */ + 448, /* (492) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 448, /* (493) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 449, /* (494) boolean_primary ::= predicate */ + 449, /* (495) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 442, /* (496) common_expression ::= expr_or_subquery */ + 442, /* (497) common_expression ::= boolean_value_expression */ + 450, /* (498) from_clause_opt ::= */ + 450, /* (499) from_clause_opt ::= FROM table_reference_list */ + 451, /* (500) table_reference_list ::= table_reference */ + 451, /* (501) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 452, /* (502) table_reference ::= table_primary */ + 452, /* (503) table_reference ::= joined_table */ + 453, /* (504) table_primary ::= table_name alias_opt */ + 453, /* (505) table_primary ::= db_name NK_DOT table_name alias_opt */ + 453, /* (506) table_primary ::= subquery alias_opt */ + 453, /* (507) table_primary ::= parenthesized_joined_table */ + 455, /* (508) alias_opt ::= */ + 455, /* (509) alias_opt ::= table_alias */ + 455, /* (510) alias_opt ::= AS table_alias */ + 457, /* (511) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 457, /* (512) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 454, /* (513) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 458, /* (514) join_type ::= */ + 458, /* (515) join_type ::= INNER */ + 459, /* (516) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 460, /* (517) set_quantifier_opt ::= */ + 460, /* (518) set_quantifier_opt ::= DISTINCT */ + 460, /* (519) set_quantifier_opt ::= ALL */ + 461, /* (520) select_list ::= select_item */ + 461, /* (521) select_list ::= select_list NK_COMMA select_item */ + 469, /* (522) select_item ::= NK_STAR */ + 469, /* (523) select_item ::= common_expression */ + 469, /* (524) select_item ::= common_expression column_alias */ + 469, /* (525) select_item ::= common_expression AS column_alias */ + 469, /* (526) select_item ::= table_name NK_DOT NK_STAR */ + 426, /* (527) where_clause_opt ::= */ + 426, /* (528) where_clause_opt ::= WHERE search_condition */ + 462, /* (529) partition_by_clause_opt ::= */ + 462, /* (530) partition_by_clause_opt ::= PARTITION BY partition_list */ + 470, /* (531) partition_list ::= partition_item */ + 470, /* (532) partition_list ::= partition_list NK_COMMA partition_item */ + 471, /* (533) partition_item ::= expr_or_subquery */ + 471, /* (534) partition_item ::= expr_or_subquery column_alias */ + 471, /* (535) partition_item ::= expr_or_subquery AS column_alias */ + 466, /* (536) twindow_clause_opt ::= */ + 466, /* (537) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + 466, /* (538) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 466, /* (539) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + 466, /* (540) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + 466, /* (541) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 405, /* (542) sliding_opt ::= */ + 405, /* (543) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + 465, /* (544) fill_opt ::= */ + 465, /* (545) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 465, /* (546) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 465, /* (547) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 472, /* (548) fill_mode ::= NONE */ + 472, /* (549) fill_mode ::= PREV */ + 472, /* (550) fill_mode ::= NULL */ + 472, /* (551) fill_mode ::= NULL_F */ + 472, /* (552) fill_mode ::= LINEAR */ + 472, /* (553) fill_mode ::= NEXT */ + 467, /* (554) group_by_clause_opt ::= */ + 467, /* (555) group_by_clause_opt ::= GROUP BY group_by_list */ + 473, /* (556) group_by_list ::= expr_or_subquery */ + 473, /* (557) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 468, /* (558) having_clause_opt ::= */ + 468, /* (559) having_clause_opt ::= HAVING search_condition */ + 463, /* (560) range_opt ::= */ + 463, /* (561) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 464, /* (562) every_opt ::= */ + 464, /* (563) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 474, /* (564) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 475, /* (565) query_simple ::= query_specification */ + 475, /* (566) query_simple ::= union_query_expression */ + 479, /* (567) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 479, /* (568) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 480, /* (569) query_simple_or_subquery ::= query_simple */ + 480, /* (570) query_simple_or_subquery ::= subquery */ + 409, /* (571) query_or_subquery ::= query_expression */ + 409, /* (572) query_or_subquery ::= subquery */ + 476, /* (573) order_by_clause_opt ::= */ + 476, /* (574) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 477, /* (575) slimit_clause_opt ::= */ + 477, /* (576) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 477, /* (577) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 477, /* (578) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 478, /* (579) limit_clause_opt ::= */ + 478, /* (580) limit_clause_opt ::= LIMIT NK_INTEGER */ + 478, /* (581) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 478, /* (582) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 456, /* (583) subquery ::= NK_LP query_expression NK_RP */ + 456, /* (584) subquery ::= NK_LP subquery NK_RP */ + 352, /* (585) search_condition ::= common_expression */ + 481, /* (586) sort_specification_list ::= sort_specification */ + 481, /* (587) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 482, /* (588) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 483, /* (589) ordering_specification_opt ::= */ + 483, /* (590) ordering_specification_opt ::= ASC */ + 483, /* (591) ordering_specification_opt ::= DESC */ + 484, /* (592) null_ordering_opt ::= */ + 484, /* (593) null_ordering_opt ::= NULLS FIRST */ + 484, /* (594) null_ordering_opt ::= NULLS LAST */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -4000,398 +3956,399 @@ static const signed char yyRuleInfoNRhs[] = { -1, /* (199) type_name ::= MEDIUMBLOB */ -1, /* (200) type_name ::= BLOB */ -4, /* (201) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - -1, /* (202) type_name ::= DECIMAL */ - -4, /* (203) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - -6, /* (204) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 0, /* (205) tags_def_opt ::= */ - -1, /* (206) tags_def_opt ::= tags_def */ - -4, /* (207) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - 0, /* (208) table_options ::= */ - -3, /* (209) table_options ::= table_options COMMENT NK_STRING */ - -3, /* (210) table_options ::= table_options MAX_DELAY duration_list */ - -3, /* (211) table_options ::= table_options WATERMARK duration_list */ - -5, /* (212) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - -3, /* (213) table_options ::= table_options TTL NK_INTEGER */ - -5, /* (214) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - -3, /* (215) table_options ::= table_options DELETE_MARK duration_list */ - -1, /* (216) alter_table_options ::= alter_table_option */ - -2, /* (217) alter_table_options ::= alter_table_options alter_table_option */ - -2, /* (218) alter_table_option ::= COMMENT NK_STRING */ - -2, /* (219) alter_table_option ::= TTL NK_INTEGER */ - -1, /* (220) duration_list ::= duration_literal */ - -3, /* (221) duration_list ::= duration_list NK_COMMA duration_literal */ - -1, /* (222) rollup_func_list ::= rollup_func_name */ - -3, /* (223) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - -1, /* (224) rollup_func_name ::= function_name */ - -1, /* (225) rollup_func_name ::= FIRST */ - -1, /* (226) rollup_func_name ::= LAST */ - -1, /* (227) col_name_list ::= col_name */ - -3, /* (228) col_name_list ::= col_name_list NK_COMMA col_name */ - -1, /* (229) col_name ::= column_name */ - -2, /* (230) cmd ::= SHOW DNODES */ - -2, /* (231) cmd ::= SHOW USERS */ - -3, /* (232) cmd ::= SHOW USER PRIVILEGES */ - -2, /* (233) cmd ::= SHOW DATABASES */ - -4, /* (234) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - -4, /* (235) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - -3, /* (236) cmd ::= SHOW db_name_cond_opt VGROUPS */ - -2, /* (237) cmd ::= SHOW MNODES */ - -2, /* (238) cmd ::= SHOW QNODES */ - -2, /* (239) cmd ::= SHOW FUNCTIONS */ - -5, /* (240) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - -2, /* (241) cmd ::= SHOW STREAMS */ - -2, /* (242) cmd ::= SHOW ACCOUNTS */ - -2, /* (243) cmd ::= SHOW APPS */ - -2, /* (244) cmd ::= SHOW CONNECTIONS */ - -2, /* (245) cmd ::= SHOW LICENCES */ - -2, /* (246) cmd ::= SHOW GRANTS */ - -4, /* (247) cmd ::= SHOW CREATE DATABASE db_name */ - -4, /* (248) cmd ::= SHOW CREATE TABLE full_table_name */ - -4, /* (249) cmd ::= SHOW CREATE STABLE full_table_name */ - -2, /* (250) cmd ::= SHOW QUERIES */ - -2, /* (251) cmd ::= SHOW SCORES */ - -2, /* (252) cmd ::= SHOW TOPICS */ - -2, /* (253) cmd ::= SHOW VARIABLES */ - -3, /* (254) cmd ::= SHOW CLUSTER VARIABLES */ - -3, /* (255) cmd ::= SHOW LOCAL VARIABLES */ - -5, /* (256) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - -2, /* (257) cmd ::= SHOW BNODES */ - -2, /* (258) cmd ::= SHOW SNODES */ - -2, /* (259) cmd ::= SHOW CLUSTER */ - -2, /* (260) cmd ::= SHOW TRANSACTIONS */ - -4, /* (261) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - -2, /* (262) cmd ::= SHOW CONSUMERS */ - -2, /* (263) cmd ::= SHOW SUBSCRIPTIONS */ - -5, /* (264) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - -7, /* (265) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - -3, /* (266) cmd ::= SHOW VNODES NK_INTEGER */ - -3, /* (267) cmd ::= SHOW VNODES NK_STRING */ - -3, /* (268) cmd ::= SHOW db_name_cond_opt ALIVE */ - -3, /* (269) cmd ::= SHOW CLUSTER ALIVE */ - 0, /* (270) db_name_cond_opt ::= */ - -2, /* (271) db_name_cond_opt ::= db_name NK_DOT */ - 0, /* (272) like_pattern_opt ::= */ - -2, /* (273) like_pattern_opt ::= LIKE NK_STRING */ - -1, /* (274) table_name_cond ::= table_name */ - 0, /* (275) from_db_opt ::= */ - -2, /* (276) from_db_opt ::= FROM db_name */ - 0, /* (277) tag_list_opt ::= */ - -1, /* (278) tag_list_opt ::= tag_item */ - -3, /* (279) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - -1, /* (280) tag_item ::= TBNAME */ - -1, /* (281) tag_item ::= QTAGS */ - -1, /* (282) tag_item ::= column_name */ - -2, /* (283) tag_item ::= column_name column_alias */ - -3, /* (284) tag_item ::= column_name AS column_alias */ - -8, /* (285) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ - -9, /* (286) cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ - -4, /* (287) cmd ::= DROP INDEX exists_opt full_index_name */ - -1, /* (288) full_index_name ::= index_name */ - -3, /* (289) full_index_name ::= db_name NK_DOT index_name */ - -10, /* (290) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - -12, /* (291) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - -1, /* (292) func_list ::= func */ - -3, /* (293) func_list ::= func_list NK_COMMA func */ - -4, /* (294) func ::= sma_func_name NK_LP expression_list NK_RP */ - -1, /* (295) sma_func_name ::= function_name */ - -1, /* (296) sma_func_name ::= COUNT */ - -1, /* (297) sma_func_name ::= FIRST */ - -1, /* (298) sma_func_name ::= LAST */ - -1, /* (299) sma_func_name ::= LAST_ROW */ - 0, /* (300) sma_stream_opt ::= */ - -3, /* (301) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - -3, /* (302) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - -3, /* (303) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - -6, /* (304) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - -7, /* (305) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - -9, /* (306) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - -7, /* (307) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - -9, /* (308) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - -4, /* (309) cmd ::= DROP TOPIC exists_opt topic_name */ - -7, /* (310) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - -2, /* (311) cmd ::= DESC full_table_name */ - -2, /* (312) cmd ::= DESCRIBE full_table_name */ - -3, /* (313) cmd ::= RESET QUERY CACHE */ - -4, /* (314) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - -4, /* (315) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 0, /* (316) analyze_opt ::= */ - -1, /* (317) analyze_opt ::= ANALYZE */ - 0, /* (318) explain_options ::= */ - -3, /* (319) explain_options ::= explain_options VERBOSE NK_BOOL */ - -3, /* (320) explain_options ::= explain_options RATIO NK_FLOAT */ - -12, /* (321) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - -4, /* (322) cmd ::= DROP FUNCTION exists_opt function_name */ - 0, /* (323) agg_func_opt ::= */ - -1, /* (324) agg_func_opt ::= AGGREGATE */ - 0, /* (325) bufsize_opt ::= */ - -2, /* (326) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 0, /* (327) language_opt ::= */ - -2, /* (328) language_opt ::= LANGUAGE NK_STRING */ - 0, /* (329) or_replace_opt ::= */ - -2, /* (330) or_replace_opt ::= OR REPLACE */ - -12, /* (331) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - -4, /* (332) cmd ::= DROP STREAM exists_opt stream_name */ - -4, /* (333) cmd ::= PAUSE STREAM exists_opt stream_name */ - -5, /* (334) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 0, /* (335) col_list_opt ::= */ - -3, /* (336) col_list_opt ::= NK_LP col_name_list NK_RP */ - 0, /* (337) tag_def_or_ref_opt ::= */ - -1, /* (338) tag_def_or_ref_opt ::= tags_def */ - -4, /* (339) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 0, /* (340) stream_options ::= */ - -3, /* (341) stream_options ::= stream_options TRIGGER AT_ONCE */ - -3, /* (342) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - -4, /* (343) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - -3, /* (344) stream_options ::= stream_options WATERMARK duration_literal */ - -4, /* (345) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - -3, /* (346) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - -3, /* (347) stream_options ::= stream_options DELETE_MARK duration_literal */ - -4, /* (348) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 0, /* (349) subtable_opt ::= */ - -4, /* (350) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 0, /* (351) ignore_opt ::= */ - -2, /* (352) ignore_opt ::= IGNORE UNTREATED */ - -3, /* (353) cmd ::= KILL CONNECTION NK_INTEGER */ - -3, /* (354) cmd ::= KILL QUERY NK_STRING */ - -3, /* (355) cmd ::= KILL TRANSACTION NK_INTEGER */ - -2, /* (356) cmd ::= BALANCE VGROUP */ - -3, /* (357) cmd ::= BALANCE VGROUP LEADER */ - -4, /* (358) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - -4, /* (359) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - -3, /* (360) cmd ::= SPLIT VGROUP NK_INTEGER */ - -2, /* (361) dnode_list ::= DNODE NK_INTEGER */ - -3, /* (362) dnode_list ::= dnode_list DNODE NK_INTEGER */ - -4, /* (363) cmd ::= DELETE FROM full_table_name where_clause_opt */ - -1, /* (364) cmd ::= query_or_subquery */ - -1, /* (365) cmd ::= insert_query */ - -7, /* (366) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - -4, /* (367) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - -1, /* (368) literal ::= NK_INTEGER */ - -1, /* (369) literal ::= NK_FLOAT */ - -1, /* (370) literal ::= NK_STRING */ - -1, /* (371) literal ::= NK_BOOL */ - -2, /* (372) literal ::= TIMESTAMP NK_STRING */ - -1, /* (373) literal ::= duration_literal */ - -1, /* (374) literal ::= NULL */ - -1, /* (375) literal ::= NK_QUESTION */ - -1, /* (376) duration_literal ::= NK_VARIABLE */ - -1, /* (377) signed ::= NK_INTEGER */ - -2, /* (378) signed ::= NK_PLUS NK_INTEGER */ - -2, /* (379) signed ::= NK_MINUS NK_INTEGER */ - -1, /* (380) signed ::= NK_FLOAT */ - -2, /* (381) signed ::= NK_PLUS NK_FLOAT */ - -2, /* (382) signed ::= NK_MINUS NK_FLOAT */ - -1, /* (383) signed_literal ::= signed */ - -1, /* (384) signed_literal ::= NK_STRING */ - -1, /* (385) signed_literal ::= NK_BOOL */ - -2, /* (386) signed_literal ::= TIMESTAMP NK_STRING */ - -1, /* (387) signed_literal ::= duration_literal */ - -1, /* (388) signed_literal ::= NULL */ - -1, /* (389) signed_literal ::= literal_func */ - -1, /* (390) signed_literal ::= NK_QUESTION */ - -1, /* (391) literal_list ::= signed_literal */ - -3, /* (392) literal_list ::= literal_list NK_COMMA signed_literal */ - -1, /* (393) db_name ::= NK_ID */ - -1, /* (394) table_name ::= NK_ID */ - -1, /* (395) column_name ::= NK_ID */ - -1, /* (396) function_name ::= NK_ID */ - -1, /* (397) table_alias ::= NK_ID */ - -1, /* (398) column_alias ::= NK_ID */ - -1, /* (399) user_name ::= NK_ID */ - -1, /* (400) topic_name ::= NK_ID */ - -1, /* (401) stream_name ::= NK_ID */ - -1, /* (402) cgroup_name ::= NK_ID */ - -1, /* (403) index_name ::= NK_ID */ - -1, /* (404) expr_or_subquery ::= expression */ - -1, /* (405) expression ::= literal */ - -1, /* (406) expression ::= pseudo_column */ - -1, /* (407) expression ::= column_reference */ - -1, /* (408) expression ::= function_expression */ - -1, /* (409) expression ::= case_when_expression */ - -3, /* (410) expression ::= NK_LP expression NK_RP */ - -2, /* (411) expression ::= NK_PLUS expr_or_subquery */ - -2, /* (412) expression ::= NK_MINUS expr_or_subquery */ - -3, /* (413) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - -3, /* (414) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - -3, /* (415) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - -3, /* (416) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - -3, /* (417) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - -3, /* (418) expression ::= column_reference NK_ARROW NK_STRING */ - -3, /* (419) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - -3, /* (420) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - -1, /* (421) expression_list ::= expr_or_subquery */ - -3, /* (422) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - -1, /* (423) column_reference ::= column_name */ - -3, /* (424) column_reference ::= table_name NK_DOT column_name */ - -1, /* (425) pseudo_column ::= ROWTS */ - -1, /* (426) pseudo_column ::= TBNAME */ - -3, /* (427) pseudo_column ::= table_name NK_DOT TBNAME */ - -1, /* (428) pseudo_column ::= QSTART */ - -1, /* (429) pseudo_column ::= QEND */ - -1, /* (430) pseudo_column ::= QDURATION */ - -1, /* (431) pseudo_column ::= WSTART */ - -1, /* (432) pseudo_column ::= WEND */ - -1, /* (433) pseudo_column ::= WDURATION */ - -1, /* (434) pseudo_column ::= IROWTS */ - -1, /* (435) pseudo_column ::= ISFILLED */ - -1, /* (436) pseudo_column ::= QTAGS */ - -4, /* (437) function_expression ::= function_name NK_LP expression_list NK_RP */ - -4, /* (438) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - -6, /* (439) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - -1, /* (440) function_expression ::= literal_func */ - -3, /* (441) literal_func ::= noarg_func NK_LP NK_RP */ - -1, /* (442) literal_func ::= NOW */ - -1, /* (443) noarg_func ::= NOW */ - -1, /* (444) noarg_func ::= TODAY */ - -1, /* (445) noarg_func ::= TIMEZONE */ - -1, /* (446) noarg_func ::= DATABASE */ - -1, /* (447) noarg_func ::= CLIENT_VERSION */ - -1, /* (448) noarg_func ::= SERVER_VERSION */ - -1, /* (449) noarg_func ::= SERVER_STATUS */ - -1, /* (450) noarg_func ::= CURRENT_USER */ - -1, /* (451) noarg_func ::= USER */ - -1, /* (452) star_func ::= COUNT */ - -1, /* (453) star_func ::= FIRST */ - -1, /* (454) star_func ::= LAST */ - -1, /* (455) star_func ::= LAST_ROW */ - -1, /* (456) star_func_para_list ::= NK_STAR */ - -1, /* (457) star_func_para_list ::= other_para_list */ - -1, /* (458) other_para_list ::= star_func_para */ - -3, /* (459) other_para_list ::= other_para_list NK_COMMA star_func_para */ - -1, /* (460) star_func_para ::= expr_or_subquery */ - -3, /* (461) star_func_para ::= table_name NK_DOT NK_STAR */ - -4, /* (462) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - -5, /* (463) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - -1, /* (464) when_then_list ::= when_then_expr */ - -2, /* (465) when_then_list ::= when_then_list when_then_expr */ - -4, /* (466) when_then_expr ::= WHEN common_expression THEN common_expression */ - 0, /* (467) case_when_else_opt ::= */ - -2, /* (468) case_when_else_opt ::= ELSE common_expression */ - -3, /* (469) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - -5, /* (470) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - -6, /* (471) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - -3, /* (472) predicate ::= expr_or_subquery IS NULL */ - -4, /* (473) predicate ::= expr_or_subquery IS NOT NULL */ - -3, /* (474) predicate ::= expr_or_subquery in_op in_predicate_value */ - -1, /* (475) compare_op ::= NK_LT */ - -1, /* (476) compare_op ::= NK_GT */ - -1, /* (477) compare_op ::= NK_LE */ - -1, /* (478) compare_op ::= NK_GE */ - -1, /* (479) compare_op ::= NK_NE */ - -1, /* (480) compare_op ::= NK_EQ */ - -1, /* (481) compare_op ::= LIKE */ - -2, /* (482) compare_op ::= NOT LIKE */ - -1, /* (483) compare_op ::= MATCH */ - -1, /* (484) compare_op ::= NMATCH */ - -1, /* (485) compare_op ::= CONTAINS */ - -1, /* (486) in_op ::= IN */ - -2, /* (487) in_op ::= NOT IN */ - -3, /* (488) in_predicate_value ::= NK_LP literal_list NK_RP */ - -1, /* (489) boolean_value_expression ::= boolean_primary */ - -2, /* (490) boolean_value_expression ::= NOT boolean_primary */ - -3, /* (491) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - -3, /* (492) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - -1, /* (493) boolean_primary ::= predicate */ - -3, /* (494) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - -1, /* (495) common_expression ::= expr_or_subquery */ - -1, /* (496) common_expression ::= boolean_value_expression */ - 0, /* (497) from_clause_opt ::= */ - -2, /* (498) from_clause_opt ::= FROM table_reference_list */ - -1, /* (499) table_reference_list ::= table_reference */ - -3, /* (500) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - -1, /* (501) table_reference ::= table_primary */ - -1, /* (502) table_reference ::= joined_table */ - -2, /* (503) table_primary ::= table_name alias_opt */ - -4, /* (504) table_primary ::= db_name NK_DOT table_name alias_opt */ - -2, /* (505) table_primary ::= subquery alias_opt */ - -1, /* (506) table_primary ::= parenthesized_joined_table */ - 0, /* (507) alias_opt ::= */ - -1, /* (508) alias_opt ::= table_alias */ - -2, /* (509) alias_opt ::= AS table_alias */ - -3, /* (510) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - -3, /* (511) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - -6, /* (512) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 0, /* (513) join_type ::= */ - -1, /* (514) join_type ::= INNER */ - -12, /* (515) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 0, /* (516) set_quantifier_opt ::= */ - -1, /* (517) set_quantifier_opt ::= DISTINCT */ - -1, /* (518) set_quantifier_opt ::= ALL */ - -1, /* (519) select_list ::= select_item */ - -3, /* (520) select_list ::= select_list NK_COMMA select_item */ - -1, /* (521) select_item ::= NK_STAR */ - -1, /* (522) select_item ::= common_expression */ - -2, /* (523) select_item ::= common_expression column_alias */ - -3, /* (524) select_item ::= common_expression AS column_alias */ - -3, /* (525) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (526) where_clause_opt ::= */ - -2, /* (527) where_clause_opt ::= WHERE search_condition */ - 0, /* (528) partition_by_clause_opt ::= */ - -3, /* (529) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (530) partition_list ::= partition_item */ - -3, /* (531) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (532) partition_item ::= expr_or_subquery */ - -2, /* (533) partition_item ::= expr_or_subquery column_alias */ - -3, /* (534) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (535) twindow_clause_opt ::= */ - -6, /* (536) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - -4, /* (537) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (538) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (539) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (540) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 0, /* (541) sliding_opt ::= */ - -4, /* (542) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - 0, /* (543) fill_opt ::= */ - -4, /* (544) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (545) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (546) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (547) fill_mode ::= NONE */ - -1, /* (548) fill_mode ::= PREV */ - -1, /* (549) fill_mode ::= NULL */ - -1, /* (550) fill_mode ::= NULL_F */ - -1, /* (551) fill_mode ::= LINEAR */ - -1, /* (552) fill_mode ::= NEXT */ - 0, /* (553) group_by_clause_opt ::= */ - -3, /* (554) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (555) group_by_list ::= expr_or_subquery */ - -3, /* (556) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (557) having_clause_opt ::= */ - -2, /* (558) having_clause_opt ::= HAVING search_condition */ - 0, /* (559) range_opt ::= */ - -6, /* (560) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 0, /* (561) every_opt ::= */ - -4, /* (562) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (563) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (564) query_simple ::= query_specification */ - -1, /* (565) query_simple ::= union_query_expression */ - -4, /* (566) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (567) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (568) query_simple_or_subquery ::= query_simple */ - -1, /* (569) query_simple_or_subquery ::= subquery */ - -1, /* (570) query_or_subquery ::= query_expression */ - -1, /* (571) query_or_subquery ::= subquery */ - 0, /* (572) order_by_clause_opt ::= */ - -3, /* (573) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (574) slimit_clause_opt ::= */ - -2, /* (575) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (576) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (577) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (578) limit_clause_opt ::= */ - -2, /* (579) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (580) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (581) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (582) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (583) subquery ::= NK_LP subquery NK_RP */ - -1, /* (584) search_condition ::= common_expression */ - -1, /* (585) sort_specification_list ::= sort_specification */ - -3, /* (586) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (587) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (588) ordering_specification_opt ::= */ - -1, /* (589) ordering_specification_opt ::= ASC */ - -1, /* (590) ordering_specification_opt ::= DESC */ - 0, /* (591) null_ordering_opt ::= */ - -2, /* (592) null_ordering_opt ::= NULLS FIRST */ - -2, /* (593) null_ordering_opt ::= NULLS LAST */ + -4, /* (202) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + -1, /* (203) type_name ::= DECIMAL */ + -4, /* (204) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + -6, /* (205) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 0, /* (206) tags_def_opt ::= */ + -1, /* (207) tags_def_opt ::= tags_def */ + -4, /* (208) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + 0, /* (209) table_options ::= */ + -3, /* (210) table_options ::= table_options COMMENT NK_STRING */ + -3, /* (211) table_options ::= table_options MAX_DELAY duration_list */ + -3, /* (212) table_options ::= table_options WATERMARK duration_list */ + -5, /* (213) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + -3, /* (214) table_options ::= table_options TTL NK_INTEGER */ + -5, /* (215) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + -3, /* (216) table_options ::= table_options DELETE_MARK duration_list */ + -1, /* (217) alter_table_options ::= alter_table_option */ + -2, /* (218) alter_table_options ::= alter_table_options alter_table_option */ + -2, /* (219) alter_table_option ::= COMMENT NK_STRING */ + -2, /* (220) alter_table_option ::= TTL NK_INTEGER */ + -1, /* (221) duration_list ::= duration_literal */ + -3, /* (222) duration_list ::= duration_list NK_COMMA duration_literal */ + -1, /* (223) rollup_func_list ::= rollup_func_name */ + -3, /* (224) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + -1, /* (225) rollup_func_name ::= function_name */ + -1, /* (226) rollup_func_name ::= FIRST */ + -1, /* (227) rollup_func_name ::= LAST */ + -1, /* (228) col_name_list ::= col_name */ + -3, /* (229) col_name_list ::= col_name_list NK_COMMA col_name */ + -1, /* (230) col_name ::= column_name */ + -2, /* (231) cmd ::= SHOW DNODES */ + -2, /* (232) cmd ::= SHOW USERS */ + -3, /* (233) cmd ::= SHOW USER PRIVILEGES */ + -2, /* (234) cmd ::= SHOW DATABASES */ + -4, /* (235) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + -4, /* (236) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + -3, /* (237) cmd ::= SHOW db_name_cond_opt VGROUPS */ + -2, /* (238) cmd ::= SHOW MNODES */ + -2, /* (239) cmd ::= SHOW QNODES */ + -2, /* (240) cmd ::= SHOW FUNCTIONS */ + -5, /* (241) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + -2, /* (242) cmd ::= SHOW STREAMS */ + -2, /* (243) cmd ::= SHOW ACCOUNTS */ + -2, /* (244) cmd ::= SHOW APPS */ + -2, /* (245) cmd ::= SHOW CONNECTIONS */ + -2, /* (246) cmd ::= SHOW LICENCES */ + -2, /* (247) cmd ::= SHOW GRANTS */ + -4, /* (248) cmd ::= SHOW CREATE DATABASE db_name */ + -4, /* (249) cmd ::= SHOW CREATE TABLE full_table_name */ + -4, /* (250) cmd ::= SHOW CREATE STABLE full_table_name */ + -2, /* (251) cmd ::= SHOW QUERIES */ + -2, /* (252) cmd ::= SHOW SCORES */ + -2, /* (253) cmd ::= SHOW TOPICS */ + -2, /* (254) cmd ::= SHOW VARIABLES */ + -3, /* (255) cmd ::= SHOW CLUSTER VARIABLES */ + -3, /* (256) cmd ::= SHOW LOCAL VARIABLES */ + -5, /* (257) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + -2, /* (258) cmd ::= SHOW BNODES */ + -2, /* (259) cmd ::= SHOW SNODES */ + -2, /* (260) cmd ::= SHOW CLUSTER */ + -2, /* (261) cmd ::= SHOW TRANSACTIONS */ + -4, /* (262) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + -2, /* (263) cmd ::= SHOW CONSUMERS */ + -2, /* (264) cmd ::= SHOW SUBSCRIPTIONS */ + -5, /* (265) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + -7, /* (266) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + -3, /* (267) cmd ::= SHOW VNODES NK_INTEGER */ + -3, /* (268) cmd ::= SHOW VNODES NK_STRING */ + -3, /* (269) cmd ::= SHOW db_name_cond_opt ALIVE */ + -3, /* (270) cmd ::= SHOW CLUSTER ALIVE */ + 0, /* (271) db_name_cond_opt ::= */ + -2, /* (272) db_name_cond_opt ::= db_name NK_DOT */ + 0, /* (273) like_pattern_opt ::= */ + -2, /* (274) like_pattern_opt ::= LIKE NK_STRING */ + -1, /* (275) table_name_cond ::= table_name */ + 0, /* (276) from_db_opt ::= */ + -2, /* (277) from_db_opt ::= FROM db_name */ + 0, /* (278) tag_list_opt ::= */ + -1, /* (279) tag_list_opt ::= tag_item */ + -3, /* (280) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + -1, /* (281) tag_item ::= TBNAME */ + -1, /* (282) tag_item ::= QTAGS */ + -1, /* (283) tag_item ::= column_name */ + -2, /* (284) tag_item ::= column_name column_alias */ + -3, /* (285) tag_item ::= column_name AS column_alias */ + -8, /* (286) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ + -9, /* (287) cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ + -4, /* (288) cmd ::= DROP INDEX exists_opt full_index_name */ + -1, /* (289) full_index_name ::= index_name */ + -3, /* (290) full_index_name ::= db_name NK_DOT index_name */ + -10, /* (291) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + -12, /* (292) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + -1, /* (293) func_list ::= func */ + -3, /* (294) func_list ::= func_list NK_COMMA func */ + -4, /* (295) func ::= sma_func_name NK_LP expression_list NK_RP */ + -1, /* (296) sma_func_name ::= function_name */ + -1, /* (297) sma_func_name ::= COUNT */ + -1, /* (298) sma_func_name ::= FIRST */ + -1, /* (299) sma_func_name ::= LAST */ + -1, /* (300) sma_func_name ::= LAST_ROW */ + 0, /* (301) sma_stream_opt ::= */ + -3, /* (302) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + -3, /* (303) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + -3, /* (304) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + -6, /* (305) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + -7, /* (306) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + -9, /* (307) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + -7, /* (308) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + -9, /* (309) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + -4, /* (310) cmd ::= DROP TOPIC exists_opt topic_name */ + -7, /* (311) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + -2, /* (312) cmd ::= DESC full_table_name */ + -2, /* (313) cmd ::= DESCRIBE full_table_name */ + -3, /* (314) cmd ::= RESET QUERY CACHE */ + -4, /* (315) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + -4, /* (316) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 0, /* (317) analyze_opt ::= */ + -1, /* (318) analyze_opt ::= ANALYZE */ + 0, /* (319) explain_options ::= */ + -3, /* (320) explain_options ::= explain_options VERBOSE NK_BOOL */ + -3, /* (321) explain_options ::= explain_options RATIO NK_FLOAT */ + -12, /* (322) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + -4, /* (323) cmd ::= DROP FUNCTION exists_opt function_name */ + 0, /* (324) agg_func_opt ::= */ + -1, /* (325) agg_func_opt ::= AGGREGATE */ + 0, /* (326) bufsize_opt ::= */ + -2, /* (327) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 0, /* (328) language_opt ::= */ + -2, /* (329) language_opt ::= LANGUAGE NK_STRING */ + 0, /* (330) or_replace_opt ::= */ + -2, /* (331) or_replace_opt ::= OR REPLACE */ + -12, /* (332) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + -4, /* (333) cmd ::= DROP STREAM exists_opt stream_name */ + -4, /* (334) cmd ::= PAUSE STREAM exists_opt stream_name */ + -5, /* (335) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 0, /* (336) col_list_opt ::= */ + -3, /* (337) col_list_opt ::= NK_LP col_name_list NK_RP */ + 0, /* (338) tag_def_or_ref_opt ::= */ + -1, /* (339) tag_def_or_ref_opt ::= tags_def */ + -4, /* (340) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 0, /* (341) stream_options ::= */ + -3, /* (342) stream_options ::= stream_options TRIGGER AT_ONCE */ + -3, /* (343) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + -4, /* (344) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + -3, /* (345) stream_options ::= stream_options WATERMARK duration_literal */ + -4, /* (346) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + -3, /* (347) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + -3, /* (348) stream_options ::= stream_options DELETE_MARK duration_literal */ + -4, /* (349) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 0, /* (350) subtable_opt ::= */ + -4, /* (351) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 0, /* (352) ignore_opt ::= */ + -2, /* (353) ignore_opt ::= IGNORE UNTREATED */ + -3, /* (354) cmd ::= KILL CONNECTION NK_INTEGER */ + -3, /* (355) cmd ::= KILL QUERY NK_STRING */ + -3, /* (356) cmd ::= KILL TRANSACTION NK_INTEGER */ + -2, /* (357) cmd ::= BALANCE VGROUP */ + -3, /* (358) cmd ::= BALANCE VGROUP LEADER */ + -4, /* (359) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + -4, /* (360) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + -3, /* (361) cmd ::= SPLIT VGROUP NK_INTEGER */ + -2, /* (362) dnode_list ::= DNODE NK_INTEGER */ + -3, /* (363) dnode_list ::= dnode_list DNODE NK_INTEGER */ + -4, /* (364) cmd ::= DELETE FROM full_table_name where_clause_opt */ + -1, /* (365) cmd ::= query_or_subquery */ + -1, /* (366) cmd ::= insert_query */ + -7, /* (367) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + -4, /* (368) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + -1, /* (369) literal ::= NK_INTEGER */ + -1, /* (370) literal ::= NK_FLOAT */ + -1, /* (371) literal ::= NK_STRING */ + -1, /* (372) literal ::= NK_BOOL */ + -2, /* (373) literal ::= TIMESTAMP NK_STRING */ + -1, /* (374) literal ::= duration_literal */ + -1, /* (375) literal ::= NULL */ + -1, /* (376) literal ::= NK_QUESTION */ + -1, /* (377) duration_literal ::= NK_VARIABLE */ + -1, /* (378) signed ::= NK_INTEGER */ + -2, /* (379) signed ::= NK_PLUS NK_INTEGER */ + -2, /* (380) signed ::= NK_MINUS NK_INTEGER */ + -1, /* (381) signed ::= NK_FLOAT */ + -2, /* (382) signed ::= NK_PLUS NK_FLOAT */ + -2, /* (383) signed ::= NK_MINUS NK_FLOAT */ + -1, /* (384) signed_literal ::= signed */ + -1, /* (385) signed_literal ::= NK_STRING */ + -1, /* (386) signed_literal ::= NK_BOOL */ + -2, /* (387) signed_literal ::= TIMESTAMP NK_STRING */ + -1, /* (388) signed_literal ::= duration_literal */ + -1, /* (389) signed_literal ::= NULL */ + -1, /* (390) signed_literal ::= literal_func */ + -1, /* (391) signed_literal ::= NK_QUESTION */ + -1, /* (392) literal_list ::= signed_literal */ + -3, /* (393) literal_list ::= literal_list NK_COMMA signed_literal */ + -1, /* (394) db_name ::= NK_ID */ + -1, /* (395) table_name ::= NK_ID */ + -1, /* (396) column_name ::= NK_ID */ + -1, /* (397) function_name ::= NK_ID */ + -1, /* (398) table_alias ::= NK_ID */ + -1, /* (399) column_alias ::= NK_ID */ + -1, /* (400) user_name ::= NK_ID */ + -1, /* (401) topic_name ::= NK_ID */ + -1, /* (402) stream_name ::= NK_ID */ + -1, /* (403) cgroup_name ::= NK_ID */ + -1, /* (404) index_name ::= NK_ID */ + -1, /* (405) expr_or_subquery ::= expression */ + -1, /* (406) expression ::= literal */ + -1, /* (407) expression ::= pseudo_column */ + -1, /* (408) expression ::= column_reference */ + -1, /* (409) expression ::= function_expression */ + -1, /* (410) expression ::= case_when_expression */ + -3, /* (411) expression ::= NK_LP expression NK_RP */ + -2, /* (412) expression ::= NK_PLUS expr_or_subquery */ + -2, /* (413) expression ::= NK_MINUS expr_or_subquery */ + -3, /* (414) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + -3, /* (415) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + -3, /* (416) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + -3, /* (417) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + -3, /* (418) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + -3, /* (419) expression ::= column_reference NK_ARROW NK_STRING */ + -3, /* (420) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + -3, /* (421) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + -1, /* (422) expression_list ::= expr_or_subquery */ + -3, /* (423) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + -1, /* (424) column_reference ::= column_name */ + -3, /* (425) column_reference ::= table_name NK_DOT column_name */ + -1, /* (426) pseudo_column ::= ROWTS */ + -1, /* (427) pseudo_column ::= TBNAME */ + -3, /* (428) pseudo_column ::= table_name NK_DOT TBNAME */ + -1, /* (429) pseudo_column ::= QSTART */ + -1, /* (430) pseudo_column ::= QEND */ + -1, /* (431) pseudo_column ::= QDURATION */ + -1, /* (432) pseudo_column ::= WSTART */ + -1, /* (433) pseudo_column ::= WEND */ + -1, /* (434) pseudo_column ::= WDURATION */ + -1, /* (435) pseudo_column ::= IROWTS */ + -1, /* (436) pseudo_column ::= ISFILLED */ + -1, /* (437) pseudo_column ::= QTAGS */ + -4, /* (438) function_expression ::= function_name NK_LP expression_list NK_RP */ + -4, /* (439) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + -6, /* (440) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + -1, /* (441) function_expression ::= literal_func */ + -3, /* (442) literal_func ::= noarg_func NK_LP NK_RP */ + -1, /* (443) literal_func ::= NOW */ + -1, /* (444) noarg_func ::= NOW */ + -1, /* (445) noarg_func ::= TODAY */ + -1, /* (446) noarg_func ::= TIMEZONE */ + -1, /* (447) noarg_func ::= DATABASE */ + -1, /* (448) noarg_func ::= CLIENT_VERSION */ + -1, /* (449) noarg_func ::= SERVER_VERSION */ + -1, /* (450) noarg_func ::= SERVER_STATUS */ + -1, /* (451) noarg_func ::= CURRENT_USER */ + -1, /* (452) noarg_func ::= USER */ + -1, /* (453) star_func ::= COUNT */ + -1, /* (454) star_func ::= FIRST */ + -1, /* (455) star_func ::= LAST */ + -1, /* (456) star_func ::= LAST_ROW */ + -1, /* (457) star_func_para_list ::= NK_STAR */ + -1, /* (458) star_func_para_list ::= other_para_list */ + -1, /* (459) other_para_list ::= star_func_para */ + -3, /* (460) other_para_list ::= other_para_list NK_COMMA star_func_para */ + -1, /* (461) star_func_para ::= expr_or_subquery */ + -3, /* (462) star_func_para ::= table_name NK_DOT NK_STAR */ + -4, /* (463) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + -5, /* (464) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + -1, /* (465) when_then_list ::= when_then_expr */ + -2, /* (466) when_then_list ::= when_then_list when_then_expr */ + -4, /* (467) when_then_expr ::= WHEN common_expression THEN common_expression */ + 0, /* (468) case_when_else_opt ::= */ + -2, /* (469) case_when_else_opt ::= ELSE common_expression */ + -3, /* (470) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + -5, /* (471) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + -6, /* (472) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + -3, /* (473) predicate ::= expr_or_subquery IS NULL */ + -4, /* (474) predicate ::= expr_or_subquery IS NOT NULL */ + -3, /* (475) predicate ::= expr_or_subquery in_op in_predicate_value */ + -1, /* (476) compare_op ::= NK_LT */ + -1, /* (477) compare_op ::= NK_GT */ + -1, /* (478) compare_op ::= NK_LE */ + -1, /* (479) compare_op ::= NK_GE */ + -1, /* (480) compare_op ::= NK_NE */ + -1, /* (481) compare_op ::= NK_EQ */ + -1, /* (482) compare_op ::= LIKE */ + -2, /* (483) compare_op ::= NOT LIKE */ + -1, /* (484) compare_op ::= MATCH */ + -1, /* (485) compare_op ::= NMATCH */ + -1, /* (486) compare_op ::= CONTAINS */ + -1, /* (487) in_op ::= IN */ + -2, /* (488) in_op ::= NOT IN */ + -3, /* (489) in_predicate_value ::= NK_LP literal_list NK_RP */ + -1, /* (490) boolean_value_expression ::= boolean_primary */ + -2, /* (491) boolean_value_expression ::= NOT boolean_primary */ + -3, /* (492) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + -3, /* (493) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + -1, /* (494) boolean_primary ::= predicate */ + -3, /* (495) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + -1, /* (496) common_expression ::= expr_or_subquery */ + -1, /* (497) common_expression ::= boolean_value_expression */ + 0, /* (498) from_clause_opt ::= */ + -2, /* (499) from_clause_opt ::= FROM table_reference_list */ + -1, /* (500) table_reference_list ::= table_reference */ + -3, /* (501) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + -1, /* (502) table_reference ::= table_primary */ + -1, /* (503) table_reference ::= joined_table */ + -2, /* (504) table_primary ::= table_name alias_opt */ + -4, /* (505) table_primary ::= db_name NK_DOT table_name alias_opt */ + -2, /* (506) table_primary ::= subquery alias_opt */ + -1, /* (507) table_primary ::= parenthesized_joined_table */ + 0, /* (508) alias_opt ::= */ + -1, /* (509) alias_opt ::= table_alias */ + -2, /* (510) alias_opt ::= AS table_alias */ + -3, /* (511) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + -3, /* (512) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + -6, /* (513) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 0, /* (514) join_type ::= */ + -1, /* (515) join_type ::= INNER */ + -12, /* (516) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 0, /* (517) set_quantifier_opt ::= */ + -1, /* (518) set_quantifier_opt ::= DISTINCT */ + -1, /* (519) set_quantifier_opt ::= ALL */ + -1, /* (520) select_list ::= select_item */ + -3, /* (521) select_list ::= select_list NK_COMMA select_item */ + -1, /* (522) select_item ::= NK_STAR */ + -1, /* (523) select_item ::= common_expression */ + -2, /* (524) select_item ::= common_expression column_alias */ + -3, /* (525) select_item ::= common_expression AS column_alias */ + -3, /* (526) select_item ::= table_name NK_DOT NK_STAR */ + 0, /* (527) where_clause_opt ::= */ + -2, /* (528) where_clause_opt ::= WHERE search_condition */ + 0, /* (529) partition_by_clause_opt ::= */ + -3, /* (530) partition_by_clause_opt ::= PARTITION BY partition_list */ + -1, /* (531) partition_list ::= partition_item */ + -3, /* (532) partition_list ::= partition_list NK_COMMA partition_item */ + -1, /* (533) partition_item ::= expr_or_subquery */ + -2, /* (534) partition_item ::= expr_or_subquery column_alias */ + -3, /* (535) partition_item ::= expr_or_subquery AS column_alias */ + 0, /* (536) twindow_clause_opt ::= */ + -6, /* (537) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + -4, /* (538) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + -6, /* (539) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (540) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + -7, /* (541) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 0, /* (542) sliding_opt ::= */ + -4, /* (543) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + 0, /* (544) fill_opt ::= */ + -4, /* (545) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (546) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (547) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (548) fill_mode ::= NONE */ + -1, /* (549) fill_mode ::= PREV */ + -1, /* (550) fill_mode ::= NULL */ + -1, /* (551) fill_mode ::= NULL_F */ + -1, /* (552) fill_mode ::= LINEAR */ + -1, /* (553) fill_mode ::= NEXT */ + 0, /* (554) group_by_clause_opt ::= */ + -3, /* (555) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (556) group_by_list ::= expr_or_subquery */ + -3, /* (557) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (558) having_clause_opt ::= */ + -2, /* (559) having_clause_opt ::= HAVING search_condition */ + 0, /* (560) range_opt ::= */ + -6, /* (561) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 0, /* (562) every_opt ::= */ + -4, /* (563) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (564) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (565) query_simple ::= query_specification */ + -1, /* (566) query_simple ::= union_query_expression */ + -4, /* (567) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (568) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (569) query_simple_or_subquery ::= query_simple */ + -1, /* (570) query_simple_or_subquery ::= subquery */ + -1, /* (571) query_or_subquery ::= query_expression */ + -1, /* (572) query_or_subquery ::= subquery */ + 0, /* (573) order_by_clause_opt ::= */ + -3, /* (574) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (575) slimit_clause_opt ::= */ + -2, /* (576) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (577) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (578) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (579) limit_clause_opt ::= */ + -2, /* (580) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (581) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (582) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (583) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (584) subquery ::= NK_LP subquery NK_RP */ + -1, /* (585) search_condition ::= common_expression */ + -1, /* (586) sort_specification_list ::= sort_specification */ + -3, /* (587) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (588) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (589) ordering_specification_opt ::= */ + -1, /* (590) ordering_specification_opt ::= ASC */ + -1, /* (591) ordering_specification_opt ::= DESC */ + 0, /* (592) null_ordering_opt ::= */ + -2, /* (593) null_ordering_opt ::= NULLS FIRST */ + -2, /* (594) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -4483,11 +4440,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,337,&yymsp[0].minor); + yy_destructor(yypParser,338,&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,338,&yymsp[0].minor); + yy_destructor(yypParser,339,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -4501,20 +4458,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,337,&yymsp[-2].minor); +{ yy_destructor(yypParser,338,&yymsp[-2].minor); { } - yy_destructor(yypParser,339,&yymsp[0].minor); + yy_destructor(yypParser,340,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,340,&yymsp[0].minor); +{ yy_destructor(yypParser,341,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,338,&yymsp[-1].minor); +{ yy_destructor(yypParser,339,&yymsp[-1].minor); { } - yy_destructor(yypParser,340,&yymsp[0].minor); + yy_destructor(yypParser,341,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -4528,113 +4485,113 @@ 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,339,&yymsp[0].minor); + yy_destructor(yypParser,340,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy833, &yymsp[-1].minor.yy0, yymsp[0].minor.yy575); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy669, &yymsp[-1].minor.yy0, yymsp[0].minor.yy73); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy833, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy669, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy833, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy669, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy833, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy669, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy833); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy669); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy575 = 1; } +{ yymsp[1].minor.yy73 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy575 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy73 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 31: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy85, &yymsp[-3].minor.yy489, &yymsp[0].minor.yy833, yymsp[-2].minor.yy520); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy349, &yymsp[-3].minor.yy257, &yymsp[0].minor.yy669, yymsp[-2].minor.yy242); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy85, &yymsp[-3].minor.yy489, &yymsp[0].minor.yy833, yymsp[-2].minor.yy520); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy349, &yymsp[-3].minor.yy257, &yymsp[0].minor.yy669, yymsp[-2].minor.yy242); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy85 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy349 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 36: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==36); -{ yylhsminor.yy85 = yymsp[0].minor.yy85; } - yymsp[0].minor.yy85 = yylhsminor.yy85; +{ yylhsminor.yy349 = yymsp[0].minor.yy349; } + yymsp[0].minor.yy349 = yylhsminor.yy349; break; case 35: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy85 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy349 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 37: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy85 = yymsp[-2].minor.yy85 | yymsp[0].minor.yy85; } - yymsp[-2].minor.yy85 = yylhsminor.yy85; +{ yylhsminor.yy349 = yymsp[-2].minor.yy349 | yymsp[0].minor.yy349; } + yymsp[-2].minor.yy349 = yylhsminor.yy349; break; case 38: /* priv_type ::= READ */ -{ yymsp[0].minor.yy85 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy349 = PRIVILEGE_TYPE_READ; } break; case 39: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy85 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy349 = PRIVILEGE_TYPE_WRITE; } break; case 40: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy489.first = yymsp[-2].minor.yy0; yylhsminor.yy489.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy489 = yylhsminor.yy489; +{ yylhsminor.yy257.first = yymsp[-2].minor.yy0; yylhsminor.yy257.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy257 = yylhsminor.yy257; break; case 41: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy489.first = yymsp[-2].minor.yy833; yylhsminor.yy489.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy489 = yylhsminor.yy489; +{ yylhsminor.yy257.first = yymsp[-2].minor.yy669; yylhsminor.yy257.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy257 = yylhsminor.yy257; break; case 42: /* priv_level ::= db_name NK_DOT table_name */ -{ yylhsminor.yy489.first = yymsp[-2].minor.yy833; yylhsminor.yy489.second = yymsp[0].minor.yy833; } - yymsp[-2].minor.yy489 = yylhsminor.yy489; +{ yylhsminor.yy257.first = yymsp[-2].minor.yy669; yylhsminor.yy257.second = yymsp[0].minor.yy669; } + yymsp[-2].minor.yy257 = yylhsminor.yy257; break; case 43: /* priv_level ::= topic_name */ -{ yylhsminor.yy489.first = yymsp[0].minor.yy833; yylhsminor.yy489.second = nil_token; } - yymsp[0].minor.yy489 = yylhsminor.yy489; +{ yylhsminor.yy257.first = yymsp[0].minor.yy669; yylhsminor.yy257.second = nil_token; } + yymsp[0].minor.yy257 = yylhsminor.yy257; break; case 44: /* with_opt ::= */ case 144: /* start_opt ::= */ yytestcase(yyruleno==144); case 148: /* end_opt ::= */ yytestcase(yyruleno==148); - case 272: /* like_pattern_opt ::= */ yytestcase(yyruleno==272); - case 349: /* subtable_opt ::= */ yytestcase(yyruleno==349); - case 467: /* case_when_else_opt ::= */ yytestcase(yyruleno==467); - case 497: /* from_clause_opt ::= */ yytestcase(yyruleno==497); - case 526: /* where_clause_opt ::= */ yytestcase(yyruleno==526); - case 535: /* twindow_clause_opt ::= */ yytestcase(yyruleno==535); - case 541: /* sliding_opt ::= */ yytestcase(yyruleno==541); - case 543: /* fill_opt ::= */ yytestcase(yyruleno==543); - case 557: /* having_clause_opt ::= */ yytestcase(yyruleno==557); - case 559: /* range_opt ::= */ yytestcase(yyruleno==559); - case 561: /* every_opt ::= */ yytestcase(yyruleno==561); - case 574: /* slimit_clause_opt ::= */ yytestcase(yyruleno==574); - case 578: /* limit_clause_opt ::= */ yytestcase(yyruleno==578); -{ yymsp[1].minor.yy520 = NULL; } + case 273: /* like_pattern_opt ::= */ yytestcase(yyruleno==273); + case 350: /* subtable_opt ::= */ yytestcase(yyruleno==350); + case 468: /* case_when_else_opt ::= */ yytestcase(yyruleno==468); + case 498: /* from_clause_opt ::= */ yytestcase(yyruleno==498); + case 527: /* where_clause_opt ::= */ yytestcase(yyruleno==527); + case 536: /* twindow_clause_opt ::= */ yytestcase(yyruleno==536); + case 542: /* sliding_opt ::= */ yytestcase(yyruleno==542); + case 544: /* fill_opt ::= */ yytestcase(yyruleno==544); + case 558: /* having_clause_opt ::= */ yytestcase(yyruleno==558); + case 560: /* range_opt ::= */ yytestcase(yyruleno==560); + case 562: /* every_opt ::= */ yytestcase(yyruleno==562); + case 575: /* slimit_clause_opt ::= */ yytestcase(yyruleno==575); + case 579: /* limit_clause_opt ::= */ yytestcase(yyruleno==579); +{ yymsp[1].minor.yy242 = NULL; } break; case 45: /* with_opt ::= WITH search_condition */ - case 498: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==498); - case 527: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==527); - case 558: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==558); -{ yymsp[-1].minor.yy520 = yymsp[0].minor.yy520; } + case 499: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==499); + case 528: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==528); + case 559: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==559); +{ yymsp[-1].minor.yy242 = yymsp[0].minor.yy242; } break; case 46: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy833, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy669, NULL); } break; case 47: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy833, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy669, &yymsp[0].minor.yy0); } break; case 48: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy537, false); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy777, false); } break; case 49: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy833, yymsp[0].minor.yy537, false); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy669, yymsp[0].minor.yy777, false); } break; case 50: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy537); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy777); } break; case 51: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy833, false, yymsp[0].minor.yy537); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy669, false, yymsp[0].minor.yy777); } break; case 52: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -4654,53 +4611,53 @@ static YYACTIONTYPE yy_reduce( case 57: /* dnode_endpoint ::= NK_STRING */ case 58: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==58); case 59: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==59); - case 296: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==296); - case 297: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==297); - case 298: /* sma_func_name ::= LAST */ yytestcase(yyruleno==298); - case 299: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==299); - case 393: /* db_name ::= NK_ID */ yytestcase(yyruleno==393); - case 394: /* table_name ::= NK_ID */ yytestcase(yyruleno==394); - case 395: /* column_name ::= NK_ID */ yytestcase(yyruleno==395); - case 396: /* function_name ::= NK_ID */ yytestcase(yyruleno==396); - case 397: /* table_alias ::= NK_ID */ yytestcase(yyruleno==397); - case 398: /* column_alias ::= NK_ID */ yytestcase(yyruleno==398); - case 399: /* user_name ::= NK_ID */ yytestcase(yyruleno==399); - case 400: /* topic_name ::= NK_ID */ yytestcase(yyruleno==400); - case 401: /* stream_name ::= NK_ID */ yytestcase(yyruleno==401); - case 402: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==402); - case 403: /* index_name ::= NK_ID */ yytestcase(yyruleno==403); - case 443: /* noarg_func ::= NOW */ yytestcase(yyruleno==443); - case 444: /* noarg_func ::= TODAY */ yytestcase(yyruleno==444); - case 445: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==445); - case 446: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==446); - case 447: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==447); - case 448: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==448); - case 449: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==449); - case 450: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==450); - case 451: /* noarg_func ::= USER */ yytestcase(yyruleno==451); - case 452: /* star_func ::= COUNT */ yytestcase(yyruleno==452); - case 453: /* star_func ::= FIRST */ yytestcase(yyruleno==453); - case 454: /* star_func ::= LAST */ yytestcase(yyruleno==454); - case 455: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==455); -{ yylhsminor.yy833 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy833 = yylhsminor.yy833; + case 297: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==297); + case 298: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==298); + case 299: /* sma_func_name ::= LAST */ yytestcase(yyruleno==299); + case 300: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==300); + case 394: /* db_name ::= NK_ID */ yytestcase(yyruleno==394); + case 395: /* table_name ::= NK_ID */ yytestcase(yyruleno==395); + case 396: /* column_name ::= NK_ID */ yytestcase(yyruleno==396); + case 397: /* function_name ::= NK_ID */ yytestcase(yyruleno==397); + case 398: /* table_alias ::= NK_ID */ yytestcase(yyruleno==398); + case 399: /* column_alias ::= NK_ID */ yytestcase(yyruleno==399); + case 400: /* user_name ::= NK_ID */ yytestcase(yyruleno==400); + case 401: /* topic_name ::= NK_ID */ yytestcase(yyruleno==401); + case 402: /* stream_name ::= NK_ID */ yytestcase(yyruleno==402); + case 403: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==403); + case 404: /* index_name ::= NK_ID */ yytestcase(yyruleno==404); + case 444: /* noarg_func ::= NOW */ yytestcase(yyruleno==444); + case 445: /* noarg_func ::= TODAY */ yytestcase(yyruleno==445); + case 446: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==446); + case 447: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==447); + case 448: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==448); + case 449: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==449); + case 450: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==450); + case 451: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==451); + case 452: /* noarg_func ::= USER */ yytestcase(yyruleno==452); + case 453: /* star_func ::= COUNT */ yytestcase(yyruleno==453); + case 454: /* star_func ::= FIRST */ yytestcase(yyruleno==454); + case 455: /* star_func ::= LAST */ yytestcase(yyruleno==455); + case 456: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==456); +{ yylhsminor.yy669 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy669 = yylhsminor.yy669; break; case 60: /* force_opt ::= */ case 84: /* not_exists_opt ::= */ yytestcase(yyruleno==84); case 86: /* exists_opt ::= */ yytestcase(yyruleno==86); - case 316: /* analyze_opt ::= */ yytestcase(yyruleno==316); - case 323: /* agg_func_opt ::= */ yytestcase(yyruleno==323); - case 329: /* or_replace_opt ::= */ yytestcase(yyruleno==329); - case 351: /* ignore_opt ::= */ yytestcase(yyruleno==351); - case 516: /* set_quantifier_opt ::= */ yytestcase(yyruleno==516); -{ yymsp[1].minor.yy537 = false; } + case 317: /* analyze_opt ::= */ yytestcase(yyruleno==317); + case 324: /* agg_func_opt ::= */ yytestcase(yyruleno==324); + case 330: /* or_replace_opt ::= */ yytestcase(yyruleno==330); + case 352: /* ignore_opt ::= */ yytestcase(yyruleno==352); + case 517: /* set_quantifier_opt ::= */ yytestcase(yyruleno==517); +{ yymsp[1].minor.yy777 = false; } break; case 61: /* force_opt ::= FORCE */ case 62: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==62); - case 317: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==317); - case 324: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==324); - case 517: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==517); -{ yymsp[0].minor.yy537 = true; } + case 318: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==318); + case 325: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==325); + case 518: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==518); +{ yymsp[0].minor.yy777 = true; } break; case 63: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -4742,1413 +4699,1416 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } break; case 76: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy537, &yymsp[-1].minor.yy833, yymsp[0].minor.yy520); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy777, &yymsp[-1].minor.yy669, yymsp[0].minor.yy242); } break; case 77: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy537, &yymsp[0].minor.yy833); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy777, &yymsp[0].minor.yy669); } break; case 78: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy833); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy669); } break; case 79: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy833, yymsp[0].minor.yy520); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy669, yymsp[0].minor.yy242); } break; case 80: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy833); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy669); } break; case 81: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy833, yymsp[0].minor.yy860); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy669, yymsp[0].minor.yy120); } break; case 82: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy833, yymsp[-1].minor.yy520, yymsp[0].minor.yy520); } +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy669, yymsp[-1].minor.yy242, yymsp[0].minor.yy242); } break; case 83: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy537 = true; } +{ yymsp[-2].minor.yy777 = true; } break; case 85: /* exists_opt ::= IF EXISTS */ - case 330: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==330); - case 352: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==352); -{ yymsp[-1].minor.yy537 = true; } + case 331: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==331); + case 353: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==353); +{ yymsp[-1].minor.yy777 = true; } break; case 87: /* db_options ::= */ -{ yymsp[1].minor.yy520 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy242 = createDefaultDatabaseOptions(pCxt); } break; case 88: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 89: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 90: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 91: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 92: /* db_options ::= db_options DURATION NK_INTEGER */ case 93: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==93); -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 94: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 95: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 96: /* db_options ::= db_options KEEP integer_list */ case 97: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==97); -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_KEEP, yymsp[0].minor.yy904); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_KEEP, yymsp[0].minor.yy174); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 98: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 99: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 100: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 101: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 102: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 103: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 104: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 105: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_RETENTIONS, yymsp[0].minor.yy904); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_RETENTIONS, yymsp[0].minor.yy174); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 106: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 107: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 108: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 109: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 110: /* db_options ::= db_options WAL_RETENTION_PERIOD 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.yy520 = setDatabaseOption(pCxt, yymsp[-3].minor.yy520, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-3].minor.yy242, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; case 111: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 112: /* db_options ::= db_options WAL_RETENTION_SIZE 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.yy520 = setDatabaseOption(pCxt, yymsp[-3].minor.yy520, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-3].minor.yy242, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; case 113: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 114: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 115: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 116: /* db_options ::= db_options TABLE_PREFIX signed */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy520); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy242); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 117: /* db_options ::= db_options TABLE_SUFFIX signed */ -{ yylhsminor.yy520 = setDatabaseOption(pCxt, yymsp[-2].minor.yy520, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy520); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setDatabaseOption(pCxt, yymsp[-2].minor.yy242, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy242); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 118: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy520 = createAlterDatabaseOptions(pCxt); yylhsminor.yy520 = setAlterDatabaseOption(pCxt, yylhsminor.yy520, &yymsp[0].minor.yy805); } - yymsp[0].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createAlterDatabaseOptions(pCxt); yylhsminor.yy242 = setAlterDatabaseOption(pCxt, yylhsminor.yy242, &yymsp[0].minor.yy535); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; case 119: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy520 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy520, &yymsp[0].minor.yy805); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy242, &yymsp[0].minor.yy535); } + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; case 120: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy805.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy535.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; case 121: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy805.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy535.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; case 122: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy805.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy535.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; case 123: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy805.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy535.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; case 124: /* alter_db_option ::= KEEP integer_list */ case 125: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==125); -{ yymsp[-1].minor.yy805.type = DB_OPTION_KEEP; yymsp[-1].minor.yy805.pList = yymsp[0].minor.yy904; } +{ yymsp[-1].minor.yy535.type = DB_OPTION_KEEP; yymsp[-1].minor.yy535.pList = yymsp[0].minor.yy174; } break; case 126: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy805.type = DB_OPTION_PAGES; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy535.type = DB_OPTION_PAGES; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; case 127: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy805.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy535.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; case 128: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy805.type = DB_OPTION_WAL; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy535.type = DB_OPTION_WAL; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; case 129: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy805.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy535.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; case 130: /* alter_db_option ::= MINROWS NK_INTEGER */ -{ yymsp[-1].minor.yy805.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy535.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; case 131: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy805.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy535.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; case 132: /* alter_db_option ::= WAL_RETENTION_PERIOD 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; - yymsp[-2].minor.yy805.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy805.val = t; + yymsp[-2].minor.yy535.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy535.val = t; } break; case 133: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -{ yymsp[-1].minor.yy805.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy535.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; case 134: /* alter_db_option ::= WAL_RETENTION_SIZE 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; - yymsp[-2].minor.yy805.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy805.val = t; + yymsp[-2].minor.yy535.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy535.val = t; } break; case 135: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy904 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy904 = yylhsminor.yy904; +{ yylhsminor.yy174 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy174 = yylhsminor.yy174; break; case 136: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 362: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==362); -{ yylhsminor.yy904 = addNodeToList(pCxt, yymsp[-2].minor.yy904, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy904 = yylhsminor.yy904; + case 363: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==363); +{ yylhsminor.yy174 = addNodeToList(pCxt, yymsp[-2].minor.yy174, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy174 = yylhsminor.yy174; break; case 137: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy904 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy904 = yylhsminor.yy904; +{ yylhsminor.yy174 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy174 = yylhsminor.yy174; break; case 138: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy904 = addNodeToList(pCxt, yymsp[-2].minor.yy904, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy904 = yylhsminor.yy904; +{ yylhsminor.yy174 = addNodeToList(pCxt, yymsp[-2].minor.yy174, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy174 = yylhsminor.yy174; break; case 139: /* retention_list ::= retention */ case 169: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==169); case 172: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==172); case 179: /* column_def_list ::= column_def */ yytestcase(yyruleno==179); - case 222: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==222); - case 227: /* col_name_list ::= col_name */ yytestcase(yyruleno==227); - case 278: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==278); - case 292: /* func_list ::= func */ yytestcase(yyruleno==292); - case 391: /* literal_list ::= signed_literal */ yytestcase(yyruleno==391); - case 458: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==458); - case 464: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==464); - case 519: /* select_list ::= select_item */ yytestcase(yyruleno==519); - case 530: /* partition_list ::= partition_item */ yytestcase(yyruleno==530); - case 585: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==585); -{ yylhsminor.yy904 = createNodeList(pCxt, yymsp[0].minor.yy520); } - yymsp[0].minor.yy904 = yylhsminor.yy904; + case 223: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==223); + case 228: /* col_name_list ::= col_name */ yytestcase(yyruleno==228); + case 279: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==279); + case 293: /* func_list ::= func */ yytestcase(yyruleno==293); + case 392: /* literal_list ::= signed_literal */ yytestcase(yyruleno==392); + case 459: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==459); + case 465: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==465); + case 520: /* select_list ::= select_item */ yytestcase(yyruleno==520); + case 531: /* partition_list ::= partition_item */ yytestcase(yyruleno==531); + case 586: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==586); +{ yylhsminor.yy174 = createNodeList(pCxt, yymsp[0].minor.yy242); } + yymsp[0].minor.yy174 = yylhsminor.yy174; break; case 140: /* retention_list ::= retention_list NK_COMMA retention */ case 173: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==173); case 180: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==180); - case 223: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==223); - case 228: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==228); - case 279: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==279); - case 293: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==293); - case 392: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==392); - case 459: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==459); - case 520: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==520); - case 531: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==531); - case 586: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==586); -{ yylhsminor.yy904 = addNodeToList(pCxt, yymsp[-2].minor.yy904, yymsp[0].minor.yy520); } - yymsp[-2].minor.yy904 = yylhsminor.yy904; + case 224: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==224); + case 229: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==229); + case 280: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==280); + case 294: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==294); + case 393: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==393); + case 460: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==460); + case 521: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==521); + case 532: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==532); + case 587: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==587); +{ yylhsminor.yy174 = addNodeToList(pCxt, yymsp[-2].minor.yy174, yymsp[0].minor.yy242); } + yymsp[-2].minor.yy174 = yylhsminor.yy174; break; case 141: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy520 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 142: /* speed_opt ::= */ - case 325: /* bufsize_opt ::= */ yytestcase(yyruleno==325); -{ yymsp[1].minor.yy860 = 0; } + case 326: /* bufsize_opt ::= */ yytestcase(yyruleno==326); +{ yymsp[1].minor.yy120 = 0; } break; case 143: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 326: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==326); -{ yymsp[-1].minor.yy860 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + case 327: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==327); +{ yymsp[-1].minor.yy120 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 145: /* start_opt ::= START WITH NK_INTEGER */ case 149: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==149); -{ yymsp[-2].minor.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } +{ yymsp[-2].minor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } break; case 146: /* start_opt ::= START WITH NK_STRING */ case 150: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==150); -{ yymsp[-2].minor.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-2].minor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 147: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ case 151: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==151); -{ yymsp[-3].minor.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-3].minor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 152: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 154: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==154); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy537, yymsp[-5].minor.yy520, yymsp[-3].minor.yy904, yymsp[-1].minor.yy904, yymsp[0].minor.yy520); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy777, yymsp[-5].minor.yy242, yymsp[-3].minor.yy174, yymsp[-1].minor.yy174, yymsp[0].minor.yy242); } break; case 153: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy904); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy174); } break; case 155: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy904); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy174); } break; case 156: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy537, yymsp[0].minor.yy520); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy777, yymsp[0].minor.yy242); } break; case 157: /* cmd ::= ALTER TABLE alter_table_clause */ - case 364: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==364); - case 365: /* cmd ::= insert_query */ yytestcase(yyruleno==365); -{ pCxt->pRootNode = yymsp[0].minor.yy520; } + case 365: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==365); + case 366: /* cmd ::= insert_query */ yytestcase(yyruleno==366); +{ pCxt->pRootNode = yymsp[0].minor.yy242; } break; case 158: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy520); } +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy242); } break; case 159: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy520 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy520, yymsp[0].minor.yy520); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy242, yymsp[0].minor.yy242); } + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; case 160: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy520 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy520, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy833, yymsp[0].minor.yy840); } - yymsp[-4].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy242, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy669, yymsp[0].minor.yy794); } + yymsp[-4].minor.yy242 = yylhsminor.yy242; break; case 161: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy520 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy520, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy833); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy242, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy669); } + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; case 162: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy520 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy520, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy833, yymsp[0].minor.yy840); } - yymsp[-4].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy242, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy669, yymsp[0].minor.yy794); } + yymsp[-4].minor.yy242 = yylhsminor.yy242; break; case 163: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy520 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy520, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy833, &yymsp[0].minor.yy833); } - yymsp[-4].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy242, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy669, &yymsp[0].minor.yy669); } + yymsp[-4].minor.yy242 = yylhsminor.yy242; break; case 164: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy520 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy520, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy833, yymsp[0].minor.yy840); } - yymsp[-4].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy242, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy669, yymsp[0].minor.yy794); } + yymsp[-4].minor.yy242 = yylhsminor.yy242; break; case 165: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy520 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy520, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy833); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy242, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy669); } + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; case 166: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy520 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy520, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy833, yymsp[0].minor.yy840); } - yymsp[-4].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy242, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy669, yymsp[0].minor.yy794); } + yymsp[-4].minor.yy242 = yylhsminor.yy242; break; case 167: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy520 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy520, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy833, &yymsp[0].minor.yy833); } - yymsp[-4].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy242, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy669, &yymsp[0].minor.yy669); } + yymsp[-4].minor.yy242 = yylhsminor.yy242; break; case 168: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy520 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy520, &yymsp[-2].minor.yy833, yymsp[0].minor.yy520); } - yymsp[-5].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy242, &yymsp[-2].minor.yy669, yymsp[0].minor.yy242); } + yymsp[-5].minor.yy242 = yylhsminor.yy242; break; case 170: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 465: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==465); -{ yylhsminor.yy904 = addNodeToList(pCxt, yymsp[-1].minor.yy904, yymsp[0].minor.yy520); } - yymsp[-1].minor.yy904 = yylhsminor.yy904; + case 466: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==466); +{ yylhsminor.yy174 = addNodeToList(pCxt, yymsp[-1].minor.yy174, yymsp[0].minor.yy242); } + yymsp[-1].minor.yy174 = yylhsminor.yy174; break; case 171: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ -{ yylhsminor.yy520 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy537, yymsp[-8].minor.yy520, yymsp[-6].minor.yy520, yymsp[-5].minor.yy904, yymsp[-2].minor.yy904, yymsp[0].minor.yy520); } - yymsp[-9].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy777, yymsp[-8].minor.yy242, yymsp[-6].minor.yy242, yymsp[-5].minor.yy174, yymsp[-2].minor.yy174, yymsp[0].minor.yy242); } + yymsp[-9].minor.yy242 = yylhsminor.yy242; break; case 174: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy520 = createDropTableClause(pCxt, yymsp[-1].minor.yy537, yymsp[0].minor.yy520); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createDropTableClause(pCxt, yymsp[-1].minor.yy777, yymsp[0].minor.yy242); } + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; case 175: /* specific_cols_opt ::= */ - case 205: /* tags_def_opt ::= */ yytestcase(yyruleno==205); - case 277: /* tag_list_opt ::= */ yytestcase(yyruleno==277); - case 335: /* col_list_opt ::= */ yytestcase(yyruleno==335); - case 337: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==337); - case 528: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==528); - case 553: /* group_by_clause_opt ::= */ yytestcase(yyruleno==553); - case 572: /* order_by_clause_opt ::= */ yytestcase(yyruleno==572); -{ yymsp[1].minor.yy904 = NULL; } + case 206: /* tags_def_opt ::= */ yytestcase(yyruleno==206); + case 278: /* tag_list_opt ::= */ yytestcase(yyruleno==278); + case 336: /* col_list_opt ::= */ yytestcase(yyruleno==336); + case 338: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==338); + case 529: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==529); + case 554: /* group_by_clause_opt ::= */ yytestcase(yyruleno==554); + case 573: /* order_by_clause_opt ::= */ yytestcase(yyruleno==573); +{ yymsp[1].minor.yy174 = NULL; } break; case 176: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ - case 336: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==336); -{ yymsp[-2].minor.yy904 = yymsp[-1].minor.yy904; } + case 337: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==337); +{ yymsp[-2].minor.yy174 = yymsp[-1].minor.yy174; } break; case 177: /* full_table_name ::= table_name */ -{ yylhsminor.yy520 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy833, NULL); } - yymsp[0].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy669, NULL); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; case 178: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy520 = createRealTableNode(pCxt, &yymsp[-2].minor.yy833, &yymsp[0].minor.yy833, NULL); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createRealTableNode(pCxt, &yymsp[-2].minor.yy669, &yymsp[0].minor.yy669, NULL); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; case 181: /* column_def ::= column_name type_name */ -{ yylhsminor.yy520 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy833, yymsp[0].minor.yy840, NULL); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; +{ yylhsminor.yy242 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy669, yymsp[0].minor.yy794, NULL); } + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; case 182: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy840 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 183: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy840 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 184: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy840 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 185: /* type_name ::= INT */ case 186: /* type_name ::= INTEGER */ yytestcase(yyruleno==186); -{ yymsp[0].minor.yy840 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_INT); } break; case 187: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy840 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 188: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy840 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 189: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy840 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 190: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy840 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy794 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 191: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy840 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 192: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy840 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy794 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 193: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy840 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy794 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 194: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy840 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy794 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 195: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy840 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy794 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 196: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy840 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy794 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 197: /* type_name ::= JSON */ -{ yymsp[0].minor.yy840 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 198: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy840 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy794 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 199: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy840 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 200: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy840 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 201: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy840 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy794 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 202: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy840 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 202: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy794 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } break; - case 203: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy840 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 203: /* type_name ::= DECIMAL */ +{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 204: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy840 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 204: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy794 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 206: /* tags_def_opt ::= tags_def */ - case 338: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==338); - case 457: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==457); -{ yylhsminor.yy904 = yymsp[0].minor.yy904; } - yymsp[0].minor.yy904 = yylhsminor.yy904; + case 205: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy794 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 207: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ - case 339: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==339); -{ yymsp[-3].minor.yy904 = yymsp[-1].minor.yy904; } + case 207: /* tags_def_opt ::= tags_def */ + case 339: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==339); + case 458: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==458); +{ yylhsminor.yy174 = yymsp[0].minor.yy174; } + yymsp[0].minor.yy174 = yylhsminor.yy174; break; - case 208: /* table_options ::= */ -{ yymsp[1].minor.yy520 = createDefaultTableOptions(pCxt); } + case 208: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ + case 340: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==340); +{ yymsp[-3].minor.yy174 = yymsp[-1].minor.yy174; } break; - case 209: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy520 = setTableOption(pCxt, yymsp[-2].minor.yy520, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 209: /* table_options ::= */ +{ yymsp[1].minor.yy242 = createDefaultTableOptions(pCxt); } break; - case 210: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy520 = setTableOption(pCxt, yymsp[-2].minor.yy520, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy904); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 210: /* table_options ::= table_options COMMENT NK_STRING */ +{ yylhsminor.yy242 = setTableOption(pCxt, yymsp[-2].minor.yy242, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 211: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy520 = setTableOption(pCxt, yymsp[-2].minor.yy520, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy904); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 211: /* table_options ::= table_options MAX_DELAY duration_list */ +{ yylhsminor.yy242 = setTableOption(pCxt, yymsp[-2].minor.yy242, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy174); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 212: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy520 = setTableOption(pCxt, yymsp[-4].minor.yy520, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy904); } - yymsp[-4].minor.yy520 = yylhsminor.yy520; + case 212: /* table_options ::= table_options WATERMARK duration_list */ +{ yylhsminor.yy242 = setTableOption(pCxt, yymsp[-2].minor.yy242, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy174); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 213: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy520 = setTableOption(pCxt, yymsp[-2].minor.yy520, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 213: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ +{ yylhsminor.yy242 = setTableOption(pCxt, yymsp[-4].minor.yy242, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy174); } + yymsp[-4].minor.yy242 = yylhsminor.yy242; break; - case 214: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy520 = setTableOption(pCxt, yymsp[-4].minor.yy520, TABLE_OPTION_SMA, yymsp[-1].minor.yy904); } - yymsp[-4].minor.yy520 = yylhsminor.yy520; + case 214: /* table_options ::= table_options TTL NK_INTEGER */ +{ yylhsminor.yy242 = setTableOption(pCxt, yymsp[-2].minor.yy242, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 215: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy520 = setTableOption(pCxt, yymsp[-2].minor.yy520, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy904); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 215: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ +{ yylhsminor.yy242 = setTableOption(pCxt, yymsp[-4].minor.yy242, TABLE_OPTION_SMA, yymsp[-1].minor.yy174); } + yymsp[-4].minor.yy242 = yylhsminor.yy242; break; - case 216: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy520 = createAlterTableOptions(pCxt); yylhsminor.yy520 = setTableOption(pCxt, yylhsminor.yy520, yymsp[0].minor.yy805.type, &yymsp[0].minor.yy805.val); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 216: /* table_options ::= table_options DELETE_MARK duration_list */ +{ yylhsminor.yy242 = setTableOption(pCxt, yymsp[-2].minor.yy242, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy174); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 217: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy520 = setTableOption(pCxt, yymsp[-1].minor.yy520, yymsp[0].minor.yy805.type, &yymsp[0].minor.yy805.val); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; + case 217: /* alter_table_options ::= alter_table_option */ +{ yylhsminor.yy242 = createAlterTableOptions(pCxt); yylhsminor.yy242 = setTableOption(pCxt, yylhsminor.yy242, yymsp[0].minor.yy535.type, &yymsp[0].minor.yy535.val); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 218: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy805.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } + case 218: /* alter_table_options ::= alter_table_options alter_table_option */ +{ yylhsminor.yy242 = setTableOption(pCxt, yymsp[-1].minor.yy242, yymsp[0].minor.yy535.type, &yymsp[0].minor.yy535.val); } + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; - case 219: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy805.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy805.val = yymsp[0].minor.yy0; } + case 219: /* alter_table_option ::= COMMENT NK_STRING */ +{ yymsp[-1].minor.yy535.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; - case 220: /* duration_list ::= duration_literal */ - case 421: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==421); -{ yylhsminor.yy904 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy520)); } - yymsp[0].minor.yy904 = yylhsminor.yy904; + case 220: /* alter_table_option ::= TTL NK_INTEGER */ +{ yymsp[-1].minor.yy535.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy535.val = yymsp[0].minor.yy0; } break; - case 221: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 422: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==422); -{ yylhsminor.yy904 = addNodeToList(pCxt, yymsp[-2].minor.yy904, releaseRawExprNode(pCxt, yymsp[0].minor.yy520)); } - yymsp[-2].minor.yy904 = yylhsminor.yy904; + case 221: /* duration_list ::= duration_literal */ + case 422: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==422); +{ yylhsminor.yy174 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy242)); } + yymsp[0].minor.yy174 = yylhsminor.yy174; break; - case 224: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy520 = createFunctionNode(pCxt, &yymsp[0].minor.yy833, NULL); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 222: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 423: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==423); +{ yylhsminor.yy174 = addNodeToList(pCxt, yymsp[-2].minor.yy174, releaseRawExprNode(pCxt, yymsp[0].minor.yy242)); } + yymsp[-2].minor.yy174 = yylhsminor.yy174; break; - case 225: /* rollup_func_name ::= FIRST */ - case 226: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==226); - case 281: /* tag_item ::= QTAGS */ yytestcase(yyruleno==281); -{ yylhsminor.yy520 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 225: /* rollup_func_name ::= function_name */ +{ yylhsminor.yy242 = createFunctionNode(pCxt, &yymsp[0].minor.yy669, NULL); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 229: /* col_name ::= column_name */ - case 282: /* tag_item ::= column_name */ yytestcase(yyruleno==282); -{ yylhsminor.yy520 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy833); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 226: /* rollup_func_name ::= FIRST */ + case 227: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==227); + case 282: /* tag_item ::= QTAGS */ yytestcase(yyruleno==282); +{ yylhsminor.yy242 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 230: /* cmd ::= SHOW DNODES */ + case 230: /* col_name ::= column_name */ + case 283: /* tag_item ::= column_name */ yytestcase(yyruleno==283); +{ yylhsminor.yy242 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy669); } + yymsp[0].minor.yy242 = yylhsminor.yy242; + break; + case 231: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 231: /* cmd ::= SHOW USERS */ + case 232: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 232: /* cmd ::= SHOW USER PRIVILEGES */ + case 233: /* cmd ::= SHOW USER PRIVILEGES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } break; - case 233: /* cmd ::= SHOW DATABASES */ + case 234: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; - case 234: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy520, yymsp[0].minor.yy520, OP_TYPE_LIKE); } + case 235: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, OP_TYPE_LIKE); } break; - case 235: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy520, yymsp[0].minor.yy520, OP_TYPE_LIKE); } + case 236: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, OP_TYPE_LIKE); } break; - case 236: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy520, NULL, OP_TYPE_LIKE); } + case 237: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy242, NULL, OP_TYPE_LIKE); } break; - case 237: /* cmd ::= SHOW MNODES */ + case 238: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 238: /* cmd ::= SHOW QNODES */ + case 239: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 239: /* cmd ::= SHOW FUNCTIONS */ + case 240: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 240: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy520, yymsp[-1].minor.yy520, OP_TYPE_EQUAL); } + case 241: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy242, yymsp[-1].minor.yy242, OP_TYPE_EQUAL); } break; - case 241: /* cmd ::= SHOW STREAMS */ + case 242: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 242: /* cmd ::= SHOW ACCOUNTS */ + case 243: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 243: /* cmd ::= SHOW APPS */ + case 244: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 244: /* cmd ::= SHOW CONNECTIONS */ + case 245: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 245: /* cmd ::= SHOW LICENCES */ - case 246: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==246); + case 246: /* cmd ::= SHOW LICENCES */ + case 247: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==247); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 247: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy833); } + case 248: /* cmd ::= SHOW CREATE DATABASE db_name */ +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy669); } break; - case 248: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy520); } + case 249: /* cmd ::= SHOW CREATE TABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy242); } break; - case 249: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy520); } + case 250: /* cmd ::= SHOW CREATE STABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy242); } break; - case 250: /* cmd ::= SHOW QUERIES */ + case 251: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 251: /* cmd ::= SHOW SCORES */ + case 252: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 252: /* cmd ::= SHOW TOPICS */ + case 253: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 253: /* cmd ::= SHOW VARIABLES */ - case 254: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==254); + case 254: /* cmd ::= SHOW VARIABLES */ + case 255: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==255); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 255: /* cmd ::= SHOW LOCAL VARIABLES */ + case 256: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 256: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy520); } + case 257: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy242); } break; - case 257: /* cmd ::= SHOW BNODES */ + case 258: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 258: /* cmd ::= SHOW SNODES */ + case 259: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 259: /* cmd ::= SHOW CLUSTER */ + case 260: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 260: /* cmd ::= SHOW TRANSACTIONS */ + case 261: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 261: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy520); } + case 262: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy242); } break; - case 262: /* cmd ::= SHOW CONSUMERS */ + case 263: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 263: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 264: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 264: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy520, yymsp[-1].minor.yy520, OP_TYPE_EQUAL); } + case 265: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy242, yymsp[-1].minor.yy242, OP_TYPE_EQUAL); } break; - case 265: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy520, yymsp[0].minor.yy520, yymsp[-3].minor.yy904); } + case 266: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy242, yymsp[0].minor.yy242, yymsp[-3].minor.yy174); } break; - case 266: /* cmd ::= SHOW VNODES NK_INTEGER */ + case 267: /* cmd ::= SHOW VNODES NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 267: /* cmd ::= SHOW VNODES NK_STRING */ + case 268: /* cmd ::= SHOW VNODES NK_STRING */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); } break; - case 268: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy520, QUERY_NODE_SHOW_DB_ALIVE_STMT); } + case 269: /* cmd ::= SHOW db_name_cond_opt ALIVE */ +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy242, QUERY_NODE_SHOW_DB_ALIVE_STMT); } break; - case 269: /* cmd ::= SHOW CLUSTER ALIVE */ + case 270: /* cmd ::= SHOW CLUSTER ALIVE */ { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } break; - case 270: /* db_name_cond_opt ::= */ - case 275: /* from_db_opt ::= */ yytestcase(yyruleno==275); -{ yymsp[1].minor.yy520 = createDefaultDatabaseCondValue(pCxt); } + case 271: /* db_name_cond_opt ::= */ + case 276: /* from_db_opt ::= */ yytestcase(yyruleno==276); +{ yymsp[1].minor.yy242 = createDefaultDatabaseCondValue(pCxt); } break; - case 271: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy520 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy833); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; + case 272: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy242 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy669); } + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; - case 273: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 274: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 274: /* table_name_cond ::= table_name */ -{ yylhsminor.yy520 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy833); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 275: /* table_name_cond ::= table_name */ +{ yylhsminor.yy242 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy669); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 276: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy520 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy833); } + case 277: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy242 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy669); } break; - case 280: /* tag_item ::= TBNAME */ -{ yylhsminor.yy520 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 281: /* tag_item ::= TBNAME */ +{ yylhsminor.yy242 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 283: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy520 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy833), &yymsp[0].minor.yy833); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; + case 284: /* tag_item ::= column_name column_alias */ +{ yylhsminor.yy242 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy669), &yymsp[0].minor.yy669); } + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; - case 284: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy520 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy833), &yymsp[0].minor.yy833); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 285: /* tag_item ::= column_name AS column_alias */ +{ yylhsminor.yy242 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy669), &yymsp[0].minor.yy669); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 285: /* cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy537, yymsp[-3].minor.yy520, yymsp[-1].minor.yy520, NULL, yymsp[0].minor.yy520); } + case 286: /* cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy777, yymsp[-3].minor.yy242, yymsp[-1].minor.yy242, NULL, yymsp[0].minor.yy242); } break; - case 286: /* cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy537, yymsp[-5].minor.yy520, yymsp[-3].minor.yy520, yymsp[-1].minor.yy904, NULL); } + case 287: /* cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy777, yymsp[-5].minor.yy242, yymsp[-3].minor.yy242, yymsp[-1].minor.yy174, NULL); } break; - case 287: /* cmd ::= DROP INDEX exists_opt full_index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy537, yymsp[0].minor.yy520); } + case 288: /* cmd ::= DROP INDEX exists_opt full_index_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy777, yymsp[0].minor.yy242); } break; - case 288: /* full_index_name ::= index_name */ -{ yylhsminor.yy520 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy833); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 289: /* full_index_name ::= index_name */ +{ yylhsminor.yy242 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy669); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 289: /* full_index_name ::= db_name NK_DOT index_name */ -{ yylhsminor.yy520 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy833, &yymsp[0].minor.yy833); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 290: /* full_index_name ::= db_name NK_DOT index_name */ +{ yylhsminor.yy242 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy669, &yymsp[0].minor.yy669); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 290: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy520 = createIndexOption(pCxt, yymsp[-7].minor.yy904, releaseRawExprNode(pCxt, yymsp[-3].minor.yy520), NULL, yymsp[-1].minor.yy520, yymsp[0].minor.yy520); } + case 291: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-9].minor.yy242 = createIndexOption(pCxt, yymsp[-7].minor.yy174, releaseRawExprNode(pCxt, yymsp[-3].minor.yy242), NULL, yymsp[-1].minor.yy242, yymsp[0].minor.yy242); } break; - case 291: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-11].minor.yy520 = createIndexOption(pCxt, yymsp[-9].minor.yy904, releaseRawExprNode(pCxt, yymsp[-5].minor.yy520), releaseRawExprNode(pCxt, yymsp[-3].minor.yy520), yymsp[-1].minor.yy520, yymsp[0].minor.yy520); } + case 292: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-11].minor.yy242 = createIndexOption(pCxt, yymsp[-9].minor.yy174, releaseRawExprNode(pCxt, yymsp[-5].minor.yy242), releaseRawExprNode(pCxt, yymsp[-3].minor.yy242), yymsp[-1].minor.yy242, yymsp[0].minor.yy242); } break; - case 294: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy520 = createFunctionNode(pCxt, &yymsp[-3].minor.yy833, yymsp[-1].minor.yy904); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; + case 295: /* func ::= sma_func_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy242 = createFunctionNode(pCxt, &yymsp[-3].minor.yy669, yymsp[-1].minor.yy174); } + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; - case 295: /* sma_func_name ::= function_name */ - case 508: /* alias_opt ::= table_alias */ yytestcase(yyruleno==508); -{ yylhsminor.yy833 = yymsp[0].minor.yy833; } - yymsp[0].minor.yy833 = yylhsminor.yy833; + case 296: /* sma_func_name ::= function_name */ + case 509: /* alias_opt ::= table_alias */ yytestcase(yyruleno==509); +{ yylhsminor.yy669 = yymsp[0].minor.yy669; } + yymsp[0].minor.yy669 = yylhsminor.yy669; break; - case 300: /* sma_stream_opt ::= */ - case 340: /* stream_options ::= */ yytestcase(yyruleno==340); -{ yymsp[1].minor.yy520 = createStreamOptions(pCxt); } + case 301: /* sma_stream_opt ::= */ + case 341: /* stream_options ::= */ yytestcase(yyruleno==341); +{ yymsp[1].minor.yy242 = createStreamOptions(pCxt); } break; - case 301: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy520)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy520); yylhsminor.yy520 = yymsp[-2].minor.yy520; } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 302: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy242)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy242); yylhsminor.yy242 = yymsp[-2].minor.yy242; } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 302: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy520)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy520); yylhsminor.yy520 = yymsp[-2].minor.yy520; } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 303: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy242)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy242); yylhsminor.yy242 = yymsp[-2].minor.yy242; } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 303: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy520)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy520); yylhsminor.yy520 = yymsp[-2].minor.yy520; } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 304: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy242)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy242); yylhsminor.yy242 = yymsp[-2].minor.yy242; } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 304: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy537, &yymsp[-2].minor.yy833, yymsp[0].minor.yy520); } + case 305: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy777, &yymsp[-2].minor.yy669, yymsp[0].minor.yy242); } break; - case 305: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy537, &yymsp[-3].minor.yy833, &yymsp[0].minor.yy833, false); } + case 306: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy777, &yymsp[-3].minor.yy669, &yymsp[0].minor.yy669, false); } break; - case 306: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy537, &yymsp[-5].minor.yy833, &yymsp[0].minor.yy833, true); } + case 307: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy777, &yymsp[-5].minor.yy669, &yymsp[0].minor.yy669, true); } break; - case 307: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy537, &yymsp[-3].minor.yy833, yymsp[0].minor.yy520, false); } + case 308: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy777, &yymsp[-3].minor.yy669, yymsp[0].minor.yy242, false); } break; - case 308: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy537, &yymsp[-5].minor.yy833, yymsp[0].minor.yy520, true); } + case 309: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy777, &yymsp[-5].minor.yy669, yymsp[0].minor.yy242, true); } break; - case 309: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy537, &yymsp[0].minor.yy833); } + case 310: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy777, &yymsp[0].minor.yy669); } break; - case 310: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy537, &yymsp[-2].minor.yy833, &yymsp[0].minor.yy833); } + case 311: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy777, &yymsp[-2].minor.yy669, &yymsp[0].minor.yy669); } break; - case 311: /* cmd ::= DESC full_table_name */ - case 312: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==312); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy520); } + case 312: /* cmd ::= DESC full_table_name */ + case 313: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==313); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy242); } break; - case 313: /* cmd ::= RESET QUERY CACHE */ + case 314: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 314: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - case 315: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==315); -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy537, yymsp[-1].minor.yy520, yymsp[0].minor.yy520); } + case 315: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 316: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==316); +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy777, yymsp[-1].minor.yy242, yymsp[0].minor.yy242); } break; - case 318: /* explain_options ::= */ -{ yymsp[1].minor.yy520 = createDefaultExplainOptions(pCxt); } + case 319: /* explain_options ::= */ +{ yymsp[1].minor.yy242 = createDefaultExplainOptions(pCxt); } break; - case 319: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy520 = setExplainVerbose(pCxt, yymsp[-2].minor.yy520, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 320: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy242 = setExplainVerbose(pCxt, yymsp[-2].minor.yy242, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 320: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy520 = setExplainRatio(pCxt, yymsp[-2].minor.yy520, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 321: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy242 = setExplainRatio(pCxt, yymsp[-2].minor.yy242, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 321: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy537, yymsp[-9].minor.yy537, &yymsp[-6].minor.yy833, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy840, yymsp[-1].minor.yy860, &yymsp[0].minor.yy833, yymsp[-10].minor.yy537); } + case 322: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy777, yymsp[-9].minor.yy777, &yymsp[-6].minor.yy669, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy794, yymsp[-1].minor.yy120, &yymsp[0].minor.yy669, yymsp[-10].minor.yy777); } break; - case 322: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy537, &yymsp[0].minor.yy833); } + case 323: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy777, &yymsp[0].minor.yy669); } break; - case 327: /* language_opt ::= */ -{ yymsp[1].minor.yy833 = nil_token; } + case 328: /* language_opt ::= */ +{ yymsp[1].minor.yy669 = nil_token; } break; - case 328: /* language_opt ::= LANGUAGE NK_STRING */ -{ yymsp[-1].minor.yy833 = yymsp[0].minor.yy0; } + case 329: /* language_opt ::= LANGUAGE NK_STRING */ +{ yymsp[-1].minor.yy669 = yymsp[0].minor.yy0; } break; - case 331: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy537, &yymsp[-8].minor.yy833, yymsp[-5].minor.yy520, yymsp[-7].minor.yy520, yymsp[-3].minor.yy904, yymsp[-2].minor.yy520, yymsp[0].minor.yy520, yymsp[-4].minor.yy904); } + case 332: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy777, &yymsp[-8].minor.yy669, yymsp[-5].minor.yy242, yymsp[-7].minor.yy242, yymsp[-3].minor.yy174, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, yymsp[-4].minor.yy174); } break; - case 332: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy537, &yymsp[0].minor.yy833); } + case 333: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy777, &yymsp[0].minor.yy669); } break; - case 333: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy537, &yymsp[0].minor.yy833); } + case 334: /* cmd ::= PAUSE STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy777, &yymsp[0].minor.yy669); } break; - case 334: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy537, yymsp[-1].minor.yy537, &yymsp[0].minor.yy833); } + case 335: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ +{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy777, yymsp[-1].minor.yy777, &yymsp[0].minor.yy669); } break; - case 341: /* stream_options ::= stream_options TRIGGER AT_ONCE */ - case 342: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==342); -{ yylhsminor.yy520 = setStreamOptions(pCxt, yymsp[-2].minor.yy520, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 342: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 343: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==343); +{ yylhsminor.yy242 = setStreamOptions(pCxt, yymsp[-2].minor.yy242, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 343: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ yylhsminor.yy520 = setStreamOptions(pCxt, yymsp[-3].minor.yy520, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy520)); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; + case 344: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ yylhsminor.yy242 = setStreamOptions(pCxt, yymsp[-3].minor.yy242, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy242)); } + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; - case 344: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ yylhsminor.yy520 = setStreamOptions(pCxt, yymsp[-2].minor.yy520, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy520)); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 345: /* stream_options ::= stream_options WATERMARK duration_literal */ +{ yylhsminor.yy242 = setStreamOptions(pCxt, yymsp[-2].minor.yy242, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy242)); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 345: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ yylhsminor.yy520 = setStreamOptions(pCxt, yymsp[-3].minor.yy520, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; + case 346: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ yylhsminor.yy242 = setStreamOptions(pCxt, yymsp[-3].minor.yy242, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; - case 346: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ yylhsminor.yy520 = setStreamOptions(pCxt, yymsp[-2].minor.yy520, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 347: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +{ yylhsminor.yy242 = setStreamOptions(pCxt, yymsp[-2].minor.yy242, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 347: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -{ yylhsminor.yy520 = setStreamOptions(pCxt, yymsp[-2].minor.yy520, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy520)); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 348: /* stream_options ::= stream_options DELETE_MARK duration_literal */ +{ yylhsminor.yy242 = setStreamOptions(pCxt, yymsp[-2].minor.yy242, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy242)); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 348: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -{ yylhsminor.yy520 = setStreamOptions(pCxt, yymsp[-3].minor.yy520, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; + case 349: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ +{ yylhsminor.yy242 = setStreamOptions(pCxt, yymsp[-3].minor.yy242, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; - case 350: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 542: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==542); - case 562: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==562); -{ yymsp[-3].minor.yy520 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy520); } + case 351: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 543: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==543); + case 563: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==563); +{ yymsp[-3].minor.yy242 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy242); } break; - case 353: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 354: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 354: /* cmd ::= KILL QUERY NK_STRING */ + case 355: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 355: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 356: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 356: /* cmd ::= BALANCE VGROUP */ + case 357: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 357: /* cmd ::= BALANCE VGROUP LEADER */ + case 358: /* cmd ::= BALANCE VGROUP LEADER */ { pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt); } break; - case 358: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 359: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 359: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy904); } + case 360: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy174); } break; - case 360: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 361: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 361: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy904 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 362: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy174 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 363: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy520, yymsp[0].minor.yy520); } + case 364: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy242, yymsp[0].minor.yy242); } break; - case 366: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ yymsp[-6].minor.yy520 = createInsertStmt(pCxt, yymsp[-4].minor.yy520, yymsp[-2].minor.yy904, yymsp[0].minor.yy520); } + case 367: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ yymsp[-6].minor.yy242 = createInsertStmt(pCxt, yymsp[-4].minor.yy242, yymsp[-2].minor.yy174, yymsp[0].minor.yy242); } break; - case 367: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -{ yymsp[-3].minor.yy520 = createInsertStmt(pCxt, yymsp[-1].minor.yy520, NULL, yymsp[0].minor.yy520); } + case 368: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ +{ yymsp[-3].minor.yy242 = createInsertStmt(pCxt, yymsp[-1].minor.yy242, NULL, yymsp[0].minor.yy242); } break; - case 368: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy520 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 369: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy242 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 369: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy520 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 370: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy242 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 370: /* literal ::= NK_STRING */ -{ yylhsminor.yy520 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 371: /* literal ::= NK_STRING */ +{ yylhsminor.yy242 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 371: /* literal ::= NK_BOOL */ -{ yylhsminor.yy520 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 372: /* literal ::= NK_BOOL */ +{ yylhsminor.yy242 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 372: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; + case 373: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; - case 373: /* literal ::= duration_literal */ - case 383: /* signed_literal ::= signed */ yytestcase(yyruleno==383); - case 404: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==404); - case 405: /* expression ::= literal */ yytestcase(yyruleno==405); - case 406: /* expression ::= pseudo_column */ yytestcase(yyruleno==406); - case 407: /* expression ::= column_reference */ yytestcase(yyruleno==407); - case 408: /* expression ::= function_expression */ yytestcase(yyruleno==408); - case 409: /* expression ::= case_when_expression */ yytestcase(yyruleno==409); - case 440: /* function_expression ::= literal_func */ yytestcase(yyruleno==440); - case 489: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==489); - case 493: /* boolean_primary ::= predicate */ yytestcase(yyruleno==493); - case 495: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==495); - case 496: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==496); - case 499: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==499); - case 501: /* table_reference ::= table_primary */ yytestcase(yyruleno==501); - case 502: /* table_reference ::= joined_table */ yytestcase(yyruleno==502); - case 506: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==506); - case 564: /* query_simple ::= query_specification */ yytestcase(yyruleno==564); - case 565: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==565); - case 568: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==568); - case 570: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==570); -{ yylhsminor.yy520 = yymsp[0].minor.yy520; } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 374: /* literal ::= duration_literal */ + case 384: /* signed_literal ::= signed */ yytestcase(yyruleno==384); + case 405: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==405); + case 406: /* expression ::= literal */ yytestcase(yyruleno==406); + case 407: /* expression ::= pseudo_column */ yytestcase(yyruleno==407); + case 408: /* expression ::= column_reference */ yytestcase(yyruleno==408); + case 409: /* expression ::= function_expression */ yytestcase(yyruleno==409); + case 410: /* expression ::= case_when_expression */ yytestcase(yyruleno==410); + case 441: /* function_expression ::= literal_func */ yytestcase(yyruleno==441); + case 490: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==490); + case 494: /* boolean_primary ::= predicate */ yytestcase(yyruleno==494); + case 496: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==496); + case 497: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==497); + case 500: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==500); + case 502: /* table_reference ::= table_primary */ yytestcase(yyruleno==502); + case 503: /* table_reference ::= joined_table */ yytestcase(yyruleno==503); + case 507: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==507); + case 565: /* query_simple ::= query_specification */ yytestcase(yyruleno==565); + case 566: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==566); + case 569: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==569); + case 571: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==571); +{ yylhsminor.yy242 = yymsp[0].minor.yy242; } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 374: /* literal ::= NULL */ -{ yylhsminor.yy520 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 375: /* literal ::= NULL */ +{ yylhsminor.yy242 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 375: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy520 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 376: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy242 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 376: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy520 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 377: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy242 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 377: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 378: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 378: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 379: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 379: /* signed ::= NK_MINUS NK_INTEGER */ + case 380: /* 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.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; - case 380: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 381: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 381: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 382: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 382: /* signed ::= NK_MINUS NK_FLOAT */ + case 383: /* 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.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; - case 384: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 385: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 385: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 386: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 386: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 387: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 387: /* signed_literal ::= duration_literal */ - case 389: /* signed_literal ::= literal_func */ yytestcase(yyruleno==389); - case 460: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==460); - case 522: /* select_item ::= common_expression */ yytestcase(yyruleno==522); - case 532: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==532); - case 569: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==569); - case 571: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==571); - case 584: /* search_condition ::= common_expression */ yytestcase(yyruleno==584); -{ yylhsminor.yy520 = releaseRawExprNode(pCxt, yymsp[0].minor.yy520); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 388: /* signed_literal ::= duration_literal */ + case 390: /* signed_literal ::= literal_func */ yytestcase(yyruleno==390); + case 461: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==461); + case 523: /* select_item ::= common_expression */ yytestcase(yyruleno==523); + case 533: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==533); + case 570: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==570); + case 572: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==572); + case 585: /* search_condition ::= common_expression */ yytestcase(yyruleno==585); +{ yylhsminor.yy242 = releaseRawExprNode(pCxt, yymsp[0].minor.yy242); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 388: /* signed_literal ::= NULL */ -{ yylhsminor.yy520 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 389: /* signed_literal ::= NULL */ +{ yylhsminor.yy242 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 390: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy520 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 391: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy242 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 410: /* expression ::= NK_LP expression NK_RP */ - case 494: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==494); - case 583: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==583); -{ yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy520)); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 411: /* expression ::= NK_LP expression NK_RP */ + case 495: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==495); + case 584: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==584); +{ yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy242)); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 411: /* expression ::= NK_PLUS expr_or_subquery */ + case 412: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy520)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy242)); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; - case 412: /* expression ::= NK_MINUS expr_or_subquery */ + case 413: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy520), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy242), NULL)); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; - case 413: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 414: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy520); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy242); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 414: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 415: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy520); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy242); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 415: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 416: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy520); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy242); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 416: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 417: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy520); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy242); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 417: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 418: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy520); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy242); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 418: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 419: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 419: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 420: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy520); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy242); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 420: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 421: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy520); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy242); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 423: /* column_reference ::= column_name */ -{ yylhsminor.yy520 = createRawExprNode(pCxt, &yymsp[0].minor.yy833, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy833)); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 424: /* column_reference ::= column_name */ +{ yylhsminor.yy242 = createRawExprNode(pCxt, &yymsp[0].minor.yy669, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy669)); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 424: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy833, &yymsp[0].minor.yy833, createColumnNode(pCxt, &yymsp[-2].minor.yy833, &yymsp[0].minor.yy833)); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 425: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy669, &yymsp[0].minor.yy669, createColumnNode(pCxt, &yymsp[-2].minor.yy669, &yymsp[0].minor.yy669)); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 425: /* pseudo_column ::= ROWTS */ - case 426: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==426); - case 428: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==428); - case 429: /* pseudo_column ::= QEND */ yytestcase(yyruleno==429); - case 430: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==430); - case 431: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==431); - case 432: /* pseudo_column ::= WEND */ yytestcase(yyruleno==432); - case 433: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==433); - case 434: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==434); - case 435: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==435); - case 436: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==436); - case 442: /* literal_func ::= NOW */ yytestcase(yyruleno==442); -{ yylhsminor.yy520 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 426: /* pseudo_column ::= ROWTS */ + case 427: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==427); + case 429: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==429); + case 430: /* pseudo_column ::= QEND */ yytestcase(yyruleno==430); + case 431: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==431); + case 432: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==432); + case 433: /* pseudo_column ::= WEND */ yytestcase(yyruleno==433); + case 434: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==434); + case 435: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==435); + case 436: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==436); + case 437: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==437); + case 443: /* literal_func ::= NOW */ yytestcase(yyruleno==443); +{ yylhsminor.yy242 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 427: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy833, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy833)))); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 428: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy669, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy669)))); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 437: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 438: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==438); -{ yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy833, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy833, yymsp[-1].minor.yy904)); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; + case 438: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 439: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==439); +{ yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy669, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy669, yymsp[-1].minor.yy174)); } + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; - case 439: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy520), yymsp[-1].minor.yy840)); } - yymsp[-5].minor.yy520 = yylhsminor.yy520; + case 440: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +{ yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy242), yymsp[-1].minor.yy794)); } + yymsp[-5].minor.yy242 = yylhsminor.yy242; break; - case 441: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy833, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy833, NULL)); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 442: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy669, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy669, NULL)); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 456: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy904 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy904 = yylhsminor.yy904; + case 457: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy174 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy174 = yylhsminor.yy174; break; - case 461: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 525: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==525); -{ yylhsminor.yy520 = createColumnNode(pCxt, &yymsp[-2].minor.yy833, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 462: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 526: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==526); +{ yylhsminor.yy242 = createColumnNode(pCxt, &yymsp[-2].minor.yy669, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 462: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy904, yymsp[-1].minor.yy520)); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; + case 463: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy174, yymsp[-1].minor.yy242)); } + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; - case 463: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy520), yymsp[-2].minor.yy904, yymsp[-1].minor.yy520)); } - yymsp[-4].minor.yy520 = yylhsminor.yy520; + case 464: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy242), yymsp[-2].minor.yy174, yymsp[-1].minor.yy242)); } + yymsp[-4].minor.yy242 = yylhsminor.yy242; break; - case 466: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy520 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520)); } + case 467: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy242 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242)); } break; - case 468: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy520 = releaseRawExprNode(pCxt, yymsp[0].minor.yy520); } + case 469: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy242 = releaseRawExprNode(pCxt, yymsp[0].minor.yy242); } break; - case 469: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 474: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==474); + case 470: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 475: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==475); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy520); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy524, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy242); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy70, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 470: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 471: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy520); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy520), releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy242); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy242), releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } - yymsp[-4].minor.yy520 = yylhsminor.yy520; + yymsp[-4].minor.yy242 = yylhsminor.yy242; break; - case 471: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 472: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy520); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy520), releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy242); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy242), releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } - yymsp[-5].minor.yy520 = yylhsminor.yy520; + yymsp[-5].minor.yy242 = yylhsminor.yy242; break; - case 472: /* predicate ::= expr_or_subquery IS NULL */ + case 473: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), NULL)); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 473: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 474: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy520), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy242), NULL)); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; - case 475: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy524 = OP_TYPE_LOWER_THAN; } + case 476: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy70 = OP_TYPE_LOWER_THAN; } break; - case 476: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy524 = OP_TYPE_GREATER_THAN; } + case 477: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy70 = OP_TYPE_GREATER_THAN; } break; - case 477: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy524 = OP_TYPE_LOWER_EQUAL; } + case 478: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy70 = OP_TYPE_LOWER_EQUAL; } break; - case 478: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy524 = OP_TYPE_GREATER_EQUAL; } + case 479: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy70 = OP_TYPE_GREATER_EQUAL; } break; - case 479: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy524 = OP_TYPE_NOT_EQUAL; } + case 480: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy70 = OP_TYPE_NOT_EQUAL; } break; - case 480: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy524 = OP_TYPE_EQUAL; } + case 481: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy70 = OP_TYPE_EQUAL; } break; - case 481: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy524 = OP_TYPE_LIKE; } + case 482: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy70 = OP_TYPE_LIKE; } break; - case 482: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy524 = OP_TYPE_NOT_LIKE; } + case 483: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy70 = OP_TYPE_NOT_LIKE; } break; - case 483: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy524 = OP_TYPE_MATCH; } + case 484: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy70 = OP_TYPE_MATCH; } break; - case 484: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy524 = OP_TYPE_NMATCH; } + case 485: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy70 = OP_TYPE_NMATCH; } break; - case 485: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy524 = OP_TYPE_JSON_CONTAINS; } + case 486: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy70 = OP_TYPE_JSON_CONTAINS; } break; - case 486: /* in_op ::= IN */ -{ yymsp[0].minor.yy524 = OP_TYPE_IN; } + case 487: /* in_op ::= IN */ +{ yymsp[0].minor.yy70 = OP_TYPE_IN; } break; - case 487: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy524 = OP_TYPE_NOT_IN; } + case 488: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy70 = OP_TYPE_NOT_IN; } break; - case 488: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy904)); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 489: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy174)); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 490: /* boolean_value_expression ::= NOT boolean_primary */ + case 491: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy520), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy242), NULL)); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; - case 491: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 492: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy520); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy242); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 492: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 493: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy520); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy520); - yylhsminor.yy520 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy242); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy242); + yylhsminor.yy242 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 500: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy520 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy520, yymsp[0].minor.yy520, NULL); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 501: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy242 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, NULL); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 503: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy520 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy833, &yymsp[0].minor.yy833); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; + case 504: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy242 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy669, &yymsp[0].minor.yy669); } + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; - case 504: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy520 = createRealTableNode(pCxt, &yymsp[-3].minor.yy833, &yymsp[-1].minor.yy833, &yymsp[0].minor.yy833); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; + case 505: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy242 = createRealTableNode(pCxt, &yymsp[-3].minor.yy669, &yymsp[-1].minor.yy669, &yymsp[0].minor.yy669); } + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; - case 505: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy520 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy520), &yymsp[0].minor.yy833); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; + case 506: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy242 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy242), &yymsp[0].minor.yy669); } + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; - case 507: /* alias_opt ::= */ -{ yymsp[1].minor.yy833 = nil_token; } + case 508: /* alias_opt ::= */ +{ yymsp[1].minor.yy669 = nil_token; } break; - case 509: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy833 = yymsp[0].minor.yy833; } + case 510: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy669 = yymsp[0].minor.yy669; } break; - case 510: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 511: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==511); -{ yymsp[-2].minor.yy520 = yymsp[-1].minor.yy520; } + case 511: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 512: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==512); +{ yymsp[-2].minor.yy242 = yymsp[-1].minor.yy242; } break; - case 512: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy520 = createJoinTableNode(pCxt, yymsp[-4].minor.yy596, yymsp[-5].minor.yy520, yymsp[-2].minor.yy520, yymsp[0].minor.yy520); } - yymsp[-5].minor.yy520 = yylhsminor.yy520; + case 513: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy242 = createJoinTableNode(pCxt, yymsp[-4].minor.yy482, yymsp[-5].minor.yy242, yymsp[-2].minor.yy242, yymsp[0].minor.yy242); } + yymsp[-5].minor.yy242 = yylhsminor.yy242; break; - case 513: /* join_type ::= */ -{ yymsp[1].minor.yy596 = JOIN_TYPE_INNER; } + case 514: /* join_type ::= */ +{ yymsp[1].minor.yy482 = JOIN_TYPE_INNER; } break; - case 514: /* join_type ::= INNER */ -{ yymsp[0].minor.yy596 = JOIN_TYPE_INNER; } + case 515: /* join_type ::= INNER */ +{ yymsp[0].minor.yy482 = JOIN_TYPE_INNER; } break; - case 515: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 516: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-11].minor.yy520 = createSelectStmt(pCxt, yymsp[-10].minor.yy537, yymsp[-9].minor.yy904, yymsp[-8].minor.yy520); - yymsp[-11].minor.yy520 = addWhereClause(pCxt, yymsp[-11].minor.yy520, yymsp[-7].minor.yy520); - yymsp[-11].minor.yy520 = addPartitionByClause(pCxt, yymsp[-11].minor.yy520, yymsp[-6].minor.yy904); - yymsp[-11].minor.yy520 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy520, yymsp[-2].minor.yy520); - yymsp[-11].minor.yy520 = addGroupByClause(pCxt, yymsp[-11].minor.yy520, yymsp[-1].minor.yy904); - yymsp[-11].minor.yy520 = addHavingClause(pCxt, yymsp[-11].minor.yy520, yymsp[0].minor.yy520); - yymsp[-11].minor.yy520 = addRangeClause(pCxt, yymsp[-11].minor.yy520, yymsp[-5].minor.yy520); - yymsp[-11].minor.yy520 = addEveryClause(pCxt, yymsp[-11].minor.yy520, yymsp[-4].minor.yy520); - yymsp[-11].minor.yy520 = addFillClause(pCxt, yymsp[-11].minor.yy520, yymsp[-3].minor.yy520); + yymsp[-11].minor.yy242 = createSelectStmt(pCxt, yymsp[-10].minor.yy777, yymsp[-9].minor.yy174, yymsp[-8].minor.yy242); + yymsp[-11].minor.yy242 = addWhereClause(pCxt, yymsp[-11].minor.yy242, yymsp[-7].minor.yy242); + yymsp[-11].minor.yy242 = addPartitionByClause(pCxt, yymsp[-11].minor.yy242, yymsp[-6].minor.yy174); + yymsp[-11].minor.yy242 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy242, yymsp[-2].minor.yy242); + yymsp[-11].minor.yy242 = addGroupByClause(pCxt, yymsp[-11].minor.yy242, yymsp[-1].minor.yy174); + yymsp[-11].minor.yy242 = addHavingClause(pCxt, yymsp[-11].minor.yy242, yymsp[0].minor.yy242); + yymsp[-11].minor.yy242 = addRangeClause(pCxt, yymsp[-11].minor.yy242, yymsp[-5].minor.yy242); + yymsp[-11].minor.yy242 = addEveryClause(pCxt, yymsp[-11].minor.yy242, yymsp[-4].minor.yy242); + yymsp[-11].minor.yy242 = addFillClause(pCxt, yymsp[-11].minor.yy242, yymsp[-3].minor.yy242); } break; - case 518: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy537 = false; } + case 519: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy777 = false; } break; - case 521: /* select_item ::= NK_STAR */ -{ yylhsminor.yy520 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy520 = yylhsminor.yy520; + case 522: /* select_item ::= NK_STAR */ +{ yylhsminor.yy242 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy242 = yylhsminor.yy242; break; - case 523: /* select_item ::= common_expression column_alias */ - case 533: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==533); -{ yylhsminor.yy520 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy520), &yymsp[0].minor.yy833); } - yymsp[-1].minor.yy520 = yylhsminor.yy520; + case 524: /* select_item ::= common_expression column_alias */ + case 534: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==534); +{ yylhsminor.yy242 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy242), &yymsp[0].minor.yy669); } + yymsp[-1].minor.yy242 = yylhsminor.yy242; break; - case 524: /* select_item ::= common_expression AS column_alias */ - case 534: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==534); -{ yylhsminor.yy520 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), &yymsp[0].minor.yy833); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 525: /* select_item ::= common_expression AS column_alias */ + case 535: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==535); +{ yylhsminor.yy242 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), &yymsp[0].minor.yy669); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 529: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 554: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==554); - case 573: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==573); -{ yymsp[-2].minor.yy904 = yymsp[0].minor.yy904; } + case 530: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 555: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==555); + case 574: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==574); +{ yymsp[-2].minor.yy174 = yymsp[0].minor.yy174; } break; - case 536: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy520 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy520), releaseRawExprNode(pCxt, yymsp[-1].minor.yy520)); } + case 537: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy242 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy242), releaseRawExprNode(pCxt, yymsp[-1].minor.yy242)); } break; - case 537: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy520 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy520)); } + case 538: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy242 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy242)); } break; - case 538: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy520 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy520), NULL, yymsp[-1].minor.yy520, yymsp[0].minor.yy520); } + case 539: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy242 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy242), NULL, yymsp[-1].minor.yy242, yymsp[0].minor.yy242); } break; - case 539: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy520 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy520), releaseRawExprNode(pCxt, yymsp[-3].minor.yy520), yymsp[-1].minor.yy520, yymsp[0].minor.yy520); } + case 540: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy242 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy242), releaseRawExprNode(pCxt, yymsp[-3].minor.yy242), yymsp[-1].minor.yy242, yymsp[0].minor.yy242); } break; - case 540: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -{ yymsp[-6].minor.yy520 = createEventWindowNode(pCxt, yymsp[-3].minor.yy520, yymsp[0].minor.yy520); } + case 541: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +{ yymsp[-6].minor.yy242 = createEventWindowNode(pCxt, yymsp[-3].minor.yy242, yymsp[0].minor.yy242); } break; - case 544: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy520 = createFillNode(pCxt, yymsp[-1].minor.yy470, NULL); } + case 545: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy242 = createFillNode(pCxt, yymsp[-1].minor.yy204, NULL); } break; - case 545: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy520 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy904)); } + case 546: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy242 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy174)); } break; - case 546: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy520 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy904)); } + case 547: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy242 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy174)); } break; - case 547: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy470 = FILL_MODE_NONE; } + case 548: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy204 = FILL_MODE_NONE; } break; - case 548: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy470 = FILL_MODE_PREV; } + case 549: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy204 = FILL_MODE_PREV; } break; - case 549: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy470 = FILL_MODE_NULL; } + case 550: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy204 = FILL_MODE_NULL; } break; - case 550: /* fill_mode ::= NULL_F */ -{ yymsp[0].minor.yy470 = FILL_MODE_NULL_F; } + case 551: /* fill_mode ::= NULL_F */ +{ yymsp[0].minor.yy204 = FILL_MODE_NULL_F; } break; - case 551: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy470 = FILL_MODE_LINEAR; } + case 552: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy204 = FILL_MODE_LINEAR; } break; - case 552: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy470 = FILL_MODE_NEXT; } + case 553: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy204 = FILL_MODE_NEXT; } break; - case 555: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy904 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); } - yymsp[0].minor.yy904 = yylhsminor.yy904; + case 556: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy174 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } + yymsp[0].minor.yy174 = yylhsminor.yy174; break; - case 556: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy904 = addNodeToList(pCxt, yymsp[-2].minor.yy904, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy520))); } - yymsp[-2].minor.yy904 = yylhsminor.yy904; + case 557: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy174 = addNodeToList(pCxt, yymsp[-2].minor.yy174, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy242))); } + yymsp[-2].minor.yy174 = yylhsminor.yy174; break; - case 560: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy520 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy520), releaseRawExprNode(pCxt, yymsp[-1].minor.yy520)); } + case 561: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy242 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy242), releaseRawExprNode(pCxt, yymsp[-1].minor.yy242)); } break; - case 563: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 564: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy520 = addOrderByClause(pCxt, yymsp[-3].minor.yy520, yymsp[-2].minor.yy904); - yylhsminor.yy520 = addSlimitClause(pCxt, yylhsminor.yy520, yymsp[-1].minor.yy520); - yylhsminor.yy520 = addLimitClause(pCxt, yylhsminor.yy520, yymsp[0].minor.yy520); + yylhsminor.yy242 = addOrderByClause(pCxt, yymsp[-3].minor.yy242, yymsp[-2].minor.yy174); + yylhsminor.yy242 = addSlimitClause(pCxt, yylhsminor.yy242, yymsp[-1].minor.yy242); + yylhsminor.yy242 = addLimitClause(pCxt, yylhsminor.yy242, yymsp[0].minor.yy242); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; - case 566: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy520 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy520, yymsp[0].minor.yy520); } - yymsp[-3].minor.yy520 = yylhsminor.yy520; + case 567: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy242 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy242, yymsp[0].minor.yy242); } + yymsp[-3].minor.yy242 = yylhsminor.yy242; break; - case 567: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy520 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy520, yymsp[0].minor.yy520); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 568: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy242 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy242, yymsp[0].minor.yy242); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 575: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 579: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==579); -{ yymsp[-1].minor.yy520 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 576: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 580: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==580); +{ yymsp[-1].minor.yy242 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 576: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 580: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==580); -{ yymsp[-3].minor.yy520 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 577: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 581: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==581); +{ yymsp[-3].minor.yy242 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 577: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 581: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==581); -{ yymsp[-3].minor.yy520 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 578: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 582: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==582); +{ yymsp[-3].minor.yy242 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 582: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy520 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy520); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 583: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy242 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy242); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 587: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy520 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy520), yymsp[-1].minor.yy906, yymsp[0].minor.yy257); } - yymsp[-2].minor.yy520 = yylhsminor.yy520; + case 588: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy242 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy242), yymsp[-1].minor.yy48, yymsp[0].minor.yy687); } + yymsp[-2].minor.yy242 = yylhsminor.yy242; break; - case 588: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy906 = ORDER_ASC; } + case 589: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy48 = ORDER_ASC; } break; - case 589: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy906 = ORDER_ASC; } + case 590: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy48 = ORDER_ASC; } break; - case 590: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy906 = ORDER_DESC; } + case 591: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy48 = ORDER_DESC; } break; - case 591: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy257 = NULL_ORDER_DEFAULT; } + case 592: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy687 = NULL_ORDER_DEFAULT; } break; - case 592: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy257 = NULL_ORDER_FIRST; } + case 593: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy687 = NULL_ORDER_FIRST; } break; - case 593: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy257 = NULL_ORDER_LAST; } + case 594: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy687 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/planner/test/planStmtTest.cpp b/source/libs/planner/test/planStmtTest.cpp index bab38797cc..df8a509d12 100644 --- a/source/libs/planner/test/planStmtTest.cpp +++ b/source/libs/planner/test/planStmtTest.cpp @@ -108,6 +108,7 @@ class PlanStmtTest : public PlannerTestBase { switch (type) { case TSDB_DATA_TYPE_VARCHAR: case TSDB_DATA_TYPE_VARBINARY: + case TSDB_DATA_TYPE_GEOMETRY: strncpy((char*)pBindParam->buffer, pVal, bytes); break; case TSDB_DATA_TYPE_TIMESTAMP: diff --git a/source/libs/qcom/src/queryUtil.c b/source/libs/qcom/src/queryUtil.c index c70ea57401..b3627e1a96 100644 --- a/source/libs/qcom/src/queryUtil.c +++ b/source/libs/qcom/src/queryUtil.c @@ -52,6 +52,10 @@ static bool doValidateSchema(SSchema* pSchema, int32_t numOfCols, int32_t maxLen if (pSchema[i].bytes > TSDB_MAX_NCHAR_LEN) { return false; } + } else if (pSchema[i].type == TSDB_DATA_TYPE_GEOMETRY) { + if (pSchema[i].bytes > TSDB_MAX_GEOMETRY_LEN) { + return false; + } } else { if (pSchema[i].bytes != tDataTypes[pSchema[i].type].bytes) { return false; @@ -297,6 +301,7 @@ int32_t dataConverToStr(char* str, int type, void* buf, int32_t bufSize, int32_t break; case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: if (bufSize < 0) { // tscError("invalid buf size"); return TSDB_CODE_TSC_INVALID_VALUE; diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c index 02a21b66ed..344c3dcca3 100644 --- a/source/libs/scalar/src/filter.c +++ b/source/libs/scalar/src/filter.c @@ -178,7 +178,7 @@ __compar_fn_t gUint64UsignCompare[] = {compareUint64Uint8, compareUint64Uint16, int8_t filterGetCompFuncIdx(int32_t type, int32_t optr) { int8_t comparFn = 0; - if (optr == OP_TYPE_IN && (type != TSDB_DATA_TYPE_BINARY && type != TSDB_DATA_TYPE_NCHAR)) { + if (optr == OP_TYPE_IN && (type != TSDB_DATA_TYPE_BINARY && type != TSDB_DATA_TYPE_NCHAR && type != TSDB_DATA_TYPE_GEOMETRY)) { switch (type) { case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_TINYINT: @@ -204,7 +204,7 @@ int8_t filterGetCompFuncIdx(int32_t type, int32_t optr) { } } - if (optr == OP_TYPE_NOT_IN && (type != TSDB_DATA_TYPE_BINARY && type != TSDB_DATA_TYPE_NCHAR)) { + if (optr == OP_TYPE_NOT_IN && (type != TSDB_DATA_TYPE_BINARY && type != TSDB_DATA_TYPE_NCHAR && type != TSDB_DATA_TYPE_GEOMETRY)) { switch (type) { case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_TINYINT: @@ -255,7 +255,8 @@ int8_t filterGetCompFuncIdx(int32_t type, int32_t optr) { case TSDB_DATA_TYPE_DOUBLE: comparFn = 5; break; - case TSDB_DATA_TYPE_BINARY: { + case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: { if (optr == OP_TYPE_MATCH) { comparFn = 19; } else if (optr == OP_TYPE_NMATCH) { @@ -448,8 +449,9 @@ static FORCE_INLINE SFilterRangeNode *filterNewRange(SFilterRangeCtx *ctx, SFilt } void *filterInitRangeCtx(int32_t type, int32_t options) { - if (type > TSDB_DATA_TYPE_UBIGINT || type < TSDB_DATA_TYPE_BOOL || type == TSDB_DATA_TYPE_BINARY || - type == TSDB_DATA_TYPE_NCHAR) { + if (type > TSDB_DATA_TYPE_UBIGINT || type < TSDB_DATA_TYPE_BOOL || + type == TSDB_DATA_TYPE_BINARY || + type == TSDB_DATA_TYPE_NCHAR || type == TSDB_DATA_TYPE_GEOMETRY) { qError("not supported range type:%d", type); return NULL; } @@ -1567,6 +1569,7 @@ int32_t fltConverToStr(char *str, int type, void *buf, int32_t bufSize, int32_t case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: if (bufSize < 0) { // tscError("invalid buf size"); return TSDB_CODE_TSC_INVALID_VALUE; @@ -3739,7 +3742,8 @@ EDealRes fltReviseRewriter(SNode **pNode, void *pContext) { } if (TSDB_DATA_TYPE_BINARY != valueNode->node.resType.type && TSDB_DATA_TYPE_NCHAR != - valueNode->node.resType.type) { return DEAL_RES_CONTINUE; + valueNode->node.resType.type && + TSDB_DATA_TYPE_GEOMETRY != valueNode->node.resType.type) { return DEAL_RES_CONTINUE; } if (stat->precision < 0) { diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index 1afcf44958..b9af716929 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -289,7 +289,7 @@ static int32_t doScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarP static VarDataLenT tlength(char *input, int32_t type) { return varDataLen(input); } static VarDataLenT tcharlength(char *input, int32_t type) { - if (type == TSDB_DATA_TYPE_VARCHAR) { + if (type == TSDB_DATA_TYPE_VARCHAR || type == TSDB_DATA_TYPE_GEOMETRY) { return varDataLen(input); } else { // NCHAR return varDataLen(input) / TSDB_NCHAR_SIZE; @@ -935,7 +935,8 @@ int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutp } break; } - case TSDB_DATA_TYPE_BINARY: { + case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: { if (inputType == TSDB_DATA_TYPE_BOOL) { // NOTE: sprintf will append '\0' at the end of string int32_t len = sprintf(varDataVal(output), "%.*s", (int32_t)(outputLen - VARSTR_HEADER_SIZE), diff --git a/source/libs/scalar/src/sclvector.c b/source/libs/scalar/src/sclvector.c index 4d803cb638..4f76f93c6c 100644 --- a/source/libs/scalar/src/sclvector.c +++ b/source/libs/scalar/src/sclvector.c @@ -230,6 +230,8 @@ _getValueAddr_fn_t getVectorValueAddrFn(int32_t srcType) { p = getVectorValueAddr_VAR; } else if (srcType == TSDB_DATA_TYPE_NCHAR) { p = getVectorValueAddr_VAR; + }else if(srcType == TSDB_DATA_TYPE_GEOMETRY) { + p = getVectorValueAddr_VAR; } else { p = getVectorValueAddr_default; } @@ -440,7 +442,7 @@ int32_t vectorConvertFromVarData(SSclVectorConvCtx *pCtx, int32_t *overflow) { if (vton) { memcpy(tmp, data, varDataTLen(data)); } else { - if (TSDB_DATA_TYPE_VARCHAR == convertType) { + if (TSDB_DATA_TYPE_VARCHAR == convertType || TSDB_DATA_TYPE_GEOMETRY == convertType) { memcpy(tmp, varDataVal(data), varDataLen(data)); tmp[varDataLen(data)] = 0; } else if (TSDB_DATA_TYPE_NCHAR == convertType) { @@ -531,7 +533,7 @@ bool convertJsonValue(__compar_fn_t *fp, int32_t optr, int8_t typeLeft, int8_t t } if (optr == OP_TYPE_LIKE || optr == OP_TYPE_NOT_LIKE || optr == OP_TYPE_MATCH || optr == OP_TYPE_NMATCH) { - if (typeLeft != TSDB_DATA_TYPE_NCHAR && typeLeft != TSDB_DATA_TYPE_BINARY) { + if (typeLeft != TSDB_DATA_TYPE_NCHAR && typeLeft != TSDB_DATA_TYPE_BINARY && typeLeft != TSDB_DATA_TYPE_GEOMETRY) { return false; } } @@ -560,7 +562,8 @@ bool convertJsonValue(__compar_fn_t *fp, int32_t optr, int8_t typeLeft, int8_t t if (IS_NUMERIC_TYPE(type)) { if (typeLeft == TSDB_DATA_TYPE_NCHAR || - typeLeft == TSDB_DATA_TYPE_VARCHAR) { + typeLeft == TSDB_DATA_TYPE_VARCHAR || + typeLeft == TSDB_DATA_TYPE_GEOMETRY) { return false; } else if (typeLeft != type) { convertNumberToNumber(*pLeftData, pLeftOut, typeLeft, type); @@ -568,13 +571,14 @@ bool convertJsonValue(__compar_fn_t *fp, int32_t optr, int8_t typeLeft, int8_t t } if (typeRight == TSDB_DATA_TYPE_NCHAR || - typeRight == TSDB_DATA_TYPE_VARCHAR) { + typeRight == TSDB_DATA_TYPE_VARCHAR || + typeRight == TSDB_DATA_TYPE_GEOMETRY) { return false; } else if (typeRight != type) { convertNumberToNumber(*pRightData, pRightOut, typeRight, type); *pRightData = pRightOut; } - } else if (type == TSDB_DATA_TYPE_BINARY) { + } else if (type == TSDB_DATA_TYPE_BINARY || typeLeft == TSDB_DATA_TYPE_GEOMETRY) { if (typeLeft == TSDB_DATA_TYPE_NCHAR) { *pLeftData = ncharTobinary(*pLeftData); *freeLeft = true; @@ -864,7 +868,8 @@ int32_t vectorConvertSingleColImpl(const SScalarParam *pIn, SScalarParam *pOut, break; } case TSDB_DATA_TYPE_BINARY: - case TSDB_DATA_TYPE_NCHAR: { + case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: { return vectorConvertToVarData(&cCtx); } default: @@ -875,27 +880,29 @@ int32_t vectorConvertSingleColImpl(const SScalarParam *pIn, SScalarParam *pOut, return TSDB_CODE_SUCCESS; } -int8_t gConvertTypes[TSDB_DATA_TYPE_BLOB + 1][TSDB_DATA_TYPE_BLOB + 1] = { - /* NULL BOOL TINY SMAL INT BIG FLOA DOUB VARC TIME NCHA UTIN USMA UINT UBIG JSON VARB DECI BLOB */ - /*NULL*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /*BOOL*/ 0, 0, 2, 3, 4, 5, 6, 7, 5, 9, 7, 11, 12, 13, 14, 0, 7, 0, 0, - /*TINY*/ 0, 0, 0, 3, 4, 5, 6, 7, 5, 9, 7, 3, 4, 5, 7, 0, 7, 0, 0, - /*SMAL*/ 0, 0, 0, 0, 4, 5, 6, 7, 5, 9, 7, 3, 4, 5, 7, 0, 7, 0, 0, - /*INT */ 0, 0, 0, 0, 0, 5, 6, 7, 5, 9, 7, 4, 4, 5, 7, 0, 7, 0, 0, - /*BIGI*/ 0, 0, 0, 0, 0, 0, 6, 7, 5, 9, 7, 5, 5, 5, 7, 0, 7, 0, 0, - /*FLOA*/ 0, 0, 0, 0, 0, 0, 0, 7, 7, 6, 7, 6, 6, 6, 6, 0, 7, 0, 0, - /*DOUB*/ 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 0, 7, 0, 0, - /*VARC*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 8, 7, 7, 7, 7, 0, 0, 0, 0, - /*TIME*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 7, 0, 7, 0, 0, - /*NCHA*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 0, 0, 0, 0, - /*UTIN*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 14, 0, 7, 0, 0, - /*USMA*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 14, 0, 7, 0, 0, - /*UINT*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 7, 0, 0, - /*UBIG*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, - /*JSON*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /*VARB*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /*DECI*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /*BLOB*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +int8_t gConvertTypes[TSDB_DATA_TYPE_MAX][TSDB_DATA_TYPE_MAX] = { + /* NULL BOOL TINY SMAL INT BIG FLOA DOUB VARC TIME NCHA UTIN USMA UINT UBIG JSON GEOM VARB DECI BLOB MEDB*/ + /*NULL*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /*BOOL*/ 0, 0, 2, 3, 4, 5, 6, 7, 5, 9, 7, 11, 12, 13, 14, 0, 7, 0, 0, 0, 0, + /*TINY*/ 0, 0, 0, 3, 4, 5, 6, 7, 5, 9, 7, 3, 4, 5, 7, 0, 7, 0, 0, 0, 0, + /*SMAL*/ 0, 0, 0, 0, 4, 5, 6, 7, 5, 9, 7, 3, 4, 5, 7, 0, 7, 0, 0, 0, 0, + /*INT */ 0, 0, 0, 0, 0, 5, 6, 7, 5, 9, 7, 4, 4, 5, 7, 0, 7, 0, 0, 0, 0, + /*BIGI*/ 0, 0, 0, 0, 0, 0, 6, 7, 5, 9, 7, 5, 5, 5, 7, 0, 7, 0, 0, 0, 0, + /*FLOA*/ 0, 0, 0, 0, 0, 0, 0, 7, 7, 6, 7, 6, 6, 6, 6, 0, 7, 0, 0, 0, 0, + /*DOUB*/ 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 0, 7, 0, 0, 0, 0, + /*VARC*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 8, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, + /*TIME*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 7, 0, 7, 0, 0, 0, 0, + /*NCHA*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, + /*UTIN*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 14, 0, 7, 0, 0, 0, 0, + /*USMA*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 14, 0, 7, 0, 0, 0, 0, + /*UINT*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 7, 0, 0, 0, 0, + /*UBIG*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, + /*JSON*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /*VARB*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /*DECI*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /*BLOB*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /*MEDB*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /*GEOM*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int32_t vectorGetConvertType(int32_t type1, int32_t type2) { if (type1 == type2) { diff --git a/source/util/CMakeLists.txt b/source/util/CMakeLists.txt index 8f3bd42a47..6c9aff046c 100644 --- a/source/util/CMakeLists.txt +++ b/source/util/CMakeLists.txt @@ -4,6 +4,7 @@ add_library(util STATIC ${UTIL_SRC}) if (DEFINED GRANT_CFG_INCLUDE_DIR) add_definitions(-DGRANTS_CFG) endif() + target_include_directories( util PUBLIC "${TD_SOURCE_DIR}/include/util" @@ -15,10 +16,9 @@ target_link_libraries( util PUBLIC os PUBLIC lz4_static - PUBLIC api cjson + PUBLIC api cjson geos_c ) if(${BUILD_TEST}) ADD_SUBDIRECTORY(test) endif(${BUILD_TEST}) - diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index d6f0e898ef..e32ff3da95 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -1284,7 +1284,7 @@ int32_t comparewcsPatternNMatch(const void *pLeft, const void *pRight) { __compar_fn_t getComparFunc(int32_t type, int32_t optr) { __compar_fn_t comparFn = NULL; - if (optr == OP_TYPE_IN && (type != TSDB_DATA_TYPE_BINARY && type != TSDB_DATA_TYPE_NCHAR)) { + if (optr == OP_TYPE_IN && (type != TSDB_DATA_TYPE_BINARY && type != TSDB_DATA_TYPE_NCHAR && type != TSDB_DATA_TYPE_GEOMETRY)) { switch (type) { case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_TINYINT: @@ -1307,7 +1307,7 @@ __compar_fn_t getComparFunc(int32_t type, int32_t optr) { } } - if (optr == OP_TYPE_NOT_IN && (type != TSDB_DATA_TYPE_BINARY && type != TSDB_DATA_TYPE_NCHAR)) { + if (optr == OP_TYPE_NOT_IN && (type != TSDB_DATA_TYPE_BINARY && type != TSDB_DATA_TYPE_NCHAR && type != TSDB_DATA_TYPE_GEOMETRY)) { switch (type) { case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_TINYINT: @@ -1351,7 +1351,8 @@ __compar_fn_t getComparFunc(int32_t type, int32_t optr) { case TSDB_DATA_TYPE_DOUBLE: comparFn = compareDoubleVal; break; - case TSDB_DATA_TYPE_BINARY: { + case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: { if (optr == OP_TYPE_MATCH) { comparFn = comparestrRegexMatch; } else if (optr == OP_TYPE_NMATCH) { @@ -1436,6 +1437,7 @@ __compar_fn_t getKeyComparFunc(int32_t keyType, int32_t order) { case TSDB_DATA_TYPE_UBIGINT: return (order == TSDB_ORDER_ASC) ? compareUint64Val : compareUint64ValDesc; case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: return (order == TSDB_ORDER_ASC) ? compareLenPrefixedStr : compareLenPrefixedStrDesc; case TSDB_DATA_TYPE_NCHAR: return (order == TSDB_ORDER_ASC) ? compareLenPrefixedWStr : compareLenPrefixedWStrDesc; diff --git a/source/util/src/tcompression.c b/source/util/src/tcompression.c index b05f1808e8..c31115d14f 100644 --- a/source/util/src/tcompression.c +++ b/source/util/src/tcompression.c @@ -1385,6 +1385,14 @@ static struct { .endFn = tCompBinaryEnd, .getI64 = NULL, .putI64 = NULL}, + {.type = TSDB_DATA_TYPE_GEOMETRY, + .bytes = 1, + .isVarLen = 1, + .startFn = tCompBinaryStart, + .cmprFn = tCompBinary, + .endFn = tCompBinaryEnd, + .getI64 = NULL, + .putI64 = NULL}, }; struct SCompressor { diff --git a/source/util/src/tgeosctx.c b/source/util/src/tgeosctx.c new file mode 100644 index 0000000000..b4e7e953df --- /dev/null +++ b/source/util/src/tgeosctx.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include "tdef.h" +#include "tgeosctx.h" + +static threadlocal SGeosContext tlGeosCtx = {0}; + +SGeosContext* getThreadLocalGeosCtx() { + return &tlGeosCtx; +} + +void destroyThreadLocalGeosCtx() { + if (tlGeosCtx.WKTReader) { + GEOSWKTReader_destroy_r(tlGeosCtx.handle, tlGeosCtx.WKTReader); + tlGeosCtx.WKTReader = NULL; + } + + if (tlGeosCtx.WKTWriter) { + GEOSWKTWriter_destroy_r(tlGeosCtx.handle, tlGeosCtx.WKTWriter); + tlGeosCtx.WKTWriter = NULL; + } + + if (tlGeosCtx.WKBReader) { + GEOSWKBReader_destroy_r(tlGeosCtx.handle, tlGeosCtx.WKBReader); + tlGeosCtx.WKBReader = NULL; + } + + if (tlGeosCtx.WKBWriter) { + GEOSWKBWriter_destroy_r(tlGeosCtx.handle, tlGeosCtx.WKBWriter); + tlGeosCtx.WKBWriter = NULL; + } + + if(tlGeosCtx.handle) { + GEOS_finish_r(tlGeosCtx.handle); + tlGeosCtx.handle = NULL; + } +} diff --git a/source/util/src/thashutil.c b/source/util/src/thashutil.c index f9c7eb1f56..891c09cfb5 100644 --- a/source/util/src/thashutil.c +++ b/source/util/src/thashutil.c @@ -194,6 +194,7 @@ _hash_fn_t taosGetDefaultHashFunction(int32_t type) { break; case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: fn = MurmurHash3_32; break; case TSDB_DATA_TYPE_UINT: diff --git a/source/util/src/tsched.c b/source/util/src/tsched.c index 5c1706e405..8ad7ccc7c2 100644 --- a/source/util/src/tsched.c +++ b/source/util/src/tsched.c @@ -16,6 +16,7 @@ #define _DEFAULT_SOURCE #include "tsched.h" #include "tdef.h" +#include "tgeosctx.h" #include "tlog.h" #include "ttimer.h" #include "tutil.h" @@ -164,6 +165,8 @@ void *taosProcessSchedQueue(void *scheduler) { (*(msg.tfp))(msg.ahandle, msg.thandle); } + destroyThreadLocalGeosCtx(); + return NULL; } diff --git a/source/util/src/tskiplist.c b/source/util/src/tskiplist.c index 222e0e8a51..6344af523f 100644 --- a/source/util/src/tskiplist.c +++ b/source/util/src/tskiplist.c @@ -376,6 +376,7 @@ void tSkipListPrint(SSkipList *pSkipList, int16_t nlevel) { fprintf(stdout, "%d: %" PRId64 " \n", id++, *(int64_t *)key); break; case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: fprintf(stdout, "%d: %s \n", id++, key); break; case TSDB_DATA_TYPE_DOUBLE: diff --git a/source/util/src/tworker.c b/source/util/src/tworker.c index 6edee27c05..57dc60e539 100644 --- a/source/util/src/tworker.c +++ b/source/util/src/tworker.c @@ -15,6 +15,7 @@ #define _DEFAULT_SOURCE #include "tworker.h" +#include "tgeosctx.h" #include "taoserror.h" #include "tlog.h" @@ -92,6 +93,8 @@ static void *tQWorkerThreadFp(SQueueWorker *worker) { taosUpdateItemSize(qinfo.queue, 1); } + destroyThreadLocalGeosCtx(); + return NULL; } diff --git a/tests/pytest/util/sql.py b/tests/pytest/util/sql.py index c041282bfc..2af8f721b6 100644 --- a/tests/pytest/util/sql.py +++ b/tests/pytest/util/sql.py @@ -78,29 +78,38 @@ class TDSql: self.cursor.execute(s) time.sleep(2) - def error(self, sql): + def error(self, sql, expectedErrno = None): + caller = inspect.getframeinfo(inspect.stack()[1][0]) expectErrNotOccured = True + try: self.cursor.execute(sql) except BaseException as e: expectErrNotOccured = False - caller = inspect.getframeinfo(inspect.stack()[1][0]) + self.errno = e.errno self.error_info = repr(e) # print(error_info) # self.error_info = error_info[error_info.index('(')+1:-1].split(",")[0].replace("'","") # self.error_info = (','.join(error_info.split(",")[:-1]).split("(",1)[1:][0]).replace("'","") # print("!!!!!!!!!!!!!!",self.error_info) - + if expectErrNotOccured: - caller = inspect.getframeinfo(inspect.stack()[1][0]) tdLog.exit("%s(%d) failed: sql:%s, expect error not occured" % (caller.filename, caller.lineno, sql)) else: self.queryRows = 0 self.queryCols = 0 self.queryResult = None - tdLog.info("sql:%s, expect error occured" % (sql)) + + if expectedErrno != None: + if expectedErrno == self.errno: + tdLog.info("sql:%s, expected errno %s occured" % (sql, expectedErrno)) + else: + tdLog.exit("%s(%d) failed: sql:%s, errno %s occured, but not expected errno %s" % (caller.filename, caller.lineno, sql, self.errno, expectedErrno)) + else: + tdLog.info("sql:%s, expect error occured" % (sql)) + return self.error_info - + def query(self, sql, row_tag=None,queryTimes=10): self.sql = sql diff --git a/tests/script/api/batchprepare.c b/tests/script/api/batchprepare.c index 99507ef5c3..a8feefec1e 100644 --- a/tests/script/api/batchprepare.c +++ b/tests/script/api/batchprepare.c @@ -453,6 +453,9 @@ void generateInsertSQL(BindData *data) { case TSDB_DATA_TYPE_UBIGINT: len += sprintf(data->sql + len, "tubigdata"); break; + case TSDB_DATA_TYPE_GEOMETRY: + len += sprintf(data->sql + len, "tgeometrydata"); + break; default: printf("!!!invalid tag type:%d", data->pTags[c].buffer_type); exit(1); @@ -521,6 +524,9 @@ void generateInsertSQL(BindData *data) { case TSDB_DATA_TYPE_UBIGINT: len += sprintf(data->sql + len, "ubigdata"); break; + case TSDB_DATA_TYPE_GEOMETRY: + len += sprintf(data->sql + len, "tgeometrydata"); + break; default: printf("!!!invalid col type:%d", data->pBind[c].buffer_type); exit(1); @@ -550,7 +556,7 @@ void bpAppendOperatorParam(BindData *data, int32_t *len, int32_t dataType, int32 if (gCaseCtrl.optrIdxListNum > 0) { pInfo = &operInfo[gCaseCtrl.optrIdxList[idx]]; } else { - if (TSDB_DATA_TYPE_VARCHAR == dataType || TSDB_DATA_TYPE_NCHAR == dataType) { + if (TSDB_DATA_TYPE_VARCHAR == dataType || TSDB_DATA_TYPE_NCHAR == dataType || TSDB_DATA_TYPE_GEOMETRY == dataType) { pInfo = &operInfo[varoperatorList[rand() % tListLen(varoperatorList)]]; } else { pInfo = &operInfo[operatorList[rand() % tListLen(operatorList)]]; @@ -635,6 +641,9 @@ int32_t bpAppendColumnName(BindData *data, int32_t type, int32_t len) { case TSDB_DATA_TYPE_UBIGINT: return sprintf(data->sql + len, "ubigdata"); break; + case TSDB_DATA_TYPE_GEOMETRY: + len += sprintf(data->sql + len, "tgeometrydata"); + break; default: printf("!!!invalid col type:%d", type); exit(1); @@ -868,6 +877,7 @@ int32_t prepareColData(BP_BIND_TYPE bType, BindData *data, int32_t bindIdx, int3 pBase[bindIdx].is_null = data->isNull ? (data->isNull + rowIdx) : NULL; break; case TSDB_DATA_TYPE_VARCHAR: + case TSDB_DATA_TYPE_GEOMETRY: pBase[bindIdx].buffer_length = gVarCharSize; pBase[bindIdx].buffer = data->binaryData + rowIdx * gVarCharSize; pBase[bindIdx].length = data->binaryLen; @@ -1210,6 +1220,7 @@ int32_t bpAppendValueString(char *buf, int type, void *value, int32_t valueLen, case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: buf[*len] = '\''; ++(*len); memcpy(buf + *len, value, valueLen); @@ -1355,7 +1366,7 @@ void bpCheckColTagFields(TAOS_STMT *stmt, int32_t fieldNum, TAOS_FIELD_E* pField exit(1); } - if (pFields[i].type == TSDB_DATA_TYPE_BINARY) { + if (pFields[i].type == TSDB_DATA_TYPE_BINARY || pFields[i].type == TSDB_DATA_TYPE_GEOMETRY) { if (pFields[i].bytes != (pBind[i].buffer_length + 2)) { printf("!!!%s %dth field len %d mis-match expect len %d\n", BP_BIND_TYPE_STR(type), i, pFields[i].bytes, (pBind[i].buffer_length + 2)); exit(1); @@ -2499,6 +2510,9 @@ void generateCreateTableSQL(char *buf, int32_t tblIdx, int32_t colNum, int32_t * case TSDB_DATA_TYPE_UBIGINT: blen += sprintf(buf + blen, "ubigdata bigint unsigned"); break; + case TSDB_DATA_TYPE_GEOMETRY: + blen += sprintf(buf + blen, "geometrydata geometry(%d)", gVarCharSize); + break; default: printf("invalid col type:%d", colList[c]); exit(1); @@ -2557,13 +2571,16 @@ void generateCreateTableSQL(char *buf, int32_t tblIdx, int32_t colNum, int32_t * case TSDB_DATA_TYPE_UBIGINT: blen += sprintf(buf + blen, "tubigdata bigint unsigned"); break; + case TSDB_DATA_TYPE_GEOMETRY: + blen += sprintf(buf + blen, "tgeometrydata geometry(%d)", gVarCharSize); + break; default: printf("invalid col type:%d", colList[c]); exit(1); - } + } } - blen += sprintf(buf + blen, ")"); + blen += sprintf(buf + blen, ")"); } if (3 == tableType) { @@ -2615,6 +2632,9 @@ void generateCreateTableSQL(char *buf, int32_t tblIdx, int32_t colNum, int32_t * case TSDB_DATA_TYPE_UBIGINT: blen += sprintf(buf + blen, "%d", rand() % 128); break; + case TSDB_DATA_TYPE_GEOMETRY: + blen += sprintf(buf + blen, "'geo%d'", rand() % 128); + break; default: printf("invalid col type:%d", colList[c]); exit(1); diff --git a/tests/script/api/demoapi.c b/tests/script/api/demoapi.c index 6c060a6325..18bd89ceee 100644 --- a/tests/script/api/demoapi.c +++ b/tests/script/api/demoapi.c @@ -200,7 +200,8 @@ static int print_result(char *tbname, TAOS_RES* res, int block) { for (int f = 0; f < num_fields; f++) { if ((fields[f].type != TSDB_DATA_TYPE_VARCHAR) && (fields[f].type != TSDB_DATA_TYPE_NCHAR) - && (fields[f].type != TSDB_DATA_TYPE_JSON)) { + && (fields[f].type != TSDB_DATA_TYPE_JSON) + && (fields[f].type != TSDB_DATA_TYPE_GEOMETRY)) { printf("col%d type is %d, no need get offset\n", f, fields[f].type); for (int64_t c = 0; c < rows; c++) { diff --git a/tests/script/api/stmt_function.c b/tests/script/api/stmt_function.c index 62f8fab29f..55ab3f5631 100644 --- a/tests/script/api/stmt_function.c +++ b/tests/script/api/stmt_function.c @@ -400,6 +400,7 @@ void taos_stmt_use_result_query(void *taos, char *col, int type) { params->length = ¶ms->buffer_length; break; case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: params->buffer_length = sizeof(v.c6); params->buffer = &v.c6; params->length = ¶ms->buffer_length; diff --git a/tests/system-test/2-query/geometry.py b/tests/system-test/2-query/geometry.py new file mode 100644 index 0000000000..e430b62fb2 --- /dev/null +++ b/tests/system-test/2-query/geometry.py @@ -0,0 +1,257 @@ +import taos +import sys + +from util.log import * +from util.sql import * +from util.cases import * + +class TDTestCase: + + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug(f"start to excute {__file__}") + tdSql.init(conn.cursor()) + + # WKT strings to be input as GEOMETRY type + self.point = "POINT (3.000000 6.000000)" + self.lineString = "LINESTRING (1.000000 1.000000, 2.000000 2.000000, 5.000000 5.000000)" + self.polygon = "POLYGON ((3.000000 6.000000, 5.000000 6.000000, 5.000000 8.000000, 3.000000 8.000000, 3.000000 6.000000))" + + # expected errno + self.errno_TSC_SQL_SYNTAX_ERROR = -2147483114; + self.errno_PAR_SYNTAX_ERROR = -2147473920 + + self.errno_FUNTION_PARA_NUM = -2147473407; + self.errno_FUNTION_PARA_TYPE = -2147473406; + self.errno_FUNTION_PARA_VALUE = -2147473405; + + def prepare_data(self, dbname = "db"): + tdSql.execute( + f'''create table {dbname}.t1 + (ts timestamp, c1 int, c2 float, c3 varchar(256), c4 geometry(512)) + ''' + ) + tdSql.execute( + f'''create table {dbname}.stb1 + (ts timestamp, c1 int, c2 float, c3 varchar(256), c4 geometry(512)) tags (t1 int) + ''' + ) + for i in range(2): + tdSql.execute(f'create table {dbname}.ct{i+1} using {dbname}.stb1 tags ( {i+1} )') + + values = f''' + (now()-1s, 1, 1.1, '{self.point}', '{self.point}') + (now(), 2, 2.2, '{self.lineString}', '{self.lineString}') + (now()+1s, 3, 3.3, '{self.polygon}', '{self.polygon}') + (now()+2s, 4, 4.4, NULL, NULL) + ''' + tdSql.execute(f"insert into {dbname}.t1 values{values}") + tdSql.execute(f"insert into {dbname}.ct1 values{values}") + tdSql.execute(f"insert into {dbname}.ct2 values{values}") + + # the following errors would happen when casting a string to GEOMETRY by ST_GeomFromText(), but raise an error as syntax error + # wrong WTK + tdSql.error(f"insert into {dbname}.ct2 values(now(), 1, 1.1, NULL, 'POIN(1.0 1.5)')", self.errno_TSC_SQL_SYNTAX_ERROR) + # wrong WTK at all + tdSql.error(f"insert into {dbname}.ct2 values(now(), 1, 1.1, NULL, 'XXX')", self.errno_TSC_SQL_SYNTAX_ERROR) + # empty WTK + tdSql.error(f"insert into {dbname}.ct2 values(now(), 1, 1.1, NULL, '')", self.errno_TSC_SQL_SYNTAX_ERROR) + # wrong type + tdSql.error(f"insert into {dbname}.ct2 values(now(), 1, 1.1, NULL, 2)", self.errno_TSC_SQL_SYNTAX_ERROR) + + def geomFromText_test(self, dbname = "db"): + # [ToDo] remove ST_AsText() calling in geomFromText_test once GEOMETRY type is supported in taos-connector-python + + # column input, including NULL value + tdSql.query(f"select ST_AsText(ST_GeomFromText(c3)), ST_AsText(c4) from {dbname}.t1") + for i in range(tdSql.queryRows): + tdSql.checkEqual(tdSql.queryResult[i][0], tdSql.queryResult[i][1]) + + # constant input + tdSql.query(f"select ST_AsText(ST_GeomFromText('{self.point}'))") + tdSql.checkEqual(tdSql.queryResult[0][0], self.point) + + # empty input + tdSql.query(f"select ST_AsText(ST_GeomFromText(''))") + tdSql.checkEqual(tdSql.queryResult[0][0], None) + + # NULL input + tdSql.query(f"select ST_AsText(ST_GeomFromText(NULL))") + tdSql.checkEqual(tdSql.queryResult[0][0], None) + + # wrong type input + tdSql.error(f"select ST_GeomFromText(2)", self.errno_FUNTION_PARA_TYPE) + tdSql.error(f"select ST_GeomFromText(c1) from {dbname}.t1", self.errno_FUNTION_PARA_TYPE) + + # wrong number of params input + tdSql.error(f"select ST_GeomFromText()", self.errno_PAR_SYNTAX_ERROR) + tdSql.error(f"select ST_GeomFromText(c3, c3) from {dbname}.t1", self.errno_FUNTION_PARA_NUM) + + # wrong param content input + # lack of the last letter of 'POINT' + tdSql.error(f"select ST_GeomFromText('POIN(1.0 1.5)')", self.errno_FUNTION_PARA_VALUE) + # redundant comma at the end + tdSql.error(f"select ST_GeomFromText('LINESTRING(1.0 1.0, 2.0 2.0, 5.0 5.0,)')", self.errno_FUNTION_PARA_VALUE) + # the first point and last one are not same + tdSql.error(f"select ST_GeomFromText('POLYGON((3.0 6.0, 5.0 6.0, 5.0 8.0, 3.0 8.0))')", self.errno_FUNTION_PARA_VALUE) + # wrong WTK at all + tdSql.error(f"select ST_GeomFromText('XXX')", self.errno_FUNTION_PARA_VALUE) + + def asText_test(self, dbname = "db"): + # column input, including NULL value + tdSql.query(f"select c3, ST_AsText(c4) from {dbname}.ct1") + for i in range(tdSql.queryRows): + tdSql.checkEqual(tdSql.queryResult[i][0], tdSql.queryResult[i][1]) + + # constant input + tdSql.query(f"select ST_AsText(c4) from {dbname}.ct1 where c1 = 1") + tdSql.checkEqual(tdSql.queryResult[0][0], self.point) + + # empty input should NOT happen for GEOMETRY type + + # NULL input + tdSql.query(f"select ST_AsText(NULL)") + tdSql.checkEqual(tdSql.queryResult[0][0], None) + + # wrong type input + tdSql.error(f"select ST_AsText('XXX')", self.errno_FUNTION_PARA_TYPE) + tdSql.error(f"select ST_AsText(c2) from {dbname}.ct1", self.errno_FUNTION_PARA_TYPE) + + # wrong number of params input + tdSql.error(f"select ST_AsText() from {dbname}.ct1", self.errno_PAR_SYNTAX_ERROR) + tdSql.error(f"select ST_AsText(c4, c4) from {dbname}.ct1", self.errno_FUNTION_PARA_NUM) + + # wrong param content input should NOT happen for GEOMETRY type + + def geomRelationFunc_test(self, geomRelationFuncName, expectedResults, dbname = "db"): + # two columns input, including NULL value + tdSql.query(f"select {geomRelationFuncName}(ST_GeomFromText(c3), c4) from {dbname}.t1") + for i in range(tdSql.queryRows): + tdSql.checkData(i, 0, expectedResults[0][i]) + + # constant and column input + tdSql.query(f"select {geomRelationFuncName}(ST_GeomFromText('{self.point}'), c4) from {dbname}.t1") + for i in range(tdSql.queryRows): + tdSql.checkData(i, 0, expectedResults[1][i]) + + # column and constant input + tdSql.query(f"select {geomRelationFuncName}(c4, ST_GeomFromText('{self.point}')) from {dbname}.t1") + for i in range(tdSql.queryRows): + tdSql.checkData(i, 0, expectedResults[2][i]) + + # two constants input + tdSql.query(f"select {geomRelationFuncName}(ST_GeomFromText('{self.point}'), ST_GeomFromText('{self.lineString}'))") + tdSql.checkEqual(tdSql.queryResult[0][0], expectedResults[3]) + + tdSql.query(f"select {geomRelationFuncName}(ST_GeomFromText('{self.polygon}'), ST_GeomFromText('{self.point}'))") + tdSql.checkEqual(tdSql.queryResult[0][0], expectedResults[4]) + + # NULL type input + tdSql.query(f"select {geomRelationFuncName}(NULL, ST_GeomFromText('{self.point}'))") + tdSql.checkEqual(tdSql.queryResult[0][0], None) + + tdSql.query(f"select {geomRelationFuncName}(ST_GeomFromText('{self.lineString}'), NULL)") + tdSql.checkEqual(tdSql.queryResult[0][0], None) + + tdSql.query(f"select {geomRelationFuncName}(NULL, NULL)") + tdSql.checkEqual(tdSql.queryResult[0][0], None) + + # wrong type input + tdSql.error(f"select {geomRelationFuncName}(c1, c4) from {dbname}.t1", self.errno_FUNTION_PARA_TYPE) + tdSql.error(f"select {geomRelationFuncName}(c4, c2) from {dbname}.t1", self.errno_FUNTION_PARA_TYPE) + tdSql.error(f"select {geomRelationFuncName}(c4, 'XXX') from {dbname}.t1", self.errno_FUNTION_PARA_TYPE) + + # wrong number of params input + tdSql.error(f"select {geomRelationFuncName}(c4) from {dbname}.t1", self.errno_FUNTION_PARA_NUM) + tdSql.error(f"select {geomRelationFuncName}(ST_GeomFromText(c3), c4, c4) from {dbname}.t1", self.errno_FUNTION_PARA_NUM) + + # used in where clause + tdSql.query(f"select c3 from {dbname}.t1 where {geomRelationFuncName}(ST_GeomFromText('{self.point}'), c4)=true") + tdSql.checkEqual(tdSql.queryRows, expectedResults[5][0]) + for i in range(tdSql.queryRows): + tdSql.checkData(i, 0, expectedResults[5][i+1]) + + def run(self): + tdSql.prepare() + + tdLog.printNoPrefix("==========step1: create tables and insert data") + self.prepare_data() + + tdLog.printNoPrefix("==========step2: ST_GeomFromText function test") + self.geomFromText_test() + + tdLog.printNoPrefix("==========step3: ST_AsText function test") + self.asText_test() + + tdLog.printNoPrefix("==========step4: ST_Intersects function test") + expectedResults = [ + [True, True, True, None], # two columns + [True, False, True, None], # constant and column + [True, False, True, None], # column and constant + False, # two constants 1 + True, # two constants 2 + [2, self.point, self.polygon] # in where clause + ] + self.geomRelationFunc_test('ST_Intersects', expectedResults) + + tdLog.printNoPrefix("==========step5: ST_Equals function test") + expectedResults = [ + [True, True, True, None], # two columns + [True, False, False, None], # constant and column + [True, False, False, None], # column and constant + False, # two constants 1 + False, # two constants 2 + [1, self.point] # in where clause + ] + self.geomRelationFunc_test('ST_Equals', expectedResults) + + tdLog.printNoPrefix("==========step6: ST_Touches function test") + expectedResults = [ + [False, False, False, None], # two columns + [False, False, True, None], # constant and column + [False, False, True, None], # column and constant + False, # two constants 1 + True, # two constants 2 + [1, self.polygon] # in where clause + ] + self.geomRelationFunc_test('ST_Touches', expectedResults) + + tdLog.printNoPrefix("==========step7: ST_Covers function test") + expectedResults = [ + [True, True, True, None], # two columns + [True, False, False, None], # constant and column + [True, False, True, None], # column and constant + False, # two constants 1 + True, # two constants 2 + [1, self.point] # in where clause + ] + self.geomRelationFunc_test('ST_Covers', expectedResults) + + tdLog.printNoPrefix("==========step8: ST_Contains function test") + expectedResults = [ + [True, True, True, None], # two columns + [True, False, False, None], # constant and column + [True, False, False, None], # column and constant + False, # two constants 1 + False, # two constants 2 + [1, self.point] # in where clause + ] + self.geomRelationFunc_test('ST_Contains', expectedResults) + + tdLog.printNoPrefix("==========step9: ST_ContainsProperly function test") + expectedResults = [ + [True, False, False, None], # two columns + [True, False, False, None], # constant and column + [True, False, False, None], # column and constant + False, # two constants 1 + False, # two constants 2 + [1, self.point] # in where clause + ] + self.geomRelationFunc_test('ST_ContainsProperly', expectedResults) + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tools/shell/CMakeLists.txt b/tools/shell/CMakeLists.txt index 7b1dc3a541..acc47d4910 100644 --- a/tools/shell/CMakeLists.txt +++ b/tools/shell/CMakeLists.txt @@ -40,7 +40,7 @@ endif () target_link_libraries( shell - PRIVATE os common transport util + PRIVATE os common transport geometry util ) target_include_directories( diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index e2752f7899..7b30052659 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -20,6 +20,7 @@ #define _DEFAULT_SOURCE #include "shellInt.h" #include "shellAuto.h" +#include "geosWrapper.h" static bool shellIsEmptyCommand(const char *cmd); static int32_t shellRunSingleCommand(char *command); @@ -29,6 +30,7 @@ static void shellRunSingleCommandImp(char *command); static char *shellFormatTimestamp(char *buf, int64_t val, int32_t precision); static int32_t shellDumpResultToFile(const char *fname, TAOS_RES *tres); static void shellPrintNChar(const char *str, int32_t length, int32_t width); +static void shellPrintGeometry(const unsigned char *str, int32_t length, int32_t width); static int32_t shellVerticalPrintResult(TAOS_RES *tres, const char *sql); static int32_t shellHorizontalPrintResult(TAOS_RES *tres, const char *sql); static int32_t shellDumpResult(TAOS_RES *tres, char *fname, int32_t *error_no, bool vertical, const char *sql); @@ -306,6 +308,15 @@ char *shellFormatTimestamp(char *buf, int64_t val, int32_t precision) { return buf; } +char *shellDumpHexValue(char *buf, const char *val, int32_t length) { + for (int32_t i = 0; i < length; i++) { + sprintf(buf + (i * 2), "%02X", val[i]); + } + buf[length * 2] = 0; + + return buf; +} + void shellDumpFieldToFile(TdFilePtr pFile, const char *val, TAOS_FIELD *field, int32_t length, int32_t precision) { if (val == NULL) { taosFprintfFile(pFile, "NULL"); @@ -384,6 +395,10 @@ void shellDumpFieldToFile(TdFilePtr pFile, const char *val, TAOS_FIELD *field, i taosFprintfFile(pFile, "%s%s%s", quotationStr, buf, quotationStr); } break; + case TSDB_DATA_TYPE_GEOMETRY: + shellDumpHexValue(buf, val, length); + taosFprintfFile(pFile, "%s", buf); + break; case TSDB_DATA_TYPE_TIMESTAMP: shellFormatTimestamp(buf, *(int64_t *)val, precision); taosFprintfFile(pFile, "%s%s%s", quotationStr, buf, quotationStr); @@ -507,16 +522,53 @@ void shellPrintNChar(const char *str, int32_t length, int32_t width) { } } +void shellPrintString(const char *str, int32_t width) { + int32_t len = strlen(str); + + if (width == 0) { + printf("%s", str); + } + else if (len > width) { + if (width <= 3) { + printf("%.*s.", width - 1, str); + } + else { + printf("%.*s...", width - 3, str); + } + } else { + printf("%s%*.s", str, width - len, ""); + } +} + +void shellPrintGeometry(const unsigned char *val, int32_t length, int32_t width) { + if (length == 0) { //empty value + shellPrintString("", width); + return; + } + + int32_t code = TSDB_CODE_FAILED; + + code = initCtxAsText(); + if (code != TSDB_CODE_SUCCESS) { + shellPrintString(getThreadLocalGeosCtx()->errMsg, width); + return; + } + + char *outputWKT = NULL; + code = doAsText(val, length, &outputWKT); + if (code != TSDB_CODE_SUCCESS) { + shellPrintString(getThreadLocalGeosCtx()->errMsg, width); //should NOT happen + return; + } + + shellPrintString(outputWKT, width); + + geosFreeBuffer(outputWKT); +} + void shellPrintField(const char *val, TAOS_FIELD *field, int32_t width, int32_t length, int32_t precision) { if (val == NULL) { - int32_t w = width; - if (field->type < TSDB_DATA_TYPE_TINYINT || field->type > TSDB_DATA_TYPE_DOUBLE) { - w = 0; - } - w = printf("%*s", w, TSDB_DATA_NULL_STR); - for (; w < width; w++) { - putchar(' '); - } + shellPrintString(TSDB_DATA_NULL_STR, width); return; } @@ -524,7 +576,7 @@ void shellPrintField(const char *val, TAOS_FIELD *field, int32_t width, int32_t char buf[TSDB_MAX_BYTES_PER_ROW]; switch (field->type) { case TSDB_DATA_TYPE_BOOL: - printf("%*s", width, ((((int32_t)(*((char *)val))) == 1) ? "true" : "false")); + shellPrintString(((((int32_t)(*((char *)val))) == 1) ? "true" : "false"), width); break; case TSDB_DATA_TYPE_TINYINT: printf("%*d", width, *((int8_t *)val)); @@ -580,6 +632,9 @@ void shellPrintField(const char *val, TAOS_FIELD *field, int32_t width, int32_t case TSDB_DATA_TYPE_JSON: shellPrintNChar(val, length, width); break; + case TSDB_DATA_TYPE_GEOMETRY: + shellPrintGeometry(val, length, width); + break; case TSDB_DATA_TYPE_TIMESTAMP: shellFormatTimestamp(buf, *(int64_t *)val, precision); printf("%s", buf); @@ -708,6 +763,7 @@ int32_t shellCalcColWidth(TAOS_FIELD *field, int32_t precision) { return TMAX(25, width); case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_GEOMETRY: if (field->bytes > shell.args.displayWidth) { return TMAX(shell.args.displayWidth, width); } else { @@ -1089,6 +1145,7 @@ void *shellThreadLoop(void *arg) { taosResetTerminalMode(); } while (shellRunCommand(command, true) == 0); + destroyThreadLocalGeosCtx(); taosMemoryFreeClear(command); shellWriteHistory(); shellExit(); diff --git a/utils/test/c/tmqSim.c b/utils/test/c/tmqSim.c index d98a45f0d3..dd6875185f 100644 --- a/utils/test/c/tmqSim.c +++ b/utils/test/c/tmqSim.c @@ -542,7 +542,8 @@ static void shellDumpFieldToFile(TdFilePtr pFile, const char* val, TAOS_FIELD* f break; case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_NCHAR: - case TSDB_DATA_TYPE_JSON: { + case TSDB_DATA_TYPE_JSON: + case TSDB_DATA_TYPE_GEOMETRY: { int32_t bufIndex = 0; for (int32_t i = 0; i < length; i++) { buf[bufIndex] = val[i]; diff --git a/utils/tsim/src/simExe.c b/utils/tsim/src/simExe.c index 1be28635ef..c1f0f502f3 100644 --- a/utils/tsim/src/simExe.c +++ b/utils/tsim/src/simExe.c @@ -752,6 +752,7 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) { break; case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: if (length[i] < 0 || length[i] > 1 << 20) { fprintf(stderr, "Invalid length(%d) of BINARY or NCHAR\n", length[i]); exit(-1); From 81af19af85341d8c3947d1b229e66cc30e4bf36a Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Wed, 24 May 2023 16:03:55 +0800 Subject: [PATCH 10/12] docs: update readme with geos (#21453) * docs: update readme with libgflags * docs: update readme with geos --- README-CN.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README-CN.md b/README-CN.md index aa52f38f0e..6c49ce0727 100644 --- a/README-CN.md +++ b/README-CN.md @@ -117,7 +117,7 @@ scl enable devtoolset-9 -- bash ### macOS ``` -brew install argp-standalone pkgconfig +brew install argp-standalone pkgconfig geos ``` ### 设置 golang 开发环境 diff --git a/README.md b/README.md index 50785dbb8e..2f1650c3c9 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ scl enable devtoolset-9 -- bash ### macOS ``` -brew install argp-standalone pkgconfig +brew install argp-standalone pkgconfig geos ``` ### Setup golang environment From ab017bc747343847e44fea1d86629b1be86190c6 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Wed, 24 May 2023 16:29:52 +0800 Subject: [PATCH 11/12] docs: remove geometry docs (#21454) * docs: update readme with libgflags * docs: update readme with geos * docs: remove geometry docs --- docs/en/12-taos-sql/01-data-type.md | 2 - docs/en/12-taos-sql/11-geometry-function.md | 160 -------------------- 2 files changed, 162 deletions(-) delete mode 100644 docs/en/12-taos-sql/11-geometry-function.md diff --git a/docs/en/12-taos-sql/01-data-type.md b/docs/en/12-taos-sql/01-data-type.md index a870d7b530..70bea97dba 100644 --- a/docs/en/12-taos-sql/01-data-type.md +++ b/docs/en/12-taos-sql/01-data-type.md @@ -42,8 +42,6 @@ In TDengine, the data types below can be used when specifying a column or tag. | 14 | NCHAR | User Defined | Multi-byte string that can include multi byte characters like Chinese characters. Each character of NCHAR type consumes 4 bytes storage. The string value should be quoted with single quotes. Literal single quote inside the string must be preceded with backslash, like `\'`. The length must be specified when defining a column or tag of NCHAR type, for example nchar(10) means it can store at most 10 characters of nchar type and will consume fixed storage of 40 bytes. An error will be reported if the string value exceeds the length defined. | | 15 | JSON | | JSON type can only be used on tags. A tag of json type is excluded with any other tags of any other type. | | 16 | VARCHAR | User-defined | Alias of BINARY | -| 17 | GEOMETRY | User-defined | Geometry data type, like POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION. | - :::note - Only ASCII visible characters are suggested to be used in a column or tag of BINARY type. Multi-byte characters must be stored in NCHAR type. diff --git a/docs/en/12-taos-sql/11-geometry-function.md b/docs/en/12-taos-sql/11-geometry-function.md deleted file mode 100644 index 4f9f9ce56d..0000000000 --- a/docs/en/12-taos-sql/11-geometry-function.md +++ /dev/null @@ -1,160 +0,0 @@ ---- -sidebar_label: Geometry Functions -title: Geometry Functions -toc_max_heading_level: 4 ---- - -## Geometry Input Functions - -Geometry input functions create geometry data from WTK. - -### ST_GeomFromText - -```sql -ST_GeomFromText(VARCHAR WKT expr) -``` - -**Description**: Return a specified GEOMETRY value from Well-Known Text representation (WKT). - -**Return value type**: GEOMETRY - -**Applicable data types**: VARCHAR - -**Applicable table types**: standard tables and supertables - -**Explanations**: -- The input can be one of WTK string, like POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION. -- The output is a GEOMETRY data type, internal defined as binary string. - -## Geometry Output Functions - -Geometry output functions convert geometry data into WTK. - -### ST_AsText - -```sql -ST_AsText(GEOMETRY geom) -``` - -**Description**: Return a specified Well-Known Text representation (WKT) value from GEOMETRY data. - -**Return value type**: VARCHAR - -**Applicable data types**: GEOMETRY - -**Applicable table types**: standard tables and supertables - -**Explanations**: -- The output can be one of WTK string, like POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION. - -## Geometry Relationships Functions - -Geometry relationships functions determine spatial relationships between geometries. - -### ST_Intersects - -```sql -ST_Intersects(GEOMETRY geomA, GEOMETRY geomB) -``` - -**Description**: Compares two geometries and returns true if they intersect. - -**Return value type**: BOOL - -**Applicable data types**: GEOMETRY, GEOMETRY - -**Applicable table types**: standard tables and supertables - -**Explanations**: -- Geometries intersect if they have any point in common. - - -### ST_Equals - -```sql -ST_Equals(GEOMETRY geomA, GEOMETRY geomB) -``` - -**Description**: Returns TRUE if the given geometries are "spatially equal". - -**Return value type**: BOOL - -**Applicable data types**: GEOMETRY, GEOMETRY - -**Applicable table types**: standard tables and supertables - -**Explanations**: -- 'Spatially equal' means ST_Contains(A,B) = true and ST_Contains(B,A) = true, and the ordering of points can be different but represent the same geometry structure. - - -### ST_Touches - -```sql -ST_Touches(GEOMETRY geomA, GEOMETRY geomB) -``` - -**Description**: Returns TRUE if A and B intersect, but their interiors do not intersect. - -**Return value type**: BOOL - -**Applicable data types**: GEOMETRY, GEOMETRY - -**Applicable table types**: standard tables and supertables - -**Explanations**: -- A and B have at least one point in common, and the common points lie in at least one boundary. -- For Point/Point inputs the relationship is always FALSE, since points do not have a boundary. - - -### ST_Covers - -```sql -ST_Covers(GEOMETRY geomA, GEOMETRY geomB) -``` - -**Description**: Returns TRUE if every point in Geometry B lies inside (intersects the interior or boundary of) Geometry A. - -**Return value type**: BOOL - -**Applicable data types**: GEOMETRY, GEOMETRY - -**Applicable table types**: standard tables and supertables - -**Explanations**: -- A covers B means no point of B lies outside (in the exterior of) A. - - -### ST_Contains - -```sql -ST_Contains(GEOMETRY geomA, GEOMETRY geomB) -``` - -**Description**: Returns TRUE if geometry A contains geometry B. - -**Return value type**: BOOL - -**Applicable data types**: GEOMETRY, GEOMETRY - -**Applicable table types**: standard tables and supertables - -**Explanations**: -- A contains B if and only if all points of B lie inside (i.e. in the interior or boundary of) A (or equivalently, no points of B lie in the exterior of A), and the interiors of A and B have at least one point in common. - - -### ST_ContainsProperly - -```sql -ST_ContainsProperly(GEOMETRY geomA, GEOMETRY geomB) -``` - -**Description**: Returns TRUE if every point of B lies inside A. - -**Return value type**: BOOL - -**Applicable data types**: GEOMETRY, GEOMETRY - -**Applicable table types**: standard tables and supertables - -**Explanations**: -- There is no point of B lies in the the boundary or exterior of A. From 61df1a1b211be03ad119c7f14861dc4ea15fc294 Mon Sep 17 00:00:00 2001 From: huolibo Date: Wed, 24 May 2023 17:23:31 +0800 Subject: [PATCH 12/12] enh: stmt insert demo --- .../com/taos/example/StmtInsertExample.java | 104 +++++++++++------- 1 file changed, 65 insertions(+), 39 deletions(-) diff --git a/docs/examples/java/src/main/java/com/taos/example/StmtInsertExample.java b/docs/examples/java/src/main/java/com/taos/example/StmtInsertExample.java index bbcc92b22f..72d4ecc725 100644 --- a/docs/examples/java/src/main/java/com/taos/example/StmtInsertExample.java +++ b/docs/examples/java/src/main/java/com/taos/example/StmtInsertExample.java @@ -6,39 +6,32 @@ import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; +import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Comparator; import java.util.List; +import java.util.Random; +import java.util.stream.Collectors; public class StmtInsertExample { - private static ArrayList tsToLongArray(String ts) { - ArrayList result = new ArrayList<>(); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); - LocalDateTime localDateTime = LocalDateTime.parse(ts, formatter); - result.add(localDateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli()); - return result; - } + private static String datePattern = "yyyy-MM-dd HH:mm:ss.SSS"; + private static DateTimeFormatter formatter = DateTimeFormatter.ofPattern(datePattern); - private static ArrayList toArray(T v) { - ArrayList result = new ArrayList<>(); - result.add(v); - return result; - } - - private static List getRawData() { - return Arrays.asList( - "d1001,2018-10-03 14:38:05.000,10.30000,219,0.31000,California.SanFrancisco,2", - "d1001,2018-10-03 14:38:15.000,12.60000,218,0.33000,California.SanFrancisco,2", - "d1001,2018-10-03 14:38:16.800,12.30000,221,0.31000,California.SanFrancisco,2", - "d1002,2018-10-03 14:38:16.650,10.30000,218,0.25000,California.SanFrancisco,3", - "d1003,2018-10-03 14:38:05.500,11.80000,221,0.28000,California.LosAngeles,2", - "d1003,2018-10-03 14:38:16.600,13.40000,223,0.29000,California.LosAngeles,2", - "d1004,2018-10-03 14:38:05.000,10.80000,223,0.29000,California.LosAngeles,3", - "d1004,2018-10-03 14:38:06.500,11.50000,221,0.35000,California.LosAngeles,3" - ); + private static List getRawData(int size) { + SimpleDateFormat format = new SimpleDateFormat(datePattern); + List result = new ArrayList<>(); + long current = System.currentTimeMillis(); + Random random = new Random(); + for (int i = 0; i < size; i++) { + String time = format.format(current + i); + int id = random.nextInt(10); + result.add("d" + id + "," + time + ",10.30000,219,0.31000,California.SanFrancisco,2"); + } + return result.stream() + .sorted(Comparator.comparing(s -> s.split(",")[0])).collect(Collectors.toList()); } private static Connection getConnection() throws SQLException { @@ -48,9 +41,9 @@ public class StmtInsertExample { private static void createTable(Connection conn) throws SQLException { try (Statement stmt = conn.createStatement()) { - stmt.execute("CREATE DATABASE power KEEP 3650"); - stmt.executeUpdate("USE power"); - stmt.execute("CREATE STABLE meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) " + + stmt.execute("CREATE DATABASE if not exists power KEEP 3650"); + stmt.executeUpdate("use power"); + stmt.execute("CREATE STABLE if not exists meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) " + "TAGS (location BINARY(64), groupId INT)"); } } @@ -58,21 +51,54 @@ public class StmtInsertExample { private static void insertData() throws SQLException { try (Connection conn = getConnection()) { createTable(conn); - String psql = "INSERT INTO ? USING meters TAGS(?, ?) VALUES(?, ?, ?, ?)"; + String psql = "INSERT INTO ? USING power.meters TAGS(?, ?) VALUES(?, ?, ?, ?)"; try (TSDBPreparedStatement pst = (TSDBPreparedStatement) conn.prepareStatement(psql)) { - for (String line : getRawData()) { + String tableName = null; + ArrayList ts = new ArrayList<>(); + ArrayList current = new ArrayList<>(); + ArrayList voltage = new ArrayList<>(); + ArrayList phase = new ArrayList<>(); + for (String line : getRawData(100000)) { String[] ps = line.split(","); - // bind table name and tags - pst.setTableName(ps[0]); - pst.setTagString(0, ps[5]); - pst.setTagInt(1, Integer.valueOf(ps[6])); + if (tableName == null) { + // bind table name and tags + tableName = "power." + ps[0]; + pst.setTableName(ps[0]); + pst.setTagString(0, ps[5]); + pst.setTagInt(1, Integer.valueOf(ps[6])); + } else { + if (!tableName.equals(ps[0])) { + pst.setTimestamp(0, ts); + pst.setFloat(1, current); + pst.setInt(2, voltage); + pst.setFloat(3, phase); + pst.columnDataAddBatch(); + pst.columnDataExecuteBatch(); + + // bind table name and tags + tableName = ps[0]; + pst.setTableName(ps[0]); + pst.setTagString(0, ps[5]); + pst.setTagInt(1, Integer.valueOf(ps[6])); + ts.clear(); + current.clear(); + voltage.clear(); + phase.clear(); + } + } // bind values - pst.setTimestamp(0, tsToLongArray(ps[1])); //ps[1] looks like: 2018-10-03 14:38:05.000 - pst.setFloat(1, toArray(Float.valueOf(ps[2]))); - pst.setInt(2, toArray(Integer.valueOf(ps[3]))); - pst.setFloat(3, toArray(Float.valueOf(ps[4]))); - pst.columnDataAddBatch(); + // ps[1] looks like: 2018-10-03 14:38:05.000 + LocalDateTime localDateTime = LocalDateTime.parse(ps[1], formatter); + ts.add(localDateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli()); + current.add(Float.valueOf(ps[2])); + voltage.add(Integer.valueOf(ps[3])); + phase.add(Float.valueOf(ps[4])); } + pst.setTimestamp(0, ts); + pst.setFloat(1, current); + pst.setInt(2, voltage); + pst.setFloat(3, phase); + pst.columnDataAddBatch(); pst.columnDataExecuteBatch(); } }