diff --git a/cmake/cmake.version b/cmake/cmake.version index fcb31adc39bfb4b95519bdf4b1a426fa7256ba3f..05094f10cccea02ecb6a9cc4b9283335cb4424b6 100644 --- a/cmake/cmake.version +++ b/cmake/cmake.version @@ -2,7 +2,7 @@ IF (DEFINED VERNUMBER) SET(TD_VER_NUMBER ${VERNUMBER}) ELSE () - SET(TD_VER_NUMBER "3.0.1.2") + SET(TD_VER_NUMBER "3.0.1.4") ENDIF () IF (DEFINED VERCOMPATIBLE) diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index 448c2b99c013da6880631c514bc24cf577fdc002..5d2fcf27b2ea091b1b6dcfe32e474c410d83f2e5 100644 --- a/cmake/taostools_CMakeLists.txt.in +++ b/cmake/taostools_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taos-tools ExternalProject_Add(taos-tools GIT_REPOSITORY https://github.com/taosdata/taos-tools.git - GIT_TAG f03c09a + GIT_TAG 70f5a1c SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/docs/en/07-develop/03-insert-data/02-influxdb-line.mdx b/docs/en/07-develop/03-insert-data/02-influxdb-line.mdx index 11db3daeb054b2cac29c6a0ccde2add27774f3da..c91dbba5d2786f8a5a78ed77c105e3661ae8641f 100644 --- a/docs/en/07-develop/03-insert-data/02-influxdb-line.mdx +++ b/docs/en/07-develop/03-insert-data/02-influxdb-line.mdx @@ -37,7 +37,8 @@ meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0 - All the data in `tag_set` will be converted to nchar type automatically . - Each data in `field_set` must be self-descriptive for its data type. For example 1.2f32 means a value 1.2 of float type. Without the "f" type suffix, it will be treated as type double. - Multiple kinds of precision can be used for the `timestamp` field. Time precision can be from nanosecond (ns) to hour (h). - +- You can configure smlChildTableName in taos.cfg to specify table names, for example, `smlChildTableName=tname`. You can insert `st,tname=cpul,t1=4 c1=3 1626006833639000000` and the cpu1 table will be automatically created. Note that if multiple rows have the same tname but different tag_set values, the tag_set of the first row is used to create the table and the others are ignored. +- It is assumed that the order of field_set in a supertable is consistent, meaning that the first record contains all fields and subsequent records store fields in the same order. If the order is not consistent, set smlDataFormat in taos.cfg to false. Otherwise, data will be written out of order and a database error will occur.(smlDataFormat in taos.cfg default to false after version of 3.0.1.3) ::: For more details please refer to [InfluxDB Line Protocol](https://docs.influxdata.com/influxdb/v2.0/reference/syntax/line-protocol/) and [TDengine Schemaless](/reference/schemaless/#Schemaless-Line-Protocol) @@ -64,3 +65,7 @@ For more details please refer to [InfluxDB Line Protocol](https://docs.influxdat + +## Query Examples +If you want query the data of `location=California.LosAngeles,groupid=2`,here is the query sql: +select * from `meters.voltage` where location="California.LosAngeles" and groupid=2 diff --git a/docs/en/07-develop/03-insert-data/03-opentsdb-telnet.mdx b/docs/en/07-develop/03-insert-data/03-opentsdb-telnet.mdx index db9bfd73649709cf806ae6499513191db8321107..d88a6335cb52602c371cb677afa1488d746cab95 100644 --- a/docs/en/07-develop/03-insert-data/03-opentsdb-telnet.mdx +++ b/docs/en/07-develop/03-insert-data/03-opentsdb-telnet.mdx @@ -31,7 +31,7 @@ For example: ```txt meters.current 1648432611250 11.3 location=California.LosAngeles groupid=3 ``` - +- The defult child table name is generated by rules.You can configure smlChildTableName in taos.cfg to specify chile table names, for example, `smlChildTableName=tname`. You can insert `meters.current 1648432611250 11.3 tname=cpu1 location=California.LosAngeles groupid=3` and the cpu1 table will be automatically created. Note that if multiple rows have the same tname but different tag_set values, the tag_set of the first row is used to create the table and the others are ignored. Please refer to [OpenTSDB Telnet API](http://opentsdb.net/docs/build/html/api_telnet/put.html) for more details. ## Examples @@ -79,3 +79,6 @@ taos> select tbname, * from `meters.current`; t_7e7b26dd860280242c6492a16... | 2022-03-28 09:56:51.250 | 12.600000000 | 2 | California.SanFrancisco | Query OK, 4 row(s) in set (0.005399s) ``` +## Query Examples +If you want query the data of `location=California.LosAngeles groupid=3`,here is the query sql: +select * from `meters.voltage` where location="California.LosAngeles" and groupid=3 diff --git a/docs/en/07-develop/03-insert-data/04-opentsdb-json.mdx b/docs/en/07-develop/03-insert-data/04-opentsdb-json.mdx index 23703f4087483373a15e9cf7604bb67ca62888f5..e2e6d6fc9f099485a6bb9c3bf8d8ea580be824de 100644 --- a/docs/en/07-develop/03-insert-data/04-opentsdb-json.mdx +++ b/docs/en/07-develop/03-insert-data/04-opentsdb-json.mdx @@ -48,7 +48,7 @@ Please refer to [OpenTSDB HTTP API](http://opentsdb.net/docs/build/html/api_http - In JSON protocol, strings will be converted to nchar type and numeric values will be converted to double type. - Only data in array format is accepted and so an array must be used even if there is only one row. - +- The defult child table name is generated by rules.You can configure smlChildTableName in taos.cfg to specify chile table names, for example, `smlChildTableName=tname`. You can insert `"tags": { "host": "web02","dc": "lga","tname":"cpu1"}` and the cpu1 table will be automatically created. Note that if multiple rows have the same tname but different tag_set values, the tag_set of the first row is used to create the table and the others are ignored. ::: ## Examples @@ -94,3 +94,6 @@ taos> select * from `meters.current`; 2022-03-28 09:56:51.250 | 12.600000000 | 2.000000000 | California.SanFrancisco | Query OK, 2 row(s) in set (0.004076s) ``` +## Query Examples +If you want query the data of "tags": {"location": "California.LosAngeles", "groupid": 1},here is the query sql: +select * from `meters.voltage` where location="California.LosAngeles" and groupid=1 diff --git a/docs/en/12-taos-sql/06-select.md b/docs/en/12-taos-sql/06-select.md index 786444ad77a4ba8cd3c4729863dfae0a53cef798..c065245827f8e7edbb0297abef4aa9e5de4a45cc 100644 --- a/docs/en/12-taos-sql/06-select.md +++ b/docs/en/12-taos-sql/06-select.md @@ -181,6 +181,14 @@ In TDengine, the first column of all tables must be a timestamp. This column is select _rowts, max(current) from meters; ``` +**\_IROWTS** + +The \_IROWTS pseudocolumn can only be used with INTERP function. This pseudocolumn can be used to retrieve the corresponding timestamp column associated with the interpolation results. + +```sql +select _irowts, interp(current) from meters range('2020-01-01 10:00:00', '2020-01-01 10:30:00') every(1s) fill(linear); +``` + ## Query Objects `FROM` can be followed by a number of tables or super tables, or can be followed by a sub-query. diff --git a/docs/en/12-taos-sql/10-function.md b/docs/en/12-taos-sql/10-function.md index 14dedfb216086c6b122079f6dd16b1e91364e08d..243ede5fcbe157c933b655fe91e95d1d87084a7e 100644 --- a/docs/en/12-taos-sql/10-function.md +++ b/docs/en/12-taos-sql/10-function.md @@ -867,6 +867,7 @@ INTERP(expr) - The number of rows in the result set of `INTERP` is determined by the parameter `EVERY`. Starting from timestamp1, one interpolation is performed for every time interval specified `EVERY` parameter. - Interpolation is performed based on `FILL` parameter. - `INTERP` can only be used to interpolate in single timeline. So it must be used with `partition by tbname` when it's used on a STable. +- Pseudo column `_irowts` can be used along with `INTERP` to return the timestamps associated with interpolation points(support after version 3.0.1.4). ### LAST diff --git a/docs/en/12-taos-sql/20-keywords.md b/docs/en/12-taos-sql/20-keywords.md index f7eb067c960cd9599153a208cd2781b49b090511..4b479b866b77e1e354d20376ccb869755af76d00 100644 --- a/docs/en/12-taos-sql/20-keywords.md +++ b/docs/en/12-taos-sql/20-keywords.md @@ -343,6 +343,7 @@ The following list shows all reserved keywords: ### \_ - \_C0 +- \_IROWTS - \_QDURATION - \_QEND - \_QSTART diff --git a/docs/en/12-taos-sql/22-meta.md b/docs/en/12-taos-sql/22-meta.md index 9bda5a0a1027243ea5f50c55e303fdb7155c853b..0a597779466c3552c0653227e86831668a32fc4f 100644 --- a/docs/en/12-taos-sql/22-meta.md +++ b/docs/en/12-taos-sql/22-meta.md @@ -11,7 +11,15 @@ TDengine includes a built-in database named `INFORMATION_SCHEMA` to provide acce 4. Future versions of TDengine can add new columns to INFORMATION_SCHEMA tables without affecting existing business systems. 5. It is easier for users coming from other database management systems. For example, Oracle users can query data dictionary tables. -Note: SHOW statements are still supported for the convenience of existing users. +:::info + +- SHOW statements are still supported for the convenience of existing users. +- Some columns in the system table may be keywords, and you need to use the escape character '\`' when querying, for example, to query the VGROUPS in the database `test`: +```sql + select `vgroups` from ins_databases where name = 'test'; +``` + +::: This document introduces the tables of INFORMATION_SCHEMA and their structure. @@ -102,7 +110,11 @@ Provides information about user-created databases. Similar to SHOW DATABASES. | 24 | wal_retention_period | INT | WAL retention period | | 25 | wal_retention_size | INT | Maximum WAL size | | 26 | wal_roll_period | INT | WAL rotation period | -| 27 | wal_segment_size | WAL file size | +| 27 | wal_segment_size | BIGINT | WAL file size | +| 28 | stt_trigger | SMALLINT | The threshold for number of files to trigger file merging | +| 29 | table_prefix | SMALLINT | The prefix length in the table name that is ignored when distributing table to vnode based on table name | +| 30 | table_suffix | SMALLINT | The suffix length in the table name that is ignored when distributing table to vnode based on table name | +| 31 | tsdb_pagesize | INT | The page size for internal storage engine, its unit is KB | ## INS_FUNCTIONS diff --git a/docs/en/12-taos-sql/29-changes.md b/docs/en/12-taos-sql/29-changes.md index 8532eeac5d599ca2739393c9e38eec52631e407a..78b6d5fc05b9b03e1e8b3af268bc357dfaa401bc 100644 --- a/docs/en/12-taos-sql/29-changes.md +++ b/docs/en/12-taos-sql/29-changes.md @@ -11,12 +11,13 @@ description: "This document explains how TDengine SQL has changed in version 3.0 | 1 | VARCHAR | Added | Alias of BINARY. | 2 | TIMESTAMP literal | Added | TIMESTAMP 'timestamp format' syntax now supported. | 3 | _ROWTS pseudocolumn | Added | Indicates the primary key. Alias of _C0. -| 4 | INFORMATION_SCHEMA | Added | Database for system metadata containing all schema definitions -| 5 | PERFORMANCE_SCHEMA | Added | Database for system performance information. -| 6 | Connection queries | Deprecated | Connection queries are no longer supported. The syntax and interfaces are deprecated. -| 7 | Mixed operations | Enhanced | Mixing scalar and vector operations in queries has been enhanced and is supported in all SELECT clauses. -| 8 | Tag operations | Added | Tag columns can be used in queries and clauses like data columns. -| 9 | Timeline clauses and time functions in supertables | Enhanced | When PARTITION BY is not used, data in supertables is merged into a single timeline. +| 4 | _IROWTS pseudocolumn | Added | Used to retrieve timestamps with INTERP function. +| 5 | INFORMATION_SCHEMA | Added | Database for system metadata containing all schema definitions +| 6 | PERFORMANCE_SCHEMA | Added | Database for system performance information. +| 7 | Connection queries | Deprecated | Connection queries are no longer supported. The syntax and interfaces are deprecated. +| 8 | Mixed operations | Enhanced | Mixing scalar and vector operations in queries has been enhanced and is supported in all SELECT clauses. +| 9 | Tag operations | Added | Tag columns can be used in queries and clauses like data columns. +| 10 | Timeline clauses and time functions in supertables | Enhanced | When PARTITION BY is not used, data in supertables is merged into a single timeline. ## SQL Syntax diff --git a/docs/en/14-reference/03-connector/04-java.mdx b/docs/en/14-reference/03-connector/04-java.mdx index 129d90ea85d9455c1ae460b3799b5253dd3a49fc..c032687d0ff979aea52faad9cdef2413756280e5 100644 --- a/docs/en/14-reference/03-connector/04-java.mdx +++ b/docs/en/14-reference/03-connector/04-java.mdx @@ -109,7 +109,7 @@ TDengine's JDBC URL specification format is: For establishing connections, native connections differ slightly from REST connections. - + ```java diff --git a/docs/en/14-reference/03-connector/05-go.mdx b/docs/en/14-reference/03-connector/05-go.mdx index 518d3625d54492c2b6ec209302ac91ca32d03ad2..f00e635af9bdda737f752208f4b34c9ff634d075 100644 --- a/docs/en/14-reference/03-connector/05-go.mdx +++ b/docs/en/14-reference/03-connector/05-go.mdx @@ -113,7 +113,7 @@ username:password@protocol(address)/dbname?param=value ``` ### Connecting via connector - + _taosSql_ implements Go's `database/sql/driver` interface via cgo. You can use the [`database/sql`](https://golang.org/pkg/database/sql/) interface by simply introducing the driver. diff --git a/docs/en/14-reference/03-connector/06-rust.mdx b/docs/en/14-reference/03-connector/06-rust.mdx index edc3016cde6b694668960fb969c53af302b3c963..4e2a7848dc87ac0522b6d5aa5855b5a0998dc789 100644 --- a/docs/en/14-reference/03-connector/06-rust.mdx +++ b/docs/en/14-reference/03-connector/06-rust.mdx @@ -55,26 +55,28 @@ taos = "*" - + -In `cargo.toml`, add [taos][taos] and enable the native feature: +In `cargo.toml`, add [taos][taos] and enable the ws feature: ```toml [dependencies] -taos = { version = "*", default-features = false, features = ["native"] } +taos = { version = "*", default-features = false, features = ["ws"] } ``` - -In `cargo.toml`, add [taos][taos] and enable the ws feature: + + +In `cargo.toml`, add [taos][taos] and enable the native feature: ```toml [dependencies] -taos = { version = "*", default-features = false, features = ["ws"] } +taos = { version = "*", default-features = false, features = ["native"] } ``` + ## Establishing a connection diff --git a/docs/en/14-reference/03-connector/07-python.mdx b/docs/en/14-reference/03-connector/07-python.mdx index d92a93fd4fd79bfa449249a16e87268b924c8475..1e7945bfd293ee5c9b4f6329efe3dd99749591b4 100644 --- a/docs/en/14-reference/03-connector/07-python.mdx +++ b/docs/en/14-reference/03-connector/07-python.mdx @@ -80,7 +80,7 @@ pip3 install git+https://github.com/taosdata/taos-connector-python.git ### Verify - + For native connection, you need to verify that both the client driver and the Python connector itself are installed correctly. The client driver and Python connector have been installed properly if you can successfully import the `taos` module. In the Python Interactive Shell, you can type. @@ -118,7 +118,7 @@ Requirement already satisfied: taospy in c:\users\username\appdata\local\program Before establishing a connection with the connector, we recommend testing the connectivity of the local TDengine CLI to the TDengine cluster. - + Ensure that the TDengine instance is up and that the FQDN of the machines in the cluster (the FQDN defaults to hostname if you are starting a standalone version) can be resolved locally, by testing with the `ping` command. @@ -173,7 +173,7 @@ If the test is successful, it will output the server version information, e.g. The following example code assumes that TDengine is installed locally and that the default configuration is used for both FQDN and serverPort. - + ```python @@ -219,7 +219,7 @@ All arguments to the `connect()` function are optional keyword arguments. The fo ### Basic Usage - + ##### TaosConnection class @@ -289,7 +289,7 @@ For a more detailed description of the `sql()` method, please refer to [RestClie ### Used with pandas - + ```python diff --git a/docs/en/14-reference/03-connector/08-node.mdx b/docs/en/14-reference/03-connector/08-node.mdx index bf7c6b95ea67dc8bf8fa1277591b549a2fd6322d..a36cf0efc9432425ad16c4d8112cc813a8c528b9 100644 --- a/docs/en/14-reference/03-connector/08-node.mdx +++ b/docs/en/14-reference/03-connector/08-node.mdx @@ -85,7 +85,7 @@ If using ARM64 Node.js on Windows 10 ARM, you must add "Visual C++ compilers and ### Install via npm - + ```bash @@ -124,7 +124,7 @@ node nodejsChecker.js host=localhost Please choose to use one of the connectors. - + Install and import the `@tdengine/client` package. diff --git a/docs/en/14-reference/03-connector/09-csharp.mdx b/docs/en/14-reference/03-connector/09-csharp.mdx index 87a10e17cafa2578b76ca768eb51f8d784fc6e7f..85514f58ac1a19c7ae1a725e9b055f10280ebbb6 100644 --- a/docs/en/14-reference/03-connector/09-csharp.mdx +++ b/docs/en/14-reference/03-connector/09-csharp.mdx @@ -97,7 +97,7 @@ dotnet add exmaple.csproj reference src/TDengine.csproj ## Establish a Connection - + @@ -173,7 +173,7 @@ ws://localhost:6041/test #### SQL Write - + @@ -204,7 +204,7 @@ ws://localhost:6041/test #### Parameter Binding - + @@ -227,7 +227,7 @@ ws://localhost:6041/test #### Synchronous Query - + diff --git a/docs/en/14-reference/12-config/index.md b/docs/en/14-reference/12-config/index.md index 5ab6f59454efd15aaa80a6dddc7626cab2dc8d88..726a1ccd69389b48e0d1f9075e316fd58034c012 100644 --- a/docs/en/14-reference/12-config/index.md +++ b/docs/en/14-reference/12-config/index.md @@ -177,12 +177,21 @@ The parameters described in this document by the effect that they have on the sy ### maxNumOfDistinctRes | Attribute | Description | -| -------- | -------------------------------- | --- | +| -------- | -------------------------------- | | Applicable | Server Only | | Meaning | The maximum number of distinct rows returned | | Value Range | [100,000 - 100,000,000] | | Default Value | 100,000 | +### keepColumnName + +| Attribute | Description | +| -------- | -------------------------------- | +| Applicable | Client only | +| Meaning | When the Last, First, LastRow function is queried, whether the returned column name contains the function name. | +| Value Range | 0 means including the function name, 1 means not including the function name. | +| Default Value | 0 | + ## Locale Parameters ### timezone diff --git a/docs/en/14-reference/13-schemaless/13-schemaless.md b/docs/en/14-reference/13-schemaless/13-schemaless.md index 4f50c38cbbfda9d8d8567517f9109f18e2007988..5b7924ce56b240d34ab139f6160839a56438dc6b 100644 --- a/docs/en/14-reference/13-schemaless/13-schemaless.md +++ b/docs/en/14-reference/13-schemaless/13-schemaless.md @@ -47,9 +47,8 @@ In the schemaless writing data line protocol, each data item in the field_set ne - `t`, `T`, `true`, `True`, `TRUE`, `f`, `F`, `false`, and `False` will be handled directly as BOOL types. -For example, the following data rows indicate that the t1 label is "3" (NCHAR), the t2 label is "4" (NCHAR), and the t3 label -is "t3" to the super table named `st` labeled "t3" (NCHAR), write c1 column as 3 (BIGINT), c2 column as false (BOOL), c3 column -is "passit" (BINARY), c4 column is 4 (DOUBLE), and the primary key timestamp is 1626006833639000000 in one row. +For example, the following data rows write c1 column as 3 (BIGINT), c2 column as false (BOOL), c3 column +as "passit" (BINARY), c4 column as 4 (DOUBLE), and the primary key timestamp as 1626006833639000000 to child table with the t1 label as "3" (NCHAR), the t2 label as "4" (NCHAR), and the t3 label as "t3" (NCHAR) and the super table named `st`. ```json st,t1=3,t2=4,t3=t3 c1=3i64,c3="passit",c2=false,c4=4f64 1626006833639000000 @@ -69,7 +68,7 @@ Schemaless writes process row data according to the following principles. Note that tag_key1, tag_key2 are not the original order of the tags entered by the user but the result of using the tag names in ascending order of the strings. Therefore, tag_key1 is not the first tag entered in the line protocol. The string's MD5 hash value "md5_val" is calculated after the ranking is completed. The calculation result is then combined with the string to generate the table name: "t_md5_val". "t_" is a fixed prefix that every table generated by this mapping relationship has. -You can configure smlChildTableName to specify table names, for example, `smlChildTableName=tname`. You can insert `st,tname=cpul,t1=4 c1=3 1626006833639000000` and the cpu1 table will be automatically created. Note that if multiple rows have the same tname but different tag_set values, the tag_set of the first row is used to create the table and the others are ignored. +You can configure smlChildTableName in taos.cfg to specify table names, for example, `smlChildTableName=tname`. You can insert `st,tname=cpul,t1=4 c1=3 1626006833639000000` and the cpu1 table will be automatically created. Note that if multiple rows have the same tname but different tag_set values, the tag_set of the first row is used to create the table and the others are ignored. 2. If the super table obtained by parsing the line protocol does not exist, this super table is created. 3. If the subtable obtained by the parse line protocol does not exist, Schemaless creates the sub-table according to the subtable name determined in steps 1 or 2. @@ -78,7 +77,7 @@ You can configure smlChildTableName to specify table names, for example, `smlChi NULL. 6. For BINARY or NCHAR columns, if the length of the value provided in a data row exceeds the column type limit, the maximum length of characters allowed to be stored in the column is automatically increased (only incremented and not decremented) to ensure complete preservation of the data. 7. Errors encountered throughout the processing will interrupt the writing process and return an error code. -8. It is assumed that the order of field_set in a supertable is consistent, meaning that the first record contains all fields and subsequent records store fields in the same order. If the order is not consistent, set smlDataFormat to false. Otherwise, data will be written out of order and a database error will occur. +8. It is assumed that the order of field_set in a supertable is consistent, meaning that the first record contains all fields and subsequent records store fields in the same order. If the order is not consistent, set smlDataFormat in taos.cfg to false. Otherwise, data will be written out of order and a database error will occur.(smlDataFormat in taos.cfg default to false after version of 3.0.1.3) :::tip All processing logic of schemaless will still follow TDengine's underlying restrictions on data structures, such as the total length of each row of data cannot exceed diff --git a/docs/en/14-reference/_telegraf.mdx b/docs/en/14-reference/_telegraf.mdx index e32fb256936a5f2c00bbb3f37529e895d260fc5c..bcf1a0893fff7c06127da9e8117a778a76bfb0d9 100644 --- a/docs/en/14-reference/_telegraf.mdx +++ b/docs/en/14-reference/_telegraf.mdx @@ -22,5 +22,4 @@ An example is as follows. username = "root" password = "taosdata" data_format = "influx" - influx_max_line_bytes = 250 ``` diff --git a/docs/en/20-third-party/02-prometheus.md b/docs/en/20-third-party/02-prometheus.md index 0fb41a169632a9d2775dfb3f48ea7254cf9a8558..c46b0381b988c5a8b208ca934d73aed47b527113 100644 --- a/docs/en/20-third-party/02-prometheus.md +++ b/docs/en/20-third-party/02-prometheus.md @@ -89,3 +89,7 @@ VALUE TIMESTAMP ``` +:::note + +- TDengine will automatically create unique IDs for sub-table names by the rule. +::: diff --git a/docs/en/20-third-party/03-telegraf.md b/docs/en/20-third-party/03-telegraf.md index 6a7aac322f9def880f58d7ed0adcc4a8f3687ed1..ab06ab037947a18d99f854d9279da9a83861e66d 100644 --- a/docs/en/20-third-party/03-telegraf.md +++ b/docs/en/20-third-party/03-telegraf.md @@ -15,6 +15,7 @@ To write Telegraf data to TDengine requires the following preparations. - The TDengine cluster is deployed and functioning properly - taosAdapter is installed and running properly. Please refer to the [taosAdapter manual](/reference/taosadapter) for details. - Telegraf has been installed. Please refer to the [official documentation](https://docs.influxdata.com/telegraf/v1.22/install/) for Telegraf installation. +- Telegraf collects the running status measurements of current system. You can enable [input plugins](https://docs.influxdata.com/telegraf/v1.22/plugins/) to insert [other formats](https://docs.influxdata.com/telegraf/v1.24/data_formats/input/) data to Telegraf then forward to TDengine. ## Configuration steps @@ -31,11 +32,12 @@ Use TDengine CLI to verify Telegraf correctly writing data to TDengine and read ``` taos> show databases; - name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | -==================================================================================================================================================================================================================================================================================== - telegraf | 2022-04-20 08:47:53.488 | 22 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | - log | 2022-04-20 07:19:50.260 | 9 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | -Query OK, 2 row(s) in set (0.002401s) + name | +================================= + information_schema | + performance_schema | + telegraf | +Query OK, 3 rows in database (0.010568s) taos> use telegraf; Database changed. @@ -65,3 +67,11 @@ taos> select * from telegraf.system limit 10; | Query OK, 3 row(s) in set (0.013269s) ``` + +:::note + +- TDengine take influxdb format data and create unique ID for table names by the rule. +The user can configure `smlChildTableName` parameter to generate specified table names if he/she needs. And he/she also need to insert data with specified data format. +For example, Add `smlChildTableName=tname` in the taos.cfg file. Insert data `st,tname=cpu1,t1=4 c1=3 1626006833639000000` then the table name will be cpu1. If there are multiple lines has same tname but different tag_set, the first line's tag_set will be used to automatically creating table and ignore other lines. Please refer to [TDengine Schemaless](/reference/schemaless/#Schemaless-Line-Protocol) +::: + diff --git a/docs/en/20-third-party/05-collectd.md b/docs/en/20-third-party/05-collectd.md index db62f2ecd1afb4936466ca0243a7e14ff294f8b6..295c08c307ad0ecbe5ee03fc1a24e12c277db6a3 100644 --- a/docs/en/20-third-party/05-collectd.md +++ b/docs/en/20-third-party/05-collectd.md @@ -72,3 +72,7 @@ taos> select * from collectd.memory_value limit 10; Query OK, 10 row(s) in set (0.010348s) ``` +:::note + +- TDengine will automatically create unique IDs for sub-table names by the rule. +::: diff --git a/docs/en/20-third-party/07-icinga2.md b/docs/en/20-third-party/07-icinga2.md index b27196dfe313b468eeb73ff4b114d9d955618c3e..e98f2098033d433c9db1ac7bf80ac8c3cc340a11 100644 --- a/docs/en/20-third-party/07-icinga2.md +++ b/docs/en/20-third-party/07-icinga2.md @@ -36,11 +36,12 @@ After waiting about 10 seconds, use the TDengine CLI to query TDengine to verify ``` taos> show databases; - name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | -==================================================================================================================================================================================================================================================================================== - log | 2022-04-20 07:19:50.260 | 11 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | - icinga2 | 2022-04-20 12:11:39.697 | 13 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | -Query OK, 2 row(s) in set (0.001867s) + name | +================================= + information_schema | + performance_schema | + icinga2 | +Query OK, 3 row(s) in set (0.001867s) taos> use icinga2; Database changed. @@ -72,3 +73,8 @@ taos> show stables; icinga.service.users.state | 2022-04-20 12:11:39.704 | 2 | 1 | 1 | Query OK, 22 row(s) in set (0.002317s) ``` + +:::note + +- TDengine will automatically create unique IDs for sub-table names by the rule. +::: diff --git a/docs/en/25-application/01-telegraf.md b/docs/en/25-application/01-telegraf.md index 59491152bcda3e26ec12aaa59ac1041ef23c4e7e..f7003264496e61f33e843a4c8f2ec8227ba571b6 100644 --- a/docs/en/25-application/01-telegraf.md +++ b/docs/en/25-application/01-telegraf.md @@ -60,7 +60,6 @@ For the configuration method, add the following text to `/etc/telegraf/telegraf. username = "" password = "" data_format = "influx" - influx_max_line_bytes = 250 ``` Then restart telegraf: diff --git a/docs/en/28-releases/01-tdengine.md b/docs/en/28-releases/01-tdengine.md index 414986d107cb561d23b215a2e3b806f98542182e..808a21474ebc843b2e6b6081507b64c510f79797 100644 --- a/docs/en/28-releases/01-tdengine.md +++ b/docs/en/28-releases/01-tdengine.md @@ -6,6 +6,14 @@ description: TDengine release history, Release Notes and download links. import Release from "/components/ReleaseV3"; +## 3.0.1.4 + + + +## 3.0.1.3 + + + ## 3.0.1.2 diff --git a/docs/en/28-releases/02-tools.md b/docs/en/28-releases/02-tools.md index 086d3adea2d43f9b3eebdfb9520236710e306582..5d6693ae73dbe9348c6dcfad6f88ed1602acd957 100644 --- a/docs/en/28-releases/02-tools.md +++ b/docs/en/28-releases/02-tools.md @@ -6,6 +6,14 @@ description: taosTools release history, Release Notes, download links. import Release from "/components/ReleaseV3"; +## 2.2.4 + + + +## 2.2.3 + + + ## 2.2.2 diff --git a/docs/zh/07-develop/03-insert-data/02-influxdb-line.mdx b/docs/zh/07-develop/03-insert-data/02-influxdb-line.mdx index f88284ad676edaae1ff9424ae7a7dfe93aaebba2..a107ffb1b6de6bcf04f559bf4223363a2a40bc5b 100644 --- a/docs/zh/07-develop/03-insert-data/02-influxdb-line.mdx +++ b/docs/zh/07-develop/03-insert-data/02-influxdb-line.mdx @@ -37,7 +37,9 @@ meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0 - tag_set 中的所有的数据自动转化为 nchar 数据类型; - field_set 中的每个数据项都需要对自身的数据类型进行描述, 比如 1.2f32 代表 float 类型的数值 1.2, 如果不带类型后缀会被当作 double 处理; - timestamp 支持多种时间精度。写入数据的时候需要用参数指定时间精度,支持从小时到纳秒的 6 种时间精度。 - +- 为了提高写入的效率,默认假设同一个超级表中 field_set 的顺序是一样的(第一条数据包含所有的 field,后面的数据按照这个顺序),如果顺序不一样,需要配置参数 smlDataFormat 为 false,否则,数据写入按照相同顺序写入,库中数据会异常。(3.0.1.3之后的版本 smlDataFormat 默认为 false) [TDengine 无模式写入参考指南](/reference/schemaless/#无模式写入行协议) +- 默认生产的子表名是根据规则生成的唯一ID值。为了让用户可以指定生成的表名,可以通过在taos.cfg里配置 smlChildTableName 参数来指定。 +举例如下:配置 smlChildTableName=tname 插入数据为 st,tname=cpu1,t1=4 c1=3 1626006833639000000 则创建的表名为 cpu1,注意如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一行自动建表时指定的 tag_set,其他的行会忽略)。[TDengine 无模式写入参考指南](/reference/schemaless/#无模式写入行协议) ::: 要了解更多可参考:[InfluxDB Line 协议官方文档](https://docs.influxdata.com/influxdb/v2.0/reference/syntax/line-protocol/) 和 [TDengine 无模式写入参考指南](/reference/schemaless/#无模式写入行协议) @@ -64,3 +66,7 @@ meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0 + +## 查询示例 +比如查询 location=California.LosAngeles,groupid=2 子表的数据可以通过如下sql: +select * from meters where location=California.LosAngeles and groupid=2 diff --git a/docs/zh/07-develop/03-insert-data/03-opentsdb-telnet.mdx b/docs/zh/07-develop/03-insert-data/03-opentsdb-telnet.mdx index 4f63e17635a713f1f91785cc0fced89fe9340a95..58bca7f8430e68056c10d9df5184f1b104b48bac 100644 --- a/docs/zh/07-develop/03-insert-data/03-opentsdb-telnet.mdx +++ b/docs/zh/07-develop/03-insert-data/03-opentsdb-telnet.mdx @@ -32,6 +32,8 @@ OpenTSDB 行协议同样采用一行字符串来表示一行数据。OpenTSDB meters.current 1648432611250 11.3 location=California.LosAngeles groupid=3 ``` +- 默认生产的子表名是根据规则生成的唯一ID值。为了让用户可以指定生成的表名,可以通过在taos.cfg里配置 smlChildTableName 参数来指定。 +举例如下:配置 smlChildTableName=tname 插入数据为 meters.current 1648432611250 11.3 tname=cpu1 location=California.LosAngeles groupid=3 则创建的表名为 cpu1,注意如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一行自动建表时指定的 tag_set,其他的行会忽略)。 参考[OpenTSDB Telnet API 文档](http://opentsdb.net/docs/build/html/api_telnet/put.html)。 ## 示例代码 @@ -79,3 +81,6 @@ taos> select tbname, * from `meters.current`; t_7e7b26dd860280242c6492a16... | 2022-03-28 09:56:51.250 | 12.600000000 | 2 | California.SanFrancisco | Query OK, 4 row(s) in set (0.005399s) ``` +## 查询示例: +想要查询 location=California.LosAngeles groupid=3 的数据,可以通过如下sql: +select * from `meters.voltage` where location="California.LosAngeles" and groupid=3 diff --git a/docs/zh/07-develop/03-insert-data/04-opentsdb-json.mdx b/docs/zh/07-develop/03-insert-data/04-opentsdb-json.mdx index b0257b9cb71ad7aafbadd29d8b6d574e4e024796..aa3e5980cf76a06ecedd966d231ca6437fdd7e1b 100644 --- a/docs/zh/07-develop/03-insert-data/04-opentsdb-json.mdx +++ b/docs/zh/07-develop/03-insert-data/04-opentsdb-json.mdx @@ -48,7 +48,8 @@ OpenTSDB JSON 格式协议采用一个 JSON 字符串表示一行或多行数据 - 对于 JSON 格式协议,TDengine 并不会自动把所有标签转成 nchar 类型, 字符串将将转为 nchar 类型, 数值将同样转换为 double 类型。 - TDengine 只接收 JSON **数组格式**的字符串,即使一行数据也需要转换成数组形式。 - +- 默认生产的子表名是根据规则生成的唯一ID值。为了让用户可以指定生成的表名,可以通过在taos.cfg里配置 smlChildTableName 参数来指定。 +举例如下:配置 smlChildTableName=tname 插入数据为 "tags": { "host": "web02","dc": "lga","tname":"cpu1"} 则创建的表名为 cpu1,注意如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一行自动建表时指定的 tag_set,其他的行会忽略)。 ::: ## 示例代码 @@ -94,3 +95,7 @@ taos> select * from `meters.current`; 2022-03-28 09:56:51.250 | 12.600000000 | 2.000000000 | California.SanFrancisco | Query OK, 2 row(s) in set (0.004076s) ``` + +## 查询示例 +想要查询"tags": {"location": "California.LosAngeles", "groupid": 1} 的数据,可以通过如下sql: +select * from `meters.voltage` where location="California.LosAngeles" and groupid=1 diff --git a/docs/zh/08-connector/14-java.mdx b/docs/zh/08-connector/14-java.mdx index 6b1715f8c6a2f949fca552885ea3920f43e8a849..d78da52aaa3e687d3444e9dfc22427bb267defe8 100644 --- a/docs/zh/08-connector/14-java.mdx +++ b/docs/zh/08-connector/14-java.mdx @@ -109,7 +109,7 @@ TDengine 的 JDBC URL 规范格式为: 对于建立连接,原生连接与 REST 连接有细微不同。 - + ```java diff --git a/docs/zh/08-connector/20-go.mdx b/docs/zh/08-connector/20-go.mdx index 9d30f75190cddbb17c40e97655002a158cd6aae6..515d1b030b24f36defb32ee9f59fde421eec8a9c 100644 --- a/docs/zh/08-connector/20-go.mdx +++ b/docs/zh/08-connector/20-go.mdx @@ -114,7 +114,7 @@ username:password@protocol(address)/dbname?param=value ``` ### 使用连接器进行连接 - + _taosSql_ 通过 cgo 实现了 Go 的 `database/sql/driver` 接口。只需要引入驱动就可以使用 [`database/sql`](https://golang.org/pkg/database/sql/) 的接口。 diff --git a/docs/zh/08-connector/26-rust.mdx b/docs/zh/08-connector/26-rust.mdx index f6b99beed3b33a4b34208445c516db689b9875fb..63dce4b69b7a66c0888f306b72fd87b45e4c5bf3 100644 --- a/docs/zh/08-connector/26-rust.mdx +++ b/docs/zh/08-connector/26-rust.mdx @@ -55,23 +55,24 @@ taos = "*" - + -在 `Cargo.toml` 文件中添加 [taos][taos],并启用 `native` 特性: +在 `Cargo.toml` 文件中添加 [taos][taos],并启用 `ws` 特性。 ```toml [dependencies] -taos = { version = "*", default-features = false, features = ["native"] } +taos = { version = "*", default-features = false, features = ["ws"] } ``` - -在 `Cargo.toml` 文件中添加 [taos][taos],并启用 `ws` 特性。 + + +在 `Cargo.toml` 文件中添加 [taos][taos],并启用 `native` 特性: ```toml [dependencies] -taos = { version = "*", default-features = false, features = ["ws"] } +taos = { version = "*", default-features = false, features = ["native"] } ``` diff --git a/docs/zh/08-connector/30-python.mdx b/docs/zh/08-connector/30-python.mdx index 0242486d3b8820ac38301d38ccbaf8bb9fc7e1c3..c70677f8166317cd9dfa921d4953d3b3433576d9 100644 --- a/docs/zh/08-connector/30-python.mdx +++ b/docs/zh/08-connector/30-python.mdx @@ -80,7 +80,7 @@ pip3 install git+https://github.com/taosdata/taos-connector-python.git ### 安装验证 - + 对于原生连接,需要验证客户端驱动和 Python 连接器本身是否都正确安装。如果能成功导入 `taos` 模块,则说明已经正确安装了客户端驱动和 Python 连接器。可在 Python 交互式 Shell 中输入: @@ -118,7 +118,7 @@ Requirement already satisfied: taospy in c:\users\username\appdata\local\program 在用连接器建立连接之前,建议先测试本地 TDengine CLI 到 TDengine 集群的连通性。 - + 请确保 TDengine 集群已经启动, 且集群中机器的 FQDN (如果启动的是单机版,FQDN 默认为 hostname)在本机能够解析, 可用 `ping` 命令进行测试: @@ -173,7 +173,7 @@ curl -u root:taosdata http://:/rest/sql -d "select server_version()" 以下示例代码假设 TDengine 安装在本机, 且 FQDN 和 serverPort 都使用了默认配置。 - + ```python @@ -219,7 +219,7 @@ curl -u root:taosdata http://:/rest/sql -d "select server_version()" ### 基本使用 - + ##### TaosConnection 类的使用 @@ -289,7 +289,7 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线 ### 与 pandas 一起使用 - + ```python diff --git a/docs/zh/08-connector/35-node.mdx b/docs/zh/08-connector/35-node.mdx index 167ae069d6175873679e8c7cc4ecbb16dafe2ad8..1de19cdd3a39b178f0ce9755f332fbfae6fe70f1 100644 --- a/docs/zh/08-connector/35-node.mdx +++ b/docs/zh/08-connector/35-node.mdx @@ -85,7 +85,7 @@ REST 连接器支持所有能运行 Node.js 的平台。 ### 使用 npm 安装 - + ```bash @@ -124,7 +124,7 @@ node nodejsChecker.js host=localhost 请选择使用一种连接器。 - + 安装并引用 `@tdengine/client` 包。 diff --git a/docs/zh/08-connector/40-csharp.mdx b/docs/zh/08-connector/40-csharp.mdx index e99f41ae9cb0a97426878e3efb8cb85d66af4929..70c0382080cde6bc0ca942dc15cc142ed0dfd833 100644 --- a/docs/zh/08-connector/40-csharp.mdx +++ b/docs/zh/08-connector/40-csharp.mdx @@ -35,7 +35,7 @@ import CSAsyncQuery from "../07-develop/04-query-data/_cs_async.mdx" ## 支持的功能特性 - + @@ -96,7 +96,7 @@ dotnet add exmaple.csproj reference src/TDengine.csproj ## 建立连接 - + @@ -171,7 +171,7 @@ namespace TDengineExample #### SQL 写入 - + @@ -203,7 +203,7 @@ namespace TDengineExample #### 参数绑定 - + @@ -227,7 +227,7 @@ namespace TDengineExample #### 同步查询 - + diff --git a/docs/zh/12-taos-sql/06-select.md b/docs/zh/12-taos-sql/06-select.md index 394e4a99d59aa3a1a59c2cb483bb2eefd71e44db..b3b8ef38873d20acaefa13515ff0d5785c5acc86 100644 --- a/docs/zh/12-taos-sql/06-select.md +++ b/docs/zh/12-taos-sql/06-select.md @@ -182,6 +182,14 @@ TDengine 中,所有表的第一列都必须是时间戳类型,且为其主 select _rowts, max(current) from meters; ``` +**\_IROWTS** + +\_irowts 伪列只能与 interp 函数一起使用,用于返回 interp 函数插值结果对应的时间戳列。 + +```sql +select _irowts, interp(current) from meters range('2020-01-01 10:00:00', '2020-01-01 10:30:00') every(1s) fill(linear); +``` + ## 查询对象 FROM 关键字后面可以是若干个表(超级表)列表,也可以是子查询的结果。 diff --git a/docs/zh/12-taos-sql/10-function.md b/docs/zh/12-taos-sql/10-function.md index 2a4d82045fe9b94aa82630420fc9e3afe82ba171..4c33b5232ac7d7511d1ff4bd121c389ce84d9a41 100644 --- a/docs/zh/12-taos-sql/10-function.md +++ b/docs/zh/12-taos-sql/10-function.md @@ -868,6 +868,7 @@ INTERP(expr) - INTERP 根据 EVERY 字段来确定输出时间范围内的结果条数,即从 timestamp1 开始每隔固定长度的时间(EVERY 值)进行插值。如果没有指定 EVERY,则默认窗口大小为无穷大,即从 timestamp1 开始只有一个窗口。 - INTERP 根据 FILL 字段来决定在每个符合输出条件的时刻如何进行插值。 - INTERP 只能在一个时间序列内进行插值,因此当作用于超级表时必须跟 partition by tbname 一起使用。 +- INTERP 可以与伪列 _irowts 一起使用,返回插值点所对应的时间戳(3.0.1.4版本以后支持)。 ### LAST diff --git a/docs/zh/12-taos-sql/20-keywords.md b/docs/zh/12-taos-sql/20-keywords.md index 7530e803db44f49048f02e2ad6980a288c14fa12..8013698fced2f31ca21dfa220066b027e71cb856 100644 --- a/docs/zh/12-taos-sql/20-keywords.md +++ b/docs/zh/12-taos-sql/20-keywords.md @@ -344,6 +344,7 @@ description: TDengine 保留关键字的详细列表 ### \_ - \_C0 +- \_IROWTS - \_QDURATION - \_QEND - \_QSTART diff --git a/docs/zh/12-taos-sql/22-meta.md b/docs/zh/12-taos-sql/22-meta.md index c1ffc4a757500276f348d08cd577f63072dfece2..c192d0e5e83ab856a891137c96e9bd778bfc8e1c 100644 --- a/docs/zh/12-taos-sql/22-meta.md +++ b/docs/zh/12-taos-sql/22-meta.md @@ -12,7 +12,15 @@ TDengine 内置了一个名为 `INFORMATION_SCHEMA` 的数据库,提供对数 4. TDengine 在后续演进中可以灵活的添加已有 INFORMATION_SCHEMA 中表的列,而不用担心对既有业务系统造成影响 5. 与其他数据库系统更具互操作性。例如,Oracle 数据库用户熟悉查询 Oracle 数据字典中的表 -Note: 由于 SHOW 语句已经被开发者熟悉和广泛使用,所以它们仍然被保留。 +:::info + +- 由于 SHOW 语句已经被开发者熟悉和广泛使用,所以它们仍然被保留。 +- 系统表中的一些列可能是关键字,在查询时需要使用转义符'\`',例如查询数据库 test 有几个 VGROUP: +```sql + select `vgroups` from ins_databases where name = 'test'; +``` + +::: 本章将详细介绍 `INFORMATION_SCHEMA` 这个内置元数据库中的表和表结构。 @@ -103,7 +111,11 @@ Note: 由于 SHOW 语句已经被开发者熟悉和广泛使用,所以它们 | 24 | wal_retention_period | INT | WAL 的保存时长 | | 25 | wal_retention_size | INT | WAL 的保存上限 | | 26 | wal_roll_period | INT | wal 文件切换时长 | -| 27 | wal_segment_size | wal 单个文件大小 | +| 27 | wal_segment_size | BIGINT | wal 单个文件大小 | +| 28 | stt_trigger | SMALLINT | 触发文件合并的落盘文件的个数 | +| 29 | table_prefix | SMALLINT | 内部存储引擎根据表名分配存储该表数据的 VNODE 时要忽略的前缀的长度 | +| 30 | table_suffix | SMALLINT | 内部存储引擎根据表名分配存储该表数据的 VNODE 时要忽略的后缀的长度 | +| 31 | tsdb_pagesize | INT | 时序数据存储引擎中的页大小 | ## INS_FUNCTIONS diff --git a/docs/zh/12-taos-sql/29-changes.md b/docs/zh/12-taos-sql/29-changes.md index e63825045d5ddc26d289af4bbd7fa808719bb99c..7da8e9f331bd1d9c81e9bde441e35b03900422b0 100644 --- a/docs/zh/12-taos-sql/29-changes.md +++ b/docs/zh/12-taos-sql/29-changes.md @@ -11,12 +11,13 @@ description: "TDengine 3.0 版本的语法变更说明" | 1 | VARCHAR | 新增 | BINARY类型的别名。 | 2 | TIMESTAMP字面量 | 新增 | 新增支持 TIMESTAMP 'timestamp format' 语法。 | 3 | _ROWTS伪列 | 新增 | 表示时间戳主键。是_C0伪列的别名。 -| 4 | INFORMATION_SCHEMA | 新增 | 包含各种SCHEMA定义的系统数据库。 -| 5 | PERFORMANCE_SCHEMA | 新增 | 包含运行信息的系统数据库。 -| 6 | 连续查询 | 废除 | 不再支持连续查询。相关的各种语法和接口废除。 -| 7 | 混合运算 | 增强 | 查询中的混合运算(标量运算和矢量运算混合)全面增强,SELECT的各个子句均全面支持符合语法语义的混合运算。 -| 8 | 标签运算 | 新增 |在查询中,标签列可以像普通列一样参与各种运算,用于各种子句。 -| 9 | 时间线子句和时间函数用于超级表查询 | 增强 |没有PARTITION BY时,超级表的数据会被合并成一条时间线。 +| 4 | _IROWTS伪列 | 新增 | 用于返回 interp 函数插值结果对应的时间戳列。 +| 5 | INFORMATION_SCHEMA | 新增 | 包含各种SCHEMA定义的系统数据库。 +| 6 | PERFORMANCE_SCHEMA | 新增 | 包含运行信息的系统数据库。 +| 7 | 连续查询 | 废除 | 不再支持连续查询。相关的各种语法和接口废除。 +| 8 | 混合运算 | 增强 | 查询中的混合运算(标量运算和矢量运算混合)全面增强,SELECT的各个子句均全面支持符合语法语义的混合运算。 +| 9 | 标签运算 | 新增 |在查询中,标签列可以像普通列一样参与各种运算,用于各种子句。 +| 10 | 时间线子句和时间函数用于超级表查询 | 增强 |没有PARTITION BY时,超级表的数据会被合并成一条时间线。 ## SQL 语句变更 diff --git a/docs/zh/14-reference/12-config/index.md b/docs/zh/14-reference/12-config/index.md index 179a3c6df0d5966d1eefa87e3393eae774f4387f..6f26878cdd4c558db11465db804e2eef92b143fa 100644 --- a/docs/zh/14-reference/12-config/index.md +++ b/docs/zh/14-reference/12-config/index.md @@ -177,12 +177,21 @@ taos --dump-config ### maxNumOfDistinctRes | 属性 | 说明 | -| -------- | -------------------------------- | --- | +| -------- | -------------------------------- | | 适用范围 | 仅服务端适用 | | 含义 | 允许返回的 distinct 结果最大行数 | | 取值范围 | 默认值为 10 万,最大值 1 亿 | | 缺省值 | 10 万 | +### keepColumnName + +| 属性 | 说明 | +| -------- | -------------------------------- | +| 适用范围 | 仅客户端适用 | +| 含义 | Last、First、LastRow 函数查询时,返回的列名是否包含函数名。 | +| 取值范围 | 0 表示包含函数名,1 表示不包含函数名。 | +| 缺省值 | 0 | + ## 区域相关 ### timezone diff --git a/docs/zh/14-reference/13-schemaless/13-schemaless.md b/docs/zh/14-reference/13-schemaless/13-schemaless.md index a33abafaf82746afbf5669c6ea564b5a87060bb8..07d5b0692bc9ac53d8c46cc0542c9512c2aa536e 100644 --- a/docs/zh/14-reference/13-schemaless/13-schemaless.md +++ b/docs/zh/14-reference/13-schemaless/13-schemaless.md @@ -67,9 +67,12 @@ st,t1=3,t2=4,t3=t3 c1=3i64,c3="passit",c2=false,c4=4f64 1626006833639000000 "measurement,tag_key1=tag_value1,tag_key2=tag_value2" ``` +:::tip 需要注意的是,这里的 tag_key1, tag_key2 并不是用户输入的标签的原始顺序,而是使用了标签名称按照字符串升序排列后的结果。所以,tag_key1 并不是在行协议中输入的第一个标签。 排列完成以后计算该字符串的 MD5 散列值 "md5_val"。然后将计算的结果与字符串组合生成表名:“t_md5_val”。其中的 “t_” 是固定的前缀,每个通过该映射关系自动生成的表都具有该前缀。 -为了让用户可以指定生成的表名,可以通过配置 smlChildTableName 来指定(比如 配置 smlChildTableName=tname 插入数据为 st,tname=cpu1,t1=4 c1=3 1626006833639000000 则创建的表名为 cpu1,注意如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一次自动建表时指定的 tag_set,其他的会忽略)。 +:::tip +为了让用户可以指定生成的表名,可以通过在taos.cfg里配置 smlChildTableName 参数来指定。 +举例如下:配置 smlChildTableName=tname 插入数据为 st,tname=cpu1,t1=4 c1=3 1626006833639000000 则创建的表名为 cpu1,注意如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一行自动建表时指定的 tag_set,其他的行会忽略)。 2. 如果解析行协议获得的超级表不存在,则会创建这个超级表(不建议手动创建超级表,不然插入数据可能异常)。 3. 如果解析行协议获得子表不存在,则 Schemaless 会按照步骤 1 或 2 确定的子表名来创建子表。 diff --git a/docs/zh/14-reference/_telegraf.mdx b/docs/zh/14-reference/_telegraf.mdx index bae46d66062ad7d5bfc2487900c02bd7a19ce4f6..3f92e5dde03ef2d59d4e14cb47e82fbd71f290d2 100644 --- a/docs/zh/14-reference/_telegraf.mdx +++ b/docs/zh/14-reference/_telegraf.mdx @@ -22,6 +22,5 @@ username = "root" password = "taosdata" data_format = "influx" - influx_max_line_bytes = 250 ``` diff --git a/docs/zh/20-third-party/02-prometheus.md b/docs/zh/20-third-party/02-prometheus.md index eb6c3bf1d0b5f6e5d8146566969df41dbad5bf99..59bab1823a0ba5f0eef882e19446dba2b6617f2d 100644 --- a/docs/zh/20-third-party/02-prometheus.md +++ b/docs/zh/20-third-party/02-prometheus.md @@ -88,3 +88,7 @@ VALUE TIMESTAMP ``` +:::note + +- TDengine 默认生成的子表名是根据规则生成的唯一 ID 值。 +::: diff --git a/docs/zh/20-third-party/03-telegraf.md b/docs/zh/20-third-party/03-telegraf.md index 84883e665a84db89d564314a0e47f9caab04d6ff..71bb1b3885d51055ac98e7bc8fa99ad970c2ce40 100644 --- a/docs/zh/20-third-party/03-telegraf.md +++ b/docs/zh/20-third-party/03-telegraf.md @@ -16,6 +16,7 @@ Telegraf 是一款十分流行的指标采集开源软件。在数据采集和 - TDengine 集群已经部署并正常运行 - taosAdapter 已经安装并正常运行。具体细节请参考 [taosAdapter 的使用手册](/reference/taosadapter) - Telegraf 已经安装。安装 Telegraf 请参考[官方文档](https://docs.influxdata.com/telegraf/v1.22/install/) +- Telegraf 默认采集系统运行状态数据。通过使能[输入插件](https://docs.influxdata.com/telegraf/v1.22/plugins/)方式可以输出[其他格式](https://docs.influxdata.com/telegraf/v1.24/data_formats/input/)的数据到 Telegraf 再写入到 TDengine中。 ## 配置步骤 @@ -32,11 +33,12 @@ sudo systemctl restart telegraf ``` taos> show databases; - name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | -==================================================================================================================================================================================================================================================================================== - telegraf | 2022-04-20 08:47:53.488 | 22 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | - log | 2022-04-20 07:19:50.260 | 9 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | -Query OK, 2 row(s) in set (0.002401s) + name | +================================= + information_schema | + performance_schema | + telegraf | +Query OK, 3 rows in database (0.010568s) taos> use telegraf; Database changed. @@ -66,3 +68,11 @@ taos> select * from telegraf.system limit 10; | Query OK, 3 row(s) in set (0.013269s) ``` + +:::note + +- TDengine 接收 influxdb 格式数据默认生成的子表名是根据规则生成的唯一 ID 值。 +用户如需指定生成的表名,可以通过在 taos.cfg 里配置 smlChildTableName 参数来指定。如果通过控制输入数据格式,即可利用 TDengine 这个功能指定生成的表名。 +举例如下:配置 smlChildTableName=tname 插入数据为 st,tname=cpu1,t1=4 c1=3 1626006833639000000 则创建的表名为 cpu1。如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一行自动建表时指定的 tag_set,其他的行会忽略)。[TDengine 无模式写入参考指南](/reference/schemaless/#无模式写入行协议) +::: + diff --git a/docs/zh/20-third-party/05-collectd.md b/docs/zh/20-third-party/05-collectd.md index cc2235f2600ec44425a2f22f39dc3c58a4ccdd5a..d55b981fb999dcea465f460455b604300f2e8d7b 100644 --- a/docs/zh/20-third-party/05-collectd.md +++ b/docs/zh/20-third-party/05-collectd.md @@ -72,3 +72,7 @@ taos> select * from collectd.memory_value limit 10; Query OK, 10 row(s) in set (0.010348s) ``` +:::note + +- TDengine 默认生成的子表名是根据规则生成的唯一 ID 值。 +::: diff --git a/docs/zh/20-third-party/07-icinga2.md b/docs/zh/20-third-party/07-icinga2.md index 06ead57655cfad7bcf88945780dbed52e9c58e16..03d733a326582c8aa9869625e5d7fc0c0777becb 100644 --- a/docs/zh/20-third-party/07-icinga2.md +++ b/docs/zh/20-third-party/07-icinga2.md @@ -37,11 +37,12 @@ sudo systemctl restart icinga2 ``` taos> show databases; - name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | -==================================================================================================================================================================================================================================================================================== - log | 2022-04-20 07:19:50.260 | 11 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | - icinga2 | 2022-04-20 12:11:39.697 | 13 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | -Query OK, 2 row(s) in set (0.001867s) + name | +================================= + information_schema | + performance_schema | + icinga2 | +Query OK, 3 row(s) in set (0.001867s) taos> use icinga2; Database changed. @@ -73,3 +74,9 @@ taos> show stables; icinga.service.users.state | 2022-04-20 12:11:39.704 | 2 | 1 | 1 | Query OK, 22 row(s) in set (0.002317s) ``` + + +:::note + +- TDengine 默认生成的子表名是根据规则生成的唯一 ID 值。 +::: diff --git a/docs/zh/25-application/01-telegraf.md b/docs/zh/25-application/01-telegraf.md index 4e9597f96454730ebcdee5adeebf55439923e8e7..6338264d171b9246b2e99d418035e061d1068a4b 100644 --- a/docs/zh/25-application/01-telegraf.md +++ b/docs/zh/25-application/01-telegraf.md @@ -61,7 +61,6 @@ IT 运维监测数据通常都是对时间特性比较敏感的数据,例如 username = "" password = "" data_format = "influx" - influx_max_line_bytes = 250 ``` 然后重启 Telegraf: diff --git a/docs/zh/28-releases/01-tdengine.md b/docs/zh/28-releases/01-tdengine.md index b05cf7a942901efacb3512b9d6721b75e252f7c5..59e0d0f76174d567eeb5b597256a78ff098a351e 100644 --- a/docs/zh/28-releases/01-tdengine.md +++ b/docs/zh/28-releases/01-tdengine.md @@ -6,6 +6,14 @@ description: TDengine 发布历史、Release Notes 及下载链接 import Release from "/components/ReleaseV3"; +## 3.0.1.4 + + + +## 3.0.1.3 + + + ## 3.0.1.2 diff --git a/docs/zh/28-releases/02-tools.md b/docs/zh/28-releases/02-tools.md index f793981d064ef1dfe6962a454cdc284763667070..83ccdec3873bd6df23beaddd3408b3a3ede6559e 100644 --- a/docs/zh/28-releases/02-tools.md +++ b/docs/zh/28-releases/02-tools.md @@ -6,6 +6,14 @@ description: taosTools 的发布历史、Release Notes 和下载链接 import Release from "/components/ReleaseV3"; +## 2.2.4 + + + +## 2.2.3 + + + ## 2.2.2 diff --git a/examples/lua/README.md b/examples/lua/README.md index 32d6a4cace9bd0bf66238ff32af1d3ecf0285046..5abf0c1aab9bf7f53daf2b95827169e3aaa23fc8 100644 --- a/examples/lua/README.md +++ b/examples/lua/README.md @@ -1,6 +1,12 @@ # TDengine driver connector for Lua It's a Lua implementation for [TDengine](https://github.com/taosdata/TDengine), an open-sourced big data platform designed and optimized for the Internet of Things (IoT), Connected Cars, Industrial IoT, and IT Infrastructure and Application Monitoring. You may need to install Lua5.3 . +As TDengine is built with lua-enable with default configure, the built-in lua lib conflicts with external lua lib. The following commands require TDengine built with lua-disable. +To disable built-in lua: +``` +mkdir debug && cd debug +cmake .. -DBUILD_LUA=false && cmake --build . +``` ## Lua Dependencies - Lua: diff --git a/examples/lua/lua51/lua_connector51.c b/examples/lua/lua51/lua_connector51.c index 4c702b2aaeac163f73bc0b2503449dd68a25150d..8a9051dd0cb3da0fd82e752132d499a5935be758 100644 --- a/examples/lua/lua51/lua_connector51.c +++ b/examples/lua/lua51/lua_connector51.c @@ -29,7 +29,7 @@ static int l_connect(lua_State *L){ luaL_checktype(L, 1, LUA_TTABLE); lua_getfield(L, 1,"host"); - if (lua_isstring(L,-1)){ + if (lua_isstring(L, -1)){ host = lua_tostring(L, -1); // printf("host = %s\n", host); } @@ -58,8 +58,9 @@ static int l_connect(lua_State *L){ //printf("password = %s\n", password); } - lua_settop(L,0); + lua_settop(L, 0); + taos_init(); lua_newtable(L); int table_index = lua_gettop(L); @@ -125,7 +126,7 @@ static int l_query(lua_State *L){ //printf("row index:%d\n",rows); rows++; - lua_pushnumber(L,rows); + lua_pushnumber(L, rows); lua_newtable(L); for (int i = 0; i < num_fields; ++i) { @@ -136,15 +137,19 @@ static int l_query(lua_State *L){ lua_pushstring(L,fields[i].name); int32_t* length = taos_fetch_lengths(result); switch (fields[i].type) { + case TSDB_DATA_TYPE_UTINYINT: case TSDB_DATA_TYPE_TINYINT: lua_pushinteger(L,*((char *)row[i])); break; + case TSDB_DATA_TYPE_USMALLINT: case TSDB_DATA_TYPE_SMALLINT: lua_pushinteger(L,*((short *)row[i])); break; + case TSDB_DATA_TYPE_UINT: case TSDB_DATA_TYPE_INT: lua_pushinteger(L,*((int *)row[i])); break; + case TSDB_DATA_TYPE_UBIGINT: case TSDB_DATA_TYPE_BIGINT: lua_pushinteger(L,*((int64_t *)row[i])); break; @@ -154,6 +159,7 @@ static int l_query(lua_State *L){ case TSDB_DATA_TYPE_DOUBLE: lua_pushnumber(L,*((double *)row[i])); break; + case TSDB_DATA_TYPE_JSON: case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_NCHAR: //printf("type:%d, max len:%d, current len:%d\n",fields[i].type, fields[i].bytes, length[i]); @@ -197,7 +203,7 @@ void async_query_callback(void *param, TAOS_RES *result, int code){ printf("failed, reason:%s\n", taos_errstr(result)); lua_pushinteger(L, -1); lua_setfield(L, table_index, "code"); - lua_pushstring(L,"something is wrong");// taos_errstr(taos)); + lua_pushstring(L, taos_errstr(result)); lua_setfield(L, table_index, "error"); }else{ //printf("success to async query.\n"); @@ -214,9 +220,9 @@ void async_query_callback(void *param, TAOS_RES *result, int code){ static int l_async_query(lua_State *L){ int r = luaL_ref(L, LUA_REGISTRYINDEX); - TAOS * taos = (TAOS*)lua_topointer(L,1); - const char * sqlstr = lua_tostring(L,2); - // int stime = luaL_checknumber(L,3); + TAOS * taos = (TAOS*)lua_topointer(L, 1); + const char * sqlstr = lua_tostring(L, 2); + // int stime = luaL_checknumber(L, 3); lua_newtable(L); int table_index = lua_gettop(L); @@ -224,7 +230,7 @@ static int l_async_query(lua_State *L){ struct async_query_callback_param *p = malloc(sizeof(struct async_query_callback_param)); p->state = L; p->callback=r; - // printf("r:%d, L:%d\n",r,L); + // printf("r:%d, L:%d\n", r, L); taos_query_a(taos,sqlstr,async_query_callback,p); lua_pushnumber(L, 0); @@ -267,7 +273,7 @@ static const struct luaL_Reg lib[] = { extern int luaopen_luaconnector51(lua_State* L) { // luaL_register(L, "luaconnector51", lib); - lua_newtable (L); + lua_newtable(L); luaL_setfuncs(L,lib,0); return 1; } diff --git a/examples/lua/lua_connector.c b/examples/lua/lua_connector.c index ce13ab3829dec17e4df97ab94f358bd128e80cf1..c3d8bcb99548c787953cd27bcbb90b6c63ee5a4a 100644 --- a/examples/lua/lua_connector.c +++ b/examples/lua/lua_connector.c @@ -29,7 +29,7 @@ static int l_connect(lua_State *L){ luaL_checktype(L, 1, LUA_TTABLE); lua_getfield(L, 1,"host"); - if (lua_isstring(L,-1)){ + if (lua_isstring(L, -1)){ host = lua_tostring(L, -1); // printf("host = %s\n", host); } @@ -58,7 +58,7 @@ static int l_connect(lua_State *L){ //printf("password = %s\n", password); } - lua_settop(L,0); + lua_settop(L, 0); taos_init(); @@ -126,7 +126,7 @@ static int l_query(lua_State *L){ //printf("row index:%d\n",rows); rows++; - lua_pushnumber(L,rows); + lua_pushnumber(L, rows); lua_newtable(L); for (int i = 0; i < num_fields; ++i) { @@ -203,7 +203,7 @@ void async_query_callback(void *param, TAOS_RES *result, int code){ printf("failed, reason:%s\n", taos_errstr(result)); lua_pushinteger(L, -1); lua_setfield(L, table_index, "code"); - lua_pushstring(L,"something is wrong");// taos_errstr(taos)); + lua_pushstring(L, taos_errstr(result)); lua_setfield(L, table_index, "error"); }else{ //printf("success to async query.\n"); @@ -220,9 +220,9 @@ void async_query_callback(void *param, TAOS_RES *result, int code){ static int l_async_query(lua_State *L){ int r = luaL_ref(L, LUA_REGISTRYINDEX); - TAOS * taos = (TAOS*)lua_topointer(L,1); - const char * sqlstr = lua_tostring(L,2); - // int stime = luaL_checknumber(L,3); + TAOS * taos = (TAOS*)lua_topointer(L, 1); + const char * sqlstr = lua_tostring(L, 2); + // int stime = luaL_checknumber(L, 3); lua_newtable(L); int table_index = lua_gettop(L); @@ -230,7 +230,7 @@ static int l_async_query(lua_State *L){ struct async_query_callback_param *p = malloc(sizeof(struct async_query_callback_param)); p->state = L; p->callback=r; - // printf("r:%d, L:%d\n",r,L); + // printf("r:%d, L:%d\n", r, L); taos_query_a(taos,sqlstr,async_query_callback,p); lua_pushnumber(L, 0); diff --git a/examples/lua/test.lua b/examples/lua/test.lua index 3d725cc6a368a4d263729a35612ae0461c86b5ab..94415982e7ceaa75498acc8b8bfa523d953ec401 100644 --- a/examples/lua/test.lua +++ b/examples/lua/test.lua @@ -176,8 +176,14 @@ end driver.query_a(conn,"INSERT INTO therm1 VALUES ('2019-09-01 00:00:00.005', 100),('2019-09-01 00:00:00.006', 101),('2019-09-01 00:00:00.007', 102)", async_query_callback) res = driver.query(conn, "create stream stream_avg_degree into avg_degree as select avg(degree) from thermometer interval(5s) sliding(1s)") +if res.code ~=0 then + print("create stream--- failed:"..res.error) + return +else + print("create stream--- pass") +end -print("From now on we start continous insert in an definite loop, pls wait for about 10 seconds and check stream table for result.") +print("From now on we start continous insertion in an definite loop, please wait for about 10 seconds and check stream table avg_degree for result.") local loop_index = 0 while loop_index < 10 do local t = os.time()*1000 @@ -193,5 +199,5 @@ while loop_index < 10 do os.execute("sleep " .. 1) loop_index = loop_index + 1 end -driver.query(conn,"DROP STREAM IF EXISTS avg_therm_s") +driver.query(conn,"DROP STREAM IF EXISTS stream_avg_degree") driver.close(conn) diff --git a/include/common/tcommon.h b/include/common/tcommon.h index 2544cedda744901ddc98bf9d7698fddf5907513f..2add3332ab28320f52c666141470f30e40b11fe8 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -177,6 +177,7 @@ typedef struct SSDataBlock { enum { FETCH_TYPE__DATA = 1, FETCH_TYPE__META, + FETCH_TYPE__SEP, FETCH_TYPE__NONE, }; diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 9b69bec5b3f9e9227a9ae0ae32ccde7358457d1e..bd5e74387edc4292e3a019b817a8d70f266e081d 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -98,6 +98,7 @@ extern int32_t tsQueryRsmaTolerance; extern bool tsQueryPlannerTrace; extern int32_t tsQueryNodeChunkSize; extern bool tsQueryUseNodeAllocator; +extern bool tsKeepColumnName; // client extern int32_t tsMinSlidingTime; diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index f40ff275cae339f13f662c39903eda8b33eb3098..d061da7aafc8de15ac0763d3fa62c167c2dd6fc3 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -226,110 +226,112 @@ #define TK_WSTART 208 #define TK_WEND 209 #define TK_WDURATION 210 -#define TK_CAST 211 -#define TK_NOW 212 -#define TK_TODAY 213 -#define TK_TIMEZONE 214 -#define TK_CLIENT_VERSION 215 -#define TK_SERVER_VERSION 216 -#define TK_SERVER_STATUS 217 -#define TK_CURRENT_USER 218 -#define TK_COUNT 219 -#define TK_LAST_ROW 220 -#define TK_CASE 221 -#define TK_END 222 -#define TK_WHEN 223 -#define TK_THEN 224 -#define TK_ELSE 225 -#define TK_BETWEEN 226 -#define TK_IS 227 -#define TK_NK_LT 228 -#define TK_NK_GT 229 -#define TK_NK_LE 230 -#define TK_NK_GE 231 -#define TK_NK_NE 232 -#define TK_MATCH 233 -#define TK_NMATCH 234 -#define TK_CONTAINS 235 -#define TK_IN 236 -#define TK_JOIN 237 -#define TK_INNER 238 -#define TK_SELECT 239 -#define TK_DISTINCT 240 -#define TK_WHERE 241 -#define TK_PARTITION 242 -#define TK_BY 243 -#define TK_SESSION 244 -#define TK_STATE_WINDOW 245 -#define TK_SLIDING 246 -#define TK_FILL 247 -#define TK_VALUE 248 -#define TK_NONE 249 -#define TK_PREV 250 -#define TK_LINEAR 251 -#define TK_NEXT 252 -#define TK_HAVING 253 -#define TK_RANGE 254 -#define TK_EVERY 255 -#define TK_ORDER 256 -#define TK_SLIMIT 257 -#define TK_SOFFSET 258 -#define TK_LIMIT 259 -#define TK_OFFSET 260 -#define TK_ASC 261 -#define TK_NULLS 262 -#define TK_ABORT 263 -#define TK_AFTER 264 -#define TK_ATTACH 265 -#define TK_BEFORE 266 -#define TK_BEGIN 267 -#define TK_BITAND 268 -#define TK_BITNOT 269 -#define TK_BITOR 270 -#define TK_BLOCKS 271 -#define TK_CHANGE 272 -#define TK_COMMA 273 -#define TK_COMPACT 274 -#define TK_CONCAT 275 -#define TK_CONFLICT 276 -#define TK_COPY 277 -#define TK_DEFERRED 278 -#define TK_DELIMITERS 279 -#define TK_DETACH 280 -#define TK_DIVIDE 281 -#define TK_DOT 282 -#define TK_EACH 283 -#define TK_FAIL 284 -#define TK_FILE 285 -#define TK_FOR 286 -#define TK_GLOB 287 -#define TK_ID 288 -#define TK_IMMEDIATE 289 -#define TK_IMPORT 290 -#define TK_INITIALLY 291 -#define TK_INSTEAD 292 -#define TK_ISNULL 293 -#define TK_KEY 294 -#define TK_NK_BITNOT 295 -#define TK_NK_SEMI 296 -#define TK_NOTNULL 297 -#define TK_OF 298 -#define TK_PLUS 299 -#define TK_PRIVILEGE 300 -#define TK_RAISE 301 -#define TK_REPLACE 302 -#define TK_RESTRICT 303 -#define TK_ROW 304 -#define TK_SEMI 305 -#define TK_STAR 306 -#define TK_STATEMENT 307 -#define TK_STRING 308 -#define TK_TIMES 309 -#define TK_UPDATE 310 -#define TK_VALUES 311 -#define TK_VARIABLE 312 -#define TK_VIEW 313 -#define TK_WAL 314 +#define TK_IROWTS 211 +#define TK_QTAGS 212 +#define TK_CAST 213 +#define TK_NOW 214 +#define TK_TODAY 215 +#define TK_TIMEZONE 216 +#define TK_CLIENT_VERSION 217 +#define TK_SERVER_VERSION 218 +#define TK_SERVER_STATUS 219 +#define TK_CURRENT_USER 220 +#define TK_COUNT 221 +#define TK_LAST_ROW 222 +#define TK_CASE 223 +#define TK_END 224 +#define TK_WHEN 225 +#define TK_THEN 226 +#define TK_ELSE 227 +#define TK_BETWEEN 228 +#define TK_IS 229 +#define TK_NK_LT 230 +#define TK_NK_GT 231 +#define TK_NK_LE 232 +#define TK_NK_GE 233 +#define TK_NK_NE 234 +#define TK_MATCH 235 +#define TK_NMATCH 236 +#define TK_CONTAINS 237 +#define TK_IN 238 +#define TK_JOIN 239 +#define TK_INNER 240 +#define TK_SELECT 241 +#define TK_DISTINCT 242 +#define TK_WHERE 243 +#define TK_PARTITION 244 +#define TK_BY 245 +#define TK_SESSION 246 +#define TK_STATE_WINDOW 247 +#define TK_SLIDING 248 +#define TK_FILL 249 +#define TK_VALUE 250 +#define TK_NONE 251 +#define TK_PREV 252 +#define TK_LINEAR 253 +#define TK_NEXT 254 +#define TK_HAVING 255 +#define TK_RANGE 256 +#define TK_EVERY 257 +#define TK_ORDER 258 +#define TK_SLIMIT 259 +#define TK_SOFFSET 260 +#define TK_LIMIT 261 +#define TK_OFFSET 262 +#define TK_ASC 263 +#define TK_NULLS 264 +#define TK_ABORT 265 +#define TK_AFTER 266 +#define TK_ATTACH 267 +#define TK_BEFORE 268 +#define TK_BEGIN 269 +#define TK_BITAND 270 +#define TK_BITNOT 271 +#define TK_BITOR 272 +#define TK_BLOCKS 273 +#define TK_CHANGE 274 +#define TK_COMMA 275 +#define TK_COMPACT 276 +#define TK_CONCAT 277 +#define TK_CONFLICT 278 +#define TK_COPY 279 +#define TK_DEFERRED 280 +#define TK_DELIMITERS 281 +#define TK_DETACH 282 +#define TK_DIVIDE 283 +#define TK_DOT 284 +#define TK_EACH 285 +#define TK_FAIL 286 +#define TK_FILE 287 +#define TK_FOR 288 +#define TK_GLOB 289 +#define TK_ID 290 +#define TK_IMMEDIATE 291 +#define TK_IMPORT 292 +#define TK_INITIALLY 293 +#define TK_INSTEAD 294 +#define TK_ISNULL 295 +#define TK_KEY 296 +#define TK_NK_BITNOT 297 +#define TK_NK_SEMI 298 +#define TK_NOTNULL 299 +#define TK_OF 300 +#define TK_PLUS 301 +#define TK_PRIVILEGE 302 +#define TK_RAISE 303 +#define TK_REPLACE 304 +#define TK_RESTRICT 305 +#define TK_ROW 306 +#define TK_SEMI 307 +#define TK_STAR 308 +#define TK_STATEMENT 309 +#define TK_STRING 310 +#define TK_TIMES 311 +#define TK_UPDATE 312 +#define TK_VALUES 313 +#define TK_VARIABLE 314 +#define TK_VIEW 315 +#define TK_WAL 316 #define TK_NK_SPACE 300 #define TK_NK_COMMENT 301 diff --git a/include/libs/executor/executor.h b/include/libs/executor/executor.h index 8c1d957381583f1e91a5c1620b90638ea3061ce1..78eedaf921fe91fef7c3b8fc337a4d26c4d8d96e 100644 --- a/include/libs/executor/executor.h +++ b/include/libs/executor/executor.h @@ -29,13 +29,13 @@ typedef void* DataSinkHandle; struct SRpcMsg; struct SSubplan; -typedef int32_t (*localFetchFp)(void *, uint64_t, uint64_t, uint64_t, int64_t, int32_t, void**, SArray*); +typedef int32_t (*localFetchFp)(void*, uint64_t, uint64_t, uint64_t, int64_t, int32_t, void**, SArray*); typedef struct { - void *handle; + void* handle; bool localExec; localFetchFp fp; - SArray *explainRes; + SArray* explainRes; } SLocalFetch; typedef struct { @@ -51,9 +51,9 @@ typedef struct { bool initTqReader; int32_t numOfVgroups; - void* sContext; // SSnapContext* + void* sContext; // SSnapContext* - void* pStateBackend; + void* pStateBackend; } SReadHandle; // in queue mode, data streams are seperated by msg @@ -136,7 +136,8 @@ int32_t qGetQueryTableSchemaVersion(qTaskInfo_t tinfo, char* dbName, char* table * @param handle * @return */ -int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds, SLocalFetch *pLocal); + +int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds, bool* hasMore, SLocalFetch *pLocal); int32_t qExecTask(qTaskInfo_t tinfo, SSDataBlock** pBlock, uint64_t* useconds); /** @@ -195,6 +196,8 @@ int32_t qStreamPrepareTsdbScan(qTaskInfo_t tinfo, uint64_t uid, int64_t ts); int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subType); +int32_t qStreamScanMemData(qTaskInfo_t tinfo, const SSubmitReq* pReq); + int32_t qStreamExtractOffset(qTaskInfo_t tinfo, STqOffsetVal* pOffset); SMqMetaRsp* qStreamExtractMetaMsg(qTaskInfo_t tinfo); diff --git a/include/libs/function/functionMgt.h b/include/libs/function/functionMgt.h index c9c19579cb1c6943c5914aebed20668a1c1ff156..569c16675ddc1c221f61b1566db9da66d99a28c5 100644 --- a/include/libs/function/functionMgt.h +++ b/include/libs/function/functionMgt.h @@ -119,9 +119,11 @@ typedef enum EFunctionType { FUNCTION_TYPE_WSTART, FUNCTION_TYPE_WEND, FUNCTION_TYPE_WDURATION, + FUNCTION_TYPE_IROWTS, + FUNCTION_TYPE_TAGS, // internal function - FUNCTION_TYPE_SELECT_VALUE, + FUNCTION_TYPE_SELECT_VALUE = 3750, FUNCTION_TYPE_BLOCK_DIST, // block distribution aggregate function FUNCTION_TYPE_BLOCK_DIST_INFO, // block distribution pseudo column function FUNCTION_TYPE_TO_COLUMN, @@ -212,6 +214,7 @@ bool fmIsClientPseudoColumnFunc(int32_t funcId); bool fmIsMultiRowsFunc(int32_t funcId); bool fmIsKeepOrderFunc(int32_t funcId); bool fmIsCumulativeFunc(int32_t funcId); +bool fmIsInterpPseudoColumnFunc(int32_t funcId); int32_t fmGetDistMethod(const SFunctionNode* pFunc, SFunctionNode** pPartialFunc, SFunctionNode** pMergeFunc); diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index 32249e3d8b357ce1ba35df1b717af7c1e43b9999..00e896f586dec53a34c53ade66af9107bacea1d4 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -27,9 +27,10 @@ extern "C" { #define LIST_LENGTH(l) (NULL != (l) ? (l)->length : 0) -#define FOREACH(node, list) \ - for (SListCell *cell = (NULL != (list) ? (list)->pHead : NULL), *pNext; \ - (NULL != cell ? (node = cell->pNode, pNext = cell->pNext, true) : (node = NULL, pNext = NULL, false)); cell = pNext) +#define FOREACH(node, list) \ + for (SListCell* cell = (NULL != (list) ? (list)->pHead : NULL), *pNext; \ + (NULL != cell ? (node = cell->pNode, pNext = cell->pNext, true) : (node = NULL, pNext = NULL, false)); \ + cell = pNext) #define REPLACE_NODE(newNode) cell->pNode = (SNode*)(newNode) @@ -192,6 +193,7 @@ typedef enum ENodeType { QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT, QUERY_NODE_SHOW_SCORES_STMT, + QUERY_NODE_SHOW_TABLE_TAGS_STMT, QUERY_NODE_KILL_CONNECTION_STMT, QUERY_NODE_KILL_QUERY_STMT, QUERY_NODE_KILL_TRANSACTION_STMT, @@ -239,6 +241,7 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL, QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL, QUERY_NODE_PHYSICAL_PLAN_FILL, + QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL, QUERY_NODE_PHYSICAL_PLAN_MERGE_SESSION, QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION, QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_SESSION, diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index e6e34648f9c62b74bbae9cbecc3ad826acddfe91..25ff18a8fc1a5b6f35e82c2323ed6a4023285d76 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -464,6 +464,8 @@ typedef struct SFillPhysiNode { EOrder inputTsOrder; } SFillPhysiNode; +typedef SFillPhysiNode SStreamFillPhysiNode; + typedef struct SMultiTableIntervalPhysiNode { SIntervalPhysiNode interval; SNodeList* pPartitionKeys; diff --git a/include/libs/stream/streamState.h b/include/libs/stream/streamState.h index 849d83a58b09d99656d2b375af27678d77bac3d5..0adcf976f01d43eaeb37b5d04809d1fcf8e8a79b 100644 --- a/include/libs/stream/streamState.h +++ b/include/libs/stream/streamState.h @@ -31,6 +31,7 @@ typedef struct { TDB* db; TTB* pStateDb; TTB* pFuncStateDb; + TTB* pFillStateDb; // todo refactor TXN txn; } SStreamState; @@ -51,15 +52,22 @@ int32_t streamStateFuncDel(SStreamState* pState, const STupleKey* key); int32_t streamStatePut(SStreamState* pState, const SWinKey* key, const void* value, int32_t vLen); int32_t streamStateGet(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen); int32_t streamStateDel(SStreamState* pState, const SWinKey* key); + +int32_t streamStateFillPut(SStreamState* pState, const SWinKey* key, const void* value, int32_t vLen); +int32_t streamStateFillGet(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen); +int32_t streamStateFillDel(SStreamState* pState, const SWinKey* key); + int32_t streamStateAddIfNotExist(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen); int32_t streamStateReleaseBuf(SStreamState* pState, const SWinKey* key, void* pVal); void streamFreeVal(void* val); SStreamStateCur* streamStateGetCur(SStreamState* pState, const SWinKey* key); -SStreamStateCur* streamStateSeekKeyNext(SStreamState* pState, const SWinKey* key); -SStreamStateCur* streamStateSeekKeyPrev(SStreamState* pState, const SWinKey* key); +SStreamStateCur* streamStateGetAndCheckCur(SStreamState* pState, SWinKey* key); +SStreamStateCur* streamStateFillSeekKeyNext(SStreamState* pState, const SWinKey* key); +SStreamStateCur* streamStateFillSeekKeyPrev(SStreamState* pState, const SWinKey* key); void streamStateFreeCur(SStreamStateCur* pCur); +int32_t streamStateGetGroupKVByCur(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen); int32_t streamStateGetKVByCur(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen); int32_t streamStateSeekFirst(SStreamState* pState, SStreamStateCur* pCur); diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 837d0c630310d723e1baf7715553565408029d0c..f6940b28958112d569c33b6f2b856c3231ca126f 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -565,6 +565,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_PAR_GET_META_ERROR TAOS_DEF_ERROR_CODE(0, 0x2662) #define TSDB_CODE_PAR_NOT_UNIQUE_TABLE_ALIAS TAOS_DEF_ERROR_CODE(0, 0x2663) #define TSDB_CODE_PAR_NOT_SUPPORT_JOIN TAOS_DEF_ERROR_CODE(0, 0x2664) +#define TSDB_CODE_PAR_INVALID_TAGS_PC TAOS_DEF_ERROR_CODE(0, 0x2665) #define TSDB_CODE_PAR_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x26FF) //planner diff --git a/packaging/cfg/nginxd.service b/packaging/cfg/nginxd.service deleted file mode 100644 index 50bbc1a21de5e6645404ec1d4e9bcd6f177f69d2..0000000000000000000000000000000000000000 --- a/packaging/cfg/nginxd.service +++ /dev/null @@ -1,22 +0,0 @@ -[Unit] -Description=Nginx For TDengine Service -After=network-online.target -Wants=network-online.target - -[Service] -Type=forking -PIDFile=/usr/local/nginxd/logs/nginx.pid -ExecStart=/usr/local/nginxd/sbin/nginx -ExecStop=/usr/local/nginxd/sbin/nginx -s stop -TimeoutStopSec=1000000s -LimitNOFILE=infinity -LimitNPROC=infinity -LimitCORE=infinity -TimeoutStartSec=0 -StandardOutput=null -Restart=always -StartLimitBurst=3 -StartLimitInterval=60s - -[Install] -WantedBy=multi-user.target diff --git a/packaging/check_package.sh b/packaging/check_package.sh index e728c6455abdb149d43a4e46d2b7730511b8800d..5c3a2f926731ffed236b5b859e483c7fc38c242b 100644 --- a/packaging/check_package.sh +++ b/packaging/check_package.sh @@ -38,8 +38,6 @@ temp_version="" fin_result="" service_config_dir="/etc/systemd/system" -nginx_port=6060 -nginx_dir="/usr/local/nginxd" # Color setting RED='\033[0;31m' @@ -132,10 +130,7 @@ function check_main_path() { check_file ${install_main_dir} $i done if [ "$verMode" == "cluster" ]; then - nginx_main_dir=("admin" "conf" "html" "sbin" "logs") - for i in "${nginx_main_dir[@]}";do - check_file ${nginx_dir} $i - done + check_file ${install_main_dir} "share/admin" fi echo -e "Check main path:\033[32mOK\033[0m!" } @@ -150,9 +145,6 @@ function check_bin_path() { for i in "${lbin_dir[@]}";do check_link ${bin_link_dir}/$i done - if [ "$verMode" == "cluster" ]; then - check_file ${nginx_dir}/sbin nginx - fi echo -e "Check bin path:\033[32mOK\033[0m!" } diff --git a/packaging/release.sh b/packaging/release.sh index 2452ee18134027aa31ef0963294dc162c6ec82ed..9ebbc50a84ffb762a2440b840fce8064bb4b7f2b 100755 --- a/packaging/release.sh +++ b/packaging/release.sh @@ -219,12 +219,12 @@ fi if [[ "$cpuType" == "x64" ]] || [[ "$cpuType" == "aarch64" ]] || [[ "$cpuType" == "aarch32" ]] || [[ "$cpuType" == "arm64" ]] || [[ "$cpuType" == "arm32" ]] || [[ "$cpuType" == "mips64" ]]; then if [ "$verMode" != "cluster" ]; then # community-version compile - cmake ../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DPAGMODE=${pagMode} -DBUILD_HTTP=${BUILD_HTTP} -DBUILD_TOOLS=${BUILD_TOOLS} ${allocator_macro} + cmake ../ -DCPUTYPE=${cpuType} -DWEBSOCKET=true -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DPAGMODE=${pagMode} -DBUILD_HTTP=${BUILD_HTTP} -DBUILD_TOOLS=${BUILD_TOOLS} ${allocator_macro} else if [[ "$dbName" != "taos" ]]; then replace_enterprise_$dbName fi - cmake ../../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DBUILD_HTTP=${BUILD_HTTP} -DBUILD_TOOLS=${BUILD_TOOLS} ${allocator_macro} + cmake ../../ -DCPUTYPE=${cpuType} -DWEBSOCKET=true -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DBUILD_HTTP=${BUILD_HTTP} -DBUILD_TOOLS=${BUILD_TOOLS} ${allocator_macro} fi else echo "input cpuType=${cpuType} error!!!" diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index 5088e9bdac6e3da77cfd5c84cf33b9f541db8a07..9694a89a8f8376e871c1e45434fb64d4e9c4408f 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -50,8 +50,7 @@ install_main_dir=${installDir} bin_dir="${installDir}/bin" service_config_dir="/etc/systemd/system" -nginx_port=6060 -nginx_dir="/usr/local/nginxd" +web_port=6041 # Color setting RED='\033[0;31m' @@ -182,7 +181,7 @@ function install_main_path() { ${csudo}mkdir -p ${install_main_dir}/include # ${csudo}mkdir -p ${install_main_dir}/init.d if [ "$verMode" == "cluster" ]; then - ${csudo}mkdir -p ${nginx_dir} + ${csudo}mkdir -p ${install_main_dir}/share fi if [[ -e ${script_dir}/email ]]; then @@ -218,12 +217,6 @@ function install_bin() { [ -x ${install_main_dir}/bin/TDinsight.sh ] && ${csudo}ln -s ${install_main_dir}/bin/TDinsight.sh ${bin_link_dir}/TDinsight.sh || : [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || : [ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || : - - if [ "$verMode" == "cluster" ]; then - ${csudo}cp -r ${script_dir}/nginxd/* ${nginx_dir} && ${csudo}chmod 0555 ${nginx_dir}/* - ${csudo}mkdir -p ${nginx_dir}/logs - ${csudo}chmod 777 ${nginx_dir}/sbin/nginx - fi } function install_lib() { @@ -574,6 +567,13 @@ function install_examples() { fi } +function install_web() { + if [ -d "${script_dir}/share" ]; then + ${csudo}cp -rf ${script_dir}/share/* ${install_main_dir}/share + fi +} + + function clean_service_on_sysvinit() { if pidof ${serverName} &>/dev/null; then ${csudo}service ${serverName} stop || : @@ -654,16 +654,6 @@ function clean_service_on_systemd() { fi ${csudo}systemctl disable tarbitratord &>/dev/null || echo &>/dev/null ${csudo}rm -f ${tarbitratord_service_config} - - if [ "$verMode" == "cluster" ]; then - nginx_service_config="${service_config_dir}/nginxd.service" - if systemctl is-active --quiet nginxd; then - echo "Nginx for ${productName} is running, stopping it..." - ${csudo}systemctl stop nginxd &>/dev/null || echo &>/dev/null - fi - ${csudo}systemctl disable nginxd &>/dev/null || echo &>/dev/null - ${csudo}rm -f ${nginx_service_config} - fi } function install_service_on_systemd() { @@ -677,19 +667,6 @@ function install_service_on_systemd() { ${csudo}systemctl enable ${serverName} ${csudo}systemctl daemon-reload - - if [ "$verMode" == "cluster" ]; then - [ -f ${script_dir}/cfg/nginxd.service ] && - ${csudo}cp ${script_dir}/cfg/nginxd.service \ - ${service_config_dir}/ || : - ${csudo}systemctl daemon-reload - - if ! ${csudo}systemctl enable nginxd &>/dev/null; then - ${csudo}systemctl daemon-reexec - ${csudo}systemctl enable nginxd - fi - ${csudo}systemctl start nginxd - fi } function install_adapter_service() { @@ -793,19 +770,6 @@ function updateProduct() { sleep 1 fi - if [ "$verMode" == "cluster" ]; then - if pidof nginx &>/dev/null; then - if ((${service_mod} == 0)); then - ${csudo}systemctl stop nginxd || : - elif ((${service_mod} == 1)); then - ${csudo}service nginxd stop || : - else - kill_process nginx - fi - sleep 1 - fi - fi - install_main_path install_log @@ -817,6 +781,7 @@ function updateProduct() { fi install_examples + install_web if [ -z $1 ]; then install_bin install_service @@ -825,18 +790,6 @@ function updateProduct() { install_adapter_config openresty_work=false - if [ "$verMode" == "cluster" ]; then - # Check if openresty is installed - # Check if nginx is installed successfully - if type curl &>/dev/null; then - if curl -sSf http://127.0.0.1:${nginx_port} &>/dev/null; then - echo -e "\033[44;32;1mNginx for ${productName} is updated successfully!${NC}" - openresty_work=true - else - echo -e "\033[44;31;5mNginx for ${productName} does not work! Please try again!\033[0m" - fi - fi - fi echo echo -e "${GREEN_DARK}To configure ${productName} ${NC}: edit ${cfg_install_dir}/${configFile}" @@ -857,7 +810,7 @@ function updateProduct() { fi if [ ${openresty_work} = 'true' ]; then - echo -e "${GREEN_DARK}To access ${productName} ${NC}: use ${GREEN_UNDERLINE}${clientName} -h $serverFqdn${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}" + echo -e "${GREEN_DARK}To access ${productName} ${NC}: use ${GREEN_UNDERLINE}${clientName} -h $serverFqdn${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${web_port}${NC}" else echo -e "${GREEN_DARK}To access ${productName} ${NC}: use ${GREEN_UNDERLINE}${clientName} -h $serverFqdn${NC} in shell${NC}" fi @@ -906,6 +859,7 @@ function installProduct() { install_connector fi install_examples + install_web if [ -z $1 ]; then # install service and client # For installing new @@ -915,17 +869,6 @@ function installProduct() { install_adapter_config openresty_work=false - if [ "$verMode" == "cluster" ]; then - # Check if nginx is installed successfully - if type curl &>/dev/null; then - if curl -sSf http://127.0.0.1:${nginx_port} &>/dev/null; then - echo -e "\033[44;32;1mNginx for ${productName} is installed successfully!${NC}" - openresty_work=true - else - echo -e "\033[44;31;5mNginx for ${productName} does not work! Please try again!\033[0m" - fi - fi - fi install_config diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh index d1e7a222cc1739cca1e90fe268f8512326e36ae5..58b43850013a27147e76c0eb7a6e4c9a219b3303 100755 --- a/packaging/tools/make_install.sh +++ b/packaging/tools/make_install.sh @@ -151,6 +151,7 @@ function install_main_path() { ${csudo}mkdir -p ${install_main_dir}/driver ${csudo}mkdir -p ${install_main_dir}/examples ${csudo}mkdir -p ${install_main_dir}/include + ${csudo}mkdir -p ${install_main_dir}/share # ${csudo}mkdir -p ${install_main_dir}/init.d else ${csudo}rm -rf ${install_main_dir} || ${csudo}rm -rf ${install_main_2_dir} || : @@ -161,6 +162,7 @@ function install_main_path() { ${csudo}mkdir -p ${install_main_dir}/driver || ${csudo}mkdir -p ${install_main_2_dir}/driver ${csudo}mkdir -p ${install_main_dir}/examples || ${csudo}mkdir -p ${install_main_2_dir}/examples ${csudo}mkdir -p ${install_main_dir}/include || ${csudo}mkdir -p ${install_main_2_dir}/include + ${csudo}mkdir -p ${install_main_dir}/share || ${csudo}mkdir -p ${install_main_2_dir}/share fi } @@ -469,6 +471,16 @@ function install_examples() { fi } +function install_web() { + if [ -d "${binary_dir}/build/share" ]; then + if [ "$osType" != "Darwin" ]; then + ${csudo}cp -rf ${binary_dir}/build/share/* ${install_main_dir}/share || : + else + ${csudo}cp -rf ${binary_dir}/build/share/* ${install_main_dir}/share || ${csudo}cp -rf ${binary_dir}/build/share/* ${install_main_2_dir}/share || : + fi + fi +} + function clean_service_on_sysvinit() { if pidof ${serverName} &>/dev/null; then ${csudo}service ${serverName} stop || : @@ -596,6 +608,7 @@ function update_TDengine() { install_lib # install_connector install_examples + install_web install_bin install_service diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index 2305b96b3663c3c52ca84988518de3fd00769af8..fb0ef4f9a30f11db261103ae10d8cde3e2b19aab 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -107,7 +107,7 @@ else fi install_files="${script_dir}/install.sh" -nginx_dir="${top_dir}/../enterprise/src/plugins/web" +web_dir="${top_dir}/../enterprise/src/plugins/web" init_file_deb=${script_dir}/../deb/taosd init_file_rpm=${script_dir}/../rpm/taosd @@ -132,10 +132,6 @@ if [ -f "${cfg_dir}/${serverName}.service" ]; then cp ${cfg_dir}/${serverName}.service ${install_dir}/cfg || : fi -if [ -f "${top_dir}/packaging/cfg/nginxd.service" ]; then - cp ${top_dir}/packaging/cfg/nginxd.service ${install_dir}/cfg || : -fi - mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || : mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/${serverName}.deb mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/${serverName}.rpm @@ -222,16 +218,6 @@ if [ "$verMode" == "cluster" ]; then sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove.sh >>remove_temp.sh mv remove_temp.sh ${install_dir}/bin/remove.sh - mkdir -p ${install_dir}/nginxd && cp -r ${nginx_dir}/* ${install_dir}/nginxd - cp ${nginx_dir}/png/taos.png ${install_dir}/nginxd/admin/images/taos.png - rm -rf ${install_dir}/nginxd/png - - if [ "$cpuType" == "aarch64" ]; then - cp -f ${install_dir}/nginxd/sbin/arm/64bit/nginx ${install_dir}/nginxd/sbin/ - elif [ "$cpuType" == "aarch32" ]; then - cp -f ${install_dir}/nginxd/sbin/arm/32bit/nginx ${install_dir}/nginxd/sbin/ - fi - rm -rf ${install_dir}/nginxd/sbin/arm fi cd ${install_dir} @@ -288,6 +274,13 @@ if [[ $dbName == "taos" ]]; then cp -r ${examples_dir}/C# ${install_dir}/examples mkdir -p ${install_dir}/examples/taosbenchmark-json && cp ${examples_dir}/../tools/taos-tools/example/* ${install_dir}/examples/taosbenchmark-json fi + + # Add web files + if [ -d "${web_dir}/admin" ]; then + mkdir -p ${install_dir}/share/ + cp ${web_dir}/admin ${install_dir}/share/ -r + cp ${web_dir}/png/taos.png ${install_dir}/share/admin/images/taos.png + fi fi # Copy driver diff --git a/packaging/tools/remove.sh b/packaging/tools/remove.sh index bf4ff564f56c3fa1a35418c6a1d3a0a372596e03..a648750904c9102c1786f5d1de1655a54d1e0a9a 100755 --- a/packaging/tools/remove.sh +++ b/packaging/tools/remove.sh @@ -27,13 +27,11 @@ local_bin_link_dir="/usr/local/bin" lib_link_dir="/usr/lib" lib64_link_dir="/usr/lib64" inc_link_dir="/usr/include" -install_nginxd_dir="/usr/local/nginxd" service_config_dir="/etc/systemd/system" taos_service_name=${serverName} taosadapter_service_name="taosadapter" tarbitrator_service_name="tarbitratord" -nginx_service_name="nginxd" csudo="" if command -v sudo >/dev/null; then csudo="sudo " @@ -153,18 +151,6 @@ function clean_service_on_systemd() { fi ${csudo}systemctl disable ${tarbitrator_service_name} &>/dev/null || echo &>/dev/null ${csudo}rm -f ${tarbitratord_service_config} - - if [ "$verMode" == "cluster" ]; then - nginx_service_config="${service_config_dir}/${nginx_service_name}.service" - if [ -d ${install_nginxd_dir} ]; then - if systemctl is-active --quiet ${nginx_service_name}; then - echo "Nginx for ${productName} is running, stopping it..." - ${csudo}systemctl stop ${nginx_service_name} &>/dev/null || echo &>/dev/null - fi - ${csudo}systemctl disable ${nginx_service_name} &>/dev/null || echo &>/dev/null - ${csudo}rm -f ${nginx_service_config} - fi - fi } function clean_service_on_sysvinit() { @@ -239,7 +225,6 @@ clean_config ${csudo}rm -rf ${data_link_dir} || : ${csudo}rm -rf ${install_main_dir} -${csudo}rm -rf ${install_nginxd_dir} if [[ -e /etc/os-release ]]; then osinfo=$(awk -F= '/^NAME/{print $2}' /etc/os-release) else diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 6a4ef3d821ce4180e40b48d58f423477997628e7..5792f498efddfdf43a7bab3ce3d47aebaa512a36 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -19,6 +19,7 @@ #include "functionMgt.h" #include "os.h" #include "query.h" +#include "qworker.h" #include "scheduler.h" #include "tcache.h" #include "tglobal.h" @@ -27,7 +28,6 @@ #include "trpc.h" #include "tsched.h" #include "ttime.h" -#include "qworker.h" #define TSC_VAR_NOT_RELEASE 1 #define TSC_VAR_RELEASED 0 @@ -70,11 +70,10 @@ static void deregisterRequest(SRequestObj *pRequest) { int32_t currentInst = atomic_sub_fetch_64((int64_t *)&pActivity->currentRequests, 1); int32_t num = atomic_sub_fetch_32(&pTscObj->numOfReqs, 1); - int64_t nowUs = taosGetTimestampUs(); - int64_t duration = nowUs - pRequest->metric.start; - tscDebug("0x%" PRIx64 " free Request from connObj: 0x%" PRIx64 ", reqId:0x%" PRIx64 " elapsed:%" PRIu64 - " ms, current:%d, app current:%d", - pRequest->self, pTscObj->id, pRequest->requestId, duration / 1000, num, currentInst); + int64_t duration = taosGetTimestampUs() - pRequest->metric.start; + tscDebug("0x%" PRIx64 " free Request from connObj: 0x%" PRIx64 ", reqId:0x%" PRIx64 " elapsed:%.2f ms, " + "current:%d, app current:%d", + pRequest->self, pTscObj->id, pRequest->requestId, duration / 1000.0, num, currentInst); if (QUERY_NODE_VNODE_MODIF_STMT == pRequest->stmtType) { tscPerf("insert duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64 @@ -85,11 +84,12 @@ static void deregisterRequest(SRequestObj *pRequest) { atomic_add_fetch_64((int64_t *)&pActivity->insertElapsedTime, duration); } else if (QUERY_NODE_SELECT_STMT == pRequest->stmtType) { tscPerf("select duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64 - "us, planner:%" PRId64 "us, exec:%" PRId64 "us", + "us, planner:%" PRId64 "us, exec:%" PRId64 "us, reqId:0x%"PRIx64, duration, pRequest->metric.syntaxEnd - pRequest->metric.syntaxStart, pRequest->metric.ctgEnd - pRequest->metric.ctgStart, pRequest->metric.semanticEnd - pRequest->metric.ctgEnd, pRequest->metric.planEnd - pRequest->metric.semanticEnd, - pRequest->metric.resultReady - pRequest->metric.planEnd); + pRequest->metric.resultReady - pRequest->metric.planEnd, pRequest->requestId); + atomic_add_fetch_64((int64_t *)&pActivity->queryElapsedTime, duration); } diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index be907ea1e27cadb391f3010a3ba2e19735a83055..8ffc88ec28fea8de7059d97fface02ad42c0eadf 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -483,8 +483,8 @@ void setResPrecision(SReqResultInfo* pResInfo, int32_t precision) { int32_t buildVnodePolicyNodeList(SRequestObj* pRequest, SArray** pNodeList, SArray* pMnodeList, SArray* pDbVgList) { SArray* nodeList = taosArrayInit(4, sizeof(SQueryNodeLoad)); - char *policy = (tsQueryPolicy == QUERY_POLICY_VNODE) ? "vnode" : "client"; - + char* policy = (tsQueryPolicy == QUERY_POLICY_VNODE) ? "vnode" : "client"; + int32_t dbNum = taosArrayGetSize(pDbVgList); for (int32_t i = 0; i < dbNum; ++i) { SArray* pVg = taosArrayGetP(pDbVgList, i); @@ -815,7 +815,7 @@ int32_t handleCreateTbExecRes(void* res, SCatalog* pCatalog) { int32_t handleQueryExecRsp(SRequestObj* pRequest) { if (NULL == pRequest->body.resInfo.execRes.res) { - return TSDB_CODE_SUCCESS; + return pRequest->code; } SCatalog* pCatalog = NULL; @@ -868,44 +868,43 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) { return code; } +//todo refacto the error code mgmt void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) { SRequestObj* pRequest = (SRequestObj*)param; - pRequest->code = code; - - pRequest->metric.resultReady = taosGetTimestampUs(); + STscObj* pTscObj = pRequest->pTscObj; + pRequest->code = code; if (pResult) { destroyQueryExecRes(&pRequest->body.resInfo.execRes); memcpy(&pRequest->body.resInfo.execRes, pResult, sizeof(*pResult)); } - if (TDMT_VND_SUBMIT == pRequest->type || TDMT_VND_DELETE == pRequest->type || - TDMT_VND_CREATE_TABLE == pRequest->type) { + int32_t type = pRequest->type; + if (TDMT_VND_SUBMIT == type || TDMT_VND_DELETE == type || TDMT_VND_CREATE_TABLE == type) { if (pResult) { pRequest->body.resInfo.numOfRows = pResult->numOfRows; - if (TDMT_VND_SUBMIT == pRequest->type) { - STscObj* pTscObj = pRequest->pTscObj; + + // record the insert rows + if (TDMT_VND_SUBMIT == type) { SAppClusterSummary* pActivity = &pTscObj->pAppInfo->summary; atomic_add_fetch_64((int64_t*)&pActivity->numOfInsertRows, pResult->numOfRows); } } schedulerFreeJob(&pRequest->body.queryJob, 0); - - pRequest->metric.execEnd = taosGetTimestampUs(); } taosMemoryFree(pResult); + tscDebug("0x%" PRIx64 " enter scheduler exec cb, code:%s, reqId:0x%" PRIx64, pRequest->self, tstrerror(code), + pRequest->requestId); - tscDebug("0x%" PRIx64 " enter scheduler exec cb, code:%d - %s, reqId:0x%" PRIx64, pRequest->self, code, - tstrerror(code), pRequest->requestId); - - STscObj* pTscObj = pRequest->pTscObj; if (code != TSDB_CODE_SUCCESS && NEED_CLIENT_HANDLE_ERROR(code) && pRequest->sqlstr != NULL) { - tscDebug("0x%" PRIx64 " client retry to handle the error, code:%d - %s, tryCount:%d, reqId:0x%" PRIx64, - pRequest->self, code, tstrerror(code), pRequest->retry, pRequest->requestId); + tscDebug("0x%" PRIx64 " client retry to handle the error, code:%s, tryCount:%d, reqId:0x%" PRIx64, + pRequest->self, tstrerror(code), pRequest->retry, pRequest->requestId); pRequest->prevCode = code; schedulerFreeJob(&pRequest->body.queryJob, 0); + qDestroyQuery(pRequest->pQuery); + pRequest->pQuery = NULL; doAsyncQuery(pRequest, true); return; } @@ -915,7 +914,11 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) { removeMeta(pTscObj, pRequest->targetTableList); } - handleQueryExecRsp(pRequest); + pRequest->metric.execEnd = taosGetTimestampUs(); + int32_t code1 = handleQueryExecRsp(pRequest); + if (pRequest->code == TSDB_CODE_SUCCESS && pRequest->code != code1) { + pRequest->code = code1; + } // return to client pRequest->body.queryFp(pRequest->body.param, pRequest, code); @@ -1056,7 +1059,6 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData* pResultM } pRequest->metric.planEnd = taosGetTimestampUs(); - if (TSDB_CODE_SUCCESS == code && !pRequest->validateOnly) { SArray* pNodeList = NULL; buildAsyncExecNodeList(pRequest, &pNodeList, pMnodeList, pResultMeta); diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 650b16f8553a88b662f00ab5dba2951ad9ef2984..5b255a28ea8e125145f1bdb2a2bfcca5d6fc61f5 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -20,13 +20,13 @@ #include "functionMgt.h" #include "os.h" #include "query.h" +#include "qworker.h" #include "scheduler.h" #include "tglobal.h" #include "tmsg.h" #include "tref.h" #include "trpc.h" #include "version.h" -#include "qworker.h" #define TSC_VAR_NOT_RELEASE 1 #define TSC_VAR_RELEASED 0 @@ -700,6 +700,7 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) { SQuery *pQuery = pRequest->pQuery; pRequest->metric.ctgEnd = taosGetTimestampUs(); + qDebug("0x%" PRIx64 " start to semantic analysis, reqId:0x%" PRIx64, pRequest->self, pRequest->requestId); if (code == TSDB_CODE_SUCCESS) { code = qAnalyseSqlSemantic(pWrapper->pCtx, &pWrapper->catalogReq, pResultMeta, pQuery); @@ -723,13 +724,16 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) { destorySqlParseWrapper(pWrapper); - tscDebug("0x%" PRIx64 " analysis semantics completed, start async query, reqId:0x%" PRIx64, pRequest->self, - pRequest->requestId); + double el = (pRequest->metric.semanticEnd - pRequest->metric.ctgEnd)/1000.0; + tscDebug("0x%" PRIx64 " analysis semantics completed, start async query, elapsed time:%.2f ms, reqId:0x%" PRIx64, + pRequest->self, el, pRequest->requestId); + launchAsyncQuery(pRequest, pQuery, pResultMeta); } else { destorySqlParseWrapper(pWrapper); qDestroyQuery(pRequest->pQuery); pRequest->pQuery = NULL; + if (NEED_CLIENT_HANDLE_ERROR(code)) { tscDebug("0x%" PRIx64 " client retry to handle the error, code:%d - %s, tryCount:%d, reqId:0x%" PRIx64, pRequest->self, code, tstrerror(code), pRequest->retry, pRequest->requestId); @@ -813,7 +817,6 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) { pRequest->metric.syntaxEnd = taosGetTimestampUs(); if (!updateMetaForce) { - STscObj *pTscObj = pRequest->pTscObj; SAppClusterSummary *pActivity = &pTscObj->pAppInfo->summary; if (NULL == pRequest->pQuery->pRoot) { atomic_add_fetch_64((int64_t *)&pActivity->numOfInsertsReq, 1); @@ -860,6 +863,7 @@ static void fetchCallback(void *pResult, void *param, int32_t code) { SRequestObj *pRequest = (SRequestObj *)param; SReqResultInfo *pResultInfo = &pRequest->body.resInfo; + pRequest->metric.resultReady = taosGetTimestampUs(); tscDebug("0x%" PRIx64 " enter scheduler fetch cb, code:%d - %s, reqId:0x%" PRIx64, pRequest->self, code, tstrerror(code), pRequest->requestId); diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index c9c02a77e19b1984c39d3f4752620c505a69da37..66f992f05f94f1e583118044cea2271ec8fcd7ee 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -515,7 +515,7 @@ int32_t tmqCommitMsgImpl(tmq_t* tmq, const TAOS_RES* msg, int8_t async, tmq_comm SMqMetaRspObj* pMetaRspObj = (SMqMetaRspObj*)msg; topic = pMetaRspObj->topic; vgId = pMetaRspObj->vgId; - } else if(TD_RES_TMQ_METADATA(msg)) { + } else if (TD_RES_TMQ_METADATA(msg)) { SMqTaosxRspObj* pRspObj = (SMqTaosxRspObj*)msg; topic = pRspObj->topic; vgId = pRspObj->vgId; @@ -715,7 +715,7 @@ void tmqSendHbReq(void* param, void* tmrId) { int32_t epoch = tmq->epoch; SMqHbReq* pReq = taosMemoryMalloc(sizeof(SMqHbReq)); if (pReq == NULL) goto OVER; - pReq->consumerId = consumerId; + pReq->consumerId = htobe64(consumerId); pReq->epoch = epoch; SMsgSendInfo* sendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo)); @@ -1603,6 +1603,7 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { return NULL; } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__POLL_RSP) { SMqPollRspWrapper* pollRspWrapper = (SMqPollRspWrapper*)rspWrapper; + tscDebug("consumer %ld actual process poll rsp", tmq->consumerId); /*atomic_sub_fetch_32(&tmq->readyRequest, 1);*/ int32_t consumerEpoch = atomic_load_32(&tmq->epoch); if (pollRspWrapper->dataRsp.head.epoch == consumerEpoch) { @@ -1661,9 +1662,9 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { // build rsp void* pRsp = NULL; - if(pollRspWrapper->taosxRsp.createTableNum == 0){ + if (pollRspWrapper->taosxRsp.createTableNum == 0) { pRsp = tmqBuildRspFromWrapper(pollRspWrapper); - }else{ + } else { pRsp = tmqBuildTaosxRspFromWrapper(pollRspWrapper); } taosFreeQitem(pollRspWrapper); @@ -1718,7 +1719,10 @@ TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) { while (1) { tmqHandleAllDelayedTask(tmq); - if (tmqPollImpl(tmq, timeout) < 0) return NULL; + if (tmqPollImpl(tmq, timeout) < 0) { + tscDebug("return since poll err"); + /*return NULL;*/ + } rspObj = tmqHandleAllRsp(tmq, timeout, false); if (rspObj) { @@ -1850,12 +1854,12 @@ const char* tmq_get_table_name(TAOS_RES* res) { return (const char*)taosArrayGetP(pRspObj->rsp.blockTbName, pRspObj->resIter); } else if (TD_RES_TMQ_METADATA(res)) { SMqTaosxRspObj* pRspObj = (SMqTaosxRspObj*)res; - if (!pRspObj->rsp.withTbName || pRspObj->rsp.blockTbName == NULL || pRspObj->resIter < 0 || - pRspObj->resIter >= pRspObj->rsp.blockNum) { - return NULL; - } - return (const char*)taosArrayGetP(pRspObj->rsp.blockTbName, pRspObj->resIter); + if (!pRspObj->rsp.withTbName || pRspObj->rsp.blockTbName == NULL || pRspObj->resIter < 0 || + pRspObj->resIter >= pRspObj->rsp.blockNum) { + return NULL; } + return (const char*)taosArrayGetP(pRspObj->rsp.blockTbName, pRspObj->resIter); + } return NULL; } diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 41d170686eda5c28b29a33c680687c95e41e27f6..c0203dadb82066992510fde7143a82d68afb023b 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -85,8 +85,7 @@ uint16_t tsTelemPort = 80; char tsSmlTagName[TSDB_COL_NAME_LEN] = "_tag_null"; char tsSmlChildTableName[TSDB_TABLE_NAME_LEN] = ""; // user defined child table name can be specified in tag value. // If set to empty system will generate table name using MD5 hash. -bool tsSmlDataFormat = - true; // true means that the name and order of cols in each line are the same(only for influx protocol) +bool tsSmlDataFormat = false; // true means that the name and order of cols in each line are the same(only for influx protocol) // query int32_t tsQueryPolicy = 1; @@ -95,6 +94,7 @@ int32_t tsQueryRsmaTolerance = 1000; // the tolerance time (ms) to judge from w bool tsQueryPlannerTrace = false; int32_t tsQueryNodeChunkSize = 32 * 1024; bool tsQueryUseNodeAllocator = true; +bool tsKeepColumnName = false; /* * denote if the server needs to compress response message at the application layer to client, including query rsp, @@ -292,6 +292,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) { if (cfgAddBool(pCfg, "queryPlannerTrace", tsQueryPlannerTrace, true) != 0) return -1; if (cfgAddInt32(pCfg, "queryNodeChunkSize", tsQueryNodeChunkSize, 1024, 128 * 1024, true) != 0) return -1; if (cfgAddBool(pCfg, "queryUseNodeAllocator", tsQueryUseNodeAllocator, true) != 0) return -1; + if (cfgAddBool(pCfg, "keepColumnName", tsKeepColumnName, true) != 0) return -1; if (cfgAddString(pCfg, "smlChildTableName", "", 1) != 0) return -1; if (cfgAddString(pCfg, "smlTagName", tsSmlTagName, 1) != 0) return -1; if (cfgAddBool(pCfg, "smlDataFormat", tsSmlDataFormat, 1) != 0) return -1; @@ -654,6 +655,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) { tsQueryPlannerTrace = cfgGetItem(pCfg, "queryPlannerTrace")->bval; tsQueryNodeChunkSize = cfgGetItem(pCfg, "queryNodeChunkSize")->i32; tsQueryUseNodeAllocator = cfgGetItem(pCfg, "queryUseNodeAllocator")->bval; + tsKeepColumnName = cfgGetItem(pCfg, "keepColumnName")->bval; return 0; } @@ -847,6 +849,9 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) { break; } case 'k': { + if (strcasecmp("keepColumnName", name) == 0) { + tsKeepColumnName = cfgGetItem(pCfg, "keepColumnName")->bval; + } break; } case 'l': { @@ -923,9 +928,9 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) { } case 'u': { if (strcasecmp("multiProcess", name) == 0) { - #if !defined(WINDOWS) && !defined(DARWIN) +#if !defined(WINDOWS) && !defined(DARWIN) tsMultiProcess = cfgGetItem(pCfg, "multiProcess")->bval; - #endif +#endif } else if (strcasecmp("udfDebugFlag", name) == 0) { udfDebugFlag = cfgGetItem(pCfg, "udfDebugFlag")->i32; } diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index abc23e3d95e1455ed7f23b1d0f630a4af1302558..3dfc10e5544bf3c348349ede2e88896721c6174b 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -272,6 +272,7 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) { SMqConsumerObj *pConsumer = mndAcquireConsumer(pMnode, consumerId); if (pConsumer == NULL) { + mError("consumer %ld not exist", consumerId); terrno = TSDB_CODE_MND_CONSUMER_NOT_EXIST; return -1; } diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index 662f524e0893f466b36d11adb020066498f68e8b..ce195454f8d6746dce07c33fe92e15abb85a50e4 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -379,6 +379,8 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq * topicObj.ast = strdup(pCreate->ast); topicObj.astLen = strlen(pCreate->ast) + 1; + qDebugL("ast %s", topicObj.ast); + SNode *pAst = NULL; if (nodesStringToNode(pCreate->ast, &pAst) != 0) { taosMemoryFree(topicObj.ast); diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 6ba10641f5e7054034f2008f1b317ec8121286c6..f0fb8d4b021da7ace48bf513ff2aabb5d3e920ba 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -217,7 +217,7 @@ int32_t tqReaderRemoveTbUidList(STqReader *pReader, const SArray *tbUidList); int32_t tqSeekVer(STqReader *pReader, int64_t ver); int32_t tqNextBlock(STqReader *pReader, SFetchRet *ret); -int32_t tqReaderSetDataMsg(STqReader *pReader, SSubmitReq *pMsg, int64_t ver); +int32_t tqReaderSetDataMsg(STqReader *pReader, const SSubmitReq *pMsg, int64_t ver); bool tqNextDataBlock(STqReader *pReader); bool tqNextDataBlockFilterOut(STqReader *pReader, SHashObj *filterOutUids); int32_t tqRetrieveDataBlock(SSDataBlock *pBlock, STqReader *pReader); diff --git a/source/dnode/vnode/src/inc/tq.h b/source/dnode/vnode/src/inc/tq.h index c3441a43f0e736881fc8bc491dd5717223645ed4..f96afe6fba1b081d9511a3fdd6503be73fa1bdc3 100644 --- a/source/dnode/vnode/src/inc/tq.h +++ b/source/dnode/vnode/src/inc/tq.h @@ -113,10 +113,20 @@ typedef struct { } STqHandle; +typedef struct { + SMqDataRsp dataRsp; + SMqRspHead rspHead; + char subKey[TSDB_SUBSCRIBE_KEY_LEN]; + SRpcHandleInfo pInfo; +} STqPushEntry; + struct STQ { - SVnode* pVnode; - char* path; - SHashObj* pPushMgr; // consumerId -> STqHandle* + SVnode* pVnode; + char* path; + + SRWLatch pushLock; + + SHashObj* pPushMgr; // consumerId -> STqPushEntry SHashObj* pHandle; // subKey -> STqHandle SHashObj* pCheckInfo; // topic -> SAlterCheckInfo @@ -146,7 +156,9 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHea // tqExec int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SSubmitReq* pReq, STaosxRsp* pRsp); +int32_t tqAddBlockDataToRsp(const SSDataBlock* pBlock, SMqDataRsp* pRsp, int32_t numOfCols); int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, const SMqDataRsp* pRsp); +int32_t tqPushDataRsp(STQ* pTq, STqPushEntry* pPushEntry); // tqMeta int32_t tqMetaOpen(STQ* pTq); diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index c2f0d582798b3d8653bd57fe3cc97f2db24745de..75b2f7409626343d117b1e5840e7cfdb43e75d40 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -32,6 +32,12 @@ extern "C" { #define tsdbTrace(...) do { if (tsdbDebugFlag & DEBUG_TRACE) { taosPrintLog("TSD ", DEBUG_TRACE, tsdbDebugFlag, __VA_ARGS__); }} while(0) // clang-format on +#define TSDB_CHECK_CODE(CODE, LINO, LABEL) \ + if (CODE) { \ + LINO = __LINE__; \ + goto LABEL; \ + } + typedef struct TSDBROW TSDBROW; typedef struct TABLEID TABLEID; typedef struct TSDBKEY TSDBKEY; @@ -150,7 +156,7 @@ int32_t tCmprBlockL(void const *lhs, void const *rhs); int32_t tBlockDataCreate(SBlockData *pBlockData); void tBlockDataDestroy(SBlockData *pBlockData, int8_t deepClear); -int32_t tBlockDataInit(SBlockData *pBlockData, int64_t suid, int64_t uid, STSchema *pTSchema); +int32_t tBlockDataInit(SBlockData *pBlockData, TABLEID *pId, STSchema *pTSchema, int16_t *aCid, int32_t nCid); int32_t tBlockDataInitEx(SBlockData *pBlockData, SBlockData *pBlockDataFrom); void tBlockDataReset(SBlockData *pBlockData); int32_t tBlockDataAppendRow(SBlockData *pBlockData, TSDBROW *pRow, STSchema *pTSchema, int64_t uid); @@ -272,6 +278,7 @@ int32_t tsdbReadSttBlk(SDataFReader *pReader, int32_t iStt, SArray *aSttBlk); int32_t tsdbReadBlockSma(SDataFReader *pReader, SDataBlk *pBlock, SArray *aColumnDataAgg); int32_t tsdbReadDataBlock(SDataFReader *pReader, SDataBlk *pBlock, SBlockData *pBlockData); int32_t tsdbReadSttBlock(SDataFReader *pReader, int32_t iStt, SSttBlk *pSttBlk, SBlockData *pBlockData); +int32_t tsdbReadSttBlockEx(SDataFReader *pReader, int32_t iStt, SSttBlk *pSttBlk, SBlockData *pBlockData); // SDelFWriter int32_t tsdbDelFWriterOpen(SDelFWriter **ppWriter, SDelFile *pFile, STsdb *pTsdb); int32_t tsdbDelFWriterClose(SDelFWriter **ppWriter, int8_t sync); @@ -633,6 +640,9 @@ typedef struct SSttBlockLoadInfo { int32_t currentLoadBlockIndex; int32_t loadBlocks; double elapsedTime; + STSchema *pSchema; + int16_t *colIds; + int32_t numOfCols; } SSttBlockLoadInfo; typedef struct SMergeTree { @@ -652,13 +662,14 @@ typedef struct { } SSkmInfo; int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader *pFReader, uint64_t suid, uint64_t uid, - STimeWindow *pTimeWindow, SVersionRange *pVerRange, void *pLoadInfo, const char *idStr); + STimeWindow *pTimeWindow, SVersionRange *pVerRange, SSttBlockLoadInfo *pBlockLoadInfo, + bool destroyLoadInfo, const char *idStr); void tMergeTreeAddIter(SMergeTree *pMTree, SLDataIter *pIter); bool tMergeTreeNext(SMergeTree *pMTree); TSDBROW tMergeTreeGetRow(SMergeTree *pMTree); void tMergeTreeClose(SMergeTree *pMTree); -SSttBlockLoadInfo *tCreateLastBlockLoadInfo(); +SSttBlockLoadInfo *tCreateLastBlockLoadInfo(STSchema *pSchema, int16_t *colList, int32_t numOfCols); void resetLastBlockLoadInfo(SSttBlockLoadInfo *pLoadInfo); void getLastBlockLoadInfo(SSttBlockLoadInfo *pLoadInfo, int64_t *blocks, double *el); void *destroyLastBlockLoadInfo(SSttBlockLoadInfo *pLoadInfo); diff --git a/source/dnode/vnode/src/inc/vnd.h b/source/dnode/vnode/src/inc/vnd.h index 898e79928b8fbb3ceac2272b36e31b47690eee23..900d29b97ef36503ee1103231aff82b929512095 100644 --- a/source/dnode/vnode/src/inc/vnd.h +++ b/source/dnode/vnode/src/inc/vnd.h @@ -99,7 +99,6 @@ void vnodeSyncStart(SVnode* pVnode); void vnodeSyncClose(SVnode* pVnode); void vnodeRedirectRpcMsg(SVnode* pVnode, SRpcMsg* pMsg); bool vnodeIsLeader(SVnode* pVnode); -bool vnodeIsReadyForRead(SVnode* pVnode); bool vnodeIsRoleLeader(SVnode* pVnode); #ifdef __cplusplus diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c index f549ef84f80012b7969a2776e87a18a9e94120ae..2ef4e7510ecfe2be6ba0b1d6f75fa45ac0ff5bf3 100644 --- a/source/dnode/vnode/src/meta/metaQuery.c +++ b/source/dnode/vnode/src/meta/metaQuery.c @@ -872,7 +872,7 @@ SArray *metaGetSmaIdsByTable(SMeta *pMeta, tb_uid_t uid) { pSmaIdxKey = (SSmaIdxKey *)pCur->pKey; - if (taosArrayPush(pUids, &pSmaIdxKey->smaUid) < 0) { + if (!taosArrayPush(pUids, &pSmaIdxKey->smaUid)) { terrno = TSDB_CODE_OUT_OF_MEMORY; metaCloseSmaCursor(pCur); taosArrayDestroy(pUids); @@ -915,7 +915,7 @@ SArray *metaGetSmaTbUids(SMeta *pMeta) { } } - if (taosArrayPush(pUids, &uid) < 0) { + if (!taosArrayPush(pUids, &uid)) { terrno = TSDB_CODE_OUT_OF_MEMORY; metaCloseSmaCursor(pCur); taosArrayDestroy(pUids); diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index 2b44cdcef1e56b4ecac59e7e2eb331d0bde18311..fb5caad2691fca40e136ad204b0a90ac700d4337 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -213,7 +213,7 @@ static int32_t tdUpdateQTaskInfoFiles(SSma *pSma, SRSmaStat *pStat) { tdRSmaQTaskInfoGetFullName(TD_VID(pVnode), committed, tfsGetPrimaryPath(pVnode->pTfs), qTaskInfoFullName); if (taosCheckExistFile(qTaskInfoFullName)) { SQTaskFile qFile = {.nRef = 1, .padding = 0, .version = committed, .size = 0}; - if (taosArrayPush(pFS->aQTaskInf, &qFile) < 0) { + if (!taosArrayPush(pFS->aQTaskInf, &qFile)) { taosWUnLockLatch(RSMA_FS_LOCK(pStat)); terrno = TSDB_CODE_OUT_OF_MEMORY; return TSDB_CODE_FAILED; diff --git a/source/dnode/vnode/src/sma/smaEnv.c b/source/dnode/vnode/src/sma/smaEnv.c index ccf4ebb39f26032a329773ead8cd42e0f137e8ee..64e5e49d0b116a7bed6d8ad5be49388db14bbd96 100644 --- a/source/dnode/vnode/src/sma/smaEnv.c +++ b/source/dnode/vnode/src/sma/smaEnv.c @@ -386,7 +386,7 @@ int32_t tdCheckAndInitSmaEnv(SSma *pSma, int8_t smaType) { } break; default: - smaError("vgId:%d, undefined smaType:%", SMA_VID(pSma), smaType); + smaError("vgId:%d, undefined smaType:%" PRIi8, SMA_VID(pSma), smaType); return TSDB_CODE_FAILED; } diff --git a/source/dnode/vnode/src/sma/smaFS.c b/source/dnode/vnode/src/sma/smaFS.c index a5f4e8d2e8ed5d82e13cd8b19a032f9e394bff17..55378751eb729b046346d5d5aba3e37cc8c7ad4b 100644 --- a/source/dnode/vnode/src/sma/smaFS.c +++ b/source/dnode/vnode/src/sma/smaFS.c @@ -54,7 +54,7 @@ int32_t tdRSmaFSOpen(SSma *pSma, int64_t version) { if ((terrno = tdRSmaFSUpsertQTaskFile(RSMA_FS(pStat), &qTaskFile)) < 0) { goto _end; } - smaInfo("vgId:%d, open fs, version:%" PRIi64 ", ref:%" PRIi64, TD_VID(pVnode), qTaskFile.version, qTaskFile.nRef); + smaInfo("vgId:%d, open fs, version:%" PRIi64 ", ref:%d", TD_VID(pVnode), qTaskFile.version, qTaskFile.nRef); } _end: diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index 8d1525e081c1224394adf64c7d7ba8e5a6338cc7..27da9da02c2d6213d92ac4cf268e60a2680df839 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -196,7 +196,8 @@ static int32_t tdUpdateTbUidListImpl(SSma *pSma, tb_uid_t *suid, SArray *tbUids, if (!suid || !tbUids) { terrno = TSDB_CODE_INVALID_PTR; - smaError("vgId:%d, failed to get rsma info for uid:%" PRIi64 " since %s", SMA_VID(pSma), *suid, terrstr()); + smaError("vgId:%d, failed to get rsma info for uid:%" PRIi64 " since %s", SMA_VID(pSma), suid ? *suid : -1, + terrstr()); return TSDB_CODE_FAILED; } @@ -566,6 +567,7 @@ static int32_t tdUidStorePut(STbUidStore *pStore, tb_uid_t suid, tb_uid_t *uid) } if (!taosArrayPush(pUidArray, uid)) { terrno = TSDB_CODE_OUT_OF_MEMORY; + taosArrayDestroy(pUidArray); return TSDB_CODE_FAILED; } if (taosHashPut(pStore->uidHash, &suid, sizeof(suid), &pUidArray, sizeof(pUidArray)) < 0) { @@ -690,7 +692,8 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma while (1) { uint64_t ts; - int32_t code = qExecTaskOpt(taskInfo, pResList, &ts, NULL); + bool hasMore = false; + int32_t code = qExecTaskOpt(taskInfo, pResList, &ts, &hasMore, NULL); if (code < 0) { if (code == TSDB_CODE_QRY_IN_EXEC) { break; @@ -1677,13 +1680,13 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) { SRSmaInfoItem *pItem = NULL; if (!(pRSmaRef = taosHashGet(smaMgmt.refHash, ¶m, POINTER_BYTES))) { - smaDebug("rsma fetch task not start since rsma info item:%p not exist in refHash:%p, rsetId:%" PRIi64, param, - *(int64_t *)¶m, smaMgmt.refHash, smaMgmt.rsetId); + smaDebug("rsma fetch task not start since rsma info item:%p not exist in refHash:%p, rsetId:%d", param, + smaMgmt.refHash, smaMgmt.rsetId); return; } if (!(pStat = (SRSmaStat *)tdAcquireSmaRef(smaMgmt.rsetId, pRSmaRef->refId))) { - smaDebug("rsma fetch task not start since rsma stat already destroyed, rsetId:%" PRIi64 " refId:%d)", + smaDebug("rsma fetch task not start since rsma stat already destroyed, rsetId:%d refId:%" PRIi64 ")", smaMgmt.rsetId, pRSmaRef->refId); // pRSmaRef freed in taosHashRemove taosHashRemove(smaMgmt.refHash, ¶m, POINTER_BYTES); return; @@ -1692,7 +1695,7 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) { pSma = pStat->pSma; if (!(pRSmaInfo = tdAcquireRSmaInfoBySuid(pSma, pRSmaRef->suid))) { - smaDebug("rsma fetch task not start since rsma info not exist, rsetId:%" PRIi64 " refId:%d)", smaMgmt.rsetId, + smaDebug("rsma fetch task not start since rsma info not exist, rsetId:%d refId:%" PRIi64 ")", smaMgmt.rsetId, pRSmaRef->refId); // pRSmaRef freed in taosHashRemove tdReleaseSmaRef(smaMgmt.rsetId, pRSmaRef->refId); taosHashRemove(smaMgmt.refHash, ¶m, POINTER_BYTES); @@ -1700,7 +1703,7 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) { } if (RSMA_INFO_IS_DEL(pRSmaInfo)) { - smaDebug("rsma fetch task not start since rsma info already deleted, rsetId:%" PRIi64 " refId:%d)", smaMgmt.rsetId, + smaDebug("rsma fetch task not start since rsma info already deleted, rsetId:%d refId:%" PRIi64 ")", smaMgmt.rsetId, pRSmaRef->refId); // pRSmaRef freed in taosHashRemove tdReleaseRSmaInfo(pSma, pRSmaInfo); tdReleaseSmaRef(smaMgmt.rsetId, pRSmaRef->refId); @@ -1716,7 +1719,7 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) { case TASK_TRIGGER_STAT_PAUSED: case TASK_TRIGGER_STAT_CANCELLED: { smaDebug("vgId:%d, rsma fetch task not start for level %" PRIi8 " since stat is %" PRIi8 - ", rsetId rsetId:%" PRIi64 " refId:%d", + ", rsetId:%d refId:%" PRIi64, SMA_VID(pSma), pItem->level, rsmaTriggerStat, smaMgmt.rsetId, pRSmaRef->refId); if (rsmaTriggerStat == TASK_TRIGGER_STAT_PAUSED) { taosTmrReset(tdRSmaFetchTrigger, RSMA_FETCH_INTERVAL, pItem, smaMgmt.tmrHandle, &pItem->tmrId); @@ -1844,7 +1847,7 @@ static int32_t tdRSmaBatchExec(SSma *pSma, SRSmaInfo *pInfo, STaosQall *qall, SA void *msg = NULL; taosGetQitem(qall, (void **)&msg); if (msg) { - if (taosArrayPush(pSubmitArr, &msg) < 0) { + if (!taosArrayPush(pSubmitArr, &msg)) { tdFreeRSmaSubmitItems(pSubmitArr); goto _err; } diff --git a/source/dnode/vnode/src/sma/smaSnapshot.c b/source/dnode/vnode/src/sma/smaSnapshot.c index 5a0167a75fc799366396015f8323e770a217a1cb..4939fce20c1f672390551a906cac95c46eceef1a 100644 --- a/source/dnode/vnode/src/sma/smaSnapshot.c +++ b/source/dnode/vnode/src/sma/smaSnapshot.c @@ -70,6 +70,8 @@ int32_t rsmaSnapReaderOpen(SSma* pSma, int64_t sver, int64_t ever, SRSmaSnapRead return TSDB_CODE_SUCCESS; _err: + if (pReader) rsmaSnapReaderClose(&pReader); + *ppReader = NULL; smaError("vgId:%d, vnode snapshot rsma reader open failed since %s", TD_VID(pVnode), tstrerror(code)); return TSDB_CODE_FAILED; } @@ -101,8 +103,8 @@ static int32_t rsmaQTaskInfSnapReaderOpen(SRSmaSnapReader* pReader, int64_t vers if (!taosCheckExistFile(qTaskInfoFullName)) { tdRSmaFSUnRef(pSma, pStat, version); - smaInfo("vgId:%d, vnode snapshot rsma reader for qtaskinfo version %" PRIi64 " not need as %s not exists", - TD_VID(pVnode), qTaskInfoFullName); + smaInfo("vgId:%d, vnode snapshot rsma reader for qtaskinfo version %" PRIi64 " not need as %s not exist", + TD_VID(pVnode), version, qTaskInfoFullName); return TSDB_CODE_SUCCESS; } @@ -336,6 +338,7 @@ int32_t rsmaSnapWriterOpen(SSma* pSma, int64_t sver, int64_t ever, SRSmaSnapWrit tdRSmaQTaskInfoGetFullName(TD_VID(pVnode), 0, tfsGetPrimaryPath(pVnode->pTfs), qTaskInfoFullName); TdFilePtr qTaskF = taosCreateFile(qTaskInfoFullName, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC); if (!qTaskF) { + taosMemoryFree(qWriter); code = TAOS_SYSTEM_ERROR(errno); smaError("vgId:%d, rsma snapshot writer open %s failed since %s", TD_VID(pSma->pVnode), qTaskInfoFullName, tstrerror(code)); @@ -356,6 +359,7 @@ int32_t rsmaSnapWriterOpen(SSma* pSma, int64_t sver, int64_t ever, SRSmaSnapWrit _err: smaError("vgId:%d, rsma snapshot writer open failed since %s", TD_VID(pSma->pVnode), tstrerror(code)); + if (pWriter) rsmaSnapWriterClose(&pWriter, 0); *ppWriter = NULL; return code; } @@ -449,11 +453,11 @@ static int32_t rsmaSnapWriteQTaskInfo(SRSmaSnapWriter* pWriter, uint8_t* pData, code = TAOS_SYSTEM_ERROR(errno); goto _err; } + smaInfo("vgId:%d, vnode snapshot rsma write qtaskinfo %s succeed", SMA_VID(pWriter->pSma), qWriter->fname); } else { smaInfo("vgId:%d, vnode snapshot rsma write qtaskinfo is not needed", SMA_VID(pWriter->pSma)); } - smaInfo("vgId:%d, vnode snapshot rsma write qtaskinfo %s succeed", SMA_VID(pWriter->pSma), qWriter->fname); _exit: return code; diff --git a/source/dnode/vnode/src/sma/smaUtil.c b/source/dnode/vnode/src/sma/smaUtil.c index a4ba0a61a57b781ff062328fe18920f3ce15dacc..6d7b7df1ee4061070328ccf8522b04ecc8bccd49 100644 --- a/source/dnode/vnode/src/sma/smaUtil.c +++ b/source/dnode/vnode/src/sma/smaUtil.c @@ -290,19 +290,19 @@ int32_t tdRemoveTFile(STFile *pTFile) { void *tdAcquireSmaRef(int32_t rsetId, int64_t refId) { void *pResult = taosAcquireRef(rsetId, refId); if (!pResult) { - smaWarn("rsma acquire ref for rsetId:%" PRIi64 " refId:%d failed since %s", rsetId, refId, terrstr()); + smaWarn("rsma acquire ref for rsetId:%d refId:%" PRIi64 " failed since %s", rsetId, refId, terrstr()); } else { - smaDebug("rsma acquire ref for rsetId:%" PRIi64 " refId:%d success", rsetId, refId); + smaDebug("rsma acquire ref for rsetId:%d refId:%" PRIi64 " success", rsetId, refId); } return pResult; } int32_t tdReleaseSmaRef(int32_t rsetId, int64_t refId) { if (taosReleaseRef(rsetId, refId) < 0) { - smaWarn("rsma release ref for rsetId:%" PRIi64 " refId:%d failed since %s", rsetId, refId, terrstr()); + smaWarn("rsma release ref for rsetId:%d refId:%" PRIi64 " failed since %s", rsetId, refId, terrstr()); return TSDB_CODE_FAILED; } - smaDebug("rsma release ref for rsetId:%" PRIi64 " refId:%d success", rsetId, refId); + smaDebug("rsma release ref for rsetId:%d refId:%" PRIi64 " success", rsetId, refId); return TSDB_CODE_SUCCESS; } \ No newline at end of file diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 76f3c1b12d7e8e4ae27b38d3a3907ae933d7d904..ed5a89441665d27f868acece7504fecadba998a7 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -65,6 +65,11 @@ static void destroySTqHandle(void* data) { } } +static void tqPushEntryFree(void* data) { + STqPushEntry* p = *(void**)data; + taosMemoryFree(p); +} + STQ* tqOpen(const char* path, SVnode* pVnode) { STQ* pTq = taosMemoryCalloc(1, sizeof(STQ)); if (pTq == NULL) { @@ -78,7 +83,9 @@ STQ* tqOpen(const char* path, SVnode* pVnode) { taosHashSetFreeFp(pTq->pHandle, destroySTqHandle); - pTq->pPushMgr = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_ENTRY_LOCK); + taosInitRWLatch(&pTq->pushLock); + pTq->pPushMgr = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK); + taosHashSetFreeFp(pTq->pPushMgr, tqPushEntryFree); pTq->pCheckInfo = taosHashInit(64, MurmurHash3_32, true, HASH_ENTRY_LOCK); @@ -153,6 +160,65 @@ int32_t tqSendMetaPollRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, return 0; } +int32_t tqPushDataRsp(STQ* pTq, STqPushEntry* pPushEntry) { + SMqDataRsp* pRsp = &pPushEntry->dataRsp; + + ASSERT(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum); + ASSERT(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum); + + ASSERT(!pRsp->withSchema); + ASSERT(taosArrayGetSize(pRsp->blockSchema) == 0); + + if (pRsp->reqOffset.type == TMQ_OFFSET__LOG) { + if (pRsp->blockNum > 0) { + ASSERT(pRsp->rspOffset.version > pRsp->reqOffset.version); + } else { + ASSERT(pRsp->rspOffset.version >= pRsp->reqOffset.version); + } + } + + int32_t len = 0; + int32_t code = 0; + tEncodeSize(tEncodeSMqDataRsp, pRsp, len, code); + + if (code < 0) { + return -1; + } + + int32_t tlen = sizeof(SMqRspHead) + len; + void* buf = rpcMallocCont(tlen); + if (buf == NULL) { + return -1; + } + + memcpy(buf, &pPushEntry->rspHead, sizeof(SMqRspHead)); + + void* abuf = POINTER_SHIFT(buf, sizeof(SMqRspHead)); + + SEncoder encoder = {0}; + tEncoderInit(&encoder, abuf, len); + tEncodeSMqDataRsp(&encoder, pRsp); + tEncoderClear(&encoder); + + SRpcMsg rsp = { + .info = pPushEntry->pInfo, + .pCont = buf, + .contLen = tlen, + .code = 0, + }; + + tmsgSendRsp(&rsp); + + char buf1[80] = {0}; + char buf2[80] = {0}; + tFormatOffset(buf1, 80, &pRsp->reqOffset); + tFormatOffset(buf2, 80, &pRsp->rspOffset); + tqDebug("vgId:%d, from consumer:%" PRId64 ", (epoch %d) push rsp, block num: %d, reqOffset:%s, rspOffset:%s", + TD_VID(pTq->pVnode), pPushEntry->rspHead.consumerId, pRsp->head.epoch, pRsp->blockNum, buf1, buf2); + + return 0; +} + int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, const SMqDataRsp* pRsp) { ASSERT(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum); ASSERT(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum); @@ -354,6 +420,8 @@ static int32_t tqInitDataRsp(SMqDataRsp* pRsp, const SMqPollReq* pReq, int8_t su return -1; } + pRsp->withTbName = 0; +#if 0 pRsp->withTbName = pReq->withTbName; if (pRsp->withTbName) { pRsp->blockTbName = taosArrayInit(0, sizeof(void*)); @@ -362,6 +430,7 @@ static int32_t tqInitDataRsp(SMqDataRsp* pRsp, const SMqPollReq* pReq, int8_t su return -1; } } +#endif if (subType == TOPIC_SUB_TYPE__COLUMN) { pRsp->withSchema = false; @@ -477,11 +546,33 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) { if (pHandle->execHandle.subType == TOPIC_SUB_TYPE__COLUMN) { SMqDataRsp dataRsp = {0}; tqInitDataRsp(&dataRsp, pReq, pHandle->execHandle.subType); + // lock + taosWLockLatch(&pTq->pushLock); tqScanData(pTq, pHandle, &dataRsp, &fetchOffsetNew); #if 1 - + if (dataRsp.blockNum == 0 && dataRsp.reqOffset.type == TMQ_OFFSET__LOG && + dataRsp.reqOffset.version == dataRsp.rspOffset.version) { + STqPushEntry* pPushEntry = taosMemoryCalloc(1, sizeof(STqPushEntry)); + if (pPushEntry != NULL) { + pPushEntry->pInfo = pMsg->info; + memcpy(pPushEntry->subKey, pHandle->subKey, TSDB_SUBSCRIBE_KEY_LEN); + dataRsp.withTbName = 0; + memcpy(&pPushEntry->dataRsp, &dataRsp, sizeof(SMqDataRsp)); + pPushEntry->rspHead.consumerId = consumerId; + pPushEntry->rspHead.epoch = reqEpoch; + pPushEntry->rspHead.mqMsgType = TMQ_MSG_TYPE__POLL_RSP; + taosHashPut(pTq->pPushMgr, pHandle->subKey, strlen(pHandle->subKey) + 1, &pPushEntry, sizeof(void*)); + tqDebug("tmq poll: consumer %ld, subkey %s, vg %d save handle to push mgr", consumerId, pHandle->subKey, + TD_VID(pTq->pVnode)); + // unlock + taosWUnLockLatch(&pTq->pushLock); + return 0; + } + } + taosWUnLockLatch(&pTq->pushLock); #endif + if (tqSendDataRsp(pTq, pMsg, pReq, &dataRsp) < 0) { code = -1; } @@ -614,10 +705,22 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) { int32_t tqProcessVgDeleteReq(STQ* pTq, int64_t version, char* msg, int32_t msgLen) { SMqVDeleteReq* pReq = (SMqVDeleteReq*)msg; - int32_t code = taosHashRemove(pTq->pHandle, pReq->subKey, strlen(pReq->subKey)); - ASSERT(code == 0); + taosWLockLatch(&pTq->pushLock); + int32_t code = taosHashRemove(pTq->pPushMgr, pReq->subKey, strlen(pReq->subKey)); + if (code != 0) { + tqDebug("vgId:%d, tq remove push handle %s", pTq->pVnode->config.vgId, pReq->subKey); + } + taosWUnLockLatch(&pTq->pushLock); + + code = taosHashRemove(pTq->pHandle, pReq->subKey, strlen(pReq->subKey)); + if (code != 0) { + tqError("cannot process tq delete req %s, since no such handle", pReq->subKey); + } - tqOffsetDelete(pTq->pOffsetStore, pReq->subKey); + code = tqOffsetDelete(pTq->pOffsetStore, pReq->subKey); + if (code != 0) { + tqError("cannot process tq delete req %s, since no such offset", pReq->subKey); + } if (tqMetaDeleteHandle(pTq, pReq->subKey) < 0) { ASSERT(0); @@ -756,7 +859,9 @@ int32_t tqProcessVgChangeReq(STQ* pTq, int64_t version, char* msg, int32_t msgLe atomic_add_fetch_32(&pHandle->epoch, 1); if (tqMetaSaveHandle(pTq, req.subKey, pHandle) < 0) { // TODO + ASSERT(0); } + // close handle } return 0; diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c index a24f92023584710e642d931131d9f707a08c52da..58d051bec1aaa1d6d88309eb4ef17f2a9c736d4e 100644 --- a/source/dnode/vnode/src/tq/tqExec.c +++ b/source/dnode/vnode/src/tq/tqExec.c @@ -15,7 +15,7 @@ #include "tq.h" -static int32_t tqAddBlockDataToRsp(const SSDataBlock* pBlock, SMqDataRsp* pRsp, int32_t numOfCols) { +int32_t tqAddBlockDataToRsp(const SSDataBlock* pBlock, SMqDataRsp* pRsp, int32_t numOfCols) { int32_t dataStrLen = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock); void* buf = taosMemoryCalloc(1, dataStrLen); if (buf == NULL) return -1; @@ -243,7 +243,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SSubmitReq* pReq, STaosxRsp } if (pHandle->fetchMeta) { SSubmitBlk* pBlk = pReader->pBlock; - int32_t schemaLen = htonl(pBlk->schemaLen); + int32_t schemaLen = htonl(pBlk->schemaLen); if (schemaLen > 0) { if (pRsp->createTableNum == 0) { pRsp->createTableLen = taosArrayInit(0, sizeof(int32_t)); @@ -278,7 +278,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SSubmitReq* pReq, STaosxRsp } if (pHandle->fetchMeta) { SSubmitBlk* pBlk = pReader->pBlock; - int32_t schemaLen = htonl(pBlk->schemaLen); + int32_t schemaLen = htonl(pBlk->schemaLen); if (schemaLen > 0) { if (pRsp->createTableNum == 0) { pRsp->createTableLen = taosArrayInit(0, sizeof(int32_t)); diff --git a/source/dnode/vnode/src/tq/tqPush.c b/source/dnode/vnode/src/tq/tqPush.c index a57e8174fee9f82fd35c425e9214e48fba91f709..dcfb07f0ff51f9e820d75ae31d8445ec4e2f630f 100644 --- a/source/dnode/vnode/src/tq/tqPush.c +++ b/source/dnode/vnode/src/tq/tqPush.c @@ -213,6 +213,97 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_ #endif int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) { + tqDebug("vgId:%d tq push msg ver %ld, type: %s", pTq->pVnode->config.vgId, ver, TMSG_INFO(msgType)); + + if (msgType == TDMT_VND_SUBMIT) { + // lock push mgr to avoid potential msg lost + taosWLockLatch(&pTq->pushLock); + tqDebug("vgId:%d push handle num %d", pTq->pVnode->config.vgId, taosHashGetSize(pTq->pPushMgr)); + if (taosHashGetSize(pTq->pPushMgr) != 0) { + SArray* cachedKeys = taosArrayInit(0, sizeof(void*)); + SArray* cachedKeyLens = taosArrayInit(0, sizeof(size_t)); + void* data = taosMemoryMalloc(msgLen); + if (data == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + tqError("failed to copy data for stream since out of memory"); + return -1; + } + memcpy(data, msg, msgLen); + SSubmitReq* pReq = (SSubmitReq*)data; + pReq->version = ver; + + void* pIter = NULL; + while (1) { + pIter = taosHashIterate(pTq->pPushMgr, pIter); + if (pIter == NULL) break; + STqPushEntry* pPushEntry = *(STqPushEntry**)pIter; + + STqHandle* pHandle = taosHashGet(pTq->pHandle, pPushEntry->subKey, strlen(pPushEntry->subKey)); + if (pHandle == NULL) { + tqDebug("vgId:%d cannot find handle %s", pTq->pVnode->config.vgId, pPushEntry->subKey); + continue; + } + if (pPushEntry->dataRsp.reqOffset.version > ver) { + tqDebug("vgId:%d push entry req version %ld, while push version %ld, skip", pTq->pVnode->config.vgId, + pPushEntry->dataRsp.reqOffset.version, ver); + continue; + } + STqExecHandle* pExec = &pHandle->execHandle; + qTaskInfo_t task = pExec->task; + + SMqDataRsp* pRsp = &pPushEntry->dataRsp; + + // prepare scan mem data + qStreamScanMemData(task, pReq); + + // exec + while (1) { + SSDataBlock* pDataBlock = NULL; + uint64_t ts = 0; + if (qExecTask(task, &pDataBlock, &ts) < 0) { + ASSERT(0); + } + + if (pDataBlock == NULL) { + break; + } + + tqAddBlockDataToRsp(pDataBlock, pRsp, pExec->numOfCols); + pRsp->blockNum++; + } + + tqDebug("vgId:%d tq handle push, subkey: %s, block num: %d", pTq->pVnode->config.vgId, pPushEntry->subKey, + pRsp->blockNum); + if (pRsp->blockNum > 0) { + // set offset + tqOffsetResetToLog(&pRsp->rspOffset, ver); + // remove from hash + size_t kLen; + void* key = taosHashGetKey(pIter, &kLen); + void* keyCopy = taosMemoryMalloc(kLen); + memcpy(keyCopy, key, kLen); + + taosArrayPush(cachedKeys, &keyCopy); + taosArrayPush(cachedKeyLens, &kLen); + + tqPushDataRsp(pTq, pPushEntry); + } + } + // delete entry + for (int32_t i = 0; i < taosArrayGetSize(cachedKeys); i++) { + void* key = taosArrayGetP(cachedKeys, i); + size_t kLen = *(size_t*)taosArrayGet(cachedKeyLens, i); + if (taosHashRemove(pTq->pPushMgr, key, kLen) != 0) { + ASSERT(0); + } + } + taosArrayDestroyP(cachedKeys, (FDelete)taosMemoryFree); + taosArrayDestroy(cachedKeyLens); + } + // unlock + taosWUnLockLatch(&pTq->pushLock); + } + if (vnodeIsRoleLeader(pTq->pVnode)) { if (msgType == TDMT_VND_SUBMIT) { if (taosHashGetSize(pTq->pStreamMeta->pTasks) == 0) return 0; diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c index 8e5f328efa14454f9d89de3f8e77bcb8a368dbd9..3bd31e66608a0dcda4aad43edb4e8a885e22b81a 100644 --- a/source/dnode/vnode/src/tq/tqRead.c +++ b/source/dnode/vnode/src/tq/tqRead.c @@ -15,21 +15,20 @@ #include "tq.h" - -bool isValValidForTable(STqHandle* pHandle, SWalCont *pHead){ - if(pHandle->execHandle.subType != TOPIC_SUB_TYPE__TABLE){ +bool isValValidForTable(STqHandle* pHandle, SWalCont* pHead) { + if (pHandle->execHandle.subType != TOPIC_SUB_TYPE__TABLE) { return true; } - int16_t msgType = pHead->msgType; - char* body = pHead->body; - int32_t bodyLen = pHead->bodyLen; + int16_t msgType = pHead->msgType; + char* body = pHead->body; + int32_t bodyLen = pHead->bodyLen; - int64_t tbSuid = pHandle->execHandle.execTb.suid; - int64_t realTbSuid = 0; - SDecoder coder; - void* data = POINTER_SHIFT(body, sizeof(SMsgHead)); - int32_t len = bodyLen - sizeof(SMsgHead); + int64_t tbSuid = pHandle->execHandle.execTb.suid; + int64_t realTbSuid = 0; + SDecoder coder; + void* data = POINTER_SHIFT(body, sizeof(SMsgHead)); + int32_t len = bodyLen - sizeof(SMsgHead); tDecoderInit(&coder, data, len); if (msgType == TDMT_VND_CREATE_STB || msgType == TDMT_VND_ALTER_STB) { @@ -43,38 +42,38 @@ bool isValValidForTable(STqHandle* pHandle, SWalCont *pHead){ if (tDecodeSVDropStbReq(&coder, &req) < 0) { goto end; } - realTbSuid = req.suid; + realTbSuid = req.suid; } else if (msgType == TDMT_VND_CREATE_TABLE) { SVCreateTbBatchReq req = {0}; if (tDecodeSVCreateTbBatchReq(&coder, &req) < 0) { goto end; } - int32_t needRebuild = 0; + int32_t needRebuild = 0; SVCreateTbReq* pCreateReq = NULL; for (int32_t iReq = 0; iReq < req.nReqs; iReq++) { pCreateReq = req.pReqs + iReq; - if(pCreateReq->type == TSDB_CHILD_TABLE && pCreateReq->ctb.suid == tbSuid){ + if (pCreateReq->type == TSDB_CHILD_TABLE && pCreateReq->ctb.suid == tbSuid) { needRebuild++; } } - if(needRebuild == 0){ + if (needRebuild == 0) { // do nothing - }else if(needRebuild == req.nReqs){ + } else if (needRebuild == req.nReqs) { realTbSuid = tbSuid; - }else{ + } else { realTbSuid = tbSuid; SVCreateTbBatchReq reqNew = {0}; reqNew.pArray = taosArrayInit(req.nReqs, sizeof(struct SVCreateTbReq)); for (int32_t iReq = 0; iReq < req.nReqs; iReq++) { pCreateReq = req.pReqs + iReq; - if(pCreateReq->type == TSDB_CHILD_TABLE && pCreateReq->ctb.suid == tbSuid){ + if (pCreateReq->type == TSDB_CHILD_TABLE && pCreateReq->ctb.suid == tbSuid) { reqNew.nReqs++; taosArrayPush(reqNew.pArray, pCreateReq); } } - int tlen; + int tlen; int32_t ret = 0; tEncodeSize(tEncodeSVCreateTbBatchReq, &reqNew, tlen, ret); void* buf = taosMemoryMalloc(tlen); @@ -107,7 +106,7 @@ bool isValValidForTable(STqHandle* pHandle, SWalCont *pHead){ } } } else if (msgType == TDMT_VND_ALTER_TABLE) { - SVAlterTbReq req = {0}; + SVAlterTbReq req = {0}; if (tDecodeSVAlterTbReq(&coder, &req) < 0) { goto end; @@ -129,32 +128,32 @@ bool isValValidForTable(STqHandle* pHandle, SWalCont *pHead){ goto end; } - int32_t needRebuild = 0; + int32_t needRebuild = 0; SVDropTbReq* pDropReq = NULL; for (int32_t iReq = 0; iReq < req.nReqs; iReq++) { pDropReq = req.pReqs + iReq; - if(pDropReq->suid == tbSuid){ + if (pDropReq->suid == tbSuid) { needRebuild++; } } - if(needRebuild == 0){ + if (needRebuild == 0) { // do nothing - }else if(needRebuild == req.nReqs){ + } else if (needRebuild == req.nReqs) { realTbSuid = tbSuid; - }else{ + } else { realTbSuid = tbSuid; SVDropTbBatchReq reqNew = {0}; reqNew.pArray = taosArrayInit(req.nReqs, sizeof(SVDropTbReq)); for (int32_t iReq = 0; iReq < req.nReqs; iReq++) { pDropReq = req.pReqs + iReq; - if(pDropReq->suid == tbSuid){ + if (pDropReq->suid == tbSuid) { reqNew.nReqs++; taosArrayPush(reqNew.pArray, pDropReq); } } - int tlen; + int tlen; int32_t ret = 0; tEncodeSize(tEncodeSVDropTbBatchReq, &reqNew, tlen, ret); void* buf = taosMemoryMalloc(tlen); @@ -177,11 +176,11 @@ bool isValValidForTable(STqHandle* pHandle, SWalCont *pHead){ goto end; } realTbSuid = req.suid; - } else{ + } else { ASSERT(0); } - end: +end: tDecoderClear(&coder); return tbSuid == realTbSuid; } @@ -224,7 +223,7 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHea code = -1; goto END; } - if(isValValidForTable(pHandle, pHead)){ + if (isValValidForTable(pHandle, pHead)) { *fetchOffset = offset; code = 0; goto END; @@ -241,7 +240,7 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHea offset++; } } - END: +END: taosThreadMutexUnlock(&pHandle->pWalReader->mutex); return code; } @@ -315,14 +314,18 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) { return -1; } void* body = pReader->pWalReader->pHead->head.body; +#if 0 if (pReader->pWalReader->pHead->head.msgType != TDMT_VND_SUBMIT) { // TODO do filter ret->fetchType = FETCH_TYPE__META; ret->meta = pReader->pWalReader->pHead->head.body; return 0; } else { - tqReaderSetDataMsg(pReader, body, pReader->pWalReader->pHead->head.version); +#endif + tqReaderSetDataMsg(pReader, body, pReader->pWalReader->pHead->head.version); +#if 0 } +#endif } while (tqNextDataBlock(pReader)) { @@ -334,6 +337,7 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) { continue; } ret->fetchType = FETCH_TYPE__DATA; + tqDebug("return data rows %d", ret->data.info.rows); return 0; } @@ -341,14 +345,14 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) { ret->offset.type = TMQ_OFFSET__LOG; ret->offset.version = pReader->ver; ASSERT(pReader->ver >= 0); - ret->fetchType = FETCH_TYPE__NONE; + ret->fetchType = FETCH_TYPE__SEP; tqDebug("return offset %" PRId64 ", processed finish", ret->offset.version); return 0; } } } -int32_t tqReaderSetDataMsg(STqReader* pReader, SSubmitReq* pMsg, int64_t ver) { +int32_t tqReaderSetDataMsg(STqReader* pReader, const SSubmitReq* pMsg, int64_t ver) { pReader->pMsg = pMsg; if (tInitSubmitMsgIter(pMsg, &pReader->msgIter) < 0) return -1; diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 32272b541cca6d6cf4057bd8f51e6facb0a86083..3a921349e66ff34de862a882db33f49189246e1c 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -420,6 +420,7 @@ typedef enum { typedef struct { SFSLASTNEXTROWSTATES state; // [input] STsdb *pTsdb; // [input] + STSchema *pTSchema;// [input] tb_uid_t suid; tb_uid_t uid; int32_t nFileSet; @@ -455,9 +456,10 @@ static int32_t getNextRowFromFSLast(void *iter, TSDBROW **ppRow) { code = tsdbDataFReaderOpen(&state->pDataFReader, state->pTsdb, pFileSet); if (code) goto _err; + SSttBlockLoadInfo* pLoadInfo = tCreateLastBlockLoadInfo(state->pTSchema, NULL, 0); tMergeTreeOpen(&state->mergeTree, 1, state->pDataFReader, state->suid, state->uid, &(STimeWindow){.skey = TSKEY_MIN, .ekey = TSKEY_MAX}, - &(SVersionRange){.minVer = 0, .maxVer = UINT64_MAX}, NULL, NULL); + &(SVersionRange){.minVer = 0, .maxVer = UINT64_MAX}, pLoadInfo,true, NULL); bool hasVal = tMergeTreeNext(&state->mergeTree); if (!hasVal) { state->state = SFSLASTNEXTROW_FILESET; @@ -612,7 +614,8 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow) { tMapDataGetItemByIdx(&state->blockMap, state->iBlock, &block, tGetDataBlk); /* code = tsdbReadBlockData(state->pDataFReader, &state->blockIdx, &block, &state->blockData, NULL, NULL); */ tBlockDataReset(state->pBlockData); - code = tBlockDataInit(state->pBlockData, state->suid, state->uid, state->pTSchema); + TABLEID tid = {.suid = state->suid, .uid = state->uid}; + code = tBlockDataInit(state->pBlockData, &tid, state->pTSchema, NULL, 0); if (code) goto _err; code = tsdbReadDataBlock(state->pDataFReader, &block, state->pBlockData); @@ -891,6 +894,7 @@ static int32_t nextRowIterOpen(CacheNextRowIter *pIter, tb_uid_t uid, STsdb *pTs pIter->fsLastState.state = (SFSLASTNEXTROWSTATES)SFSNEXTROW_FS; pIter->fsLastState.pTsdb = pTsdb; pIter->fsLastState.aDFileSet = pIter->pReadSnap->fs.aDFileSet; + pIter->fsLastState.pTSchema = pTSchema; pIter->fsLastState.suid = suid; pIter->fsLastState.uid = uid; diff --git a/source/dnode/vnode/src/tsdb/tsdbCommit.c b/source/dnode/vnode/src/tsdb/tsdbCommit.c index a619b9f2e4f827d72f2aad5fd752ae002ac2fc74..5403395623de41ef448785ceb6f619c9b7e6a6f7 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCommit.c +++ b/source/dnode/vnode/src/tsdb/tsdbCommit.c @@ -437,7 +437,7 @@ static int32_t tsdbOpenCommitIter(SCommitter *pCommitter) { pIter->iSttBlk = 0; SSttBlk *pSttBlk = (SSttBlk *)taosArrayGet(pIter->aSttBlk, 0); - code = tsdbReadSttBlock(pCommitter->dReader.pReader, iStt, pSttBlk, &pIter->bData); + code = tsdbReadSttBlockEx(pCommitter->dReader.pReader, iStt, pSttBlk, &pIter->bData); if (code) goto _err; pIter->iRow = 0; @@ -1049,7 +1049,7 @@ static int32_t tsdbNextCommitRow(SCommitter *pCommitter) { if (pIter->iSttBlk < taosArrayGetSize(pIter->aSttBlk)) { SSttBlk *pSttBlk = (SSttBlk *)taosArrayGet(pIter->aSttBlk, pIter->iSttBlk); - code = tsdbReadSttBlock(pCommitter->dReader.pReader, pIter->iStt, pSttBlk, &pIter->bData); + code = tsdbReadSttBlockEx(pCommitter->dReader.pReader, pIter->iStt, pSttBlk, &pIter->bData); if (code) goto _exit; pIter->iRow = 0; @@ -1305,7 +1305,8 @@ static int32_t tsdbInitLastBlockIfNeed(SCommitter *pCommitter, TABLEID id) { if (!pBDatal->suid && !pBDatal->uid) { ASSERT(pCommitter->skmTable.suid == id.suid); ASSERT(pCommitter->skmTable.uid == id.uid); - code = tBlockDataInit(pBDatal, id.suid, id.suid ? 0 : id.uid, pCommitter->skmTable.pTSchema); + TABLEID tid = {.suid = id.suid, .uid = id.suid ? 0 : id.uid}; + code = tBlockDataInit(pBDatal, &tid, pCommitter->skmTable.pTSchema, NULL, 0); if (code) goto _exit; } @@ -1428,9 +1429,9 @@ static int32_t tsdbCommitFileDataImpl(SCommitter *pCommitter) { // impl code = tsdbUpdateTableSchema(pCommitter->pTsdb->pVnode->pMeta, id.suid, id.uid, &pCommitter->skmTable); if (code) goto _err; - code = tBlockDataInit(&pCommitter->dReader.bData, id.suid, id.uid, pCommitter->skmTable.pTSchema); + code = tBlockDataInit(&pCommitter->dReader.bData, &id, pCommitter->skmTable.pTSchema, NULL, 0); if (code) goto _err; - code = tBlockDataInit(&pCommitter->dWriter.bData, id.suid, id.uid, pCommitter->skmTable.pTSchema); + code = tBlockDataInit(&pCommitter->dWriter.bData, &id, pCommitter->skmTable.pTSchema, NULL, 0); if (code) goto _err; /* merge with data in .data file */ diff --git a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c index 5f03a82bc0fff8276b4d96da6bb5e37f2b9e3812..7e6a0d04ffc74b9719316df93851527fe2cbbcc6 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c +++ b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c @@ -28,11 +28,10 @@ struct SLDataIter { uint64_t uid; STimeWindow timeWindow; SVersionRange verRange; - SSttBlockLoadInfo* pBlockLoadInfo; }; -SSttBlockLoadInfo* tCreateLastBlockLoadInfo() { +SSttBlockLoadInfo* tCreateLastBlockLoadInfo(STSchema* pSchema, int16_t* colList, int32_t numOfCols) { SSttBlockLoadInfo* pLoadInfo = taosMemoryCalloc(TSDB_DEFAULT_STT_FILE, sizeof(SSttBlockLoadInfo)); if (pLoadInfo == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -55,6 +54,9 @@ SSttBlockLoadInfo* tCreateLastBlockLoadInfo() { } pLoadInfo[i].aSttBlk = taosArrayInit(4, sizeof(SSttBlk)); + pLoadInfo[i].pSchema = pSchema; + pLoadInfo[i].colIds = colList; + pLoadInfo[i].numOfCols = numOfCols; } return pLoadInfo; @@ -111,7 +113,19 @@ static SBlockData* loadLastBlock(SLDataIter *pIter, const char* idStr) { pInfo->currentLoadBlockIndex ^= 1; if (pIter->pSttBlk != NULL) { // current block not loaded yet int64_t st = taosGetTimestampUs(); - code = tsdbReadSttBlock(pIter->pReader, pIter->iStt, pIter->pSttBlk, &pInfo->blockData[pInfo->currentLoadBlockIndex]); + + SBlockData* pBlock = &pInfo->blockData[pInfo->currentLoadBlockIndex]; + + TABLEID id = {0}; + if (pIter->pSttBlk->suid != 0) { + id.suid = pIter->pSttBlk->suid; + } else { + id.uid = pIter->uid; + } + + tBlockDataInit(pBlock, &id, pInfo->pSchema, pInfo->colIds, pInfo->numOfCols); + code = tsdbReadSttBlock(pIter->pReader, pIter->iStt, pIter->pSttBlk, pBlock); + double el = (taosGetTimestampUs() - st)/ 1000.0; pInfo->elapsedTime += el; pInfo->loadBlocks += 1; @@ -460,7 +474,8 @@ static FORCE_INLINE int32_t tLDataIterCmprFn(const void *p1, const void *p2) { } int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader *pFReader, uint64_t suid, uint64_t uid, - STimeWindow *pTimeWindow, SVersionRange *pVerRange, void* pBlockLoadInfo, const char* idStr) { + STimeWindow *pTimeWindow, SVersionRange *pVerRange, SSttBlockLoadInfo *pBlockLoadInfo, + bool destroyLoadInfo, const char *idStr) { pMTree->backward = backward; pMTree->pIter = NULL; pMTree->pIterList = taosArrayInit(4, POINTER_BYTES); @@ -473,21 +488,12 @@ int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader *pFRead tRBTreeCreate(&pMTree->rbt, tLDataIterCmprFn); int32_t code = TSDB_CODE_SUCCESS; - SSttBlockLoadInfo* pLoadInfo = NULL; - if (pBlockLoadInfo == NULL) { - if (pMTree->pLoadInfo == NULL) { - pMTree->destroyLoadInfo = true; - pMTree->pLoadInfo = tCreateLastBlockLoadInfo(); - } - - pLoadInfo = pMTree->pLoadInfo; - } else { - pLoadInfo = pBlockLoadInfo; - } + pMTree->pLoadInfo = pBlockLoadInfo; + pMTree->destroyLoadInfo = destroyLoadInfo; for (int32_t i = 0; i < pFReader->pSet->nSttF; ++i) { // open all last file struct SLDataIter* pIter = NULL; - code = tLDataIterOpen(&pIter, pFReader, i, pMTree->backward, suid, uid, pTimeWindow, pVerRange, &pLoadInfo[i]); + code = tLDataIterOpen(&pIter, pFReader, i, pMTree->backward, suid, uid, pTimeWindow, pVerRange, &pMTree->pLoadInfo[i]); if (code != TSDB_CODE_SUCCESS) { goto _end; } diff --git a/source/dnode/vnode/src/tsdb/tsdbOpen.c b/source/dnode/vnode/src/tsdb/tsdbOpen.c index ec760e3c57c277ed3183bb73729f7a655daa0304..fcbcff924879995639f1a07a2f267506ca72a4af 100644 --- a/source/dnode/vnode/src/tsdb/tsdbOpen.c +++ b/source/dnode/vnode/src/tsdb/tsdbOpen.c @@ -85,6 +85,8 @@ _err: int tsdbClose(STsdb **pTsdb) { if (*pTsdb) { taosThreadRwlockDestroy(&(*pTsdb)->rwLock); + tsdbMemTableDestroy((*pTsdb)->mem); + (*pTsdb)->mem = NULL; tsdbFSClose(*pTsdb); tsdbCloseCache(*pTsdb); taosMemoryFreeClear(*pTsdb); diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 3d2c89ba0217b2d6d19025714d73cf9aebfb8586..c3cb5f9eb8ab8317d8f1a9e581819b75cff2811c 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -79,6 +79,7 @@ typedef struct SBlockLoadSuppInfo { SColumnDataAgg tsColAgg; SColumnDataAgg** plist; int16_t* colIds; // column ids for loading file block data + int32_t numOfCols; char** buildBuf; // build string tmp buffer, todo remove it later after all string format being updated. } SBlockLoadSuppInfo; @@ -203,6 +204,7 @@ static int32_t setColumnIdSlotList(STsdbReader* pReader, SSDataBlock* pBlock) { size_t numOfCols = blockDataGetNumOfCols(pBlock); + pSupInfo->numOfCols = numOfCols; pSupInfo->colIds = taosMemoryMalloc(numOfCols * sizeof(int16_t)); pSupInfo->buildBuf = taosMemoryCalloc(numOfCols, POINTER_BYTES); if (pSupInfo->buildBuf == NULL || pSupInfo->colIds == NULL) { @@ -352,7 +354,8 @@ static int32_t initFilesetIterator(SFilesetIter* pIter, SArray* aDFileSet, STsdb tMergeTreeClose(&pLReader->mergeTree); if (pLReader->pInfo == NULL) { - pLReader->pInfo = tCreateLastBlockLoadInfo(); + // here we ignore the first column, which is always be the primary timestamp column + pLReader->pInfo = tCreateLastBlockLoadInfo(pReader->pSchema, &pReader->suppInfo.colIds[1], pReader->suppInfo.numOfCols - 1); if (pLReader->pInfo == NULL) { tsdbDebug("init fileset iterator failed, code:%s %s", tstrerror(terrno), pReader->idStr); return terrno; @@ -483,7 +486,7 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd pReader->pTsdb = getTsdbByRetentions(pVnode, pCond->twindows.skey, pVnode->config.tsdbCfg.retentions, idstr, &level); pReader->suid = pCond->suid; pReader->order = pCond->order; - pReader->capacity = 4096; + pReader->capacity = capacity; pReader->idStr = (idstr != NULL) ? strdup(idstr) : NULL; pReader->verRange = getQueryVerRange(pVnode, pCond, level); pReader->type = pCond->type; @@ -838,14 +841,18 @@ static int32_t copyBlockDataToSDataBlock(STsdbReader* pReader, STableBlockScanIn bool asc = ASCENDING_TRAVERSE(pReader->order); int32_t step = asc ? 1 : -1; - if (asc && pReader->window.skey <= pBlock->minKey.ts) { - pDumpInfo->rowIndex = 0; - } else if (!asc && pReader->window.ekey >= pBlock->maxKey.ts) { - pDumpInfo->rowIndex = pBlock->nRow - 1; - } else { - int32_t pos = asc ? pBlock->nRow - 1 : 0; - int32_t order = (pReader->order == TSDB_ORDER_ASC) ? TSDB_ORDER_DESC : TSDB_ORDER_ASC; - pDumpInfo->rowIndex = doBinarySearchKey(pBlockData->aTSKEY, pBlock->nRow, pos, pReader->window.skey, order); + + if ((pDumpInfo->rowIndex == 0 && asc) || (pDumpInfo->rowIndex == pBlock->nRow - 1 && (!asc))) { + if (asc && pReader->window.skey <= pBlock->minKey.ts) { + //pDumpInfo->rowIndex = 0; + } else + if (!asc && pReader->window.ekey >= pBlock->maxKey.ts) { + //pDumpInfo->rowIndex = pBlock->nRow - 1; + } else { + int32_t pos = asc ? pBlock->nRow - 1 : 0; + int32_t order = (pReader->order == TSDB_ORDER_ASC) ? TSDB_ORDER_DESC : TSDB_ORDER_ASC; + pDumpInfo->rowIndex = doBinarySearchKey(pBlockData->aTSKEY, pBlock->nRow, pos, pReader->window.skey, order); + } } // time window check @@ -929,8 +936,8 @@ static int32_t copyBlockDataToSDataBlock(STsdbReader* pReader, STableBlockScanIn pDumpInfo->rowIndex += step * remain; if (pDumpInfo->rowIndex >= 0 && pDumpInfo->rowIndex < pBlock->nRow) { - int64_t ts = pBlockData->aTSKEY[pDumpInfo->rowIndex]; - setBlockAllDumped(pDumpInfo, ts, pReader->order); +// int64_t ts = pBlockData->aTSKEY[pDumpInfo->rowIndex]; +// setBlockAllDumped(pDumpInfo, ts, pReader->order); } else { int64_t k = asc ? pBlock->maxKey.ts : pBlock->minKey.ts; setBlockAllDumped(pDumpInfo, k, pReader->order); @@ -948,15 +955,22 @@ static int32_t copyBlockDataToSDataBlock(STsdbReader* pReader, STableBlockScanIn return TSDB_CODE_SUCCESS; } -static int32_t doLoadFileBlockData(STsdbReader* pReader, SDataBlockIter* pBlockIter, SBlockData* pBlockData) { +static int32_t doLoadFileBlockData(STsdbReader* pReader, SDataBlockIter* pBlockIter, SBlockData* pBlockData, uint64_t uid) { int64_t st = taosGetTimestampUs(); + tBlockDataReset(pBlockData); + TABLEID tid = {.suid = pReader->suid, .uid = uid}; + int32_t code = tBlockDataInit(pBlockData, &tid, pReader->pSchema, &pReader->suppInfo.colIds[1], pReader->suppInfo.numOfCols-1); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + SFileDataBlockInfo* pBlockInfo = getCurrentBlockInfo(pBlockIter); SFileBlockDumpInfo* pDumpInfo = &pReader->status.fBlockDumpInfo; ASSERT(pBlockInfo != NULL); SDataBlk* pBlock = getCurrentBlock(pBlockIter); - int32_t code = tsdbReadDataBlock(pReader->pFileReader, pBlock, pBlockData); + code = tsdbReadDataBlock(pReader->pFileReader, pBlock, pBlockData); if (code != TSDB_CODE_SUCCESS) { tsdbError("%p error occurs in loading file block, global index:%d, table index:%d, brange:%" PRId64 "-%" PRId64 ", rows:%d, code:%s %s", @@ -1741,7 +1755,7 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo* tsLast = getCurrentKeyInLastBlock(pLastBlockReader); } - int64_t key = hasDataInFileBlock(pBlockData, pDumpInfo)? pBlockData->aTSKEY[pDumpInfo->rowIndex]:INT64_MIN; + int64_t key = hasDataInFileBlock(pBlockData, pDumpInfo) ? pBlockData->aTSKEY[pDumpInfo->rowIndex] : INT64_MIN; TSDBKEY k = TSDBROW_KEY(pRow); TSDBKEY ik = TSDBROW_KEY(piRow); @@ -1995,7 +2009,7 @@ static bool initLastBlockReader(SLastBlockReader* pLBlockReader, STableBlockScan int32_t code = tMergeTreeOpen(&pLBlockReader->mergeTree, (pLBlockReader->order == TSDB_ORDER_DESC), pReader->pFileReader, - pReader->suid, pScanInfo->uid, &w, &pLBlockReader->verRange, pLBlockReader->pInfo, pReader->idStr); + pReader->suid, pScanInfo->uid, &w, &pLBlockReader->verRange, pLBlockReader->pInfo, false, pReader->idStr); if (code != TSDB_CODE_SUCCESS) { return false; } @@ -2009,12 +2023,12 @@ static int64_t getCurrentKeyInLastBlock(SLastBlockReader* pLastBlockReader) { } static bool hasDataInLastBlock(SLastBlockReader* pLastBlockReader) { return pLastBlockReader->mergeTree.pIter != NULL; } -bool hasDataInFileBlock(const SBlockData* pBlockData, const SFileBlockDumpInfo* pDumpInfo) { - if (pBlockData->nRow > 0) { - ASSERT(pBlockData->nRow == pDumpInfo->totalRows); +bool hasDataInFileBlock(const SBlockData* pBlockData, const SFileBlockDumpInfo* pDumpInfo) { + if (pBlockData->nRow > 0) { + ASSERT(pBlockData->nRow == pDumpInfo->totalRows); } - return pBlockData->nRow > 0 && (!pDumpInfo->allDumped); + return pBlockData->nRow > 0 && (!pDumpInfo->allDumped); } int32_t mergeRowsInFileBlocks(SBlockData* pBlockData, STableBlockScanInfo* pBlockScanInfo, int64_t key, @@ -2451,13 +2465,7 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { ASSERT(pBlockIter->numOfBlocks == 0); code = buildComposedDataBlock(pReader); } else if (fileBlockShouldLoad(pReader, pBlockInfo, pBlock, pScanInfo, keyInBuf, pLastBlockReader)) { - tBlockDataReset(&pStatus->fileBlockData); - code = tBlockDataInit(&pStatus->fileBlockData, pReader->suid, pScanInfo->uid, pReader->pSchema); - if (code != TSDB_CODE_SUCCESS) { - return code; - } - - code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData); + code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pScanInfo->uid); if (code != TSDB_CODE_SUCCESS) { return code; } @@ -2931,13 +2939,7 @@ static int32_t checkForNeighborFileBlock(STsdbReader* pReader, STableBlockScanIn setFileBlockActiveInBlockIter(pBlockIter, neighborIndex, step); // 3. load the neighbor block, and set it to be the currently accessed file data block - tBlockDataReset(&pStatus->fileBlockData); - int32_t code = tBlockDataInit(&pStatus->fileBlockData, pReader->suid, pFBlock->uid, pReader->pSchema); - if (code != TSDB_CODE_SUCCESS) { - return code; - } - - code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData); + int32_t code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pFBlock->uid); if (code != TSDB_CODE_SUCCESS) { return code; } @@ -3404,10 +3406,14 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, SArray* pTabl // we need only one row pPrevReader->capacity = 1; pPrevReader->status.pTableMap = pReader->status.pTableMap; + pPrevReader->pSchema = pReader->pSchema; + pPrevReader->pMemSchema = pReader->pMemSchema; pPrevReader->pReadSnap = pReader->pReadSnap; pNextReader->capacity = 1; pNextReader->status.pTableMap = pReader->status.pTableMap; + pNextReader->pSchema = pReader->pSchema; + pNextReader->pMemSchema = pReader->pMemSchema; pNextReader->pReadSnap = pReader->pReadSnap; code = doOpenReaderImpl(pPrevReader); @@ -3441,11 +3447,19 @@ void tsdbReaderClose(STsdbReader* pReader) { { if (pReader->innerReader[0] != NULL) { - pReader->innerReader[0]->status.pTableMap = NULL; - pReader->innerReader[0]->pReadSnap = NULL; + STsdbReader* p = pReader->innerReader[0]; + + p->status.pTableMap = NULL; + p->pReadSnap = NULL; + p->pSchema = NULL; + p->pMemSchema = NULL; + + p = pReader->innerReader[1]; - pReader->innerReader[1]->status.pTableMap = NULL; - pReader->innerReader[1]->pReadSnap = NULL; + p->status.pTableMap = NULL; + p->pReadSnap = NULL; + p->pSchema = NULL; + p->pMemSchema = NULL; tsdbReaderClose(pReader->innerReader[0]); tsdbReaderClose(pReader->innerReader[1]); @@ -3683,14 +3697,7 @@ static SArray* doRetrieveDataBlock(STsdbReader* pReader) { SFileDataBlockInfo* pFBlock = getCurrentBlockInfo(&pStatus->blockIter); STableBlockScanInfo* pBlockScanInfo = taosHashGet(pStatus->pTableMap, &pFBlock->uid, sizeof(pFBlock->uid)); - tBlockDataReset(&pStatus->fileBlockData); - int32_t code = tBlockDataInit(&pStatus->fileBlockData, pReader->suid, pBlockScanInfo->uid, pReader->pSchema); - if (code != TSDB_CODE_SUCCESS) { - terrno = code; - return NULL; - } - - code = doLoadFileBlockData(pReader, &pStatus->blockIter, &pStatus->fileBlockData); + int32_t code = doLoadFileBlockData(pReader, &pStatus->blockIter, &pStatus->fileBlockData, pBlockScanInfo->uid); if (code != TSDB_CODE_SUCCESS) { tBlockDataDestroy(&pStatus->fileBlockData, 1); terrno = code; diff --git a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c index 5fe0b408b1396c52fd1fbdf5ad2b6e37c0e5e7be..fc577e39626ff18554938abfcf9c3f8498342c6a 100644 --- a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c +++ b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c @@ -926,12 +926,13 @@ _err: return code; } -static int32_t tsdbReadBlockDataImpl(SDataFReader *pReader, SBlockInfo *pBlkInfo, SBlockData *pBlockData) { +static int32_t tsdbReadBlockDataImpl(SDataFReader *pReader, SBlockInfo *pBlkInfo, SBlockData *pBlockData, + int32_t iStt) { int32_t code = 0; tBlockDataClear(pBlockData); - STsdbFD *pFD = pReader->pDataFD; + STsdbFD *pFD = (iStt < 0) ? pReader->pDataFD : pReader->aSttFD[iStt]; // uid + version + tskey code = tRealloc(&pReader->aBuf[0], pBlkInfo->szKey); @@ -1070,9 +1071,12 @@ _err: int32_t tsdbReadDataBlock(SDataFReader *pReader, SDataBlk *pDataBlk, SBlockData *pBlockData) { int32_t code = 0; - code = tsdbReadBlockDataImpl(pReader, &pDataBlk->aSubBlock[0], pBlockData); + code = tsdbReadBlockDataImpl(pReader, &pDataBlk->aSubBlock[0], pBlockData, -1); if (code) goto _err; + ASSERT(pDataBlk->nSubBlock == 1); + +#if 0 if (pDataBlk->nSubBlock > 1) { SBlockData bData1; SBlockData bData2; @@ -1113,6 +1117,7 @@ int32_t tsdbReadDataBlock(SDataFReader *pReader, SDataBlk *pDataBlk, SBlockData tBlockDataDestroy(&bData1, 1); tBlockDataDestroy(&bData2, 1); } +#endif return code; @@ -1123,23 +1128,38 @@ _err: int32_t tsdbReadSttBlock(SDataFReader *pReader, int32_t iStt, SSttBlk *pSttBlk, SBlockData *pBlockData) { int32_t code = 0; + int32_t lino = 0; + + code = tsdbReadBlockDataImpl(pReader, &pSttBlk->bInfo, pBlockData, iStt); + TSDB_CHECK_CODE(code, lino, _exit); + +_exit: + if (code) { + tsdbError("vgId:%d %s failed at %d since %s", TD_VID(pReader->pTsdb->pVnode), __func__, lino, tstrerror(code)); + } + return code; +} + +int32_t tsdbReadSttBlockEx(SDataFReader *pReader, int32_t iStt, SSttBlk *pSttBlk, SBlockData *pBlockData) { + int32_t code = 0; + int32_t lino = 0; // alloc code = tRealloc(&pReader->aBuf[0], pSttBlk->bInfo.szBlock); - if (code) goto _err; + TSDB_CHECK_CODE(code, lino, _exit); // read code = tsdbReadFile(pReader->aSttFD[iStt], pSttBlk->bInfo.offset, pReader->aBuf[0], pSttBlk->bInfo.szBlock); - if (code) goto _err; + TSDB_CHECK_CODE(code, lino, _exit); // decmpr code = tDecmprBlockData(pReader->aBuf[0], pSttBlk->bInfo.szBlock, pBlockData, &pReader->aBuf[1]); - if (code) goto _err; - - return code; + TSDB_CHECK_CODE(code, lino, _exit); -_err: - tsdbError("vgId:%d tsdb read stt block failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code)); +_exit: + if (code) { + tsdbError("vgId:%d %s failed at %d since %s", TD_VID(pReader->pTsdb->pVnode), __func__, lino, tstrerror(code)); + } return code; } diff --git a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c index 99e88a442c16e77f2db2ca752eb54f4e120532f8..a928dc3484c67461a8b5a49c39d60e3af4336e8b 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c +++ b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c @@ -140,7 +140,7 @@ static int32_t tsdbSnapReadOpenFile(STsdbSnapReader* pReader) { if (pSttBlk->minVer > pReader->ever) continue; if (pSttBlk->maxVer < pReader->sver) continue; - code = tsdbReadSttBlock(pReader->pDataFReader, iStt, pSttBlk, &pIter->bData); + code = tsdbReadSttBlockEx(pReader->pDataFReader, iStt, pSttBlk, &pIter->bData); if (code) goto _err; for (pIter->iRow = 0; pIter->iRow < pIter->bData.nRow; pIter->iRow++) { @@ -223,7 +223,7 @@ static int32_t tsdbSnapNextRow(STsdbSnapReader* pReader) { if (pSttBlk->minVer > pReader->ever || pSttBlk->maxVer < pReader->sver) continue; - code = tsdbReadSttBlock(pReader->pDataFReader, pIter->iStt, pSttBlk, &pIter->bData); + code = tsdbReadSttBlockEx(pReader->pDataFReader, pIter->iStt, pSttBlk, &pIter->bData); if (code) goto _err; pIter->iRow = -1; @@ -319,7 +319,7 @@ static int32_t tsdbSnapReadData(STsdbSnapReader* pReader, uint8_t** ppData) { code = tsdbUpdateTableSchema(pTsdb->pVnode->pMeta, id.suid, id.uid, &pReader->skmTable); if (code) goto _err; - code = tBlockDataInit(pBlockData, id.suid, id.uid, pReader->skmTable.pTSchema); + code = tBlockDataInit(pBlockData, &id, pReader->skmTable.pTSchema, NULL, 0); if (code) goto _err; while (pRowInfo->suid == id.suid && pRowInfo->uid == id.uid) { @@ -715,7 +715,7 @@ static int32_t tsdbSnapWriteTableDataStart(STsdbSnapWriter* pWriter, TABLEID* pI if (code) goto _err; tMapDataReset(&pWriter->dWriter.mDataBlk); - code = tBlockDataInit(&pWriter->dWriter.bData, pId->suid, pId->uid, pWriter->skmTable.pTSchema); + code = tBlockDataInit(&pWriter->dWriter.bData, pId, pWriter->skmTable.pTSchema, NULL, 0); if (code) goto _err; return code; @@ -1000,7 +1000,8 @@ static int32_t tsdbSnapWriteToSttFile(STsdbSnapWriter* pWriter, int32_t iRow) { code = tsdbUpdateTableSchema(pWriter->pTsdb->pVnode->pMeta, pWriter->id.suid, pWriter->id.uid, &pWriter->skmTable); if (code) goto _err; - code = tBlockDataInit(pBData, pWriter->id.suid, pWriter->id.suid ? 0 : pWriter->id.uid, pWriter->skmTable.pTSchema); + TABLEID tid = {.suid = pWriter->id.suid, .uid = pWriter->id.suid ? 0 : pWriter->id.uid}; + code = tBlockDataInit(pBData, &tid, pWriter->skmTable.pTSchema, NULL, 0); if (code) goto _err; } diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index 8026441cbcf9d85e8de6f0ae5b707c56f775b09a..4999e7a49a82764534b316994b38fa9e0c9af895 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -948,24 +948,47 @@ void tBlockDataDestroy(SBlockData *pBlockData, int8_t deepClear) { pBlockData->aColData = NULL; } -int32_t tBlockDataInit(SBlockData *pBlockData, int64_t suid, int64_t uid, STSchema *pTSchema) { +int32_t tBlockDataInit(SBlockData *pBlockData, TABLEID *pId, STSchema *pTSchema, int16_t *aCid, int32_t nCid) { int32_t code = 0; - ASSERT(suid || uid); + ASSERT(pId->suid || pId->uid); - pBlockData->suid = suid; - pBlockData->uid = uid; + pBlockData->suid = pId->suid; + pBlockData->uid = pId->uid; pBlockData->nRow = 0; taosArrayClear(pBlockData->aIdx); - for (int32_t iColumn = 1; iColumn < pTSchema->numOfCols; iColumn++) { + if (aCid) { + int32_t iColumn = 1; STColumn *pTColumn = &pTSchema->columns[iColumn]; + for (int32_t iCid = 0; iCid < nCid; iCid++) { + while (pTColumn && pTColumn->colId < aCid[iCid]) { + iColumn++; + pTColumn = (iColumn < pTSchema->numOfCols) ? &pTSchema->columns[iColumn] : NULL; + } - SColData *pColData; - code = tBlockDataAddColData(pBlockData, iColumn - 1, &pColData); - if (code) goto _exit; + if (pTColumn == NULL) { + break; + } else if (pTColumn->colId == aCid[iCid]) { + SColData *pColData; + code = tBlockDataAddColData(pBlockData, taosArrayGetSize(pBlockData->aIdx), &pColData); + if (code) goto _exit; + tColDataInit(pColData, pTColumn->colId, pTColumn->type, (pTColumn->flags & COL_SMA_ON) ? 1 : 0); - tColDataInit(pColData, pTColumn->colId, pTColumn->type, (pTColumn->flags & COL_SMA_ON) ? 1 : 0); + iColumn++; + pTColumn = (iColumn < pTSchema->numOfCols) ? &pTSchema->columns[iColumn] : NULL; + } + } + } else { + for (int32_t iColumn = 1; iColumn < pTSchema->numOfCols; iColumn++) { + STColumn *pTColumn = &pTSchema->columns[iColumn]; + + SColData *pColData; + code = tBlockDataAddColData(pBlockData, iColumn - 1, &pColData); + if (code) goto _exit; + + tColDataInit(pColData, pTColumn->colId, pTColumn->type, (pTColumn->flags & COL_SMA_ON) ? 1 : 0); + } } _exit: diff --git a/source/dnode/vnode/src/vnd/vnodeBufPool.c b/source/dnode/vnode/src/vnd/vnodeBufPool.c index 5a22114ab42206f0f63a4c41a3d4c53c438ff68b..6e02425b55a39463d25638a2190de96f3459d657 100644 --- a/source/dnode/vnode/src/vnd/vnodeBufPool.c +++ b/source/dnode/vnode/src/vnd/vnodeBufPool.c @@ -53,6 +53,10 @@ int vnodeCloseBufPool(SVnode *pVnode) { vnodeBufPoolDestroy(pPool); } + if (pVnode->inUse) { + vnodeBufPoolDestroy(pVnode->inUse); + pVnode->inUse = NULL; + } vDebug("vgId:%d, vnode buffer pool is closed", TD_VID(pVnode)); return 0; @@ -177,4 +181,4 @@ void vnodeBufPoolUnRef(SVBufPool *pPool) { taosThreadMutexUnlock(&pVnode->mutex); } -} \ No newline at end of file +} diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index 4ccfea40510a6148ceec57893629c693d9d7a1cd..b5307cecf29d21bf68773c41ed318341e083d814 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -161,7 +161,6 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) { // open sync if (vnodeSyncOpen(pVnode, dir)) { vError("vgId:%d, failed to open sync since %s", TD_VID(pVnode), tstrerror(terrno)); - terrno = TSDB_CODE_OUT_OF_MEMORY; goto _err; } @@ -174,6 +173,7 @@ _err: if (pVnode->pTsdb) tsdbClose(&pVnode->pTsdb); if (pVnode->pSma) smaClose(pVnode->pSma); if (pVnode->pMeta) metaClose(pVnode->pMeta); + if (pVnode->pPool) vnodeCloseBufPool(pVnode); tsem_destroy(&(pVnode->canCommit)); taosMemoryFree(pVnode); diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 6e9eba306a68ad91c22e5adb16e8ce5048b23903..28093dfc709eab590d444ee342a4acf376f379dc 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -289,7 +289,7 @@ int32_t vnodePreprocessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg) { int32_t vnodeProcessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg) { vTrace("message in vnode query queue is processing"); - if ((pMsg->msgType == TDMT_SCH_QUERY) && !vnodeIsReadyForRead(pVnode)) { + if ((pMsg->msgType == TDMT_SCH_QUERY) && !vnodeIsLeader(pVnode)) { vnodeRedirectRpcMsg(pVnode, pMsg); return 0; } @@ -311,7 +311,12 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) { vTrace("vgId:%d, msg:%p in fetch queue is processing", pVnode->config.vgId, pMsg); if ((pMsg->msgType == TDMT_SCH_FETCH || pMsg->msgType == TDMT_VND_TABLE_META || pMsg->msgType == TDMT_VND_TABLE_CFG || pMsg->msgType == TDMT_VND_BATCH_META) && - !vnodeIsReadyForRead(pVnode)) { + !vnodeIsLeader(pVnode)) { + vnodeRedirectRpcMsg(pVnode, pMsg); + return 0; + } + + if (pMsg->msgType == TDMT_VND_CONSUME && !pVnode->restored) { vnodeRedirectRpcMsg(pVnode, pMsg); return 0; } @@ -808,7 +813,6 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq SSubmitRsp submitRsp = {0}; SSubmitMsgIter msgIter = {0}; SSubmitBlk *pBlock; - SSubmitRsp rsp = {0}; SVCreateTbReq createTbReq = {0}; SDecoder decoder = {0}; int32_t nRows; @@ -921,7 +925,8 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq } if (taosArrayGetSize(newTbUids) > 0) { - vDebug("vgId:%d, add %d table into query table list in handling submit", TD_VID(pVnode), (int32_t)taosArrayGetSize(newTbUids)); + vDebug("vgId:%d, add %d table into query table list in handling submit", TD_VID(pVnode), + (int32_t)taosArrayGetSize(newTbUids)); } tqUpdateTbUidList(pVnode->pTq, newTbUids, true); diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index cdbdd4b468c857f793229f98af2f8b776085cb6a..aa3f72d281a0c59c9e317b1bbc11930c44c8916b 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -240,7 +240,7 @@ void vnodeProposeWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) isWeak, isBlock, msg, numOfMsgs, arrayPos, pMsg->info.handle); if (!pVnode->restored) { - vGError("vgId:%d, msg:%p failed to process since not leader", vgId, pMsg); + vGError("vgId:%d, msg:%p failed to process since restore not finished", vgId, pMsg); terrno = TSDB_CODE_APP_NOT_READY; vnodeHandleProposeError(pVnode, pMsg, TSDB_CODE_APP_NOT_READY); rpcFreeCont(pMsg->pCont); @@ -796,16 +796,3 @@ bool vnodeIsLeader(SVnode *pVnode) { return true; } -bool vnodeIsReadyForRead(SVnode *pVnode) { - if (syncIsReady(pVnode->sync)) { - return true; - } - - if (syncIsReadyForRead(pVnode->sync)) { - return true; - } - - vDebug("vgId:%d, vnode not ready for read, state:%s, last:%ld, cmt:%ld", pVnode->config.vgId, - syncGetMyRoleStr(pVnode->sync), syncGetLastIndex(pVnode->sync), syncGetCommitIndex(pVnode->sync)); - return false; -} diff --git a/source/libs/catalog/src/ctgAsync.c b/source/libs/catalog/src/ctgAsync.c index 3c4cc9f7a2d11f10b5303a7769dbfe085f38f6a1..463ea9340aed23217e00cedebe4403fb5070cc56 100644 --- a/source/libs/catalog/src/ctgAsync.c +++ b/source/libs/catalog/src/ctgAsync.c @@ -487,6 +487,8 @@ int32_t ctgInitTask(SCtgJob* pJob, CTG_TASK_TYPE type, void* param, int32_t* tas int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgJob** job, const SCatalogReq* pReq, catalogCallback fp, void* param) { int32_t code = 0; + int64_t st = taosGetTimestampUs(); + int32_t tbMetaNum = (int32_t)ctgGetTablesReqNum(pReq->pTableMeta); int32_t dbVgNum = (int32_t)taosArrayGetSize(pReq->pDbVgroup); int32_t tbHashNum = (int32_t)ctgGetTablesReqNum(pReq->pTableHash); @@ -634,12 +636,12 @@ int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgJob** job, const taosAcquireRef(gCtgMgmt.jobPool, pJob->refId); - qDebug("QID:0x%" PRIx64 ", jobId: 0x%" PRIx64 " initialized, task num %d, forceUpdate %d", pJob->queryId, pJob->refId, - taskNum, pReq->forceUpdate); + double el = (taosGetTimestampUs() - st)/1000.0; + qDebug("QID:0x%" PRIx64 ", jobId: 0x%" PRIx64 " initialized, task num %d, forceUpdate %d, elapsed time:%.2f ms", + pJob->queryId, pJob->refId, taskNum, pReq->forceUpdate, el); return TSDB_CODE_SUCCESS; _return: - ctgFreeJob(*job); CTG_RET(code); } diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index 12e00a0a06d46525d04829b17ef5e0b755c80ac7..56470f066801283eae6a5414b8f6d90d86ce8e86 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -34,6 +34,7 @@ extern "C" { #include "scalar.h" #include "taosdef.h" #include "tarray.h" +#include "tfill.h" #include "thash.h" #include "tlockfree.h" #include "tmsg.h" @@ -145,6 +146,7 @@ typedef struct { SMqMetaRsp metaRsp; // for tmq fetching meta int8_t returned; int64_t snapshotVer; + const SSubmitReq* pReq; SSchemaWrapper* schema; char tbName[TSDB_TABLE_NAME_LEN]; @@ -191,6 +193,7 @@ enum { OP_OPENED = 0x1, OP_RES_TO_RETURN = 0x5, OP_EXEC_DONE = 0x9, + OP_EXEC_RECV = 0x11, }; typedef struct SOperatorFpSet { @@ -798,6 +801,22 @@ typedef struct SStreamPartitionOperatorInfo { SSDataBlock* pDelRes; } SStreamPartitionOperatorInfo; +typedef struct SStreamFillOperatorInfo { + SStreamFillSupporter* pFillSup; + SSDataBlock* pRes; + SSDataBlock* pSrcBlock; + int32_t srcRowIndex; + SSDataBlock* pPrevSrcBlock; + SSDataBlock* pSrcDelBlock; + int32_t srcDelRowIndex; + SSDataBlock* pDelRes; + SNode* pCondition; + SArray* pColMatchColInfo; + int32_t primaryTsCol; + int32_t primarySrcSlotId; + SStreamFillInfo* pFillInfo; +} SStreamFillOperatorInfo; + typedef struct STimeSliceOperatorInfo { SSDataBlock* pRes; STimeWindow win; @@ -1006,6 +1025,8 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SOperatorInfo* createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo); +SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFillPhysiNode* pPhyFillNode, + SExecTaskInfo* pTaskInfo); int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBlock* pSrcBlock, SqlFunctionCtx* pCtx, int32_t numOfOutput, SArray* pPseudoList); @@ -1094,6 +1115,7 @@ int32_t setOutputBuf(STimeWindow* win, SResultRow** pResult, int64_t tableGroupI SExecTaskInfo* pTaskInfo); int32_t releaseOutputBuf(SExecTaskInfo* pTaskInfo, SWinKey* pKey, SResultRow* pResult); int32_t saveOutputBuf(SExecTaskInfo* pTaskInfo, SWinKey* pKey, SResultRow* pResult, int32_t resSize); +void getNextIntervalWindow(SInterval* pInterval, STimeWindow* tw, int32_t order); #ifdef __cplusplus } diff --git a/source/libs/executor/inc/tfill.h b/source/libs/executor/inc/tfill.h index 63abfc019d7e687267ab2766d0da0e054a6a4a3c..ed019be767b63b9ec641ea25b86670d1cdd4974e 100644 --- a/source/libs/executor/inc/tfill.h +++ b/source/libs/executor/inc/tfill.h @@ -23,12 +23,13 @@ extern "C" { #include "os.h" #include "taosdef.h" #include "tcommon.h" +#include "tsimplehash.h" struct SSDataBlock; typedef struct SFillColInfo { - SExprInfo *pExpr; - bool notFillCol; // denote if this column needs fill operation + SExprInfo* pExpr; + bool notFillCol; // denote if this column needs fill operation SVariant fillVal; } SFillColInfo; @@ -51,46 +52,96 @@ typedef struct { } SRowVal; typedef struct SFillInfo { - TSKEY start; // start timestamp - TSKEY end; // endKey for fill - TSKEY currentKey; // current active timestamp, the value may be changed during the fill procedure. - int32_t tsSlotId; // primary time stamp slot id - int32_t srcTsSlotId; // timestamp column id in the source data block. - int32_t order; // order [TSDB_ORDER_ASC|TSDB_ORDER_DESC] - int32_t type; // fill type - int32_t numOfRows; // number of rows in the input data block - int32_t index; // active row index - int32_t numOfTotal; // number of filled rows in one round - int32_t numOfCurrent; // number of filled rows in current results - int32_t numOfCols; // number of columns, including the tags columns - SInterval interval; - SRowVal prev; - SRowVal next; - SSDataBlock *pSrcBlock; - int32_t alloc; // data buffer size in rows - - SFillColInfo* pFillCol; // column info for fill operations - SFillTagColInfo* pTags; // tags value for filling gap - const char* id; + TSKEY start; // start timestamp + TSKEY end; // endKey for fill + TSKEY currentKey; // current active timestamp, the value may be changed during the fill procedure. + int32_t tsSlotId; // primary time stamp slot id + int32_t srcTsSlotId; // timestamp column id in the source data block. + int32_t order; // order [TSDB_ORDER_ASC|TSDB_ORDER_DESC] + int32_t type; // fill type + int32_t numOfRows; // number of rows in the input data block + int32_t index; // active row index + int32_t numOfTotal; // number of filled rows in one round + int32_t numOfCurrent; // number of filled rows in current results + int32_t numOfCols; // number of columns, including the tags columns + SInterval interval; + SRowVal prev; + SRowVal next; + SSDataBlock* pSrcBlock; + int32_t alloc; // data buffer size in rows + + SFillColInfo* pFillCol; // column info for fill operations + SFillTagColInfo* pTags; // tags value for filling gap + const char* id; } SFillInfo; -int64_t getNumOfResultsAfterFillGap(SFillInfo* pFillInfo, int64_t ekey, int32_t maxNumOfRows); +typedef struct SResultCellData { + bool isNull; + int8_t type; + int32_t bytes; + char pData[]; +} SResultCellData; + +typedef struct SResultRowData { + TSKEY key; + SResultCellData* pRowVal; +} SResultRowData; + +typedef struct SStreamFillLinearInfo { + TSKEY nextEnd; + SArray* pDeltaVal; // double. value for Fill(linear). + SArray* pNextDeltaVal; // double. value for Fill(linear). + int64_t winIndex; + bool hasNext; +} SStreamFillLinearInfo; + +typedef struct SStreamFillInfo { + TSKEY start; // startKey for fill + TSKEY end; // endKey for fill + TSKEY current; // current Key for fill + TSKEY preRowKey; + TSKEY nextRowKey; + SResultRowData* pResRow; + SStreamFillLinearInfo* pLinearInfo; + bool needFill; + int32_t type; // fill type + int32_t pos; + SArray* delRanges; + int32_t delIndex; +} SStreamFillInfo; + +typedef struct SStreamFillSupporter { + int32_t type; // fill type + SInterval interval; + SResultRowData prev; + SResultRowData cur; + SResultRowData next; + SResultRowData nextNext; + SFillColInfo* pAllColInfo; // fill exprs and not fill exprs + int32_t numOfAllCols; // number of all exprs, including the tags columns + int32_t numOfFillCols; + int32_t numOfNotFillCols; + int32_t rowSize; + SSHashObj* pResMap; + bool hasDelete; +} SStreamFillSupporter; +int64_t getNumOfResultsAfterFillGap(SFillInfo* pFillInfo, int64_t ekey, int32_t maxNumOfRows); -void taosFillSetStartInfo(struct SFillInfo* pFillInfo, int32_t numOfRows, TSKEY endKey); -void taosResetFillInfo(struct SFillInfo* pFillInfo, TSKEY startTimestamp); -void taosFillSetInputDataBlock(struct SFillInfo* pFillInfo, const struct SSDataBlock* pInput); -struct SFillColInfo* createFillColInfo(SExprInfo* pExpr, int32_t numOfFillExpr, SExprInfo* pNotFillExpr, int32_t numOfNotFillCols, const struct SNodeListNode* val); -bool taosFillHasMoreResults(struct SFillInfo* pFillInfo); +void taosFillSetStartInfo(struct SFillInfo* pFillInfo, int32_t numOfRows, TSKEY endKey); +void taosResetFillInfo(struct SFillInfo* pFillInfo, TSKEY startTimestamp); +void taosFillSetInputDataBlock(struct SFillInfo* pFillInfo, const struct SSDataBlock* pInput); +struct SFillColInfo* createFillColInfo(SExprInfo* pExpr, int32_t numOfFillExpr, SExprInfo* pNotFillExpr, + int32_t numOfNotFillCols, const struct SNodeListNode* val); +bool taosFillHasMoreResults(struct SFillInfo* pFillInfo); SFillInfo* taosCreateFillInfo(TSKEY skey, int32_t numOfFillCols, int32_t numOfNotFillCols, int32_t capacity, SInterval* pInterval, int32_t fillType, struct SFillColInfo* pCol, int32_t slotId, int32_t order, const char* id); -void* taosDestroyFillInfo(struct SFillInfo *pFillInfo); +void* taosDestroyFillInfo(struct SFillInfo* pFillInfo); int64_t taosFillResultDataBlock(struct SFillInfo* pFillInfo, SSDataBlock* p, int32_t capacity); -int64_t getFillInfoStart(struct SFillInfo *pFillInfo); - +int64_t getFillInfoStart(struct SFillInfo* pFillInfo); #ifdef __cplusplus } diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index 373cb451f4f73fc0d2f6245f9ea9af06617ea59f..a8c73f0170a3a888f9ec27c66e19667654bc1abd 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -479,14 +479,14 @@ static void freeBlock(void* param) { blockDataDestroy(pBlock); } -int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds, SLocalFetch* pLocal) { +int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds, bool* hasMore, SLocalFetch* pLocal) { SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo; int64_t threadId = taosGetSelfPthreadId(); if (pLocal) { memcpy(&pTaskInfo->localFetch, pLocal, sizeof(*pLocal)); } - + taosArrayClearEx(pResList, freeBlock); int64_t curOwner = 0; @@ -536,6 +536,7 @@ int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds, SL } } + *hasMore = (pRes != NULL); uint64_t el = (taosGetTimestampUs() - st); pTaskInfo->cost.elapsedTime += el; @@ -773,6 +774,14 @@ int32_t initQueryTableDataCondForTmq(SQueryTableDataCond* pCond, SSnapContext* s return TSDB_CODE_SUCCESS; } +int32_t qStreamScanMemData(qTaskInfo_t tinfo, const SSubmitReq* pReq) { + SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo; + ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE); + ASSERT(pTaskInfo->streamInfo.pReq == NULL); + pTaskInfo->streamInfo.pReq = pReq; + return 0; +} + int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subType) { SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo; SOperatorInfo* pOperator = pTaskInfo->pRoot; diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index a0729bdf3b2721758110ed0a62e4ef6297d09ee1..99177913126b3da573fb9a006171f1dbae686d6b 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -3742,6 +3742,8 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo pOptr = createMergeJoinOperatorInfo(ops, size, (SSortMergeJoinPhysiNode*)pPhyNode, pTaskInfo); } else if (QUERY_NODE_PHYSICAL_PLAN_FILL == type) { pOptr = createFillOperatorInfo(ops[0], (SFillPhysiNode*)pPhyNode, pTaskInfo); + } else if (QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL == type) { + pOptr = createStreamFillOperatorInfo(ops[0], (SStreamFillPhysiNode*)pPhyNode, pTaskInfo); } else if (QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC == type) { pOptr = createIndefinitOutputOperatorInfo(ops[0], pPhyNode, pTaskInfo); } else if (QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC == type) { diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c index 2f12a0d19bdf74e7b0b2ab94c373a31cbe7d8316..e9e6fed66aad43daf71a99613fb966d16461da76 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -53,7 +53,7 @@ static void destroyIndefinitOperatorInfo(void* param) { SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhysiNode* pProjPhyNode, SExecTaskInfo* pTaskInfo) { - int32_t code = TSDB_CODE_SUCCESS; + int32_t code = TSDB_CODE_SUCCESS; SProjectOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SProjectOperatorInfo)); SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); if (pInfo == NULL || pOperator == NULL) { @@ -184,7 +184,7 @@ static int32_t doIngroupLimitOffset(SLimitInfo* pLimitInfo, uint64_t groupId, SS if (pLimitInfo->limit.limit >= 0 && pLimitInfo->numOfOutputRows + pBlock->info.rows >= pLimitInfo->limit.limit) { int32_t keepRows = (int32_t)(pLimitInfo->limit.limit - pLimitInfo->numOfOutputRows); blockDataKeepFirstNRows(pBlock, keepRows); - //TODO: optimize it later when partition by + limit + // TODO: optimize it later when partition by + limit if ((pLimitInfo->slimit.limit == -1 && pLimitInfo->currentGroupId == 0) || (pLimitInfo->slimit.limit > 0 && pLimitInfo->slimit.limit <= pLimitInfo->numOfOutputGroups)) { doSetOperatorCompleted(pOperator); @@ -206,9 +206,16 @@ SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) { blockDataCleanup(pFinalRes); SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + if (pTaskInfo->streamInfo.pReq) { + pOperator->status = OP_OPENED; + } + + qDebug("enter project"); + if (pOperator->status == OP_EXEC_DONE) { if (pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE) { pOperator->status = OP_OPENED; + qDebug("projection in queue model, set status open and return null"); return NULL; } @@ -237,9 +244,23 @@ SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) { // The downstream exec may change the value of the newgroup, so use a local variable instead. SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream); if (pBlock == NULL) { + if (pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE && pFinalRes->info.rows == 0) { + pOperator->status = OP_OPENED; + if (pOperator->status == OP_EXEC_RECV) { + continue; + } else { + return NULL; + } + } + qDebug("set op close, exec %d, status %d rows %d", pTaskInfo->execModel, pOperator->status, + pFinalRes->info.rows); doSetOperatorCompleted(pOperator); break; } + if (pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE) { + qDebug("set status recv"); + pOperator->status = OP_EXEC_RECV; + } // for stream interval if (pBlock->info.type == STREAM_RETRIEVE || pBlock->info.type == STREAM_DELETE_RESULT || @@ -298,6 +319,7 @@ SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) { // when apply the limit/offset for each group, pRes->info.rows may be 0, due to limit constraint. if (pFinalRes->info.rows > 0 || (pOperator->status == OP_EXEC_DONE)) { + qDebug("project return %d rows, status %d", pFinalRes->info.rows, pOperator->status); break; } } else { diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 6c5c33ae29e034add9bb07cea6f98c66dbeec58b..927ef2c64d03c050d859a2878765d4cfcddc7f41 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -1022,11 +1022,7 @@ static uint64_t getGroupIdByCol(SStreamScanInfo* pInfo, uint64_t uid, TSKEY ts, return calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pPreRes, 0); } -static uint64_t getGroupIdByData(SStreamScanInfo* pInfo, uint64_t uid, TSKEY ts, int64_t maxVersion) { - if (pInfo->partitionSup.needCalc) { - return getGroupIdByCol(pInfo, uid, ts, maxVersion); - } - +static uint64_t getGroupIdByUid(SStreamScanInfo* pInfo, uint64_t uid) { SHashObj* map = pInfo->pTableScanOp->pTaskInfo->tableqinfoList.map; uint64_t* groupId = taosHashGet(map, &uid, sizeof(int64_t)); if (groupId) { @@ -1035,6 +1031,14 @@ static uint64_t getGroupIdByData(SStreamScanInfo* pInfo, uint64_t uid, TSKEY ts, return 0; } +static uint64_t getGroupIdByData(SStreamScanInfo* pInfo, uint64_t uid, TSKEY ts, int64_t maxVersion) { + if (pInfo->partitionSup.needCalc) { + return getGroupIdByCol(pInfo, uid, ts, maxVersion); + } + + return getGroupIdByUid(pInfo, uid); +} + static bool prepareRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pBlock, int32_t* pRowIndex) { if ((*pRowIndex) == pBlock->info.rows) { return false; @@ -1081,26 +1085,32 @@ static bool prepareRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pBlock, int32_ return true; } -static STimeWindow getSlidingWindow(TSKEY* startTsCol, TSKEY* endTsCol, SInterval* pInterval, +static STimeWindow getSlidingWindow(TSKEY* startTsCol, TSKEY* endTsCol, uint64_t* gpIdCol, SInterval* pInterval, SDataBlockInfo* pDataBlockInfo, int32_t* pRowIndex, bool hasGroup) { SResultRowInfo dumyInfo; dumyInfo.cur.pageId = -1; STimeWindow win = getActiveTimeWindow(NULL, &dumyInfo, startTsCol[*pRowIndex], pInterval, TSDB_ORDER_ASC); STimeWindow endWin = win; STimeWindow preWin = win; + uint64_t groupId = gpIdCol[*pRowIndex]; while (1) { if (hasGroup) { (*pRowIndex) += 1; } else { - (*pRowIndex) += getNumOfRowsInTimeWindow(pDataBlockInfo, startTsCol, *pRowIndex, endWin.ekey, binarySearchForKey, - NULL, TSDB_ORDER_ASC); + while ((groupId == gpIdCol[(*pRowIndex)] && startTsCol[*pRowIndex] < endWin.ekey)) { + (*pRowIndex) += 1; + if ((*pRowIndex) == pDataBlockInfo->rows) { + break; + } + } } + do { preWin = endWin; getNextTimeWindow(pInterval, &endWin, TSDB_ORDER_ASC); } while (endTsCol[(*pRowIndex) - 1] >= endWin.skey); endWin = preWin; - if (win.ekey == endWin.ekey || (*pRowIndex) == pDataBlockInfo->rows) { + if (win.ekey == endWin.ekey || (*pRowIndex) == pDataBlockInfo->rows || groupId != gpIdCol[*pRowIndex]) { win.ekey = endWin.ekey; return win; } @@ -1235,11 +1245,13 @@ static int32_t generateIntervalScanRange(SStreamScanInfo* pInfo, SSDataBlock* pS int64_t version = pSrcBlock->info.version - 1; for (int32_t i = 0; i < rows;) { uint64_t srcUid = srcUidData[i]; - uint64_t groupId = getGroupIdByData(pInfo, srcUid, srcStartTsCol[i], version); - uint64_t srcGpId = srcGp[i]; - TSKEY calStartTs = srcStartTsCol[i]; + uint64_t groupId = srcGp[i]; + if (groupId == 0) { + groupId = getGroupIdByData(pInfo, srcUid, srcStartTsCol[i], version); + } + TSKEY calStartTs = srcStartTsCol[i]; colDataAppend(pCalStartTsCol, pDestBlock->info.rows, (const char*)(&calStartTs), false); - STimeWindow win = getSlidingWindow(srcStartTsCol, srcEndTsCol, &pInfo->interval, &pSrcBlock->info, &i, + STimeWindow win = getSlidingWindow(srcStartTsCol, srcEndTsCol, srcGp, &pInfo->interval, &pSrcBlock->info, &i, pInfo->partitionSup.needCalc); TSKEY calEndTs = srcStartTsCol[i - 1]; colDataAppend(pCalEndTsCol, pDestBlock->info.rows, (const char*)(&calEndTs), false); @@ -1248,15 +1260,6 @@ static int32_t generateIntervalScanRange(SStreamScanInfo* pInfo, SSDataBlock* pS colDataAppend(pEndTsCol, pDestBlock->info.rows, (const char*)(&win.ekey), false); colDataAppend(pGpCol, pDestBlock->info.rows, (const char*)(&groupId), false); pDestBlock->info.rows++; - if (pInfo->partitionSup.needCalc && srcGpId != 0 && groupId != srcGpId) { - colDataAppend(pCalStartTsCol, pDestBlock->info.rows, (const char*)(&calStartTs), false); - colDataAppend(pCalEndTsCol, pDestBlock->info.rows, (const char*)(&calEndTs), false); - colDataAppend(pDeUidCol, pDestBlock->info.rows, (const char*)(&srcUid), false); - colDataAppend(pStartTsCol, pDestBlock->info.rows, (const char*)(&win.skey), false); - colDataAppend(pEndTsCol, pDestBlock->info.rows, (const char*)(&win.ekey), false); - colDataAppend(pGpCol, pDestBlock->info.rows, (const char*)(&srcGpId), false); - pDestBlock->info.rows++; - } } return TSDB_CODE_SUCCESS; } @@ -1331,7 +1334,7 @@ void appendOneRow(SSDataBlock* pBlock, TSKEY* pStartTs, TSKEY* pEndTs, uint64_t* static void checkUpdateData(SStreamScanInfo* pInfo, bool invertible, SSDataBlock* pBlock, bool out) { if (out) { blockDataCleanup(pInfo->pUpdateDataRes); - blockDataEnsureCapacity(pInfo->pUpdateDataRes, pBlock->info.rows); + blockDataEnsureCapacity(pInfo->pUpdateDataRes, pBlock->info.rows * 2); } SColumnInfoData* pColDataInfo = taosArrayGet(pBlock->pDataBlock, pInfo->primaryTsIndex); ASSERT(pColDataInfo->info.type == TSDB_DATA_TYPE_TIMESTAMP); @@ -1352,10 +1355,12 @@ static void checkUpdateData(SStreamScanInfo* pInfo, bool invertible, SSDataBlock isDeletedStreamWindow(&win, pBlock->info.groupId, pInfo->pTableScanOp, &pInfo->twAggSup); if ((update || closedWin) && out) { qDebug("stream update check not pass, update %d, closedWin %d", update, closedWin); - uint64_t gpId = closedWin && pInfo->partitionSup.needCalc - ? calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pBlock, rowId) - : 0; + uint64_t gpId = 0; appendOneRow(pInfo->pUpdateDataRes, tsCol + rowId, tsCol + rowId, &pBlock->info.uid, &gpId); + if (closedWin && pInfo->partitionSup.needCalc) { + gpId = calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pBlock, rowId); + appendOneRow(pInfo->pUpdateDataRes, tsCol + rowId, tsCol + rowId, &pBlock->info.uid, &gpId); + } } } if (out && pInfo->pUpdateDataRes->info.rows > 0) { @@ -1430,6 +1435,43 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) { SStreamScanInfo* pInfo = pOperator->info; qDebug("queue scan called"); + + if (pTaskInfo->streamInfo.pReq != NULL) { + if (pInfo->tqReader->pMsg == NULL) { + pInfo->tqReader->pMsg = pTaskInfo->streamInfo.pReq; + const SSubmitReq* pSubmit = pInfo->tqReader->pMsg; + if (tqReaderSetDataMsg(pInfo->tqReader, pSubmit, 0) < 0) { + qError("submit msg messed up when initing stream submit block %p", pSubmit); + pInfo->tqReader->pMsg = NULL; + pTaskInfo->streamInfo.pReq = NULL; + ASSERT(0); + } + } + + blockDataCleanup(pInfo->pRes); + SDataBlockInfo* pBlockInfo = &pInfo->pRes->info; + + while (tqNextDataBlock(pInfo->tqReader)) { + SSDataBlock block = {0}; + + int32_t code = tqRetrieveDataBlock(&block, pInfo->tqReader); + + if (code != TSDB_CODE_SUCCESS || block.info.rows == 0) { + continue; + } + + setBlockIntoRes(pInfo, &block); + + if (pBlockInfo->rows > 0) { + return pInfo->pRes; + } + } + + pInfo->tqReader->pMsg = NULL; + pTaskInfo->streamInfo.pReq = NULL; + return NULL; + } + if (pTaskInfo->streamInfo.prepareStatus.type == TMQ_OFFSET__SNAPSHOT_DATA) { SSDataBlock* pResult = doTableScan(pInfo->pTableScanOp); if (pResult && pResult->info.rows > 0) { @@ -1462,8 +1504,8 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) { if (setBlockIntoRes(pInfo, &ret.data) < 0) { ASSERT(0); } - // TODO clean data block if (pInfo->pRes->info.rows > 0) { + pOperator->status = OP_EXEC_RECV; qDebug("queue scan log return %d rows", pInfo->pRes->info.rows); return pInfo->pRes; } @@ -1472,18 +1514,19 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) { // pTaskInfo->streamInfo.lastStatus = ret.offset; // pTaskInfo->streamInfo.metaBlk = ret.meta; // return NULL; - } else if (ret.fetchType == FETCH_TYPE__NONE) { + } else if (ret.fetchType == FETCH_TYPE__NONE || + (ret.fetchType == FETCH_TYPE__SEP && pOperator->status == OP_EXEC_RECV)) { pTaskInfo->streamInfo.lastStatus = ret.offset; ASSERT(pTaskInfo->streamInfo.lastStatus.version >= pTaskInfo->streamInfo.prepareStatus.version); ASSERT(pTaskInfo->streamInfo.lastStatus.version + 1 == pInfo->tqReader->pWalReader->curVersion); char formatBuf[80]; tFormatOffset(formatBuf, 80, &ret.offset); qDebug("queue scan log return null, offset %s", formatBuf); + pOperator->status = OP_OPENED; return NULL; - } else { - ASSERT(0); } } +#if 0 } else if (pTaskInfo->streamInfo.prepareStatus.type == TMQ_OFFSET__SNAPSHOT_DATA) { SSDataBlock* pResult = doTableScan(pInfo->pTableScanOp); if (pResult && pResult->info.rows > 0) { @@ -1492,6 +1535,7 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) { } qDebug("stream scan tsdb return null"); return NULL; +#endif } else { ASSERT(0); return NULL; @@ -1532,6 +1576,30 @@ static int32_t filterDelBlockByUid(SSDataBlock* pDst, const SSDataBlock* pSrc, S return 0; } +// for partition by tag +static void setBlockGroupIdByUid(SStreamScanInfo* pInfo, SSDataBlock* pBlock) { + SColumnInfoData* pStartTsCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); + TSKEY* startTsCol = (TSKEY*)pStartTsCol->pData; + SColumnInfoData* pGpCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); + uint64_t* gpCol = (uint64_t*)pGpCol->pData; + SColumnInfoData* pUidCol = taosArrayGet(pBlock->pDataBlock, UID_COLUMN_INDEX); + uint64_t* uidCol = (uint64_t*)pUidCol->pData; + int32_t rows = pBlock->info.rows; + if (!pInfo->partitionSup.needCalc) { + for (int32_t i = 0; i < rows; i++) { + uint64_t groupId = getGroupIdByUid(pInfo, uidCol[i]); + colDataAppend(pGpCol, i, (const char*)&groupId, false); + } + } else { + // SSDataBlock* pPreRes = readPreVersionData(pInfo->pTableScanOp, uidCol[i], startTsCol, ts, maxVersion); + // if (!pPreRes || pPreRes->info.rows == 0) { + // return 0; + // } + // ASSERT(pPreRes->info.rows == 1); + // return calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pPreRes, 0); + } +} + static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) { // NOTE: this operator does never check if current status is done or not SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; @@ -1628,7 +1696,8 @@ FETCH_NEXT_BLOCK: } else { pDelBlock = pBlock; } - printDataBlock(pBlock, "stream scan delete recv filtered"); + setBlockGroupIdByUid(pInfo, pDelBlock); + printDataBlock(pDelBlock, "stream scan delete recv filtered"); if (!isIntervalWindow(pInfo) && !isSessionWindow(pInfo) && !isStateWindow(pInfo)) { generateDeleteResultBlock(pInfo, pDelBlock, pInfo->pDeleteDataRes); pInfo->pDeleteDataRes->info.type = STREAM_DELETE_RESULT; diff --git a/source/libs/executor/src/tfill.c b/source/libs/executor/src/tfill.c index f23552c5a7b82207ffc368dbae7c1894cb6a8edd..ea0d26f4de167f0158f22a2e438ac16a74e3485f 100644 --- a/source/libs/executor/src/tfill.c +++ b/source/libs/executor/src/tfill.c @@ -19,6 +19,7 @@ #include "tmsg.h" #include "ttypes.h" +#include "executorimpl.h" #include "tcommon.h" #include "thash.h" #include "ttime.h" @@ -35,18 +36,30 @@ #define GET_DEST_SLOT_ID(_p) ((_p)->pExpr->base.resSchema.slotId) +#define FILL_POS_INVALID 0 +#define FILL_POS_START 1 +#define FILL_POS_MID 2 +#define FILL_POS_END 3 + +typedef struct STimeRange { + TSKEY skey; + TSKEY ekey; + uint64_t groupId; +} STimeRange; + static void doSetVal(SColumnInfoData* pDstColInfoData, int32_t rowIndex, const SGroupKeys* pKey); -static bool fillIfWindowPseudoColumn(SFillInfo* pFillInfo, SFillColInfo* pCol, SColumnInfoData* pDstColInfoData, int32_t rowIndex); +static bool fillIfWindowPseudoColumn(SFillInfo* pFillInfo, SFillColInfo* pCol, SColumnInfoData* pDstColInfoData, + int32_t rowIndex); static void setNullRow(SSDataBlock* pBlock, SFillInfo* pFillInfo, int32_t rowIndex) { - for(int32_t i = 0; i < pFillInfo->numOfCols; ++i) { - SFillColInfo* pCol = &pFillInfo->pFillCol[i]; - int32_t dstSlotId = GET_DEST_SLOT_ID(pCol); + for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) { + SFillColInfo* pCol = &pFillInfo->pFillCol[i]; + int32_t dstSlotId = GET_DEST_SLOT_ID(pCol); SColumnInfoData* pDstColInfo = taosArrayGet(pBlock->pDataBlock, dstSlotId); if (pCol->notFillCol) { bool filled = fillIfWindowPseudoColumn(pFillInfo, pCol, pDstColInfo, rowIndex); if (!filled) { - SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->prev.pRowVal : pFillInfo->next.pRowVal; + SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->prev.pRowVal : pFillInfo->next.pRowVal; SGroupKeys* pKey = taosArrayGet(p, i); doSetVal(pDstColInfo, rowIndex, pKey); } @@ -76,8 +89,9 @@ static void doSetUserSpecifiedValue(SColumnInfoData* pDst, SVariant* pVar, int32 } } -//fill windows pseudo column, _wstart, _wend, _wduration and return true, otherwise return false -static bool fillIfWindowPseudoColumn(SFillInfo* pFillInfo, SFillColInfo* pCol, SColumnInfoData* pDstColInfoData, int32_t rowIndex) { +// fill windows pseudo column, _wstart, _wend, _wduration and return true, otherwise return false +static bool fillIfWindowPseudoColumn(SFillInfo* pFillInfo, SFillColInfo* pCol, SColumnInfoData* pDstColInfoData, + int32_t rowIndex) { if (!pCol->notFillCol) { return false; } @@ -89,15 +103,15 @@ static bool fillIfWindowPseudoColumn(SFillInfo* pFillInfo, SFillColInfo* pCol, S colDataAppend(pDstColInfoData, rowIndex, (const char*)&pFillInfo->currentKey, false); return true; } else if (pCol->pExpr->base.pParam[0].pCol->colType == COLUMN_TYPE_WINDOW_END) { - //TODO: include endpoint + // TODO: include endpoint SInterval* pInterval = &pFillInfo->interval; - int32_t step = (pFillInfo->order == TSDB_ORDER_ASC) ? 1 : -1; - int64_t windowEnd = + int32_t step = (pFillInfo->order == TSDB_ORDER_ASC) ? 1 : -1; + int64_t windowEnd = taosTimeAdd(pFillInfo->currentKey, pInterval->sliding * step, pInterval->slidingUnit, pInterval->precision); colDataAppend(pDstColInfoData, rowIndex, (const char*)&windowEnd, false); return true; } else if (pCol->pExpr->base.pParam[0].pCol->colType == COLUMN_TYPE_WINDOW_DURATION) { - //TODO: include endpoint + // TODO: include endpoint colDataAppend(pDstColInfoData, rowIndex, (const char*)&pFillInfo->interval.sliding, false); return true; } @@ -115,13 +129,13 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock* // set the other values if (pFillInfo->type == TSDB_FILL_PREV) { - SArray* p = FILL_IS_ASC_FILL(pFillInfo)? pFillInfo->prev.pRowVal : pFillInfo->next.pRowVal; + SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->prev.pRowVal : pFillInfo->next.pRowVal; for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) { SFillColInfo* pCol = &pFillInfo->pFillCol[i]; SColumnInfoData* pDstColInfoData = taosArrayGet(pBlock->pDataBlock, GET_DEST_SLOT_ID(pCol)); - bool filled = fillIfWindowPseudoColumn(pFillInfo, pCol, pDstColInfoData, index); + bool filled = fillIfWindowPseudoColumn(pFillInfo, pCol, pDstColInfoData, index); if (!filled) { SGroupKeys* pKey = taosArrayGet(p, i); doSetVal(pDstColInfoData, index, pKey); @@ -131,9 +145,9 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock* SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->next.pRowVal : pFillInfo->prev.pRowVal; // todo refactor: start from 0 not 1 for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) { - SFillColInfo* pCol = &pFillInfo->pFillCol[i]; + SFillColInfo* pCol = &pFillInfo->pFillCol[i]; SColumnInfoData* pDstColInfoData = taosArrayGet(pBlock->pDataBlock, GET_DEST_SLOT_ID(pCol)); - bool filled = fillIfWindowPseudoColumn(pFillInfo, pCol, pDstColInfoData, index); + bool filled = fillIfWindowPseudoColumn(pFillInfo, pCol, pDstColInfoData, index); if (!filled) { SGroupKeys* pKey = taosArrayGet(p, i); doSetVal(pDstColInfoData, index, pKey); @@ -154,7 +168,7 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock* if (pCol->notFillCol) { bool filled = fillIfWindowPseudoColumn(pFillInfo, pCol, pDstCol, index); if (!filled) { - SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->prev.pRowVal : pFillInfo->next.pRowVal; + SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->prev.pRowVal : pFillInfo->next.pRowVal; SGroupKeys* pKey = taosArrayGet(p, i); doSetVal(pDstCol, index, pKey); } @@ -190,13 +204,13 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock* for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) { SFillColInfo* pCol = &pFillInfo->pFillCol[i]; - int32_t slotId = GET_DEST_SLOT_ID(pCol); + int32_t slotId = GET_DEST_SLOT_ID(pCol); SColumnInfoData* pDst = taosArrayGet(pBlock->pDataBlock, slotId); if (pCol->notFillCol) { bool filled = fillIfWindowPseudoColumn(pFillInfo, pCol, pDst, index); if (!filled) { - SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->prev.pRowVal : pFillInfo->next.pRowVal; + SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->prev.pRowVal : pFillInfo->next.pRowVal; SGroupKeys* pKey = taosArrayGet(p, i); doSetVal(pDst, index, pKey); } @@ -261,8 +275,8 @@ static void copyCurrentRowIntoBuf(SFillInfo* pFillInfo, int32_t rowIndex, SArray } else if (type == QUERY_NODE_OPERATOR) { SColumnInfoData* pSrcCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, i); - bool isNull = colDataIsNull_s(pSrcCol, rowIndex); - char* p = colDataGetData(pSrcCol, rowIndex); + bool isNull = colDataIsNull_s(pSrcCol, rowIndex); + char* p = colDataGetData(pSrcCol, rowIndex); saveColData(pRow, i, p, isNull); } else { ASSERT(0); @@ -425,9 +439,9 @@ struct SFillInfo* taosCreateFillInfo(TSKEY skey, int32_t numOfFillCols, int32_t pFillInfo->order = order; pFillInfo->srcTsSlotId = primaryTsSlotId; - for(int32_t i = 0; i < numOfNotFillCols; ++i) { + for (int32_t i = 0; i < numOfNotFillCols; ++i) { SFillColInfo* p = &pCol[i + numOfFillCols]; - int32_t srcSlotId = GET_DEST_SLOT_ID(p); + int32_t srcSlotId = GET_DEST_SLOT_ID(p); if (srcSlotId == primaryTsSlotId) { pFillInfo->tsSlotId = i + numOfFillCols; break; @@ -499,9 +513,9 @@ void* taosDestroyFillInfo(SFillInfo* pFillInfo) { } taosArrayDestroy(pFillInfo->next.pRowVal); -// for (int32_t i = 0; i < pFillInfo->numOfTags; ++i) { -// taosMemoryFreeClear(pFillInfo->pTags[i].tagVal); -// } + // for (int32_t i = 0; i < pFillInfo->numOfTags; ++i) { + // taosMemoryFreeClear(pFillInfo->pTags[i].tagVal); + // } taosMemoryFreeClear(pFillInfo->pTags); taosMemoryFreeClear(pFillInfo->pFillCol); @@ -640,7 +654,7 @@ SFillColInfo* createFillColInfo(SExprInfo* pExpr, int32_t numOfFillExpr, SExprIn } } - for(int32_t i = 0; i < numOfNotFillExpr; ++i) { + for (int32_t i = 0; i < numOfNotFillExpr; ++i) { SExprInfo* pExprInfo = &pNotFillExpr[i]; pFillCol[i + numOfFillExpr].pExpr = pExprInfo; pFillCol[i + numOfFillExpr].notFillCol = true; @@ -648,3 +662,1050 @@ SFillColInfo* createFillColInfo(SExprInfo* pExpr, int32_t numOfFillExpr, SExprIn return pFillCol; } + +TSKEY getNextWindowTs(TSKEY ts, SInterval* pInterval) { + STimeWindow win = {.skey = ts, .ekey = ts}; + getNextIntervalWindow(pInterval, &win, TSDB_ORDER_ASC); + return win.skey; +} + +TSKEY getPrevWindowTs(TSKEY ts, SInterval* pInterval) { + STimeWindow win = {.skey = ts, .ekey = ts}; + getNextIntervalWindow(pInterval, &win, TSDB_ORDER_DESC); + return win.skey; +} + +void setRowCell(SColumnInfoData* pCol, int32_t rowId, const SResultCellData* pCell) { + colDataAppend(pCol, rowId, pCell->pData, pCell->isNull); +} + +SResultCellData* getResultCell(SResultRowData* pRaw, int32_t index) { + if (!pRaw || !pRaw->pRowVal) { + return NULL; + } + char* pData = (char*)pRaw->pRowVal; + SResultCellData* pCell = pRaw->pRowVal; + for (int32_t i = 0; i < index; i++) { + pData += (pCell->bytes + sizeof(SResultCellData)); + pCell = (SResultCellData*)pData; + } + return pCell; +} + +void* destroyFillColumnInfo(SFillColInfo* pFillCol, int32_t start, int32_t end) { + for (int32_t i = start; i < end; i++) { + destroyExprInfo(pFillCol[i].pExpr, 1); + taosMemoryFreeClear(pFillCol[i].pExpr); + taosVariantDestroy(&pFillCol[i].fillVal); + } + taosMemoryFree(pFillCol); + return NULL; +} + +void* destroyStreamFillSupporter(SStreamFillSupporter* pFillSup) { + pFillSup->pAllColInfo = destroyFillColumnInfo(pFillSup->pAllColInfo, pFillSup->numOfFillCols, pFillSup->numOfAllCols); + tSimpleHashCleanup(pFillSup->pResMap); + pFillSup->pResMap = NULL; + taosMemoryFree(pFillSup); + return NULL; +} + +void* destroyStreamFillLinearInfo(SStreamFillLinearInfo* pFillLinear) { + taosArrayDestroy(pFillLinear->pDeltaVal); + taosArrayDestroy(pFillLinear->pNextDeltaVal); + taosMemoryFree(pFillLinear); + return NULL; +} +void* destroyStreamFillInfo(SStreamFillInfo* pFillInfo) { + if (pFillInfo->type == TSDB_FILL_SET_VALUE || pFillInfo->type == TSDB_FILL_NULL) { + taosMemoryFreeClear(pFillInfo->pResRow->pRowVal); + taosMemoryFreeClear(pFillInfo->pResRow); + } + pFillInfo->pLinearInfo = destroyStreamFillLinearInfo(pFillInfo->pLinearInfo); + taosMemoryFree(pFillInfo); + return NULL; +} + +void destroyStreamFillOperatorInfo(void* param) { + SStreamFillOperatorInfo* pInfo = (SStreamFillOperatorInfo*)param; + pInfo->pFillInfo = destroyStreamFillInfo(pInfo->pFillInfo); + pInfo->pFillSup = destroyStreamFillSupporter(pInfo->pFillSup); + pInfo->pRes = blockDataDestroy(pInfo->pRes); + pInfo->pSrcBlock = blockDataDestroy(pInfo->pSrcBlock); + pInfo->pColMatchColInfo = taosArrayDestroy(pInfo->pColMatchColInfo); + taosMemoryFree(pInfo); +} + +static void resetFillWindow(SResultRowData* pRowData) { + pRowData->key = INT64_MIN; + pRowData->pRowVal = NULL; +} + +void resetPrevAndNextWindow(SStreamFillSupporter* pFillSup, SStreamState* pState) { + resetFillWindow(&pFillSup->prev); + resetFillWindow(&pFillSup->cur); + resetFillWindow(&pFillSup->next); + resetFillWindow(&pFillSup->nextNext); +} + +void getCurWindowFromDiscBuf(SOperatorInfo* pOperator, TSKEY ts, uint64_t groupId, SStreamFillSupporter* pFillSup) { + SStreamState* pState = pOperator->pTaskInfo->streamInfo.pState; + resetPrevAndNextWindow(pFillSup, pState); + + SWinKey key = {.ts = ts, .groupId = groupId}; + void* curVal = NULL; + int32_t curVLen = 0; + int32_t code = streamStateFillGet(pState, &key, (void**)&curVal, &curVLen); + ASSERT(code == TSDB_CODE_SUCCESS); + pFillSup->cur.key = key.ts; + pFillSup->cur.pRowVal = curVal; +} + +void getWindowFromDiscBuf(SOperatorInfo* pOperator, TSKEY ts, uint64_t groupId, SStreamFillSupporter* pFillSup) { + SStreamState* pState = pOperator->pTaskInfo->streamInfo.pState; + resetPrevAndNextWindow(pFillSup, pState); + + SWinKey key = {.ts = ts, .groupId = groupId}; + void* curVal = NULL; + int32_t curVLen = 0; + int32_t code = streamStateFillGet(pState, &key, (void**)&curVal, &curVLen); + ASSERT(code == TSDB_CODE_SUCCESS); + pFillSup->cur.key = key.ts; + pFillSup->cur.pRowVal = curVal; + + SStreamStateCur* pCur = streamStateFillSeekKeyPrev(pState, &key); + SWinKey preKey = {.groupId = groupId}; + void* preVal = NULL; + int32_t preVLen = 0; + if (pCur) { + code = streamStateGetGroupKVByCur(pCur, &preKey, (const void**)&preVal, &preVLen); + } + + if (pCur && code == TSDB_CODE_SUCCESS) { + pFillSup->prev.key = preKey.ts; + pFillSup->prev.pRowVal = preVal; + + code = streamStateCurNext(pState, pCur); + ASSERT(code == TSDB_CODE_SUCCESS); + + code = streamStateCurNext(pState, pCur); + if (code != TSDB_CODE_SUCCESS) { + pCur = NULL; + } + } else { + pCur = streamStateFillSeekKeyNext(pState, &key); + } + + if (pCur) { + SWinKey nextKey = {.groupId = groupId}; + void* nextVal = NULL; + int32_t nextVLen = 0; + code = streamStateGetGroupKVByCur(pCur, &nextKey, (const void**)&nextVal, &nextVLen); + if (code == TSDB_CODE_SUCCESS) { + pFillSup->next.key = nextKey.ts; + pFillSup->next.pRowVal = nextVal; + if (pFillSup->type == TSDB_FILL_PREV || pFillSup->type == TSDB_FILL_NEXT) { + code = streamStateCurNext(pState, pCur); + if (code == TSDB_CODE_SUCCESS) { + SWinKey nextNextKey = {.groupId = groupId}; + void* nextNextVal = NULL; + int32_t nextNextVLen = 0; + code = streamStateGetGroupKVByCur(pCur, &nextNextKey, (const void**)&nextNextVal, &nextNextVLen); + if (code == TSDB_CODE_SUCCESS) { + pFillSup->nextNext.key = nextNextKey.ts; + pFillSup->nextNext.pRowVal = nextNextVal; + } + } + } + } + } +} + +static bool hasPrevWindow(SStreamFillSupporter* pFillSup) { return pFillSup->prev.key != INT64_MIN; } +static bool hasNextWindow(SStreamFillSupporter* pFillSup) { return pFillSup->next.key != INT64_MIN; } +static bool hasNextNextWindow(SStreamFillSupporter* pFillSup) { + return pFillSup->nextNext.key != INT64_MIN; + return false; +} + +static void transBlockToResultRow(const SSDataBlock* pBlock, int32_t rowId, TSKEY ts, SResultRowData* pRowVal) { + int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); + for (int32_t i = 0; i < numOfCols; ++i) { + SColumnInfoData* pColData = taosArrayGet(pBlock->pDataBlock, i); + SResultCellData* pCell = getResultCell(pRowVal, i); + if (!colDataIsNull_s(pColData, rowId)) { + pCell->isNull = false; + pCell->type = pColData->info.type; + pCell->bytes = pColData->info.bytes; + char* val = colDataGetData(pColData, rowId); + if (IS_VAR_DATA_TYPE(pCell->type)) { + memcpy(pCell->pData, val, varDataTLen(val)); + } else { + memcpy(pCell->pData, val, pCell->bytes); + } + } else { + pCell->isNull = true; + } + } + pRowVal->key = ts; +} + +static void calcDeltaData(SSDataBlock* pBlock, int32_t rowId, SResultRowData* pRowVal, SArray* pDelta, + SFillColInfo* pFillCol, int32_t numOfCol, int32_t winCount, int32_t order) { + for (int32_t i = 0; i < numOfCol; i++) { + if (!pFillCol[i].notFillCol) { + int32_t slotId = GET_DEST_SLOT_ID(pFillCol + i); + SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, slotId); + char* var = colDataGetData(pCol, rowId); + double start = 0; + GET_TYPED_DATA(start, double, pCol->info.type, var); + SResultCellData* pCell = getResultCell(pRowVal, slotId); + double end = 0; + GET_TYPED_DATA(end, double, pCell->type, pCell->pData); + double delta = 0; + if (order == TSDB_ORDER_ASC) { + delta = (end - start) / winCount; + } else { + delta = (start - end) / winCount; + } + taosArraySet(pDelta, slotId, &delta); + } + } +} + +static void calcRowDeltaData(SResultRowData* pStartRow, SResultRowData* pEndRow, SArray* pDelta, SFillColInfo* pFillCol, + int32_t numOfCol, int32_t winCount) { + for (int32_t i = 0; i < numOfCol; i++) { + if (!pFillCol[i].notFillCol) { + int32_t slotId = GET_DEST_SLOT_ID(pFillCol + i); + SResultCellData* pSCell = getResultCell(pStartRow, slotId); + double start = 0.0; + GET_TYPED_DATA(start, double, pSCell->type, pSCell->pData); + SResultCellData* pECell = getResultCell(pEndRow, slotId); + double end = 0.0; + GET_TYPED_DATA(end, double, pECell->type, pECell->pData); + double delta = (end - start) / winCount; + taosArraySet(pDelta, slotId, &delta); + } + } +} + +static void setFillInfoStart(TSKEY ts, SInterval* pInterval, SStreamFillInfo* pFillInfo) { + ts = taosTimeAdd(ts, pInterval->sliding, pInterval->slidingUnit, pInterval->precision); + pFillInfo->start = ts; +} + +static void setFillInfoEnd(TSKEY ts, SInterval* pInterval, SStreamFillInfo* pFillInfo) { + ts = taosTimeAdd(ts, pInterval->sliding * -1, pInterval->slidingUnit, pInterval->precision); + pFillInfo->end = ts; +} + +static void setFillKeyInfo(TSKEY start, TSKEY end, SInterval* pInterval, SStreamFillInfo* pFillInfo) { + setFillInfoStart(start, pInterval, pFillInfo); + pFillInfo->current = pFillInfo->start; + setFillInfoEnd(end, pInterval, pFillInfo); +} + +void setDeleteFillValueInfo(TSKEY start, TSKEY end, SStreamFillSupporter* pFillSup, SStreamFillInfo* pFillInfo) { + if (!hasPrevWindow(pFillSup) || !hasNextWindow(pFillSup)) { + pFillInfo->needFill = false; + return; + } + + pFillInfo->needFill = true; + pFillInfo->start = start; + pFillInfo->current = pFillInfo->start; + pFillInfo->end = end; + pFillInfo->pos = FILL_POS_INVALID; + switch (pFillInfo->type) { + case TSDB_FILL_NULL: + case TSDB_FILL_SET_VALUE: + break; + case TSDB_FILL_PREV: + pFillInfo->pResRow = &pFillSup->prev; + break; + case TSDB_FILL_NEXT: + pFillInfo->pResRow = &pFillSup->next; + break; + case TSDB_FILL_LINEAR: { + setFillKeyInfo(pFillSup->prev.key, pFillSup->next.key, &pFillSup->interval, pFillInfo); + pFillInfo->pLinearInfo->hasNext = false; + pFillInfo->pLinearInfo->nextEnd = INT64_MIN; + int32_t numOfWins = taosTimeCountInterval(pFillSup->prev.key, pFillSup->next.key, pFillSup->interval.sliding, + pFillSup->interval.slidingUnit, pFillSup->interval.precision); + calcRowDeltaData(&pFillSup->prev, &pFillSup->next, pFillInfo->pLinearInfo->pDeltaVal, pFillSup->pAllColInfo, + pFillSup->numOfAllCols, numOfWins); + pFillInfo->pResRow = &pFillSup->prev; + pFillInfo->pLinearInfo->winIndex = 0; + } break; + default: + ASSERT(0); + break; + } +} + +void setFillValueInfo(SSDataBlock* pBlock, TSKEY ts, int32_t rowId, SStreamFillSupporter* pFillSup, + SStreamFillInfo* pFillInfo) { + pFillInfo->preRowKey = pFillSup->cur.key; + if (!hasPrevWindow(pFillSup) && !hasNextWindow(pFillSup)) { + pFillInfo->needFill = false; + pFillInfo->pos = FILL_POS_START; + return; + } + TSKEY prevWKey = INT64_MIN; + TSKEY nextWKey = INT64_MIN; + if (hasPrevWindow(pFillSup)) { + prevWKey = pFillSup->prev.key; + } + if (hasNextWindow(pFillSup)) { + nextWKey = pFillSup->next.key; + } + + pFillInfo->needFill = true; + pFillInfo->pos = FILL_POS_INVALID; + switch (pFillInfo->type) { + case TSDB_FILL_NULL: + case TSDB_FILL_SET_VALUE: { + if (pFillSup->prev.key == pFillInfo->preRowKey) { + resetFillWindow(&pFillSup->prev); + } + if (hasPrevWindow(pFillSup) && hasNextWindow(pFillSup)) { + if (pFillSup->next.key == pFillInfo->nextRowKey) { + pFillInfo->preRowKey = INT64_MIN; + setFillKeyInfo(prevWKey, ts, &pFillSup->interval, pFillInfo); + pFillInfo->pos = FILL_POS_END; + } else { + pFillInfo->needFill = false; + pFillInfo->pos = FILL_POS_START; + } + } else if (hasPrevWindow(pFillSup)) { + setFillKeyInfo(prevWKey, ts, &pFillSup->interval, pFillInfo); + pFillInfo->pos = FILL_POS_END; + } else { + setFillKeyInfo(ts, nextWKey, &pFillSup->interval, pFillInfo); + pFillInfo->pos = FILL_POS_START; + } + } break; + case TSDB_FILL_PREV: { + if (hasNextWindow(pFillSup) && ((pFillSup->next.key != pFillInfo->nextRowKey) || + (pFillSup->next.key == pFillInfo->nextRowKey && hasNextNextWindow(pFillSup)) || + (pFillSup->next.key == pFillInfo->nextRowKey && !hasPrevWindow(pFillSup)))) { + setFillKeyInfo(ts, nextWKey, &pFillSup->interval, pFillInfo); + pFillInfo->pos = FILL_POS_START; + pFillSup->prev.key = pFillSup->cur.key; + pFillSup->prev.pRowVal = pFillSup->cur.pRowVal; + } else if (hasPrevWindow(pFillSup)) { + setFillKeyInfo(prevWKey, ts, &pFillSup->interval, pFillInfo); + pFillInfo->pos = FILL_POS_END; + pFillInfo->preRowKey = INT64_MIN; + } + pFillInfo->pResRow = &pFillSup->prev; + } break; + case TSDB_FILL_NEXT: { + if (hasPrevWindow(pFillSup)) { + setFillKeyInfo(prevWKey, ts, &pFillSup->interval, pFillInfo); + pFillInfo->pos = FILL_POS_END; + pFillSup->next.key = pFillSup->cur.key; + pFillSup->next.pRowVal = pFillSup->cur.pRowVal; + pFillInfo->preRowKey = INT64_MIN; + } else { + ASSERT(hasNextWindow(pFillSup)); + setFillKeyInfo(ts, nextWKey, &pFillSup->interval, pFillInfo); + pFillInfo->pos = FILL_POS_START; + } + pFillInfo->pResRow = &pFillSup->next; + } break; + case TSDB_FILL_LINEAR: { + pFillInfo->pLinearInfo->winIndex = 0; + if (hasPrevWindow(pFillSup) && hasNextWindow(pFillSup)) { + setFillKeyInfo(prevWKey, ts, &pFillSup->interval, pFillInfo); + pFillInfo->pos = FILL_POS_MID; + pFillInfo->pLinearInfo->nextEnd = nextWKey; + int32_t numOfWins = taosTimeCountInterval(prevWKey, ts, pFillSup->interval.sliding, + pFillSup->interval.slidingUnit, pFillSup->interval.precision); + calcRowDeltaData(&pFillSup->prev, &pFillSup->cur, pFillInfo->pLinearInfo->pDeltaVal, pFillSup->pAllColInfo, + pFillSup->numOfAllCols, numOfWins); + pFillInfo->pResRow = &pFillSup->prev; + + numOfWins = taosTimeCountInterval(ts, nextWKey, pFillSup->interval.sliding, pFillSup->interval.slidingUnit, + pFillSup->interval.precision); + calcRowDeltaData(&pFillSup->cur, &pFillSup->next, pFillInfo->pLinearInfo->pNextDeltaVal, pFillSup->pAllColInfo, + pFillSup->numOfAllCols, numOfWins); + pFillInfo->pLinearInfo->hasNext = true; + } else if (hasPrevWindow(pFillSup)) { + setFillKeyInfo(prevWKey, ts, &pFillSup->interval, pFillInfo); + pFillInfo->pos = FILL_POS_END; + pFillInfo->pLinearInfo->nextEnd = INT64_MIN; + int32_t numOfWins = taosTimeCountInterval(prevWKey, ts, pFillSup->interval.sliding, + pFillSup->interval.slidingUnit, pFillSup->interval.precision); + calcRowDeltaData(&pFillSup->prev, &pFillSup->cur, pFillInfo->pLinearInfo->pDeltaVal, pFillSup->pAllColInfo, + pFillSup->numOfAllCols, numOfWins); + pFillInfo->pResRow = &pFillSup->prev; + pFillInfo->pLinearInfo->hasNext = false; + } else { + ASSERT(hasNextWindow(pFillSup)); + setFillKeyInfo(ts, nextWKey, &pFillSup->interval, pFillInfo); + pFillInfo->pos = FILL_POS_START; + pFillInfo->pLinearInfo->nextEnd = INT64_MIN; + int32_t numOfWins = taosTimeCountInterval(ts, nextWKey, pFillSup->interval.sliding, + pFillSup->interval.slidingUnit, pFillSup->interval.precision); + calcRowDeltaData(&pFillSup->cur, &pFillSup->next, pFillInfo->pLinearInfo->pDeltaVal, pFillSup->pAllColInfo, + pFillSup->numOfAllCols, numOfWins); + pFillInfo->pResRow = &pFillSup->cur; + pFillInfo->pLinearInfo->hasNext = false; + } + } break; + default: + ASSERT(0); + break; + } + ASSERT(pFillInfo->pos != FILL_POS_INVALID); +} + +static bool checkResult(SStreamFillSupporter* pFillSup, TSKEY ts, uint64_t groupId) { + SWinKey key = {.groupId = groupId, .ts = ts}; + if (tSimpleHashGet(pFillSup->pResMap, &key, sizeof(SWinKey)) != NULL) { + return false; + } + tSimpleHashPut(pFillSup->pResMap, &key, sizeof(SWinKey), NULL, 0); + return true; +} + +static void buildFillResult(SResultRowData* pResRow, SStreamFillSupporter* pFillSup, TSKEY ts, SSDataBlock* pBlock) { + uint64_t groupId = pBlock->info.groupId; + if (pFillSup->hasDelete && !checkResult(pFillSup, ts, groupId)) { + return; + } + for (int32_t i = 0; i < pFillSup->numOfAllCols; ++i) { + SFillColInfo* pFillCol = pFillSup->pAllColInfo + i; + int32_t slotId = GET_DEST_SLOT_ID(pFillCol); + SColumnInfoData* pColData = taosArrayGet(pBlock->pDataBlock, slotId); + SFillInfo tmpInfo = { + .currentKey = ts, + .order = TSDB_ORDER_ASC, + .interval = pFillSup->interval, + }; + bool filled = fillIfWindowPseudoColumn(&tmpInfo, pFillCol, pColData, pBlock->info.rows); + if (!filled) { + SResultCellData* pCell = getResultCell(pResRow, slotId); + setRowCell(pColData, pBlock->info.rows, pCell); + } + } + pBlock->info.rows++; +} + +static bool hasRemainCalc(SStreamFillInfo* pFillInfo) { + if (pFillInfo->current != INT64_MIN && pFillInfo->current <= pFillInfo->end) { + return true; + } + return false; +} + +static void doStreamFillNormal(SStreamFillSupporter* pFillSup, SStreamFillInfo* pFillInfo, SSDataBlock* pBlock) { + while (hasRemainCalc(pFillInfo) && pBlock->info.rows < pBlock->info.capacity) { + buildFillResult(pFillInfo->pResRow, pFillSup, pFillInfo->current, pBlock); + pFillInfo->current = taosTimeAdd(pFillInfo->current, pFillSup->interval.sliding, pFillSup->interval.slidingUnit, + pFillSup->interval.precision); + } +} + +static void doStreamFillLinear(SStreamFillSupporter* pFillSup, SStreamFillInfo* pFillInfo, SSDataBlock* pBlock) { + while (hasRemainCalc(pFillInfo) && pBlock->info.rows < pBlock->info.capacity) { + uint64_t groupId = pBlock->info.groupId; + SWinKey key = {.groupId = groupId, .ts = pFillInfo->current}; + if (pFillSup->hasDelete && !checkResult(pFillSup, pFillInfo->current, groupId)) { + pFillInfo->current = taosTimeAdd(pFillInfo->current, pFillSup->interval.sliding, pFillSup->interval.slidingUnit, + pFillSup->interval.precision); + pFillInfo->pLinearInfo->winIndex++; + continue; + } + pFillInfo->pLinearInfo->winIndex++; + for (int32_t i = 0; i < pFillSup->numOfAllCols; ++i) { + SFillColInfo* pFillCol = pFillSup->pAllColInfo + i; + SFillInfo tmp = { + .currentKey = pFillInfo->current, + .order = TSDB_ORDER_ASC, + .interval = pFillSup->interval, + }; + + int32_t slotId = GET_DEST_SLOT_ID(pFillCol); + SColumnInfoData* pColData = taosArrayGet(pBlock->pDataBlock, slotId); + int16_t type = pColData->info.type; + SResultCellData* pCell = getResultCell(pFillInfo->pResRow, slotId); + int32_t index = pBlock->info.rows; + if (pFillCol->notFillCol) { + bool filled = fillIfWindowPseudoColumn(&tmp, pFillCol, pColData, index); + if (!filled) { + setRowCell(pColData, index, pCell); + } + } else { + if (IS_VAR_DATA_TYPE(type) || type == TSDB_DATA_TYPE_BOOL || pCell->isNull) { + colDataAppendNULL(pColData, index); + continue; + } + double* pDelta = taosArrayGet(pFillInfo->pLinearInfo->pDeltaVal, slotId); + double vCell = 0; + GET_TYPED_DATA(vCell, double, pCell->type, pCell->pData); + vCell += (*pDelta) * pFillInfo->pLinearInfo->winIndex; + int64_t result = 0; + SET_TYPED_DATA(&result, pCell->type, vCell); + colDataAppend(pColData, index, (const char*)&result, false); + } + } + pFillInfo->current = taosTimeAdd(pFillInfo->current, pFillSup->interval.sliding, pFillSup->interval.slidingUnit, + pFillSup->interval.precision); + pBlock->info.rows++; + } +} + +static void keepResultInDiscBuf(SOperatorInfo* pOperator, uint64_t groupId, SResultRowData* pRow, int32_t len) { + SWinKey key = {.groupId = groupId, .ts = pRow->key}; + int32_t code = streamStateFillPut(pOperator->pTaskInfo->streamInfo.pState, &key, pRow->pRowVal, len); + ASSERT(code == TSDB_CODE_SUCCESS); +} + +static void doStreamFillRange(SStreamFillInfo* pFillInfo, SStreamFillSupporter* pFillSup, SSDataBlock* pRes) { + if (pFillInfo->needFill == false) { + buildFillResult(&pFillSup->cur, pFillSup, pFillSup->cur.key, pRes); + return; + } + + if (pFillInfo->pos == FILL_POS_START) { + buildFillResult(&pFillSup->cur, pFillSup, pFillSup->cur.key, pRes); + } + if (pFillInfo->type != TSDB_FILL_LINEAR) { + doStreamFillNormal(pFillSup, pFillInfo, pRes); + } else { + doStreamFillLinear(pFillSup, pFillInfo, pRes); + + if (pFillInfo->pos == FILL_POS_MID) { + buildFillResult(&pFillSup->cur, pFillSup, pFillSup->cur.key, pRes); + } + + if (pFillInfo->current > pFillInfo->end && pFillInfo->pLinearInfo->hasNext) { + pFillInfo->pLinearInfo->hasNext = false; + pFillInfo->pLinearInfo->winIndex = 0; + taosArrayClear(pFillInfo->pLinearInfo->pDeltaVal); + taosArrayAddAll(pFillInfo->pLinearInfo->pDeltaVal, pFillInfo->pLinearInfo->pNextDeltaVal); + pFillInfo->pResRow = &pFillSup->cur; + setFillKeyInfo(pFillSup->cur.key, pFillInfo->pLinearInfo->nextEnd, &pFillSup->interval, pFillInfo); + doStreamFillLinear(pFillSup, pFillInfo, pRes); + } + } + if (pFillInfo->pos == FILL_POS_END) { + buildFillResult(&pFillSup->cur, pFillSup, pFillSup->cur.key, pRes); + } +} + +void keepBlockRowInDiscBuf(SOperatorInfo* pOperator, SStreamFillInfo* pFillInfo, SSDataBlock* pBlock, TSKEY* tsCol, + int32_t rowId, uint64_t groupId, int32_t rowSize) { + TSKEY ts = tsCol[rowId]; + pFillInfo->nextRowKey = ts; + SResultRowData tmpNextRow = {.key = ts}; + tmpNextRow.pRowVal = taosMemoryCalloc(1, rowSize); + transBlockToResultRow(pBlock, rowId, ts, &tmpNextRow); + keepResultInDiscBuf(pOperator, groupId, &tmpNextRow, rowSize); + taosMemoryFreeClear(tmpNextRow.pRowVal); +} + +static void doFillResults(SOperatorInfo* pOperator, SStreamFillSupporter* pFillSup, SStreamFillInfo* pFillInfo, + SSDataBlock* pBlock, TSKEY* tsCol, int32_t rowId, SSDataBlock* pRes) { + uint64_t groupId = pBlock->info.groupId; + getWindowFromDiscBuf(pOperator, tsCol[rowId], groupId, pFillSup); + if (pFillSup->prev.key == pFillInfo->preRowKey) { + resetFillWindow(&pFillSup->prev); + } + setFillValueInfo(pBlock, tsCol[rowId], rowId, pFillSup, pFillInfo); + doStreamFillRange(pFillInfo, pFillSup, pRes); +} + +static void doStreamFillImpl(SOperatorInfo* pOperator) { + SStreamFillOperatorInfo* pInfo = pOperator->info; + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SStreamFillSupporter* pFillSup = pInfo->pFillSup; + SStreamFillInfo* pFillInfo = pInfo->pFillInfo; + SSDataBlock* pBlock = pInfo->pSrcBlock; + uint64_t groupId = pBlock->info.groupId; + SSDataBlock* pRes = pInfo->pRes; + pRes->info.groupId = groupId; + if (hasRemainCalc(pFillInfo)) { + doStreamFillRange(pFillInfo, pFillSup, pRes); + } + + SColumnInfoData* pTsCol = taosArrayGet(pInfo->pSrcBlock->pDataBlock, pInfo->primaryTsCol); + TSKEY* tsCol = (TSKEY*)pTsCol->pData; + + if (pInfo->srcRowIndex == 0) { + keepBlockRowInDiscBuf(pOperator, pFillInfo, pBlock, tsCol, pInfo->srcRowIndex, groupId, pFillSup->rowSize); + SSDataBlock* preBlock = pInfo->pPrevSrcBlock; + if (preBlock->info.rows > 0) { + int preRowId = preBlock->info.rows - 1; + SColumnInfoData* pPreTsCol = taosArrayGet(preBlock->pDataBlock, pInfo->primaryTsCol); + doFillResults(pOperator, pFillSup, pFillInfo, preBlock, (TSKEY*)pPreTsCol->pData, preRowId, pRes); + } + pInfo->srcRowIndex++; + } + + while (pInfo->srcRowIndex < pBlock->info.rows) { + TSKEY ts = tsCol[pInfo->srcRowIndex]; + keepBlockRowInDiscBuf(pOperator, pFillInfo, pBlock, tsCol, pInfo->srcRowIndex, groupId, pFillSup->rowSize); + doFillResults(pOperator, pFillSup, pFillInfo, pBlock, tsCol, pInfo->srcRowIndex - 1, pRes); + if (pInfo->pRes->info.rows == pInfo->pRes->info.capacity) { + blockDataUpdateTsWindow(pRes, pInfo->primaryTsCol); + return; + } + pInfo->srcRowIndex++; + } + blockDataUpdateTsWindow(pRes, pInfo->primaryTsCol); + blockDataCleanup(pInfo->pPrevSrcBlock); + copyDataBlock(pInfo->pPrevSrcBlock, pInfo->pSrcBlock); + blockDataCleanup(pInfo->pSrcBlock); +} + +static void buildDeleteRange(TSKEY start, TSKEY end, uint64_t groupId, SSDataBlock* delRes) { + SSDataBlock* pBlock = delRes; + SColumnInfoData* pStartCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); + SColumnInfoData* pEndCol = taosArrayGet(pBlock->pDataBlock, END_TS_COLUMN_INDEX); + SColumnInfoData* pUidCol = taosArrayGet(pBlock->pDataBlock, UID_COLUMN_INDEX); + SColumnInfoData* pGroupCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); + SColumnInfoData* pCalStartCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX); + SColumnInfoData* pCalEndCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX); + colDataAppend(pStartCol, pBlock->info.rows, (const char*)&start, false); + colDataAppend(pEndCol, pBlock->info.rows, (const char*)&end, false); + colDataAppendNULL(pUidCol, pBlock->info.rows); + colDataAppend(pGroupCol, pBlock->info.rows, (const char*)&groupId, false); + colDataAppendNULL(pCalStartCol, pBlock->info.rows); + colDataAppendNULL(pCalEndCol, pBlock->info.rows); + pBlock->info.rows++; +} + +static void buildDeleteResult(SStreamFillSupporter* pFillSup, TSKEY startTs, TSKEY endTs, uint64_t groupId, + SSDataBlock* delRes) { + if (hasPrevWindow(pFillSup)) { + TSKEY start = getNextWindowTs(pFillSup->prev.key, &pFillSup->interval); + buildDeleteRange(start, endTs, groupId, delRes); + } else if (hasNextWindow(pFillSup)) { + TSKEY end = getPrevWindowTs(pFillSup->next.key, &pFillSup->interval); + buildDeleteRange(startTs, end, groupId, delRes); + } else { + buildDeleteRange(startTs, endTs, groupId, delRes); + } +} + +static void doDeleteFillResultImpl(SOperatorInfo* pOperator, TSKEY startTs, TSKEY endTs, uint64_t groupId) { + SStreamFillOperatorInfo* pInfo = pOperator->info; + getWindowFromDiscBuf(pOperator, startTs, groupId, pInfo->pFillSup); + setDeleteFillValueInfo(startTs, endTs, pInfo->pFillSup, pInfo->pFillInfo); + SWinKey key = {.ts = startTs, .groupId = groupId}; + if (!pInfo->pFillInfo->needFill) { + streamStateFillDel(pOperator->pTaskInfo->streamInfo.pState, &key); + buildDeleteResult(pInfo->pFillSup, startTs, endTs, groupId, pInfo->pDelRes); + } else { + STimeRange tw = { + .skey = startTs, + .ekey = endTs, + .groupId = groupId, + }; + taosArrayPush(pInfo->pFillInfo->delRanges, &tw); + while (key.ts <= endTs) { + key.ts = taosTimeAdd(key.ts, pInfo->pFillSup->interval.sliding, pInfo->pFillSup->interval.slidingUnit, + pInfo->pFillSup->interval.precision); + tSimpleHashPut(pInfo->pFillSup->pResMap, &key, sizeof(SWinKey), NULL, 0); + } + } +} + +static void doDeleteFillFinalize(SOperatorInfo* pOperator) { + SStreamFillOperatorInfo* pInfo = pOperator->info; + SStreamFillInfo* pFillInfo = pInfo->pFillInfo; + int32_t size = taosArrayGetSize(pFillInfo->delRanges); + tSimpleHashClear(pInfo->pFillSup->pResMap); + for (; pFillInfo->delIndex < size; pFillInfo->delIndex++) { + STimeRange* range = taosArrayGet(pFillInfo->delRanges, pFillInfo->delIndex); + if (pInfo->pRes->info.groupId != 0 && pInfo->pRes->info.groupId != range->groupId) { + return; + } + getWindowFromDiscBuf(pOperator, range->skey, range->groupId, pInfo->pFillSup); + setDeleteFillValueInfo(range->skey, range->ekey, pInfo->pFillSup, pInfo->pFillInfo); + if (pInfo->pFillInfo->needFill) { + doStreamFillRange(pInfo->pFillInfo, pInfo->pFillSup, pInfo->pRes); + pInfo->pRes->info.groupId = range->groupId; + } + SWinKey key = {.ts = range->skey, .groupId = range->groupId}; + streamStateFillDel(pOperator->pTaskInfo->streamInfo.pState, &key); + } +} + +static void doDeleteFillResult(SOperatorInfo* pOperator) { + SStreamFillOperatorInfo* pInfo = pOperator->info; + SStreamFillSupporter* pFillSup = pInfo->pFillSup; + SStreamFillInfo* pFillInfo = pInfo->pFillInfo; + SSDataBlock* pBlock = pInfo->pSrcDelBlock; + SSDataBlock* pRes = pInfo->pRes; + SSDataBlock* pDelRes = pInfo->pDelRes; + + SColumnInfoData* pStartCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); + TSKEY* tsStarts = (TSKEY*)pStartCol->pData; + SColumnInfoData* pGroupCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); + uint64_t* groupIds = (uint64_t*)pGroupCol->pData; + while (pInfo->srcDelRowIndex < pBlock->info.rows) { + TSKEY ts = tsStarts[pInfo->srcDelRowIndex]; + TSKEY endTs = ts; + uint64_t groupId = groupIds[pInfo->srcDelRowIndex]; + SWinKey key = {.ts = ts, .groupId = groupId}; + SStreamStateCur* pCur = streamStateGetAndCheckCur(pOperator->pTaskInfo->streamInfo.pState, &key); + if (!pCur) { + pInfo->srcDelRowIndex++; + continue; + } + + SWinKey nextKey = {.groupId = groupId, .ts = ts}; + while (pInfo->srcDelRowIndex < pBlock->info.rows) { + void* nextVal = NULL; + int32_t nextLen = 0; + TSKEY delTs = tsStarts[pInfo->srcDelRowIndex]; + uint64_t delGroupId = groupIds[pInfo->srcDelRowIndex]; + int32_t code = TSDB_CODE_SUCCESS; + if (groupId != delGroupId) { + break; + } + if (delTs > nextKey.ts) { + break; + } + endTs = delTs; + SWinKey delKey = {.groupId = delGroupId, .ts = delTs}; + if (delTs == nextKey.ts) { + code = streamStateCurNext(pOperator->pTaskInfo->streamInfo.pState, pCur); + if (code == TSDB_CODE_SUCCESS) { + code = streamStateGetGroupKVByCur(pCur, &nextKey, (const void**)&nextVal, &nextLen); + } + if (delTs != ts) { + streamStateFillDel(pOperator->pTaskInfo->streamInfo.pState, &delKey); + } + if (code != TSDB_CODE_SUCCESS) { + break; + } + } + pInfo->srcDelRowIndex++; + } + doDeleteFillResultImpl(pOperator, ts, endTs, groupId); + } + pFillInfo->current = pFillInfo->end + 1; +} + +static void resetStreamFillInfo(SStreamFillOperatorInfo* pInfo) { + blockDataCleanup(pInfo->pPrevSrcBlock); + tSimpleHashClear(pInfo->pFillSup->pResMap); + pInfo->pFillSup->hasDelete = false; + taosArrayClear(pInfo->pFillInfo->delRanges); + pInfo->pFillInfo->delIndex = 0; +} + +static void doApplyStreamScalarCalculation(SOperatorInfo* pOperator, SSDataBlock* pSrcBlock, SSDataBlock* pDstBlock) { + SStreamFillOperatorInfo* pInfo = pOperator->info; + SExprSupp* pSup = &pOperator->exprSupp; + + blockDataCleanup(pDstBlock); + blockDataEnsureCapacity(pDstBlock, pSrcBlock->info.rows); + setInputDataBlock(pOperator, pSup->pCtx, pSrcBlock, TSDB_ORDER_ASC, MAIN_SCAN, false); + projectApplyFunctions(pSup->pExprInfo, pDstBlock, pSrcBlock, pSup->pCtx, pSup->numOfExprs, NULL); + pDstBlock->info.groupId = pSrcBlock->info.groupId; + + SColumnInfoData* pDst = taosArrayGet(pDstBlock->pDataBlock, pInfo->primaryTsCol); + SColumnInfoData* pSrc = taosArrayGet(pSrcBlock->pDataBlock, pInfo->primarySrcSlotId); + colDataAssign(pDst, pSrc, pDstBlock->info.rows, &pDstBlock->info); + + int32_t numOfNotFill = pInfo->pFillSup->numOfAllCols - pInfo->pFillSup->numOfFillCols; + for (int32_t i = 0; i < numOfNotFill; ++i) { + SFillColInfo* pCol = &pInfo->pFillSup->pAllColInfo[i + pInfo->pFillSup->numOfFillCols]; + ASSERT(pCol->notFillCol); + + SExprInfo* pExpr = pCol->pExpr; + int32_t srcSlotId = pExpr->base.pParam[0].pCol->slotId; + int32_t dstSlotId = pExpr->base.resSchema.slotId; + + SColumnInfoData* pDst1 = taosArrayGet(pDstBlock->pDataBlock, dstSlotId); + SColumnInfoData* pSrc1 = taosArrayGet(pSrcBlock->pDataBlock, srcSlotId); + colDataAssign(pDst1, pSrc1, pDstBlock->info.rows, &pDstBlock->info); + } + blockDataUpdateTsWindow(pDstBlock, pInfo->primaryTsCol); +} + +static SSDataBlock* doStreamFill(SOperatorInfo* pOperator) { + SStreamFillOperatorInfo* pInfo = pOperator->info; + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + + if (pOperator->status == OP_EXEC_DONE) { + return NULL; + } + blockDataCleanup(pInfo->pRes); + if (pOperator->status == OP_RES_TO_RETURN) { + if (hasRemainCalc(pInfo->pFillInfo)) { + doStreamFillRange(pInfo->pFillInfo, pInfo->pFillSup, pInfo->pRes); + if (pInfo->pRes->info.rows > 0) { + return pInfo->pRes; + } + } + doDeleteFillFinalize(pOperator); + if (pInfo->pRes->info.rows > 0) { + printDataBlock(pInfo->pRes, "stream fill"); + return pInfo->pRes; + } + doSetOperatorCompleted(pOperator); + resetStreamFillInfo(pInfo); + return NULL; + } + + SSDataBlock* fillResult = NULL; + SOperatorInfo* downstream = pOperator->pDownstream[0]; + while (1) { + if (pInfo->srcRowIndex >= pInfo->pSrcBlock->info.rows) { + // If there are delete datablocks, we receive them first. + SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream); + if (pBlock == NULL) { + pOperator->status = OP_RES_TO_RETURN; + SSDataBlock* preBlock = pInfo->pPrevSrcBlock; + if (preBlock->info.rows > 0) { + int preRowId = preBlock->info.rows - 1; + SColumnInfoData* pPreTsCol = taosArrayGet(preBlock->pDataBlock, pInfo->primaryTsCol); + doFillResults(pOperator, pInfo->pFillSup, pInfo->pFillInfo, preBlock, (TSKEY*)pPreTsCol->pData, preRowId, + pInfo->pRes); + } + pInfo->pFillInfo->preRowKey = INT64_MIN; + if (pInfo->pRes->info.rows > 0) { + printDataBlock(pInfo->pRes, "stream fill"); + return pInfo->pRes; + } + break; + } + printDataBlock(pBlock, "stream fill recv"); + + switch (pBlock->info.type) { + case STREAM_RETRIEVE: + return pBlock; + case STREAM_DELETE_RESULT: { + pInfo->pSrcDelBlock = pBlock; + pInfo->srcDelRowIndex = 0; + blockDataCleanup(pInfo->pDelRes); + pInfo->pFillSup->hasDelete = true; + doDeleteFillResult(pOperator); + if (pInfo->pDelRes->info.rows > 0) { + printDataBlock(pInfo->pDelRes, "stream fill delete"); + return pInfo->pDelRes; + } + continue; + } break; + case STREAM_NORMAL: + case STREAM_INVALID: { + doApplyStreamScalarCalculation(pOperator, pBlock, pInfo->pSrcBlock); + pInfo->srcRowIndex = 0; + } break; + default: + ASSERT(0); + break; + } + } + + doStreamFillImpl(pOperator); + doFilter(pInfo->pCondition, pInfo->pRes, pInfo->pColMatchColInfo); + pOperator->resultInfo.totalRows += pInfo->pRes->info.rows; + if (pInfo->pRes->info.rows > 0) { + break; + } + } + if (pOperator->status == OP_RES_TO_RETURN) { + doDeleteFillFinalize(pOperator); + } + + if (pInfo->pRes->info.rows == 0) { + doSetOperatorCompleted(pOperator); + resetStreamFillInfo(pInfo); + return NULL; + } + + pOperator->resultInfo.totalRows += pInfo->pRes->info.rows; + printDataBlock(pInfo->pRes, "stream fill"); + return pInfo->pRes; +} + +static int32_t initResultBuf(SStreamFillSupporter* pFillSup) { + pFillSup->rowSize = sizeof(SResultCellData) * pFillSup->numOfAllCols; + for (int i = 0; i < pFillSup->numOfAllCols; i++) { + SFillColInfo* pCol = &pFillSup->pAllColInfo[i]; + SResSchema* pSchema = &pCol->pExpr->base.resSchema; + pFillSup->rowSize += pSchema->bytes; + } + pFillSup->next.key = INT64_MIN; + pFillSup->nextNext.key = INT64_MIN; + pFillSup->prev.key = INT64_MIN; + pFillSup->next.pRowVal = NULL; + pFillSup->nextNext.pRowVal = NULL; + pFillSup->prev.pRowVal = NULL; + return TSDB_CODE_SUCCESS; +} + +static SStreamFillSupporter* initStreamFillSup(SStreamFillPhysiNode* pPhyFillNode, SInterval* pInterval, + SExprInfo* pFillExprInfo, int32_t numOfFillCols) { + SStreamFillSupporter* pFillSup = taosMemoryCalloc(1, sizeof(SStreamFillSupporter)); + if (!pFillSup) { + return NULL; + } + pFillSup->numOfFillCols = numOfFillCols; + int32_t numOfNotFillCols = 0; + SExprInfo* pNotFillExprInfo = createExprInfo(pPhyFillNode->pNotFillExprs, NULL, &numOfNotFillCols); + pFillSup->pAllColInfo = createFillColInfo(pFillExprInfo, pFillSup->numOfFillCols, pNotFillExprInfo, numOfNotFillCols, + (const SNodeListNode*)(pPhyFillNode->pValues)); + pFillSup->type = convertFillType(pPhyFillNode->mode); + pFillSup->numOfAllCols = pFillSup->numOfFillCols + numOfNotFillCols; + pFillSup->interval = *pInterval; + + int32_t code = initResultBuf(pFillSup); + if (code != TSDB_CODE_SUCCESS) { + destroyStreamFillSupporter(pFillSup); + return NULL; + } + _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); + pFillSup->pResMap = tSimpleHashInit(16, hashFn); + pFillSup->hasDelete = false; + return pFillSup; +} + +SStreamFillInfo* initStreamFillInfo(SStreamFillSupporter* pFillSup, SSDataBlock* pRes) { + SStreamFillInfo* pFillInfo = taosMemoryCalloc(1, sizeof(SStreamFillInfo)); + pFillInfo->start = INT64_MIN; + pFillInfo->current = INT64_MIN; + pFillInfo->end = INT64_MIN; + pFillInfo->preRowKey = INT64_MIN; + pFillInfo->needFill = false; + pFillInfo->pLinearInfo = taosMemoryCalloc(1, sizeof(SStreamFillLinearInfo)); + pFillInfo->pLinearInfo->hasNext = false; + pFillInfo->pLinearInfo->nextEnd = INT64_MIN; + pFillInfo->pLinearInfo->pDeltaVal = NULL; + pFillInfo->pLinearInfo->pNextDeltaVal = NULL; + if (pFillSup->type == TSDB_FILL_LINEAR) { + pFillInfo->pLinearInfo->pDeltaVal = taosArrayInit(pFillSup->numOfAllCols, sizeof(double)); + pFillInfo->pLinearInfo->pNextDeltaVal = taosArrayInit(pFillSup->numOfAllCols, sizeof(double)); + for (int32_t i = 0; i < pFillSup->numOfAllCols; i++) { + double value = 0.0; + taosArrayPush(pFillInfo->pLinearInfo->pDeltaVal, &value); + taosArrayPush(pFillInfo->pLinearInfo->pNextDeltaVal, &value); + } + } + pFillInfo->pLinearInfo->winIndex = 0; + + pFillInfo->pResRow = NULL; + if (pFillSup->type == TSDB_FILL_SET_VALUE || pFillSup->type == TSDB_FILL_NULL) { + pFillInfo->pResRow = taosMemoryCalloc(1, sizeof(SResultRowData)); + pFillInfo->pResRow->key = INT64_MIN; + pFillInfo->pResRow->pRowVal = taosMemoryCalloc(1, pFillSup->rowSize); + for (int32_t i = 0; i < pFillSup->numOfAllCols; ++i) { + SColumnInfoData* pColData = taosArrayGet(pRes->pDataBlock, i); + SResultCellData* pCell = getResultCell(pFillInfo->pResRow, i); + pCell->bytes = pColData->info.bytes; + pCell->type = pColData->info.type; + } + } + + pFillInfo->type = pFillSup->type; + pFillInfo->delRanges = taosArrayInit(16, sizeof(STimeRange)); + pFillInfo->delIndex = 0; + return pFillInfo; +} + +SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFillPhysiNode* pPhyFillNode, + SExecTaskInfo* pTaskInfo) { + SStreamFillOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SStreamFillOperatorInfo)); + SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); + if (pInfo == NULL || pOperator == NULL) { + goto _error; + } + + SInterval* pInterval = QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL == downstream->operatorType + ? &((SStreamFinalIntervalOperatorInfo*)downstream->info)->interval + : &((SStreamIntervalOperatorInfo*)downstream->info)->interval; + int32_t numOfFillCols = 0; + SExprInfo* pFillExprInfo = createExprInfo(pPhyFillNode->pFillExprs, NULL, &numOfFillCols); + pInfo->pFillSup = initStreamFillSup(pPhyFillNode, pInterval, pFillExprInfo, numOfFillCols); + if (!pInfo->pFillSup) { + goto _error; + } + + SResultInfo* pResultInfo = &pOperator->resultInfo; + initResultSizeInfo(&pOperator->resultInfo, 4096); + pInfo->pRes = createResDataBlock(pPhyFillNode->node.pOutputDataBlockDesc); + pInfo->pSrcBlock = createResDataBlock(pPhyFillNode->node.pOutputDataBlockDesc); + pInfo->pPrevSrcBlock = createResDataBlock(pPhyFillNode->node.pOutputDataBlockDesc); + blockDataEnsureCapacity(pInfo->pRes, pOperator->resultInfo.capacity); + blockDataEnsureCapacity(pInfo->pSrcBlock, pOperator->resultInfo.capacity); + blockDataEnsureCapacity(pInfo->pPrevSrcBlock, pOperator->resultInfo.capacity); + + pInfo->pFillInfo = initStreamFillInfo(pInfo->pFillSup, pInfo->pRes); + if (!pInfo->pFillInfo) { + goto _error; + } + + if (pInfo->pFillInfo->type == TSDB_FILL_SET_VALUE) { + for (int32_t i = 0; i < pInfo->pFillSup->numOfAllCols; ++i) { + SFillColInfo* pFillCol = pInfo->pFillSup->pAllColInfo + i; + int32_t slotId = GET_DEST_SLOT_ID(pFillCol); + SResultCellData* pCell = getResultCell(pInfo->pFillInfo->pResRow, slotId); + SVariant* pVar = &(pFillCol->fillVal); + if (pCell->type == TSDB_DATA_TYPE_FLOAT) { + float v = 0; + GET_TYPED_DATA(v, float, pVar->nType, &pVar->i); + SET_TYPED_DATA(pCell->pData, pCell->type, v); + } else if (pCell->type == TSDB_DATA_TYPE_DOUBLE) { + double v = 0; + GET_TYPED_DATA(v, double, pVar->nType, &pVar->i); + SET_TYPED_DATA(pCell->pData, pCell->type, v); + } else if (IS_SIGNED_NUMERIC_TYPE(pCell->type)) { + int64_t v = 0; + GET_TYPED_DATA(v, int64_t, pVar->nType, &pVar->i); + SET_TYPED_DATA(pCell->pData, pCell->type, v); + } else { + pCell->isNull = true; + } + } + } else if (pInfo->pFillInfo->type == TSDB_FILL_NULL) { + for (int32_t i = 0; i < pInfo->pFillSup->numOfAllCols; ++i) { + SFillColInfo* pFillCol = pInfo->pFillSup->pAllColInfo + i; + int32_t slotId = GET_DEST_SLOT_ID(pFillCol); + SResultCellData* pCell = getResultCell(pInfo->pFillInfo->pResRow, slotId); + pCell->isNull = true; + } + } + + pInfo->pDelRes = createSpecialDataBlock(STREAM_DELETE_RESULT); + blockDataEnsureCapacity(pInfo->pDelRes, pOperator->resultInfo.capacity); + + pInfo->primaryTsCol = ((STargetNode*)pPhyFillNode->pWStartTs)->slotId; + pInfo->primarySrcSlotId = ((SColumnNode*)((STargetNode*)pPhyFillNode->pWStartTs)->pExpr)->slotId; + + int32_t numOfOutputCols = 0; + SArray* pColMatchColInfo = extractColMatchInfo(pPhyFillNode->pFillExprs, pPhyFillNode->node.pOutputDataBlockDesc, + &numOfOutputCols, COL_MATCH_FROM_SLOT_ID); + pInfo->pCondition = pPhyFillNode->node.pConditions; + pInfo->pColMatchColInfo = pColMatchColInfo; + initExprSupp(&pOperator->exprSupp, pFillExprInfo, numOfFillCols); + pInfo->srcRowIndex = 0; + + pOperator->name = "FillOperator"; + pOperator->blocking = false; + pOperator->status = OP_NOT_OPENED; + pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL; + pOperator->info = pInfo; + pOperator->pTaskInfo = pTaskInfo; + pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, doStreamFill, NULL, NULL, destroyStreamFillOperatorInfo, + NULL, NULL, NULL); + + int32_t code = appendDownstream(pOperator, &downstream, 1); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + return pOperator; + +_error: + destroyStreamFillOperatorInfo(pInfo); + taosMemoryFreeClear(pOperator); + return NULL; +} diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 4671570802c24e0f48c3f49687bea380e275d674..b4e2b73889918a69775121104536dad4a49e3371 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -271,6 +271,10 @@ static void getNextTimeWindow(SInterval* pInterval, int32_t precision, int32_t o tw->ekey -= 1; } +void getNextIntervalWindow(SInterval* pInterval, STimeWindow* tw, int32_t order) { + getNextTimeWindow(pInterval, pInterval->precision, order, tw); +} + void doTimeWindowInterpolation(SArray* pPrevValues, SArray* pDataBlock, TSKEY prevTs, int32_t prevRowIndex, TSKEY curTs, int32_t curRowIndex, TSKEY windowKey, int32_t type, SExprSupp* pSup) { SqlFunctionCtx* pCtx = pSup->pCtx; @@ -2095,12 +2099,17 @@ static void genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp bool hasInterp = true; for (int32_t j = 0; j < pExprSup->numOfExprs; ++j) { SExprInfo* pExprInfo = &pExprSup->pExprInfo[j]; - int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; - int32_t dstSlot = pExprInfo->base.resSchema.slotId; - // SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, srcSlot); + int32_t dstSlot = pExprInfo->base.resSchema.slotId; SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot); + if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) { + colDataAppend(pDst, rows, (char*)&pSliceInfo->current, false); + continue; + } + + int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; + // SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, srcSlot); switch (pSliceInfo->fillType) { case TSDB_FILL_NULL: { colDataAppendNULL(pDst, rows); @@ -2346,19 +2355,24 @@ static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) { if (ts == pSliceInfo->current) { for (int32_t j = 0; j < pOperator->exprSupp.numOfExprs; ++j) { SExprInfo* pExprInfo = &pOperator->exprSupp.pExprInfo[j]; - int32_t dstSlot = pExprInfo->base.resSchema.slotId; - int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; - SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, srcSlot); + int32_t dstSlot = pExprInfo->base.resSchema.slotId; SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot); - if (colDataIsNull_s(pSrc, i)) { - colDataAppendNULL(pDst, pResBlock->info.rows); - continue; - } + if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) { + colDataAppend(pDst, pResBlock->info.rows, (char *)&pSliceInfo->current, false); + } else { + int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; + SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, srcSlot); + + if (colDataIsNull_s(pSrc, i)) { + colDataAppendNULL(pDst, pResBlock->info.rows); + continue; + } - char* v = colDataGetData(pSrc, i); - colDataAppend(pDst, pResBlock->info.rows, v, false); + char* v = colDataGetData(pSrc, i); + colDataAppend(pDst, pResBlock->info.rows, v, false); + } } pResBlock->info.rows += 1; @@ -2478,14 +2492,24 @@ static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) { if (ts == pSliceInfo->current && pSliceInfo->current <= pSliceInfo->win.ekey) { for (int32_t j = 0; j < pOperator->exprSupp.numOfExprs; ++j) { SExprInfo* pExprInfo = &pOperator->exprSupp.pExprInfo[j]; - int32_t dstSlot = pExprInfo->base.resSchema.slotId; - int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; - SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, srcSlot); + int32_t dstSlot = pExprInfo->base.resSchema.slotId; SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot); - char* v = colDataGetData(pSrc, i); - colDataAppend(pDst, pResBlock->info.rows, v, false); + if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) { + colDataAppend(pDst, pResBlock->info.rows, (char *)&pSliceInfo->current, false); + } else { + int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; + SColumnInfoData* pSrc = taosArrayGet(pBlock->pDataBlock, srcSlot); + + if (colDataIsNull_s(pSrc, i)) { + colDataAppendNULL(pDst, pResBlock->info.rows); + continue; + } + + char* v = colDataGetData(pSrc, i); + colDataAppend(pDst, pResBlock->info.rows, v, false); + } } pResBlock->info.rows += 1; @@ -3146,20 +3170,21 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { } doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->aggSup.pResultBuf); - if (pInfo->binfo.pRes->info.rows == 0) { - pOperator->status = OP_EXEC_DONE; - if (!IS_FINAL_OP(pInfo)) { - clearFunctionContext(&pOperator->exprSupp); - // semi interval operator clear disk buffer - clearStreamIntervalOperator(pInfo); - qDebug("===stream===clear semi operator"); - } else { - freeAllPages(pInfo->pRecycledPages, pInfo->aggSup.pResultBuf); - } - return NULL; + if (pInfo->binfo.pRes->info.rows != 0) { + printDataBlock(pInfo->binfo.pRes, IS_FINAL_OP(pInfo) ? "interval final" : "interval semi"); + return pInfo->binfo.pRes; } - printDataBlock(pInfo->binfo.pRes, IS_FINAL_OP(pInfo) ? "interval final" : "interval semi"); - return pInfo->binfo.pRes; + + doSetOperatorCompleted(pOperator); + if (!IS_FINAL_OP(pInfo)) { + clearFunctionContext(&pOperator->exprSupp); + // semi interval operator clear disk buffer + clearStreamIntervalOperator(pInfo); + qDebug("===stream===clear semi operator"); + } else { + freeAllPages(pInfo->pRecycledPages, pInfo->aggSup.pResultBuf); + } + return NULL; } else { if (!IS_FINAL_OP(pInfo)) { doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->aggSup.pResultBuf); @@ -3316,7 +3341,13 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { return pInfo->pPullDataRes; } - // we should send result first. + doBuildDeleteResult(pInfo->pDelWins, &pInfo->delIndex, pInfo->pDelRes); + if (pInfo->pDelRes->info.rows != 0) { + // process the rest of the data + printDataBlock(pInfo->pDelRes, IS_FINAL_OP(pInfo) ? "interval final" : "interval semi"); + return pInfo->pDelRes; + } + doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->aggSup.pResultBuf); if (pInfo->binfo.pRes->info.rows != 0) { printDataBlock(pInfo->binfo.pRes, IS_FINAL_OP(pInfo) ? "interval final" : "interval semi"); @@ -3330,13 +3361,6 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { // process the rest of the data return pInfo->pUpdateRes; } - - doBuildDeleteResult(pInfo->pDelWins, &pInfo->delIndex, pInfo->pDelRes); - if (pInfo->pDelRes->info.rows != 0) { - // process the rest of the data - printDataBlock(pInfo->pDelRes, IS_FINAL_OP(pInfo) ? "interval final" : "interval semi"); - return pInfo->pDelRes; - } return NULL; } @@ -5744,19 +5768,18 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) { if (pOperator->status == OP_RES_TO_RETURN) { doBuildDeleteResult(pInfo->pDelWins, &pInfo->delIndex, pInfo->pDelRes); if (pInfo->pDelRes->info.rows > 0) { - printDataBlock(pInfo->pDelRes, "single interval"); + printDataBlock(pInfo->pDelRes, "single interval delete"); return pInfo->pDelRes; } doBuildResult(pOperator, pInfo->binfo.pRes, &pInfo->groupResInfo); - // doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->aggSup.pResultBuf); - if (pInfo->binfo.pRes->info.rows == 0 || !hasRemainResults(&pInfo->groupResInfo)) { - pOperator->status = OP_EXEC_DONE; - qDebug("===stream===single interval is done"); - freeAllPages(pInfo->pRecycledPages, pInfo->aggSup.pResultBuf); + if (pInfo->binfo.pRes->info.rows > 0) { + printDataBlock(pInfo->binfo.pRes, "single interval"); + return pInfo->binfo.pRes; } - printDataBlock(pInfo->binfo.pRes, "single interval"); - return pInfo->binfo.pRes->info.rows == 0 ? NULL : pInfo->binfo.pRes; + + doSetOperatorCompleted(pOperator); + return NULL; } SOperatorInfo* downstream = pOperator->pDownstream[0]; @@ -5823,24 +5846,24 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) { } taosArraySort(pUpdated, resultrowComparAsc); - // new disc buf - // finalizeUpdatedResult(pOperator->exprSupp.numOfExprs, pInfo->aggSup.pResultBuf, pUpdated, - // pSup->rowEntryInfoOffset); initMultiResInfoFromArrayList(&pInfo->groupResInfo, pUpdated); blockDataEnsureCapacity(pInfo->binfo.pRes, pOperator->resultInfo.capacity); removeDeleteResults(pUpdatedMap, pInfo->pDelWins); taosHashCleanup(pUpdatedMap); + doBuildDeleteResult(pInfo->pDelWins, &pInfo->delIndex, pInfo->pDelRes); if (pInfo->pDelRes->info.rows > 0) { - printDataBlock(pInfo->pDelRes, "single interval"); + printDataBlock(pInfo->pDelRes, "single interval delete"); return pInfo->pDelRes; } - // doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->aggSup.pResultBuf); - // new disc buf doBuildResult(pOperator, pInfo->binfo.pRes, &pInfo->groupResInfo); - printDataBlock(pInfo->binfo.pRes, "single interval"); - return pInfo->binfo.pRes->info.rows == 0 ? NULL : pInfo->binfo.pRes; + if (pInfo->binfo.pRes->info.rows > 0) { + printDataBlock(pInfo->binfo.pRes, "single interval"); + return pInfo->binfo.pRes; + } + + return NULL; } void destroyStreamIntervalOperatorInfo(void* param) { diff --git a/source/libs/function/inc/functionMgtInt.h b/source/libs/function/inc/functionMgtInt.h index 37208c4723fe2bac49215f7dcc7caf76a96855e3..9bff812c3a9866eb0ccb1eade0de1c63580d50c4 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_FORBID_STABLE_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(23) +#define FUNC_MGT_INTERP_PC_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 0677bd7d636ba5c7bea0acfaec62e5ca109122e1..e9415dc87978872ad672c160aae68e194052443c 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -2020,6 +2020,11 @@ static int32_t translateUserFunc(SFunctionNode* pFunc, char* pErrBuf, int32_t le return TSDB_CODE_SUCCESS; } +static int32_t translateTagsPseudoColumn(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + // The _tags pseudo-column will be expanded to the actual tags on the client side + return TSDB_CODE_SUCCESS; +} + // clang-format off const SBuiltinFuncDefinition funcMgtBuiltins[] = { { @@ -3146,6 +3151,26 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .classification = FUNC_MGT_SYSTEM_INFO_FUNC | FUNC_MGT_SCALAR_FUNC, .translateFunc = translateUserFunc, }, + { + .name = "_irowts", + .type = FUNCTION_TYPE_IROWTS, + .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_INTERP_PC_FUNC, + .translateFunc = translateTimePseudoColumn, + .getEnvFunc = getTimePseudoFuncEnv, + .initFunc = NULL, + .sprocessFunc = NULL, + .finalizeFunc = NULL + }, + { + .name = "_tags", + .type = FUNCTION_TYPE_TAGS, + .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_MULTI_RES_FUNC, + .translateFunc = translateTagsPseudoColumn, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = NULL, + .finalizeFunc = NULL + }, }; // clang-format on diff --git a/source/libs/function/src/functionMgt.c b/source/libs/function/src/functionMgt.c index bc10ce71aeeb49ca816d4ea95c489f412ef13da6..ca8ddbc60acc987735fc7b4f5a43c852e165fd20 100644 --- a/source/libs/function/src/functionMgt.c +++ b/source/libs/function/src/functionMgt.c @@ -224,6 +224,8 @@ bool fmIsInterpFunc(int32_t funcId) { return FUNCTION_TYPE_INTERP == funcMgtBuiltins[funcId].type; } +bool fmIsInterpPseudoColumnFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, FUNC_MGT_INTERP_PC_FUNC); } + bool fmIsLastRowFunc(int32_t funcId) { if (funcId < 0 || funcId >= funcMgtBuiltinsNum) { return false; diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index 62427e0488773c3c6160ad4ed4b859b32881f6c3..060a92f864ec6380a799c77a6790eeeb3175577b 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -1656,6 +1656,8 @@ int32_t doSetupUdf(char udfName[], UdfcFuncHandle *funcHandle) { int32_t errCode = udfcRunUdfUvTask(task, UV_TASK_CONNECT); if (errCode != 0) { fnError("failed to connect to pipe. udfName: %s, pipe: %s", udfName, (&gUdfdProxy)->udfdPipeName); + taosMemoryFree(task->session); + taosMemoryFree(task); return TSDB_CODE_UDF_PIPE_CONNECT_ERR; } diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index 636f006d6e7b8aaa909df2b0ba1966ed6af9e308..8ff0dc15a56068d466664df01f4f2291100741f2 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -960,7 +960,7 @@ int32_t udfdInitResidentFuncs() { char* token; while ((token = strtok_r(pSave, ",", &pSave)) != NULL) { char func[TSDB_FUNC_NAME_LEN] = {0}; - strncpy(func, token, strlen(token)); + strncpy(func, token, sizeof(func)); taosArrayPush(global.residentFuncs, func); } diff --git a/source/libs/index/src/indexCache.c b/source/libs/index/src/indexCache.c index 7e867db755c658abad341e8fa59cd6687ef9b959..39bba4e2695030cefc332469ae74ad25b5eda194 100644 --- a/source/libs/index/src/indexCache.c +++ b/source/libs/index/src/indexCache.c @@ -302,6 +302,7 @@ static int32_t cacheSearchCompareFunc_JSON(void* cache, SIndexTerm* term, SIdxTR char* p = taosMemoryCalloc(1, strlen(c->colVal) + 1); memcpy(p, c->colVal, strlen(c->colVal)); cond = cmpFn(p + skip, term->colVal, dType); + taosMemoryFree(p); } } if (cond == MATCH) { diff --git a/source/libs/index/src/indexFstFile.c b/source/libs/index/src/indexFstFile.c index 2a33ddd477daa8c1de9e64e958be0d15865f9efb..7021fdfae33fc89289e4506fcf40fbfef9601505 100644 --- a/source/libs/index/src/indexFstFile.c +++ b/source/libs/index/src/indexFstFile.c @@ -69,6 +69,8 @@ static int idxFileCtxDoReadFrom(IFileCtx* ctx, uint8_t* buf, int len, int32_t of int32_t blkOffset = offset % kBlockSize; int32_t blkLeft = kBlockSize - blkOffset; + if (offset >= ctx->file.size) return 0; + do { char key[128] = {0}; idxGenLRUKey(key, ctx->file.buf, blkId); @@ -80,24 +82,34 @@ static int idxFileCtxDoReadFrom(IFileCtx* ctx, uint8_t* buf, int len, int32_t of memcpy(buf + total, blk->buf + blkOffset, nread); taosLRUCacheRelease(ctx->lru, h, false); } else { - int32_t cacheMemSize = sizeof(SDataBlock) + kBlockSize; + int32_t left = ctx->file.size - offset; + if (left < kBlockSize) { + nread = TMIN(left, len); + int32_t bytes = taosPReadFile(ctx->file.pFile, buf + total, nread, offset); + assert(bytes == nread); - SDataBlock* blk = taosMemoryCalloc(1, cacheMemSize); - blk->blockId = blkId; - blk->nread = taosPReadFile(ctx->file.pFile, blk->buf, kBlockSize, blkId * kBlockSize); - assert(blk->nread <= kBlockSize); + total += bytes; + return total; + } else { + int32_t cacheMemSize = sizeof(SDataBlock) + kBlockSize; - if (blk->nread < kBlockSize && blk->nread < len) { - break; - } + SDataBlock* blk = taosMemoryCalloc(1, cacheMemSize); + blk->blockId = blkId; + blk->nread = taosPReadFile(ctx->file.pFile, blk->buf, kBlockSize, blkId * kBlockSize); + assert(blk->nread <= kBlockSize); - nread = TMIN(blkLeft, len); - memcpy(buf + total, blk->buf + blkOffset, nread); + if (blk->nread < kBlockSize && blk->nread < len) { + break; + } + + nread = TMIN(blkLeft, len); + memcpy(buf + total, blk->buf + blkOffset, nread); - LRUStatus s = taosLRUCacheInsert(ctx->lru, key, strlen(key), blk, cacheMemSize, deleteDataBlockFromLRU, NULL, - TAOS_LRU_PRIORITY_LOW); - if (s != TAOS_LRU_STATUS_OK) { - return -1; + LRUStatus s = taosLRUCacheInsert(ctx->lru, key, strlen(key), blk, cacheMemSize, deleteDataBlockFromLRU, NULL, + TAOS_LRU_PRIORITY_LOW); + if (s != TAOS_LRU_STATUS_OK) { + return -1; + } } } total += nread; @@ -146,9 +158,7 @@ IFileCtx* idxFileCtxCreate(WriterType type, const char* path, bool readOnly, int } else { ctx->file.pFile = taosOpenFile(path, TD_FILE_READ); - int64_t size = 0; taosFStatFile(ctx->file.pFile, &ctx->file.size, NULL); - ctx->file.size = (int)size; #ifdef USE_MMAP ctx->file.ptr = (char*)tfMmapReadOnly(ctx->file.pFile, ctx->file.size); #endif diff --git a/source/libs/index/test/jsonUT.cc b/source/libs/index/test/jsonUT.cc index 1911514d9771e477ea0cc04ac30b647b095e4ef5..8ae3fd41357da90b426eed6f2cd8b1c8c358d154 100644 --- a/source/libs/index/test/jsonUT.cc +++ b/source/libs/index/test/jsonUT.cc @@ -172,9 +172,9 @@ TEST_F(JsonEnv, testWriteMillonData) { { std::string colName("voltagefdadfa"); std::string colVal("abxxxxxxxxxxxx"); - for (int i = 0; i < 10; i++) { + for (int i = 0; i < 10000; i++) { colVal[i % colVal.size()] = '0' + i % 128; - for (size_t i = 0; i < 100; i++) { + for (size_t i = 0; i < 10; i++) { SIndexTerm* term = indexTermCreateT(1, ADD_VALUE, TSDB_DATA_TYPE_BINARY, colName.c_str(), colName.size(), colVal.c_str(), colVal.size()); diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 78afadb75cc74be4b19e9e042042a64960a4dc69..e401a3da7fe4fdb9815eae3fedfec9e5b281689d 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -254,6 +254,7 @@ const char* nodesNodeName(ENodeType type) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL: return "PhysiStreamSemiInterval"; case QUERY_NODE_PHYSICAL_PLAN_FILL: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL: return "PhysiFill"; case QUERY_NODE_PHYSICAL_PLAN_MERGE_SESSION: return "PhysiSessionWindow"; @@ -4635,6 +4636,7 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL: return physiIntervalNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_FILL: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL: return physiFillNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_MERGE_SESSION: case QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION: @@ -4788,6 +4790,7 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL: return jsonToPhysiIntervalNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_FILL: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL: return jsonToPhysiFillNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_MERGE_SESSION: case QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION: diff --git a/source/libs/nodes/src/nodesMsgFuncs.c b/source/libs/nodes/src/nodesMsgFuncs.c index 989a4f5925028e2f15561432709d921ddac44416..cdc4e66e4247615697a6090e2ad1c1e8a1659529 100644 --- a/source/libs/nodes/src/nodesMsgFuncs.c +++ b/source/libs/nodes/src/nodesMsgFuncs.c @@ -90,12 +90,12 @@ static void endTlvEncode(STlvEncoder* pEncoder, char** pMsg, int32_t* pLen) { static int32_t tlvEncodeImpl(STlvEncoder* pEncoder, int16_t type, const void* pValue, int32_t len) { int32_t tlvLen = sizeof(STlv) + len; if (pEncoder->offset + tlvLen > pEncoder->allocSize) { - void* pNewBuf = taosMemoryRealloc(pEncoder->pBuf, pEncoder->allocSize * 2); + pEncoder->allocSize = TMAX(pEncoder->allocSize * 2, pEncoder->allocSize + pEncoder->offset + tlvLen); + void* pNewBuf = taosMemoryRealloc(pEncoder->pBuf, pEncoder->allocSize); if (NULL == pNewBuf) { return TSDB_CODE_OUT_OF_MEMORY; } pEncoder->pBuf = pNewBuf; - pEncoder->allocSize = pEncoder->allocSize * 2; } STlv* pTlv = (STlv*)(pEncoder->pBuf + pEncoder->offset); pTlv->type = htons(type); @@ -3633,6 +3633,7 @@ static int32_t specificNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { code = physiIntervalNodeToMsg(pObj, pEncoder); break; case QUERY_NODE_PHYSICAL_PLAN_FILL: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL: code = physiFillNodeToMsg(pObj, pEncoder); break; case QUERY_NODE_PHYSICAL_PLAN_MERGE_SESSION: @@ -3770,6 +3771,7 @@ static int32_t msgToSpecificNode(STlvDecoder* pDecoder, void* pObj) { code = msgToPhysiIntervalNode(pDecoder, pObj); break; case QUERY_NODE_PHYSICAL_PLAN_FILL: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL: code = msgToPhysiFillNode(pDecoder, pObj); break; case QUERY_NODE_PHYSICAL_PLAN_MERGE_SESSION: diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 71e53bd9be9d26c84c78710a5bb5d0f9d0d14d73..6e964fb53a7e36b435169f04daced63d43f6a786 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -419,6 +419,7 @@ SNode* nodesMakeNode(ENodeType type) { case QUERY_NODE_SHOW_TRANSACTIONS_STMT: case QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT: case QUERY_NODE_SHOW_TAGS_STMT: + case QUERY_NODE_SHOW_TABLE_TAGS_STMT: return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_SHOW_DNODE_VARIABLES_STMT: return makeNode(type, sizeof(SShowDnodeVariablesStmt)); @@ -511,6 +512,7 @@ SNode* nodesMakeNode(ENodeType type) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL: return makeNode(type, sizeof(SStreamSemiIntervalPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_FILL: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL: return makeNode(type, sizeof(SFillPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_MERGE_SESSION: return makeNode(type, sizeof(SSessionWinodwPhysiNode)); @@ -920,7 +922,8 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT: case QUERY_NODE_SHOW_TRANSACTIONS_STMT: case QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT: - case QUERY_NODE_SHOW_TAGS_STMT: { + case QUERY_NODE_SHOW_TAGS_STMT: + case QUERY_NODE_SHOW_TABLE_TAGS_STMT: { SShowStmt* pStmt = (SShowStmt*)pNode; nodesDestroyNode(pStmt->pDbName); nodesDestroyNode(pStmt->pTbName); @@ -1156,7 +1159,8 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL: destroyWinodwPhysiNode((SWinodwPhysiNode*)pNode); break; - case QUERY_NODE_PHYSICAL_PLAN_FILL: { + case QUERY_NODE_PHYSICAL_PLAN_FILL: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL: { SFillPhysiNode* pPhyNode = (SFillPhysiNode*)pNode; destroyPhysiNode((SPhysiNode*)pPhyNode); nodesDestroyList(pPhyNode->pFillExprs); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index cf465d6d762d8cae27d728dbb5b1b4fec50d2285..83fa92041e0bec709b176fdec749b1e122c8dcf7 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -420,6 +420,7 @@ cmd ::= SHOW TABLE DISTRIBUTED full_table_name(A). cmd ::= SHOW CONSUMERS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } cmd ::= SHOW SUBSCRIPTIONS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } cmd ::= SHOW TAGS FROM table_name_cond(A) from_db_opt(B). { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, B, A, OP_TYPE_EQUAL); } +cmd ::= SHOW TABLE TAGS FROM table_name_cond(A) from_db_opt(B). { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLE_TAGS_STMT, B, A, OP_TYPE_EQUAL); } cmd ::= SHOW VNODES NK_INTEGER(A). { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &A), NULL); } cmd ::= SHOW VNODES NK_STRING(A). { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &A)); } @@ -707,6 +708,8 @@ pseudo_column(A) ::= QDURATION(B). pseudo_column(A) ::= WSTART(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } pseudo_column(A) ::= WEND(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } pseudo_column(A) ::= WDURATION(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } +pseudo_column(A) ::= IROWTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } +pseudo_column(A) ::= QTAGS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } function_expression(A) ::= function_name(B) NK_LP expression_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); } function_expression(A) ::= star_func(B) NK_LP star_func_para_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 10a066db40e497767e6e4eca623aabf3ded3dcea..8998ffdbf3fa3cf2af280957df0b5ff9ad787dea 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -1310,7 +1310,7 @@ SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName) { static bool needDbShowStmt(ENodeType type) { return QUERY_NODE_SHOW_TABLES_STMT == type || QUERY_NODE_SHOW_STABLES_STMT == type || QUERY_NODE_SHOW_VGROUPS_STMT == type || QUERY_NODE_SHOW_INDEXES_STMT == type || - QUERY_NODE_SHOW_TAGS_STMT == type; + QUERY_NODE_SHOW_TAGS_STMT == type || QUERY_NODE_SHOW_TABLE_TAGS_STMT == type; } SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type) { diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index ec5f6c4e570206f1a08d537f735605d0d54d53ef..ce90bd3da0cc183722dc87a2d741f90a190ae4de 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -407,9 +407,18 @@ static int32_t collectMetaKeyFromShowTags(SCollectMetaKeyCxt* pCxt, SShowStmt* p if (TSDB_CODE_SUCCESS == code) { code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache); } + if (TSDB_CODE_SUCCESS == code && NULL != pStmt->pTbName) { + code = reserveTableVgroupInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, + ((SValueNode*)pStmt->pTbName)->literal, pCxt->pMetaCache); + } return code; } +static int32_t collectMetaKeyFromShowStableTags(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { + return collectMetaKeyFromRealTableImpl(pCxt, ((SValueNode*)pStmt->pDbName)->literal, + ((SValueNode*)pStmt->pTbName)->literal, AUTH_TYPE_READ); +} + static int32_t collectMetaKeyFromShowUsers(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USERS, pCxt->pMetaCache); @@ -591,6 +600,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { return collectMetaKeyFromShowTables(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_TAGS_STMT: return collectMetaKeyFromShowTags(pCxt, (SShowStmt*)pStmt); + case QUERY_NODE_SHOW_TABLE_TAGS_STMT: + return collectMetaKeyFromShowStableTags(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_USERS_STMT: return collectMetaKeyFromShowUsers(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_LICENCES_STMT: diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 26127be0d62940d13df785c9bcba5d603b35b5d6..345b9cc5b9e29449d009ab9c0911b1438e44b8b3 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -252,10 +252,12 @@ static SKeyword keywordTable[] = { {"WITH", TK_WITH}, {"WRITE", TK_WRITE}, {"_C0", TK_ROWTS}, + {"_IROWTS", TK_IROWTS}, {"_QDURATION", TK_QDURATION}, {"_QEND", TK_QEND}, {"_QSTART", TK_QSTART}, {"_ROWTS", TK_ROWTS}, + {"_TAGS", TK_QTAGS}, {"_WDURATION", TK_WDURATION}, {"_WEND", TK_WEND}, {"_WSTART", TK_WSTART}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index c386ddf6d63a095146445c4f262971ed252017db..9d805b8e3386a0f08cb56e2041dc6575a6e7a3ec 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -1215,6 +1215,9 @@ static bool isMultiResFunc(SNode* pNode) { if (QUERY_NODE_FUNCTION != nodeType(pNode) || !fmIsMultiResFunc(((SFunctionNode*)pNode)->funcId)) { return false; } + if (FUNCTION_TYPE_TAGS == ((SFunctionNode*)pNode)->funcType) { + return true; + } SNodeList* pParameterList = ((SFunctionNode*)pNode)->pParameterList; if (LIST_LENGTH(pParameterList) > 1) { return true; @@ -1556,6 +1559,9 @@ static int32_t translateMultiResFunc(STranslateContext* pCxt, SFunctionNode* pFu "%s(*) is only supported in SELECTed list", pFunc->functionName); } } + if (tsKeepColumnName && 1 == LIST_LENGTH(pFunc->pParameterList)) { + strcpy(pFunc->node.userAlias, ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->userAlias); + } return TSDB_CODE_SUCCESS; } @@ -1839,17 +1845,46 @@ static EDealRes translateWhenThen(STranslateContext* pCxt, SWhenThenNode* pWhenT return DEAL_RES_CONTINUE; } +static bool isCondition(const SNode* pNode) { + if (QUERY_NODE_OPERATOR == nodeType(pNode)) { + return nodesIsComparisonOp((const SOperatorNode*)pNode); + } + return (QUERY_NODE_LOGIC_CONDITION == nodeType(pNode)); +} + +static int32_t rewriteIsTrue(SNode* pSrc, SNode** pIsTrue) { + SOperatorNode* pOp = (SOperatorNode*)nodesMakeNode(QUERY_NODE_OPERATOR); + if (NULL == pOp) { + return TSDB_CODE_OUT_OF_MEMORY; + } + pOp->opType = OP_TYPE_IS_TRUE; + pOp->pLeft = pSrc; + pOp->node.resType.type = TSDB_DATA_TYPE_BOOL; + pOp->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_BOOL].bytes; + *pIsTrue = (SNode*)pOp; + return TSDB_CODE_SUCCESS; +} + static EDealRes translateCaseWhen(STranslateContext* pCxt, SCaseWhenNode* pCaseWhen) { bool first = true; SNode* pNode = NULL; FOREACH(pNode, pCaseWhen->pWhenThenList) { + SWhenThenNode* pWhenThen = (SWhenThenNode*)pNode; + if (NULL == pCaseWhen->pCase && !isCondition(pWhenThen->pWhen)) { + SNode* pIsTrue = NULL; + pCxt->errCode = rewriteIsTrue(pWhenThen->pWhen, &pIsTrue); + if (TSDB_CODE_SUCCESS != pCxt->errCode) { + return DEAL_RES_ERROR; + } + pWhenThen->pWhen = pIsTrue; + } if (first) { pCaseWhen->node.resType = ((SExprNode*)pNode)->resType; } else if (!dataTypeEqual(&pCaseWhen->node.resType, &((SExprNode*)pNode)->resType)) { - SWhenThenNode* pWhenThen = (SWhenThenNode*)pNode; - SNode* pCastFunc = NULL; - if (TSDB_CODE_SUCCESS != createCastFunc(pCxt, pWhenThen->pThen, pCaseWhen->node.resType, &pCastFunc)) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_WRONG_VALUE_TYPE, "CASE WHEN data type mismatch"); + SNode* pCastFunc = NULL; + pCxt->errCode = createCastFunc(pCxt, pWhenThen->pThen, pCaseWhen->node.resType, &pCastFunc); + if (TSDB_CODE_SUCCESS != pCxt->errCode) { + return DEAL_RES_ERROR; } pWhenThen->pThen = pCastFunc; pWhenThen->node.resType = pCaseWhen->node.resType; @@ -1857,8 +1892,9 @@ static EDealRes translateCaseWhen(STranslateContext* pCxt, SCaseWhenNode* pCaseW } if (NULL != pCaseWhen->pElse && !dataTypeEqual(&pCaseWhen->node.resType, &((SExprNode*)pCaseWhen->pElse)->resType)) { SNode* pCastFunc = NULL; - if (TSDB_CODE_SUCCESS != createCastFunc(pCxt, pCaseWhen->pElse, pCaseWhen->node.resType, &pCastFunc)) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_WRONG_VALUE_TYPE, "CASE WHEN data type mismatch"); + pCxt->errCode = createCastFunc(pCxt, pCaseWhen->pElse, pCaseWhen->node.resType, &pCastFunc); + if (TSDB_CODE_SUCCESS != pCxt->errCode) { + return DEAL_RES_ERROR; } pCaseWhen->pElse = pCastFunc; ((SExprNode*)pCaseWhen->pElse)->resType = pCaseWhen->node.resType; @@ -2138,10 +2174,114 @@ static bool sysTableFromVnode(const char* pTable) { static bool sysTableFromDnode(const char* pTable) { return 0 == strcmp(pTable, TSDB_INS_TABLE_DNODE_VARIABLES); } +static int32_t getTagsTableVgroupListImpl(STranslateContext* pCxt, SName* pTargetName, SName* pName, + SArray** pVgroupList) { + if (0 == pTargetName->type) { + return getDBVgInfoImpl(pCxt, pName, pVgroupList); + } + + if (TSDB_DB_NAME_T == pTargetName->type) { + return getDBVgInfoImpl(pCxt, pTargetName, pVgroupList); + } + + SVgroupInfo vgInfo = {0}; + int32_t code = getTableHashVgroupImpl(pCxt, pTargetName, &vgInfo); + if (TSDB_CODE_SUCCESS == code) { + *pVgroupList = taosArrayInit(1, sizeof(SVgroupInfo)); + if (NULL == *pVgroupList) { + code = TSDB_CODE_OUT_OF_MEMORY; + } + } + if (TSDB_CODE_SUCCESS == code) { + taosArrayPush(*pVgroupList, &vgInfo); + } + return code; +} + +static int32_t getTagsTableTargetNameFromOp(STranslateContext* pCxt, SOperatorNode* pOper, SName* pName) { + if (OP_TYPE_EQUAL != pOper->opType) { + return TSDB_CODE_SUCCESS; + } + + SColumnNode* pCol = NULL; + SValueNode* pVal = NULL; + if (QUERY_NODE_COLUMN == nodeType(pOper->pLeft)) { + pCol = (SColumnNode*)pOper->pLeft; + } else if (QUERY_NODE_VALUE == nodeType(pOper->pLeft)) { + pVal = (SValueNode*)pOper->pLeft; + } + if (QUERY_NODE_COLUMN == nodeType(pOper->pRight)) { + pCol = (SColumnNode*)pOper->pRight; + } else if (QUERY_NODE_VALUE == nodeType(pOper->pRight)) { + pVal = (SValueNode*)pOper->pRight; + } + if (NULL == pCol || NULL == pVal) { + return TSDB_CODE_SUCCESS; + } + + if (0 == strcmp(pCol->colName, "db_name")) { + return tNameSetDbName(pName, pCxt->pParseCxt->acctId, pVal->literal, strlen(pVal->literal)); + } else if (0 == strcmp(pCol->colName, "table_name")) { + return tNameAddTbName(pName, pVal->literal, strlen(pVal->literal)); + } + + return TSDB_CODE_SUCCESS; +} + +static void getTagsTableTargetObjName(STranslateContext* pCxt, SNode* pNode, SName* pName) { + if (QUERY_NODE_OPERATOR == nodeType(pNode)) { + getTagsTableTargetNameFromOp(pCxt, (SOperatorNode*)pNode, pName); + } +} + +static int32_t getTagsTableTargetNameFromCond(STranslateContext* pCxt, SLogicConditionNode* pCond, SName* pName) { + if (LOGIC_COND_TYPE_AND != pCond->condType) { + return TSDB_CODE_SUCCESS; + } + + SNode* pNode = NULL; + FOREACH(pNode, pCond->pParameterList) { getTagsTableTargetObjName(pCxt, pNode, pName); } + if ('\0' == pName->dbname[0]) { + pName->type = 0; + } + return TSDB_CODE_SUCCESS; +} + +static int32_t getTagsTableTargetName(STranslateContext* pCxt, SNode* pWhere, SName* pName) { + if (NULL == pWhere) { + return TSDB_CODE_SUCCESS; + } + + if (QUERY_NODE_OPERATOR == nodeType(pWhere)) { + return getTagsTableTargetNameFromOp(pCxt, (SOperatorNode*)pWhere, pName); + } + + if (QUERY_NODE_LOGIC_CONDITION == nodeType(pWhere)) { + return getTagsTableTargetNameFromCond(pCxt, (SLogicConditionNode*)pWhere, pName); + } + + return TSDB_CODE_SUCCESS; +} + +static int32_t getTagsTableVgroupList(STranslateContext* pCxt, SName* pName, SArray** pVgroupList) { + if (!isSelectStmt(pCxt->pCurrStmt)) { + return TSDB_CODE_SUCCESS; + } + SSelectStmt* pSelect = (SSelectStmt*)pCxt->pCurrStmt; + SName targetName = {0}; + int32_t code = getTagsTableTargetName(pCxt, pSelect->pWhere, &targetName); + if (TSDB_CODE_SUCCESS == code) { + code = getTagsTableVgroupListImpl(pCxt, &targetName, pName, pVgroupList); + } + return code; +} + static int32_t setVnodeSysTableVgroupList(STranslateContext* pCxt, SName* pName, SRealTableNode* pRealTable) { int32_t code = TSDB_CODE_SUCCESS; SArray* vgroupList = NULL; - if ('\0' != pRealTable->qualDbName[0]) { + if (0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TAGS)) { + code = getTagsTableVgroupList(pCxt, pName, &vgroupList); + } else if ('\0' != pRealTable->qualDbName[0]) { if (0 != strcmp(pRealTable->qualDbName, TSDB_INFORMATION_SCHEMA_DB)) { code = getDBVgInfo(pCxt, pRealTable->qualDbName, &vgroupList); } @@ -2149,14 +2289,12 @@ static int32_t setVnodeSysTableVgroupList(STranslateContext* pCxt, SName* pName, code = getDBVgInfoImpl(pCxt, pName, &vgroupList); } - if (TSDB_CODE_SUCCESS == code && 0 == strcmp(pRealTable->table.dbName, TSDB_INFORMATION_SCHEMA_DB) && - 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TAGS) && isSelectStmt(pCxt->pCurrStmt) && - 0 == taosArrayGetSize(vgroupList)) { + if (TSDB_CODE_SUCCESS == code && 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TAGS) && + isSelectStmt(pCxt->pCurrStmt) && 0 == taosArrayGetSize(vgroupList)) { ((SSelectStmt*)pCxt->pCurrStmt)->isEmptyResult = true; } - if (TSDB_CODE_SUCCESS == code && 0 == strcmp(pRealTable->table.dbName, TSDB_INFORMATION_SCHEMA_DB) && - 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TABLES)) { + if (TSDB_CODE_SUCCESS == code && 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TABLES)) { code = addMnodeToVgroupList(&pCxt->pParseCxt->mgmtEpSet, &vgroupList); } @@ -2388,8 +2526,12 @@ static SNode* createMultiResFunc(SFunctionNode* pSrcFunc, SExprNode* pExpr) { SColumnNode* pCol = (SColumnNode*)pExpr; len = snprintf(buf, sizeof(buf), "%s(%s.%s)", pSrcFunc->functionName, pCol->tableAlias, pCol->colName); strncpy(pFunc->node.aliasName, buf, TMIN(len, sizeof(pFunc->node.aliasName) - 1)); - len = snprintf(buf, sizeof(buf), "%s(%s)", pSrcFunc->functionName, pCol->colName); - strncpy(pFunc->node.userAlias, buf, TMIN(len, sizeof(pFunc->node.userAlias) - 1)); + if (tsKeepColumnName) { + strcpy(pFunc->node.userAlias, pCol->colName); + } else { + len = snprintf(buf, sizeof(buf), "%s(%s)", pSrcFunc->functionName, pCol->colName); + strncpy(pFunc->node.userAlias, buf, TMIN(len, sizeof(pFunc->node.userAlias) - 1)); + } } else { len = snprintf(buf, sizeof(buf), "%s(%s)", pSrcFunc->functionName, pExpr->aliasName); strncpy(pFunc->node.aliasName, buf, TMIN(len, sizeof(pFunc->node.aliasName) - 1)); @@ -2476,6 +2618,34 @@ static int32_t createMultiResFuncsFromStar(STranslateContext* pCxt, SFunctionNod return code; } +static int32_t createTags(STranslateContext* pCxt, SNodeList** pOutput) { + if (QUERY_NODE_REAL_TABLE != nodeType(((SSelectStmt*)pCxt->pCurrStmt)->pFromTable)) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TAGS_PC, + "The _TAGS pseudo column can only be used for subtable and supertable queries"); + } + + SRealTableNode* pTable = (SRealTableNode*)(((SSelectStmt*)pCxt->pCurrStmt)->pFromTable); + const STableMeta* pMeta = pTable->pMeta; + if (TSDB_SUPER_TABLE != pMeta->tableType && TSDB_CHILD_TABLE != pMeta->tableType) { + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TAGS_PC, + "The _TAGS pseudo column can only be used for subtable and supertable queries"); + } + + SSchema* pTagsSchema = getTableTagSchema(pMeta); + for (int32_t i = 0; i < pMeta->tableInfo.numOfTags; ++i) { + SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); + if (NULL == pCol) { + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_OUT_OF_MEMORY); + } + setColumnInfoBySchema(pTable, pTagsSchema + i, 1, pCol); + if (TSDB_CODE_SUCCESS != nodesListMakeStrictAppend(pOutput, (SNode*)pCol)) { + NODES_DESTORY_LIST(*pOutput); + return TSDB_CODE_OUT_OF_MEMORY; + } + } + return TSDB_CODE_SUCCESS; +} + static int32_t translateStar(STranslateContext* pCxt, SSelectStmt* pSelect) { SNode* pNode = NULL; WHERE_EACH(pNode, pSelect->pProjectionList) { @@ -2489,10 +2659,14 @@ static int32_t translateStar(STranslateContext* pCxt, SSelectStmt* pSelect) { continue; } } else if (isMultiResFunc(pNode)) { - SNodeList* pFuncs = NULL; - code = createMultiResFuncsFromStar(pCxt, (SFunctionNode*)pNode, &pFuncs); + SNodeList* pNodeList = NULL; + if (FUNCTION_TYPE_TAGS == ((SFunctionNode*)pNode)->funcType) { + code = createTags(pCxt, &pNodeList); + } else { + code = createMultiResFuncsFromStar(pCxt, (SFunctionNode*)pNode, &pNodeList); + } if (TSDB_CODE_SUCCESS == code) { - INSERT_LIST(pSelect->pProjectionList, pFuncs); + INSERT_LIST(pSelect->pProjectionList, pNodeList); ERASE_NODE(pSelect->pProjectionList); continue; } @@ -4470,6 +4644,8 @@ static SNode* createTbnameFunction() { return NULL; } strcpy(pFunc->functionName, "tbname"); + strcpy(pFunc->node.aliasName, "tbname"); + strcpy(pFunc->node.userAlias, "tbname"); return (SNode*)pFunc; } @@ -5898,7 +6074,7 @@ static SNode* createProjectCol(const char* pProjCol) { static SNodeList* createProjectCols(int32_t ncols, const char* const pCols[]) { SNodeList* pProjections = NULL; - if (ncols <= 0) { + if (0 == ncols) { nodesListMakeStrictAppend(&pProjections, createStarCol()); return pProjections; } @@ -5930,10 +6106,12 @@ static int32_t createSimpleSelectStmt(const char* pDb, const char* pTable, int32 strcpy(pRealTable->table.tableAlias, pTable); pSelect->pFromTable = (SNode*)pRealTable; - pSelect->pProjectionList = createProjectCols(numOfProjs, pProjCol); - if (NULL == pSelect->pProjectionList) { - nodesDestroyNode((SNode*)pSelect); - return TSDB_CODE_OUT_OF_MEMORY; + if (numOfProjs >= 0) { + pSelect->pProjectionList = createProjectCols(numOfProjs, pProjCol); + if (NULL == pSelect->pProjectionList) { + nodesDestroyNode((SNode*)pSelect); + return TSDB_CODE_OUT_OF_MEMORY; + } } *pStmt = pSelect; @@ -6036,6 +6214,40 @@ static int32_t rewriteShow(STranslateContext* pCxt, SQuery* pQuery) { pQuery->showRewrite = true; nodesDestroyNode(pQuery->pRoot); pQuery->pRoot = (SNode*)pStmt; + } else { + nodesDestroyNode((SNode*)pStmt); + } + return code; +} + +static SNode* createTagsFunction() { + SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); + if (NULL == pFunc) { + return NULL; + } + strcpy(pFunc->functionName, "_tags"); + return (SNode*)pFunc; +} + +static int32_t rewriteShowStableTags(STranslateContext* pCxt, SQuery* pQuery) { + const char* cols[] = {"tbname", "_tags"}; + SShowStmt* pShow = (SShowStmt*)pQuery->pRoot; + SSelectStmt* pSelect = NULL; + int32_t code = createSimpleSelectStmt(((SValueNode*)pShow->pDbName)->literal, ((SValueNode*)pShow->pTbName)->literal, + -1, NULL, &pSelect); + if (TSDB_CODE_SUCCESS == code) { + code = nodesListMakeStrictAppend(&pSelect->pProjectionList, createTbnameFunction()); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodesListMakeStrictAppend(&pSelect->pProjectionList, createTagsFunction()); + } + if (TSDB_CODE_SUCCESS == code) { + pSelect->isDistinct = true; + pQuery->showRewrite = true; + nodesDestroyNode(pQuery->pRoot); + pQuery->pRoot = (SNode*)pSelect; + } else { + nodesDestroyNode((SNode*)pSelect); } return code; } @@ -7173,6 +7385,9 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_SHOW_TAGS_STMT: code = rewriteShow(pCxt, pQuery); break; + case QUERY_NODE_SHOW_TABLE_TAGS_STMT: + code = rewriteShowStableTags(pCxt, pQuery); + break; case QUERY_NODE_SHOW_DNODE_VARIABLES_STMT: code = rewriteShowDnodeVariables(pCxt, pQuery); break; diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 2ccdd2cdf25d7a9fcccd45398c24b35d4445f137..9711aed4ba9ef039d27c4148821763b49b295c63 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,26 +104,26 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 447 +#define YYNOCODE 449 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - int64_t yy57; - EJoinType yy114; - SNodeList* yy148; - int8_t yy167; - int32_t yy172; - bool yy287; - SAlterOption yy323; - EOrder yy362; - SNode* yy392; - SToken yy677; - EFillMode yy708; - EOperatorType yy758; - ENullOrder yy781; - SDataType yy838; + EOrder yy14; + bool yy39; + SToken yy181; + EJoinType yy202; + int32_t yy276; + SNodeList* yy282; + int8_t yy293; + ENullOrder yy305; + SDataType yy380; + EFillMode yy381; + SAlterOption yy645; + EOperatorType yy682; + SNode* yy778; + int64_t yy831; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 689 -#define YYNRULE 518 -#define YYNTOKEN 315 -#define YY_MAX_SHIFT 688 -#define YY_MIN_SHIFTREDUCE 1016 -#define YY_MAX_SHIFTREDUCE 1533 -#define YY_ERROR_ACTION 1534 -#define YY_ACCEPT_ACTION 1535 -#define YY_NO_ACTION 1536 -#define YY_MIN_REDUCE 1537 -#define YY_MAX_REDUCE 2054 +#define YYNSTATE 693 +#define YYNRULE 521 +#define YYNTOKEN 317 +#define YY_MAX_SHIFT 692 +#define YY_MIN_SHIFTREDUCE 1022 +#define YY_MAX_SHIFTREDUCE 1542 +#define YY_ERROR_ACTION 1543 +#define YY_ACCEPT_ACTION 1544 +#define YY_NO_ACTION 1545 +#define YY_MIN_REDUCE 1546 +#define YY_MAX_REDUCE 2066 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,752 +216,791 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2818) +#define YY_ACTTAB_COUNT (2993) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 1858, 1560, 443, 1858, 444, 1572, 451, 1872, 444, 1572, - /* 10 */ 1675, 1854, 44, 42, 1854, 351, 13, 12, 1729, 1731, - /* 20 */ 346, 1854, 1316, 43, 41, 40, 39, 38, 1342, 2030, - /* 30 */ 155, 77, 1549, 1394, 1049, 1314, 1890, 1850, 1856, 334, - /* 40 */ 1850, 1856, 340, 1840, 582, 125, 1343, 1850, 1856, 1840, - /* 50 */ 588, 594, 30, 588, 1679, 542, 1389, 1929, 37, 36, - /* 60 */ 588, 17, 43, 41, 40, 39, 38, 1872, 1322, 44, - /* 70 */ 42, 1464, 1870, 581, 1053, 1054, 1904, 346, 566, 1316, - /* 80 */ 97, 1871, 1873, 598, 1875, 1876, 593, 1066, 588, 1065, - /* 90 */ 1394, 62, 1314, 167, 1, 1957, 1890, 34, 265, 339, - /* 100 */ 1953, 166, 479, 581, 595, 578, 1341, 2025, 1736, 1840, - /* 110 */ 1437, 594, 172, 1389, 1723, 333, 685, 1067, 17, 527, - /* 120 */ 1983, 1523, 565, 170, 1734, 1322, 331, 2026, 567, 1784, - /* 130 */ 1396, 1397, 596, 460, 132, 179, 1904, 1538, 1211, 1212, - /* 140 */ 98, 345, 1873, 598, 1875, 1876, 593, 46, 588, 1890, - /* 150 */ 442, 1, 1066, 446, 1065, 1957, 58, 560, 109, 312, - /* 160 */ 1953, 108, 107, 106, 105, 104, 103, 102, 101, 100, - /* 170 */ 2025, 130, 74, 685, 1972, 73, 1317, 46, 1315, 47, - /* 180 */ 58, 58, 1067, 7, 1559, 565, 170, 1396, 1397, 264, - /* 190 */ 2026, 567, 580, 168, 1965, 1966, 559, 1970, 1730, 1731, - /* 200 */ 1320, 1321, 1969, 1371, 1372, 1374, 1375, 1376, 1377, 1378, - /* 210 */ 1379, 590, 586, 1387, 1388, 1390, 1391, 1392, 1393, 1395, - /* 220 */ 1398, 3, 203, 1537, 37, 36, 1840, 581, 43, 41, - /* 230 */ 40, 39, 38, 1317, 1342, 1315, 160, 231, 232, 173, - /* 240 */ 1468, 477, 473, 469, 465, 202, 1341, 118, 117, 116, - /* 250 */ 115, 114, 113, 112, 111, 110, 391, 1320, 1321, 26, - /* 260 */ 1371, 1372, 1374, 1375, 1376, 1377, 1378, 1379, 590, 586, - /* 270 */ 1387, 1388, 1390, 1391, 1392, 1393, 1395, 1398, 3, 44, - /* 280 */ 42, 485, 78, 77, 1859, 200, 58, 346, 1558, 1316, - /* 290 */ 450, 1490, 173, 446, 308, 1854, 310, 629, 578, 530, - /* 300 */ 1394, 173, 1314, 484, 109, 217, 1680, 108, 107, 106, - /* 310 */ 105, 104, 103, 102, 101, 100, 144, 143, 626, 625, - /* 320 */ 624, 1850, 1856, 1389, 173, 173, 173, 132, 17, 2030, - /* 330 */ 1840, 1872, 225, 1341, 588, 1322, 44, 42, 1736, 553, - /* 340 */ 1488, 1489, 1491, 1492, 346, 350, 1316, 578, 199, 193, - /* 350 */ 448, 198, 561, 1557, 1734, 456, 1339, 1394, 2025, 1314, - /* 360 */ 1890, 1, 79, 310, 130, 540, 530, 384, 582, 383, - /* 370 */ 58, 191, 81, 1840, 2029, 594, 132, 119, 2026, 2028, - /* 380 */ 1389, 380, 1457, 685, 481, 17, 169, 1965, 1966, 142, - /* 390 */ 1970, 1662, 1322, 1404, 1684, 1840, 1870, 1396, 1397, 1341, - /* 400 */ 1904, 382, 378, 1316, 97, 1871, 1873, 598, 1875, 1876, - /* 410 */ 593, 1556, 588, 121, 631, 556, 1314, 167, 1, 1957, - /* 420 */ 623, 37, 36, 339, 1953, 43, 41, 40, 39, 38, - /* 430 */ 1373, 173, 11, 1344, 9, 262, 1965, 577, 428, 576, - /* 440 */ 685, 51, 2025, 1317, 1984, 1315, 1661, 218, 349, 1322, - /* 450 */ 1714, 460, 332, 1840, 1396, 1397, 153, 565, 170, 1659, - /* 460 */ 153, 1555, 2026, 567, 544, 1686, 1929, 1320, 1321, 1686, - /* 470 */ 1371, 1372, 1374, 1375, 1376, 1377, 1378, 1379, 590, 586, - /* 480 */ 1387, 1388, 1390, 1391, 1392, 1393, 1395, 1398, 3, 230, - /* 490 */ 11, 40, 39, 38, 183, 182, 1340, 685, 562, 557, - /* 500 */ 1317, 322, 1315, 1840, 1169, 620, 619, 618, 1173, 617, - /* 510 */ 1175, 1176, 616, 1178, 613, 173, 1184, 610, 1186, 1187, - /* 520 */ 607, 604, 1129, 1787, 1320, 1321, 1554, 1371, 1372, 1374, - /* 530 */ 1375, 1376, 1377, 1378, 1379, 590, 586, 1387, 1388, 1390, - /* 540 */ 1391, 1392, 1393, 1395, 1398, 3, 44, 42, 540, 1294, - /* 550 */ 1295, 2030, 629, 11, 346, 1131, 1316, 1317, 1322, 1315, - /* 560 */ 52, 323, 1343, 321, 320, 629, 483, 1394, 1840, 1314, - /* 570 */ 485, 144, 143, 626, 625, 624, 241, 1684, 507, 1872, - /* 580 */ 2025, 1320, 1321, 1373, 144, 143, 626, 625, 624, 352, - /* 590 */ 1389, 505, 484, 503, 158, 1341, 2029, 153, 1872, 1641, - /* 600 */ 2026, 2027, 1322, 44, 42, 1399, 1686, 540, 1890, 1660, - /* 610 */ 1783, 346, 305, 1316, 643, 94, 595, 490, 489, 175, - /* 620 */ 1553, 1840, 540, 594, 1394, 1736, 1314, 1890, 8, 127, - /* 630 */ 656, 654, 317, 1425, 389, 595, 1684, 1676, 1552, 1551, - /* 640 */ 1840, 1734, 594, 128, 596, 1548, 1928, 1389, 1904, 540, - /* 650 */ 685, 1684, 292, 345, 1873, 598, 1875, 1876, 593, 1322, - /* 660 */ 588, 119, 1840, 1870, 1396, 1397, 1547, 1904, 486, 631, - /* 670 */ 566, 97, 1871, 1873, 598, 1875, 1876, 593, 1684, 588, - /* 680 */ 1840, 1840, 2025, 1546, 2045, 8, 1957, 1840, 37, 36, - /* 690 */ 339, 1953, 43, 41, 40, 39, 38, 565, 170, 2025, - /* 700 */ 1991, 31, 2026, 567, 540, 264, 1344, 685, 1840, 153, - /* 710 */ 1317, 1430, 1315, 570, 565, 170, 390, 32, 1687, 2026, - /* 720 */ 567, 1396, 1397, 37, 36, 1840, 1461, 43, 41, 40, - /* 730 */ 39, 38, 1545, 1684, 1320, 1321, 1544, 1371, 1372, 1374, - /* 740 */ 1375, 1376, 1377, 1378, 1379, 590, 586, 1387, 1388, 1390, - /* 750 */ 1391, 1392, 1393, 1395, 1398, 3, 540, 37, 36, 1972, - /* 760 */ 1535, 43, 41, 40, 39, 38, 518, 1317, 398, 1315, - /* 770 */ 1782, 87, 305, 173, 1840, 1500, 37, 36, 1840, 1373, - /* 780 */ 43, 41, 40, 39, 38, 1684, 1543, 1968, 1542, 1972, - /* 790 */ 1541, 1320, 1321, 1677, 1371, 1372, 1374, 1375, 1376, 1377, - /* 800 */ 1378, 1379, 590, 586, 1387, 1388, 1390, 1391, 1392, 1393, - /* 810 */ 1395, 1398, 3, 44, 42, 1777, 498, 1967, 1053, 1054, - /* 820 */ 361, 346, 1777, 1316, 1977, 1457, 178, 540, 1840, 540, - /* 830 */ 1840, 508, 1840, 181, 1394, 540, 1314, 523, 540, 413, - /* 840 */ 2029, 414, 527, 540, 1480, 216, 1872, 458, 540, 240, - /* 850 */ 459, 627, 1785, 1325, 1727, 1681, 1684, 1389, 1684, 501, - /* 860 */ 136, 1540, 1673, 495, 1684, 1872, 2025, 1684, 215, 1322, - /* 870 */ 44, 42, 1684, 1736, 1550, 1890, 628, 1684, 346, 1727, - /* 880 */ 1316, 2031, 170, 595, 540, 45, 2026, 567, 1840, 1735, - /* 890 */ 594, 1394, 2030, 1314, 1890, 8, 519, 644, 1827, 1654, - /* 900 */ 540, 1669, 595, 1840, 540, 64, 540, 1840, 63, 594, - /* 910 */ 573, 1870, 524, 1684, 1389, 1904, 235, 685, 536, 156, - /* 920 */ 1871, 1873, 598, 1875, 1876, 593, 1322, 588, 571, 1684, - /* 930 */ 1870, 1396, 1397, 1684, 1904, 1684, 1530, 1265, 97, 1871, - /* 940 */ 1873, 598, 1875, 1876, 593, 368, 588, 493, 492, 48, - /* 950 */ 4, 2045, 1, 1957, 126, 392, 277, 339, 1953, 1714, - /* 960 */ 545, 1994, 1460, 1589, 1642, 488, 491, 2019, 393, 540, - /* 970 */ 208, 487, 210, 206, 685, 209, 585, 1317, 385, 1315, - /* 980 */ 526, 538, 50, 522, 1523, 494, 37, 36, 1396, 1397, - /* 990 */ 43, 41, 40, 39, 38, 523, 1328, 523, 1684, 1532, - /* 1000 */ 1533, 1320, 1321, 1671, 1371, 1372, 1374, 1375, 1376, 1377, - /* 1010 */ 1378, 1379, 590, 586, 1387, 1388, 1390, 1391, 1392, 1393, - /* 1020 */ 1395, 1398, 3, 307, 2025, 1339, 2025, 1584, 1582, 1529, - /* 1030 */ 212, 540, 421, 211, 1317, 433, 1315, 13, 12, 2031, - /* 1040 */ 170, 2031, 170, 539, 2026, 567, 2026, 567, 214, 496, - /* 1050 */ 499, 213, 406, 229, 434, 224, 408, 1667, 1320, 1321, - /* 1060 */ 1684, 1371, 1372, 1374, 1375, 1376, 1377, 1378, 1379, 590, - /* 1070 */ 586, 1387, 1388, 1390, 1391, 1392, 1393, 1395, 1398, 3, - /* 1080 */ 37, 36, 60, 137, 43, 41, 40, 39, 38, 154, - /* 1090 */ 540, 540, 637, 569, 283, 80, 93, 1997, 399, 221, - /* 1100 */ 638, 589, 266, 353, 1324, 233, 90, 141, 281, 66, - /* 1110 */ 395, 1599, 65, 259, 1113, 1415, 142, 622, 60, 1684, - /* 1120 */ 1684, 245, 1111, 1861, 554, 478, 253, 574, 187, 439, - /* 1130 */ 437, 1891, 357, 1573, 1431, 533, 1724, 1987, 432, 1093, - /* 1140 */ 578, 427, 426, 425, 424, 423, 420, 419, 418, 417, - /* 1150 */ 416, 412, 411, 410, 409, 403, 402, 401, 400, 237, - /* 1160 */ 397, 396, 319, 45, 45, 58, 261, 602, 1162, 132, - /* 1170 */ 1487, 1863, 1094, 248, 662, 661, 660, 659, 356, 141, - /* 1180 */ 658, 657, 133, 652, 651, 650, 649, 648, 647, 646, - /* 1190 */ 645, 146, 641, 640, 639, 355, 354, 636, 635, 634, - /* 1200 */ 633, 632, 142, 96, 37, 36, 130, 1578, 43, 41, - /* 1210 */ 40, 39, 38, 122, 1872, 1380, 276, 2, 579, 1190, - /* 1220 */ 141, 258, 5, 362, 318, 367, 1281, 273, 171, 1965, - /* 1230 */ 1966, 1194, 1970, 180, 1339, 152, 415, 394, 1779, 71, - /* 1240 */ 70, 388, 422, 1890, 177, 429, 430, 1327, 435, 436, - /* 1250 */ 431, 595, 184, 438, 1201, 680, 1840, 313, 594, 359, - /* 1260 */ 440, 306, 1345, 441, 376, 1199, 374, 370, 366, 363, - /* 1270 */ 360, 449, 145, 1347, 452, 190, 523, 192, 453, 1870, - /* 1280 */ 1346, 1348, 454, 1904, 195, 455, 1872, 97, 1871, 1873, - /* 1290 */ 598, 1875, 1876, 593, 457, 588, 197, 75, 129, 1423, - /* 1300 */ 140, 1928, 1957, 76, 201, 2025, 339, 1953, 1872, 461, - /* 1310 */ 173, 480, 482, 120, 309, 1890, 1674, 205, 1670, 207, - /* 1320 */ 2031, 170, 147, 595, 148, 2026, 567, 1602, 1840, 1672, - /* 1330 */ 594, 1668, 149, 150, 510, 512, 1818, 1890, 274, 219, - /* 1340 */ 514, 513, 517, 222, 520, 595, 525, 226, 552, 528, - /* 1350 */ 1840, 1870, 594, 328, 1424, 1904, 1817, 1789, 138, 97, - /* 1360 */ 1871, 1873, 598, 1875, 1876, 593, 531, 588, 139, 330, - /* 1370 */ 534, 535, 2045, 1870, 1957, 1872, 84, 1904, 339, 1953, - /* 1380 */ 275, 97, 1871, 1873, 598, 1875, 1876, 593, 1976, 588, - /* 1390 */ 86, 493, 492, 1685, 1932, 1344, 1957, 1988, 126, 555, - /* 1400 */ 339, 1953, 1998, 548, 1890, 243, 550, 551, 6, 488, - /* 1410 */ 491, 335, 595, 558, 247, 487, 358, 1840, 564, 594, - /* 1420 */ 2003, 252, 33, 343, 1418, 1419, 1420, 1421, 1422, 1426, - /* 1430 */ 1427, 1428, 1429, 523, 1979, 2002, 549, 547, 336, 254, - /* 1440 */ 1870, 161, 255, 546, 1904, 256, 257, 1872, 97, 1871, - /* 1450 */ 1873, 598, 1875, 1876, 593, 260, 588, 575, 1457, 572, - /* 1460 */ 131, 1930, 2025, 1957, 2024, 1343, 57, 339, 1953, 2048, - /* 1470 */ 1973, 688, 1938, 88, 600, 1728, 1890, 2031, 170, 1655, - /* 1480 */ 278, 269, 2026, 567, 595, 272, 681, 682, 684, 1840, - /* 1490 */ 49, 594, 304, 280, 1834, 282, 1833, 68, 290, 164, - /* 1500 */ 1832, 1831, 301, 300, 678, 674, 670, 666, 270, 69, - /* 1510 */ 1828, 364, 1870, 365, 1308, 1309, 1904, 176, 369, 1826, - /* 1520 */ 97, 1871, 1873, 598, 1875, 1876, 593, 371, 588, 1872, - /* 1530 */ 372, 373, 1825, 543, 375, 1957, 342, 341, 377, 339, - /* 1540 */ 1953, 1824, 1823, 1822, 379, 95, 1330, 381, 238, 1284, - /* 1550 */ 1283, 1800, 1799, 386, 387, 1798, 1797, 1394, 1890, 1323, - /* 1560 */ 1253, 1772, 1771, 1770, 1769, 134, 595, 1768, 1767, 511, - /* 1570 */ 72, 1840, 1766, 594, 1765, 1764, 1763, 1762, 404, 405, - /* 1580 */ 1389, 537, 1761, 1872, 407, 1760, 523, 1759, 1758, 1757, - /* 1590 */ 1756, 1755, 1322, 1255, 1870, 1754, 1753, 1752, 1904, 1751, - /* 1600 */ 1750, 1749, 98, 1871, 1873, 598, 1875, 1876, 593, 1872, - /* 1610 */ 588, 1748, 1890, 1747, 227, 2025, 1746, 1957, 1745, 1744, - /* 1620 */ 595, 1956, 1953, 135, 1743, 1840, 1742, 594, 1741, 1740, - /* 1630 */ 2031, 170, 1288, 1739, 220, 2026, 567, 1738, 1890, 1737, - /* 1640 */ 584, 1137, 1604, 1603, 1601, 1569, 592, 188, 1870, 1056, - /* 1650 */ 185, 1840, 1904, 594, 186, 165, 98, 1871, 1873, 598, - /* 1660 */ 1875, 1876, 593, 445, 588, 1055, 123, 447, 1568, 1813, - /* 1670 */ 189, 1957, 1807, 124, 1870, 583, 1953, 1796, 1904, 1872, - /* 1680 */ 194, 1795, 298, 1871, 1873, 598, 1875, 1876, 593, 591, - /* 1690 */ 588, 541, 1922, 196, 1781, 1663, 1600, 1598, 1086, 462, - /* 1700 */ 1331, 463, 1326, 1596, 464, 466, 467, 1594, 1890, 470, - /* 1710 */ 468, 1592, 472, 471, 474, 476, 595, 1581, 1580, 1565, - /* 1720 */ 1665, 1840, 475, 594, 1334, 1336, 59, 1205, 1204, 1664, - /* 1730 */ 653, 655, 204, 1128, 1127, 1124, 586, 1387, 1388, 1390, - /* 1740 */ 1391, 1392, 1393, 1872, 1870, 1123, 1122, 1590, 1904, 324, - /* 1750 */ 1585, 497, 157, 1871, 1873, 598, 1875, 1876, 593, 325, - /* 1760 */ 588, 1583, 326, 500, 1564, 502, 1563, 504, 1562, 1872, - /* 1770 */ 506, 99, 1890, 1300, 1812, 1806, 25, 53, 1290, 515, - /* 1780 */ 595, 151, 223, 516, 1794, 1840, 1872, 594, 1792, 2030, - /* 1790 */ 521, 1793, 1791, 1790, 1298, 327, 228, 529, 1890, 18, - /* 1800 */ 1788, 532, 234, 329, 568, 2046, 595, 82, 1870, 1780, - /* 1810 */ 83, 1840, 1904, 594, 236, 1890, 98, 1871, 1873, 598, - /* 1820 */ 1875, 1876, 593, 592, 588, 85, 90, 239, 1840, 1406, - /* 1830 */ 594, 1957, 19, 20, 1870, 15, 1954, 1405, 1904, 1872, - /* 1840 */ 27, 56, 299, 1871, 1873, 598, 1875, 1876, 593, 1502, - /* 1850 */ 588, 1870, 242, 250, 246, 1904, 1872, 244, 1484, 298, - /* 1860 */ 1871, 1873, 598, 1875, 1876, 593, 159, 588, 1890, 1923, - /* 1870 */ 10, 1486, 249, 28, 251, 1479, 595, 1861, 29, 89, - /* 1880 */ 61, 1840, 1522, 594, 22, 1890, 1517, 1516, 337, 1523, - /* 1890 */ 21, 16, 1521, 595, 1520, 338, 1454, 1453, 1840, 54, - /* 1900 */ 594, 263, 1860, 1332, 1870, 55, 1907, 162, 1904, 1416, - /* 1910 */ 12, 1872, 156, 1871, 1873, 598, 1875, 1876, 593, 1384, - /* 1920 */ 588, 1870, 1382, 587, 35, 1904, 163, 1381, 1872, 294, - /* 1930 */ 1871, 1873, 598, 1875, 1876, 593, 14, 588, 23, 174, - /* 1940 */ 1890, 1356, 1364, 24, 597, 599, 601, 348, 595, 1191, - /* 1950 */ 605, 608, 603, 1840, 1995, 594, 611, 1890, 1188, 606, - /* 1960 */ 614, 1185, 344, 609, 612, 595, 1179, 1177, 615, 1168, - /* 1970 */ 1840, 1200, 594, 563, 621, 267, 1870, 91, 92, 1872, - /* 1980 */ 1904, 67, 1183, 1196, 157, 1871, 1873, 598, 1875, 1876, - /* 1990 */ 593, 1182, 588, 1870, 1181, 1084, 1180, 1904, 1872, 630, - /* 2000 */ 1119, 299, 1871, 1873, 598, 1875, 1876, 593, 1890, 588, - /* 2010 */ 1118, 1117, 1116, 347, 1115, 1114, 595, 1112, 1110, 1109, - /* 2020 */ 1108, 1840, 642, 594, 1135, 1106, 1105, 1890, 1104, 268, - /* 2030 */ 1103, 1102, 1101, 1100, 1099, 595, 1132, 2047, 1130, 1096, - /* 2040 */ 1840, 1090, 594, 1095, 1870, 1092, 1091, 1089, 1904, 1597, - /* 2050 */ 663, 1595, 299, 1871, 1873, 598, 1875, 1876, 593, 1872, - /* 2060 */ 588, 665, 667, 509, 664, 668, 1593, 1904, 669, 671, - /* 2070 */ 672, 292, 1871, 1873, 598, 1875, 1876, 593, 673, 588, - /* 2080 */ 1591, 675, 676, 677, 1579, 679, 1561, 1046, 1890, 271, - /* 2090 */ 683, 1536, 1318, 279, 686, 687, 595, 1536, 1536, 1536, - /* 2100 */ 1536, 1840, 1536, 594, 1536, 1536, 1536, 1536, 1536, 1536, - /* 2110 */ 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1872, 1536, 1536, - /* 2120 */ 1536, 1536, 1536, 1536, 1870, 1536, 1536, 1536, 1904, 1536, - /* 2130 */ 1536, 1536, 284, 1871, 1873, 598, 1875, 1876, 593, 1872, - /* 2140 */ 588, 1536, 1536, 1536, 1536, 1536, 1890, 1536, 1536, 1536, - /* 2150 */ 1536, 1536, 1536, 1536, 595, 1536, 1536, 1536, 1536, 1840, - /* 2160 */ 1536, 594, 1536, 1536, 1536, 1536, 1536, 1536, 1890, 1536, - /* 2170 */ 1536, 1536, 1536, 1536, 1536, 1536, 595, 1536, 1536, 1536, - /* 2180 */ 1536, 1840, 1870, 594, 1536, 1536, 1904, 1536, 1536, 1536, - /* 2190 */ 285, 1871, 1873, 598, 1875, 1876, 593, 1536, 588, 1536, - /* 2200 */ 1872, 1536, 1536, 1536, 1870, 1536, 1536, 1536, 1904, 1536, - /* 2210 */ 1536, 1536, 286, 1871, 1873, 598, 1875, 1876, 593, 1872, - /* 2220 */ 588, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1890, - /* 2230 */ 1536, 1536, 1536, 1536, 1536, 1536, 1536, 595, 1536, 1536, - /* 2240 */ 1536, 1536, 1840, 1536, 594, 1536, 1536, 1536, 1890, 1536, - /* 2250 */ 1536, 1536, 1536, 1536, 1536, 1536, 595, 1536, 1536, 1536, - /* 2260 */ 1536, 1840, 1536, 594, 1536, 1870, 1536, 1536, 1536, 1904, - /* 2270 */ 1536, 1536, 1872, 293, 1871, 1873, 598, 1875, 1876, 593, - /* 2280 */ 1536, 588, 1536, 1536, 1870, 1536, 1536, 1536, 1904, 1872, - /* 2290 */ 1536, 1536, 295, 1871, 1873, 598, 1875, 1876, 593, 1536, - /* 2300 */ 588, 1890, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 595, - /* 2310 */ 1536, 1536, 1536, 1536, 1840, 1536, 594, 1536, 1890, 1536, - /* 2320 */ 1536, 1536, 1536, 1536, 1536, 1536, 595, 1536, 1536, 1536, - /* 2330 */ 1536, 1840, 1872, 594, 1536, 1536, 1536, 1870, 1536, 1536, - /* 2340 */ 1536, 1904, 1536, 1536, 1536, 287, 1871, 1873, 598, 1875, - /* 2350 */ 1876, 593, 1536, 588, 1870, 1536, 1872, 1536, 1904, 1536, - /* 2360 */ 1536, 1890, 296, 1871, 1873, 598, 1875, 1876, 593, 595, - /* 2370 */ 588, 1536, 1536, 1536, 1840, 1872, 594, 1536, 1536, 1536, - /* 2380 */ 1536, 1536, 1536, 1536, 1536, 1890, 1536, 1536, 1536, 1536, - /* 2390 */ 1536, 1536, 1536, 595, 1536, 1536, 1536, 1870, 1840, 1536, - /* 2400 */ 594, 1904, 1536, 1536, 1890, 288, 1871, 1873, 598, 1875, - /* 2410 */ 1876, 593, 595, 588, 1536, 1536, 1536, 1840, 1536, 594, - /* 2420 */ 1536, 1870, 1536, 1536, 1536, 1904, 1536, 1536, 1536, 297, - /* 2430 */ 1871, 1873, 598, 1875, 1876, 593, 1872, 588, 1536, 1536, - /* 2440 */ 1870, 1536, 1536, 1536, 1904, 1536, 1536, 1536, 289, 1871, - /* 2450 */ 1873, 598, 1875, 1876, 593, 1872, 588, 1536, 1536, 1536, - /* 2460 */ 1536, 1536, 1536, 1536, 1536, 1890, 1536, 1536, 1536, 1536, - /* 2470 */ 1536, 1536, 1536, 595, 1536, 1536, 1536, 1536, 1840, 1536, - /* 2480 */ 594, 1536, 1536, 1536, 1890, 1536, 1536, 1536, 1536, 1536, - /* 2490 */ 1536, 1536, 595, 1536, 1536, 1536, 1536, 1840, 1536, 594, - /* 2500 */ 1536, 1870, 1536, 1536, 1536, 1904, 1536, 1536, 1536, 302, - /* 2510 */ 1871, 1873, 598, 1875, 1876, 593, 1536, 588, 1536, 1872, - /* 2520 */ 1870, 1536, 1536, 1536, 1904, 1536, 1536, 1536, 303, 1871, - /* 2530 */ 1873, 598, 1875, 1876, 593, 1536, 588, 1872, 1536, 1536, - /* 2540 */ 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1890, 1536, - /* 2550 */ 1536, 1536, 1536, 1536, 1536, 1536, 595, 1536, 1536, 1536, - /* 2560 */ 1536, 1840, 1536, 594, 1536, 1536, 1890, 1536, 1536, 1536, - /* 2570 */ 1536, 1536, 1536, 1536, 595, 1536, 1536, 1536, 1536, 1840, - /* 2580 */ 1872, 594, 1536, 1536, 1870, 1536, 1536, 1536, 1904, 1536, - /* 2590 */ 1536, 1536, 1884, 1871, 1873, 598, 1875, 1876, 593, 1536, - /* 2600 */ 588, 1536, 1870, 1536, 1536, 1536, 1904, 1536, 1536, 1890, - /* 2610 */ 1883, 1871, 1873, 598, 1875, 1876, 593, 595, 588, 1536, - /* 2620 */ 1536, 1536, 1840, 1536, 594, 1536, 1536, 1536, 1536, 1536, - /* 2630 */ 1536, 1536, 1536, 1872, 1536, 1536, 1536, 1536, 1536, 1536, - /* 2640 */ 1536, 1536, 1536, 1536, 1536, 1870, 1536, 1536, 1536, 1904, - /* 2650 */ 1872, 1536, 1536, 1882, 1871, 1873, 598, 1875, 1876, 593, - /* 2660 */ 1536, 588, 1890, 1536, 1536, 1536, 1536, 1536, 1536, 1536, - /* 2670 */ 595, 1536, 1536, 1536, 1536, 1840, 1536, 594, 1536, 1890, - /* 2680 */ 1536, 1536, 1536, 1536, 1536, 1536, 1536, 595, 1536, 1536, - /* 2690 */ 1536, 1536, 1840, 1872, 594, 1536, 1536, 1536, 1870, 1536, - /* 2700 */ 1536, 1536, 1904, 1536, 1536, 1536, 314, 1871, 1873, 598, - /* 2710 */ 1875, 1876, 593, 1536, 588, 1870, 1536, 1872, 1536, 1904, - /* 2720 */ 1536, 1536, 1890, 315, 1871, 1873, 598, 1875, 1876, 593, - /* 2730 */ 595, 588, 1536, 1536, 1536, 1840, 1872, 594, 1536, 1536, - /* 2740 */ 1536, 1536, 1536, 1536, 1536, 1536, 1890, 1536, 1536, 1536, - /* 2750 */ 1536, 1536, 1536, 1536, 595, 1536, 1536, 1536, 1870, 1840, - /* 2760 */ 1536, 594, 1904, 1536, 1536, 1890, 311, 1871, 1873, 598, - /* 2770 */ 1875, 1876, 593, 595, 588, 1536, 1536, 1536, 1840, 1536, - /* 2780 */ 594, 1536, 1870, 1536, 1536, 1536, 1904, 1536, 1536, 1536, - /* 2790 */ 316, 1871, 1873, 598, 1875, 1876, 593, 1536, 588, 1536, - /* 2800 */ 1536, 1870, 1536, 1536, 1536, 1904, 1536, 1536, 1536, 291, - /* 2810 */ 1871, 1873, 598, 1875, 1876, 593, 1536, 588, + /* 0 */ 1868, 1797, 447, 1868, 448, 1581, 455, 1882, 448, 1581, + /* 10 */ 1684, 1864, 44, 42, 1864, 354, 544, 394, 1738, 1740, + /* 20 */ 349, 1864, 1323, 43, 41, 40, 39, 38, 52, 2042, + /* 30 */ 34, 267, 585, 1403, 1348, 1321, 1900, 1860, 1866, 337, + /* 40 */ 1860, 1866, 343, 1349, 586, 1693, 1350, 1860, 1866, 1850, + /* 50 */ 592, 598, 30, 592, 1671, 310, 1398, 1055, 37, 36, + /* 60 */ 592, 17, 43, 41, 40, 39, 38, 1882, 1329, 44, + /* 70 */ 42, 1473, 1880, 40, 39, 38, 1916, 349, 570, 1323, + /* 80 */ 97, 1881, 1883, 602, 1885, 1886, 597, 1072, 592, 1071, + /* 90 */ 1403, 62, 1321, 168, 1, 1969, 1900, 1059, 1060, 342, + /* 100 */ 1965, 77, 483, 464, 599, 582, 46, 2037, 58, 1850, + /* 110 */ 585, 598, 173, 1398, 464, 125, 689, 1073, 17, 531, + /* 120 */ 1995, 1532, 569, 171, 1688, 1329, 334, 2038, 571, 1794, + /* 130 */ 1405, 1406, 600, 585, 132, 181, 1916, 1547, 154, 227, + /* 140 */ 98, 348, 1883, 602, 1885, 1886, 597, 1696, 592, 1900, + /* 150 */ 1072, 1, 1071, 1217, 1218, 1969, 58, 564, 109, 314, + /* 160 */ 1965, 108, 107, 106, 105, 104, 103, 102, 101, 100, + /* 170 */ 2037, 130, 74, 689, 58, 73, 1324, 58, 1322, 81, + /* 180 */ 1073, 58, 1669, 1569, 46, 569, 171, 1405, 1406, 266, + /* 190 */ 2038, 571, 584, 169, 1977, 1978, 563, 1982, 1739, 1740, + /* 200 */ 1327, 1328, 635, 1378, 1379, 1381, 1382, 1383, 1384, 1385, + /* 210 */ 1386, 1387, 1388, 594, 590, 1396, 1397, 1399, 1400, 1401, + /* 220 */ 1402, 1404, 1407, 3, 205, 1850, 233, 234, 1349, 633, + /* 230 */ 582, 159, 325, 1324, 1477, 1322, 1650, 387, 161, 386, + /* 240 */ 1348, 174, 635, 481, 477, 473, 469, 204, 145, 144, + /* 250 */ 630, 629, 628, 174, 156, 174, 1558, 1327, 1328, 132, + /* 260 */ 1378, 1379, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, + /* 270 */ 594, 590, 1396, 1397, 1399, 1400, 1401, 1402, 1404, 1407, + /* 280 */ 3, 44, 42, 219, 78, 312, 167, 202, 534, 349, + /* 290 */ 335, 1323, 326, 1568, 324, 323, 130, 487, 154, 1732, + /* 300 */ 582, 489, 1403, 174, 1321, 1567, 109, 1695, 1348, 108, + /* 310 */ 107, 106, 105, 104, 103, 102, 101, 100, 170, 1977, + /* 320 */ 1978, 174, 1982, 488, 174, 1398, 565, 1745, 174, 132, + /* 330 */ 17, 1869, 560, 1882, 336, 1850, 232, 1329, 44, 42, + /* 340 */ 79, 312, 1864, 1743, 534, 1787, 349, 1850, 1323, 582, + /* 350 */ 201, 195, 47, 200, 452, 544, 179, 460, 94, 1403, + /* 360 */ 1346, 1321, 1900, 1, 544, 1413, 130, 119, 1860, 1866, + /* 370 */ 586, 1348, 127, 193, 485, 1850, 119, 598, 132, 1745, + /* 380 */ 1685, 592, 1398, 490, 1693, 689, 353, 17, 172, 1977, + /* 390 */ 1978, 395, 1982, 1693, 1329, 1743, 1301, 1302, 1880, 1405, + /* 400 */ 1406, 1499, 1916, 1546, 396, 352, 97, 1881, 1883, 602, + /* 410 */ 1885, 1886, 597, 154, 592, 121, 1135, 566, 561, 168, + /* 420 */ 1, 1969, 1695, 1434, 1380, 342, 1965, 118, 117, 116, + /* 430 */ 115, 114, 113, 112, 111, 110, 2042, 264, 1977, 581, + /* 440 */ 432, 580, 689, 77, 2037, 1324, 1996, 1322, 511, 1137, + /* 450 */ 355, 557, 1497, 1498, 1500, 1501, 1405, 1406, 154, 569, + /* 460 */ 171, 509, 1350, 507, 2038, 571, 1689, 1695, 1347, 1327, + /* 470 */ 1328, 1670, 1378, 1379, 1381, 1382, 1383, 1384, 1385, 1386, + /* 480 */ 1387, 1388, 594, 590, 1396, 1397, 1399, 1400, 1401, 1402, + /* 490 */ 1404, 1407, 3, 31, 11, 446, 185, 184, 450, 174, + /* 500 */ 494, 493, 1324, 1439, 1322, 1329, 1175, 624, 623, 622, + /* 510 */ 1179, 621, 1181, 1182, 620, 1184, 617, 1566, 1190, 614, + /* 520 */ 1192, 1193, 611, 608, 1984, 2042, 1327, 1328, 1532, 1378, + /* 530 */ 1379, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 594, + /* 540 */ 590, 1396, 1397, 1399, 1400, 1401, 1402, 1404, 1407, 3, + /* 550 */ 44, 42, 1981, 544, 2037, 1380, 660, 658, 349, 1850, + /* 560 */ 1323, 11, 1332, 9, 544, 176, 544, 627, 1565, 454, + /* 570 */ 2041, 1403, 450, 1321, 2038, 2040, 392, 633, 393, 1564, + /* 580 */ 37, 36, 1693, 1882, 43, 41, 40, 39, 38, 544, + /* 590 */ 13, 12, 1351, 1693, 1398, 1693, 145, 144, 630, 629, + /* 600 */ 628, 403, 1882, 1668, 544, 266, 1329, 44, 42, 1408, + /* 610 */ 1850, 544, 1900, 1563, 544, 349, 417, 1323, 1693, 1984, + /* 620 */ 599, 1850, 1745, 418, 1562, 1850, 462, 598, 1403, 1745, + /* 630 */ 1321, 1900, 8, 1693, 11, 546, 319, 1941, 1744, 599, + /* 640 */ 1693, 544, 226, 1693, 1850, 1743, 598, 1980, 600, 1561, + /* 650 */ 87, 1398, 1916, 463, 689, 1850, 294, 348, 1883, 602, + /* 660 */ 1885, 1886, 597, 1329, 592, 647, 1850, 1880, 1405, 1406, + /* 670 */ 1693, 1916, 1686, 1560, 570, 97, 1881, 1883, 602, 1885, + /* 680 */ 1886, 597, 80, 592, 1446, 1793, 2037, 307, 2057, 8, + /* 690 */ 1969, 1850, 37, 36, 342, 1965, 43, 41, 40, 39, + /* 700 */ 38, 569, 171, 2037, 2003, 1335, 2038, 571, 544, 633, + /* 710 */ 548, 689, 1941, 383, 1324, 1850, 1322, 1544, 569, 171, + /* 720 */ 356, 1059, 1060, 2038, 571, 1405, 1406, 26, 145, 144, + /* 730 */ 630, 629, 628, 385, 381, 243, 1557, 1693, 1327, 1328, + /* 740 */ 1682, 1378, 1379, 1381, 1382, 1383, 1384, 1385, 1386, 1387, + /* 750 */ 1388, 594, 590, 1396, 1397, 1399, 1400, 1401, 1402, 1404, + /* 760 */ 1407, 3, 37, 36, 544, 1678, 43, 41, 40, 39, + /* 770 */ 38, 1324, 220, 1322, 1787, 1723, 1690, 364, 1850, 174, + /* 780 */ 2041, 1351, 37, 36, 1556, 180, 43, 41, 40, 39, + /* 790 */ 38, 1611, 1555, 1693, 527, 1327, 1328, 7, 1378, 1379, + /* 800 */ 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 594, 590, + /* 810 */ 1396, 1397, 1399, 1400, 1401, 1402, 1404, 1407, 3, 44, + /* 820 */ 42, 544, 1323, 2037, 1554, 1553, 1850, 349, 574, 1323, + /* 830 */ 1552, 531, 1680, 137, 1850, 1321, 544, 1099, 2043, 171, + /* 840 */ 1403, 1795, 1321, 2038, 571, 1676, 1551, 32, 523, 1509, + /* 850 */ 1693, 1470, 1882, 37, 36, 497, 496, 43, 41, 40, + /* 860 */ 39, 38, 126, 1398, 1550, 1693, 1850, 1850, 1329, 2042, + /* 870 */ 1100, 1882, 1850, 492, 495, 1329, 44, 42, 544, 491, + /* 880 */ 544, 1900, 1984, 544, 349, 1792, 1323, 307, 1850, 599, + /* 890 */ 528, 1787, 237, 544, 1850, 540, 598, 1403, 2037, 1321, + /* 900 */ 1900, 8, 183, 1989, 1466, 542, 1850, 1693, 599, 1693, + /* 910 */ 1979, 1348, 1693, 1850, 2041, 598, 689, 1880, 2038, 2039, + /* 920 */ 1398, 1916, 1693, 689, 242, 157, 1881, 1883, 602, 1885, + /* 930 */ 1886, 597, 1329, 592, 489, 223, 1880, 1405, 1406, 1549, + /* 940 */ 1916, 544, 1539, 544, 97, 1881, 1883, 602, 1885, 1886, + /* 950 */ 597, 128, 592, 543, 1940, 268, 488, 2057, 1, 1969, + /* 960 */ 648, 593, 1663, 342, 1965, 631, 549, 2006, 1736, 522, + /* 970 */ 1693, 632, 1693, 2031, 1736, 1598, 1324, 626, 1322, 279, + /* 980 */ 689, 1850, 1723, 1324, 143, 1322, 48, 4, 210, 402, + /* 990 */ 212, 208, 45, 211, 1405, 1406, 214, 498, 1466, 213, + /* 1000 */ 1327, 1328, 1837, 216, 50, 526, 215, 1327, 1328, 1593, + /* 1010 */ 1378, 1379, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, + /* 1020 */ 594, 590, 1396, 1397, 1399, 1400, 1401, 1402, 1404, 1407, + /* 1030 */ 3, 500, 1541, 1542, 577, 573, 51, 1538, 72, 1331, + /* 1040 */ 1324, 231, 1322, 1559, 1272, 575, 37, 36, 589, 371, + /* 1050 */ 43, 41, 40, 39, 38, 37, 36, 138, 2009, 43, + /* 1060 */ 41, 40, 39, 38, 1327, 1328, 1608, 1378, 1379, 1381, + /* 1070 */ 1382, 1383, 1384, 1385, 1386, 1387, 1388, 594, 590, 1396, + /* 1080 */ 1397, 1399, 1400, 1401, 1402, 1404, 1407, 3, 309, 1469, + /* 1090 */ 1346, 13, 12, 235, 93, 1380, 1591, 425, 261, 558, + /* 1100 */ 437, 641, 642, 1651, 90, 482, 37, 36, 142, 537, + /* 1110 */ 43, 41, 40, 39, 38, 143, 60, 410, 503, 438, + /* 1120 */ 247, 412, 60, 1119, 1117, 1587, 255, 45, 1901, 666, + /* 1130 */ 665, 664, 663, 359, 45, 662, 661, 133, 656, 655, + /* 1140 */ 654, 653, 652, 651, 650, 649, 147, 645, 644, 643, + /* 1150 */ 358, 357, 640, 639, 638, 637, 636, 155, 360, 1582, + /* 1160 */ 239, 1999, 285, 322, 1733, 583, 263, 1168, 1496, 260, + /* 1170 */ 2, 5, 250, 684, 1440, 398, 283, 66, 388, 1389, + /* 1180 */ 65, 365, 1334, 1871, 606, 142, 278, 1424, 275, 143, + /* 1190 */ 370, 122, 320, 1489, 142, 527, 189, 443, 441, 1288, + /* 1200 */ 182, 153, 397, 436, 401, 1882, 431, 430, 429, 428, + /* 1210 */ 427, 424, 423, 422, 421, 420, 416, 415, 414, 413, + /* 1220 */ 407, 406, 405, 404, 2037, 400, 399, 321, 1346, 419, + /* 1230 */ 426, 1873, 1789, 58, 1900, 433, 1196, 1200, 434, 2043, + /* 1240 */ 171, 1207, 599, 1205, 2038, 571, 146, 1850, 435, 598, + /* 1250 */ 440, 37, 36, 578, 439, 43, 41, 40, 39, 38, + /* 1260 */ 186, 1352, 442, 444, 445, 453, 1354, 457, 192, 456, + /* 1270 */ 1880, 96, 194, 1353, 1916, 458, 1355, 197, 97, 1881, + /* 1280 */ 1883, 602, 1885, 1886, 597, 459, 592, 497, 496, 129, + /* 1290 */ 461, 141, 1940, 1969, 126, 199, 75, 342, 1965, 76, + /* 1300 */ 465, 530, 203, 362, 315, 492, 495, 71, 70, 391, + /* 1310 */ 361, 491, 178, 120, 484, 486, 1882, 1683, 527, 311, + /* 1320 */ 527, 1828, 207, 1679, 514, 209, 148, 527, 149, 308, + /* 1330 */ 1681, 1677, 379, 276, 377, 373, 369, 366, 363, 150, + /* 1340 */ 516, 221, 151, 518, 517, 1900, 1432, 2037, 224, 2037, + /* 1350 */ 521, 524, 529, 599, 331, 556, 2037, 228, 1850, 538, + /* 1360 */ 598, 515, 2043, 171, 2043, 171, 139, 2038, 571, 2038, + /* 1370 */ 571, 2043, 171, 140, 532, 1827, 2038, 571, 527, 1799, + /* 1380 */ 174, 1880, 535, 333, 84, 1916, 539, 277, 86, 97, + /* 1390 */ 1881, 1883, 602, 1885, 1886, 597, 1694, 592, 1351, 2000, + /* 1400 */ 2010, 1433, 2057, 552, 1969, 559, 245, 2037, 342, 1965, + /* 1410 */ 692, 554, 2015, 555, 338, 249, 6, 2014, 1988, 562, + /* 1420 */ 254, 1882, 2043, 171, 274, 568, 553, 2038, 571, 551, + /* 1430 */ 550, 1991, 162, 256, 339, 259, 579, 257, 165, 576, + /* 1440 */ 1466, 258, 131, 682, 678, 674, 670, 272, 1350, 57, + /* 1450 */ 1900, 1985, 88, 604, 2060, 1950, 1737, 1664, 599, 280, + /* 1460 */ 271, 2036, 685, 1850, 1882, 598, 49, 262, 686, 688, + /* 1470 */ 306, 33, 346, 1427, 1428, 1429, 1430, 1431, 1435, 1436, + /* 1480 */ 1437, 1438, 284, 292, 95, 282, 1880, 240, 1844, 1843, + /* 1490 */ 1916, 68, 303, 1900, 97, 1881, 1883, 602, 1885, 1886, + /* 1500 */ 597, 599, 592, 302, 1842, 1841, 1850, 1944, 598, 1969, + /* 1510 */ 69, 345, 344, 342, 1965, 1838, 367, 1882, 368, 1315, + /* 1520 */ 541, 1337, 1316, 372, 1836, 177, 374, 375, 376, 1880, + /* 1530 */ 1835, 378, 1403, 1916, 1330, 1834, 380, 97, 1881, 1883, + /* 1540 */ 602, 1885, 1886, 597, 384, 592, 1900, 1833, 382, 1832, + /* 1550 */ 1942, 1291, 1969, 229, 599, 1398, 342, 1965, 1290, 1850, + /* 1560 */ 1810, 598, 1809, 1808, 389, 390, 1807, 1329, 1782, 1260, + /* 1570 */ 1882, 1295, 1781, 222, 1779, 134, 1778, 1777, 1780, 135, + /* 1580 */ 1776, 1775, 1880, 1774, 1773, 1772, 1916, 1771, 408, 409, + /* 1590 */ 97, 1881, 1883, 602, 1885, 1886, 597, 1770, 592, 1900, + /* 1600 */ 411, 1769, 1768, 547, 1262, 1969, 1767, 599, 1766, 342, + /* 1610 */ 1965, 1765, 1850, 1882, 598, 588, 1764, 1763, 1762, 1761, + /* 1620 */ 1760, 1759, 1758, 1757, 1756, 1755, 1754, 1753, 136, 1752, + /* 1630 */ 1751, 1750, 1749, 1748, 1747, 1880, 1746, 1613, 1143, 1916, + /* 1640 */ 1612, 1610, 1900, 98, 1881, 1883, 602, 1885, 1886, 597, + /* 1650 */ 599, 592, 187, 1578, 188, 1850, 190, 598, 1969, 1062, + /* 1660 */ 1061, 449, 1968, 1965, 198, 1805, 1882, 123, 1577, 1823, + /* 1670 */ 1817, 1806, 1791, 1672, 124, 1338, 1609, 1333, 1880, 1607, + /* 1680 */ 1605, 166, 1916, 191, 466, 451, 98, 1881, 1883, 602, + /* 1690 */ 1885, 1886, 597, 196, 592, 1900, 468, 467, 470, 1341, + /* 1700 */ 1343, 1969, 471, 596, 1092, 587, 1965, 1603, 1850, 474, + /* 1710 */ 598, 1601, 1590, 590, 1396, 1397, 1399, 1400, 1401, 1402, + /* 1720 */ 472, 476, 1882, 478, 475, 479, 480, 1589, 1574, 1674, + /* 1730 */ 1211, 1880, 1210, 1673, 1134, 1916, 1133, 657, 1130, 300, + /* 1740 */ 1881, 1883, 602, 1885, 1886, 597, 595, 592, 545, 1934, + /* 1750 */ 1129, 1900, 659, 206, 59, 1599, 1128, 327, 1594, 599, + /* 1760 */ 328, 1592, 501, 329, 1850, 504, 598, 1573, 1572, 1571, + /* 1770 */ 510, 99, 506, 1822, 508, 53, 1816, 1297, 1307, 25, + /* 1780 */ 1804, 519, 1802, 1803, 1882, 18, 152, 1880, 1801, 502, + /* 1790 */ 2042, 1916, 1800, 230, 1798, 158, 1881, 1883, 602, 1885, + /* 1800 */ 1886, 597, 236, 592, 512, 1305, 1790, 520, 225, 90, + /* 1810 */ 82, 83, 241, 1900, 85, 1415, 10, 19, 218, 330, + /* 1820 */ 536, 599, 20, 525, 1414, 238, 1850, 1511, 598, 56, + /* 1830 */ 253, 61, 505, 15, 27, 1871, 499, 244, 252, 246, + /* 1840 */ 1493, 217, 1882, 248, 29, 1495, 160, 572, 2058, 1880, + /* 1850 */ 533, 251, 22, 1916, 28, 21, 89, 98, 1881, 1883, + /* 1860 */ 602, 1885, 1886, 597, 1882, 592, 1488, 1526, 1525, 340, + /* 1870 */ 1531, 1900, 1969, 1532, 1530, 1529, 332, 1966, 64, 599, + /* 1880 */ 341, 63, 265, 1870, 1850, 1463, 598, 55, 1462, 163, + /* 1890 */ 12, 1339, 1425, 1900, 1919, 164, 175, 1393, 591, 35, + /* 1900 */ 54, 596, 1391, 1390, 14, 16, 1850, 1880, 598, 23, + /* 1910 */ 24, 1916, 1363, 1371, 1197, 301, 1881, 1883, 602, 1885, + /* 1920 */ 1886, 597, 605, 592, 1882, 601, 603, 351, 609, 1880, + /* 1930 */ 1194, 612, 607, 1916, 615, 610, 613, 300, 1881, 1883, + /* 1940 */ 602, 1885, 1886, 597, 618, 592, 1191, 1935, 1185, 616, + /* 1950 */ 1174, 1183, 619, 1900, 625, 91, 92, 1206, 67, 269, + /* 1960 */ 1202, 599, 1090, 634, 1189, 1188, 1850, 1882, 598, 1125, + /* 1970 */ 1187, 1124, 1186, 1141, 1123, 1122, 1121, 1120, 1118, 1116, + /* 1980 */ 1115, 1114, 1110, 1108, 1882, 646, 1112, 1111, 1109, 1880, + /* 1990 */ 270, 1107, 1106, 1916, 1105, 1138, 1900, 157, 1881, 1883, + /* 2000 */ 602, 1885, 1886, 597, 599, 592, 1136, 1102, 1101, 1850, + /* 2010 */ 1098, 598, 1097, 1900, 1096, 1095, 1606, 667, 669, 1604, + /* 2020 */ 671, 599, 673, 668, 1602, 672, 1850, 677, 598, 675, + /* 2030 */ 1600, 676, 1880, 679, 680, 681, 1916, 1588, 1882, 2007, + /* 2040 */ 296, 1881, 1883, 602, 1885, 1886, 597, 683, 592, 1880, + /* 2050 */ 1052, 1570, 687, 1916, 273, 1325, 1882, 158, 1881, 1883, + /* 2060 */ 602, 1885, 1886, 597, 281, 592, 690, 1900, 691, 1545, + /* 2070 */ 1545, 1545, 347, 1545, 1545, 599, 1545, 1545, 1545, 1545, + /* 2080 */ 1850, 1545, 598, 1545, 567, 1900, 1545, 1545, 1545, 1545, + /* 2090 */ 350, 1545, 1545, 599, 1545, 1545, 1545, 1545, 1850, 1545, + /* 2100 */ 598, 1545, 1545, 1880, 1545, 1545, 1545, 1916, 1545, 1545, + /* 2110 */ 2059, 301, 1881, 1883, 602, 1885, 1886, 597, 1882, 592, + /* 2120 */ 1545, 1880, 1545, 1545, 1545, 1916, 1545, 1545, 1545, 301, + /* 2130 */ 1881, 1883, 602, 1885, 1886, 597, 1545, 592, 1545, 1545, + /* 2140 */ 1545, 1545, 1882, 1545, 1545, 1545, 1545, 1900, 1545, 1545, + /* 2150 */ 1545, 1545, 1545, 1545, 1545, 599, 1545, 1545, 1545, 1545, + /* 2160 */ 1850, 1545, 598, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + /* 2170 */ 1545, 1900, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 599, + /* 2180 */ 1545, 1545, 1545, 513, 1850, 1882, 598, 1916, 1545, 1545, + /* 2190 */ 1545, 294, 1881, 1883, 602, 1885, 1886, 597, 1545, 592, + /* 2200 */ 1545, 1545, 1545, 1545, 1545, 1882, 1545, 1880, 1545, 1545, + /* 2210 */ 1545, 1916, 1545, 1545, 1900, 286, 1881, 1883, 602, 1885, + /* 2220 */ 1886, 597, 599, 592, 1545, 1545, 1545, 1850, 1545, 598, + /* 2230 */ 1545, 1545, 1545, 1545, 1900, 1545, 1545, 1545, 1545, 1545, + /* 2240 */ 1545, 1545, 599, 1545, 1545, 1545, 1545, 1850, 1545, 598, + /* 2250 */ 1880, 1545, 1545, 1545, 1916, 1545, 1545, 1545, 287, 1881, + /* 2260 */ 1883, 602, 1885, 1886, 597, 1545, 592, 1545, 1882, 1545, + /* 2270 */ 1880, 1545, 1545, 1545, 1916, 1545, 1545, 1545, 288, 1881, + /* 2280 */ 1883, 602, 1885, 1886, 597, 1545, 592, 1882, 1545, 1545, + /* 2290 */ 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1900, 1545, 1545, + /* 2300 */ 1545, 1545, 1545, 1545, 1545, 599, 1545, 1545, 1545, 1545, + /* 2310 */ 1850, 1545, 598, 1545, 1545, 1545, 1900, 1545, 1545, 1545, + /* 2320 */ 1545, 1545, 1545, 1545, 599, 1545, 1545, 1545, 1545, 1850, + /* 2330 */ 1882, 598, 1545, 1880, 1545, 1545, 1545, 1916, 1545, 1545, + /* 2340 */ 1545, 295, 1881, 1883, 602, 1885, 1886, 597, 1545, 592, + /* 2350 */ 1545, 1545, 1880, 1545, 1545, 1545, 1916, 1545, 1545, 1900, + /* 2360 */ 297, 1881, 1883, 602, 1885, 1886, 597, 599, 592, 1545, + /* 2370 */ 1545, 1545, 1850, 1545, 598, 1545, 1545, 1545, 1545, 1545, + /* 2380 */ 1545, 1882, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + /* 2390 */ 1545, 1545, 1545, 1545, 1545, 1880, 1545, 1545, 1545, 1916, + /* 2400 */ 1545, 1882, 1545, 289, 1881, 1883, 602, 1885, 1886, 597, + /* 2410 */ 1900, 592, 1545, 1545, 1545, 1545, 1545, 1545, 599, 1545, + /* 2420 */ 1545, 1545, 1545, 1850, 1545, 598, 1545, 1545, 1545, 1545, + /* 2430 */ 1900, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 599, 1545, + /* 2440 */ 1545, 1545, 1545, 1850, 1545, 598, 1880, 1545, 1545, 1545, + /* 2450 */ 1916, 1545, 1882, 1545, 298, 1881, 1883, 602, 1885, 1886, + /* 2460 */ 597, 1545, 592, 1545, 1545, 1545, 1880, 1545, 1545, 1545, + /* 2470 */ 1916, 1545, 1545, 1545, 290, 1881, 1883, 602, 1885, 1886, + /* 2480 */ 597, 1900, 592, 1545, 1545, 1545, 1545, 1545, 1545, 599, + /* 2490 */ 1545, 1545, 1545, 1545, 1850, 1545, 598, 1545, 1545, 1545, + /* 2500 */ 1545, 1545, 1545, 1545, 1545, 1882, 1545, 1545, 1545, 1545, + /* 2510 */ 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1880, 1545, 1545, + /* 2520 */ 1545, 1916, 1545, 1545, 1545, 299, 1881, 1883, 602, 1885, + /* 2530 */ 1886, 597, 1545, 592, 1900, 1545, 1545, 1545, 1545, 1545, + /* 2540 */ 1545, 1545, 599, 1545, 1545, 1545, 1545, 1850, 1882, 598, + /* 2550 */ 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + /* 2560 */ 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1882, 1545, + /* 2570 */ 1880, 1545, 1545, 1545, 1916, 1545, 1545, 1900, 291, 1881, + /* 2580 */ 1883, 602, 1885, 1886, 597, 599, 592, 1545, 1545, 1545, + /* 2590 */ 1850, 1545, 598, 1545, 1545, 1545, 1545, 1900, 1545, 1545, + /* 2600 */ 1545, 1545, 1545, 1545, 1545, 599, 1545, 1545, 1545, 1545, + /* 2610 */ 1850, 1545, 598, 1880, 1545, 1545, 1545, 1916, 1545, 1545, + /* 2620 */ 1545, 304, 1881, 1883, 602, 1885, 1886, 597, 1545, 592, + /* 2630 */ 1545, 1882, 1545, 1880, 1545, 1545, 1545, 1916, 1545, 1545, + /* 2640 */ 1545, 305, 1881, 1883, 602, 1885, 1886, 597, 1545, 592, + /* 2650 */ 1882, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + /* 2660 */ 1900, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 599, 1545, + /* 2670 */ 1545, 1545, 1545, 1850, 1545, 598, 1545, 1545, 1545, 1900, + /* 2680 */ 1545, 1545, 1545, 1545, 1545, 1545, 1545, 599, 1545, 1545, + /* 2690 */ 1545, 1545, 1850, 1882, 598, 1545, 1880, 1545, 1545, 1545, + /* 2700 */ 1916, 1545, 1545, 1545, 1894, 1881, 1883, 602, 1885, 1886, + /* 2710 */ 597, 1545, 592, 1545, 1545, 1880, 1545, 1545, 1545, 1916, + /* 2720 */ 1545, 1545, 1900, 1893, 1881, 1883, 602, 1885, 1886, 597, + /* 2730 */ 599, 592, 1545, 1545, 1545, 1850, 1545, 598, 1545, 1545, + /* 2740 */ 1545, 1545, 1545, 1545, 1882, 1545, 1545, 1545, 1545, 1545, + /* 2750 */ 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1880, 1545, + /* 2760 */ 1545, 1545, 1916, 1545, 1882, 1545, 1892, 1881, 1883, 602, + /* 2770 */ 1885, 1886, 597, 1900, 592, 1545, 1545, 1545, 1545, 1545, + /* 2780 */ 1545, 599, 1545, 1545, 1545, 1545, 1850, 1545, 598, 1545, + /* 2790 */ 1545, 1545, 1545, 1900, 1545, 1545, 1545, 1545, 1545, 1545, + /* 2800 */ 1545, 599, 1545, 1545, 1545, 1545, 1850, 1545, 598, 1880, + /* 2810 */ 1545, 1545, 1545, 1916, 1545, 1882, 1545, 316, 1881, 1883, + /* 2820 */ 602, 1885, 1886, 597, 1545, 592, 1545, 1545, 1545, 1880, + /* 2830 */ 1545, 1545, 1545, 1916, 1545, 1545, 1545, 317, 1881, 1883, + /* 2840 */ 602, 1885, 1886, 597, 1900, 592, 1545, 1545, 1545, 1545, + /* 2850 */ 1545, 1545, 599, 1545, 1545, 1545, 1545, 1850, 1545, 598, + /* 2860 */ 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1882, 1545, + /* 2870 */ 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + /* 2880 */ 1880, 1545, 1545, 1545, 1916, 1545, 1545, 1545, 313, 1881, + /* 2890 */ 1883, 602, 1885, 1886, 597, 1545, 592, 1900, 1545, 1545, + /* 2900 */ 1545, 1545, 1545, 1545, 1545, 599, 1545, 1545, 1545, 1545, + /* 2910 */ 1850, 1882, 598, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + /* 2920 */ 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + /* 2930 */ 1545, 1545, 1545, 1880, 1545, 1545, 1545, 1916, 1545, 1545, + /* 2940 */ 1900, 318, 1881, 1883, 602, 1885, 1886, 597, 599, 592, + /* 2950 */ 1545, 1545, 1545, 1850, 1545, 598, 1545, 1545, 1545, 1545, + /* 2960 */ 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + /* 2970 */ 1545, 1545, 1545, 1545, 1545, 1545, 1880, 1545, 1545, 1545, + /* 2980 */ 1916, 1545, 1545, 1545, 293, 1881, 1883, 602, 1885, 1886, + /* 2990 */ 597, 1545, 592, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 349, 318, 322, 349, 324, 325, 322, 318, 324, 325, - /* 10 */ 349, 360, 12, 13, 360, 358, 1, 2, 361, 362, - /* 20 */ 20, 360, 22, 12, 13, 14, 15, 16, 20, 3, - /* 30 */ 317, 330, 319, 33, 4, 35, 347, 386, 387, 388, - /* 40 */ 386, 387, 388, 360, 355, 344, 20, 386, 387, 360, - /* 50 */ 399, 362, 2, 399, 353, 403, 56, 405, 8, 9, - /* 60 */ 399, 61, 12, 13, 14, 15, 16, 318, 68, 12, - /* 70 */ 13, 14, 383, 20, 44, 45, 387, 20, 392, 22, - /* 80 */ 391, 392, 393, 394, 395, 396, 397, 20, 399, 22, - /* 90 */ 33, 4, 35, 404, 94, 406, 347, 407, 408, 410, - /* 100 */ 411, 346, 35, 20, 355, 326, 20, 421, 347, 360, - /* 110 */ 95, 362, 423, 56, 359, 354, 116, 50, 61, 362, - /* 120 */ 431, 95, 436, 437, 363, 68, 369, 441, 442, 372, - /* 130 */ 130, 131, 383, 60, 355, 56, 387, 0, 130, 131, - /* 140 */ 391, 392, 393, 394, 395, 396, 397, 94, 399, 347, - /* 150 */ 323, 94, 20, 326, 22, 406, 94, 355, 21, 410, - /* 160 */ 411, 24, 25, 26, 27, 28, 29, 30, 31, 32, - /* 170 */ 421, 392, 93, 116, 389, 96, 176, 94, 178, 94, - /* 180 */ 94, 94, 50, 39, 318, 436, 437, 130, 131, 163, - /* 190 */ 441, 442, 413, 414, 415, 416, 394, 418, 361, 362, - /* 200 */ 200, 201, 417, 203, 204, 205, 206, 207, 208, 209, + /* 0 */ 351, 0, 324, 351, 326, 327, 324, 320, 326, 327, + /* 10 */ 351, 362, 12, 13, 362, 360, 328, 328, 363, 364, + /* 20 */ 20, 362, 22, 12, 13, 14, 15, 16, 340, 3, + /* 30 */ 409, 410, 20, 33, 20, 35, 349, 388, 389, 390, + /* 40 */ 388, 389, 390, 20, 357, 357, 20, 388, 389, 362, + /* 50 */ 401, 364, 2, 401, 0, 366, 56, 4, 8, 9, + /* 60 */ 401, 61, 12, 13, 14, 15, 16, 320, 68, 12, + /* 70 */ 13, 14, 385, 14, 15, 16, 389, 20, 394, 22, + /* 80 */ 393, 394, 395, 396, 397, 398, 399, 20, 401, 22, + /* 90 */ 33, 4, 35, 406, 94, 408, 349, 44, 45, 412, + /* 100 */ 413, 332, 35, 60, 357, 328, 94, 423, 94, 362, + /* 110 */ 20, 364, 425, 56, 60, 346, 116, 50, 61, 364, + /* 120 */ 433, 95, 438, 439, 355, 68, 371, 443, 444, 374, + /* 130 */ 130, 131, 385, 20, 357, 56, 389, 0, 349, 56, + /* 140 */ 393, 394, 395, 396, 397, 398, 399, 358, 401, 349, + /* 150 */ 20, 94, 22, 130, 131, 408, 94, 357, 21, 412, + /* 160 */ 413, 24, 25, 26, 27, 28, 29, 30, 31, 32, + /* 170 */ 423, 394, 93, 116, 94, 96, 176, 94, 178, 96, + /* 180 */ 50, 94, 0, 320, 94, 438, 439, 130, 131, 163, + /* 190 */ 443, 444, 415, 416, 417, 418, 396, 420, 363, 364, + /* 200 */ 200, 201, 60, 203, 204, 205, 206, 207, 208, 209, /* 210 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 220 */ 220, 221, 33, 0, 8, 9, 360, 20, 12, 13, - /* 230 */ 14, 15, 16, 176, 20, 178, 47, 125, 126, 239, - /* 240 */ 14, 52, 53, 54, 55, 56, 20, 24, 25, 26, - /* 250 */ 27, 28, 29, 30, 31, 32, 326, 200, 201, 43, + /* 220 */ 220, 221, 222, 223, 33, 362, 125, 126, 20, 106, + /* 230 */ 328, 333, 37, 176, 14, 178, 338, 175, 47, 177, + /* 240 */ 20, 241, 60, 52, 53, 54, 55, 56, 125, 126, + /* 250 */ 127, 128, 129, 241, 319, 241, 321, 200, 201, 357, /* 260 */ 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - /* 270 */ 213, 214, 215, 216, 217, 218, 219, 220, 221, 12, - /* 280 */ 13, 106, 93, 330, 349, 96, 94, 20, 318, 22, - /* 290 */ 323, 200, 239, 326, 364, 360, 184, 106, 326, 187, - /* 300 */ 33, 239, 35, 128, 21, 126, 353, 24, 25, 26, - /* 310 */ 27, 28, 29, 30, 31, 32, 125, 126, 127, 128, - /* 320 */ 129, 386, 387, 56, 239, 239, 239, 355, 61, 392, - /* 330 */ 360, 318, 56, 20, 399, 68, 12, 13, 347, 248, - /* 340 */ 249, 250, 251, 252, 20, 354, 22, 326, 159, 160, - /* 350 */ 14, 162, 20, 318, 363, 166, 20, 33, 421, 35, - /* 360 */ 347, 94, 183, 184, 392, 326, 187, 175, 355, 177, - /* 370 */ 94, 182, 96, 360, 437, 362, 355, 338, 441, 442, - /* 380 */ 56, 171, 238, 116, 345, 61, 414, 415, 416, 43, - /* 390 */ 418, 0, 68, 14, 355, 360, 383, 130, 131, 20, - /* 400 */ 387, 191, 192, 22, 391, 392, 393, 394, 395, 396, - /* 410 */ 397, 318, 399, 392, 60, 161, 35, 404, 94, 406, - /* 420 */ 105, 8, 9, 410, 411, 12, 13, 14, 15, 16, - /* 430 */ 204, 239, 223, 20, 225, 414, 415, 416, 78, 418, - /* 440 */ 116, 95, 421, 176, 431, 178, 0, 340, 339, 68, - /* 450 */ 343, 60, 339, 360, 130, 131, 347, 436, 437, 0, - /* 460 */ 347, 318, 441, 442, 403, 356, 405, 200, 201, 356, - /* 470 */ 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - /* 480 */ 213, 214, 215, 216, 217, 218, 219, 220, 221, 125, - /* 490 */ 223, 14, 15, 16, 134, 135, 20, 116, 244, 245, - /* 500 */ 176, 37, 178, 360, 107, 108, 109, 110, 111, 112, - /* 510 */ 113, 114, 115, 116, 117, 239, 119, 120, 121, 122, - /* 520 */ 123, 124, 35, 0, 200, 201, 318, 203, 204, 205, - /* 530 */ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - /* 540 */ 216, 217, 218, 219, 220, 221, 12, 13, 326, 185, - /* 550 */ 186, 392, 106, 223, 20, 68, 22, 176, 68, 178, - /* 560 */ 338, 97, 20, 99, 100, 106, 102, 33, 360, 35, - /* 570 */ 106, 125, 126, 127, 128, 129, 163, 355, 21, 318, - /* 580 */ 421, 200, 201, 204, 125, 126, 127, 128, 129, 339, - /* 590 */ 56, 34, 128, 36, 331, 20, 437, 347, 318, 336, - /* 600 */ 441, 442, 68, 12, 13, 14, 356, 326, 347, 0, - /* 610 */ 371, 20, 373, 22, 68, 328, 355, 333, 334, 338, - /* 620 */ 318, 360, 326, 362, 33, 347, 35, 347, 94, 342, - /* 630 */ 333, 334, 354, 158, 338, 355, 355, 350, 318, 318, - /* 640 */ 360, 363, 362, 402, 383, 318, 405, 56, 387, 326, - /* 650 */ 116, 355, 391, 392, 393, 394, 395, 396, 397, 68, - /* 660 */ 399, 338, 360, 383, 130, 131, 318, 387, 345, 60, - /* 670 */ 392, 391, 392, 393, 394, 395, 396, 397, 355, 399, - /* 680 */ 360, 360, 421, 318, 404, 94, 406, 360, 8, 9, - /* 690 */ 410, 411, 12, 13, 14, 15, 16, 436, 437, 421, - /* 700 */ 420, 226, 441, 442, 326, 163, 20, 116, 360, 347, - /* 710 */ 176, 236, 178, 43, 436, 437, 338, 2, 356, 441, - /* 720 */ 442, 130, 131, 8, 9, 360, 4, 12, 13, 14, - /* 730 */ 15, 16, 318, 355, 200, 201, 318, 203, 204, 205, - /* 740 */ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - /* 750 */ 216, 217, 218, 219, 220, 221, 326, 8, 9, 389, - /* 760 */ 315, 12, 13, 14, 15, 16, 379, 176, 338, 178, - /* 770 */ 371, 328, 373, 239, 360, 95, 8, 9, 360, 204, - /* 780 */ 12, 13, 14, 15, 16, 355, 318, 417, 318, 389, - /* 790 */ 318, 200, 201, 350, 203, 204, 205, 206, 207, 208, - /* 800 */ 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - /* 810 */ 219, 220, 221, 12, 13, 355, 4, 417, 44, 45, - /* 820 */ 375, 20, 355, 22, 237, 238, 366, 326, 360, 326, - /* 830 */ 360, 19, 360, 366, 33, 326, 35, 392, 326, 338, - /* 840 */ 3, 338, 362, 326, 95, 33, 318, 338, 326, 163, - /* 850 */ 338, 357, 372, 35, 360, 338, 355, 56, 355, 47, - /* 860 */ 338, 318, 348, 51, 355, 318, 421, 355, 56, 68, - /* 870 */ 12, 13, 355, 347, 319, 347, 357, 355, 20, 360, - /* 880 */ 22, 436, 437, 355, 326, 43, 441, 442, 360, 363, - /* 890 */ 362, 33, 3, 35, 347, 94, 338, 335, 0, 337, - /* 900 */ 326, 348, 355, 360, 326, 93, 326, 360, 96, 362, - /* 910 */ 43, 383, 338, 355, 56, 387, 338, 116, 338, 391, - /* 920 */ 392, 393, 394, 395, 396, 397, 68, 399, 258, 355, - /* 930 */ 383, 130, 131, 355, 387, 355, 168, 95, 391, 392, - /* 940 */ 393, 394, 395, 396, 397, 47, 399, 64, 65, 42, - /* 950 */ 43, 404, 94, 406, 71, 22, 340, 410, 411, 343, - /* 960 */ 432, 433, 240, 0, 336, 82, 83, 420, 35, 326, - /* 970 */ 98, 88, 98, 101, 116, 101, 61, 176, 375, 178, - /* 980 */ 375, 338, 163, 164, 95, 22, 8, 9, 130, 131, - /* 990 */ 12, 13, 14, 15, 16, 392, 178, 392, 355, 130, - /* 1000 */ 131, 200, 201, 348, 203, 204, 205, 206, 207, 208, - /* 1010 */ 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - /* 1020 */ 219, 220, 221, 18, 421, 20, 421, 0, 0, 261, - /* 1030 */ 98, 326, 27, 101, 176, 30, 178, 1, 2, 436, - /* 1040 */ 437, 436, 437, 338, 441, 442, 441, 442, 98, 22, - /* 1050 */ 22, 101, 47, 43, 49, 56, 51, 348, 200, 201, - /* 1060 */ 355, 203, 204, 205, 206, 207, 208, 209, 210, 211, - /* 1070 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 1080 */ 8, 9, 43, 43, 12, 13, 14, 15, 16, 18, - /* 1090 */ 326, 326, 13, 256, 23, 96, 94, 390, 93, 348, - /* 1100 */ 13, 348, 338, 338, 35, 95, 104, 43, 37, 38, - /* 1110 */ 105, 0, 41, 445, 35, 200, 43, 348, 43, 355, - /* 1120 */ 355, 43, 35, 46, 434, 327, 428, 260, 57, 58, - /* 1130 */ 59, 347, 327, 325, 95, 95, 359, 390, 133, 35, - /* 1140 */ 326, 136, 137, 138, 139, 140, 141, 142, 143, 144, - /* 1150 */ 145, 146, 147, 148, 149, 150, 151, 152, 153, 95, - /* 1160 */ 155, 156, 157, 43, 43, 94, 438, 43, 95, 355, - /* 1170 */ 95, 94, 68, 95, 63, 64, 65, 66, 67, 43, - /* 1180 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - /* 1190 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - /* 1200 */ 89, 90, 43, 132, 8, 9, 392, 0, 12, 13, - /* 1210 */ 14, 15, 16, 43, 318, 95, 95, 422, 419, 95, - /* 1220 */ 43, 412, 241, 385, 384, 47, 174, 377, 414, 415, - /* 1230 */ 416, 95, 418, 42, 20, 163, 326, 367, 326, 168, - /* 1240 */ 169, 170, 367, 347, 173, 365, 158, 178, 92, 332, - /* 1250 */ 365, 355, 326, 326, 95, 48, 360, 61, 362, 375, - /* 1260 */ 326, 190, 20, 320, 193, 95, 195, 196, 197, 198, - /* 1270 */ 199, 320, 95, 20, 381, 330, 392, 330, 362, 383, - /* 1280 */ 20, 20, 374, 387, 330, 376, 318, 391, 392, 393, - /* 1290 */ 394, 395, 396, 397, 374, 399, 330, 330, 402, 103, - /* 1300 */ 404, 405, 406, 330, 330, 421, 410, 411, 318, 326, - /* 1310 */ 239, 320, 347, 326, 320, 347, 347, 347, 347, 347, - /* 1320 */ 436, 437, 347, 355, 347, 441, 442, 0, 360, 347, - /* 1330 */ 362, 347, 347, 347, 189, 382, 360, 347, 381, 328, - /* 1340 */ 380, 181, 362, 328, 326, 355, 326, 328, 246, 360, - /* 1350 */ 360, 383, 362, 374, 158, 387, 360, 360, 370, 391, - /* 1360 */ 392, 393, 394, 395, 396, 397, 360, 399, 370, 360, - /* 1370 */ 160, 368, 404, 383, 406, 318, 328, 387, 410, 411, - /* 1380 */ 343, 391, 392, 393, 394, 395, 396, 397, 420, 399, - /* 1390 */ 328, 64, 65, 355, 404, 20, 406, 390, 71, 247, - /* 1400 */ 410, 411, 390, 360, 347, 370, 360, 360, 253, 82, - /* 1410 */ 83, 360, 355, 360, 370, 88, 375, 360, 167, 362, - /* 1420 */ 427, 429, 226, 227, 228, 229, 230, 231, 232, 233, - /* 1430 */ 234, 235, 236, 392, 430, 427, 255, 254, 262, 426, - /* 1440 */ 383, 427, 425, 242, 387, 424, 385, 318, 391, 392, - /* 1450 */ 393, 394, 395, 396, 397, 439, 399, 259, 238, 257, - /* 1460 */ 355, 404, 421, 406, 440, 20, 94, 410, 411, 446, - /* 1470 */ 389, 19, 409, 94, 351, 360, 347, 436, 437, 337, - /* 1480 */ 326, 328, 441, 442, 355, 33, 36, 321, 320, 360, - /* 1490 */ 378, 362, 373, 329, 0, 316, 0, 183, 341, 47, - /* 1500 */ 0, 0, 341, 341, 52, 53, 54, 55, 56, 42, - /* 1510 */ 0, 35, 383, 194, 35, 35, 387, 35, 194, 0, - /* 1520 */ 391, 392, 393, 394, 395, 396, 397, 35, 399, 318, - /* 1530 */ 35, 194, 0, 404, 194, 406, 12, 13, 35, 410, - /* 1540 */ 411, 0, 0, 0, 22, 93, 22, 35, 96, 178, - /* 1550 */ 176, 0, 0, 172, 171, 0, 0, 33, 347, 35, - /* 1560 */ 46, 0, 0, 0, 0, 42, 355, 0, 0, 375, - /* 1570 */ 154, 360, 0, 362, 0, 0, 0, 0, 149, 35, - /* 1580 */ 56, 129, 0, 318, 149, 0, 392, 0, 0, 0, - /* 1590 */ 0, 0, 68, 22, 383, 0, 0, 0, 387, 0, - /* 1600 */ 0, 0, 391, 392, 393, 394, 395, 396, 397, 318, - /* 1610 */ 399, 0, 347, 0, 162, 421, 0, 406, 0, 0, - /* 1620 */ 355, 410, 411, 42, 0, 360, 0, 362, 0, 0, - /* 1630 */ 436, 437, 180, 0, 182, 441, 442, 0, 347, 0, - /* 1640 */ 116, 35, 0, 0, 0, 0, 355, 42, 383, 14, - /* 1650 */ 56, 360, 387, 362, 56, 43, 391, 392, 393, 394, - /* 1660 */ 395, 396, 397, 46, 399, 14, 39, 46, 0, 0, - /* 1670 */ 40, 406, 0, 39, 383, 410, 411, 0, 387, 318, - /* 1680 */ 39, 0, 391, 392, 393, 394, 395, 396, 397, 398, - /* 1690 */ 399, 400, 401, 167, 0, 0, 0, 0, 62, 35, - /* 1700 */ 176, 47, 178, 0, 39, 35, 47, 0, 347, 35, - /* 1710 */ 39, 0, 39, 47, 35, 39, 355, 0, 0, 0, - /* 1720 */ 0, 360, 47, 362, 200, 201, 103, 35, 22, 0, - /* 1730 */ 43, 43, 101, 35, 35, 35, 212, 213, 214, 215, - /* 1740 */ 216, 217, 218, 318, 383, 35, 22, 0, 387, 22, - /* 1750 */ 0, 49, 391, 392, 393, 394, 395, 396, 397, 22, - /* 1760 */ 399, 0, 22, 35, 0, 35, 0, 35, 0, 318, - /* 1770 */ 22, 20, 347, 95, 0, 0, 94, 163, 35, 22, - /* 1780 */ 355, 179, 160, 163, 0, 360, 318, 362, 0, 3, - /* 1790 */ 165, 0, 0, 0, 35, 163, 95, 188, 347, 94, - /* 1800 */ 0, 161, 94, 352, 443, 444, 355, 94, 383, 0, - /* 1810 */ 39, 360, 387, 362, 159, 347, 391, 392, 393, 394, - /* 1820 */ 395, 396, 397, 355, 399, 94, 104, 46, 360, 222, - /* 1830 */ 362, 406, 43, 43, 383, 243, 411, 222, 387, 318, - /* 1840 */ 94, 43, 391, 392, 393, 394, 395, 396, 397, 95, - /* 1850 */ 399, 383, 94, 43, 94, 387, 318, 95, 95, 391, - /* 1860 */ 392, 393, 394, 395, 396, 397, 94, 399, 347, 401, - /* 1870 */ 224, 95, 94, 94, 46, 95, 355, 46, 43, 94, - /* 1880 */ 3, 360, 95, 362, 43, 347, 35, 35, 35, 95, - /* 1890 */ 243, 243, 35, 355, 35, 35, 95, 95, 360, 237, - /* 1900 */ 362, 46, 46, 22, 383, 43, 94, 46, 387, 200, - /* 1910 */ 2, 318, 391, 392, 393, 394, 395, 396, 397, 95, - /* 1920 */ 399, 383, 95, 94, 94, 387, 46, 95, 318, 391, - /* 1930 */ 392, 393, 394, 395, 396, 397, 94, 399, 94, 46, - /* 1940 */ 347, 95, 22, 94, 202, 105, 35, 35, 355, 95, - /* 1950 */ 35, 35, 94, 360, 433, 362, 35, 347, 95, 94, - /* 1960 */ 35, 95, 352, 94, 94, 355, 95, 95, 94, 22, - /* 1970 */ 360, 35, 362, 435, 106, 43, 383, 94, 94, 318, - /* 1980 */ 387, 94, 118, 22, 391, 392, 393, 394, 395, 396, - /* 1990 */ 397, 118, 399, 383, 118, 62, 118, 387, 318, 61, - /* 2000 */ 35, 391, 392, 393, 394, 395, 396, 397, 347, 399, - /* 2010 */ 35, 35, 35, 352, 35, 35, 355, 35, 35, 35, - /* 2020 */ 35, 360, 91, 362, 68, 35, 35, 347, 22, 43, - /* 2030 */ 35, 22, 35, 35, 35, 355, 68, 444, 35, 35, - /* 2040 */ 360, 22, 362, 35, 383, 35, 35, 35, 387, 0, - /* 2050 */ 35, 0, 391, 392, 393, 394, 395, 396, 397, 318, - /* 2060 */ 399, 39, 35, 383, 47, 47, 0, 387, 39, 35, - /* 2070 */ 47, 391, 392, 393, 394, 395, 396, 397, 39, 399, - /* 2080 */ 0, 35, 47, 39, 0, 35, 0, 35, 347, 22, - /* 2090 */ 21, 447, 22, 22, 21, 20, 355, 447, 447, 447, - /* 2100 */ 447, 360, 447, 362, 447, 447, 447, 447, 447, 447, - /* 2110 */ 447, 447, 447, 447, 447, 447, 447, 318, 447, 447, - /* 2120 */ 447, 447, 447, 447, 383, 447, 447, 447, 387, 447, - /* 2130 */ 447, 447, 391, 392, 393, 394, 395, 396, 397, 318, - /* 2140 */ 399, 447, 447, 447, 447, 447, 347, 447, 447, 447, - /* 2150 */ 447, 447, 447, 447, 355, 447, 447, 447, 447, 360, - /* 2160 */ 447, 362, 447, 447, 447, 447, 447, 447, 347, 447, - /* 2170 */ 447, 447, 447, 447, 447, 447, 355, 447, 447, 447, - /* 2180 */ 447, 360, 383, 362, 447, 447, 387, 447, 447, 447, - /* 2190 */ 391, 392, 393, 394, 395, 396, 397, 447, 399, 447, - /* 2200 */ 318, 447, 447, 447, 383, 447, 447, 447, 387, 447, - /* 2210 */ 447, 447, 391, 392, 393, 394, 395, 396, 397, 318, - /* 2220 */ 399, 447, 447, 447, 447, 447, 447, 447, 447, 347, - /* 2230 */ 447, 447, 447, 447, 447, 447, 447, 355, 447, 447, - /* 2240 */ 447, 447, 360, 447, 362, 447, 447, 447, 347, 447, - /* 2250 */ 447, 447, 447, 447, 447, 447, 355, 447, 447, 447, - /* 2260 */ 447, 360, 447, 362, 447, 383, 447, 447, 447, 387, - /* 2270 */ 447, 447, 318, 391, 392, 393, 394, 395, 396, 397, - /* 2280 */ 447, 399, 447, 447, 383, 447, 447, 447, 387, 318, - /* 2290 */ 447, 447, 391, 392, 393, 394, 395, 396, 397, 447, - /* 2300 */ 399, 347, 447, 447, 447, 447, 447, 447, 447, 355, - /* 2310 */ 447, 447, 447, 447, 360, 447, 362, 447, 347, 447, - /* 2320 */ 447, 447, 447, 447, 447, 447, 355, 447, 447, 447, - /* 2330 */ 447, 360, 318, 362, 447, 447, 447, 383, 447, 447, - /* 2340 */ 447, 387, 447, 447, 447, 391, 392, 393, 394, 395, - /* 2350 */ 396, 397, 447, 399, 383, 447, 318, 447, 387, 447, - /* 2360 */ 447, 347, 391, 392, 393, 394, 395, 396, 397, 355, - /* 2370 */ 399, 447, 447, 447, 360, 318, 362, 447, 447, 447, - /* 2380 */ 447, 447, 447, 447, 447, 347, 447, 447, 447, 447, - /* 2390 */ 447, 447, 447, 355, 447, 447, 447, 383, 360, 447, - /* 2400 */ 362, 387, 447, 447, 347, 391, 392, 393, 394, 395, - /* 2410 */ 396, 397, 355, 399, 447, 447, 447, 360, 447, 362, - /* 2420 */ 447, 383, 447, 447, 447, 387, 447, 447, 447, 391, - /* 2430 */ 392, 393, 394, 395, 396, 397, 318, 399, 447, 447, - /* 2440 */ 383, 447, 447, 447, 387, 447, 447, 447, 391, 392, - /* 2450 */ 393, 394, 395, 396, 397, 318, 399, 447, 447, 447, - /* 2460 */ 447, 447, 447, 447, 447, 347, 447, 447, 447, 447, - /* 2470 */ 447, 447, 447, 355, 447, 447, 447, 447, 360, 447, - /* 2480 */ 362, 447, 447, 447, 347, 447, 447, 447, 447, 447, - /* 2490 */ 447, 447, 355, 447, 447, 447, 447, 360, 447, 362, - /* 2500 */ 447, 383, 447, 447, 447, 387, 447, 447, 447, 391, - /* 2510 */ 392, 393, 394, 395, 396, 397, 447, 399, 447, 318, - /* 2520 */ 383, 447, 447, 447, 387, 447, 447, 447, 391, 392, - /* 2530 */ 393, 394, 395, 396, 397, 447, 399, 318, 447, 447, - /* 2540 */ 447, 447, 447, 447, 447, 447, 447, 447, 347, 447, - /* 2550 */ 447, 447, 447, 447, 447, 447, 355, 447, 447, 447, - /* 2560 */ 447, 360, 447, 362, 447, 447, 347, 447, 447, 447, - /* 2570 */ 447, 447, 447, 447, 355, 447, 447, 447, 447, 360, - /* 2580 */ 318, 362, 447, 447, 383, 447, 447, 447, 387, 447, - /* 2590 */ 447, 447, 391, 392, 393, 394, 395, 396, 397, 447, - /* 2600 */ 399, 447, 383, 447, 447, 447, 387, 447, 447, 347, - /* 2610 */ 391, 392, 393, 394, 395, 396, 397, 355, 399, 447, - /* 2620 */ 447, 447, 360, 447, 362, 447, 447, 447, 447, 447, - /* 2630 */ 447, 447, 447, 318, 447, 447, 447, 447, 447, 447, - /* 2640 */ 447, 447, 447, 447, 447, 383, 447, 447, 447, 387, - /* 2650 */ 318, 447, 447, 391, 392, 393, 394, 395, 396, 397, - /* 2660 */ 447, 399, 347, 447, 447, 447, 447, 447, 447, 447, - /* 2670 */ 355, 447, 447, 447, 447, 360, 447, 362, 447, 347, - /* 2680 */ 447, 447, 447, 447, 447, 447, 447, 355, 447, 447, - /* 2690 */ 447, 447, 360, 318, 362, 447, 447, 447, 383, 447, - /* 2700 */ 447, 447, 387, 447, 447, 447, 391, 392, 393, 394, - /* 2710 */ 395, 396, 397, 447, 399, 383, 447, 318, 447, 387, - /* 2720 */ 447, 447, 347, 391, 392, 393, 394, 395, 396, 397, - /* 2730 */ 355, 399, 447, 447, 447, 360, 318, 362, 447, 447, - /* 2740 */ 447, 447, 447, 447, 447, 447, 347, 447, 447, 447, - /* 2750 */ 447, 447, 447, 447, 355, 447, 447, 447, 383, 360, - /* 2760 */ 447, 362, 387, 447, 447, 347, 391, 392, 393, 394, - /* 2770 */ 395, 396, 397, 355, 399, 447, 447, 447, 360, 447, - /* 2780 */ 362, 447, 383, 447, 447, 447, 387, 447, 447, 447, - /* 2790 */ 391, 392, 393, 394, 395, 396, 397, 447, 399, 447, - /* 2800 */ 447, 383, 447, 447, 447, 387, 447, 447, 447, 391, - /* 2810 */ 392, 393, 394, 395, 396, 397, 447, 399, + /* 270 */ 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + /* 280 */ 223, 12, 13, 126, 93, 184, 348, 96, 187, 20, + /* 290 */ 341, 22, 97, 320, 99, 100, 394, 102, 349, 361, + /* 300 */ 328, 106, 33, 241, 35, 320, 21, 358, 20, 24, + /* 310 */ 25, 26, 27, 28, 29, 30, 31, 32, 416, 417, + /* 320 */ 418, 241, 420, 128, 241, 56, 20, 349, 241, 357, + /* 330 */ 61, 351, 161, 320, 356, 362, 125, 68, 12, 13, + /* 340 */ 183, 184, 362, 365, 187, 357, 20, 362, 22, 328, + /* 350 */ 159, 160, 94, 162, 14, 328, 368, 166, 330, 33, + /* 360 */ 20, 35, 349, 94, 328, 14, 394, 340, 388, 389, + /* 370 */ 357, 20, 344, 182, 347, 362, 340, 364, 357, 349, + /* 380 */ 352, 401, 56, 347, 357, 116, 356, 61, 416, 417, + /* 390 */ 418, 22, 420, 357, 68, 365, 185, 186, 385, 130, + /* 400 */ 131, 200, 389, 0, 35, 341, 393, 394, 395, 396, + /* 410 */ 397, 398, 399, 349, 401, 394, 35, 246, 247, 406, + /* 420 */ 94, 408, 358, 158, 204, 412, 413, 24, 25, 26, + /* 430 */ 27, 28, 29, 30, 31, 32, 3, 416, 417, 418, + /* 440 */ 78, 420, 116, 332, 423, 176, 433, 178, 21, 68, + /* 450 */ 341, 250, 251, 252, 253, 254, 130, 131, 349, 438, + /* 460 */ 439, 34, 20, 36, 443, 444, 355, 358, 20, 200, + /* 470 */ 201, 0, 203, 204, 205, 206, 207, 208, 209, 210, + /* 480 */ 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + /* 490 */ 221, 222, 223, 228, 225, 325, 134, 135, 328, 241, + /* 500 */ 335, 336, 176, 238, 178, 68, 107, 108, 109, 110, + /* 510 */ 111, 112, 113, 114, 115, 116, 117, 320, 119, 120, + /* 520 */ 121, 122, 123, 124, 391, 394, 200, 201, 95, 203, + /* 530 */ 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + /* 540 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + /* 550 */ 12, 13, 419, 328, 423, 204, 335, 336, 20, 362, + /* 560 */ 22, 225, 35, 227, 328, 340, 328, 105, 320, 325, + /* 570 */ 439, 33, 328, 35, 443, 444, 340, 106, 340, 320, + /* 580 */ 8, 9, 357, 320, 12, 13, 14, 15, 16, 328, + /* 590 */ 1, 2, 20, 357, 56, 357, 125, 126, 127, 128, + /* 600 */ 129, 340, 320, 0, 328, 163, 68, 12, 13, 14, + /* 610 */ 362, 328, 349, 320, 328, 20, 340, 22, 357, 391, + /* 620 */ 357, 362, 349, 340, 320, 362, 340, 364, 33, 349, + /* 630 */ 35, 349, 94, 357, 225, 405, 356, 407, 365, 357, + /* 640 */ 357, 328, 56, 357, 362, 365, 364, 419, 385, 320, + /* 650 */ 330, 56, 389, 340, 116, 362, 393, 394, 395, 396, + /* 660 */ 397, 398, 399, 68, 401, 68, 362, 385, 130, 131, + /* 670 */ 357, 389, 352, 320, 394, 393, 394, 395, 396, 397, + /* 680 */ 398, 399, 96, 401, 95, 373, 423, 375, 406, 94, + /* 690 */ 408, 362, 8, 9, 412, 413, 12, 13, 14, 15, + /* 700 */ 16, 438, 439, 423, 422, 178, 443, 444, 328, 106, + /* 710 */ 405, 116, 407, 171, 176, 362, 178, 317, 438, 439, + /* 720 */ 340, 44, 45, 443, 444, 130, 131, 43, 125, 126, + /* 730 */ 127, 128, 129, 191, 192, 163, 320, 357, 200, 201, + /* 740 */ 350, 203, 204, 205, 206, 207, 208, 209, 210, 211, + /* 750 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + /* 760 */ 222, 223, 8, 9, 328, 350, 12, 13, 14, 15, + /* 770 */ 16, 176, 342, 178, 357, 345, 340, 377, 362, 241, + /* 780 */ 3, 20, 8, 9, 320, 368, 12, 13, 14, 15, + /* 790 */ 16, 0, 320, 357, 394, 200, 201, 39, 203, 204, + /* 800 */ 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + /* 810 */ 215, 216, 217, 218, 219, 220, 221, 222, 223, 12, + /* 820 */ 13, 328, 22, 423, 320, 320, 362, 20, 43, 22, + /* 830 */ 320, 364, 350, 340, 362, 35, 328, 35, 438, 439, + /* 840 */ 33, 374, 35, 443, 444, 350, 320, 2, 340, 95, + /* 850 */ 357, 4, 320, 8, 9, 64, 65, 12, 13, 14, + /* 860 */ 15, 16, 71, 56, 320, 357, 362, 362, 68, 394, + /* 870 */ 68, 320, 362, 82, 83, 68, 12, 13, 328, 88, + /* 880 */ 328, 349, 391, 328, 20, 373, 22, 375, 362, 357, + /* 890 */ 340, 357, 340, 328, 362, 340, 364, 33, 423, 35, + /* 900 */ 349, 94, 368, 239, 240, 340, 362, 357, 357, 357, + /* 910 */ 419, 20, 357, 362, 439, 364, 116, 385, 443, 444, + /* 920 */ 56, 389, 357, 116, 163, 393, 394, 395, 396, 397, + /* 930 */ 398, 399, 68, 401, 106, 350, 385, 130, 131, 320, + /* 940 */ 389, 328, 168, 328, 393, 394, 395, 396, 397, 398, + /* 950 */ 399, 404, 401, 340, 407, 340, 128, 406, 94, 408, + /* 960 */ 337, 350, 339, 412, 413, 359, 434, 435, 362, 381, + /* 970 */ 357, 359, 357, 422, 362, 0, 176, 350, 178, 342, + /* 980 */ 116, 362, 345, 176, 43, 178, 42, 43, 98, 105, + /* 990 */ 98, 101, 43, 101, 130, 131, 98, 22, 240, 101, + /* 1000 */ 200, 201, 0, 98, 163, 164, 101, 200, 201, 0, + /* 1010 */ 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + /* 1020 */ 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + /* 1030 */ 223, 22, 130, 131, 43, 258, 95, 263, 154, 35, + /* 1040 */ 176, 43, 178, 321, 95, 260, 8, 9, 61, 47, + /* 1050 */ 12, 13, 14, 15, 16, 8, 9, 43, 392, 12, + /* 1060 */ 13, 14, 15, 16, 200, 201, 0, 203, 204, 205, + /* 1070 */ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + /* 1080 */ 216, 217, 218, 219, 220, 221, 222, 223, 18, 242, + /* 1090 */ 20, 1, 2, 95, 94, 204, 0, 27, 447, 436, + /* 1100 */ 30, 13, 13, 338, 104, 329, 8, 9, 43, 95, + /* 1110 */ 12, 13, 14, 15, 16, 43, 43, 47, 22, 49, + /* 1120 */ 43, 51, 43, 35, 35, 0, 430, 43, 349, 63, + /* 1130 */ 64, 65, 66, 67, 43, 69, 70, 71, 72, 73, + /* 1140 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + /* 1150 */ 84, 85, 86, 87, 88, 89, 90, 18, 329, 327, + /* 1160 */ 95, 392, 23, 93, 361, 421, 440, 95, 95, 414, + /* 1170 */ 424, 243, 95, 48, 95, 105, 37, 38, 377, 95, + /* 1180 */ 41, 387, 178, 46, 43, 43, 95, 200, 379, 43, + /* 1190 */ 47, 43, 386, 95, 43, 394, 57, 58, 59, 174, + /* 1200 */ 42, 163, 369, 133, 369, 320, 136, 137, 138, 139, + /* 1210 */ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + /* 1220 */ 150, 151, 152, 153, 423, 155, 156, 157, 20, 328, + /* 1230 */ 369, 94, 328, 94, 349, 367, 95, 95, 158, 438, + /* 1240 */ 439, 95, 357, 95, 443, 444, 95, 362, 367, 364, + /* 1250 */ 334, 8, 9, 262, 92, 12, 13, 14, 15, 16, + /* 1260 */ 328, 20, 328, 328, 322, 322, 20, 364, 332, 383, + /* 1270 */ 385, 132, 332, 20, 389, 376, 20, 332, 393, 394, + /* 1280 */ 395, 396, 397, 398, 399, 378, 401, 64, 65, 404, + /* 1290 */ 376, 406, 407, 408, 71, 332, 332, 412, 413, 332, + /* 1300 */ 328, 377, 332, 377, 61, 82, 83, 168, 169, 170, + /* 1310 */ 377, 88, 173, 328, 322, 349, 320, 349, 394, 322, + /* 1320 */ 394, 362, 349, 349, 189, 349, 349, 394, 349, 190, + /* 1330 */ 349, 349, 193, 383, 195, 196, 197, 198, 199, 349, + /* 1340 */ 384, 330, 349, 382, 181, 349, 103, 423, 330, 423, + /* 1350 */ 364, 328, 328, 357, 376, 248, 423, 330, 362, 160, + /* 1360 */ 364, 377, 438, 439, 438, 439, 372, 443, 444, 443, + /* 1370 */ 444, 438, 439, 372, 362, 362, 443, 444, 394, 362, + /* 1380 */ 241, 385, 362, 362, 330, 389, 370, 345, 330, 393, + /* 1390 */ 394, 395, 396, 397, 398, 399, 357, 401, 20, 392, + /* 1400 */ 392, 158, 406, 362, 408, 249, 372, 423, 412, 413, + /* 1410 */ 19, 362, 429, 362, 362, 372, 255, 429, 422, 362, + /* 1420 */ 431, 320, 438, 439, 33, 167, 257, 443, 444, 256, + /* 1430 */ 244, 432, 429, 428, 264, 387, 261, 427, 47, 259, + /* 1440 */ 240, 426, 357, 52, 53, 54, 55, 56, 20, 94, + /* 1450 */ 349, 391, 94, 353, 448, 411, 362, 339, 357, 328, + /* 1460 */ 330, 442, 36, 362, 320, 364, 380, 441, 323, 322, + /* 1470 */ 375, 228, 229, 230, 231, 232, 233, 234, 235, 236, + /* 1480 */ 237, 238, 318, 343, 93, 331, 385, 96, 0, 0, + /* 1490 */ 389, 183, 343, 349, 393, 394, 395, 396, 397, 398, + /* 1500 */ 399, 357, 401, 343, 0, 0, 362, 406, 364, 408, + /* 1510 */ 42, 12, 13, 412, 413, 0, 35, 320, 194, 35, + /* 1520 */ 129, 22, 35, 194, 0, 35, 35, 35, 194, 385, + /* 1530 */ 0, 194, 33, 389, 35, 0, 35, 393, 394, 395, + /* 1540 */ 396, 397, 398, 399, 35, 401, 349, 0, 22, 0, + /* 1550 */ 406, 178, 408, 162, 357, 56, 412, 413, 176, 362, + /* 1560 */ 0, 364, 0, 0, 172, 171, 0, 68, 0, 46, + /* 1570 */ 320, 180, 0, 182, 0, 42, 0, 0, 0, 42, + /* 1580 */ 0, 0, 385, 0, 0, 0, 389, 0, 149, 35, + /* 1590 */ 393, 394, 395, 396, 397, 398, 399, 0, 401, 349, + /* 1600 */ 149, 0, 0, 406, 22, 408, 0, 357, 0, 412, + /* 1610 */ 413, 0, 362, 320, 364, 116, 0, 0, 0, 0, + /* 1620 */ 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, + /* 1630 */ 0, 0, 0, 0, 0, 385, 0, 0, 35, 389, + /* 1640 */ 0, 0, 349, 393, 394, 395, 396, 397, 398, 399, + /* 1650 */ 357, 401, 56, 0, 56, 362, 42, 364, 408, 14, + /* 1660 */ 14, 46, 412, 413, 167, 0, 320, 39, 0, 0, + /* 1670 */ 0, 0, 0, 0, 39, 176, 0, 178, 385, 0, + /* 1680 */ 0, 43, 389, 40, 35, 46, 393, 394, 395, 396, + /* 1690 */ 397, 398, 399, 39, 401, 349, 39, 47, 35, 200, + /* 1700 */ 201, 408, 47, 357, 62, 412, 413, 0, 362, 35, + /* 1710 */ 364, 0, 0, 214, 215, 216, 217, 218, 219, 220, + /* 1720 */ 39, 39, 320, 35, 47, 47, 39, 0, 0, 0, + /* 1730 */ 35, 385, 22, 0, 35, 389, 35, 43, 35, 393, + /* 1740 */ 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, + /* 1750 */ 35, 349, 43, 101, 103, 0, 22, 22, 0, 357, + /* 1760 */ 22, 0, 49, 22, 362, 35, 364, 0, 0, 0, + /* 1770 */ 22, 20, 35, 0, 35, 163, 0, 35, 95, 94, + /* 1780 */ 0, 22, 0, 0, 320, 94, 179, 385, 0, 4, + /* 1790 */ 3, 389, 0, 95, 0, 393, 394, 395, 396, 397, + /* 1800 */ 398, 399, 94, 401, 19, 35, 0, 163, 160, 104, + /* 1810 */ 94, 39, 46, 349, 94, 224, 226, 43, 33, 163, + /* 1820 */ 161, 357, 43, 165, 224, 159, 362, 95, 364, 43, + /* 1830 */ 46, 3, 47, 245, 94, 46, 51, 94, 43, 95, + /* 1840 */ 95, 56, 320, 94, 43, 95, 94, 445, 446, 385, + /* 1850 */ 188, 94, 43, 389, 94, 245, 94, 393, 394, 395, + /* 1860 */ 396, 397, 398, 399, 320, 401, 95, 35, 35, 35, + /* 1870 */ 95, 349, 408, 95, 35, 35, 354, 413, 93, 357, + /* 1880 */ 35, 96, 46, 46, 362, 95, 364, 43, 95, 46, + /* 1890 */ 2, 22, 200, 349, 94, 46, 46, 95, 94, 94, + /* 1900 */ 239, 357, 95, 95, 94, 245, 362, 385, 364, 94, + /* 1910 */ 94, 389, 95, 22, 95, 393, 394, 395, 396, 397, + /* 1920 */ 398, 399, 35, 401, 320, 202, 105, 35, 35, 385, + /* 1930 */ 95, 35, 94, 389, 35, 94, 94, 393, 394, 395, + /* 1940 */ 396, 397, 398, 399, 35, 401, 95, 403, 95, 94, + /* 1950 */ 22, 95, 94, 349, 106, 94, 94, 35, 94, 43, + /* 1960 */ 22, 357, 62, 61, 118, 118, 362, 320, 364, 35, + /* 1970 */ 118, 35, 118, 68, 35, 35, 35, 35, 35, 35, + /* 1980 */ 35, 35, 22, 22, 320, 91, 35, 35, 35, 385, + /* 1990 */ 43, 35, 35, 389, 35, 68, 349, 393, 394, 395, + /* 2000 */ 396, 397, 398, 399, 357, 401, 35, 35, 35, 362, + /* 2010 */ 35, 364, 35, 349, 22, 35, 0, 35, 39, 0, + /* 2020 */ 35, 357, 39, 47, 0, 47, 362, 39, 364, 35, + /* 2030 */ 0, 47, 385, 35, 47, 39, 389, 0, 320, 435, + /* 2040 */ 393, 394, 395, 396, 397, 398, 399, 35, 401, 385, + /* 2050 */ 35, 0, 21, 389, 22, 22, 320, 393, 394, 395, + /* 2060 */ 396, 397, 398, 399, 22, 401, 21, 349, 20, 449, + /* 2070 */ 449, 449, 354, 449, 449, 357, 449, 449, 449, 449, + /* 2080 */ 362, 449, 364, 449, 437, 349, 449, 449, 449, 449, + /* 2090 */ 354, 449, 449, 357, 449, 449, 449, 449, 362, 449, + /* 2100 */ 364, 449, 449, 385, 449, 449, 449, 389, 449, 449, + /* 2110 */ 446, 393, 394, 395, 396, 397, 398, 399, 320, 401, + /* 2120 */ 449, 385, 449, 449, 449, 389, 449, 449, 449, 393, + /* 2130 */ 394, 395, 396, 397, 398, 399, 449, 401, 449, 449, + /* 2140 */ 449, 449, 320, 449, 449, 449, 449, 349, 449, 449, + /* 2150 */ 449, 449, 449, 449, 449, 357, 449, 449, 449, 449, + /* 2160 */ 362, 449, 364, 449, 449, 449, 449, 449, 449, 449, + /* 2170 */ 449, 349, 449, 449, 449, 449, 449, 449, 449, 357, + /* 2180 */ 449, 449, 449, 385, 362, 320, 364, 389, 449, 449, + /* 2190 */ 449, 393, 394, 395, 396, 397, 398, 399, 449, 401, + /* 2200 */ 449, 449, 449, 449, 449, 320, 449, 385, 449, 449, + /* 2210 */ 449, 389, 449, 449, 349, 393, 394, 395, 396, 397, + /* 2220 */ 398, 399, 357, 401, 449, 449, 449, 362, 449, 364, + /* 2230 */ 449, 449, 449, 449, 349, 449, 449, 449, 449, 449, + /* 2240 */ 449, 449, 357, 449, 449, 449, 449, 362, 449, 364, + /* 2250 */ 385, 449, 449, 449, 389, 449, 449, 449, 393, 394, + /* 2260 */ 395, 396, 397, 398, 399, 449, 401, 449, 320, 449, + /* 2270 */ 385, 449, 449, 449, 389, 449, 449, 449, 393, 394, + /* 2280 */ 395, 396, 397, 398, 399, 449, 401, 320, 449, 449, + /* 2290 */ 449, 449, 449, 449, 449, 449, 449, 349, 449, 449, + /* 2300 */ 449, 449, 449, 449, 449, 357, 449, 449, 449, 449, + /* 2310 */ 362, 449, 364, 449, 449, 449, 349, 449, 449, 449, + /* 2320 */ 449, 449, 449, 449, 357, 449, 449, 449, 449, 362, + /* 2330 */ 320, 364, 449, 385, 449, 449, 449, 389, 449, 449, + /* 2340 */ 449, 393, 394, 395, 396, 397, 398, 399, 449, 401, + /* 2350 */ 449, 449, 385, 449, 449, 449, 389, 449, 449, 349, + /* 2360 */ 393, 394, 395, 396, 397, 398, 399, 357, 401, 449, + /* 2370 */ 449, 449, 362, 449, 364, 449, 449, 449, 449, 449, + /* 2380 */ 449, 320, 449, 449, 449, 449, 449, 449, 449, 449, + /* 2390 */ 449, 449, 449, 449, 449, 385, 449, 449, 449, 389, + /* 2400 */ 449, 320, 449, 393, 394, 395, 396, 397, 398, 399, + /* 2410 */ 349, 401, 449, 449, 449, 449, 449, 449, 357, 449, + /* 2420 */ 449, 449, 449, 362, 449, 364, 449, 449, 449, 449, + /* 2430 */ 349, 449, 449, 449, 449, 449, 449, 449, 357, 449, + /* 2440 */ 449, 449, 449, 362, 449, 364, 385, 449, 449, 449, + /* 2450 */ 389, 449, 320, 449, 393, 394, 395, 396, 397, 398, + /* 2460 */ 399, 449, 401, 449, 449, 449, 385, 449, 449, 449, + /* 2470 */ 389, 449, 449, 449, 393, 394, 395, 396, 397, 398, + /* 2480 */ 399, 349, 401, 449, 449, 449, 449, 449, 449, 357, + /* 2490 */ 449, 449, 449, 449, 362, 449, 364, 449, 449, 449, + /* 2500 */ 449, 449, 449, 449, 449, 320, 449, 449, 449, 449, + /* 2510 */ 449, 449, 449, 449, 449, 449, 449, 385, 449, 449, + /* 2520 */ 449, 389, 449, 449, 449, 393, 394, 395, 396, 397, + /* 2530 */ 398, 399, 449, 401, 349, 449, 449, 449, 449, 449, + /* 2540 */ 449, 449, 357, 449, 449, 449, 449, 362, 320, 364, + /* 2550 */ 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + /* 2560 */ 449, 449, 449, 449, 449, 449, 449, 449, 320, 449, + /* 2570 */ 385, 449, 449, 449, 389, 449, 449, 349, 393, 394, + /* 2580 */ 395, 396, 397, 398, 399, 357, 401, 449, 449, 449, + /* 2590 */ 362, 449, 364, 449, 449, 449, 449, 349, 449, 449, + /* 2600 */ 449, 449, 449, 449, 449, 357, 449, 449, 449, 449, + /* 2610 */ 362, 449, 364, 385, 449, 449, 449, 389, 449, 449, + /* 2620 */ 449, 393, 394, 395, 396, 397, 398, 399, 449, 401, + /* 2630 */ 449, 320, 449, 385, 449, 449, 449, 389, 449, 449, + /* 2640 */ 449, 393, 394, 395, 396, 397, 398, 399, 449, 401, + /* 2650 */ 320, 449, 449, 449, 449, 449, 449, 449, 449, 449, + /* 2660 */ 349, 449, 449, 449, 449, 449, 449, 449, 357, 449, + /* 2670 */ 449, 449, 449, 362, 449, 364, 449, 449, 449, 349, + /* 2680 */ 449, 449, 449, 449, 449, 449, 449, 357, 449, 449, + /* 2690 */ 449, 449, 362, 320, 364, 449, 385, 449, 449, 449, + /* 2700 */ 389, 449, 449, 449, 393, 394, 395, 396, 397, 398, + /* 2710 */ 399, 449, 401, 449, 449, 385, 449, 449, 449, 389, + /* 2720 */ 449, 449, 349, 393, 394, 395, 396, 397, 398, 399, + /* 2730 */ 357, 401, 449, 449, 449, 362, 449, 364, 449, 449, + /* 2740 */ 449, 449, 449, 449, 320, 449, 449, 449, 449, 449, + /* 2750 */ 449, 449, 449, 449, 449, 449, 449, 449, 385, 449, + /* 2760 */ 449, 449, 389, 449, 320, 449, 393, 394, 395, 396, + /* 2770 */ 397, 398, 399, 349, 401, 449, 449, 449, 449, 449, + /* 2780 */ 449, 357, 449, 449, 449, 449, 362, 449, 364, 449, + /* 2790 */ 449, 449, 449, 349, 449, 449, 449, 449, 449, 449, + /* 2800 */ 449, 357, 449, 449, 449, 449, 362, 449, 364, 385, + /* 2810 */ 449, 449, 449, 389, 449, 320, 449, 393, 394, 395, + /* 2820 */ 396, 397, 398, 399, 449, 401, 449, 449, 449, 385, + /* 2830 */ 449, 449, 449, 389, 449, 449, 449, 393, 394, 395, + /* 2840 */ 396, 397, 398, 399, 349, 401, 449, 449, 449, 449, + /* 2850 */ 449, 449, 357, 449, 449, 449, 449, 362, 449, 364, + /* 2860 */ 449, 449, 449, 449, 449, 449, 449, 449, 320, 449, + /* 2870 */ 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + /* 2880 */ 385, 449, 449, 449, 389, 449, 449, 449, 393, 394, + /* 2890 */ 395, 396, 397, 398, 399, 449, 401, 349, 449, 449, + /* 2900 */ 449, 449, 449, 449, 449, 357, 449, 449, 449, 449, + /* 2910 */ 362, 320, 364, 449, 449, 449, 449, 449, 449, 449, + /* 2920 */ 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + /* 2930 */ 449, 449, 449, 385, 449, 449, 449, 389, 449, 449, + /* 2940 */ 349, 393, 394, 395, 396, 397, 398, 399, 357, 401, + /* 2950 */ 449, 449, 449, 362, 449, 364, 449, 449, 449, 449, + /* 2960 */ 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + /* 2970 */ 449, 449, 449, 449, 449, 449, 385, 449, 449, 449, + /* 2980 */ 389, 449, 449, 449, 393, 394, 395, 396, 397, 398, + /* 2990 */ 399, 449, 401, }; -#define YY_SHIFT_COUNT (688) +#define YY_SHIFT_COUNT (692) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2086) +#define YY_SHIFT_MAX (2051) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 1071, 0, 57, 267, 57, 324, 324, 324, 534, 324, - /* 10 */ 324, 324, 324, 324, 591, 801, 801, 858, 801, 801, - /* 20 */ 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, - /* 30 */ 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, - /* 40 */ 801, 801, 801, 801, 801, 801, 53, 86, 83, 192, - /* 50 */ 276, 62, 85, 62, 83, 83, 1524, 1524, 62, 1524, - /* 60 */ 1524, 87, 62, 207, 207, 30, 30, 8, 207, 207, - /* 70 */ 207, 207, 207, 207, 207, 207, 207, 207, 73, 207, - /* 80 */ 207, 207, 214, 207, 207, 313, 207, 207, 313, 332, - /* 90 */ 207, 313, 313, 313, 207, 354, 1005, 1196, 1196, 283, - /* 100 */ 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, - /* 110 */ 381, 381, 381, 381, 381, 381, 381, 381, 381, 464, - /* 120 */ 883, 26, 8, 336, 336, 391, 487, 609, 209, 209, - /* 130 */ 542, 542, 542, 487, 476, 476, 315, 214, 523, 523, - /* 140 */ 330, 313, 313, 490, 490, 315, 546, 397, 397, 397, - /* 150 */ 397, 397, 397, 397, 1452, 137, 413, 768, 1327, 91, - /* 160 */ 67, 254, 226, 379, 132, 774, 175, 686, 587, 144, - /* 170 */ 837, 587, 907, 722, 575, 981, 1178, 1052, 1191, 1214, - /* 180 */ 1214, 1191, 1088, 1088, 1156, 1214, 1214, 1214, 1242, 1242, - /* 190 */ 1253, 73, 214, 73, 1260, 1261, 73, 1260, 73, 73, - /* 200 */ 73, 1214, 73, 1242, 313, 313, 313, 313, 313, 313, - /* 210 */ 313, 313, 313, 313, 313, 1214, 1242, 490, 1145, 1253, - /* 220 */ 354, 1160, 214, 354, 1214, 1214, 1260, 354, 1102, 490, - /* 230 */ 490, 490, 490, 1102, 490, 1210, 354, 315, 354, 476, - /* 240 */ 1375, 1375, 490, 1152, 1102, 490, 490, 1152, 1102, 490, - /* 250 */ 490, 313, 1155, 1251, 1152, 1181, 1183, 1201, 981, 1176, - /* 260 */ 1198, 1202, 1220, 476, 1445, 1372, 1379, 490, 546, 1214, - /* 270 */ 354, 1450, 1242, 2818, 2818, 2818, 2818, 2818, 2818, 2818, - /* 280 */ 1111, 189, 223, 812, 680, 216, 749, 50, 715, 1072, - /* 290 */ 446, 978, 978, 978, 978, 978, 978, 978, 978, 978, - /* 300 */ 459, 191, 11, 11, 179, 112, 210, 79, 360, 557, - /* 310 */ 364, 477, 15, 475, 477, 477, 477, 346, 898, 933, - /* 320 */ 872, 874, 932, 950, 963, 1027, 1028, 999, 819, 842, - /* 330 */ 1010, 1040, 1064, 1073, 1075, 1078, 869, 670, 867, 1036, - /* 340 */ 1039, 818, 1069, 915, 1120, 889, 1077, 1121, 1124, 1136, - /* 350 */ 1159, 1170, 1177, 1002, 1079, 1087, 1104, 1207, 1494, 1496, - /* 360 */ 1314, 1500, 1501, 1467, 1510, 1476, 1319, 1479, 1480, 1482, - /* 370 */ 1324, 1519, 1492, 1495, 1337, 1532, 1340, 1541, 1503, 1542, - /* 380 */ 1522, 1543, 1512, 1371, 1374, 1551, 1552, 1381, 1383, 1555, - /* 390 */ 1556, 1514, 1561, 1562, 1563, 1523, 1564, 1567, 1568, 1416, - /* 400 */ 1572, 1574, 1575, 1576, 1577, 1429, 1544, 1582, 1435, 1585, - /* 410 */ 1587, 1588, 1589, 1590, 1591, 1595, 1596, 1597, 1599, 1600, - /* 420 */ 1601, 1611, 1613, 1581, 1616, 1618, 1619, 1624, 1626, 1628, - /* 430 */ 1571, 1629, 1633, 1637, 1639, 1606, 1642, 1594, 1643, 1598, - /* 440 */ 1644, 1645, 1605, 1627, 1612, 1635, 1617, 1651, 1621, 1668, - /* 450 */ 1630, 1634, 1669, 1672, 1677, 1641, 1526, 1681, 1694, 1695, - /* 460 */ 1636, 1696, 1697, 1664, 1654, 1665, 1703, 1670, 1659, 1671, - /* 470 */ 1707, 1674, 1666, 1673, 1711, 1679, 1675, 1676, 1717, 1718, - /* 480 */ 1719, 1720, 1623, 1631, 1692, 1706, 1729, 1698, 1699, 1687, - /* 490 */ 1688, 1700, 1710, 1724, 1747, 1727, 1750, 1737, 1702, 1761, - /* 500 */ 1740, 1728, 1764, 1730, 1766, 1732, 1768, 1748, 1751, 1678, - /* 510 */ 1682, 1774, 1614, 1743, 1775, 1602, 1757, 1620, 1622, 1784, - /* 520 */ 1788, 1632, 1625, 1786, 1791, 1792, 1793, 1705, 1701, 1759, - /* 530 */ 1609, 1800, 1708, 1640, 1713, 1809, 1771, 1655, 1731, 1722, - /* 540 */ 1781, 1789, 1607, 1646, 1615, 1790, 1592, 1746, 1754, 1758, - /* 550 */ 1762, 1763, 1760, 1798, 1776, 1772, 1778, 1779, 1780, 1810, - /* 560 */ 1828, 1831, 1785, 1835, 1647, 1787, 1794, 1877, 1841, 1648, - /* 570 */ 1851, 1852, 1853, 1857, 1859, 1860, 1801, 1802, 1855, 1662, - /* 580 */ 1862, 1856, 1861, 1908, 1881, 1709, 1812, 1824, 1829, 1827, - /* 590 */ 1830, 1832, 1880, 1842, 1844, 1893, 1846, 1920, 1742, 1849, - /* 600 */ 1840, 1854, 1911, 1912, 1858, 1863, 1915, 1865, 1866, 1916, - /* 610 */ 1869, 1871, 1921, 1870, 1872, 1925, 1874, 1864, 1873, 1876, - /* 620 */ 1878, 1947, 1868, 1883, 1884, 1936, 1887, 1932, 1932, 1961, - /* 630 */ 1933, 1938, 1965, 1975, 1976, 1977, 1979, 1980, 1982, 1983, - /* 640 */ 1984, 1985, 1956, 1931, 1986, 1990, 1991, 2006, 1995, 2009, - /* 650 */ 1997, 1998, 1999, 1968, 1687, 2003, 1688, 2004, 2008, 2010, - /* 660 */ 2011, 2019, 2012, 2049, 2015, 2017, 2022, 2051, 2027, 2018, - /* 670 */ 2029, 2066, 2034, 2023, 2039, 2080, 2046, 2035, 2044, 2084, - /* 680 */ 2050, 2052, 2086, 2067, 2069, 2070, 2071, 2073, 2075, + /* 0 */ 1139, 0, 57, 269, 57, 326, 326, 326, 538, 326, + /* 10 */ 326, 326, 326, 326, 595, 807, 807, 864, 807, 807, + /* 20 */ 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, + /* 30 */ 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, + /* 40 */ 807, 807, 807, 807, 807, 807, 12, 14, 90, 62, + /* 50 */ 83, 80, 258, 80, 90, 90, 1499, 1499, 80, 1499, + /* 60 */ 1499, 87, 80, 113, 113, 53, 53, 23, 113, 113, + /* 70 */ 113, 113, 113, 113, 113, 113, 113, 113, 43, 113, + /* 80 */ 113, 113, 208, 113, 113, 288, 113, 113, 288, 306, + /* 90 */ 113, 288, 288, 288, 113, 142, 1070, 1243, 1243, 285, + /* 100 */ 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, + /* 110 */ 800, 800, 800, 800, 800, 800, 800, 800, 800, 195, + /* 120 */ 1223, 26, 23, 340, 340, 54, 381, 182, 336, 336, + /* 130 */ 442, 442, 442, 381, 448, 448, 448, 462, 208, 1, + /* 140 */ 1, 409, 288, 288, 437, 437, 462, 597, 399, 399, + /* 150 */ 399, 399, 399, 399, 399, 1391, 137, 572, 774, 791, + /* 160 */ 201, 67, 171, 220, 351, 130, 677, 828, 761, 664, + /* 170 */ 758, 777, 664, 944, 847, 891, 928, 1143, 1025, 1158, + /* 180 */ 1158, 1208, 1208, 1158, 1080, 1080, 1162, 1208, 1208, 1208, + /* 190 */ 1241, 1241, 1246, 43, 208, 43, 1253, 1256, 43, 1253, + /* 200 */ 43, 43, 43, 1208, 43, 1241, 288, 288, 288, 288, + /* 210 */ 288, 288, 288, 288, 288, 288, 288, 1208, 1241, 437, + /* 220 */ 1135, 1246, 142, 1163, 208, 142, 1208, 1208, 1253, 142, + /* 230 */ 1107, 437, 437, 437, 437, 1107, 437, 1199, 142, 462, + /* 240 */ 142, 448, 1378, 1378, 437, 1156, 1107, 437, 437, 1156, + /* 250 */ 1107, 437, 437, 288, 1161, 1258, 1156, 1169, 1173, 1186, + /* 260 */ 928, 1170, 1175, 1180, 1200, 448, 1428, 1355, 1358, 437, + /* 270 */ 597, 1208, 142, 1426, 1241, 2993, 2993, 2993, 2993, 2993, + /* 280 */ 2993, 2993, 1066, 191, 403, 1785, 754, 684, 1098, 50, + /* 290 */ 845, 1038, 471, 1047, 1047, 1047, 1047, 1047, 1047, 1047, + /* 300 */ 1047, 1047, 603, 123, 11, 11, 157, 101, 542, 79, + /* 310 */ 362, 427, 211, 59, 589, 265, 59, 59, 59, 941, + /* 320 */ 1002, 369, 884, 890, 892, 898, 905, 975, 1009, 1096, + /* 330 */ 586, 841, 949, 998, 1014, 1065, 1072, 1073, 1077, 902, + /* 340 */ 785, 991, 1090, 1079, 527, 1004, 987, 1084, 433, 1137, + /* 350 */ 1091, 1141, 1142, 1146, 1148, 1151, 1000, 1088, 1089, 802, + /* 360 */ 1125, 1488, 1489, 1308, 1504, 1505, 1468, 1515, 1481, 1324, + /* 370 */ 1484, 1487, 1490, 1329, 1524, 1491, 1492, 1334, 1530, 1337, + /* 380 */ 1535, 1501, 1547, 1526, 1549, 1509, 1373, 1382, 1560, 1562, + /* 390 */ 1392, 1394, 1563, 1566, 1523, 1568, 1572, 1574, 1533, 1576, + /* 400 */ 1577, 1578, 1537, 1580, 1581, 1583, 1584, 1585, 1587, 1439, + /* 410 */ 1554, 1597, 1451, 1601, 1602, 1606, 1608, 1611, 1616, 1617, + /* 420 */ 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1586, 1625, 1626, + /* 430 */ 1627, 1629, 1630, 1631, 1582, 1632, 1633, 1634, 1636, 1603, + /* 440 */ 1637, 1596, 1640, 1598, 1641, 1653, 1614, 1628, 1638, 1645, + /* 450 */ 1615, 1646, 1639, 1668, 1643, 1635, 1669, 1670, 1671, 1654, + /* 460 */ 1497, 1665, 1672, 1673, 1642, 1676, 1679, 1649, 1650, 1657, + /* 470 */ 1680, 1663, 1655, 1681, 1707, 1674, 1677, 1682, 1711, 1688, + /* 480 */ 1678, 1687, 1712, 1727, 1728, 1729, 1651, 1652, 1695, 1710, + /* 490 */ 1733, 1699, 1701, 1694, 1709, 1703, 1715, 1734, 1755, 1735, + /* 500 */ 1758, 1738, 1713, 1761, 1741, 1730, 1767, 1737, 1768, 1739, + /* 510 */ 1769, 1748, 1751, 1683, 1685, 1773, 1612, 1742, 1776, 1607, + /* 520 */ 1759, 1644, 1648, 1780, 1782, 1656, 1658, 1787, 1783, 1788, + /* 530 */ 1792, 1691, 1698, 1770, 1662, 1794, 1708, 1659, 1716, 1806, + /* 540 */ 1772, 1666, 1720, 1705, 1766, 1774, 1591, 1590, 1600, 1779, + /* 550 */ 1588, 1740, 1732, 1743, 1744, 1745, 1749, 1786, 1750, 1752, + /* 560 */ 1757, 1760, 1771, 1795, 1784, 1789, 1762, 1801, 1610, 1775, + /* 570 */ 1778, 1828, 1809, 1660, 1832, 1833, 1834, 1839, 1840, 1845, + /* 580 */ 1790, 1793, 1836, 1661, 1844, 1837, 1843, 1888, 1869, 1692, + /* 590 */ 1800, 1802, 1804, 1807, 1805, 1808, 1849, 1810, 1815, 1850, + /* 600 */ 1817, 1891, 1723, 1816, 1821, 1819, 1887, 1892, 1838, 1835, + /* 610 */ 1893, 1841, 1851, 1896, 1842, 1853, 1899, 1855, 1856, 1909, + /* 620 */ 1858, 1846, 1847, 1852, 1854, 1928, 1848, 1861, 1862, 1922, + /* 630 */ 1864, 1916, 1916, 1938, 1900, 1902, 1934, 1936, 1939, 1940, + /* 640 */ 1941, 1942, 1943, 1944, 1945, 1946, 1905, 1894, 1947, 1951, + /* 650 */ 1952, 1960, 1953, 1961, 1956, 1957, 1959, 1927, 1694, 1971, + /* 660 */ 1709, 1972, 1973, 1975, 1977, 1992, 1980, 2016, 1982, 1976, + /* 670 */ 1979, 2019, 1985, 1978, 1983, 2024, 1994, 1984, 1988, 2030, + /* 680 */ 1998, 1987, 1996, 2037, 2012, 2015, 2051, 2032, 2031, 2033, + /* 690 */ 2042, 2045, 2048, }; -#define YY_REDUCE_COUNT (279) -#define YY_REDUCE_MIN (-349) -#define YY_REDUCE_MAX (2418) +#define YY_REDUCE_COUNT (281) +#define YY_REDUCE_MIN (-379) +#define YY_REDUCE_MAX (2591) static const short yy_reduce_ofst[] = { - /* 0 */ 445, -251, -311, 896, 13, 280, 547, 968, 261, 990, - /* 10 */ 1057, 1129, 1211, 1265, 1291, 528, 1361, 1425, 1451, 1468, - /* 20 */ 1521, 1538, 1593, 1610, 1661, 1680, 1741, 1799, 1821, 1882, - /* 30 */ 1901, 1954, 1971, 2014, 2038, 2057, 2118, 2137, 2201, 2219, - /* 40 */ 2262, 2315, 2332, 2375, 2399, 2418, 21, 278, -221, 603, - /* 50 */ 605, 884, 1041, 1194, -28, 814, -349, -346, -314, -339, - /* 60 */ -65, -63, 159, 39, 323, -320, -316, -343, 222, 281, - /* 70 */ 296, 378, 430, 501, 503, 509, 512, 517, -299, 522, - /* 80 */ 558, 574, -243, 578, 580, 113, 643, 705, -239, -198, - /* 90 */ 764, 109, -9, 250, 765, 287, -70, -310, -310, -287, - /* 100 */ -317, -134, -30, 35, 93, 143, 208, 302, 320, 321, - /* 110 */ 327, 348, 365, 414, 418, 468, 470, 472, 543, -245, - /* 120 */ 263, -215, -163, -173, -33, -47, 284, 443, -348, 61, - /* 130 */ -215, 370, 400, 297, 460, 467, 107, 480, 239, 399, - /* 140 */ 241, 362, 526, 494, 519, 616, 562, 514, 553, 655, - /* 150 */ 709, 751, 753, 769, 387, 555, 707, 668, 628, 690, - /* 160 */ 798, 698, 784, 784, 805, 808, 777, 747, 799, 799, - /* 170 */ 728, 799, 809, 795, 784, 838, 840, 850, 870, 910, - /* 180 */ 912, 875, 880, 885, 917, 926, 927, 934, 943, 951, - /* 190 */ 893, 945, 916, 947, 908, 909, 954, 920, 966, 967, - /* 200 */ 973, 983, 974, 991, 965, 969, 970, 971, 972, 975, - /* 210 */ 977, 982, 984, 985, 986, 987, 994, 976, 953, 957, - /* 220 */ 1011, 960, 980, 1015, 1018, 1020, 979, 1019, 988, 989, - /* 230 */ 996, 997, 1006, 998, 1009, 1003, 1048, 1037, 1062, 1038, - /* 240 */ 1007, 1012, 1043, 993, 1035, 1046, 1047, 1008, 1044, 1051, - /* 250 */ 1053, 784, 1004, 992, 1014, 1013, 1017, 1021, 1061, 1023, - /* 260 */ 1024, 1016, 799, 1105, 1081, 1063, 1123, 1115, 1142, 1154, - /* 270 */ 1153, 1166, 1168, 1112, 1119, 1157, 1161, 1162, 1164, 1179, + /* 0 */ 400, -253, -313, 885, 13, 282, 551, 996, 263, 1101, + /* 10 */ 1144, 1197, 1250, 1293, 1346, 532, 1402, 1464, 1522, 1544, + /* 20 */ 1604, 1647, 1664, 1718, 1736, 1798, 1822, 1865, 1885, 1948, + /* 30 */ 1967, 2010, 2061, 2081, 2132, 2185, 2228, 2248, 2311, 2330, + /* 40 */ 2373, 2424, 2444, 2495, 2548, 2591, 21, 280, -223, 801, + /* 50 */ 924, 926, 933, 984, -98, -28, -351, -348, -316, -341, + /* 60 */ -20, 131, 475, 27, 36, -322, -318, -345, -312, 225, + /* 70 */ 236, 238, 261, 276, 283, 286, 313, 436, -231, 493, + /* 80 */ 508, 550, -245, 552, 555, -51, 565, 613, -22, -200, + /* 90 */ 615, 64, 30, 109, 380, 28, -311, -379, -379, -65, + /* 100 */ -137, -27, -15, 197, 248, 259, 293, 304, 329, 353, + /* 110 */ 416, 464, 472, 504, 505, 510, 526, 544, 619, -62, + /* 120 */ -102, 133, -165, 170, 244, 111, 165, 320, 230, 305, + /* 130 */ 133, 228, 491, 221, -12, 417, 534, 430, 467, 312, + /* 140 */ 512, 547, -211, 273, 606, 612, 637, 623, 390, 415, + /* 150 */ 482, 495, 585, 611, 627, 588, 722, 666, 651, 765, + /* 160 */ 663, 776, 696, 779, 779, 829, 832, 803, 769, 744, + /* 170 */ 744, 726, 744, 755, 746, 779, 794, 806, 809, 833, + /* 180 */ 835, 901, 904, 861, 868, 881, 916, 932, 934, 935, + /* 190 */ 942, 943, 886, 936, 903, 940, 899, 907, 945, 914, + /* 200 */ 963, 964, 967, 972, 970, 992, 966, 968, 973, 974, + /* 210 */ 976, 977, 979, 981, 982, 990, 993, 985, 997, 959, + /* 220 */ 956, 950, 1011, 961, 986, 1018, 1023, 1024, 978, 1027, + /* 230 */ 994, 1012, 1013, 1017, 1020, 1001, 1021, 1016, 1054, 1042, + /* 240 */ 1058, 1039, 1007, 1008, 1041, 983, 1034, 1049, 1051, 988, + /* 250 */ 1043, 1052, 1057, 779, 999, 989, 1003, 1005, 1010, 1015, + /* 260 */ 1048, 1006, 1019, 1026, 744, 1085, 1060, 1044, 1100, 1094, + /* 270 */ 1118, 1131, 1130, 1145, 1147, 1086, 1095, 1140, 1149, 1160, + /* 280 */ 1154, 1164, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 10 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 20 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 30 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 40 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 50 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 60 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 70 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1608, 1534, - /* 80 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 90 */ 1534, 1534, 1534, 1534, 1534, 1606, 1773, 1959, 1534, 1534, - /* 100 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 110 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 120 */ 1534, 1971, 1534, 1534, 1534, 1608, 1534, 1606, 1931, 1931, - /* 130 */ 1971, 1971, 1971, 1534, 1534, 1534, 1713, 1534, 1814, 1814, - /* 140 */ 1534, 1534, 1534, 1534, 1534, 1713, 1534, 1534, 1534, 1534, - /* 150 */ 1534, 1534, 1534, 1534, 1808, 1534, 1996, 2049, 1534, 1534, - /* 160 */ 1534, 1999, 1534, 1534, 1534, 1534, 1666, 1986, 1963, 1977, - /* 170 */ 2033, 1964, 1961, 1980, 1534, 1990, 1534, 1801, 1778, 1534, - /* 180 */ 1534, 1778, 1775, 1775, 1657, 1534, 1534, 1534, 1534, 1534, - /* 190 */ 1534, 1608, 1534, 1608, 1534, 1534, 1608, 1534, 1608, 1608, - /* 200 */ 1608, 1534, 1608, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 210 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1820, 1534, - /* 220 */ 1606, 1810, 1534, 1606, 1534, 1534, 1534, 1606, 2004, 1534, - /* 230 */ 1534, 1534, 1534, 2004, 1534, 1534, 1606, 1534, 1606, 1534, - /* 240 */ 1534, 1534, 1534, 2006, 2004, 1534, 1534, 2006, 2004, 1534, - /* 250 */ 1534, 1534, 2018, 2014, 2006, 2022, 2020, 1992, 1990, 2052, - /* 260 */ 2039, 2035, 1977, 1534, 1534, 1534, 1682, 1534, 1534, 1534, - /* 270 */ 1606, 1566, 1534, 1803, 1814, 1716, 1716, 1716, 1609, 1539, - /* 280 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 290 */ 1534, 1889, 1534, 2017, 2016, 1935, 1934, 1933, 1924, 1888, - /* 300 */ 1534, 1678, 1887, 1886, 1534, 1534, 1534, 1534, 1534, 1534, - /* 310 */ 1534, 1880, 1534, 1534, 1881, 1879, 1878, 1534, 1534, 1534, - /* 320 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 330 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 2036, 2040, 1960, - /* 340 */ 1534, 1534, 1534, 1534, 1534, 1871, 1862, 1534, 1534, 1534, - /* 350 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 360 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 370 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 380 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 390 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 400 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 410 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 420 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 430 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 440 */ 1534, 1534, 1534, 1534, 1571, 1534, 1534, 1534, 1534, 1534, - /* 450 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 460 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 470 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 480 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1647, - /* 490 */ 1646, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 500 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1870, - /* 510 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 520 */ 1534, 1534, 1534, 2032, 1534, 1534, 1534, 1534, 1534, 1534, - /* 530 */ 1534, 1818, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 540 */ 1534, 1921, 1534, 1534, 1534, 1993, 1534, 1534, 1534, 1534, - /* 550 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 560 */ 1534, 1862, 1534, 2015, 1534, 1534, 2030, 1534, 2034, 1534, - /* 570 */ 1534, 1534, 1534, 1534, 1534, 1534, 1970, 1966, 1534, 1534, - /* 580 */ 1962, 1861, 1534, 1955, 1534, 1534, 1906, 1534, 1534, 1534, - /* 590 */ 1534, 1534, 1534, 1534, 1534, 1534, 1870, 1534, 1874, 1534, - /* 600 */ 1534, 1534, 1534, 1534, 1710, 1534, 1534, 1534, 1534, 1534, - /* 610 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1695, 1693, 1692, - /* 620 */ 1691, 1534, 1688, 1534, 1534, 1534, 1534, 1719, 1718, 1534, - /* 630 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 640 */ 1534, 1534, 1534, 1534, 1628, 1534, 1534, 1534, 1534, 1534, - /* 650 */ 1534, 1534, 1534, 1534, 1619, 1534, 1618, 1534, 1534, 1534, - /* 660 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 670 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, - /* 680 */ 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, + /* 0 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 10 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 20 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 30 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 40 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 50 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 60 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 70 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1617, 1543, + /* 80 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 90 */ 1543, 1543, 1543, 1543, 1543, 1615, 1783, 1971, 1543, 1543, + /* 100 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 110 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 120 */ 1543, 1983, 1543, 1543, 1543, 1617, 1543, 1615, 1943, 1943, + /* 130 */ 1983, 1983, 1983, 1543, 1543, 1543, 1543, 1722, 1543, 1824, + /* 140 */ 1824, 1543, 1543, 1543, 1543, 1543, 1722, 1543, 1543, 1543, + /* 150 */ 1543, 1543, 1543, 1543, 1543, 1818, 1543, 2008, 2061, 1543, + /* 160 */ 1543, 1543, 2011, 1543, 1543, 1543, 1543, 1675, 1998, 1975, + /* 170 */ 1989, 2045, 1976, 1973, 1992, 1543, 2002, 1543, 1811, 1788, + /* 180 */ 1788, 1543, 1543, 1788, 1785, 1785, 1666, 1543, 1543, 1543, + /* 190 */ 1543, 1543, 1543, 1617, 1543, 1617, 1543, 1543, 1617, 1543, + /* 200 */ 1617, 1617, 1617, 1543, 1617, 1543, 1543, 1543, 1543, 1543, + /* 210 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 220 */ 1830, 1543, 1615, 1820, 1543, 1615, 1543, 1543, 1543, 1615, + /* 230 */ 2016, 1543, 1543, 1543, 1543, 2016, 1543, 1543, 1615, 1543, + /* 240 */ 1615, 1543, 1543, 1543, 1543, 2018, 2016, 1543, 1543, 2018, + /* 250 */ 2016, 1543, 1543, 1543, 2030, 2026, 2018, 2034, 2032, 2004, + /* 260 */ 2002, 2064, 2051, 2047, 1989, 1543, 1543, 1543, 1691, 1543, + /* 270 */ 1543, 1543, 1615, 1575, 1543, 1813, 1824, 1725, 1725, 1725, + /* 280 */ 1618, 1548, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 290 */ 1543, 1543, 1543, 1899, 1543, 2029, 2028, 1947, 1946, 1945, + /* 300 */ 1936, 1898, 1543, 1687, 1897, 1896, 1543, 1543, 1543, 1543, + /* 310 */ 1543, 1543, 1543, 1890, 1543, 1543, 1891, 1889, 1888, 1543, + /* 320 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 330 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 340 */ 2048, 2052, 1972, 1543, 1543, 1543, 1543, 1543, 1881, 1872, + /* 350 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 360 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 370 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 380 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 390 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 400 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 410 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 420 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 430 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 440 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1580, 1543, + /* 450 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 460 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 470 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 480 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 490 */ 1543, 1543, 1543, 1656, 1655, 1543, 1543, 1543, 1543, 1543, + /* 500 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 510 */ 1543, 1543, 1543, 1880, 1543, 1543, 1543, 1543, 1543, 1543, + /* 520 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 2044, 1543, 1543, + /* 530 */ 1543, 1543, 1543, 1543, 1543, 1828, 1543, 1543, 1543, 1543, + /* 540 */ 1543, 1543, 1543, 1543, 1543, 1933, 1543, 1543, 1543, 2005, + /* 550 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 560 */ 1543, 1543, 1543, 1543, 1543, 1872, 1543, 2027, 1543, 1543, + /* 570 */ 2042, 1543, 2046, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 580 */ 1982, 1978, 1543, 1543, 1974, 1871, 1543, 1967, 1543, 1543, + /* 590 */ 1918, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 600 */ 1880, 1543, 1884, 1543, 1543, 1543, 1543, 1543, 1719, 1543, + /* 610 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 620 */ 1543, 1704, 1702, 1701, 1700, 1543, 1697, 1543, 1543, 1543, + /* 630 */ 1543, 1728, 1727, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 640 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1637, 1543, + /* 650 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1628, 1543, + /* 660 */ 1627, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 670 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 680 */ 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + /* 690 */ 1543, 1543, 1543, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1192,6 +1231,8 @@ static const YYCODETYPE yyFallback[] = { 0, /* WSTART => nothing */ 0, /* WEND => nothing */ 0, /* WDURATION => nothing */ + 0, /* IROWTS => nothing */ + 0, /* QTAGS => nothing */ 0, /* CAST => nothing */ 0, /* NOW => nothing */ 0, /* TODAY => nothing */ @@ -1203,7 +1244,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* COUNT => nothing */ 0, /* LAST_ROW => nothing */ 0, /* CASE => nothing */ - 263, /* END => ABORT */ + 265, /* END => ABORT */ 0, /* WHEN => nothing */ 0, /* THEN => nothing */ 0, /* ELSE => nothing */ @@ -1245,57 +1286,57 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 263, /* AFTER => ABORT */ - 263, /* ATTACH => ABORT */ - 263, /* BEFORE => ABORT */ - 263, /* BEGIN => ABORT */ - 263, /* BITAND => ABORT */ - 263, /* BITNOT => ABORT */ - 263, /* BITOR => ABORT */ - 263, /* BLOCKS => ABORT */ - 263, /* CHANGE => ABORT */ - 263, /* COMMA => ABORT */ - 263, /* COMPACT => ABORT */ - 263, /* CONCAT => ABORT */ - 263, /* CONFLICT => ABORT */ - 263, /* COPY => ABORT */ - 263, /* DEFERRED => ABORT */ - 263, /* DELIMITERS => ABORT */ - 263, /* DETACH => ABORT */ - 263, /* DIVIDE => ABORT */ - 263, /* DOT => ABORT */ - 263, /* EACH => ABORT */ - 263, /* FAIL => ABORT */ - 263, /* FILE => ABORT */ - 263, /* FOR => ABORT */ - 263, /* GLOB => ABORT */ - 263, /* ID => ABORT */ - 263, /* IMMEDIATE => ABORT */ - 263, /* IMPORT => ABORT */ - 263, /* INITIALLY => ABORT */ - 263, /* INSTEAD => ABORT */ - 263, /* ISNULL => ABORT */ - 263, /* KEY => ABORT */ - 263, /* NK_BITNOT => ABORT */ - 263, /* NK_SEMI => ABORT */ - 263, /* NOTNULL => ABORT */ - 263, /* OF => ABORT */ - 263, /* PLUS => ABORT */ - 263, /* PRIVILEGE => ABORT */ - 263, /* RAISE => ABORT */ - 263, /* REPLACE => ABORT */ - 263, /* RESTRICT => ABORT */ - 263, /* ROW => ABORT */ - 263, /* SEMI => ABORT */ - 263, /* STAR => ABORT */ - 263, /* STATEMENT => ABORT */ - 263, /* STRING => ABORT */ - 263, /* TIMES => ABORT */ - 263, /* UPDATE => ABORT */ - 263, /* VALUES => ABORT */ - 263, /* VARIABLE => ABORT */ - 263, /* VIEW => ABORT */ - 263, /* WAL => ABORT */ + 265, /* AFTER => ABORT */ + 265, /* ATTACH => ABORT */ + 265, /* BEFORE => ABORT */ + 265, /* BEGIN => ABORT */ + 265, /* BITAND => ABORT */ + 265, /* BITNOT => ABORT */ + 265, /* BITOR => ABORT */ + 265, /* BLOCKS => ABORT */ + 265, /* CHANGE => ABORT */ + 265, /* COMMA => ABORT */ + 265, /* COMPACT => ABORT */ + 265, /* CONCAT => ABORT */ + 265, /* CONFLICT => ABORT */ + 265, /* COPY => ABORT */ + 265, /* DEFERRED => ABORT */ + 265, /* DELIMITERS => ABORT */ + 265, /* DETACH => ABORT */ + 265, /* DIVIDE => ABORT */ + 265, /* DOT => ABORT */ + 265, /* EACH => ABORT */ + 265, /* FAIL => ABORT */ + 265, /* FILE => ABORT */ + 265, /* FOR => ABORT */ + 265, /* GLOB => ABORT */ + 265, /* ID => ABORT */ + 265, /* IMMEDIATE => ABORT */ + 265, /* IMPORT => ABORT */ + 265, /* INITIALLY => ABORT */ + 265, /* INSTEAD => ABORT */ + 265, /* ISNULL => ABORT */ + 265, /* KEY => ABORT */ + 265, /* NK_BITNOT => ABORT */ + 265, /* NK_SEMI => ABORT */ + 265, /* NOTNULL => ABORT */ + 265, /* OF => ABORT */ + 265, /* PLUS => ABORT */ + 265, /* PRIVILEGE => ABORT */ + 265, /* RAISE => ABORT */ + 265, /* REPLACE => ABORT */ + 265, /* RESTRICT => ABORT */ + 265, /* ROW => ABORT */ + 265, /* SEMI => ABORT */ + 265, /* STAR => ABORT */ + 265, /* STATEMENT => ABORT */ + 265, /* STRING => ABORT */ + 265, /* TIMES => ABORT */ + 265, /* UPDATE => ABORT */ + 265, /* VALUES => ABORT */ + 265, /* VARIABLE => ABORT */ + 265, /* VIEW => ABORT */ + 265, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1594,242 +1635,244 @@ static const char *const yyTokenName[] = { /* 208 */ "WSTART", /* 209 */ "WEND", /* 210 */ "WDURATION", - /* 211 */ "CAST", - /* 212 */ "NOW", - /* 213 */ "TODAY", - /* 214 */ "TIMEZONE", - /* 215 */ "CLIENT_VERSION", - /* 216 */ "SERVER_VERSION", - /* 217 */ "SERVER_STATUS", - /* 218 */ "CURRENT_USER", - /* 219 */ "COUNT", - /* 220 */ "LAST_ROW", - /* 221 */ "CASE", - /* 222 */ "END", - /* 223 */ "WHEN", - /* 224 */ "THEN", - /* 225 */ "ELSE", - /* 226 */ "BETWEEN", - /* 227 */ "IS", - /* 228 */ "NK_LT", - /* 229 */ "NK_GT", - /* 230 */ "NK_LE", - /* 231 */ "NK_GE", - /* 232 */ "NK_NE", - /* 233 */ "MATCH", - /* 234 */ "NMATCH", - /* 235 */ "CONTAINS", - /* 236 */ "IN", - /* 237 */ "JOIN", - /* 238 */ "INNER", - /* 239 */ "SELECT", - /* 240 */ "DISTINCT", - /* 241 */ "WHERE", - /* 242 */ "PARTITION", - /* 243 */ "BY", - /* 244 */ "SESSION", - /* 245 */ "STATE_WINDOW", - /* 246 */ "SLIDING", - /* 247 */ "FILL", - /* 248 */ "VALUE", - /* 249 */ "NONE", - /* 250 */ "PREV", - /* 251 */ "LINEAR", - /* 252 */ "NEXT", - /* 253 */ "HAVING", - /* 254 */ "RANGE", - /* 255 */ "EVERY", - /* 256 */ "ORDER", - /* 257 */ "SLIMIT", - /* 258 */ "SOFFSET", - /* 259 */ "LIMIT", - /* 260 */ "OFFSET", - /* 261 */ "ASC", - /* 262 */ "NULLS", - /* 263 */ "ABORT", - /* 264 */ "AFTER", - /* 265 */ "ATTACH", - /* 266 */ "BEFORE", - /* 267 */ "BEGIN", - /* 268 */ "BITAND", - /* 269 */ "BITNOT", - /* 270 */ "BITOR", - /* 271 */ "BLOCKS", - /* 272 */ "CHANGE", - /* 273 */ "COMMA", - /* 274 */ "COMPACT", - /* 275 */ "CONCAT", - /* 276 */ "CONFLICT", - /* 277 */ "COPY", - /* 278 */ "DEFERRED", - /* 279 */ "DELIMITERS", - /* 280 */ "DETACH", - /* 281 */ "DIVIDE", - /* 282 */ "DOT", - /* 283 */ "EACH", - /* 284 */ "FAIL", - /* 285 */ "FILE", - /* 286 */ "FOR", - /* 287 */ "GLOB", - /* 288 */ "ID", - /* 289 */ "IMMEDIATE", - /* 290 */ "IMPORT", - /* 291 */ "INITIALLY", - /* 292 */ "INSTEAD", - /* 293 */ "ISNULL", - /* 294 */ "KEY", - /* 295 */ "NK_BITNOT", - /* 296 */ "NK_SEMI", - /* 297 */ "NOTNULL", - /* 298 */ "OF", - /* 299 */ "PLUS", - /* 300 */ "PRIVILEGE", - /* 301 */ "RAISE", - /* 302 */ "REPLACE", - /* 303 */ "RESTRICT", - /* 304 */ "ROW", - /* 305 */ "SEMI", - /* 306 */ "STAR", - /* 307 */ "STATEMENT", - /* 308 */ "STRING", - /* 309 */ "TIMES", - /* 310 */ "UPDATE", - /* 311 */ "VALUES", - /* 312 */ "VARIABLE", - /* 313 */ "VIEW", - /* 314 */ "WAL", - /* 315 */ "cmd", - /* 316 */ "account_options", - /* 317 */ "alter_account_options", - /* 318 */ "literal", - /* 319 */ "alter_account_option", - /* 320 */ "user_name", - /* 321 */ "sysinfo_opt", - /* 322 */ "privileges", - /* 323 */ "priv_level", - /* 324 */ "priv_type_list", - /* 325 */ "priv_type", - /* 326 */ "db_name", - /* 327 */ "dnode_endpoint", - /* 328 */ "not_exists_opt", - /* 329 */ "db_options", - /* 330 */ "exists_opt", - /* 331 */ "alter_db_options", - /* 332 */ "speed_opt", - /* 333 */ "integer_list", - /* 334 */ "variable_list", - /* 335 */ "retention_list", - /* 336 */ "alter_db_option", - /* 337 */ "retention", - /* 338 */ "full_table_name", - /* 339 */ "column_def_list", - /* 340 */ "tags_def_opt", - /* 341 */ "table_options", - /* 342 */ "multi_create_clause", - /* 343 */ "tags_def", - /* 344 */ "multi_drop_clause", - /* 345 */ "alter_table_clause", - /* 346 */ "alter_table_options", - /* 347 */ "column_name", - /* 348 */ "type_name", - /* 349 */ "signed_literal", - /* 350 */ "create_subtable_clause", - /* 351 */ "specific_cols_opt", - /* 352 */ "expression_list", - /* 353 */ "drop_table_clause", - /* 354 */ "col_name_list", - /* 355 */ "table_name", - /* 356 */ "column_def", - /* 357 */ "duration_list", - /* 358 */ "rollup_func_list", - /* 359 */ "alter_table_option", - /* 360 */ "duration_literal", - /* 361 */ "rollup_func_name", - /* 362 */ "function_name", - /* 363 */ "col_name", - /* 364 */ "db_name_cond_opt", - /* 365 */ "like_pattern_opt", - /* 366 */ "table_name_cond", - /* 367 */ "from_db_opt", - /* 368 */ "index_options", - /* 369 */ "func_list", - /* 370 */ "sliding_opt", - /* 371 */ "sma_stream_opt", - /* 372 */ "func", - /* 373 */ "stream_options", - /* 374 */ "topic_name", - /* 375 */ "query_or_subquery", - /* 376 */ "cgroup_name", - /* 377 */ "analyze_opt", - /* 378 */ "explain_options", - /* 379 */ "agg_func_opt", - /* 380 */ "bufsize_opt", - /* 381 */ "stream_name", - /* 382 */ "subtable_opt", - /* 383 */ "expression", - /* 384 */ "dnode_list", - /* 385 */ "where_clause_opt", - /* 386 */ "signed", - /* 387 */ "literal_func", - /* 388 */ "literal_list", - /* 389 */ "table_alias", - /* 390 */ "column_alias", - /* 391 */ "expr_or_subquery", - /* 392 */ "subquery", - /* 393 */ "pseudo_column", - /* 394 */ "column_reference", - /* 395 */ "function_expression", - /* 396 */ "case_when_expression", - /* 397 */ "star_func", - /* 398 */ "star_func_para_list", - /* 399 */ "noarg_func", - /* 400 */ "other_para_list", - /* 401 */ "star_func_para", - /* 402 */ "when_then_list", - /* 403 */ "case_when_else_opt", - /* 404 */ "common_expression", - /* 405 */ "when_then_expr", - /* 406 */ "predicate", - /* 407 */ "compare_op", - /* 408 */ "in_op", - /* 409 */ "in_predicate_value", - /* 410 */ "boolean_value_expression", - /* 411 */ "boolean_primary", - /* 412 */ "from_clause_opt", - /* 413 */ "table_reference_list", - /* 414 */ "table_reference", - /* 415 */ "table_primary", - /* 416 */ "joined_table", - /* 417 */ "alias_opt", - /* 418 */ "parenthesized_joined_table", - /* 419 */ "join_type", - /* 420 */ "search_condition", - /* 421 */ "query_specification", - /* 422 */ "set_quantifier_opt", - /* 423 */ "select_list", - /* 424 */ "partition_by_clause_opt", - /* 425 */ "range_opt", - /* 426 */ "every_opt", - /* 427 */ "fill_opt", - /* 428 */ "twindow_clause_opt", - /* 429 */ "group_by_clause_opt", - /* 430 */ "having_clause_opt", - /* 431 */ "select_item", - /* 432 */ "partition_list", - /* 433 */ "partition_item", - /* 434 */ "fill_mode", - /* 435 */ "group_by_list", - /* 436 */ "query_expression", - /* 437 */ "query_simple", - /* 438 */ "order_by_clause_opt", - /* 439 */ "slimit_clause_opt", - /* 440 */ "limit_clause_opt", - /* 441 */ "union_query_expression", - /* 442 */ "query_simple_or_subquery", - /* 443 */ "sort_specification_list", - /* 444 */ "sort_specification", - /* 445 */ "ordering_specification_opt", - /* 446 */ "null_ordering_opt", + /* 211 */ "IROWTS", + /* 212 */ "QTAGS", + /* 213 */ "CAST", + /* 214 */ "NOW", + /* 215 */ "TODAY", + /* 216 */ "TIMEZONE", + /* 217 */ "CLIENT_VERSION", + /* 218 */ "SERVER_VERSION", + /* 219 */ "SERVER_STATUS", + /* 220 */ "CURRENT_USER", + /* 221 */ "COUNT", + /* 222 */ "LAST_ROW", + /* 223 */ "CASE", + /* 224 */ "END", + /* 225 */ "WHEN", + /* 226 */ "THEN", + /* 227 */ "ELSE", + /* 228 */ "BETWEEN", + /* 229 */ "IS", + /* 230 */ "NK_LT", + /* 231 */ "NK_GT", + /* 232 */ "NK_LE", + /* 233 */ "NK_GE", + /* 234 */ "NK_NE", + /* 235 */ "MATCH", + /* 236 */ "NMATCH", + /* 237 */ "CONTAINS", + /* 238 */ "IN", + /* 239 */ "JOIN", + /* 240 */ "INNER", + /* 241 */ "SELECT", + /* 242 */ "DISTINCT", + /* 243 */ "WHERE", + /* 244 */ "PARTITION", + /* 245 */ "BY", + /* 246 */ "SESSION", + /* 247 */ "STATE_WINDOW", + /* 248 */ "SLIDING", + /* 249 */ "FILL", + /* 250 */ "VALUE", + /* 251 */ "NONE", + /* 252 */ "PREV", + /* 253 */ "LINEAR", + /* 254 */ "NEXT", + /* 255 */ "HAVING", + /* 256 */ "RANGE", + /* 257 */ "EVERY", + /* 258 */ "ORDER", + /* 259 */ "SLIMIT", + /* 260 */ "SOFFSET", + /* 261 */ "LIMIT", + /* 262 */ "OFFSET", + /* 263 */ "ASC", + /* 264 */ "NULLS", + /* 265 */ "ABORT", + /* 266 */ "AFTER", + /* 267 */ "ATTACH", + /* 268 */ "BEFORE", + /* 269 */ "BEGIN", + /* 270 */ "BITAND", + /* 271 */ "BITNOT", + /* 272 */ "BITOR", + /* 273 */ "BLOCKS", + /* 274 */ "CHANGE", + /* 275 */ "COMMA", + /* 276 */ "COMPACT", + /* 277 */ "CONCAT", + /* 278 */ "CONFLICT", + /* 279 */ "COPY", + /* 280 */ "DEFERRED", + /* 281 */ "DELIMITERS", + /* 282 */ "DETACH", + /* 283 */ "DIVIDE", + /* 284 */ "DOT", + /* 285 */ "EACH", + /* 286 */ "FAIL", + /* 287 */ "FILE", + /* 288 */ "FOR", + /* 289 */ "GLOB", + /* 290 */ "ID", + /* 291 */ "IMMEDIATE", + /* 292 */ "IMPORT", + /* 293 */ "INITIALLY", + /* 294 */ "INSTEAD", + /* 295 */ "ISNULL", + /* 296 */ "KEY", + /* 297 */ "NK_BITNOT", + /* 298 */ "NK_SEMI", + /* 299 */ "NOTNULL", + /* 300 */ "OF", + /* 301 */ "PLUS", + /* 302 */ "PRIVILEGE", + /* 303 */ "RAISE", + /* 304 */ "REPLACE", + /* 305 */ "RESTRICT", + /* 306 */ "ROW", + /* 307 */ "SEMI", + /* 308 */ "STAR", + /* 309 */ "STATEMENT", + /* 310 */ "STRING", + /* 311 */ "TIMES", + /* 312 */ "UPDATE", + /* 313 */ "VALUES", + /* 314 */ "VARIABLE", + /* 315 */ "VIEW", + /* 316 */ "WAL", + /* 317 */ "cmd", + /* 318 */ "account_options", + /* 319 */ "alter_account_options", + /* 320 */ "literal", + /* 321 */ "alter_account_option", + /* 322 */ "user_name", + /* 323 */ "sysinfo_opt", + /* 324 */ "privileges", + /* 325 */ "priv_level", + /* 326 */ "priv_type_list", + /* 327 */ "priv_type", + /* 328 */ "db_name", + /* 329 */ "dnode_endpoint", + /* 330 */ "not_exists_opt", + /* 331 */ "db_options", + /* 332 */ "exists_opt", + /* 333 */ "alter_db_options", + /* 334 */ "speed_opt", + /* 335 */ "integer_list", + /* 336 */ "variable_list", + /* 337 */ "retention_list", + /* 338 */ "alter_db_option", + /* 339 */ "retention", + /* 340 */ "full_table_name", + /* 341 */ "column_def_list", + /* 342 */ "tags_def_opt", + /* 343 */ "table_options", + /* 344 */ "multi_create_clause", + /* 345 */ "tags_def", + /* 346 */ "multi_drop_clause", + /* 347 */ "alter_table_clause", + /* 348 */ "alter_table_options", + /* 349 */ "column_name", + /* 350 */ "type_name", + /* 351 */ "signed_literal", + /* 352 */ "create_subtable_clause", + /* 353 */ "specific_cols_opt", + /* 354 */ "expression_list", + /* 355 */ "drop_table_clause", + /* 356 */ "col_name_list", + /* 357 */ "table_name", + /* 358 */ "column_def", + /* 359 */ "duration_list", + /* 360 */ "rollup_func_list", + /* 361 */ "alter_table_option", + /* 362 */ "duration_literal", + /* 363 */ "rollup_func_name", + /* 364 */ "function_name", + /* 365 */ "col_name", + /* 366 */ "db_name_cond_opt", + /* 367 */ "like_pattern_opt", + /* 368 */ "table_name_cond", + /* 369 */ "from_db_opt", + /* 370 */ "index_options", + /* 371 */ "func_list", + /* 372 */ "sliding_opt", + /* 373 */ "sma_stream_opt", + /* 374 */ "func", + /* 375 */ "stream_options", + /* 376 */ "topic_name", + /* 377 */ "query_or_subquery", + /* 378 */ "cgroup_name", + /* 379 */ "analyze_opt", + /* 380 */ "explain_options", + /* 381 */ "agg_func_opt", + /* 382 */ "bufsize_opt", + /* 383 */ "stream_name", + /* 384 */ "subtable_opt", + /* 385 */ "expression", + /* 386 */ "dnode_list", + /* 387 */ "where_clause_opt", + /* 388 */ "signed", + /* 389 */ "literal_func", + /* 390 */ "literal_list", + /* 391 */ "table_alias", + /* 392 */ "column_alias", + /* 393 */ "expr_or_subquery", + /* 394 */ "subquery", + /* 395 */ "pseudo_column", + /* 396 */ "column_reference", + /* 397 */ "function_expression", + /* 398 */ "case_when_expression", + /* 399 */ "star_func", + /* 400 */ "star_func_para_list", + /* 401 */ "noarg_func", + /* 402 */ "other_para_list", + /* 403 */ "star_func_para", + /* 404 */ "when_then_list", + /* 405 */ "case_when_else_opt", + /* 406 */ "common_expression", + /* 407 */ "when_then_expr", + /* 408 */ "predicate", + /* 409 */ "compare_op", + /* 410 */ "in_op", + /* 411 */ "in_predicate_value", + /* 412 */ "boolean_value_expression", + /* 413 */ "boolean_primary", + /* 414 */ "from_clause_opt", + /* 415 */ "table_reference_list", + /* 416 */ "table_reference", + /* 417 */ "table_primary", + /* 418 */ "joined_table", + /* 419 */ "alias_opt", + /* 420 */ "parenthesized_joined_table", + /* 421 */ "join_type", + /* 422 */ "search_condition", + /* 423 */ "query_specification", + /* 424 */ "set_quantifier_opt", + /* 425 */ "select_list", + /* 426 */ "partition_by_clause_opt", + /* 427 */ "range_opt", + /* 428 */ "every_opt", + /* 429 */ "fill_opt", + /* 430 */ "twindow_clause_opt", + /* 431 */ "group_by_clause_opt", + /* 432 */ "having_clause_opt", + /* 433 */ "select_item", + /* 434 */ "partition_list", + /* 435 */ "partition_item", + /* 436 */ "fill_mode", + /* 437 */ "group_by_list", + /* 438 */ "query_expression", + /* 439 */ "query_simple", + /* 440 */ "order_by_clause_opt", + /* 441 */ "slimit_clause_opt", + /* 442 */ "limit_clause_opt", + /* 443 */ "union_query_expression", + /* 444 */ "query_simple_or_subquery", + /* 445 */ "sort_specification_list", + /* 446 */ "sort_specification", + /* 447 */ "ordering_specification_opt", + /* 448 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2071,290 +2114,293 @@ static const char *const yyRuleName[] = { /* 231 */ "cmd ::= SHOW CONSUMERS", /* 232 */ "cmd ::= SHOW SUBSCRIPTIONS", /* 233 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 234 */ "cmd ::= SHOW VNODES NK_INTEGER", - /* 235 */ "cmd ::= SHOW VNODES NK_STRING", - /* 236 */ "db_name_cond_opt ::=", - /* 237 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 238 */ "like_pattern_opt ::=", - /* 239 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 240 */ "table_name_cond ::= table_name", - /* 241 */ "from_db_opt ::=", - /* 242 */ "from_db_opt ::= FROM db_name", - /* 243 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", - /* 244 */ "cmd ::= DROP INDEX exists_opt full_table_name", - /* 245 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 246 */ "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", - /* 247 */ "func_list ::= func", - /* 248 */ "func_list ::= func_list NK_COMMA func", - /* 249 */ "func ::= function_name NK_LP expression_list NK_RP", - /* 250 */ "sma_stream_opt ::=", - /* 251 */ "sma_stream_opt ::= stream_options WATERMARK duration_literal", - /* 252 */ "sma_stream_opt ::= stream_options MAX_DELAY duration_literal", - /* 253 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 254 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 255 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", - /* 256 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 257 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", - /* 258 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 259 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 260 */ "cmd ::= DESC full_table_name", - /* 261 */ "cmd ::= DESCRIBE full_table_name", - /* 262 */ "cmd ::= RESET QUERY CACHE", - /* 263 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 264 */ "analyze_opt ::=", - /* 265 */ "analyze_opt ::= ANALYZE", - /* 266 */ "explain_options ::=", - /* 267 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 268 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 269 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", - /* 270 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 271 */ "agg_func_opt ::=", - /* 272 */ "agg_func_opt ::= AGGREGATE", - /* 273 */ "bufsize_opt ::=", - /* 274 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 275 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", - /* 276 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 277 */ "stream_options ::=", - /* 278 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 279 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 280 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 281 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 282 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 283 */ "subtable_opt ::=", - /* 284 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 285 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 286 */ "cmd ::= KILL QUERY NK_STRING", - /* 287 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 288 */ "cmd ::= BALANCE VGROUP", - /* 289 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 290 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 291 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 292 */ "dnode_list ::= DNODE NK_INTEGER", - /* 293 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 294 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 295 */ "cmd ::= query_or_subquery", - /* 296 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 297 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", - /* 298 */ "literal ::= NK_INTEGER", - /* 299 */ "literal ::= NK_FLOAT", - /* 300 */ "literal ::= NK_STRING", - /* 301 */ "literal ::= NK_BOOL", - /* 302 */ "literal ::= TIMESTAMP NK_STRING", - /* 303 */ "literal ::= duration_literal", - /* 304 */ "literal ::= NULL", - /* 305 */ "literal ::= NK_QUESTION", - /* 306 */ "duration_literal ::= NK_VARIABLE", - /* 307 */ "signed ::= NK_INTEGER", - /* 308 */ "signed ::= NK_PLUS NK_INTEGER", - /* 309 */ "signed ::= NK_MINUS NK_INTEGER", - /* 310 */ "signed ::= NK_FLOAT", - /* 311 */ "signed ::= NK_PLUS NK_FLOAT", - /* 312 */ "signed ::= NK_MINUS NK_FLOAT", - /* 313 */ "signed_literal ::= signed", - /* 314 */ "signed_literal ::= NK_STRING", - /* 315 */ "signed_literal ::= NK_BOOL", - /* 316 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 317 */ "signed_literal ::= duration_literal", - /* 318 */ "signed_literal ::= NULL", - /* 319 */ "signed_literal ::= literal_func", - /* 320 */ "signed_literal ::= NK_QUESTION", - /* 321 */ "literal_list ::= signed_literal", - /* 322 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 323 */ "db_name ::= NK_ID", - /* 324 */ "table_name ::= NK_ID", - /* 325 */ "column_name ::= NK_ID", - /* 326 */ "function_name ::= NK_ID", - /* 327 */ "table_alias ::= NK_ID", - /* 328 */ "column_alias ::= NK_ID", - /* 329 */ "user_name ::= NK_ID", - /* 330 */ "topic_name ::= NK_ID", - /* 331 */ "stream_name ::= NK_ID", - /* 332 */ "cgroup_name ::= NK_ID", - /* 333 */ "expr_or_subquery ::= expression", - /* 334 */ "expr_or_subquery ::= subquery", - /* 335 */ "expression ::= literal", - /* 336 */ "expression ::= pseudo_column", - /* 337 */ "expression ::= column_reference", - /* 338 */ "expression ::= function_expression", - /* 339 */ "expression ::= case_when_expression", - /* 340 */ "expression ::= NK_LP expression NK_RP", - /* 341 */ "expression ::= NK_PLUS expr_or_subquery", - /* 342 */ "expression ::= NK_MINUS expr_or_subquery", - /* 343 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 344 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 345 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 346 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 347 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 348 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 349 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 350 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 351 */ "expression_list ::= expr_or_subquery", - /* 352 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 353 */ "column_reference ::= column_name", - /* 354 */ "column_reference ::= table_name NK_DOT column_name", - /* 355 */ "pseudo_column ::= ROWTS", - /* 356 */ "pseudo_column ::= TBNAME", - /* 357 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 358 */ "pseudo_column ::= QSTART", - /* 359 */ "pseudo_column ::= QEND", - /* 360 */ "pseudo_column ::= QDURATION", - /* 361 */ "pseudo_column ::= WSTART", - /* 362 */ "pseudo_column ::= WEND", - /* 363 */ "pseudo_column ::= WDURATION", - /* 364 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 365 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 366 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 367 */ "function_expression ::= literal_func", - /* 368 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 369 */ "literal_func ::= NOW", - /* 370 */ "noarg_func ::= NOW", - /* 371 */ "noarg_func ::= TODAY", - /* 372 */ "noarg_func ::= TIMEZONE", - /* 373 */ "noarg_func ::= DATABASE", - /* 374 */ "noarg_func ::= CLIENT_VERSION", - /* 375 */ "noarg_func ::= SERVER_VERSION", - /* 376 */ "noarg_func ::= SERVER_STATUS", - /* 377 */ "noarg_func ::= CURRENT_USER", - /* 378 */ "noarg_func ::= USER", - /* 379 */ "star_func ::= COUNT", - /* 380 */ "star_func ::= FIRST", - /* 381 */ "star_func ::= LAST", - /* 382 */ "star_func ::= LAST_ROW", - /* 383 */ "star_func_para_list ::= NK_STAR", - /* 384 */ "star_func_para_list ::= other_para_list", - /* 385 */ "other_para_list ::= star_func_para", - /* 386 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 387 */ "star_func_para ::= expr_or_subquery", - /* 388 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 389 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 390 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 391 */ "when_then_list ::= when_then_expr", - /* 392 */ "when_then_list ::= when_then_list when_then_expr", - /* 393 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 394 */ "case_when_else_opt ::=", - /* 395 */ "case_when_else_opt ::= ELSE common_expression", - /* 396 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 397 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 398 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 399 */ "predicate ::= expr_or_subquery IS NULL", - /* 400 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 401 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 402 */ "compare_op ::= NK_LT", - /* 403 */ "compare_op ::= NK_GT", - /* 404 */ "compare_op ::= NK_LE", - /* 405 */ "compare_op ::= NK_GE", - /* 406 */ "compare_op ::= NK_NE", - /* 407 */ "compare_op ::= NK_EQ", - /* 408 */ "compare_op ::= LIKE", - /* 409 */ "compare_op ::= NOT LIKE", - /* 410 */ "compare_op ::= MATCH", - /* 411 */ "compare_op ::= NMATCH", - /* 412 */ "compare_op ::= CONTAINS", - /* 413 */ "in_op ::= IN", - /* 414 */ "in_op ::= NOT IN", - /* 415 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 416 */ "boolean_value_expression ::= boolean_primary", - /* 417 */ "boolean_value_expression ::= NOT boolean_primary", - /* 418 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 419 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 420 */ "boolean_primary ::= predicate", - /* 421 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 422 */ "common_expression ::= expr_or_subquery", - /* 423 */ "common_expression ::= boolean_value_expression", - /* 424 */ "from_clause_opt ::=", - /* 425 */ "from_clause_opt ::= FROM table_reference_list", - /* 426 */ "table_reference_list ::= table_reference", - /* 427 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 428 */ "table_reference ::= table_primary", - /* 429 */ "table_reference ::= joined_table", - /* 430 */ "table_primary ::= table_name alias_opt", - /* 431 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 432 */ "table_primary ::= subquery alias_opt", - /* 433 */ "table_primary ::= parenthesized_joined_table", - /* 434 */ "alias_opt ::=", - /* 435 */ "alias_opt ::= table_alias", - /* 436 */ "alias_opt ::= AS table_alias", - /* 437 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 438 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 439 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 440 */ "join_type ::=", - /* 441 */ "join_type ::= INNER", - /* 442 */ "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", - /* 443 */ "set_quantifier_opt ::=", - /* 444 */ "set_quantifier_opt ::= DISTINCT", - /* 445 */ "set_quantifier_opt ::= ALL", - /* 446 */ "select_list ::= select_item", - /* 447 */ "select_list ::= select_list NK_COMMA select_item", - /* 448 */ "select_item ::= NK_STAR", - /* 449 */ "select_item ::= common_expression", - /* 450 */ "select_item ::= common_expression column_alias", - /* 451 */ "select_item ::= common_expression AS column_alias", - /* 452 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 453 */ "where_clause_opt ::=", - /* 454 */ "where_clause_opt ::= WHERE search_condition", - /* 455 */ "partition_by_clause_opt ::=", - /* 456 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 457 */ "partition_list ::= partition_item", - /* 458 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 459 */ "partition_item ::= expr_or_subquery", - /* 460 */ "partition_item ::= expr_or_subquery column_alias", - /* 461 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 462 */ "twindow_clause_opt ::=", - /* 463 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 464 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 465 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 466 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 467 */ "sliding_opt ::=", - /* 468 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 469 */ "fill_opt ::=", - /* 470 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 471 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 472 */ "fill_mode ::= NONE", - /* 473 */ "fill_mode ::= PREV", - /* 474 */ "fill_mode ::= NULL", - /* 475 */ "fill_mode ::= LINEAR", - /* 476 */ "fill_mode ::= NEXT", - /* 477 */ "group_by_clause_opt ::=", - /* 478 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 479 */ "group_by_list ::= expr_or_subquery", - /* 480 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 481 */ "having_clause_opt ::=", - /* 482 */ "having_clause_opt ::= HAVING search_condition", - /* 483 */ "range_opt ::=", - /* 484 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 485 */ "every_opt ::=", - /* 486 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 487 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 488 */ "query_simple ::= query_specification", - /* 489 */ "query_simple ::= union_query_expression", - /* 490 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 491 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 492 */ "query_simple_or_subquery ::= query_simple", - /* 493 */ "query_simple_or_subquery ::= subquery", - /* 494 */ "query_or_subquery ::= query_expression", - /* 495 */ "query_or_subquery ::= subquery", - /* 496 */ "order_by_clause_opt ::=", - /* 497 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 498 */ "slimit_clause_opt ::=", - /* 499 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 500 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 501 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 502 */ "limit_clause_opt ::=", - /* 503 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 504 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 505 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 506 */ "subquery ::= NK_LP query_expression NK_RP", - /* 507 */ "subquery ::= NK_LP subquery NK_RP", - /* 508 */ "search_condition ::= common_expression", - /* 509 */ "sort_specification_list ::= sort_specification", - /* 510 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 511 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 512 */ "ordering_specification_opt ::=", - /* 513 */ "ordering_specification_opt ::= ASC", - /* 514 */ "ordering_specification_opt ::= DESC", - /* 515 */ "null_ordering_opt ::=", - /* 516 */ "null_ordering_opt ::= NULLS FIRST", - /* 517 */ "null_ordering_opt ::= NULLS LAST", + /* 234 */ "cmd ::= SHOW TABLE TAGS FROM table_name_cond from_db_opt", + /* 235 */ "cmd ::= SHOW VNODES NK_INTEGER", + /* 236 */ "cmd ::= SHOW VNODES NK_STRING", + /* 237 */ "db_name_cond_opt ::=", + /* 238 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 239 */ "like_pattern_opt ::=", + /* 240 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 241 */ "table_name_cond ::= table_name", + /* 242 */ "from_db_opt ::=", + /* 243 */ "from_db_opt ::= FROM db_name", + /* 244 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", + /* 245 */ "cmd ::= DROP INDEX exists_opt full_table_name", + /* 246 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 247 */ "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", + /* 248 */ "func_list ::= func", + /* 249 */ "func_list ::= func_list NK_COMMA func", + /* 250 */ "func ::= function_name NK_LP expression_list NK_RP", + /* 251 */ "sma_stream_opt ::=", + /* 252 */ "sma_stream_opt ::= stream_options WATERMARK duration_literal", + /* 253 */ "sma_stream_opt ::= stream_options MAX_DELAY duration_literal", + /* 254 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 255 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 256 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", + /* 257 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 258 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", + /* 259 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 260 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 261 */ "cmd ::= DESC full_table_name", + /* 262 */ "cmd ::= DESCRIBE full_table_name", + /* 263 */ "cmd ::= RESET QUERY CACHE", + /* 264 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 265 */ "analyze_opt ::=", + /* 266 */ "analyze_opt ::= ANALYZE", + /* 267 */ "explain_options ::=", + /* 268 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 269 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 270 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", + /* 271 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 272 */ "agg_func_opt ::=", + /* 273 */ "agg_func_opt ::= AGGREGATE", + /* 274 */ "bufsize_opt ::=", + /* 275 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 276 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", + /* 277 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 278 */ "stream_options ::=", + /* 279 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 280 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 281 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 282 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 283 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 284 */ "subtable_opt ::=", + /* 285 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 286 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 287 */ "cmd ::= KILL QUERY NK_STRING", + /* 288 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 289 */ "cmd ::= BALANCE VGROUP", + /* 290 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 291 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 292 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 293 */ "dnode_list ::= DNODE NK_INTEGER", + /* 294 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 295 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 296 */ "cmd ::= query_or_subquery", + /* 297 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 298 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", + /* 299 */ "literal ::= NK_INTEGER", + /* 300 */ "literal ::= NK_FLOAT", + /* 301 */ "literal ::= NK_STRING", + /* 302 */ "literal ::= NK_BOOL", + /* 303 */ "literal ::= TIMESTAMP NK_STRING", + /* 304 */ "literal ::= duration_literal", + /* 305 */ "literal ::= NULL", + /* 306 */ "literal ::= NK_QUESTION", + /* 307 */ "duration_literal ::= NK_VARIABLE", + /* 308 */ "signed ::= NK_INTEGER", + /* 309 */ "signed ::= NK_PLUS NK_INTEGER", + /* 310 */ "signed ::= NK_MINUS NK_INTEGER", + /* 311 */ "signed ::= NK_FLOAT", + /* 312 */ "signed ::= NK_PLUS NK_FLOAT", + /* 313 */ "signed ::= NK_MINUS NK_FLOAT", + /* 314 */ "signed_literal ::= signed", + /* 315 */ "signed_literal ::= NK_STRING", + /* 316 */ "signed_literal ::= NK_BOOL", + /* 317 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 318 */ "signed_literal ::= duration_literal", + /* 319 */ "signed_literal ::= NULL", + /* 320 */ "signed_literal ::= literal_func", + /* 321 */ "signed_literal ::= NK_QUESTION", + /* 322 */ "literal_list ::= signed_literal", + /* 323 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 324 */ "db_name ::= NK_ID", + /* 325 */ "table_name ::= NK_ID", + /* 326 */ "column_name ::= NK_ID", + /* 327 */ "function_name ::= NK_ID", + /* 328 */ "table_alias ::= NK_ID", + /* 329 */ "column_alias ::= NK_ID", + /* 330 */ "user_name ::= NK_ID", + /* 331 */ "topic_name ::= NK_ID", + /* 332 */ "stream_name ::= NK_ID", + /* 333 */ "cgroup_name ::= NK_ID", + /* 334 */ "expr_or_subquery ::= expression", + /* 335 */ "expr_or_subquery ::= subquery", + /* 336 */ "expression ::= literal", + /* 337 */ "expression ::= pseudo_column", + /* 338 */ "expression ::= column_reference", + /* 339 */ "expression ::= function_expression", + /* 340 */ "expression ::= case_when_expression", + /* 341 */ "expression ::= NK_LP expression NK_RP", + /* 342 */ "expression ::= NK_PLUS expr_or_subquery", + /* 343 */ "expression ::= NK_MINUS expr_or_subquery", + /* 344 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 345 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 346 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 347 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 348 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 349 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 350 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 351 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 352 */ "expression_list ::= expr_or_subquery", + /* 353 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 354 */ "column_reference ::= column_name", + /* 355 */ "column_reference ::= table_name NK_DOT column_name", + /* 356 */ "pseudo_column ::= ROWTS", + /* 357 */ "pseudo_column ::= TBNAME", + /* 358 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 359 */ "pseudo_column ::= QSTART", + /* 360 */ "pseudo_column ::= QEND", + /* 361 */ "pseudo_column ::= QDURATION", + /* 362 */ "pseudo_column ::= WSTART", + /* 363 */ "pseudo_column ::= WEND", + /* 364 */ "pseudo_column ::= WDURATION", + /* 365 */ "pseudo_column ::= IROWTS", + /* 366 */ "pseudo_column ::= QTAGS", + /* 367 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 368 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 369 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 370 */ "function_expression ::= literal_func", + /* 371 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 372 */ "literal_func ::= NOW", + /* 373 */ "noarg_func ::= NOW", + /* 374 */ "noarg_func ::= TODAY", + /* 375 */ "noarg_func ::= TIMEZONE", + /* 376 */ "noarg_func ::= DATABASE", + /* 377 */ "noarg_func ::= CLIENT_VERSION", + /* 378 */ "noarg_func ::= SERVER_VERSION", + /* 379 */ "noarg_func ::= SERVER_STATUS", + /* 380 */ "noarg_func ::= CURRENT_USER", + /* 381 */ "noarg_func ::= USER", + /* 382 */ "star_func ::= COUNT", + /* 383 */ "star_func ::= FIRST", + /* 384 */ "star_func ::= LAST", + /* 385 */ "star_func ::= LAST_ROW", + /* 386 */ "star_func_para_list ::= NK_STAR", + /* 387 */ "star_func_para_list ::= other_para_list", + /* 388 */ "other_para_list ::= star_func_para", + /* 389 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 390 */ "star_func_para ::= expr_or_subquery", + /* 391 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 392 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 393 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 394 */ "when_then_list ::= when_then_expr", + /* 395 */ "when_then_list ::= when_then_list when_then_expr", + /* 396 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 397 */ "case_when_else_opt ::=", + /* 398 */ "case_when_else_opt ::= ELSE common_expression", + /* 399 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 400 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 401 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 402 */ "predicate ::= expr_or_subquery IS NULL", + /* 403 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 404 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 405 */ "compare_op ::= NK_LT", + /* 406 */ "compare_op ::= NK_GT", + /* 407 */ "compare_op ::= NK_LE", + /* 408 */ "compare_op ::= NK_GE", + /* 409 */ "compare_op ::= NK_NE", + /* 410 */ "compare_op ::= NK_EQ", + /* 411 */ "compare_op ::= LIKE", + /* 412 */ "compare_op ::= NOT LIKE", + /* 413 */ "compare_op ::= MATCH", + /* 414 */ "compare_op ::= NMATCH", + /* 415 */ "compare_op ::= CONTAINS", + /* 416 */ "in_op ::= IN", + /* 417 */ "in_op ::= NOT IN", + /* 418 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 419 */ "boolean_value_expression ::= boolean_primary", + /* 420 */ "boolean_value_expression ::= NOT boolean_primary", + /* 421 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 422 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 423 */ "boolean_primary ::= predicate", + /* 424 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 425 */ "common_expression ::= expr_or_subquery", + /* 426 */ "common_expression ::= boolean_value_expression", + /* 427 */ "from_clause_opt ::=", + /* 428 */ "from_clause_opt ::= FROM table_reference_list", + /* 429 */ "table_reference_list ::= table_reference", + /* 430 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 431 */ "table_reference ::= table_primary", + /* 432 */ "table_reference ::= joined_table", + /* 433 */ "table_primary ::= table_name alias_opt", + /* 434 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 435 */ "table_primary ::= subquery alias_opt", + /* 436 */ "table_primary ::= parenthesized_joined_table", + /* 437 */ "alias_opt ::=", + /* 438 */ "alias_opt ::= table_alias", + /* 439 */ "alias_opt ::= AS table_alias", + /* 440 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 441 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 442 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 443 */ "join_type ::=", + /* 444 */ "join_type ::= INNER", + /* 445 */ "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", + /* 446 */ "set_quantifier_opt ::=", + /* 447 */ "set_quantifier_opt ::= DISTINCT", + /* 448 */ "set_quantifier_opt ::= ALL", + /* 449 */ "select_list ::= select_item", + /* 450 */ "select_list ::= select_list NK_COMMA select_item", + /* 451 */ "select_item ::= NK_STAR", + /* 452 */ "select_item ::= common_expression", + /* 453 */ "select_item ::= common_expression column_alias", + /* 454 */ "select_item ::= common_expression AS column_alias", + /* 455 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 456 */ "where_clause_opt ::=", + /* 457 */ "where_clause_opt ::= WHERE search_condition", + /* 458 */ "partition_by_clause_opt ::=", + /* 459 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 460 */ "partition_list ::= partition_item", + /* 461 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 462 */ "partition_item ::= expr_or_subquery", + /* 463 */ "partition_item ::= expr_or_subquery column_alias", + /* 464 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 465 */ "twindow_clause_opt ::=", + /* 466 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 467 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 468 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 469 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 470 */ "sliding_opt ::=", + /* 471 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 472 */ "fill_opt ::=", + /* 473 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 474 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 475 */ "fill_mode ::= NONE", + /* 476 */ "fill_mode ::= PREV", + /* 477 */ "fill_mode ::= NULL", + /* 478 */ "fill_mode ::= LINEAR", + /* 479 */ "fill_mode ::= NEXT", + /* 480 */ "group_by_clause_opt ::=", + /* 481 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 482 */ "group_by_list ::= expr_or_subquery", + /* 483 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 484 */ "having_clause_opt ::=", + /* 485 */ "having_clause_opt ::= HAVING search_condition", + /* 486 */ "range_opt ::=", + /* 487 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 488 */ "every_opt ::=", + /* 489 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 490 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 491 */ "query_simple ::= query_specification", + /* 492 */ "query_simple ::= union_query_expression", + /* 493 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 494 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 495 */ "query_simple_or_subquery ::= query_simple", + /* 496 */ "query_simple_or_subquery ::= subquery", + /* 497 */ "query_or_subquery ::= query_expression", + /* 498 */ "query_or_subquery ::= subquery", + /* 499 */ "order_by_clause_opt ::=", + /* 500 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 501 */ "slimit_clause_opt ::=", + /* 502 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 503 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 504 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 505 */ "limit_clause_opt ::=", + /* 506 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 507 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 508 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 509 */ "subquery ::= NK_LP query_expression NK_RP", + /* 510 */ "subquery ::= NK_LP subquery NK_RP", + /* 511 */ "search_condition ::= common_expression", + /* 512 */ "sort_specification_list ::= sort_specification", + /* 513 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 514 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 515 */ "ordering_specification_opt ::=", + /* 516 */ "ordering_specification_opt ::= ASC", + /* 517 */ "ordering_specification_opt ::= DESC", + /* 518 */ "null_ordering_opt ::=", + /* 519 */ "null_ordering_opt ::= NULLS FIRST", + /* 520 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2481,190 +2527,190 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 315: /* cmd */ - case 318: /* literal */ - case 329: /* db_options */ - case 331: /* alter_db_options */ - case 337: /* retention */ - case 338: /* full_table_name */ - case 341: /* table_options */ - case 345: /* alter_table_clause */ - case 346: /* alter_table_options */ - case 349: /* signed_literal */ - case 350: /* create_subtable_clause */ - case 353: /* drop_table_clause */ - case 356: /* column_def */ - case 360: /* duration_literal */ - case 361: /* rollup_func_name */ - case 363: /* col_name */ - case 364: /* db_name_cond_opt */ - case 365: /* like_pattern_opt */ - case 366: /* table_name_cond */ - case 367: /* from_db_opt */ - case 368: /* index_options */ - case 370: /* sliding_opt */ - case 371: /* sma_stream_opt */ - case 372: /* func */ - case 373: /* stream_options */ - case 375: /* query_or_subquery */ - case 378: /* explain_options */ - case 382: /* subtable_opt */ - case 383: /* expression */ - case 385: /* where_clause_opt */ - case 386: /* signed */ - case 387: /* literal_func */ - case 391: /* expr_or_subquery */ - case 392: /* subquery */ - case 393: /* pseudo_column */ - case 394: /* column_reference */ - case 395: /* function_expression */ - case 396: /* case_when_expression */ - case 401: /* star_func_para */ - case 403: /* case_when_else_opt */ - case 404: /* common_expression */ - case 405: /* when_then_expr */ - case 406: /* predicate */ - case 409: /* in_predicate_value */ - case 410: /* boolean_value_expression */ - case 411: /* boolean_primary */ - case 412: /* from_clause_opt */ - case 413: /* table_reference_list */ - case 414: /* table_reference */ - case 415: /* table_primary */ - case 416: /* joined_table */ - case 418: /* parenthesized_joined_table */ - case 420: /* search_condition */ - case 421: /* query_specification */ - case 425: /* range_opt */ - case 426: /* every_opt */ - case 427: /* fill_opt */ - case 428: /* twindow_clause_opt */ - case 430: /* having_clause_opt */ - case 431: /* select_item */ - case 433: /* partition_item */ - case 436: /* query_expression */ - case 437: /* query_simple */ - case 439: /* slimit_clause_opt */ - case 440: /* limit_clause_opt */ - case 441: /* union_query_expression */ - case 442: /* query_simple_or_subquery */ - case 444: /* sort_specification */ + case 317: /* cmd */ + case 320: /* literal */ + case 331: /* db_options */ + case 333: /* alter_db_options */ + case 339: /* retention */ + case 340: /* full_table_name */ + case 343: /* table_options */ + case 347: /* alter_table_clause */ + case 348: /* alter_table_options */ + case 351: /* signed_literal */ + case 352: /* create_subtable_clause */ + case 355: /* drop_table_clause */ + case 358: /* column_def */ + case 362: /* duration_literal */ + case 363: /* rollup_func_name */ + case 365: /* col_name */ + case 366: /* db_name_cond_opt */ + case 367: /* like_pattern_opt */ + case 368: /* table_name_cond */ + case 369: /* from_db_opt */ + case 370: /* index_options */ + case 372: /* sliding_opt */ + case 373: /* sma_stream_opt */ + case 374: /* func */ + case 375: /* stream_options */ + case 377: /* query_or_subquery */ + case 380: /* explain_options */ + case 384: /* subtable_opt */ + case 385: /* expression */ + case 387: /* where_clause_opt */ + case 388: /* signed */ + case 389: /* literal_func */ + case 393: /* expr_or_subquery */ + case 394: /* subquery */ + case 395: /* pseudo_column */ + case 396: /* column_reference */ + case 397: /* function_expression */ + case 398: /* case_when_expression */ + case 403: /* star_func_para */ + case 405: /* case_when_else_opt */ + case 406: /* common_expression */ + case 407: /* when_then_expr */ + case 408: /* predicate */ + case 411: /* in_predicate_value */ + case 412: /* boolean_value_expression */ + case 413: /* boolean_primary */ + case 414: /* from_clause_opt */ + case 415: /* table_reference_list */ + case 416: /* table_reference */ + case 417: /* table_primary */ + case 418: /* joined_table */ + case 420: /* parenthesized_joined_table */ + case 422: /* search_condition */ + case 423: /* query_specification */ + case 427: /* range_opt */ + case 428: /* every_opt */ + case 429: /* fill_opt */ + case 430: /* twindow_clause_opt */ + case 432: /* having_clause_opt */ + case 433: /* select_item */ + case 435: /* partition_item */ + case 438: /* query_expression */ + case 439: /* query_simple */ + case 441: /* slimit_clause_opt */ + case 442: /* limit_clause_opt */ + case 443: /* union_query_expression */ + case 444: /* query_simple_or_subquery */ + case 446: /* sort_specification */ { - nodesDestroyNode((yypminor->yy392)); + nodesDestroyNode((yypminor->yy778)); } break; - case 316: /* account_options */ - case 317: /* alter_account_options */ - case 319: /* alter_account_option */ - case 332: /* speed_opt */ - case 380: /* bufsize_opt */ + case 318: /* account_options */ + case 319: /* alter_account_options */ + case 321: /* alter_account_option */ + case 334: /* speed_opt */ + case 382: /* bufsize_opt */ { } break; - case 320: /* user_name */ - case 323: /* priv_level */ - case 326: /* db_name */ - case 327: /* dnode_endpoint */ - case 347: /* column_name */ - case 355: /* table_name */ - case 362: /* function_name */ - case 374: /* topic_name */ - case 376: /* cgroup_name */ - case 381: /* stream_name */ - case 389: /* table_alias */ - case 390: /* column_alias */ - case 397: /* star_func */ - case 399: /* noarg_func */ - case 417: /* alias_opt */ + case 322: /* user_name */ + case 325: /* priv_level */ + case 328: /* db_name */ + case 329: /* dnode_endpoint */ + case 349: /* column_name */ + case 357: /* table_name */ + case 364: /* function_name */ + case 376: /* topic_name */ + case 378: /* cgroup_name */ + case 383: /* stream_name */ + case 391: /* table_alias */ + case 392: /* column_alias */ + case 399: /* star_func */ + case 401: /* noarg_func */ + case 419: /* alias_opt */ { } break; - case 321: /* sysinfo_opt */ + case 323: /* sysinfo_opt */ { } break; - case 322: /* privileges */ - case 324: /* priv_type_list */ - case 325: /* priv_type */ + case 324: /* privileges */ + case 326: /* priv_type_list */ + case 327: /* priv_type */ { } break; - case 328: /* not_exists_opt */ - case 330: /* exists_opt */ - case 377: /* analyze_opt */ - case 379: /* agg_func_opt */ - case 422: /* set_quantifier_opt */ + case 330: /* not_exists_opt */ + case 332: /* exists_opt */ + case 379: /* analyze_opt */ + case 381: /* agg_func_opt */ + case 424: /* set_quantifier_opt */ { } break; - case 333: /* integer_list */ - case 334: /* variable_list */ - case 335: /* retention_list */ - case 339: /* column_def_list */ - case 340: /* tags_def_opt */ - case 342: /* multi_create_clause */ - case 343: /* tags_def */ - case 344: /* multi_drop_clause */ - case 351: /* specific_cols_opt */ - case 352: /* expression_list */ - case 354: /* col_name_list */ - case 357: /* duration_list */ - case 358: /* rollup_func_list */ - case 369: /* func_list */ - case 384: /* dnode_list */ - case 388: /* literal_list */ - case 398: /* star_func_para_list */ - case 400: /* other_para_list */ - case 402: /* when_then_list */ - case 423: /* select_list */ - case 424: /* partition_by_clause_opt */ - case 429: /* group_by_clause_opt */ - case 432: /* partition_list */ - case 435: /* group_by_list */ - case 438: /* order_by_clause_opt */ - case 443: /* sort_specification_list */ + case 335: /* integer_list */ + case 336: /* variable_list */ + case 337: /* retention_list */ + case 341: /* column_def_list */ + case 342: /* tags_def_opt */ + case 344: /* multi_create_clause */ + case 345: /* tags_def */ + case 346: /* multi_drop_clause */ + case 353: /* specific_cols_opt */ + case 354: /* expression_list */ + case 356: /* col_name_list */ + case 359: /* duration_list */ + case 360: /* rollup_func_list */ + case 371: /* func_list */ + case 386: /* dnode_list */ + case 390: /* literal_list */ + case 400: /* star_func_para_list */ + case 402: /* other_para_list */ + case 404: /* when_then_list */ + case 425: /* select_list */ + case 426: /* partition_by_clause_opt */ + case 431: /* group_by_clause_opt */ + case 434: /* partition_list */ + case 437: /* group_by_list */ + case 440: /* order_by_clause_opt */ + case 445: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy148)); + nodesDestroyList((yypminor->yy282)); } break; - case 336: /* alter_db_option */ - case 359: /* alter_table_option */ + case 338: /* alter_db_option */ + case 361: /* alter_table_option */ { } break; - case 348: /* type_name */ + case 350: /* type_name */ { } break; - case 407: /* compare_op */ - case 408: /* in_op */ + case 409: /* compare_op */ + case 410: /* in_op */ { } break; - case 419: /* join_type */ + case 421: /* join_type */ { } break; - case 434: /* fill_mode */ + case 436: /* fill_mode */ { } break; - case 445: /* ordering_specification_opt */ + case 447: /* ordering_specification_opt */ { } break; - case 446: /* null_ordering_opt */ + case 448: /* null_ordering_opt */ { } @@ -2963,524 +3009,527 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */ } yyRuleInfo[] = { - { 315, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - { 315, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - { 316, 0 }, /* (2) account_options ::= */ - { 316, -3 }, /* (3) account_options ::= account_options PPS literal */ - { 316, -3 }, /* (4) account_options ::= account_options TSERIES literal */ - { 316, -3 }, /* (5) account_options ::= account_options STORAGE literal */ - { 316, -3 }, /* (6) account_options ::= account_options STREAMS literal */ - { 316, -3 }, /* (7) account_options ::= account_options QTIME literal */ - { 316, -3 }, /* (8) account_options ::= account_options DBS literal */ - { 316, -3 }, /* (9) account_options ::= account_options USERS literal */ - { 316, -3 }, /* (10) account_options ::= account_options CONNS literal */ - { 316, -3 }, /* (11) account_options ::= account_options STATE literal */ - { 317, -1 }, /* (12) alter_account_options ::= alter_account_option */ - { 317, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - { 319, -2 }, /* (14) alter_account_option ::= PASS literal */ - { 319, -2 }, /* (15) alter_account_option ::= PPS literal */ - { 319, -2 }, /* (16) alter_account_option ::= TSERIES literal */ - { 319, -2 }, /* (17) alter_account_option ::= STORAGE literal */ - { 319, -2 }, /* (18) alter_account_option ::= STREAMS literal */ - { 319, -2 }, /* (19) alter_account_option ::= QTIME literal */ - { 319, -2 }, /* (20) alter_account_option ::= DBS literal */ - { 319, -2 }, /* (21) alter_account_option ::= USERS literal */ - { 319, -2 }, /* (22) alter_account_option ::= CONNS literal */ - { 319, -2 }, /* (23) alter_account_option ::= STATE literal */ - { 315, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ - { 315, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ - { 315, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - { 315, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - { 315, -3 }, /* (28) cmd ::= DROP USER user_name */ - { 321, 0 }, /* (29) sysinfo_opt ::= */ - { 321, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ - { 315, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ - { 315, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ - { 322, -1 }, /* (33) privileges ::= ALL */ - { 322, -1 }, /* (34) privileges ::= priv_type_list */ - { 324, -1 }, /* (35) priv_type_list ::= priv_type */ - { 324, -3 }, /* (36) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - { 325, -1 }, /* (37) priv_type ::= READ */ - { 325, -1 }, /* (38) priv_type ::= WRITE */ - { 323, -3 }, /* (39) priv_level ::= NK_STAR NK_DOT NK_STAR */ - { 323, -3 }, /* (40) priv_level ::= db_name NK_DOT NK_STAR */ - { 315, -3 }, /* (41) cmd ::= CREATE DNODE dnode_endpoint */ - { 315, -5 }, /* (42) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - { 315, -3 }, /* (43) cmd ::= DROP DNODE NK_INTEGER */ - { 315, -3 }, /* (44) cmd ::= DROP DNODE dnode_endpoint */ - { 315, -4 }, /* (45) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - { 315, -5 }, /* (46) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - { 315, -4 }, /* (47) cmd ::= ALTER ALL DNODES NK_STRING */ - { 315, -5 }, /* (48) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - { 327, -1 }, /* (49) dnode_endpoint ::= NK_STRING */ - { 327, -1 }, /* (50) dnode_endpoint ::= NK_ID */ - { 327, -1 }, /* (51) dnode_endpoint ::= NK_IPTOKEN */ - { 315, -3 }, /* (52) cmd ::= ALTER LOCAL NK_STRING */ - { 315, -4 }, /* (53) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - { 315, -5 }, /* (54) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - { 315, -5 }, /* (55) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - { 315, -5 }, /* (56) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - { 315, -5 }, /* (57) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - { 315, -5 }, /* (58) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - { 315, -5 }, /* (59) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - { 315, -5 }, /* (60) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - { 315, -5 }, /* (61) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - { 315, -5 }, /* (62) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - { 315, -4 }, /* (63) cmd ::= DROP DATABASE exists_opt db_name */ - { 315, -2 }, /* (64) cmd ::= USE db_name */ - { 315, -4 }, /* (65) cmd ::= ALTER DATABASE db_name alter_db_options */ - { 315, -3 }, /* (66) cmd ::= FLUSH DATABASE db_name */ - { 315, -4 }, /* (67) cmd ::= TRIM DATABASE db_name speed_opt */ - { 328, -3 }, /* (68) not_exists_opt ::= IF NOT EXISTS */ - { 328, 0 }, /* (69) not_exists_opt ::= */ - { 330, -2 }, /* (70) exists_opt ::= IF EXISTS */ - { 330, 0 }, /* (71) exists_opt ::= */ - { 329, 0 }, /* (72) db_options ::= */ - { 329, -3 }, /* (73) db_options ::= db_options BUFFER NK_INTEGER */ - { 329, -3 }, /* (74) db_options ::= db_options CACHEMODEL NK_STRING */ - { 329, -3 }, /* (75) db_options ::= db_options CACHESIZE NK_INTEGER */ - { 329, -3 }, /* (76) db_options ::= db_options COMP NK_INTEGER */ - { 329, -3 }, /* (77) db_options ::= db_options DURATION NK_INTEGER */ - { 329, -3 }, /* (78) db_options ::= db_options DURATION NK_VARIABLE */ - { 329, -3 }, /* (79) db_options ::= db_options MAXROWS NK_INTEGER */ - { 329, -3 }, /* (80) db_options ::= db_options MINROWS NK_INTEGER */ - { 329, -3 }, /* (81) db_options ::= db_options KEEP integer_list */ - { 329, -3 }, /* (82) db_options ::= db_options KEEP variable_list */ - { 329, -3 }, /* (83) db_options ::= db_options PAGES NK_INTEGER */ - { 329, -3 }, /* (84) db_options ::= db_options PAGESIZE NK_INTEGER */ - { 329, -3 }, /* (85) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - { 329, -3 }, /* (86) db_options ::= db_options PRECISION NK_STRING */ - { 329, -3 }, /* (87) db_options ::= db_options REPLICA NK_INTEGER */ - { 329, -3 }, /* (88) db_options ::= db_options STRICT NK_STRING */ - { 329, -3 }, /* (89) db_options ::= db_options VGROUPS NK_INTEGER */ - { 329, -3 }, /* (90) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 329, -3 }, /* (91) db_options ::= db_options RETENTIONS retention_list */ - { 329, -3 }, /* (92) db_options ::= db_options SCHEMALESS NK_INTEGER */ - { 329, -3 }, /* (93) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - { 329, -3 }, /* (94) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - { 329, -3 }, /* (95) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - { 329, -4 }, /* (96) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - { 329, -3 }, /* (97) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - { 329, -4 }, /* (98) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - { 329, -3 }, /* (99) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - { 329, -3 }, /* (100) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - { 329, -3 }, /* (101) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - { 329, -3 }, /* (102) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ - { 329, -3 }, /* (103) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ - { 331, -1 }, /* (104) alter_db_options ::= alter_db_option */ - { 331, -2 }, /* (105) alter_db_options ::= alter_db_options alter_db_option */ - { 336, -2 }, /* (106) alter_db_option ::= CACHEMODEL NK_STRING */ - { 336, -2 }, /* (107) alter_db_option ::= CACHESIZE NK_INTEGER */ - { 336, -2 }, /* (108) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - { 336, -2 }, /* (109) alter_db_option ::= KEEP integer_list */ - { 336, -2 }, /* (110) alter_db_option ::= KEEP variable_list */ - { 336, -2 }, /* (111) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - { 336, -2 }, /* (112) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - { 333, -1 }, /* (113) integer_list ::= NK_INTEGER */ - { 333, -3 }, /* (114) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 334, -1 }, /* (115) variable_list ::= NK_VARIABLE */ - { 334, -3 }, /* (116) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 335, -1 }, /* (117) retention_list ::= retention */ - { 335, -3 }, /* (118) retention_list ::= retention_list NK_COMMA retention */ - { 337, -3 }, /* (119) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 332, 0 }, /* (120) speed_opt ::= */ - { 332, -2 }, /* (121) speed_opt ::= MAX_SPEED NK_INTEGER */ - { 315, -9 }, /* (122) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 315, -3 }, /* (123) cmd ::= CREATE TABLE multi_create_clause */ - { 315, -9 }, /* (124) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 315, -3 }, /* (125) cmd ::= DROP TABLE multi_drop_clause */ - { 315, -4 }, /* (126) cmd ::= DROP STABLE exists_opt full_table_name */ - { 315, -3 }, /* (127) cmd ::= ALTER TABLE alter_table_clause */ - { 315, -3 }, /* (128) cmd ::= ALTER STABLE alter_table_clause */ - { 345, -2 }, /* (129) alter_table_clause ::= full_table_name alter_table_options */ - { 345, -5 }, /* (130) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 345, -4 }, /* (131) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 345, -5 }, /* (132) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 345, -5 }, /* (133) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 345, -5 }, /* (134) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 345, -4 }, /* (135) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 345, -5 }, /* (136) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 345, -5 }, /* (137) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 345, -6 }, /* (138) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 342, -1 }, /* (139) multi_create_clause ::= create_subtable_clause */ - { 342, -2 }, /* (140) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 350, -10 }, /* (141) 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 */ - { 344, -1 }, /* (142) multi_drop_clause ::= drop_table_clause */ - { 344, -2 }, /* (143) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 353, -2 }, /* (144) drop_table_clause ::= exists_opt full_table_name */ - { 351, 0 }, /* (145) specific_cols_opt ::= */ - { 351, -3 }, /* (146) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - { 338, -1 }, /* (147) full_table_name ::= table_name */ - { 338, -3 }, /* (148) full_table_name ::= db_name NK_DOT table_name */ - { 339, -1 }, /* (149) column_def_list ::= column_def */ - { 339, -3 }, /* (150) column_def_list ::= column_def_list NK_COMMA column_def */ - { 356, -2 }, /* (151) column_def ::= column_name type_name */ - { 356, -4 }, /* (152) column_def ::= column_name type_name COMMENT NK_STRING */ - { 348, -1 }, /* (153) type_name ::= BOOL */ - { 348, -1 }, /* (154) type_name ::= TINYINT */ - { 348, -1 }, /* (155) type_name ::= SMALLINT */ - { 348, -1 }, /* (156) type_name ::= INT */ - { 348, -1 }, /* (157) type_name ::= INTEGER */ - { 348, -1 }, /* (158) type_name ::= BIGINT */ - { 348, -1 }, /* (159) type_name ::= FLOAT */ - { 348, -1 }, /* (160) type_name ::= DOUBLE */ - { 348, -4 }, /* (161) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 348, -1 }, /* (162) type_name ::= TIMESTAMP */ - { 348, -4 }, /* (163) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 348, -2 }, /* (164) type_name ::= TINYINT UNSIGNED */ - { 348, -2 }, /* (165) type_name ::= SMALLINT UNSIGNED */ - { 348, -2 }, /* (166) type_name ::= INT UNSIGNED */ - { 348, -2 }, /* (167) type_name ::= BIGINT UNSIGNED */ - { 348, -1 }, /* (168) type_name ::= JSON */ - { 348, -4 }, /* (169) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 348, -1 }, /* (170) type_name ::= MEDIUMBLOB */ - { 348, -1 }, /* (171) type_name ::= BLOB */ - { 348, -4 }, /* (172) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 348, -1 }, /* (173) type_name ::= DECIMAL */ - { 348, -4 }, /* (174) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 348, -6 }, /* (175) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 340, 0 }, /* (176) tags_def_opt ::= */ - { 340, -1 }, /* (177) tags_def_opt ::= tags_def */ - { 343, -4 }, /* (178) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 341, 0 }, /* (179) table_options ::= */ - { 341, -3 }, /* (180) table_options ::= table_options COMMENT NK_STRING */ - { 341, -3 }, /* (181) table_options ::= table_options MAX_DELAY duration_list */ - { 341, -3 }, /* (182) table_options ::= table_options WATERMARK duration_list */ - { 341, -5 }, /* (183) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - { 341, -3 }, /* (184) table_options ::= table_options TTL NK_INTEGER */ - { 341, -5 }, /* (185) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 346, -1 }, /* (186) alter_table_options ::= alter_table_option */ - { 346, -2 }, /* (187) alter_table_options ::= alter_table_options alter_table_option */ - { 359, -2 }, /* (188) alter_table_option ::= COMMENT NK_STRING */ - { 359, -2 }, /* (189) alter_table_option ::= TTL NK_INTEGER */ - { 357, -1 }, /* (190) duration_list ::= duration_literal */ - { 357, -3 }, /* (191) duration_list ::= duration_list NK_COMMA duration_literal */ - { 358, -1 }, /* (192) rollup_func_list ::= rollup_func_name */ - { 358, -3 }, /* (193) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - { 361, -1 }, /* (194) rollup_func_name ::= function_name */ - { 361, -1 }, /* (195) rollup_func_name ::= FIRST */ - { 361, -1 }, /* (196) rollup_func_name ::= LAST */ - { 354, -1 }, /* (197) col_name_list ::= col_name */ - { 354, -3 }, /* (198) col_name_list ::= col_name_list NK_COMMA col_name */ - { 363, -1 }, /* (199) col_name ::= column_name */ - { 315, -2 }, /* (200) cmd ::= SHOW DNODES */ - { 315, -2 }, /* (201) cmd ::= SHOW USERS */ - { 315, -2 }, /* (202) cmd ::= SHOW DATABASES */ - { 315, -4 }, /* (203) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 315, -4 }, /* (204) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 315, -3 }, /* (205) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 315, -2 }, /* (206) cmd ::= SHOW MNODES */ - { 315, -2 }, /* (207) cmd ::= SHOW MODULES */ - { 315, -2 }, /* (208) cmd ::= SHOW QNODES */ - { 315, -2 }, /* (209) cmd ::= SHOW FUNCTIONS */ - { 315, -5 }, /* (210) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 315, -2 }, /* (211) cmd ::= SHOW STREAMS */ - { 315, -2 }, /* (212) cmd ::= SHOW ACCOUNTS */ - { 315, -2 }, /* (213) cmd ::= SHOW APPS */ - { 315, -2 }, /* (214) cmd ::= SHOW CONNECTIONS */ - { 315, -2 }, /* (215) cmd ::= SHOW LICENCES */ - { 315, -2 }, /* (216) cmd ::= SHOW GRANTS */ - { 315, -4 }, /* (217) cmd ::= SHOW CREATE DATABASE db_name */ - { 315, -4 }, /* (218) cmd ::= SHOW CREATE TABLE full_table_name */ - { 315, -4 }, /* (219) cmd ::= SHOW CREATE STABLE full_table_name */ - { 315, -2 }, /* (220) cmd ::= SHOW QUERIES */ - { 315, -2 }, /* (221) cmd ::= SHOW SCORES */ - { 315, -2 }, /* (222) cmd ::= SHOW TOPICS */ - { 315, -2 }, /* (223) cmd ::= SHOW VARIABLES */ - { 315, -3 }, /* (224) cmd ::= SHOW LOCAL VARIABLES */ - { 315, -4 }, /* (225) cmd ::= SHOW DNODE NK_INTEGER VARIABLES */ - { 315, -2 }, /* (226) cmd ::= SHOW BNODES */ - { 315, -2 }, /* (227) cmd ::= SHOW SNODES */ - { 315, -2 }, /* (228) cmd ::= SHOW CLUSTER */ - { 315, -2 }, /* (229) cmd ::= SHOW TRANSACTIONS */ - { 315, -4 }, /* (230) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - { 315, -2 }, /* (231) cmd ::= SHOW CONSUMERS */ - { 315, -2 }, /* (232) cmd ::= SHOW SUBSCRIPTIONS */ - { 315, -5 }, /* (233) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - { 315, -3 }, /* (234) cmd ::= SHOW VNODES NK_INTEGER */ - { 315, -3 }, /* (235) cmd ::= SHOW VNODES NK_STRING */ - { 364, 0 }, /* (236) db_name_cond_opt ::= */ - { 364, -2 }, /* (237) db_name_cond_opt ::= db_name NK_DOT */ - { 365, 0 }, /* (238) like_pattern_opt ::= */ - { 365, -2 }, /* (239) like_pattern_opt ::= LIKE NK_STRING */ - { 366, -1 }, /* (240) table_name_cond ::= table_name */ - { 367, 0 }, /* (241) from_db_opt ::= */ - { 367, -2 }, /* (242) from_db_opt ::= FROM db_name */ - { 315, -8 }, /* (243) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ - { 315, -4 }, /* (244) cmd ::= DROP INDEX exists_opt full_table_name */ - { 368, -10 }, /* (245) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - { 368, -12 }, /* (246) 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 */ - { 369, -1 }, /* (247) func_list ::= func */ - { 369, -3 }, /* (248) func_list ::= func_list NK_COMMA func */ - { 372, -4 }, /* (249) func ::= function_name NK_LP expression_list NK_RP */ - { 371, 0 }, /* (250) sma_stream_opt ::= */ - { 371, -3 }, /* (251) sma_stream_opt ::= stream_options WATERMARK duration_literal */ - { 371, -3 }, /* (252) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ - { 315, -6 }, /* (253) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - { 315, -7 }, /* (254) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 315, -9 }, /* (255) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - { 315, -7 }, /* (256) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 315, -9 }, /* (257) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - { 315, -4 }, /* (258) cmd ::= DROP TOPIC exists_opt topic_name */ - { 315, -7 }, /* (259) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 315, -2 }, /* (260) cmd ::= DESC full_table_name */ - { 315, -2 }, /* (261) cmd ::= DESCRIBE full_table_name */ - { 315, -3 }, /* (262) cmd ::= RESET QUERY CACHE */ - { 315, -4 }, /* (263) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - { 377, 0 }, /* (264) analyze_opt ::= */ - { 377, -1 }, /* (265) analyze_opt ::= ANALYZE */ - { 378, 0 }, /* (266) explain_options ::= */ - { 378, -3 }, /* (267) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 378, -3 }, /* (268) explain_options ::= explain_options RATIO NK_FLOAT */ - { 315, -10 }, /* (269) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 315, -4 }, /* (270) cmd ::= DROP FUNCTION exists_opt function_name */ - { 379, 0 }, /* (271) agg_func_opt ::= */ - { 379, -1 }, /* (272) agg_func_opt ::= AGGREGATE */ - { 380, 0 }, /* (273) bufsize_opt ::= */ - { 380, -2 }, /* (274) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 315, -11 }, /* (275) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ - { 315, -4 }, /* (276) cmd ::= DROP STREAM exists_opt stream_name */ - { 373, 0 }, /* (277) stream_options ::= */ - { 373, -3 }, /* (278) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 373, -3 }, /* (279) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 373, -4 }, /* (280) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 373, -3 }, /* (281) stream_options ::= stream_options WATERMARK duration_literal */ - { 373, -4 }, /* (282) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - { 382, 0 }, /* (283) subtable_opt ::= */ - { 382, -4 }, /* (284) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - { 315, -3 }, /* (285) cmd ::= KILL CONNECTION NK_INTEGER */ - { 315, -3 }, /* (286) cmd ::= KILL QUERY NK_STRING */ - { 315, -3 }, /* (287) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 315, -2 }, /* (288) cmd ::= BALANCE VGROUP */ - { 315, -4 }, /* (289) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 315, -4 }, /* (290) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 315, -3 }, /* (291) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 384, -2 }, /* (292) dnode_list ::= DNODE NK_INTEGER */ - { 384, -3 }, /* (293) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 315, -4 }, /* (294) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 315, -1 }, /* (295) cmd ::= query_or_subquery */ - { 315, -7 }, /* (296) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - { 315, -4 }, /* (297) cmd ::= INSERT INTO full_table_name query_or_subquery */ - { 318, -1 }, /* (298) literal ::= NK_INTEGER */ - { 318, -1 }, /* (299) literal ::= NK_FLOAT */ - { 318, -1 }, /* (300) literal ::= NK_STRING */ - { 318, -1 }, /* (301) literal ::= NK_BOOL */ - { 318, -2 }, /* (302) literal ::= TIMESTAMP NK_STRING */ - { 318, -1 }, /* (303) literal ::= duration_literal */ - { 318, -1 }, /* (304) literal ::= NULL */ - { 318, -1 }, /* (305) literal ::= NK_QUESTION */ - { 360, -1 }, /* (306) duration_literal ::= NK_VARIABLE */ - { 386, -1 }, /* (307) signed ::= NK_INTEGER */ - { 386, -2 }, /* (308) signed ::= NK_PLUS NK_INTEGER */ - { 386, -2 }, /* (309) signed ::= NK_MINUS NK_INTEGER */ - { 386, -1 }, /* (310) signed ::= NK_FLOAT */ - { 386, -2 }, /* (311) signed ::= NK_PLUS NK_FLOAT */ - { 386, -2 }, /* (312) signed ::= NK_MINUS NK_FLOAT */ - { 349, -1 }, /* (313) signed_literal ::= signed */ - { 349, -1 }, /* (314) signed_literal ::= NK_STRING */ - { 349, -1 }, /* (315) signed_literal ::= NK_BOOL */ - { 349, -2 }, /* (316) signed_literal ::= TIMESTAMP NK_STRING */ - { 349, -1 }, /* (317) signed_literal ::= duration_literal */ - { 349, -1 }, /* (318) signed_literal ::= NULL */ - { 349, -1 }, /* (319) signed_literal ::= literal_func */ - { 349, -1 }, /* (320) signed_literal ::= NK_QUESTION */ - { 388, -1 }, /* (321) literal_list ::= signed_literal */ - { 388, -3 }, /* (322) literal_list ::= literal_list NK_COMMA signed_literal */ - { 326, -1 }, /* (323) db_name ::= NK_ID */ - { 355, -1 }, /* (324) table_name ::= NK_ID */ - { 347, -1 }, /* (325) column_name ::= NK_ID */ - { 362, -1 }, /* (326) function_name ::= NK_ID */ - { 389, -1 }, /* (327) table_alias ::= NK_ID */ - { 390, -1 }, /* (328) column_alias ::= NK_ID */ - { 320, -1 }, /* (329) user_name ::= NK_ID */ - { 374, -1 }, /* (330) topic_name ::= NK_ID */ - { 381, -1 }, /* (331) stream_name ::= NK_ID */ - { 376, -1 }, /* (332) cgroup_name ::= NK_ID */ - { 391, -1 }, /* (333) expr_or_subquery ::= expression */ - { 391, -1 }, /* (334) expr_or_subquery ::= subquery */ - { 383, -1 }, /* (335) expression ::= literal */ - { 383, -1 }, /* (336) expression ::= pseudo_column */ - { 383, -1 }, /* (337) expression ::= column_reference */ - { 383, -1 }, /* (338) expression ::= function_expression */ - { 383, -1 }, /* (339) expression ::= case_when_expression */ - { 383, -3 }, /* (340) expression ::= NK_LP expression NK_RP */ - { 383, -2 }, /* (341) expression ::= NK_PLUS expr_or_subquery */ - { 383, -2 }, /* (342) expression ::= NK_MINUS expr_or_subquery */ - { 383, -3 }, /* (343) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - { 383, -3 }, /* (344) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - { 383, -3 }, /* (345) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - { 383, -3 }, /* (346) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - { 383, -3 }, /* (347) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - { 383, -3 }, /* (348) expression ::= column_reference NK_ARROW NK_STRING */ - { 383, -3 }, /* (349) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - { 383, -3 }, /* (350) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - { 352, -1 }, /* (351) expression_list ::= expr_or_subquery */ - { 352, -3 }, /* (352) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - { 394, -1 }, /* (353) column_reference ::= column_name */ - { 394, -3 }, /* (354) column_reference ::= table_name NK_DOT column_name */ - { 393, -1 }, /* (355) pseudo_column ::= ROWTS */ - { 393, -1 }, /* (356) pseudo_column ::= TBNAME */ - { 393, -3 }, /* (357) pseudo_column ::= table_name NK_DOT TBNAME */ - { 393, -1 }, /* (358) pseudo_column ::= QSTART */ - { 393, -1 }, /* (359) pseudo_column ::= QEND */ - { 393, -1 }, /* (360) pseudo_column ::= QDURATION */ - { 393, -1 }, /* (361) pseudo_column ::= WSTART */ - { 393, -1 }, /* (362) pseudo_column ::= WEND */ - { 393, -1 }, /* (363) pseudo_column ::= WDURATION */ - { 395, -4 }, /* (364) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 395, -4 }, /* (365) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 395, -6 }, /* (366) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - { 395, -1 }, /* (367) function_expression ::= literal_func */ - { 387, -3 }, /* (368) literal_func ::= noarg_func NK_LP NK_RP */ - { 387, -1 }, /* (369) literal_func ::= NOW */ - { 399, -1 }, /* (370) noarg_func ::= NOW */ - { 399, -1 }, /* (371) noarg_func ::= TODAY */ - { 399, -1 }, /* (372) noarg_func ::= TIMEZONE */ - { 399, -1 }, /* (373) noarg_func ::= DATABASE */ - { 399, -1 }, /* (374) noarg_func ::= CLIENT_VERSION */ - { 399, -1 }, /* (375) noarg_func ::= SERVER_VERSION */ - { 399, -1 }, /* (376) noarg_func ::= SERVER_STATUS */ - { 399, -1 }, /* (377) noarg_func ::= CURRENT_USER */ - { 399, -1 }, /* (378) noarg_func ::= USER */ - { 397, -1 }, /* (379) star_func ::= COUNT */ - { 397, -1 }, /* (380) star_func ::= FIRST */ - { 397, -1 }, /* (381) star_func ::= LAST */ - { 397, -1 }, /* (382) star_func ::= LAST_ROW */ - { 398, -1 }, /* (383) star_func_para_list ::= NK_STAR */ - { 398, -1 }, /* (384) star_func_para_list ::= other_para_list */ - { 400, -1 }, /* (385) other_para_list ::= star_func_para */ - { 400, -3 }, /* (386) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 401, -1 }, /* (387) star_func_para ::= expr_or_subquery */ - { 401, -3 }, /* (388) star_func_para ::= table_name NK_DOT NK_STAR */ - { 396, -4 }, /* (389) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - { 396, -5 }, /* (390) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - { 402, -1 }, /* (391) when_then_list ::= when_then_expr */ - { 402, -2 }, /* (392) when_then_list ::= when_then_list when_then_expr */ - { 405, -4 }, /* (393) when_then_expr ::= WHEN common_expression THEN common_expression */ - { 403, 0 }, /* (394) case_when_else_opt ::= */ - { 403, -2 }, /* (395) case_when_else_opt ::= ELSE common_expression */ - { 406, -3 }, /* (396) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - { 406, -5 }, /* (397) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - { 406, -6 }, /* (398) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - { 406, -3 }, /* (399) predicate ::= expr_or_subquery IS NULL */ - { 406, -4 }, /* (400) predicate ::= expr_or_subquery IS NOT NULL */ - { 406, -3 }, /* (401) predicate ::= expr_or_subquery in_op in_predicate_value */ - { 407, -1 }, /* (402) compare_op ::= NK_LT */ - { 407, -1 }, /* (403) compare_op ::= NK_GT */ - { 407, -1 }, /* (404) compare_op ::= NK_LE */ - { 407, -1 }, /* (405) compare_op ::= NK_GE */ - { 407, -1 }, /* (406) compare_op ::= NK_NE */ - { 407, -1 }, /* (407) compare_op ::= NK_EQ */ - { 407, -1 }, /* (408) compare_op ::= LIKE */ - { 407, -2 }, /* (409) compare_op ::= NOT LIKE */ - { 407, -1 }, /* (410) compare_op ::= MATCH */ - { 407, -1 }, /* (411) compare_op ::= NMATCH */ - { 407, -1 }, /* (412) compare_op ::= CONTAINS */ - { 408, -1 }, /* (413) in_op ::= IN */ - { 408, -2 }, /* (414) in_op ::= NOT IN */ - { 409, -3 }, /* (415) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 410, -1 }, /* (416) boolean_value_expression ::= boolean_primary */ - { 410, -2 }, /* (417) boolean_value_expression ::= NOT boolean_primary */ - { 410, -3 }, /* (418) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 410, -3 }, /* (419) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 411, -1 }, /* (420) boolean_primary ::= predicate */ - { 411, -3 }, /* (421) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 404, -1 }, /* (422) common_expression ::= expr_or_subquery */ - { 404, -1 }, /* (423) common_expression ::= boolean_value_expression */ - { 412, 0 }, /* (424) from_clause_opt ::= */ - { 412, -2 }, /* (425) from_clause_opt ::= FROM table_reference_list */ - { 413, -1 }, /* (426) table_reference_list ::= table_reference */ - { 413, -3 }, /* (427) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 414, -1 }, /* (428) table_reference ::= table_primary */ - { 414, -1 }, /* (429) table_reference ::= joined_table */ - { 415, -2 }, /* (430) table_primary ::= table_name alias_opt */ - { 415, -4 }, /* (431) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 415, -2 }, /* (432) table_primary ::= subquery alias_opt */ - { 415, -1 }, /* (433) table_primary ::= parenthesized_joined_table */ - { 417, 0 }, /* (434) alias_opt ::= */ - { 417, -1 }, /* (435) alias_opt ::= table_alias */ - { 417, -2 }, /* (436) alias_opt ::= AS table_alias */ - { 418, -3 }, /* (437) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 418, -3 }, /* (438) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 416, -6 }, /* (439) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 419, 0 }, /* (440) join_type ::= */ - { 419, -1 }, /* (441) join_type ::= INNER */ - { 421, -12 }, /* (442) 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 */ - { 422, 0 }, /* (443) set_quantifier_opt ::= */ - { 422, -1 }, /* (444) set_quantifier_opt ::= DISTINCT */ - { 422, -1 }, /* (445) set_quantifier_opt ::= ALL */ - { 423, -1 }, /* (446) select_list ::= select_item */ - { 423, -3 }, /* (447) select_list ::= select_list NK_COMMA select_item */ - { 431, -1 }, /* (448) select_item ::= NK_STAR */ - { 431, -1 }, /* (449) select_item ::= common_expression */ - { 431, -2 }, /* (450) select_item ::= common_expression column_alias */ - { 431, -3 }, /* (451) select_item ::= common_expression AS column_alias */ - { 431, -3 }, /* (452) select_item ::= table_name NK_DOT NK_STAR */ - { 385, 0 }, /* (453) where_clause_opt ::= */ - { 385, -2 }, /* (454) where_clause_opt ::= WHERE search_condition */ - { 424, 0 }, /* (455) partition_by_clause_opt ::= */ - { 424, -3 }, /* (456) partition_by_clause_opt ::= PARTITION BY partition_list */ - { 432, -1 }, /* (457) partition_list ::= partition_item */ - { 432, -3 }, /* (458) partition_list ::= partition_list NK_COMMA partition_item */ - { 433, -1 }, /* (459) partition_item ::= expr_or_subquery */ - { 433, -2 }, /* (460) partition_item ::= expr_or_subquery column_alias */ - { 433, -3 }, /* (461) partition_item ::= expr_or_subquery AS column_alias */ - { 428, 0 }, /* (462) twindow_clause_opt ::= */ - { 428, -6 }, /* (463) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 428, -4 }, /* (464) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - { 428, -6 }, /* (465) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 428, -8 }, /* (466) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 370, 0 }, /* (467) sliding_opt ::= */ - { 370, -4 }, /* (468) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 427, 0 }, /* (469) fill_opt ::= */ - { 427, -4 }, /* (470) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 427, -6 }, /* (471) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 434, -1 }, /* (472) fill_mode ::= NONE */ - { 434, -1 }, /* (473) fill_mode ::= PREV */ - { 434, -1 }, /* (474) fill_mode ::= NULL */ - { 434, -1 }, /* (475) fill_mode ::= LINEAR */ - { 434, -1 }, /* (476) fill_mode ::= NEXT */ - { 429, 0 }, /* (477) group_by_clause_opt ::= */ - { 429, -3 }, /* (478) group_by_clause_opt ::= GROUP BY group_by_list */ - { 435, -1 }, /* (479) group_by_list ::= expr_or_subquery */ - { 435, -3 }, /* (480) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - { 430, 0 }, /* (481) having_clause_opt ::= */ - { 430, -2 }, /* (482) having_clause_opt ::= HAVING search_condition */ - { 425, 0 }, /* (483) range_opt ::= */ - { 425, -6 }, /* (484) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - { 426, 0 }, /* (485) every_opt ::= */ - { 426, -4 }, /* (486) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 436, -4 }, /* (487) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 437, -1 }, /* (488) query_simple ::= query_specification */ - { 437, -1 }, /* (489) query_simple ::= union_query_expression */ - { 441, -4 }, /* (490) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - { 441, -3 }, /* (491) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - { 442, -1 }, /* (492) query_simple_or_subquery ::= query_simple */ - { 442, -1 }, /* (493) query_simple_or_subquery ::= subquery */ - { 375, -1 }, /* (494) query_or_subquery ::= query_expression */ - { 375, -1 }, /* (495) query_or_subquery ::= subquery */ - { 438, 0 }, /* (496) order_by_clause_opt ::= */ - { 438, -3 }, /* (497) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 439, 0 }, /* (498) slimit_clause_opt ::= */ - { 439, -2 }, /* (499) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 439, -4 }, /* (500) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 439, -4 }, /* (501) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 440, 0 }, /* (502) limit_clause_opt ::= */ - { 440, -2 }, /* (503) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 440, -4 }, /* (504) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 440, -4 }, /* (505) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 392, -3 }, /* (506) subquery ::= NK_LP query_expression NK_RP */ - { 392, -3 }, /* (507) subquery ::= NK_LP subquery NK_RP */ - { 420, -1 }, /* (508) search_condition ::= common_expression */ - { 443, -1 }, /* (509) sort_specification_list ::= sort_specification */ - { 443, -3 }, /* (510) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 444, -3 }, /* (511) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - { 445, 0 }, /* (512) ordering_specification_opt ::= */ - { 445, -1 }, /* (513) ordering_specification_opt ::= ASC */ - { 445, -1 }, /* (514) ordering_specification_opt ::= DESC */ - { 446, 0 }, /* (515) null_ordering_opt ::= */ - { 446, -2 }, /* (516) null_ordering_opt ::= NULLS FIRST */ - { 446, -2 }, /* (517) null_ordering_opt ::= NULLS LAST */ + { 317, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + { 317, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + { 318, 0 }, /* (2) account_options ::= */ + { 318, -3 }, /* (3) account_options ::= account_options PPS literal */ + { 318, -3 }, /* (4) account_options ::= account_options TSERIES literal */ + { 318, -3 }, /* (5) account_options ::= account_options STORAGE literal */ + { 318, -3 }, /* (6) account_options ::= account_options STREAMS literal */ + { 318, -3 }, /* (7) account_options ::= account_options QTIME literal */ + { 318, -3 }, /* (8) account_options ::= account_options DBS literal */ + { 318, -3 }, /* (9) account_options ::= account_options USERS literal */ + { 318, -3 }, /* (10) account_options ::= account_options CONNS literal */ + { 318, -3 }, /* (11) account_options ::= account_options STATE literal */ + { 319, -1 }, /* (12) alter_account_options ::= alter_account_option */ + { 319, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + { 321, -2 }, /* (14) alter_account_option ::= PASS literal */ + { 321, -2 }, /* (15) alter_account_option ::= PPS literal */ + { 321, -2 }, /* (16) alter_account_option ::= TSERIES literal */ + { 321, -2 }, /* (17) alter_account_option ::= STORAGE literal */ + { 321, -2 }, /* (18) alter_account_option ::= STREAMS literal */ + { 321, -2 }, /* (19) alter_account_option ::= QTIME literal */ + { 321, -2 }, /* (20) alter_account_option ::= DBS literal */ + { 321, -2 }, /* (21) alter_account_option ::= USERS literal */ + { 321, -2 }, /* (22) alter_account_option ::= CONNS literal */ + { 321, -2 }, /* (23) alter_account_option ::= STATE literal */ + { 317, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ + { 317, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ + { 317, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + { 317, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + { 317, -3 }, /* (28) cmd ::= DROP USER user_name */ + { 323, 0 }, /* (29) sysinfo_opt ::= */ + { 323, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ + { 317, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ + { 317, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ + { 324, -1 }, /* (33) privileges ::= ALL */ + { 324, -1 }, /* (34) privileges ::= priv_type_list */ + { 326, -1 }, /* (35) priv_type_list ::= priv_type */ + { 326, -3 }, /* (36) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + { 327, -1 }, /* (37) priv_type ::= READ */ + { 327, -1 }, /* (38) priv_type ::= WRITE */ + { 325, -3 }, /* (39) priv_level ::= NK_STAR NK_DOT NK_STAR */ + { 325, -3 }, /* (40) priv_level ::= db_name NK_DOT NK_STAR */ + { 317, -3 }, /* (41) cmd ::= CREATE DNODE dnode_endpoint */ + { 317, -5 }, /* (42) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + { 317, -3 }, /* (43) cmd ::= DROP DNODE NK_INTEGER */ + { 317, -3 }, /* (44) cmd ::= DROP DNODE dnode_endpoint */ + { 317, -4 }, /* (45) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + { 317, -5 }, /* (46) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + { 317, -4 }, /* (47) cmd ::= ALTER ALL DNODES NK_STRING */ + { 317, -5 }, /* (48) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + { 329, -1 }, /* (49) dnode_endpoint ::= NK_STRING */ + { 329, -1 }, /* (50) dnode_endpoint ::= NK_ID */ + { 329, -1 }, /* (51) dnode_endpoint ::= NK_IPTOKEN */ + { 317, -3 }, /* (52) cmd ::= ALTER LOCAL NK_STRING */ + { 317, -4 }, /* (53) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + { 317, -5 }, /* (54) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + { 317, -5 }, /* (55) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + { 317, -5 }, /* (56) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + { 317, -5 }, /* (57) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + { 317, -5 }, /* (58) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + { 317, -5 }, /* (59) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + { 317, -5 }, /* (60) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + { 317, -5 }, /* (61) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + { 317, -5 }, /* (62) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { 317, -4 }, /* (63) cmd ::= DROP DATABASE exists_opt db_name */ + { 317, -2 }, /* (64) cmd ::= USE db_name */ + { 317, -4 }, /* (65) cmd ::= ALTER DATABASE db_name alter_db_options */ + { 317, -3 }, /* (66) cmd ::= FLUSH DATABASE db_name */ + { 317, -4 }, /* (67) cmd ::= TRIM DATABASE db_name speed_opt */ + { 330, -3 }, /* (68) not_exists_opt ::= IF NOT EXISTS */ + { 330, 0 }, /* (69) not_exists_opt ::= */ + { 332, -2 }, /* (70) exists_opt ::= IF EXISTS */ + { 332, 0 }, /* (71) exists_opt ::= */ + { 331, 0 }, /* (72) db_options ::= */ + { 331, -3 }, /* (73) db_options ::= db_options BUFFER NK_INTEGER */ + { 331, -3 }, /* (74) db_options ::= db_options CACHEMODEL NK_STRING */ + { 331, -3 }, /* (75) db_options ::= db_options CACHESIZE NK_INTEGER */ + { 331, -3 }, /* (76) db_options ::= db_options COMP NK_INTEGER */ + { 331, -3 }, /* (77) db_options ::= db_options DURATION NK_INTEGER */ + { 331, -3 }, /* (78) db_options ::= db_options DURATION NK_VARIABLE */ + { 331, -3 }, /* (79) db_options ::= db_options MAXROWS NK_INTEGER */ + { 331, -3 }, /* (80) db_options ::= db_options MINROWS NK_INTEGER */ + { 331, -3 }, /* (81) db_options ::= db_options KEEP integer_list */ + { 331, -3 }, /* (82) db_options ::= db_options KEEP variable_list */ + { 331, -3 }, /* (83) db_options ::= db_options PAGES NK_INTEGER */ + { 331, -3 }, /* (84) db_options ::= db_options PAGESIZE NK_INTEGER */ + { 331, -3 }, /* (85) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + { 331, -3 }, /* (86) db_options ::= db_options PRECISION NK_STRING */ + { 331, -3 }, /* (87) db_options ::= db_options REPLICA NK_INTEGER */ + { 331, -3 }, /* (88) db_options ::= db_options STRICT NK_STRING */ + { 331, -3 }, /* (89) db_options ::= db_options VGROUPS NK_INTEGER */ + { 331, -3 }, /* (90) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 331, -3 }, /* (91) db_options ::= db_options RETENTIONS retention_list */ + { 331, -3 }, /* (92) db_options ::= db_options SCHEMALESS NK_INTEGER */ + { 331, -3 }, /* (93) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + { 331, -3 }, /* (94) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + { 331, -3 }, /* (95) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + { 331, -4 }, /* (96) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + { 331, -3 }, /* (97) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + { 331, -4 }, /* (98) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + { 331, -3 }, /* (99) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + { 331, -3 }, /* (100) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + { 331, -3 }, /* (101) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + { 331, -3 }, /* (102) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ + { 331, -3 }, /* (103) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ + { 333, -1 }, /* (104) alter_db_options ::= alter_db_option */ + { 333, -2 }, /* (105) alter_db_options ::= alter_db_options alter_db_option */ + { 338, -2 }, /* (106) alter_db_option ::= CACHEMODEL NK_STRING */ + { 338, -2 }, /* (107) alter_db_option ::= CACHESIZE NK_INTEGER */ + { 338, -2 }, /* (108) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + { 338, -2 }, /* (109) alter_db_option ::= KEEP integer_list */ + { 338, -2 }, /* (110) alter_db_option ::= KEEP variable_list */ + { 338, -2 }, /* (111) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + { 338, -2 }, /* (112) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + { 335, -1 }, /* (113) integer_list ::= NK_INTEGER */ + { 335, -3 }, /* (114) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + { 336, -1 }, /* (115) variable_list ::= NK_VARIABLE */ + { 336, -3 }, /* (116) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { 337, -1 }, /* (117) retention_list ::= retention */ + { 337, -3 }, /* (118) retention_list ::= retention_list NK_COMMA retention */ + { 339, -3 }, /* (119) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + { 334, 0 }, /* (120) speed_opt ::= */ + { 334, -2 }, /* (121) speed_opt ::= MAX_SPEED NK_INTEGER */ + { 317, -9 }, /* (122) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 317, -3 }, /* (123) cmd ::= CREATE TABLE multi_create_clause */ + { 317, -9 }, /* (124) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 317, -3 }, /* (125) cmd ::= DROP TABLE multi_drop_clause */ + { 317, -4 }, /* (126) cmd ::= DROP STABLE exists_opt full_table_name */ + { 317, -3 }, /* (127) cmd ::= ALTER TABLE alter_table_clause */ + { 317, -3 }, /* (128) cmd ::= ALTER STABLE alter_table_clause */ + { 347, -2 }, /* (129) alter_table_clause ::= full_table_name alter_table_options */ + { 347, -5 }, /* (130) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 347, -4 }, /* (131) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 347, -5 }, /* (132) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 347, -5 }, /* (133) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 347, -5 }, /* (134) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 347, -4 }, /* (135) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 347, -5 }, /* (136) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 347, -5 }, /* (137) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 347, -6 }, /* (138) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + { 344, -1 }, /* (139) multi_create_clause ::= create_subtable_clause */ + { 344, -2 }, /* (140) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 352, -10 }, /* (141) 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 */ + { 346, -1 }, /* (142) multi_drop_clause ::= drop_table_clause */ + { 346, -2 }, /* (143) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 355, -2 }, /* (144) drop_table_clause ::= exists_opt full_table_name */ + { 353, 0 }, /* (145) specific_cols_opt ::= */ + { 353, -3 }, /* (146) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + { 340, -1 }, /* (147) full_table_name ::= table_name */ + { 340, -3 }, /* (148) full_table_name ::= db_name NK_DOT table_name */ + { 341, -1 }, /* (149) column_def_list ::= column_def */ + { 341, -3 }, /* (150) column_def_list ::= column_def_list NK_COMMA column_def */ + { 358, -2 }, /* (151) column_def ::= column_name type_name */ + { 358, -4 }, /* (152) column_def ::= column_name type_name COMMENT NK_STRING */ + { 350, -1 }, /* (153) type_name ::= BOOL */ + { 350, -1 }, /* (154) type_name ::= TINYINT */ + { 350, -1 }, /* (155) type_name ::= SMALLINT */ + { 350, -1 }, /* (156) type_name ::= INT */ + { 350, -1 }, /* (157) type_name ::= INTEGER */ + { 350, -1 }, /* (158) type_name ::= BIGINT */ + { 350, -1 }, /* (159) type_name ::= FLOAT */ + { 350, -1 }, /* (160) type_name ::= DOUBLE */ + { 350, -4 }, /* (161) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 350, -1 }, /* (162) type_name ::= TIMESTAMP */ + { 350, -4 }, /* (163) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 350, -2 }, /* (164) type_name ::= TINYINT UNSIGNED */ + { 350, -2 }, /* (165) type_name ::= SMALLINT UNSIGNED */ + { 350, -2 }, /* (166) type_name ::= INT UNSIGNED */ + { 350, -2 }, /* (167) type_name ::= BIGINT UNSIGNED */ + { 350, -1 }, /* (168) type_name ::= JSON */ + { 350, -4 }, /* (169) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 350, -1 }, /* (170) type_name ::= MEDIUMBLOB */ + { 350, -1 }, /* (171) type_name ::= BLOB */ + { 350, -4 }, /* (172) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 350, -1 }, /* (173) type_name ::= DECIMAL */ + { 350, -4 }, /* (174) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 350, -6 }, /* (175) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 342, 0 }, /* (176) tags_def_opt ::= */ + { 342, -1 }, /* (177) tags_def_opt ::= tags_def */ + { 345, -4 }, /* (178) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 343, 0 }, /* (179) table_options ::= */ + { 343, -3 }, /* (180) table_options ::= table_options COMMENT NK_STRING */ + { 343, -3 }, /* (181) table_options ::= table_options MAX_DELAY duration_list */ + { 343, -3 }, /* (182) table_options ::= table_options WATERMARK duration_list */ + { 343, -5 }, /* (183) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + { 343, -3 }, /* (184) table_options ::= table_options TTL NK_INTEGER */ + { 343, -5 }, /* (185) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 348, -1 }, /* (186) alter_table_options ::= alter_table_option */ + { 348, -2 }, /* (187) alter_table_options ::= alter_table_options alter_table_option */ + { 361, -2 }, /* (188) alter_table_option ::= COMMENT NK_STRING */ + { 361, -2 }, /* (189) alter_table_option ::= TTL NK_INTEGER */ + { 359, -1 }, /* (190) duration_list ::= duration_literal */ + { 359, -3 }, /* (191) duration_list ::= duration_list NK_COMMA duration_literal */ + { 360, -1 }, /* (192) rollup_func_list ::= rollup_func_name */ + { 360, -3 }, /* (193) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + { 363, -1 }, /* (194) rollup_func_name ::= function_name */ + { 363, -1 }, /* (195) rollup_func_name ::= FIRST */ + { 363, -1 }, /* (196) rollup_func_name ::= LAST */ + { 356, -1 }, /* (197) col_name_list ::= col_name */ + { 356, -3 }, /* (198) col_name_list ::= col_name_list NK_COMMA col_name */ + { 365, -1 }, /* (199) col_name ::= column_name */ + { 317, -2 }, /* (200) cmd ::= SHOW DNODES */ + { 317, -2 }, /* (201) cmd ::= SHOW USERS */ + { 317, -2 }, /* (202) cmd ::= SHOW DATABASES */ + { 317, -4 }, /* (203) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 317, -4 }, /* (204) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 317, -3 }, /* (205) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 317, -2 }, /* (206) cmd ::= SHOW MNODES */ + { 317, -2 }, /* (207) cmd ::= SHOW MODULES */ + { 317, -2 }, /* (208) cmd ::= SHOW QNODES */ + { 317, -2 }, /* (209) cmd ::= SHOW FUNCTIONS */ + { 317, -5 }, /* (210) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 317, -2 }, /* (211) cmd ::= SHOW STREAMS */ + { 317, -2 }, /* (212) cmd ::= SHOW ACCOUNTS */ + { 317, -2 }, /* (213) cmd ::= SHOW APPS */ + { 317, -2 }, /* (214) cmd ::= SHOW CONNECTIONS */ + { 317, -2 }, /* (215) cmd ::= SHOW LICENCES */ + { 317, -2 }, /* (216) cmd ::= SHOW GRANTS */ + { 317, -4 }, /* (217) cmd ::= SHOW CREATE DATABASE db_name */ + { 317, -4 }, /* (218) cmd ::= SHOW CREATE TABLE full_table_name */ + { 317, -4 }, /* (219) cmd ::= SHOW CREATE STABLE full_table_name */ + { 317, -2 }, /* (220) cmd ::= SHOW QUERIES */ + { 317, -2 }, /* (221) cmd ::= SHOW SCORES */ + { 317, -2 }, /* (222) cmd ::= SHOW TOPICS */ + { 317, -2 }, /* (223) cmd ::= SHOW VARIABLES */ + { 317, -3 }, /* (224) cmd ::= SHOW LOCAL VARIABLES */ + { 317, -4 }, /* (225) cmd ::= SHOW DNODE NK_INTEGER VARIABLES */ + { 317, -2 }, /* (226) cmd ::= SHOW BNODES */ + { 317, -2 }, /* (227) cmd ::= SHOW SNODES */ + { 317, -2 }, /* (228) cmd ::= SHOW CLUSTER */ + { 317, -2 }, /* (229) cmd ::= SHOW TRANSACTIONS */ + { 317, -4 }, /* (230) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + { 317, -2 }, /* (231) cmd ::= SHOW CONSUMERS */ + { 317, -2 }, /* (232) cmd ::= SHOW SUBSCRIPTIONS */ + { 317, -5 }, /* (233) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + { 317, -6 }, /* (234) cmd ::= SHOW TABLE TAGS FROM table_name_cond from_db_opt */ + { 317, -3 }, /* (235) cmd ::= SHOW VNODES NK_INTEGER */ + { 317, -3 }, /* (236) cmd ::= SHOW VNODES NK_STRING */ + { 366, 0 }, /* (237) db_name_cond_opt ::= */ + { 366, -2 }, /* (238) db_name_cond_opt ::= db_name NK_DOT */ + { 367, 0 }, /* (239) like_pattern_opt ::= */ + { 367, -2 }, /* (240) like_pattern_opt ::= LIKE NK_STRING */ + { 368, -1 }, /* (241) table_name_cond ::= table_name */ + { 369, 0 }, /* (242) from_db_opt ::= */ + { 369, -2 }, /* (243) from_db_opt ::= FROM db_name */ + { 317, -8 }, /* (244) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + { 317, -4 }, /* (245) cmd ::= DROP INDEX exists_opt full_table_name */ + { 370, -10 }, /* (246) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + { 370, -12 }, /* (247) 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 */ + { 371, -1 }, /* (248) func_list ::= func */ + { 371, -3 }, /* (249) func_list ::= func_list NK_COMMA func */ + { 374, -4 }, /* (250) func ::= function_name NK_LP expression_list NK_RP */ + { 373, 0 }, /* (251) sma_stream_opt ::= */ + { 373, -3 }, /* (252) sma_stream_opt ::= stream_options WATERMARK duration_literal */ + { 373, -3 }, /* (253) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ + { 317, -6 }, /* (254) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + { 317, -7 }, /* (255) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + { 317, -9 }, /* (256) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + { 317, -7 }, /* (257) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + { 317, -9 }, /* (258) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + { 317, -4 }, /* (259) cmd ::= DROP TOPIC exists_opt topic_name */ + { 317, -7 }, /* (260) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { 317, -2 }, /* (261) cmd ::= DESC full_table_name */ + { 317, -2 }, /* (262) cmd ::= DESCRIBE full_table_name */ + { 317, -3 }, /* (263) cmd ::= RESET QUERY CACHE */ + { 317, -4 }, /* (264) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + { 379, 0 }, /* (265) analyze_opt ::= */ + { 379, -1 }, /* (266) analyze_opt ::= ANALYZE */ + { 380, 0 }, /* (267) explain_options ::= */ + { 380, -3 }, /* (268) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 380, -3 }, /* (269) explain_options ::= explain_options RATIO NK_FLOAT */ + { 317, -10 }, /* (270) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + { 317, -4 }, /* (271) cmd ::= DROP FUNCTION exists_opt function_name */ + { 381, 0 }, /* (272) agg_func_opt ::= */ + { 381, -1 }, /* (273) agg_func_opt ::= AGGREGATE */ + { 382, 0 }, /* (274) bufsize_opt ::= */ + { 382, -2 }, /* (275) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 317, -11 }, /* (276) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ + { 317, -4 }, /* (277) cmd ::= DROP STREAM exists_opt stream_name */ + { 375, 0 }, /* (278) stream_options ::= */ + { 375, -3 }, /* (279) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 375, -3 }, /* (280) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 375, -4 }, /* (281) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 375, -3 }, /* (282) stream_options ::= stream_options WATERMARK duration_literal */ + { 375, -4 }, /* (283) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + { 384, 0 }, /* (284) subtable_opt ::= */ + { 384, -4 }, /* (285) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + { 317, -3 }, /* (286) cmd ::= KILL CONNECTION NK_INTEGER */ + { 317, -3 }, /* (287) cmd ::= KILL QUERY NK_STRING */ + { 317, -3 }, /* (288) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 317, -2 }, /* (289) cmd ::= BALANCE VGROUP */ + { 317, -4 }, /* (290) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 317, -4 }, /* (291) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 317, -3 }, /* (292) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 386, -2 }, /* (293) dnode_list ::= DNODE NK_INTEGER */ + { 386, -3 }, /* (294) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 317, -4 }, /* (295) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 317, -1 }, /* (296) cmd ::= query_or_subquery */ + { 317, -7 }, /* (297) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + { 317, -4 }, /* (298) cmd ::= INSERT INTO full_table_name query_or_subquery */ + { 320, -1 }, /* (299) literal ::= NK_INTEGER */ + { 320, -1 }, /* (300) literal ::= NK_FLOAT */ + { 320, -1 }, /* (301) literal ::= NK_STRING */ + { 320, -1 }, /* (302) literal ::= NK_BOOL */ + { 320, -2 }, /* (303) literal ::= TIMESTAMP NK_STRING */ + { 320, -1 }, /* (304) literal ::= duration_literal */ + { 320, -1 }, /* (305) literal ::= NULL */ + { 320, -1 }, /* (306) literal ::= NK_QUESTION */ + { 362, -1 }, /* (307) duration_literal ::= NK_VARIABLE */ + { 388, -1 }, /* (308) signed ::= NK_INTEGER */ + { 388, -2 }, /* (309) signed ::= NK_PLUS NK_INTEGER */ + { 388, -2 }, /* (310) signed ::= NK_MINUS NK_INTEGER */ + { 388, -1 }, /* (311) signed ::= NK_FLOAT */ + { 388, -2 }, /* (312) signed ::= NK_PLUS NK_FLOAT */ + { 388, -2 }, /* (313) signed ::= NK_MINUS NK_FLOAT */ + { 351, -1 }, /* (314) signed_literal ::= signed */ + { 351, -1 }, /* (315) signed_literal ::= NK_STRING */ + { 351, -1 }, /* (316) signed_literal ::= NK_BOOL */ + { 351, -2 }, /* (317) signed_literal ::= TIMESTAMP NK_STRING */ + { 351, -1 }, /* (318) signed_literal ::= duration_literal */ + { 351, -1 }, /* (319) signed_literal ::= NULL */ + { 351, -1 }, /* (320) signed_literal ::= literal_func */ + { 351, -1 }, /* (321) signed_literal ::= NK_QUESTION */ + { 390, -1 }, /* (322) literal_list ::= signed_literal */ + { 390, -3 }, /* (323) literal_list ::= literal_list NK_COMMA signed_literal */ + { 328, -1 }, /* (324) db_name ::= NK_ID */ + { 357, -1 }, /* (325) table_name ::= NK_ID */ + { 349, -1 }, /* (326) column_name ::= NK_ID */ + { 364, -1 }, /* (327) function_name ::= NK_ID */ + { 391, -1 }, /* (328) table_alias ::= NK_ID */ + { 392, -1 }, /* (329) column_alias ::= NK_ID */ + { 322, -1 }, /* (330) user_name ::= NK_ID */ + { 376, -1 }, /* (331) topic_name ::= NK_ID */ + { 383, -1 }, /* (332) stream_name ::= NK_ID */ + { 378, -1 }, /* (333) cgroup_name ::= NK_ID */ + { 393, -1 }, /* (334) expr_or_subquery ::= expression */ + { 393, -1 }, /* (335) expr_or_subquery ::= subquery */ + { 385, -1 }, /* (336) expression ::= literal */ + { 385, -1 }, /* (337) expression ::= pseudo_column */ + { 385, -1 }, /* (338) expression ::= column_reference */ + { 385, -1 }, /* (339) expression ::= function_expression */ + { 385, -1 }, /* (340) expression ::= case_when_expression */ + { 385, -3 }, /* (341) expression ::= NK_LP expression NK_RP */ + { 385, -2 }, /* (342) expression ::= NK_PLUS expr_or_subquery */ + { 385, -2 }, /* (343) expression ::= NK_MINUS expr_or_subquery */ + { 385, -3 }, /* (344) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + { 385, -3 }, /* (345) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + { 385, -3 }, /* (346) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + { 385, -3 }, /* (347) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + { 385, -3 }, /* (348) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + { 385, -3 }, /* (349) expression ::= column_reference NK_ARROW NK_STRING */ + { 385, -3 }, /* (350) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + { 385, -3 }, /* (351) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + { 354, -1 }, /* (352) expression_list ::= expr_or_subquery */ + { 354, -3 }, /* (353) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + { 396, -1 }, /* (354) column_reference ::= column_name */ + { 396, -3 }, /* (355) column_reference ::= table_name NK_DOT column_name */ + { 395, -1 }, /* (356) pseudo_column ::= ROWTS */ + { 395, -1 }, /* (357) pseudo_column ::= TBNAME */ + { 395, -3 }, /* (358) pseudo_column ::= table_name NK_DOT TBNAME */ + { 395, -1 }, /* (359) pseudo_column ::= QSTART */ + { 395, -1 }, /* (360) pseudo_column ::= QEND */ + { 395, -1 }, /* (361) pseudo_column ::= QDURATION */ + { 395, -1 }, /* (362) pseudo_column ::= WSTART */ + { 395, -1 }, /* (363) pseudo_column ::= WEND */ + { 395, -1 }, /* (364) pseudo_column ::= WDURATION */ + { 395, -1 }, /* (365) pseudo_column ::= IROWTS */ + { 395, -1 }, /* (366) pseudo_column ::= QTAGS */ + { 397, -4 }, /* (367) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 397, -4 }, /* (368) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 397, -6 }, /* (369) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + { 397, -1 }, /* (370) function_expression ::= literal_func */ + { 389, -3 }, /* (371) literal_func ::= noarg_func NK_LP NK_RP */ + { 389, -1 }, /* (372) literal_func ::= NOW */ + { 401, -1 }, /* (373) noarg_func ::= NOW */ + { 401, -1 }, /* (374) noarg_func ::= TODAY */ + { 401, -1 }, /* (375) noarg_func ::= TIMEZONE */ + { 401, -1 }, /* (376) noarg_func ::= DATABASE */ + { 401, -1 }, /* (377) noarg_func ::= CLIENT_VERSION */ + { 401, -1 }, /* (378) noarg_func ::= SERVER_VERSION */ + { 401, -1 }, /* (379) noarg_func ::= SERVER_STATUS */ + { 401, -1 }, /* (380) noarg_func ::= CURRENT_USER */ + { 401, -1 }, /* (381) noarg_func ::= USER */ + { 399, -1 }, /* (382) star_func ::= COUNT */ + { 399, -1 }, /* (383) star_func ::= FIRST */ + { 399, -1 }, /* (384) star_func ::= LAST */ + { 399, -1 }, /* (385) star_func ::= LAST_ROW */ + { 400, -1 }, /* (386) star_func_para_list ::= NK_STAR */ + { 400, -1 }, /* (387) star_func_para_list ::= other_para_list */ + { 402, -1 }, /* (388) other_para_list ::= star_func_para */ + { 402, -3 }, /* (389) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 403, -1 }, /* (390) star_func_para ::= expr_or_subquery */ + { 403, -3 }, /* (391) star_func_para ::= table_name NK_DOT NK_STAR */ + { 398, -4 }, /* (392) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + { 398, -5 }, /* (393) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + { 404, -1 }, /* (394) when_then_list ::= when_then_expr */ + { 404, -2 }, /* (395) when_then_list ::= when_then_list when_then_expr */ + { 407, -4 }, /* (396) when_then_expr ::= WHEN common_expression THEN common_expression */ + { 405, 0 }, /* (397) case_when_else_opt ::= */ + { 405, -2 }, /* (398) case_when_else_opt ::= ELSE common_expression */ + { 408, -3 }, /* (399) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + { 408, -5 }, /* (400) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + { 408, -6 }, /* (401) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + { 408, -3 }, /* (402) predicate ::= expr_or_subquery IS NULL */ + { 408, -4 }, /* (403) predicate ::= expr_or_subquery IS NOT NULL */ + { 408, -3 }, /* (404) predicate ::= expr_or_subquery in_op in_predicate_value */ + { 409, -1 }, /* (405) compare_op ::= NK_LT */ + { 409, -1 }, /* (406) compare_op ::= NK_GT */ + { 409, -1 }, /* (407) compare_op ::= NK_LE */ + { 409, -1 }, /* (408) compare_op ::= NK_GE */ + { 409, -1 }, /* (409) compare_op ::= NK_NE */ + { 409, -1 }, /* (410) compare_op ::= NK_EQ */ + { 409, -1 }, /* (411) compare_op ::= LIKE */ + { 409, -2 }, /* (412) compare_op ::= NOT LIKE */ + { 409, -1 }, /* (413) compare_op ::= MATCH */ + { 409, -1 }, /* (414) compare_op ::= NMATCH */ + { 409, -1 }, /* (415) compare_op ::= CONTAINS */ + { 410, -1 }, /* (416) in_op ::= IN */ + { 410, -2 }, /* (417) in_op ::= NOT IN */ + { 411, -3 }, /* (418) in_predicate_value ::= NK_LP literal_list NK_RP */ + { 412, -1 }, /* (419) boolean_value_expression ::= boolean_primary */ + { 412, -2 }, /* (420) boolean_value_expression ::= NOT boolean_primary */ + { 412, -3 }, /* (421) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 412, -3 }, /* (422) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 413, -1 }, /* (423) boolean_primary ::= predicate */ + { 413, -3 }, /* (424) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 406, -1 }, /* (425) common_expression ::= expr_or_subquery */ + { 406, -1 }, /* (426) common_expression ::= boolean_value_expression */ + { 414, 0 }, /* (427) from_clause_opt ::= */ + { 414, -2 }, /* (428) from_clause_opt ::= FROM table_reference_list */ + { 415, -1 }, /* (429) table_reference_list ::= table_reference */ + { 415, -3 }, /* (430) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 416, -1 }, /* (431) table_reference ::= table_primary */ + { 416, -1 }, /* (432) table_reference ::= joined_table */ + { 417, -2 }, /* (433) table_primary ::= table_name alias_opt */ + { 417, -4 }, /* (434) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 417, -2 }, /* (435) table_primary ::= subquery alias_opt */ + { 417, -1 }, /* (436) table_primary ::= parenthesized_joined_table */ + { 419, 0 }, /* (437) alias_opt ::= */ + { 419, -1 }, /* (438) alias_opt ::= table_alias */ + { 419, -2 }, /* (439) alias_opt ::= AS table_alias */ + { 420, -3 }, /* (440) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 420, -3 }, /* (441) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 418, -6 }, /* (442) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 421, 0 }, /* (443) join_type ::= */ + { 421, -1 }, /* (444) join_type ::= INNER */ + { 423, -12 }, /* (445) 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 */ + { 424, 0 }, /* (446) set_quantifier_opt ::= */ + { 424, -1 }, /* (447) set_quantifier_opt ::= DISTINCT */ + { 424, -1 }, /* (448) set_quantifier_opt ::= ALL */ + { 425, -1 }, /* (449) select_list ::= select_item */ + { 425, -3 }, /* (450) select_list ::= select_list NK_COMMA select_item */ + { 433, -1 }, /* (451) select_item ::= NK_STAR */ + { 433, -1 }, /* (452) select_item ::= common_expression */ + { 433, -2 }, /* (453) select_item ::= common_expression column_alias */ + { 433, -3 }, /* (454) select_item ::= common_expression AS column_alias */ + { 433, -3 }, /* (455) select_item ::= table_name NK_DOT NK_STAR */ + { 387, 0 }, /* (456) where_clause_opt ::= */ + { 387, -2 }, /* (457) where_clause_opt ::= WHERE search_condition */ + { 426, 0 }, /* (458) partition_by_clause_opt ::= */ + { 426, -3 }, /* (459) partition_by_clause_opt ::= PARTITION BY partition_list */ + { 434, -1 }, /* (460) partition_list ::= partition_item */ + { 434, -3 }, /* (461) partition_list ::= partition_list NK_COMMA partition_item */ + { 435, -1 }, /* (462) partition_item ::= expr_or_subquery */ + { 435, -2 }, /* (463) partition_item ::= expr_or_subquery column_alias */ + { 435, -3 }, /* (464) partition_item ::= expr_or_subquery AS column_alias */ + { 430, 0 }, /* (465) twindow_clause_opt ::= */ + { 430, -6 }, /* (466) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 430, -4 }, /* (467) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + { 430, -6 }, /* (468) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 430, -8 }, /* (469) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 372, 0 }, /* (470) sliding_opt ::= */ + { 372, -4 }, /* (471) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 429, 0 }, /* (472) fill_opt ::= */ + { 429, -4 }, /* (473) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 429, -6 }, /* (474) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 436, -1 }, /* (475) fill_mode ::= NONE */ + { 436, -1 }, /* (476) fill_mode ::= PREV */ + { 436, -1 }, /* (477) fill_mode ::= NULL */ + { 436, -1 }, /* (478) fill_mode ::= LINEAR */ + { 436, -1 }, /* (479) fill_mode ::= NEXT */ + { 431, 0 }, /* (480) group_by_clause_opt ::= */ + { 431, -3 }, /* (481) group_by_clause_opt ::= GROUP BY group_by_list */ + { 437, -1 }, /* (482) group_by_list ::= expr_or_subquery */ + { 437, -3 }, /* (483) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + { 432, 0 }, /* (484) having_clause_opt ::= */ + { 432, -2 }, /* (485) having_clause_opt ::= HAVING search_condition */ + { 427, 0 }, /* (486) range_opt ::= */ + { 427, -6 }, /* (487) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + { 428, 0 }, /* (488) every_opt ::= */ + { 428, -4 }, /* (489) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 438, -4 }, /* (490) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 439, -1 }, /* (491) query_simple ::= query_specification */ + { 439, -1 }, /* (492) query_simple ::= union_query_expression */ + { 443, -4 }, /* (493) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + { 443, -3 }, /* (494) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + { 444, -1 }, /* (495) query_simple_or_subquery ::= query_simple */ + { 444, -1 }, /* (496) query_simple_or_subquery ::= subquery */ + { 377, -1 }, /* (497) query_or_subquery ::= query_expression */ + { 377, -1 }, /* (498) query_or_subquery ::= subquery */ + { 440, 0 }, /* (499) order_by_clause_opt ::= */ + { 440, -3 }, /* (500) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 441, 0 }, /* (501) slimit_clause_opt ::= */ + { 441, -2 }, /* (502) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 441, -4 }, /* (503) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 441, -4 }, /* (504) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 442, 0 }, /* (505) limit_clause_opt ::= */ + { 442, -2 }, /* (506) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 442, -4 }, /* (507) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 442, -4 }, /* (508) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 394, -3 }, /* (509) subquery ::= NK_LP query_expression NK_RP */ + { 394, -3 }, /* (510) subquery ::= NK_LP subquery NK_RP */ + { 422, -1 }, /* (511) search_condition ::= common_expression */ + { 445, -1 }, /* (512) sort_specification_list ::= sort_specification */ + { 445, -3 }, /* (513) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 446, -3 }, /* (514) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + { 447, 0 }, /* (515) ordering_specification_opt ::= */ + { 447, -1 }, /* (516) ordering_specification_opt ::= ASC */ + { 447, -1 }, /* (517) ordering_specification_opt ::= DESC */ + { 448, 0 }, /* (518) null_ordering_opt ::= */ + { 448, -2 }, /* (519) null_ordering_opt ::= NULLS FIRST */ + { 448, -2 }, /* (520) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3569,11 +3618,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,316,&yymsp[0].minor); + yy_destructor(yypParser,318,&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,317,&yymsp[0].minor); + yy_destructor(yypParser,319,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -3587,20 +3636,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,316,&yymsp[-2].minor); +{ yy_destructor(yypParser,318,&yymsp[-2].minor); { } - yy_destructor(yypParser,318,&yymsp[0].minor); + yy_destructor(yypParser,320,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,319,&yymsp[0].minor); +{ yy_destructor(yypParser,321,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,317,&yymsp[-1].minor); +{ yy_destructor(yypParser,319,&yymsp[-1].minor); { } - yy_destructor(yypParser,319,&yymsp[0].minor); + yy_destructor(yypParser,321,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -3614,72 +3663,72 @@ 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,318,&yymsp[0].minor); + yy_destructor(yypParser,320,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy677, &yymsp[-1].minor.yy0, yymsp[0].minor.yy167); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy181, &yymsp[-1].minor.yy0, yymsp[0].minor.yy293); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy677, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy181, 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.yy677, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy181, 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.yy677, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy181, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy677); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy181); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy167 = 1; } +{ yymsp[1].minor.yy293 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy167 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy293 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 31: /* cmd ::= GRANT privileges ON priv_level TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy57, &yymsp[-2].minor.yy677, &yymsp[0].minor.yy677); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy831, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy181); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy57, &yymsp[-2].minor.yy677, &yymsp[0].minor.yy677); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy831, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy181); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy57 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy831 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 35: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==35); -{ yylhsminor.yy57 = yymsp[0].minor.yy57; } - yymsp[0].minor.yy57 = yylhsminor.yy57; +{ yylhsminor.yy831 = yymsp[0].minor.yy831; } + yymsp[0].minor.yy831 = yylhsminor.yy831; break; case 36: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy57 = yymsp[-2].minor.yy57 | yymsp[0].minor.yy57; } - yymsp[-2].minor.yy57 = yylhsminor.yy57; +{ yylhsminor.yy831 = yymsp[-2].minor.yy831 | yymsp[0].minor.yy831; } + yymsp[-2].minor.yy831 = yylhsminor.yy831; break; case 37: /* priv_type ::= READ */ -{ yymsp[0].minor.yy57 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy831 = PRIVILEGE_TYPE_READ; } break; case 38: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy57 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy831 = PRIVILEGE_TYPE_WRITE; } break; case 39: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy677 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy677 = yylhsminor.yy677; +{ yylhsminor.yy181 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy181 = yylhsminor.yy181; break; case 40: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy677 = yymsp[-2].minor.yy677; } - yymsp[-2].minor.yy677 = yylhsminor.yy677; +{ yylhsminor.yy181 = yymsp[-2].minor.yy181; } + yymsp[-2].minor.yy181 = yylhsminor.yy181; break; case 41: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy677, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy181, NULL); } break; case 42: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy677, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy0); } break; case 43: /* cmd ::= DROP DNODE NK_INTEGER */ { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; case 44: /* cmd ::= DROP DNODE dnode_endpoint */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy677); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy181); } break; case 45: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3696,31 +3745,31 @@ static YYACTIONTYPE yy_reduce( case 49: /* dnode_endpoint ::= NK_STRING */ case 50: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==50); case 51: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==51); - case 323: /* db_name ::= NK_ID */ yytestcase(yyruleno==323); - case 324: /* table_name ::= NK_ID */ yytestcase(yyruleno==324); - case 325: /* column_name ::= NK_ID */ yytestcase(yyruleno==325); - case 326: /* function_name ::= NK_ID */ yytestcase(yyruleno==326); - case 327: /* table_alias ::= NK_ID */ yytestcase(yyruleno==327); - case 328: /* column_alias ::= NK_ID */ yytestcase(yyruleno==328); - case 329: /* user_name ::= NK_ID */ yytestcase(yyruleno==329); - case 330: /* topic_name ::= NK_ID */ yytestcase(yyruleno==330); - case 331: /* stream_name ::= NK_ID */ yytestcase(yyruleno==331); - case 332: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==332); - case 370: /* noarg_func ::= NOW */ yytestcase(yyruleno==370); - case 371: /* noarg_func ::= TODAY */ yytestcase(yyruleno==371); - case 372: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==372); - case 373: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==373); - case 374: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==374); - case 375: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==375); - case 376: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==376); - case 377: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==377); - case 378: /* noarg_func ::= USER */ yytestcase(yyruleno==378); - case 379: /* star_func ::= COUNT */ yytestcase(yyruleno==379); - case 380: /* star_func ::= FIRST */ yytestcase(yyruleno==380); - case 381: /* star_func ::= LAST */ yytestcase(yyruleno==381); - case 382: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==382); -{ yylhsminor.yy677 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy677 = yylhsminor.yy677; + case 324: /* db_name ::= NK_ID */ yytestcase(yyruleno==324); + case 325: /* table_name ::= NK_ID */ yytestcase(yyruleno==325); + case 326: /* column_name ::= NK_ID */ yytestcase(yyruleno==326); + case 327: /* function_name ::= NK_ID */ yytestcase(yyruleno==327); + case 328: /* table_alias ::= NK_ID */ yytestcase(yyruleno==328); + case 329: /* column_alias ::= NK_ID */ yytestcase(yyruleno==329); + case 330: /* user_name ::= NK_ID */ yytestcase(yyruleno==330); + case 331: /* topic_name ::= NK_ID */ yytestcase(yyruleno==331); + case 332: /* stream_name ::= NK_ID */ yytestcase(yyruleno==332); + case 333: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==333); + case 373: /* noarg_func ::= NOW */ yytestcase(yyruleno==373); + case 374: /* noarg_func ::= TODAY */ yytestcase(yyruleno==374); + case 375: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==375); + case 376: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==376); + case 377: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==377); + case 378: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==378); + case 379: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==379); + case 380: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==380); + case 381: /* noarg_func ::= USER */ yytestcase(yyruleno==381); + case 382: /* star_func ::= COUNT */ yytestcase(yyruleno==382); + case 383: /* star_func ::= FIRST */ yytestcase(yyruleno==383); + case 384: /* star_func ::= LAST */ yytestcase(yyruleno==384); + case 385: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==385); +{ yylhsminor.yy181 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy181 = yylhsminor.yy181; break; case 52: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3753,208 +3802,208 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 62: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy287, &yymsp[-1].minor.yy677, yymsp[0].minor.yy392); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy39, &yymsp[-1].minor.yy181, yymsp[0].minor.yy778); } break; case 63: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy287, &yymsp[0].minor.yy677); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy39, &yymsp[0].minor.yy181); } break; case 64: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy677); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy181); } break; case 65: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy677, yymsp[0].minor.yy392); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy181, yymsp[0].minor.yy778); } break; case 66: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy677); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy181); } break; case 67: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy677, yymsp[0].minor.yy172); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy181, yymsp[0].minor.yy276); } break; case 68: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy287 = true; } +{ yymsp[-2].minor.yy39 = true; } break; case 69: /* not_exists_opt ::= */ case 71: /* exists_opt ::= */ yytestcase(yyruleno==71); - case 264: /* analyze_opt ::= */ yytestcase(yyruleno==264); - case 271: /* agg_func_opt ::= */ yytestcase(yyruleno==271); - case 443: /* set_quantifier_opt ::= */ yytestcase(yyruleno==443); -{ yymsp[1].minor.yy287 = false; } + case 265: /* analyze_opt ::= */ yytestcase(yyruleno==265); + case 272: /* agg_func_opt ::= */ yytestcase(yyruleno==272); + case 446: /* set_quantifier_opt ::= */ yytestcase(yyruleno==446); +{ yymsp[1].minor.yy39 = false; } break; case 70: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy287 = true; } +{ yymsp[-1].minor.yy39 = true; } break; case 72: /* db_options ::= */ -{ yymsp[1].minor.yy392 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy778 = createDefaultDatabaseOptions(pCxt); } break; case 73: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 74: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 75: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 76: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 77: /* db_options ::= db_options DURATION NK_INTEGER */ case 78: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==78); -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 79: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 80: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 81: /* db_options ::= db_options KEEP integer_list */ case 82: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==82); -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_KEEP, yymsp[0].minor.yy148); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_KEEP, yymsp[0].minor.yy282); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 83: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 84: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 85: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 86: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 87: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 88: /* db_options ::= db_options STRICT NK_STRING */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 89: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 90: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 91: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_RETENTIONS, yymsp[0].minor.yy148); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_RETENTIONS, yymsp[0].minor.yy282); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 92: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 93: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 94: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 95: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 96: /* 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.yy392 = setDatabaseOption(pCxt, yymsp[-3].minor.yy392, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-3].minor.yy778, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy392 = yylhsminor.yy392; + yymsp[-3].minor.yy778 = yylhsminor.yy778; break; case 97: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 98: /* 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.yy392 = setDatabaseOption(pCxt, yymsp[-3].minor.yy392, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-3].minor.yy778, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy392 = yylhsminor.yy392; + yymsp[-3].minor.yy778 = yylhsminor.yy778; break; case 99: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 100: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 101: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 102: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 103: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ -{ yylhsminor.yy392 = setDatabaseOption(pCxt, yymsp[-2].minor.yy392, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setDatabaseOption(pCxt, yymsp[-2].minor.yy778, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 104: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy392 = createAlterDatabaseOptions(pCxt); yylhsminor.yy392 = setAlterDatabaseOption(pCxt, yylhsminor.yy392, &yymsp[0].minor.yy323); } - yymsp[0].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createAlterDatabaseOptions(pCxt); yylhsminor.yy778 = setAlterDatabaseOption(pCxt, yylhsminor.yy778, &yymsp[0].minor.yy645); } + yymsp[0].minor.yy778 = yylhsminor.yy778; break; case 105: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy392 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy392, &yymsp[0].minor.yy323); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy778, &yymsp[0].minor.yy645); } + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; case 106: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy323.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy323.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy645.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } break; case 107: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy323.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy323.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy645.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } break; case 108: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy323.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy323.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy645.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } break; case 109: /* alter_db_option ::= KEEP integer_list */ case 110: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==110); -{ yymsp[-1].minor.yy323.type = DB_OPTION_KEEP; yymsp[-1].minor.yy323.pList = yymsp[0].minor.yy148; } +{ yymsp[-1].minor.yy645.type = DB_OPTION_KEEP; yymsp[-1].minor.yy645.pList = yymsp[0].minor.yy282; } break; case 111: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy323.type = DB_OPTION_WAL; yymsp[-1].minor.yy323.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy645.type = DB_OPTION_WAL; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } break; case 112: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy323.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy323.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy645.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } break; case 113: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy148 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy282 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy282 = yylhsminor.yy282; break; case 114: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 293: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==293); -{ yylhsminor.yy148 = addNodeToList(pCxt, yymsp[-2].minor.yy148, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 294: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==294); +{ yylhsminor.yy282 = addNodeToList(pCxt, yymsp[-2].minor.yy282, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy282 = yylhsminor.yy282; break; case 115: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy148 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy282 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy282 = yylhsminor.yy282; break; case 116: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy148 = addNodeToList(pCxt, yymsp[-2].minor.yy148, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy282 = addNodeToList(pCxt, yymsp[-2].minor.yy282, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy282 = yylhsminor.yy282; break; case 117: /* retention_list ::= retention */ case 139: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==139); @@ -3962,279 +4011,279 @@ static YYACTIONTYPE yy_reduce( case 149: /* column_def_list ::= column_def */ yytestcase(yyruleno==149); case 192: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==192); case 197: /* col_name_list ::= col_name */ yytestcase(yyruleno==197); - case 247: /* func_list ::= func */ yytestcase(yyruleno==247); - case 321: /* literal_list ::= signed_literal */ yytestcase(yyruleno==321); - case 385: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==385); - case 391: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==391); - case 446: /* select_list ::= select_item */ yytestcase(yyruleno==446); - case 457: /* partition_list ::= partition_item */ yytestcase(yyruleno==457); - case 509: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==509); -{ yylhsminor.yy148 = createNodeList(pCxt, yymsp[0].minor.yy392); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 248: /* func_list ::= func */ yytestcase(yyruleno==248); + case 322: /* literal_list ::= signed_literal */ yytestcase(yyruleno==322); + case 388: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==388); + case 394: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==394); + case 449: /* select_list ::= select_item */ yytestcase(yyruleno==449); + case 460: /* partition_list ::= partition_item */ yytestcase(yyruleno==460); + case 512: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==512); +{ yylhsminor.yy282 = createNodeList(pCxt, yymsp[0].minor.yy778); } + yymsp[0].minor.yy282 = yylhsminor.yy282; break; case 118: /* retention_list ::= retention_list NK_COMMA retention */ case 150: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==150); case 193: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==193); case 198: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==198); - case 248: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==248); - case 322: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==322); - case 386: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==386); - case 447: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==447); - case 458: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==458); - case 510: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==510); -{ yylhsminor.yy148 = addNodeToList(pCxt, yymsp[-2].minor.yy148, yymsp[0].minor.yy392); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 249: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==249); + case 323: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==323); + case 389: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==389); + case 450: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==450); + case 461: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==461); + case 513: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==513); +{ yylhsminor.yy282 = addNodeToList(pCxt, yymsp[-2].minor.yy282, yymsp[0].minor.yy778); } + yymsp[-2].minor.yy282 = yylhsminor.yy282; break; case 119: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy392 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 120: /* speed_opt ::= */ - case 273: /* bufsize_opt ::= */ yytestcase(yyruleno==273); -{ yymsp[1].minor.yy172 = 0; } + case 274: /* bufsize_opt ::= */ yytestcase(yyruleno==274); +{ yymsp[1].minor.yy276 = 0; } break; case 121: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 274: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==274); -{ yymsp[-1].minor.yy172 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + case 275: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==275); +{ yymsp[-1].minor.yy276 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 122: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 124: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==124); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy287, yymsp[-5].minor.yy392, yymsp[-3].minor.yy148, yymsp[-1].minor.yy148, yymsp[0].minor.yy392); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy39, yymsp[-5].minor.yy778, yymsp[-3].minor.yy282, yymsp[-1].minor.yy282, yymsp[0].minor.yy778); } break; case 123: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy148); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy282); } break; case 125: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy148); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy282); } break; case 126: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy287, yymsp[0].minor.yy392); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy39, yymsp[0].minor.yy778); } break; case 127: /* cmd ::= ALTER TABLE alter_table_clause */ - case 295: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==295); -{ pCxt->pRootNode = yymsp[0].minor.yy392; } + case 296: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==296); +{ pCxt->pRootNode = yymsp[0].minor.yy778; } break; case 128: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy392); } +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy778); } break; case 129: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy392 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; case 130: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy392 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy392, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy677, yymsp[0].minor.yy838); } - yymsp[-4].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy778, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy181, yymsp[0].minor.yy380); } + yymsp[-4].minor.yy778 = yylhsminor.yy778; break; case 131: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy392 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy392, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy677); } - yymsp[-3].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy778, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy181); } + yymsp[-3].minor.yy778 = yylhsminor.yy778; break; case 132: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy392 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy392, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy677, yymsp[0].minor.yy838); } - yymsp[-4].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy778, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy181, yymsp[0].minor.yy380); } + yymsp[-4].minor.yy778 = yylhsminor.yy778; break; case 133: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy392 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy392, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy677, &yymsp[0].minor.yy677); } - yymsp[-4].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy778, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy181, &yymsp[0].minor.yy181); } + yymsp[-4].minor.yy778 = yylhsminor.yy778; break; case 134: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy392 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy392, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy677, yymsp[0].minor.yy838); } - yymsp[-4].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy778, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy181, yymsp[0].minor.yy380); } + yymsp[-4].minor.yy778 = yylhsminor.yy778; break; case 135: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy392 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy392, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy677); } - yymsp[-3].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy778, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy181); } + yymsp[-3].minor.yy778 = yylhsminor.yy778; break; case 136: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy392 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy392, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy677, yymsp[0].minor.yy838); } - yymsp[-4].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy778, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy181, yymsp[0].minor.yy380); } + yymsp[-4].minor.yy778 = yylhsminor.yy778; break; case 137: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy392 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy392, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy677, &yymsp[0].minor.yy677); } - yymsp[-4].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy778, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy181, &yymsp[0].minor.yy181); } + yymsp[-4].minor.yy778 = yylhsminor.yy778; break; case 138: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy392 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy392, &yymsp[-2].minor.yy677, yymsp[0].minor.yy392); } - yymsp[-5].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy778, &yymsp[-2].minor.yy181, yymsp[0].minor.yy778); } + yymsp[-5].minor.yy778 = yylhsminor.yy778; break; case 140: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 143: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==143); - case 392: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==392); -{ yylhsminor.yy148 = addNodeToList(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy392); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + case 395: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==395); +{ yylhsminor.yy282 = addNodeToList(pCxt, yymsp[-1].minor.yy282, yymsp[0].minor.yy778); } + yymsp[-1].minor.yy282 = yylhsminor.yy282; break; case 141: /* 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.yy392 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy287, yymsp[-8].minor.yy392, yymsp[-6].minor.yy392, yymsp[-5].minor.yy148, yymsp[-2].minor.yy148, yymsp[0].minor.yy392); } - yymsp[-9].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy39, yymsp[-8].minor.yy778, yymsp[-6].minor.yy778, yymsp[-5].minor.yy282, yymsp[-2].minor.yy282, yymsp[0].minor.yy778); } + yymsp[-9].minor.yy778 = yylhsminor.yy778; break; case 144: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy392 = createDropTableClause(pCxt, yymsp[-1].minor.yy287, yymsp[0].minor.yy392); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createDropTableClause(pCxt, yymsp[-1].minor.yy39, yymsp[0].minor.yy778); } + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; case 145: /* specific_cols_opt ::= */ case 176: /* tags_def_opt ::= */ yytestcase(yyruleno==176); - case 455: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==455); - case 477: /* group_by_clause_opt ::= */ yytestcase(yyruleno==477); - case 496: /* order_by_clause_opt ::= */ yytestcase(yyruleno==496); -{ yymsp[1].minor.yy148 = NULL; } + case 458: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==458); + case 480: /* group_by_clause_opt ::= */ yytestcase(yyruleno==480); + case 499: /* order_by_clause_opt ::= */ yytestcase(yyruleno==499); +{ yymsp[1].minor.yy282 = NULL; } break; case 146: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy148 = yymsp[-1].minor.yy148; } +{ yymsp[-2].minor.yy282 = yymsp[-1].minor.yy282; } break; case 147: /* full_table_name ::= table_name */ -{ yylhsminor.yy392 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy677, NULL); } - yymsp[0].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy181, NULL); } + yymsp[0].minor.yy778 = yylhsminor.yy778; break; case 148: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy392 = createRealTableNode(pCxt, &yymsp[-2].minor.yy677, &yymsp[0].minor.yy677, NULL); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createRealTableNode(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy181, NULL); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 151: /* column_def ::= column_name type_name */ -{ yylhsminor.yy392 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy677, yymsp[0].minor.yy838, NULL); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy181, yymsp[0].minor.yy380, NULL); } + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; case 152: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy392 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy677, yymsp[-2].minor.yy838, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy181, yymsp[-2].minor.yy380, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy778 = yylhsminor.yy778; break; case 153: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy838 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 154: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy838 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 155: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy838 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 156: /* type_name ::= INT */ case 157: /* type_name ::= INTEGER */ yytestcase(yyruleno==157); -{ yymsp[0].minor.yy838 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_INT); } break; case 158: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy838 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 159: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy838 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 160: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy838 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 161: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy838 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy380 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 162: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy838 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 163: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy838 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy380 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 164: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy838 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy380 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 165: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy838 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy380 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 166: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy838 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy380 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 167: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy838 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy380 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 168: /* type_name ::= JSON */ -{ yymsp[0].minor.yy838 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 169: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy838 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy380 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 170: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy838 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 171: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy838 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 172: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy838 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy380 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 173: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy838 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 174: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy838 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy380 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 175: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy838 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy380 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 177: /* tags_def_opt ::= tags_def */ - case 384: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==384); -{ yylhsminor.yy148 = yymsp[0].minor.yy148; } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 387: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==387); +{ yylhsminor.yy282 = yymsp[0].minor.yy282; } + yymsp[0].minor.yy282 = yylhsminor.yy282; break; case 178: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy148 = yymsp[-1].minor.yy148; } +{ yymsp[-3].minor.yy282 = yymsp[-1].minor.yy282; } break; case 179: /* table_options ::= */ -{ yymsp[1].minor.yy392 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy778 = createDefaultTableOptions(pCxt); } break; case 180: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-2].minor.yy392, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setTableOption(pCxt, yymsp[-2].minor.yy778, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 181: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-2].minor.yy392, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy148); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setTableOption(pCxt, yymsp[-2].minor.yy778, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy282); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 182: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-2].minor.yy392, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy148); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setTableOption(pCxt, yymsp[-2].minor.yy778, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy282); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 183: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-4].minor.yy392, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy148); } - yymsp[-4].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setTableOption(pCxt, yymsp[-4].minor.yy778, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy282); } + yymsp[-4].minor.yy778 = yylhsminor.yy778; break; case 184: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-2].minor.yy392, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setTableOption(pCxt, yymsp[-2].minor.yy778, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; case 185: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-4].minor.yy392, TABLE_OPTION_SMA, yymsp[-1].minor.yy148); } - yymsp[-4].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setTableOption(pCxt, yymsp[-4].minor.yy778, TABLE_OPTION_SMA, yymsp[-1].minor.yy282); } + yymsp[-4].minor.yy778 = yylhsminor.yy778; break; case 186: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy392 = createAlterTableOptions(pCxt); yylhsminor.yy392 = setTableOption(pCxt, yylhsminor.yy392, yymsp[0].minor.yy323.type, &yymsp[0].minor.yy323.val); } - yymsp[0].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createAlterTableOptions(pCxt); yylhsminor.yy778 = setTableOption(pCxt, yylhsminor.yy778, yymsp[0].minor.yy645.type, &yymsp[0].minor.yy645.val); } + yymsp[0].minor.yy778 = yylhsminor.yy778; break; case 187: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy392 = setTableOption(pCxt, yymsp[-1].minor.yy392, yymsp[0].minor.yy323.type, &yymsp[0].minor.yy323.val); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = setTableOption(pCxt, yymsp[-1].minor.yy778, yymsp[0].minor.yy645.type, &yymsp[0].minor.yy645.val); } + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; case 188: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy323.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy323.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy645.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } break; case 189: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy323.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy323.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy645.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } break; case 190: /* duration_list ::= duration_literal */ - case 351: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==351); -{ yylhsminor.yy148 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy392)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 352: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==352); +{ yylhsminor.yy282 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy778)); } + yymsp[0].minor.yy282 = yylhsminor.yy282; break; case 191: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 352: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==352); -{ yylhsminor.yy148 = addNodeToList(pCxt, yymsp[-2].minor.yy148, releaseRawExprNode(pCxt, yymsp[0].minor.yy392)); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 353: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==353); +{ yylhsminor.yy282 = addNodeToList(pCxt, yymsp[-2].minor.yy282, releaseRawExprNode(pCxt, yymsp[0].minor.yy778)); } + yymsp[-2].minor.yy282 = yylhsminor.yy282; break; case 194: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy392 = createFunctionNode(pCxt, &yymsp[0].minor.yy677, NULL); } - yymsp[0].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createFunctionNode(pCxt, &yymsp[0].minor.yy181, NULL); } + yymsp[0].minor.yy778 = yylhsminor.yy778; break; case 195: /* rollup_func_name ::= FIRST */ case 196: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==196); -{ yylhsminor.yy392 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy778 = yylhsminor.yy778; break; case 199: /* col_name ::= column_name */ -{ yylhsminor.yy392 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy677); } - yymsp[0].minor.yy392 = yylhsminor.yy392; +{ yylhsminor.yy778 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy181); } + yymsp[0].minor.yy778 = yylhsminor.yy778; break; case 200: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } @@ -4246,13 +4295,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; case 203: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy392, yymsp[0].minor.yy392, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy778, yymsp[0].minor.yy778, OP_TYPE_LIKE); } break; case 204: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy392, yymsp[0].minor.yy392, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy778, yymsp[0].minor.yy778, OP_TYPE_LIKE); } break; case 205: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy392, NULL, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy778, NULL, OP_TYPE_LIKE); } break; case 206: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } @@ -4267,7 +4316,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; case 210: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy392, yymsp[-1].minor.yy392, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy778, yymsp[-1].minor.yy778, OP_TYPE_EQUAL); } break; case 211: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } @@ -4286,13 +4335,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; case 217: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy677); } +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy181); } break; case 218: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy392); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy778); } break; case 219: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy392); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy778); } break; case 220: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } @@ -4325,7 +4374,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; case 230: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy392); } +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy778); } break; case 231: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } @@ -4334,731 +4383,736 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; case 233: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy392, yymsp[-1].minor.yy392, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy778, yymsp[-1].minor.yy778, OP_TYPE_EQUAL); } + break; + case 234: /* cmd ::= SHOW TABLE TAGS FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLE_TAGS_STMT, yymsp[0].minor.yy778, yymsp[-1].minor.yy778, OP_TYPE_EQUAL); } break; - case 234: /* cmd ::= SHOW VNODES NK_INTEGER */ + case 235: /* cmd ::= SHOW VNODES NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 235: /* cmd ::= SHOW VNODES NK_STRING */ + case 236: /* cmd ::= SHOW VNODES NK_STRING */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); } break; - case 236: /* db_name_cond_opt ::= */ - case 241: /* from_db_opt ::= */ yytestcase(yyruleno==241); -{ yymsp[1].minor.yy392 = createDefaultDatabaseCondValue(pCxt); } + case 237: /* db_name_cond_opt ::= */ + case 242: /* from_db_opt ::= */ yytestcase(yyruleno==242); +{ yymsp[1].minor.yy778 = createDefaultDatabaseCondValue(pCxt); } break; - case 237: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy677); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; + case 238: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy181); } + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 238: /* like_pattern_opt ::= */ - case 283: /* subtable_opt ::= */ yytestcase(yyruleno==283); - case 394: /* case_when_else_opt ::= */ yytestcase(yyruleno==394); - case 424: /* from_clause_opt ::= */ yytestcase(yyruleno==424); - case 453: /* where_clause_opt ::= */ yytestcase(yyruleno==453); - case 462: /* twindow_clause_opt ::= */ yytestcase(yyruleno==462); - case 467: /* sliding_opt ::= */ yytestcase(yyruleno==467); - case 469: /* fill_opt ::= */ yytestcase(yyruleno==469); - case 481: /* having_clause_opt ::= */ yytestcase(yyruleno==481); - case 483: /* range_opt ::= */ yytestcase(yyruleno==483); - case 485: /* every_opt ::= */ yytestcase(yyruleno==485); - case 498: /* slimit_clause_opt ::= */ yytestcase(yyruleno==498); - case 502: /* limit_clause_opt ::= */ yytestcase(yyruleno==502); -{ yymsp[1].minor.yy392 = NULL; } + case 239: /* like_pattern_opt ::= */ + case 284: /* subtable_opt ::= */ yytestcase(yyruleno==284); + case 397: /* case_when_else_opt ::= */ yytestcase(yyruleno==397); + case 427: /* from_clause_opt ::= */ yytestcase(yyruleno==427); + case 456: /* where_clause_opt ::= */ yytestcase(yyruleno==456); + case 465: /* twindow_clause_opt ::= */ yytestcase(yyruleno==465); + case 470: /* sliding_opt ::= */ yytestcase(yyruleno==470); + case 472: /* fill_opt ::= */ yytestcase(yyruleno==472); + case 484: /* having_clause_opt ::= */ yytestcase(yyruleno==484); + case 486: /* range_opt ::= */ yytestcase(yyruleno==486); + case 488: /* every_opt ::= */ yytestcase(yyruleno==488); + case 501: /* slimit_clause_opt ::= */ yytestcase(yyruleno==501); + case 505: /* limit_clause_opt ::= */ yytestcase(yyruleno==505); +{ yymsp[1].minor.yy778 = NULL; } break; - case 239: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 240: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 240: /* table_name_cond ::= table_name */ -{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy677); } - yymsp[0].minor.yy392 = yylhsminor.yy392; + case 241: /* table_name_cond ::= table_name */ +{ yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy181); } + yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 242: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy677); } + case 243: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy181); } break; - case 243: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy287, yymsp[-3].minor.yy392, yymsp[-1].minor.yy392, NULL, yymsp[0].minor.yy392); } + case 244: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy39, yymsp[-3].minor.yy778, yymsp[-1].minor.yy778, NULL, yymsp[0].minor.yy778); } break; - case 244: /* cmd ::= DROP INDEX exists_opt full_table_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy287, yymsp[0].minor.yy392); } + case 245: /* cmd ::= DROP INDEX exists_opt full_table_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy39, yymsp[0].minor.yy778); } break; - case 245: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy392 = createIndexOption(pCxt, yymsp[-7].minor.yy148, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), NULL, yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } + case 246: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-9].minor.yy778 = createIndexOption(pCxt, yymsp[-7].minor.yy282, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), NULL, yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } break; - case 246: /* 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.yy392 = createIndexOption(pCxt, yymsp[-9].minor.yy148, releaseRawExprNode(pCxt, yymsp[-5].minor.yy392), releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } + case 247: /* 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.yy778 = createIndexOption(pCxt, yymsp[-9].minor.yy282, releaseRawExprNode(pCxt, yymsp[-5].minor.yy778), releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } break; - case 249: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy392 = createFunctionNode(pCxt, &yymsp[-3].minor.yy677, yymsp[-1].minor.yy148); } - yymsp[-3].minor.yy392 = yylhsminor.yy392; + case 250: /* func ::= function_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy778 = createFunctionNode(pCxt, &yymsp[-3].minor.yy181, yymsp[-1].minor.yy282); } + yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 250: /* sma_stream_opt ::= */ - case 277: /* stream_options ::= */ yytestcase(yyruleno==277); -{ yymsp[1].minor.yy392 = createStreamOptions(pCxt); } + case 251: /* sma_stream_opt ::= */ + case 278: /* stream_options ::= */ yytestcase(yyruleno==278); +{ yymsp[1].minor.yy778 = createStreamOptions(pCxt); } break; - case 251: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */ - case 281: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==281); -{ ((SStreamOptions*)yymsp[-2].minor.yy392)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy392); yylhsminor.yy392 = yymsp[-2].minor.yy392; } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + case 252: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */ + case 282: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==282); +{ ((SStreamOptions*)yymsp[-2].minor.yy778)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy778); yylhsminor.yy778 = yymsp[-2].minor.yy778; } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 252: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy392)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy392); yylhsminor.yy392 = yymsp[-2].minor.yy392; } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + case 253: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy778)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy778); yylhsminor.yy778 = yymsp[-2].minor.yy778; } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 253: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy287, &yymsp[-2].minor.yy677, yymsp[0].minor.yy392); } + case 254: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy39, &yymsp[-2].minor.yy181, yymsp[0].minor.yy778); } break; - case 254: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy287, &yymsp[-3].minor.yy677, &yymsp[0].minor.yy677, false); } + case 255: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy39, &yymsp[-3].minor.yy181, &yymsp[0].minor.yy181, false); } break; - case 255: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy287, &yymsp[-5].minor.yy677, &yymsp[0].minor.yy677, true); } + case 256: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy39, &yymsp[-5].minor.yy181, &yymsp[0].minor.yy181, true); } break; - case 256: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy287, &yymsp[-3].minor.yy677, yymsp[0].minor.yy392, false); } + case 257: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy39, &yymsp[-3].minor.yy181, yymsp[0].minor.yy778, false); } break; - case 257: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy287, &yymsp[-5].minor.yy677, yymsp[0].minor.yy392, true); } + case 258: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy39, &yymsp[-5].minor.yy181, yymsp[0].minor.yy778, true); } break; - case 258: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy287, &yymsp[0].minor.yy677); } + case 259: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy39, &yymsp[0].minor.yy181); } break; - case 259: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy287, &yymsp[-2].minor.yy677, &yymsp[0].minor.yy677); } + case 260: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy39, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy181); } break; - case 260: /* cmd ::= DESC full_table_name */ - case 261: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==261); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy392); } + case 261: /* cmd ::= DESC full_table_name */ + case 262: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==262); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy778); } break; - case 262: /* cmd ::= RESET QUERY CACHE */ + case 263: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 263: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy287, yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } + case 264: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy39, yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } break; - case 265: /* analyze_opt ::= ANALYZE */ - case 272: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==272); - case 444: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==444); -{ yymsp[0].minor.yy287 = true; } + case 266: /* analyze_opt ::= ANALYZE */ + case 273: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==273); + case 447: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==447); +{ yymsp[0].minor.yy39 = true; } break; - case 266: /* explain_options ::= */ -{ yymsp[1].minor.yy392 = createDefaultExplainOptions(pCxt); } + case 267: /* explain_options ::= */ +{ yymsp[1].minor.yy778 = createDefaultExplainOptions(pCxt); } break; - case 267: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy392 = setExplainVerbose(pCxt, yymsp[-2].minor.yy392, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + case 268: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy778 = setExplainVerbose(pCxt, yymsp[-2].minor.yy778, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 268: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy392 = setExplainRatio(pCxt, yymsp[-2].minor.yy392, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + case 269: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy778 = setExplainRatio(pCxt, yymsp[-2].minor.yy778, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 269: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy287, yymsp[-8].minor.yy287, &yymsp[-5].minor.yy677, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy838, yymsp[0].minor.yy172); } + case 270: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy39, yymsp[-8].minor.yy39, &yymsp[-5].minor.yy181, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy380, yymsp[0].minor.yy276); } break; - case 270: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy287, &yymsp[0].minor.yy677); } + case 271: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy39, &yymsp[0].minor.yy181); } break; - case 275: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy287, &yymsp[-7].minor.yy677, yymsp[-4].minor.yy392, yymsp[-6].minor.yy392, yymsp[-3].minor.yy148, yymsp[-2].minor.yy392, yymsp[0].minor.yy392); } + case 276: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy39, &yymsp[-7].minor.yy181, yymsp[-4].minor.yy778, yymsp[-6].minor.yy778, yymsp[-3].minor.yy282, yymsp[-2].minor.yy778, yymsp[0].minor.yy778); } break; - case 276: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy287, &yymsp[0].minor.yy677); } + case 277: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy39, &yymsp[0].minor.yy181); } break; - case 278: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy392)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy392 = yymsp[-2].minor.yy392; } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + case 279: /* stream_options ::= stream_options TRIGGER AT_ONCE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy778)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy778 = yymsp[-2].minor.yy778; } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 279: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy392)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy392 = yymsp[-2].minor.yy392; } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + case 280: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy778)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy778 = yymsp[-2].minor.yy778; } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 280: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-3].minor.yy392)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy392)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy392); yylhsminor.yy392 = yymsp[-3].minor.yy392; } - yymsp[-3].minor.yy392 = yylhsminor.yy392; + case 281: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-3].minor.yy778)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy778)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy778); yylhsminor.yy778 = yymsp[-3].minor.yy778; } + yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 282: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ ((SStreamOptions*)yymsp[-3].minor.yy392)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy392 = yymsp[-3].minor.yy392; } - yymsp[-3].minor.yy392 = yylhsminor.yy392; + case 283: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-3].minor.yy778)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy778 = yymsp[-3].minor.yy778; } + yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 284: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 468: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==468); - case 486: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==486); -{ yymsp[-3].minor.yy392 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy392); } + case 285: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 471: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==471); + case 489: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==489); +{ yymsp[-3].minor.yy778 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy778); } break; - case 285: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 286: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 286: /* cmd ::= KILL QUERY NK_STRING */ + case 287: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 287: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 288: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 288: /* cmd ::= BALANCE VGROUP */ + case 289: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 289: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 290: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 290: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy148); } + case 291: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy282); } break; - case 291: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 292: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 292: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy148 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - break; - case 294: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } - break; - case 296: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy392, yymsp[-2].minor.yy148, yymsp[0].minor.yy392); } - break; - case 297: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy392, NULL, yymsp[0].minor.yy392); } - break; - case 298: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 299: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 300: /* literal ::= NK_STRING */ -{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 301: /* literal ::= NK_BOOL */ -{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 302: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; - break; - case 303: /* literal ::= duration_literal */ - case 313: /* signed_literal ::= signed */ yytestcase(yyruleno==313); - case 333: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==333); - case 334: /* expr_or_subquery ::= subquery */ yytestcase(yyruleno==334); - case 335: /* expression ::= literal */ yytestcase(yyruleno==335); - case 336: /* expression ::= pseudo_column */ yytestcase(yyruleno==336); - case 337: /* expression ::= column_reference */ yytestcase(yyruleno==337); - case 338: /* expression ::= function_expression */ yytestcase(yyruleno==338); - case 339: /* expression ::= case_when_expression */ yytestcase(yyruleno==339); - case 367: /* function_expression ::= literal_func */ yytestcase(yyruleno==367); - case 416: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==416); - case 420: /* boolean_primary ::= predicate */ yytestcase(yyruleno==420); - case 422: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==422); - case 423: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==423); - case 426: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==426); - case 428: /* table_reference ::= table_primary */ yytestcase(yyruleno==428); - case 429: /* table_reference ::= joined_table */ yytestcase(yyruleno==429); - case 433: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==433); - case 488: /* query_simple ::= query_specification */ yytestcase(yyruleno==488); - case 489: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==489); - case 492: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==492); - case 494: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==494); -{ yylhsminor.yy392 = yymsp[0].minor.yy392; } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 304: /* literal ::= NULL */ -{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 305: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 306: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 307: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 308: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - break; - case 309: /* signed ::= NK_MINUS NK_INTEGER */ + case 293: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy282 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + break; + case 295: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } + break; + case 297: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy778, yymsp[-2].minor.yy282, yymsp[0].minor.yy778); } + break; + case 298: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy778, NULL, yymsp[0].minor.yy778); } + break; + case 299: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 300: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 301: /* literal ::= NK_STRING */ +{ yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 302: /* literal ::= NK_BOOL */ +{ yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 303: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy778 = yylhsminor.yy778; + break; + case 304: /* literal ::= duration_literal */ + case 314: /* signed_literal ::= signed */ yytestcase(yyruleno==314); + case 334: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==334); + case 335: /* expr_or_subquery ::= subquery */ yytestcase(yyruleno==335); + case 336: /* expression ::= literal */ yytestcase(yyruleno==336); + case 337: /* expression ::= pseudo_column */ yytestcase(yyruleno==337); + case 338: /* expression ::= column_reference */ yytestcase(yyruleno==338); + case 339: /* expression ::= function_expression */ yytestcase(yyruleno==339); + case 340: /* expression ::= case_when_expression */ yytestcase(yyruleno==340); + case 370: /* function_expression ::= literal_func */ yytestcase(yyruleno==370); + case 419: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==419); + case 423: /* boolean_primary ::= predicate */ yytestcase(yyruleno==423); + case 425: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==425); + case 426: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==426); + case 429: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==429); + case 431: /* table_reference ::= table_primary */ yytestcase(yyruleno==431); + case 432: /* table_reference ::= joined_table */ yytestcase(yyruleno==432); + case 436: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==436); + case 491: /* query_simple ::= query_specification */ yytestcase(yyruleno==491); + case 492: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==492); + case 495: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==495); + case 497: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==497); +{ yylhsminor.yy778 = yymsp[0].minor.yy778; } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 305: /* literal ::= NULL */ +{ yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 306: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 307: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 308: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 309: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + break; + case 310: /* 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.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 310: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy392 = yylhsminor.yy392; + case 311: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 311: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 312: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 312: /* signed ::= NK_MINUS NK_FLOAT */ + case 313: /* 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.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; - break; - case 314: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 315: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 316: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } - break; - case 317: /* signed_literal ::= duration_literal */ - case 319: /* signed_literal ::= literal_func */ yytestcase(yyruleno==319); - case 387: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==387); - case 449: /* select_item ::= common_expression */ yytestcase(yyruleno==449); - case 459: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==459); - case 493: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==493); - case 495: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==495); - case 508: /* search_condition ::= common_expression */ yytestcase(yyruleno==508); -{ yylhsminor.yy392 = releaseRawExprNode(pCxt, yymsp[0].minor.yy392); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 318: /* signed_literal ::= NULL */ -{ yylhsminor.yy392 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 320: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy392 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 340: /* expression ::= NK_LP expression NK_RP */ - case 421: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==421); - case 507: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==507); -{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy392)); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; - break; - case 341: /* expression ::= NK_PLUS expr_or_subquery */ + yymsp[-1].minor.yy778 = yylhsminor.yy778; + break; + case 315: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 316: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 317: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + break; + case 318: /* signed_literal ::= duration_literal */ + case 320: /* signed_literal ::= literal_func */ yytestcase(yyruleno==320); + case 390: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==390); + case 452: /* select_item ::= common_expression */ yytestcase(yyruleno==452); + case 462: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==462); + case 496: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==496); + case 498: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==498); + case 511: /* search_condition ::= common_expression */ yytestcase(yyruleno==511); +{ yylhsminor.yy778 = releaseRawExprNode(pCxt, yymsp[0].minor.yy778); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 319: /* signed_literal ::= NULL */ +{ yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 321: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy778 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 341: /* expression ::= NK_LP expression NK_RP */ + case 424: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==424); + case 510: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==510); +{ yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy778)); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; + break; + case 342: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy392)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy778)); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 342: /* expression ::= NK_MINUS expr_or_subquery */ + case 343: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy392), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy778), NULL)); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 343: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 344: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 344: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 345: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 345: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 346: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 346: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 347: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 347: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 348: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 348: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 349: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 349: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 350: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 350: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 351: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; - break; - case 353: /* column_reference ::= column_name */ -{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy677, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy677)); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 354: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy677, &yymsp[0].minor.yy677, createColumnNode(pCxt, &yymsp[-2].minor.yy677, &yymsp[0].minor.yy677)); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; - break; - case 355: /* pseudo_column ::= ROWTS */ - case 356: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==356); - case 358: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==358); - case 359: /* pseudo_column ::= QEND */ yytestcase(yyruleno==359); - case 360: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==360); - case 361: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==361); - case 362: /* pseudo_column ::= WEND */ yytestcase(yyruleno==362); - case 363: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==363); - case 369: /* literal_func ::= NOW */ yytestcase(yyruleno==369); -{ yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy392 = yylhsminor.yy392; - break; - case 357: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy677, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy677)))); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; - break; - case 364: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 365: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==365); -{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy677, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy677, yymsp[-1].minor.yy148)); } - yymsp[-3].minor.yy392 = yylhsminor.yy392; - break; - case 366: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), yymsp[-1].minor.yy838)); } - yymsp[-5].minor.yy392 = yylhsminor.yy392; - break; - case 368: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy677, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy677, NULL)); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; - break; - case 383: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy148 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; - break; - case 388: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 452: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==452); -{ yylhsminor.yy392 = createColumnNode(pCxt, &yymsp[-2].minor.yy677, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; - break; - case 389: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy148, yymsp[-1].minor.yy392)); } - yymsp[-3].minor.yy392 = yylhsminor.yy392; - break; - case 390: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), yymsp[-2].minor.yy148, yymsp[-1].minor.yy392)); } - yymsp[-4].minor.yy392 = yylhsminor.yy392; - break; - case 393: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy392 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392)); } - break; - case 395: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy392 = releaseRawExprNode(pCxt, yymsp[0].minor.yy392); } - break; - case 396: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 401: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==401); + yymsp[-2].minor.yy778 = yylhsminor.yy778; + break; + case 354: /* column_reference ::= column_name */ +{ yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy181, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy181)); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 355: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy181, createColumnNode(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy181)); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; + break; + case 356: /* pseudo_column ::= ROWTS */ + case 357: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==357); + case 359: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==359); + case 360: /* pseudo_column ::= QEND */ yytestcase(yyruleno==360); + case 361: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==361); + case 362: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==362); + case 363: /* pseudo_column ::= WEND */ yytestcase(yyruleno==363); + case 364: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==364); + case 365: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==365); + case 366: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==366); + case 372: /* literal_func ::= NOW */ yytestcase(yyruleno==372); +{ yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy778 = yylhsminor.yy778; + break; + case 358: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy181)))); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; + break; + case 367: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 368: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==368); +{ yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy181, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy181, yymsp[-1].minor.yy282)); } + yymsp[-3].minor.yy778 = yylhsminor.yy778; + break; + case 369: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +{ yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), yymsp[-1].minor.yy380)); } + yymsp[-5].minor.yy778 = yylhsminor.yy778; + break; + case 371: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy181, NULL)); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; + break; + case 386: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy282 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy282 = yylhsminor.yy282; + break; + case 391: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 455: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==455); +{ yylhsminor.yy778 = createColumnNode(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; + break; + case 392: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy282, yymsp[-1].minor.yy778)); } + yymsp[-3].minor.yy778 = yylhsminor.yy778; + break; + case 393: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), yymsp[-2].minor.yy282, yymsp[-1].minor.yy778)); } + yymsp[-4].minor.yy778 = yylhsminor.yy778; + break; + case 396: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy778 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778)); } + break; + case 398: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy778 = releaseRawExprNode(pCxt, yymsp[0].minor.yy778); } + break; + case 399: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 404: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==404); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy758, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy682, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 397: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 400: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy392); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy392), releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy778); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy778), releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } - yymsp[-4].minor.yy392 = yylhsminor.yy392; + yymsp[-4].minor.yy778 = yylhsminor.yy778; break; - case 398: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 401: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy392); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy392), releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy778); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy778), releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } - yymsp[-5].minor.yy392 = yylhsminor.yy392; + yymsp[-5].minor.yy778 = yylhsminor.yy778; break; - case 399: /* predicate ::= expr_or_subquery IS NULL */ + case 402: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), NULL)); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 400: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 403: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), NULL)); } - yymsp[-3].minor.yy392 = yylhsminor.yy392; + yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 402: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy758 = OP_TYPE_LOWER_THAN; } + case 405: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy682 = OP_TYPE_LOWER_THAN; } break; - case 403: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy758 = OP_TYPE_GREATER_THAN; } + case 406: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy682 = OP_TYPE_GREATER_THAN; } break; - case 404: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy758 = OP_TYPE_LOWER_EQUAL; } + case 407: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy682 = OP_TYPE_LOWER_EQUAL; } break; - case 405: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy758 = OP_TYPE_GREATER_EQUAL; } + case 408: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy682 = OP_TYPE_GREATER_EQUAL; } break; - case 406: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy758 = OP_TYPE_NOT_EQUAL; } + case 409: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy682 = OP_TYPE_NOT_EQUAL; } break; - case 407: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy758 = OP_TYPE_EQUAL; } + case 410: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy682 = OP_TYPE_EQUAL; } break; - case 408: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy758 = OP_TYPE_LIKE; } + case 411: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy682 = OP_TYPE_LIKE; } break; - case 409: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy758 = OP_TYPE_NOT_LIKE; } + case 412: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy682 = OP_TYPE_NOT_LIKE; } break; - case 410: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy758 = OP_TYPE_MATCH; } + case 413: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy682 = OP_TYPE_MATCH; } break; - case 411: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy758 = OP_TYPE_NMATCH; } + case 414: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy682 = OP_TYPE_NMATCH; } break; - case 412: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy758 = OP_TYPE_JSON_CONTAINS; } + case 415: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy682 = OP_TYPE_JSON_CONTAINS; } break; - case 413: /* in_op ::= IN */ -{ yymsp[0].minor.yy758 = OP_TYPE_IN; } + case 416: /* in_op ::= IN */ +{ yymsp[0].minor.yy682 = OP_TYPE_IN; } break; - case 414: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy758 = OP_TYPE_NOT_IN; } + case 417: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy682 = OP_TYPE_NOT_IN; } break; - case 415: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy148)); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + case 418: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy282)); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 417: /* boolean_value_expression ::= NOT boolean_primary */ + case 420: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy392), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy778), NULL)); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 418: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 421: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 419: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 422: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); - yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); + yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 425: /* from_clause_opt ::= FROM table_reference_list */ - case 454: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==454); - case 482: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==482); -{ yymsp[-1].minor.yy392 = yymsp[0].minor.yy392; } + case 428: /* from_clause_opt ::= FROM table_reference_list */ + case 457: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==457); + case 485: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==485); +{ yymsp[-1].minor.yy778 = yymsp[0].minor.yy778; } break; - case 427: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy392 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy392, yymsp[0].minor.yy392, NULL); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + case 430: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy778 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy778, yymsp[0].minor.yy778, NULL); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 430: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy392 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy677, &yymsp[0].minor.yy677); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; + case 433: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy778 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy181, &yymsp[0].minor.yy181); } + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 431: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy392 = createRealTableNode(pCxt, &yymsp[-3].minor.yy677, &yymsp[-1].minor.yy677, &yymsp[0].minor.yy677); } - yymsp[-3].minor.yy392 = yylhsminor.yy392; + case 434: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy778 = createRealTableNode(pCxt, &yymsp[-3].minor.yy181, &yymsp[-1].minor.yy181, &yymsp[0].minor.yy181); } + yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 432: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy392 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy392), &yymsp[0].minor.yy677); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; + case 435: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy778 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy778), &yymsp[0].minor.yy181); } + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 434: /* alias_opt ::= */ -{ yymsp[1].minor.yy677 = nil_token; } + case 437: /* alias_opt ::= */ +{ yymsp[1].minor.yy181 = nil_token; } break; - case 435: /* alias_opt ::= table_alias */ -{ yylhsminor.yy677 = yymsp[0].minor.yy677; } - yymsp[0].minor.yy677 = yylhsminor.yy677; + case 438: /* alias_opt ::= table_alias */ +{ yylhsminor.yy181 = yymsp[0].minor.yy181; } + yymsp[0].minor.yy181 = yylhsminor.yy181; break; - case 436: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy677 = yymsp[0].minor.yy677; } + case 439: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy181 = yymsp[0].minor.yy181; } break; - case 437: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 438: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==438); -{ yymsp[-2].minor.yy392 = yymsp[-1].minor.yy392; } + case 440: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 441: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==441); +{ yymsp[-2].minor.yy778 = yymsp[-1].minor.yy778; } break; - case 439: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy392 = createJoinTableNode(pCxt, yymsp[-4].minor.yy114, yymsp[-5].minor.yy392, yymsp[-2].minor.yy392, yymsp[0].minor.yy392); } - yymsp[-5].minor.yy392 = yylhsminor.yy392; + case 442: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy778 = createJoinTableNode(pCxt, yymsp[-4].minor.yy202, yymsp[-5].minor.yy778, yymsp[-2].minor.yy778, yymsp[0].minor.yy778); } + yymsp[-5].minor.yy778 = yylhsminor.yy778; break; - case 440: /* join_type ::= */ -{ yymsp[1].minor.yy114 = JOIN_TYPE_INNER; } + case 443: /* join_type ::= */ +{ yymsp[1].minor.yy202 = JOIN_TYPE_INNER; } break; - case 441: /* join_type ::= INNER */ -{ yymsp[0].minor.yy114 = JOIN_TYPE_INNER; } + case 444: /* join_type ::= INNER */ +{ yymsp[0].minor.yy202 = JOIN_TYPE_INNER; } break; - case 442: /* 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 445: /* 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.yy392 = createSelectStmt(pCxt, yymsp[-10].minor.yy287, yymsp[-9].minor.yy148, yymsp[-8].minor.yy392); - yymsp[-11].minor.yy392 = addWhereClause(pCxt, yymsp[-11].minor.yy392, yymsp[-7].minor.yy392); - yymsp[-11].minor.yy392 = addPartitionByClause(pCxt, yymsp[-11].minor.yy392, yymsp[-6].minor.yy148); - yymsp[-11].minor.yy392 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy392, yymsp[-2].minor.yy392); - yymsp[-11].minor.yy392 = addGroupByClause(pCxt, yymsp[-11].minor.yy392, yymsp[-1].minor.yy148); - yymsp[-11].minor.yy392 = addHavingClause(pCxt, yymsp[-11].minor.yy392, yymsp[0].minor.yy392); - yymsp[-11].minor.yy392 = addRangeClause(pCxt, yymsp[-11].minor.yy392, yymsp[-5].minor.yy392); - yymsp[-11].minor.yy392 = addEveryClause(pCxt, yymsp[-11].minor.yy392, yymsp[-4].minor.yy392); - yymsp[-11].minor.yy392 = addFillClause(pCxt, yymsp[-11].minor.yy392, yymsp[-3].minor.yy392); + yymsp[-11].minor.yy778 = createSelectStmt(pCxt, yymsp[-10].minor.yy39, yymsp[-9].minor.yy282, yymsp[-8].minor.yy778); + yymsp[-11].minor.yy778 = addWhereClause(pCxt, yymsp[-11].minor.yy778, yymsp[-7].minor.yy778); + yymsp[-11].minor.yy778 = addPartitionByClause(pCxt, yymsp[-11].minor.yy778, yymsp[-6].minor.yy282); + yymsp[-11].minor.yy778 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy778, yymsp[-2].minor.yy778); + yymsp[-11].minor.yy778 = addGroupByClause(pCxt, yymsp[-11].minor.yy778, yymsp[-1].minor.yy282); + yymsp[-11].minor.yy778 = addHavingClause(pCxt, yymsp[-11].minor.yy778, yymsp[0].minor.yy778); + yymsp[-11].minor.yy778 = addRangeClause(pCxt, yymsp[-11].minor.yy778, yymsp[-5].minor.yy778); + yymsp[-11].minor.yy778 = addEveryClause(pCxt, yymsp[-11].minor.yy778, yymsp[-4].minor.yy778); + yymsp[-11].minor.yy778 = addFillClause(pCxt, yymsp[-11].minor.yy778, yymsp[-3].minor.yy778); } break; - case 445: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy287 = false; } + case 448: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy39 = false; } break; - case 448: /* select_item ::= NK_STAR */ -{ yylhsminor.yy392 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy392 = yylhsminor.yy392; + case 451: /* select_item ::= NK_STAR */ +{ yylhsminor.yy778 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 450: /* select_item ::= common_expression column_alias */ - case 460: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==460); -{ yylhsminor.yy392 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy392), &yymsp[0].minor.yy677); } - yymsp[-1].minor.yy392 = yylhsminor.yy392; + case 453: /* select_item ::= common_expression column_alias */ + case 463: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==463); +{ yylhsminor.yy778 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy778), &yymsp[0].minor.yy181); } + yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 451: /* select_item ::= common_expression AS column_alias */ - case 461: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==461); -{ yylhsminor.yy392 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), &yymsp[0].minor.yy677); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + case 454: /* select_item ::= common_expression AS column_alias */ + case 464: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==464); +{ yylhsminor.yy778 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), &yymsp[0].minor.yy181); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 456: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 478: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==478); - case 497: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==497); -{ yymsp[-2].minor.yy148 = yymsp[0].minor.yy148; } + case 459: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 481: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==481); + case 500: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==500); +{ yymsp[-2].minor.yy282 = yymsp[0].minor.yy282; } break; - case 463: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy392 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), releaseRawExprNode(pCxt, yymsp[-1].minor.yy392)); } + case 466: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy778 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), releaseRawExprNode(pCxt, yymsp[-1].minor.yy778)); } break; - case 464: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy392 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy392)); } + case 467: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy778 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy778)); } break; - case 465: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy392 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), NULL, yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } + case 468: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy778 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), NULL, yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } break; - case 466: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy392 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy392), releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } + case 469: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy778 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy778), releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } break; - case 470: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy392 = createFillNode(pCxt, yymsp[-1].minor.yy708, NULL); } + case 473: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy778 = createFillNode(pCxt, yymsp[-1].minor.yy381, NULL); } break; - case 471: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy392 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy148)); } + case 474: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy778 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy282)); } break; - case 472: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy708 = FILL_MODE_NONE; } + case 475: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy381 = FILL_MODE_NONE; } break; - case 473: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy708 = FILL_MODE_PREV; } + case 476: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy381 = FILL_MODE_PREV; } break; - case 474: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy708 = FILL_MODE_NULL; } + case 477: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy381 = FILL_MODE_NULL; } break; - case 475: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy708 = FILL_MODE_LINEAR; } + case 478: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy381 = FILL_MODE_LINEAR; } break; - case 476: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy708 = FILL_MODE_NEXT; } + case 479: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy381 = FILL_MODE_NEXT; } break; - case 479: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy148 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 482: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy282 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } + yymsp[0].minor.yy282 = yylhsminor.yy282; break; - case 480: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy148 = addNodeToList(pCxt, yymsp[-2].minor.yy148, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 483: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy282 = addNodeToList(pCxt, yymsp[-2].minor.yy282, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } + yymsp[-2].minor.yy282 = yylhsminor.yy282; break; - case 484: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy392 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), releaseRawExprNode(pCxt, yymsp[-1].minor.yy392)); } + case 487: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy778 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), releaseRawExprNode(pCxt, yymsp[-1].minor.yy778)); } break; - case 487: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 490: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy392 = addOrderByClause(pCxt, yymsp[-3].minor.yy392, yymsp[-2].minor.yy148); - yylhsminor.yy392 = addSlimitClause(pCxt, yylhsminor.yy392, yymsp[-1].minor.yy392); - yylhsminor.yy392 = addLimitClause(pCxt, yylhsminor.yy392, yymsp[0].minor.yy392); + yylhsminor.yy778 = addOrderByClause(pCxt, yymsp[-3].minor.yy778, yymsp[-2].minor.yy282); + yylhsminor.yy778 = addSlimitClause(pCxt, yylhsminor.yy778, yymsp[-1].minor.yy778); + yylhsminor.yy778 = addLimitClause(pCxt, yylhsminor.yy778, yymsp[0].minor.yy778); } - yymsp[-3].minor.yy392 = yylhsminor.yy392; + yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 490: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy392 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy392, yymsp[0].minor.yy392); } - yymsp[-3].minor.yy392 = yylhsminor.yy392; + case 493: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy778 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy778, yymsp[0].minor.yy778); } + yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 491: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy392 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy392, yymsp[0].minor.yy392); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + case 494: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy778 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy778, yymsp[0].minor.yy778); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 499: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 503: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==503); -{ yymsp[-1].minor.yy392 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 502: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 506: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==506); +{ yymsp[-1].minor.yy778 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 500: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 504: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==504); -{ yymsp[-3].minor.yy392 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 503: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 507: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==507); +{ yymsp[-3].minor.yy778 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 501: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 505: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==505); -{ yymsp[-3].minor.yy392 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 504: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 508: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==508); +{ yymsp[-3].minor.yy778 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 506: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy392); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + case 509: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy778); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 511: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy392 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), yymsp[-1].minor.yy362, yymsp[0].minor.yy781); } - yymsp[-2].minor.yy392 = yylhsminor.yy392; + case 514: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy778 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), yymsp[-1].minor.yy14, yymsp[0].minor.yy305); } + yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 512: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy362 = ORDER_ASC; } + case 515: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy14 = ORDER_ASC; } break; - case 513: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy362 = ORDER_ASC; } + case 516: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy14 = ORDER_ASC; } break; - case 514: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy362 = ORDER_DESC; } + case 517: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy14 = ORDER_DESC; } break; - case 515: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy781 = NULL_ORDER_DEFAULT; } + case 518: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy305 = NULL_ORDER_DEFAULT; } break; - case 516: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy781 = NULL_ORDER_FIRST; } + case 519: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy305 = NULL_ORDER_FIRST; } break; - case 517: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy781 = NULL_ORDER_LAST; } + case 520: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy305 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/mockCatalog.cpp b/source/libs/parser/test/mockCatalog.cpp index 7725674200c9e9c931f4640a1eecbed7e16b55f2..fcaa5af05ccdb3a9fe1cb8a51177cab679e0dc84 100644 --- a/source/libs/parser/test/mockCatalog.cpp +++ b/source/libs/parser/test/mockCatalog.cpp @@ -85,6 +85,10 @@ void generateInformationSchema(MockCatalogService* mcs) { .addColumn("dnode_id", TSDB_DATA_TYPE_INT) .addColumn("dnode_ep", TSDB_DATA_TYPE_BINARY, TSDB_EP_LEN) .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_TAGS, TSDB_SYSTEM_TABLE, 2) + .addColumn("table_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN) + .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) + .done(); } void generatePerformanceSchema(MockCatalogService* mcs) { diff --git a/source/libs/parser/test/parShowToUse.cpp b/source/libs/parser/test/parShowToUse.cpp index f38859c83249dc74356e28fec930ab29cc3338c0..36e70dd01598e3806c88ae367548fb0b1b815ece 100644 --- a/source/libs/parser/test/parShowToUse.cpp +++ b/source/libs/parser/test/parShowToUse.cpp @@ -196,6 +196,12 @@ TEST_F(ParserShowToUseTest, showTableDistributed) { run("SHOW TABLE DISTRIBUTED st1"); } +TEST_F(ParserShowToUseTest, showTags) { + useDb("root", "test"); + + run("SHOW TAGS FROM st1s1"); +} + // todo SHOW topics TEST_F(ParserShowToUseTest, showUsers) { @@ -213,9 +219,9 @@ TEST_F(ParserShowToUseTest, showVariables) { TEST_F(ParserShowToUseTest, showVgroups) { useDb("root", "test"); - run("SHOW vgroups"); + run("SHOW VGROUPS"); - run("SHOW test.vgroups"); + run("SHOW test.VGROUPS"); } TEST_F(ParserShowToUseTest, showVnodes) { diff --git a/source/libs/parser/test/parTestMain.cpp b/source/libs/parser/test/parTestMain.cpp index bcaccbab071e06ee6d76b6498fb52d0330a066d9..9e67249238063d5e45b09ce9eca737e78ae3d33c 100644 --- a/source/libs/parser/test/parTestMain.cpp +++ b/source/libs/parser/test/parTestMain.cpp @@ -86,6 +86,7 @@ static void parseArg(int argc, char* argv[]) { {"dump", no_argument, NULL, 'd'}, {"async", required_argument, NULL, 'a'}, {"skipSql", required_argument, NULL, 's'}, + {"log", required_argument, NULL, 'l'}, {0, 0, 0, 0} }; // clang-format on @@ -100,6 +101,9 @@ static void parseArg(int argc, char* argv[]) { case 's': setSkipSqlNum(optarg); break; + case 'l': + setLogLevel(optarg); + break; default: break; } diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index 52f9ddaa6faa54a15900604c570366ef55ceeefe..8c87f60b9f1e874d09e1e975a81d58c4fdbf04c9 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -611,6 +611,8 @@ static int32_t createIndefRowsFuncLogicNode(SLogicPlanContext* pCxt, SSelectStmt return code; } +static bool isInterpFunc(int32_t funcId) { return fmIsInterpFunc(funcId) || fmIsInterpPseudoColumnFunc(funcId); } + static int32_t createInterpFuncLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SLogicNode** pLogicNode) { if (!pSelect->hasInterpFunc) { return TSDB_CODE_SUCCESS; @@ -625,7 +627,7 @@ static int32_t createInterpFuncLogicNode(SLogicPlanContext* pCxt, SSelectStmt* p pInterpFunc->node.requireDataOrder = getRequireDataOrder(true, pSelect); pInterpFunc->node.resultDataOrder = pInterpFunc->node.requireDataOrder; - int32_t code = nodesCollectFuncs(pSelect, SQL_CLAUSE_SELECT, fmIsInterpFunc, &pInterpFunc->pFuncs); + int32_t code = nodesCollectFuncs(pSelect, SQL_CLAUSE_SELECT, isInterpFunc, &pInterpFunc->pFuncs); if (TSDB_CODE_SUCCESS == code) { code = rewriteExprsForSelect(pInterpFunc->pFuncs, pSelect, SQL_CLAUSE_SELECT); } diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 421da8f110b452d776d281626b14ab5bb6b681b3..810b82b9fc21d2c311266f36575297f9543797b7 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -1409,7 +1409,9 @@ static int32_t createPartitionPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChi static int32_t createFillPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, SFillLogicNode* pFillNode, SPhysiNode** pPhyNode) { - SFillPhysiNode* pFill = (SFillPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pFillNode, QUERY_NODE_PHYSICAL_PLAN_FILL); + SFillPhysiNode* pFill = (SFillPhysiNode*)makePhysiNode( + pCxt, (SLogicNode*)pFillNode, + pCxt->pPlanCxt->streamQuery ? QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL : QUERY_NODE_PHYSICAL_PLAN_FILL); if (NULL == pFill) { return TSDB_CODE_OUT_OF_MEMORY; } diff --git a/source/libs/planner/test/planBasicTest.cpp b/source/libs/planner/test/planBasicTest.cpp index c7769b15b15875af3c33e919eb872fd65071698c..0baec147a2461c9dfe62dd602a40af55dd9be81b 100644 --- a/source/libs/planner/test/planBasicTest.cpp +++ b/source/libs/planner/test/planBasicTest.cpp @@ -101,6 +101,8 @@ TEST_F(PlanBasicTest, interpFunc) { useDb("root", "test"); run("SELECT INTERP(c1) FROM t1 RANGE('2017-7-14 18:00:00', '2017-7-14 19:00:00') EVERY(5s) FILL(LINEAR)"); + + run("SELECT _IROWTS, INTERP(c1) FROM t1 RANGE('2017-7-14 18:00:00', '2017-7-14 19:00:00') EVERY(5s) FILL(LINEAR)"); } TEST_F(PlanBasicTest, lastRowFunc) { @@ -178,6 +180,8 @@ TEST_F(PlanBasicTest, pseudoColumn) { run("SELECT _QSTART, _QEND, _QDURATION, _WSTART, _WEND, _WDURATION, COUNT(*) FROM t1 " "WHERE ts BETWEEN '2017-7-14 18:00:00' AND '2017-7-14 19:00:00' INTERVAL(10S)"); + + run("SELECT _TAGS, * FROM st1s1"); } TEST_F(PlanBasicTest, indefiniteRowsFunc) { diff --git a/source/libs/planner/test/planOtherTest.cpp b/source/libs/planner/test/planOtherTest.cpp index f6416b3cb1acae44621017fc64c2b58612211d12..a934fb615c39f6e7aa29274474faa4756c752deb 100644 --- a/source/libs/planner/test/planOtherTest.cpp +++ b/source/libs/planner/test/planOtherTest.cpp @@ -84,6 +84,10 @@ TEST_F(PlanOtherTest, show) { run("SHOW TABLE DISTRIBUTED st1"); run("SHOW DNODE 1 VARIABLES"); + + run("SHOW TAGS FROM st1s1"); + + run("SHOW TABLE TAGS FROM st1"); } TEST_F(PlanOtherTest, delete) { diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index 3c102938d02a74d7beda2e95e21b34b4f844fae5..ae9dd82a58eca25aab73a17bc43ef2441e3c08c0 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -107,9 +107,12 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) { QW_TASK_DLOG("start to execTask, loopIdx:%d", i++); // if *taskHandle is NULL, it's killed right now + bool hasMore = false; + if (taskHandle) { qwDbgSimulateSleep(); - code = qExecTaskOpt(taskHandle, pResList, &useconds, &localFetch); + + code = qExecTaskOpt(taskHandle, pResList, &useconds, &hasMore, &localFetch); if (code) { if (code != TSDB_CODE_OPS_NOT_SUPPORT) { QW_TASK_ELOG("qExecTask failed, code:%x - %s", code, tstrerror(code)); @@ -122,20 +125,8 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) { ++execNum; - if (taosArrayGetSize(pResList) == 0) { - QW_TASK_DLOG("qExecTask end with empty res, useconds:%" PRIu64, useconds); - dsEndPut(sinkHandle, useconds); - - QW_ERR_JRET(qwHandleTaskComplete(QW_FPARAMS(), ctx)); - - if (queryStop) { - *queryStop = true; - } - - break; - } - - for (int32_t j = 0; j < taosArrayGetSize(pResList); ++j) { + size_t numOfResBlock = taosArrayGetSize(pResList); + for (int32_t j = 0; j < numOfResBlock; ++j) { SSDataBlock *pRes = taosArrayGetP(pResList, j); ASSERT(pRes->info.rows > 0); @@ -149,6 +140,23 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) { QW_TASK_DLOG("data put into sink, rows:%d, continueExecTask:%d", pRes->info.rows, qcontinue); } + if (numOfResBlock == 0 || (hasMore == false)) { + if (numOfResBlock == 0) { + QW_TASK_DLOG("qExecTask end with empty res, useconds:%" PRIu64, useconds); + } else { + QW_TASK_DLOG("qExecTask done", ""); + } + + dsEndPut(sinkHandle, useconds); + QW_ERR_JRET(qwHandleTaskComplete(QW_FPARAMS(), ctx)); + + if (queryStop) { + *queryStop = true; + } + + break; + } + if (!qcontinue) { if (queryStop) { *queryStop = true; diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c index 5e47c0a0edb23a923220fd45c5b014603ed201b2..69495c8b7aa0901807ed81a146418f0c6b6264db 100644 --- a/source/libs/scheduler/src/schJob.c +++ b/source/libs/scheduler/src/schJob.c @@ -47,8 +47,7 @@ void schUpdateJobErrCode(SSchJob *pJob, int32_t errCode) { return; _return: - - SCH_JOB_DLOG("job errCode updated to %x - %s", errCode, tstrerror(errCode)); + SCH_JOB_DLOG("job errCode updated to %s", tstrerror(errCode)); } bool schJobDone(SSchJob *pJob) { @@ -491,7 +490,7 @@ int32_t schProcessOnJobFailure(SSchJob *pJob, int32_t errCode) { int32_t code = atomic_load_32(&pJob->errCode); if (code) { - SCH_JOB_DLOG("job failed with error: %s", tstrerror(code)); + SCH_JOB_DLOG("job failed with error %s", tstrerror(code)); } schPostJobRes(pJob, 0); diff --git a/source/libs/stream/src/streamState.c b/source/libs/stream/src/streamState.c index fde8bca77b80ce6cf65066834e61b4d81818b6e8..3428a8582385dbc2a48ed856e1af7f64ea7d74d5 100644 --- a/source/libs/stream/src/streamState.c +++ b/source/libs/stream/src/streamState.c @@ -29,7 +29,7 @@ SStreamState* streamStateOpen(char* path, SStreamTask* pTask, bool specPath) { if (!specPath) { sprintf(statePath, "%s/%d", path, pTask->taskId); } else { - memcpy(statePath, path, 300); + strncpy(statePath, path, 300); } if (tdbOpen(statePath, 4096, 256, &pState->db) < 0) { goto _err; @@ -40,6 +40,11 @@ SStreamState* streamStateOpen(char* path, SStreamTask* pTask, bool specPath) { goto _err; } + // todo refactor + if (tdbTbOpen("func.state.db", sizeof(SWinKey), -1, SWinKeyCmpr, pState->db, &pState->pFillStateDb) < 0) { + goto _err; + } + if (tdbTbOpen("func.state.db", sizeof(STupleKey), -1, STupleKeyCmpr, pState->db, &pState->pFuncStateDb) < 0) { goto _err; } @@ -55,6 +60,7 @@ SStreamState* streamStateOpen(char* path, SStreamTask* pTask, bool specPath) { _err: tdbTbClose(pState->pStateDb); tdbTbClose(pState->pFuncStateDb); + tdbTbClose(pState->pFillStateDb); tdbClose(pState->db); taosMemoryFree(pState); return NULL; @@ -64,6 +70,7 @@ void streamStateClose(SStreamState* pState) { tdbCommit(pState->db, &pState->txn); tdbTbClose(pState->pStateDb); tdbTbClose(pState->pFuncStateDb); + tdbTbClose(pState->pFillStateDb); tdbClose(pState->db); taosMemoryFree(pState); @@ -126,14 +133,30 @@ int32_t streamStateFuncDel(SStreamState* pState, const STupleKey* key) { int32_t streamStatePut(SStreamState* pState, const SWinKey* key, const void* value, int32_t vLen) { return tdbTbUpsert(pState->pStateDb, key, sizeof(SWinKey), value, vLen, &pState->txn); } + +// todo refactor +int32_t streamStateFillPut(SStreamState* pState, const SWinKey* key, const void* value, int32_t vLen) { + return tdbTbUpsert(pState->pFillStateDb, key, sizeof(SWinKey), value, vLen, &pState->txn); +} + int32_t streamStateGet(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen) { return tdbTbGet(pState->pStateDb, key, sizeof(SWinKey), pVal, pVLen); } +// todo refactor +int32_t streamStateFillGet(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen) { + return tdbTbGet(pState->pFillStateDb, key, sizeof(SWinKey), pVal, pVLen); +} + int32_t streamStateDel(SStreamState* pState, const SWinKey* key) { return tdbTbDelete(pState->pStateDb, key, sizeof(SWinKey), &pState->txn); } +// todo refactor +int32_t streamStateFillDel(SStreamState* pState, const SWinKey* key) { + return tdbTbDelete(pState->pFillStateDb, key, sizeof(SWinKey), &pState->txn); +} + int32_t streamStateAddIfNotExist(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen) { // todo refactor int32_t size = *pVLen; @@ -165,6 +188,31 @@ SStreamStateCur* streamStateGetCur(SStreamState* pState, const SWinKey* key) { return pCur; } +SStreamStateCur* streamStateFillGetCur(SStreamState* pState, const SWinKey* key) { + SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + if (pCur == NULL) return NULL; + tdbTbcOpen(pState->pFillStateDb, &pCur->pCur, NULL); + + int32_t c; + tdbTbcMoveTo(pCur->pCur, key, sizeof(SWinKey), &c); + if (c != 0) { + taosMemoryFree(pCur); + return NULL; + } + return pCur; +} + +SStreamStateCur* streamStateGetAndCheckCur(SStreamState* pState, SWinKey* key) { + SStreamStateCur* pCur = streamStateFillGetCur(pState, key); + if (pCur) { + int32_t code = streamStateGetGroupKVByCur(pCur, key, NULL, 0); + if (code == 0) { + return pCur; + } + } + return NULL; +} + int32_t streamStateGetKVByCur(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen) { const SWinKey* pKTmp = NULL; int32_t kLen; @@ -175,6 +223,17 @@ int32_t streamStateGetKVByCur(SStreamStateCur* pCur, SWinKey* pKey, const void** return 0; } +int32_t streamStateGetGroupKVByCur(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen) { + uint64_t groupId = pKey->groupId; + int32_t code = streamStateGetKVByCur(pCur, pKey, pVal, pVLen); + if (code == 0) { + if (pKey->groupId == groupId) { + return 0; + } + } + return -1; +} + int32_t streamStateSeekFirst(SStreamState* pState, SStreamStateCur* pCur) { // return tdbTbcMoveToFirst(pCur->pCur); @@ -185,12 +244,12 @@ int32_t streamStateSeekLast(SStreamState* pState, SStreamStateCur* pCur) { return tdbTbcMoveToLast(pCur->pCur); } -SStreamStateCur* streamStateSeekKeyNext(SStreamState* pState, const SWinKey* key) { +SStreamStateCur* streamStateFillSeekKeyNext(SStreamState* pState, const SWinKey* key) { SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); if (pCur == NULL) { return NULL; } - if (tdbTbcOpen(pState->pStateDb, &pCur->pCur, NULL) < 0) { + if (tdbTbcOpen(pState->pFillStateDb, &pCur->pCur, NULL) < 0) { taosMemoryFree(pCur); return NULL; } @@ -211,12 +270,12 @@ SStreamStateCur* streamStateSeekKeyNext(SStreamState* pState, const SWinKey* key return pCur; } -SStreamStateCur* streamStateSeekKeyPrev(SStreamState* pState, const SWinKey* key) { +SStreamStateCur* streamStateFillSeekKeyPrev(SStreamState* pState, const SWinKey* key) { SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); if (pCur == NULL) { return NULL; } - if (tdbTbcOpen(pState->pStateDb, &pCur->pCur, NULL) < 0) { + if (tdbTbcOpen(pState->pFillStateDb, &pCur->pCur, NULL) < 0) { taosMemoryFree(pCur); return NULL; } diff --git a/source/libs/sync/inc/syncUtil.h b/source/libs/sync/inc/syncUtil.h index 7ecff7ae97bf04da20c1817c413a44a0dd32e8c8..96e22720e8b2b0fb4defc5d5b46e8d765fc54efb 100644 --- a/source/libs/sync/inc/syncUtil.h +++ b/source/libs/sync/inc/syncUtil.h @@ -32,7 +32,7 @@ uint64_t syncUtilAddr2U64(const char* host, uint16_t port); void syncUtilU642Addr(uint64_t u64, char* host, size_t len, uint16_t* port); void syncUtilnodeInfo2EpSet(const SNodeInfo* pNodeInfo, SEpSet* pEpSet); void syncUtilraftId2EpSet(const SRaftId* raftId, SEpSet* pEpSet); -void syncUtilnodeInfo2raftId(const SNodeInfo* pNodeInfo, SyncGroupId vgId, SRaftId* raftId); +bool syncUtilnodeInfo2raftId(const SNodeInfo* pNodeInfo, SyncGroupId vgId, SRaftId* raftId); bool syncUtilSameId(const SRaftId* pId1, const SRaftId* pId2); bool syncUtilEmptyId(const SRaftId* pId); diff --git a/source/libs/sync/src/syncIndexMgr.c b/source/libs/sync/src/syncIndexMgr.c index 3bda9bcd51a1fe41fbeb09a1e4a39c3a53f1cd74..28b5313ac514ef98f4295cd547b947447d9c09bc 100644 --- a/source/libs/sync/src/syncIndexMgr.c +++ b/source/libs/sync/src/syncIndexMgr.c @@ -20,7 +20,10 @@ SSyncIndexMgr *syncIndexMgrCreate(SSyncNode *pSyncNode) { SSyncIndexMgr *pSyncIndexMgr = taosMemoryMalloc(sizeof(SSyncIndexMgr)); - ASSERT(pSyncIndexMgr != NULL); + if (pSyncIndexMgr == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } memset(pSyncIndexMgr, 0, sizeof(SSyncIndexMgr)); pSyncIndexMgr->replicas = &(pSyncNode->replicasId); @@ -248,4 +251,4 @@ SyncTerm syncIndexMgrGetTerm(SSyncIndexMgr *pSyncIndexMgr, const SRaftId *pRaftI } ASSERT(0); return -1; -} \ No newline at end of file +} diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 86c06c6936d1b04395ae5bc9ae2245104a1cb093..76fd345bdd1226a960c13c94de9d86ea7d954f1e 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -51,15 +51,17 @@ static int32_t syncNodeAppendNoop(SSyncNode* ths); int32_t syncNodeOnPingCb(SSyncNode* ths, SyncPing* pMsg); int32_t syncNodeOnPingReplyCb(SSyncNode* ths, SyncPingReply* pMsg); -// life cycle -static void syncFreeNode(void* param); // --------------------------------- +static void syncNodeFreeCb(void *param) { + syncNodeClose(param); + param = NULL; +} int32_t syncInit() { int32_t ret = 0; if (!syncEnvIsStart()) { - tsNodeRefId = taosOpenRef(200, syncFreeNode); + tsNodeRefId = taosOpenRef(200, syncNodeFreeCb); if (tsNodeRefId < 0) { sError("failed to init node ref"); syncCleanUp(); @@ -86,11 +88,15 @@ void syncCleanUp() { int64_t syncOpen(const SSyncInfo* pSyncInfo) { SSyncNode* pSyncNode = syncNodeOpen(pSyncInfo); - ASSERT(pSyncNode != NULL); + if (pSyncNode == NULL) { + sError("failed to open sync node. vgId:%d", pSyncInfo->vgId); + return -1; + } pSyncNode->rid = taosAddRef(tsNodeRefId, pSyncNode); if (pSyncNode->rid < 0) { - syncFreeNode(pSyncNode); + syncNodeClose(pSyncNode); + pSyncNode = NULL; return -1; } @@ -136,11 +142,9 @@ void syncStartStandBy(int64_t rid) { void syncStop(int64_t rid) { SSyncNode* pSyncNode = (SSyncNode*)taosAcquireRef(tsNodeRefId, rid); if (pSyncNode == NULL) return; - int32_t vgId = pSyncNode->vgId; - syncNodeClose(pSyncNode); - taosReleaseRef(tsNodeRefId, pSyncNode->rid); + taosRemoveRef(tsNodeRefId, rid); sDebug("vgId:%d, sync rid:%" PRId64 " is removed from rsetId:%" PRId64, vgId, rid, tsNodeRefId); } @@ -210,7 +214,7 @@ int32_t syncReconfigBuild(int64_t rid, const SSyncCfg* pNewCfg, SRpcMsg* pRpcMsg if (!syncNodeCheckNewConfig(pSyncNode, pNewCfg)) { taosReleaseRef(tsNodeRefId, pSyncNode->rid); terrno = TSDB_CODE_SYN_NEW_CONFIG_ERROR; - sError("syncNodeCheckNewConfig error"); + sError("invalid new config. vgId:%d", pSyncNode->vgId); return -1; } @@ -237,7 +241,7 @@ int32_t syncReconfig(int64_t rid, const SSyncCfg* pNewCfg) { if (!syncNodeCheckNewConfig(pSyncNode, pNewCfg)) { taosReleaseRef(tsNodeRefId, pSyncNode->rid); terrno = TSDB_CODE_SYN_NEW_CONFIG_ERROR; - sError("syncNodeCheckNewConfig error"); + sError("invalid new config. vgId:%d", pSyncNode->vgId); return -1; } @@ -392,29 +396,6 @@ bool syncIsReady(int64_t rid) { return b; } -bool syncIsReadyForRead(int64_t rid) { - SSyncNode* pSyncNode = (SSyncNode*)taosAcquireRef(tsNodeRefId, rid); - if (pSyncNode == NULL) { - return false; - } - ASSERT(rid == pSyncNode->rid); - - // TODO: last not noop? - SyncIndex lastIndex = syncNodeGetLastIndex(pSyncNode); - bool b = (pSyncNode->state == TAOS_SYNC_STATE_LEADER) && (pSyncNode->commitIndex >= lastIndex - SYNC_MAX_READ_RANGE); - taosReleaseRef(tsNodeRefId, pSyncNode->rid); - - // if false, set error code - if (false == b) { - if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { - terrno = TSDB_CODE_SYN_NOT_LEADER; - } else { - terrno = TSDB_CODE_APP_NOT_READY; - } - } - return b; -} - bool syncIsRestoreFinish(int64_t rid) { SSyncNode* pSyncNode = (SSyncNode*)taosAcquireRef(tsNodeRefId, rid); if (pSyncNode == NULL) { @@ -941,16 +922,18 @@ _END: SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) { SSyncInfo* pSyncInfo = (SSyncInfo*)pOldSyncInfo; - SSyncNode* pSyncNode = (SSyncNode*)taosMemoryMalloc(sizeof(SSyncNode)); - ASSERT(pSyncNode != NULL); - memset(pSyncNode, 0, sizeof(SSyncNode)); + SSyncNode* pSyncNode = (SSyncNode*)taosMemoryCalloc(1, sizeof(SSyncNode)); + if (pSyncNode == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _error; + } int32_t ret = 0; if (!taosDirExist((char*)(pSyncInfo->path))) { if (taosMkDir(pSyncInfo->path) != 0) { terrno = TAOS_SYSTEM_ERROR(errno); sError("failed to create dir:%s since %s", pSyncInfo->path, terrstr()); - return NULL; + goto _error; } } @@ -963,15 +946,21 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) { meta.lastConfigIndex = SYNC_INDEX_INVALID; meta.batchSize = pSyncInfo->batchSize; ret = raftCfgCreateFile((SSyncCfg*)&(pSyncInfo->syncCfg), meta, pSyncNode->configPath); - ASSERT(ret == 0); - + if (ret != 0) { + sError("failed to create raft cfg file. configPath: %s", pSyncNode->configPath); + goto _error; + } } else { // update syncCfg by raft_config.json pSyncNode->pRaftCfg = raftCfgOpen(pSyncNode->configPath); - ASSERT(pSyncNode->pRaftCfg != NULL); + if (pSyncNode->pRaftCfg == NULL) { + sError("failed to open raft cfg file. path:%s", pSyncNode->configPath); + goto _error; + } pSyncInfo->syncCfg = pSyncNode->pRaftCfg->cfg; raftCfgClose(pSyncNode->pRaftCfg); + pSyncNode->pRaftCfg = NULL; } // init by SSyncInfo @@ -988,11 +977,17 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) { // init raft config pSyncNode->pRaftCfg = raftCfgOpen(pSyncNode->configPath); - ASSERT(pSyncNode->pRaftCfg != NULL); + if (pSyncNode->pRaftCfg == NULL) { + sError("failed to open raft cfg file. path:%s", pSyncNode->configPath); + goto _error; + } // init internal pSyncNode->myNodeInfo = pSyncNode->pRaftCfg->cfg.nodeInfo[pSyncNode->pRaftCfg->cfg.myIndex]; - syncUtilnodeInfo2raftId(&pSyncNode->myNodeInfo, pSyncNode->vgId, &pSyncNode->myRaftId); + if (!syncUtilnodeInfo2raftId(&pSyncNode->myNodeInfo, pSyncNode->vgId, &pSyncNode->myRaftId)) { + sError("failed to determine my raft member id. vgId:%d", pSyncNode->vgId); + goto _error; + } // init peersNum, peers, peersId pSyncNode->peersNum = pSyncNode->pRaftCfg->cfg.replicaNum - 1; @@ -1004,17 +999,24 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) { } } for (int i = 0; i < pSyncNode->peersNum; ++i) { - syncUtilnodeInfo2raftId(&pSyncNode->peersNodeInfo[i], pSyncNode->vgId, &pSyncNode->peersId[i]); + if (!syncUtilnodeInfo2raftId(&pSyncNode->peersNodeInfo[i], pSyncNode->vgId, &pSyncNode->peersId[i])) { + sError("failed to determine raft member id. vgId:%d, peer:%d", pSyncNode->vgId, i); + goto _error; + } } // init replicaNum, replicasId pSyncNode->replicaNum = pSyncNode->pRaftCfg->cfg.replicaNum; for (int i = 0; i < pSyncNode->pRaftCfg->cfg.replicaNum; ++i) { - syncUtilnodeInfo2raftId(&pSyncNode->pRaftCfg->cfg.nodeInfo[i], pSyncNode->vgId, &pSyncNode->replicasId[i]); + if(!syncUtilnodeInfo2raftId(&pSyncNode->pRaftCfg->cfg.nodeInfo[i], pSyncNode->vgId, &pSyncNode->replicasId[i])) { + sError("failed to determine raft member id. vgId:%d, replica:%d", pSyncNode->vgId, i); + goto _error; + } } // init raft algorithm pSyncNode->pFsm = pSyncInfo->pFsm; + pSyncInfo->pFsm = NULL; pSyncNode->quorum = syncUtilQuorum(pSyncNode->pRaftCfg->cfg.replicaNum); pSyncNode->leaderCache = EMPTY_RAFT_ID; @@ -1047,29 +1049,50 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) { // init TLA+ server vars pSyncNode->state = TAOS_SYNC_STATE_FOLLOWER; pSyncNode->pRaftStore = raftStoreOpen(pSyncNode->raftStorePath); - ASSERT(pSyncNode->pRaftStore != NULL); + if (pSyncNode->pRaftStore == NULL) { + sError("failed to open raft store. path: %s", pSyncNode->raftStorePath); + goto _error; + } // init TLA+ candidate vars pSyncNode->pVotesGranted = voteGrantedCreate(pSyncNode); - ASSERT(pSyncNode->pVotesGranted != NULL); + if (pSyncNode->pVotesGranted == NULL) { + sError("failed to create VotesGranted. vgId:%d", pSyncNode->vgId); + goto _error; + } pSyncNode->pVotesRespond = votesRespondCreate(pSyncNode); - ASSERT(pSyncNode->pVotesRespond != NULL); + if (pSyncNode->pVotesRespond == NULL) { + sError("failed to create VotesRespond. vgId:%d", pSyncNode->vgId); + goto _error; + } // init TLA+ leader vars pSyncNode->pNextIndex = syncIndexMgrCreate(pSyncNode); - ASSERT(pSyncNode->pNextIndex != NULL); + if (pSyncNode->pNextIndex == NULL) { + sError("failed to create SyncIndexMgr. vgId:%d", pSyncNode->vgId); + goto _error; + } pSyncNode->pMatchIndex = syncIndexMgrCreate(pSyncNode); - ASSERT(pSyncNode->pMatchIndex != NULL); + if (pSyncNode->pMatchIndex == NULL) { + sError("failed to create SyncIndexMgr. vgId:%d", pSyncNode->vgId); + goto _error; + } // init TLA+ log vars pSyncNode->pLogStore = logStoreCreate(pSyncNode); - ASSERT(pSyncNode->pLogStore != NULL); + if (pSyncNode->pLogStore == NULL) { + sError("failed to create SyncLogStore. vgId:%d", pSyncNode->vgId); + goto _error; + } SyncIndex commitIndex = SYNC_INDEX_INVALID; if (pSyncNode->pFsm != NULL && pSyncNode->pFsm->FpGetSnapshotInfo != NULL) { SSnapshot snapshot = {0}; int32_t code = pSyncNode->pFsm->FpGetSnapshotInfo(pSyncNode->pFsm, &snapshot); - ASSERT(code == 0); + if (code != 0) { + sError("failed to get snapshot info. vgId:%d, code:%d", pSyncNode->vgId, code); + goto _error; + } if (snapshot.lastApplyIndex > commitIndex) { commitIndex = snapshot.lastApplyIndex; syncNodeEventLog(pSyncNode, "reset commit index by snapshot"); @@ -1132,7 +1155,10 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) { // tools pSyncNode->pSyncRespMgr = syncRespMgrCreate(pSyncNode, SYNC_RESP_TTL_MS); - ASSERT(pSyncNode->pSyncRespMgr != NULL); + if (pSyncNode->pSyncRespMgr == NULL) { + sError("failed to create SyncRespMgr. vgId:%d", pSyncNode->vgId); + goto _error; + } // restore state pSyncNode->restoreFinish = false; @@ -1162,6 +1188,15 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) { syncNodeEventLog(pSyncNode, "sync open"); return pSyncNode; + +_error: + if (pSyncInfo->pFsm) { + taosMemoryFree(pSyncInfo->pFsm); + pSyncInfo->pFsm = NULL; + } + syncNodeClose(pSyncNode); + pSyncNode = NULL; + return NULL; } void syncNodeMaybeUpdateCommitBySnapshot(SSyncNode* pSyncNode) { @@ -1214,20 +1249,28 @@ void syncNodeStartStandBy(SSyncNode* pSyncNode) { void syncNodeClose(SSyncNode* pSyncNode) { syncNodeEventLog(pSyncNode, "sync close"); - + if (pSyncNode == NULL) { + return; + } int32_t ret; - ASSERT(pSyncNode != NULL); ret = raftStoreClose(pSyncNode->pRaftStore); ASSERT(ret == 0); syncRespMgrDestroy(pSyncNode->pSyncRespMgr); + pSyncNode->pSyncRespMgr = NULL; voteGrantedDestroy(pSyncNode->pVotesGranted); + pSyncNode->pVotesGranted = NULL; votesRespondDestory(pSyncNode->pVotesRespond); + pSyncNode->pVotesRespond = NULL; syncIndexMgrDestroy(pSyncNode->pNextIndex); + pSyncNode->pNextIndex = NULL; syncIndexMgrDestroy(pSyncNode->pMatchIndex); + pSyncNode->pMatchIndex = NULL; logStoreDestory(pSyncNode->pLogStore); + pSyncNode->pLogStore = NULL; raftCfgClose(pSyncNode->pRaftCfg); + pSyncNode->pRaftCfg = NULL; syncNodeStopPingTimer(pSyncNode); syncNodeStopElectTimer(pSyncNode); @@ -1249,8 +1292,7 @@ void syncNodeClose(SSyncNode* pSyncNode) { pSyncNode->pNewNodeReceiver = NULL; } - // free memory in syncFreeNode - // taosMemoryFree(pSyncNode); + taosMemoryFree(pSyncNode); } // option @@ -2534,7 +2576,7 @@ static void syncNodeEqHeartbeatTimer(void* param, void* tmrId) { return; } } else { - sError("syncNodeEqHeartbeatTimer FpEqMsg is NULL"); + sError("vgId:%d, enqueue msg cb ptr (i.e. FpEqMsg) not set.", pSyncNode->vgId); } syncTimeoutDestroy(pSyncMsg); @@ -2774,14 +2816,6 @@ int32_t syncNodeOnClientRequestBatchCb(SSyncNode* ths, SyncClientRequestBatch* p return 0; } -static void syncFreeNode(void* param) { - SSyncNode* pNode = param; - // inner object already free - // syncNodePrint2((char*)"==syncFreeNode==", pNode); - - taosMemoryFree(pNode); -} - const char* syncStr(ESyncState state) { switch (state) { case TAOS_SYNC_STATE_FOLLOWER: diff --git a/source/libs/sync/src/syncRaftCfg.c b/source/libs/sync/src/syncRaftCfg.c index ab404d1b9af744b51b508cd1f870482c79756ea1..57126d0871da0ab80cf718260377fa8754581d65 100644 --- a/source/libs/sync/src/syncRaftCfg.c +++ b/source/libs/sync/src/syncRaftCfg.c @@ -364,8 +364,6 @@ int32_t raftCfgCreateFile(SSyncCfg *pCfg, SRaftCfgMeta meta, const char *path) { int32_t sysErr = errno; const char *sysErrStr = strerror(errno); sError("create raft cfg file error, err:%d %X, msg:%s, syserr:%d, sysmsg:%s", err, err, errStr, sysErr, sysErrStr); - ASSERT(0); - return -1; } diff --git a/source/libs/sync/src/syncRaftStore.c b/source/libs/sync/src/syncRaftStore.c index 29f78b582f1f1ddab18dba54b3b495bf3aa8af98..22b47a2c45e14216b1554c9e606f2d66b1d07b5e 100644 --- a/source/libs/sync/src/syncRaftStore.c +++ b/source/libs/sync/src/syncRaftStore.c @@ -28,7 +28,7 @@ SRaftStore *raftStoreOpen(const char *path) { SRaftStore *pRaftStore = taosMemoryMalloc(sizeof(SRaftStore)); if (pRaftStore == NULL) { - sError("raftStoreOpen malloc error"); + terrno = TSDB_CODE_OUT_OF_MEMORY; return NULL; } memset(pRaftStore, 0, sizeof(*pRaftStore)); @@ -72,7 +72,9 @@ static int32_t raftStoreInit(SRaftStore *pRaftStore) { } int32_t raftStoreClose(SRaftStore *pRaftStore) { - ASSERT(pRaftStore != NULL); + if (pRaftStore == NULL) { + return 0; + } taosCloseFile(&pRaftStore->pFile); taosMemoryFree(pRaftStore); diff --git a/source/libs/sync/src/syncRespMgr.c b/source/libs/sync/src/syncRespMgr.c index d7ed864180335eb5a07ea58298c574fb71265fe2..103c2254768a3b5bfc6d5c8090828f999b2e8c9e 100644 --- a/source/libs/sync/src/syncRespMgr.c +++ b/source/libs/sync/src/syncRespMgr.c @@ -19,6 +19,10 @@ SSyncRespMgr *syncRespMgrCreate(void *data, int64_t ttl) { SSyncRespMgr *pObj = (SSyncRespMgr *)taosMemoryMalloc(sizeof(SSyncRespMgr)); + if (pObj == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } memset(pObj, 0, sizeof(SSyncRespMgr)); pObj->pRespHash = diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c index 0be3392a9a52b69e29cbcedcb910cdbc0f9a6234..68d81813ac760a37b78bfdc12aee59624b296c48 100644 --- a/source/libs/sync/src/syncSnapshot.c +++ b/source/libs/sync/src/syncSnapshot.c @@ -35,7 +35,10 @@ SSyncSnapshotSender *snapshotSenderCreate(SSyncNode *pSyncNode, int32_t replicaI SSyncSnapshotSender *pSender = NULL; if (condition) { pSender = taosMemoryMalloc(sizeof(SSyncSnapshotSender)); - ASSERT(pSender != NULL); + if (pSender == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } memset(pSender, 0, sizeof(*pSender)); pSender->start = false; diff --git a/source/libs/sync/src/syncUtil.c b/source/libs/sync/src/syncUtil.c index 325073f3660172a1067d0bf92e11a8ae9f88fa01..6f234631dae8620df80fe5aba0366a5cb8ad62c7 100644 --- a/source/libs/sync/src/syncUtil.c +++ b/source/libs/sync/src/syncUtil.c @@ -26,7 +26,8 @@ uint64_t syncUtilAddr2U64(const char* host, uint16_t port) { uint32_t hostU32 = taosGetIpv4FromFqdn(host); if (hostU32 == (uint32_t)-1) { - sError("Get IP address error"); + sError("failed to resolve ipv4 addr. host:%s", host); + terrno = TSDB_CODE_TSC_INVALID_FQDN; return -1; } @@ -84,13 +85,18 @@ void syncUtilraftId2EpSet(const SRaftId* raftId, SEpSet* pEpSet) { addEpIntoEpSet(pEpSet, host, port); } -void syncUtilnodeInfo2raftId(const SNodeInfo* pNodeInfo, SyncGroupId vgId, SRaftId* raftId) { +bool syncUtilnodeInfo2raftId(const SNodeInfo* pNodeInfo, SyncGroupId vgId, SRaftId* raftId) { uint32_t ipv4 = taosGetIpv4FromFqdn(pNodeInfo->nodeFqdn); - ASSERT(ipv4 != 0xFFFFFFFF); + if (ipv4 == 0xFFFFFFFF || ipv4 == 1) { + sError("failed to resolve ipv4 addr. fqdn: %s", pNodeInfo->nodeFqdn); + terrno = TSDB_CODE_TSC_INVALID_FQDN; + return false; + } char ipbuf[128] = {0}; tinet_ntoa(ipbuf, ipv4); raftId->addr = syncUtilAddr2U64(ipbuf, pNodeInfo->nodePort); raftId->vgId = vgId; + return true; } bool syncUtilSameId(const SRaftId* pId1, const SRaftId* pId2) { @@ -310,4 +316,4 @@ void syncUtilJson2Line(char* jsonStr) { q++; } } -} \ No newline at end of file +} diff --git a/source/libs/sync/src/syncVoteMgr.c b/source/libs/sync/src/syncVoteMgr.c index 1d46d71a05b66d30fba02ec342014a56f388e73e..641bb32d2d56a0bf745c6cb4c5fb43ccaaaa6f75 100644 --- a/source/libs/sync/src/syncVoteMgr.c +++ b/source/libs/sync/src/syncVoteMgr.c @@ -24,7 +24,10 @@ static void voteGrantedClearVotes(SVotesGranted *pVotesGranted) { SVotesGranted *voteGrantedCreate(SSyncNode *pSyncNode) { SVotesGranted *pVotesGranted = taosMemoryMalloc(sizeof(SVotesGranted)); - ASSERT(pVotesGranted != NULL); + if (pVotesGranted == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } memset(pVotesGranted, 0, sizeof(SVotesGranted)); pVotesGranted->replicas = &(pSyncNode->replicasId); diff --git a/tests/docs-examples-test/node.sh b/tests/docs-examples-test/node.sh index 02839048155dfe75bdfa872ca88d0d717b3c9304..41acf7c7b4dfbcfa0f5f758770198b35fc707adc 100644 --- a/tests/docs-examples-test/node.sh +++ b/tests/docs-examples-test/node.sh @@ -23,7 +23,7 @@ node query_example.js node async_query_example.js -node subscribe_demo.js +# node subscribe_demo.js taos -s "drop topic if exists topic_name_example" taos -s "drop database if exists power" @@ -39,4 +39,4 @@ taos -s "drop database if exists test" node opentsdb_telnet_example.js taos -s "drop database if exists test" -node opentsdb_json_example.js \ No newline at end of file +node opentsdb_json_example.js diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 161c87844058ca6852c6649141e37f6cdf6a202f..82f73a4fdd209e84d85d8616ece777cf37e02dfb 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -303,7 +303,7 @@ ./test.sh -f tsim/insert/backquote.sim -m # unsupport ./test.sh -f tsim/parser/fourArithmetic-basic.sim -m ./test.sh -f tsim/query/interval-offset.sim -m -./test.sh -f tsim/tmq/basic3.sim -m +# unsupport ./test.sh -f tsim/tmq/basic3.sim -m ./test.sh -f tsim/stable/vnode3.sim -m ./test.sh -f tsim/qnode/basic1.sim -m # unsupport ./test.sh -f tsim/mnode/basic1.sim -m diff --git a/tests/script/tsim/stream/deleteInterval.sim b/tests/script/tsim/stream/deleteInterval.sim index 00d10afad99a258d3c931add7e7ceedc653e85df..7532b2d5def428d0c83e420c128bdc33f438f392 100644 --- a/tests/script/tsim/stream/deleteInterval.sim +++ b/tests/script/tsim/stream/deleteInterval.sim @@ -413,13 +413,8 @@ if $data12 != 3 then goto loop14 endi -return 1 -sql drop stream if exists streams3; -sql drop database if exists test3; -sql drop database if exists test; sql create database test3 vgroups 4; -sql create database test vgroups 1; sql use test3; sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int); sql create table t1 using st tags(1,1,1); @@ -435,7 +430,7 @@ sql delete from t1; loop15: sleep 200 -sql select * from test.streamt2 order by c1, c2, c3; +sql select * from test.streamt3 order by c1, c2, c3; $loop_count = $loop_count + 1 if $loop_count == 10 then @@ -453,7 +448,7 @@ sql delete from t1 where ts > 100; loop16: sleep 200 -sql select * from test.streamt2 order by c1, c2, c3; +sql select * from test.streamt3 order by c1, c2, c3; $loop_count = $loop_count + 1 if $loop_count == 10 then @@ -471,7 +466,7 @@ sql delete from st; loop17: sleep 200 -sql select * from test.streamt2 order by c1, c2, c3; +sql select * from test.streamt3 order by c1, c2, c3; $loop_count = $loop_count + 1 if $loop_count == 10 then diff --git a/tests/script/tsim/stream/fillIntervalDelete0.sim b/tests/script/tsim/stream/fillIntervalDelete0.sim new file mode 100644 index 0000000000000000000000000000000000000000..77d09d5ae891010dbc154d3aa7b807bc31f86d69 --- /dev/null +++ b/tests/script/tsim/stream/fillIntervalDelete0.sim @@ -0,0 +1,375 @@ +$loop_all = 0 +looptest: + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 200 +sql connect + +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop stream if exists streams3; +sql drop stream if exists streams4; +sql drop stream if exists streams5; +sql drop database if exists test1; +sql create database test1 vgroups 1; +sql use test1; +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20)); +sql create stream streams1 trigger at_once into streamt1 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(NULL); +sql create stream streams2 trigger at_once into streamt2 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value,100,200,300); +sql create stream streams3 trigger at_once into streamt3 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next); +sql create stream streams4 trigger at_once into streamt4 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev); +sql create stream streams5 trigger at_once into streamt5 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear); +sql insert into t1 values(1648791213000,1,1,1,1.0,'aaa'); +sleep 200 + +$loop_count = 0 + +loop0: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt1 order by ts; + +if $rows != 1 then + print =====rows=$rows + goto loop0 +endi + +sql delete from t1; + +$loop_count = 0 + +loop1: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt1 order by ts; + +if $rows != 0 then + print =====rows1=$rows + goto loop1 +endi + +sql select * from streamt2 order by ts; + +if $rows != 0 then + print =====rows2=$rows + goto loop1 +endi + +sql select * from streamt3 order by ts; + +if $rows != 0 then + print =====rows3=$rows + goto loop1 +endi + +sql select * from streamt4 order by ts; + +if $rows != 0 then + print =====rows4=$rows + goto loop1 +endi + +sql select * from streamt5 order by ts; + +if $rows != 0 then + print =====rows5=$rows + goto loop1 +endi + +sql insert into t1 values(1648791210000,4,4,4,4.0,'ddd'); +sql insert into t1 values(1648791215000,2,2,2,2.0,'bbb'); +sql insert into t1 values(1648791217000,3,3,3,3.0,'ccc'); +sql insert into t1 values(1648791219000,5,5,5,5.0,'eee'); + +$loop_count = 0 + +loop2: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt1 order by ts; + +if $rows != 10 then + print =====rows=$rows + goto loop2 +endi + +#temp +system sh/stop_dnodes.sh +return 1 + +sql delete from t1 where ts >= 1648791214000; + +$loop_count = 0 + +loop3: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt1 order by ts; + +if $rows != 1 then + print =====rows1=$rows + goto loop3 +endi + +sql select * from streamt2 order by ts; + +if $rows != 1 then + print =====rows2=$rows + goto loop3 +endi + +sql select * from streamt3 order by ts; + +if $rows != 1 then + print =====rows3=$rows + goto loop3 +endi + +sql select * from streamt4 order by ts; + +if $rows != 1 then + print =====rows4=$rows + goto loop3 +endi + +sql select * from streamt5 order by ts; + +if $rows != 1 then + print =====rows5=$rows + goto loop3 +endi + +if $data01 != 4 then + print =====data01=$data01 + return -1 +endi + + + +sql insert into t1 values(1648791213000,5,5,5,5.0,'eee'); +sql insert into t1 values(1648791215000,5,5,5,5.0,'eee'); +sql insert into t1 values(1648791219000,6,6,6,6.0,'fff'); + +$loop_count = 0 + +loop4: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt1 order by ts; + +if $rows != 4 then + print =====rows=$rows + goto loop4 +endi + + +sql delete from t1 where ts <= 1648791216000; + +$loop_count = 0 + +loop5: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt1 order by ts; + +if $rows != 1 then + print =====rows1=$rows + goto loop5 +endi + +sql select * from streamt2 order by ts; + +if $rows != 1 then + print =====rows2=$rows + goto loop5 +endi + +sql select * from streamt3 order by ts; + +if $rows != 1 then + print =====rows3=$rows + goto loop5 +endi + +sql select * from streamt4 order by ts; + +if $rows != 1 then + print =====rows4=$rows + goto loop5 +endi + +sql select * from streamt5 order by ts; + +if $rows != 1 then + print =====rows5=$rows + goto loop5 +endi + +if $data01 != 6 then + print =====data01=$data01 + return -1 +endi + + + + +sql drop stream if exists streams6; +sql drop stream if exists streams7; +sql drop stream if exists streams8; +sql drop stream if exists streams9; +sql drop stream if exists streams10; +sql drop database if exists test6; +sql create database test6 vgroups 1; +sql use test6; +sql create stable st(ts timestamp, a int, b int , c int, d double, s varchar(20)) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(1,1,1); +sql create stream streams6 trigger at_once into streamt6 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(NULL); +sql create stream streams7 trigger at_once into streamt7 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value,100,200,300); +sql create stream streams8 trigger at_once into streamt8 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next); +sql create stream streams9 trigger at_once into streamt9 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev); +sql create stream streams10 trigger at_once into streamt10 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear); + +sql insert into t1 values(1648791210000,1,1,1,1.0,'aaa'); +sql insert into t1 values(1648791217000,1,1,1,1.0,'aaa'); + +sql insert into t2 values(1648791215000,1,1,1,1.0,'aaa'); + +sleep 200 + +$loop_count = 0 + +loop7: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt6 order by ts; + +if $rows != 8 then + print =====rows=$rows + goto loop7 +endi + +sql delete from t1; + +$loop_count = 0 + +loop8: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt6 order by ts; + +if $rows != 0 then + print =====rows6=$rows + goto loop8 +endi + +sql select * from streamt7 order by ts; + +if $rows != 0 then + print =====rows7=$rows + goto loop8 +endi + +sql select * from streamt8 order by ts; + +if $rows != 0 then + print =====rows8=$rows + goto loop8 +endi + +sql select * from streamt9 order by ts; + +if $rows != 0 then + print =====rows9=$rows + goto loop8 +endi + +sql select * from streamt10 order by ts; + +if $rows != 0 then + print =====rows10=$rows + goto loop8 +endi + + + + + + + + + + + + + + + + + + + + + +sql drop stream if exists streams0; +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop stream if exists streams3; +sql drop stream if exists streams4; +sql drop stream if exists streams5; +sql drop stream if exists streams6; +sql drop stream if exists streams7; +sql drop stream if exists streams8; + +sql use test1; +sql select * from t1; +print $data00 + +$loop_all = $loop_all + 1 +print ============loop_all=$loop_all + +system sh/stop_dnodes.sh + +#goto looptest \ No newline at end of file diff --git a/tests/script/tsim/stream/fillIntervalDelete1.sim b/tests/script/tsim/stream/fillIntervalDelete1.sim new file mode 100644 index 0000000000000000000000000000000000000000..8e6972975ee299592d91b3408d68dacdecb9844c --- /dev/null +++ b/tests/script/tsim/stream/fillIntervalDelete1.sim @@ -0,0 +1,379 @@ +$loop_all = 0 +looptest: + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 200 +sql connect + +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop stream if exists streams3; +sql drop stream if exists streams4; +sql drop stream if exists streams5; +sql drop database if exists test1; +sql create database test1 vgroups 1; +sql use test1; +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20)); +sql create stream streams1 trigger at_once into streamt1 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(NULL); +sql create stream streams2 trigger at_once into streamt2 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value,100,200,300); +sql create stream streams3 trigger at_once into streamt3 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next); +sql create stream streams4 trigger at_once into streamt4 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev); +sql create stream streams5 trigger at_once into streamt5 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear); + +sql insert into t1 values(1648791210000,0,0,0,0.0,'aaa'); +sql insert into t1 values(1648791213000,1,1,1,1.0,'bbb'); +sql insert into t1 values(1648791215000,5,5,5,5.0,'ccc'); +sql insert into t1 values(1648791217000,6,6,6,6.0,'ddd'); + +$loop_count = 0 + +loop0: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt1 order by ts; + +if $rows != 8 then + print =====rows=$rows + goto loop0 +endi + + +sql delete from t1 where ts = 1648791213000; + +$loop_count = 0 + +loop2: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + + +sql select * from streamt1 order by ts; + +if $rows != 8 then + print ====streamt1=rows1=$rows + goto loop2 +endi +if $data31 != NULL then + print ====streamt1=data31=$data31 + goto loop2 +endi + +sql select * from streamt2 order by ts; + +if $rows != 8 then + print ====streamt2=rows2=$rows + goto loop2 +endi +if $data31 != 100 then + print ====streamt2=data31=$data31 + goto loop2 +endi + +sql select * from streamt3 order by ts; + +if $rows != 8 then + print ====streamt3=rows3=$rows + goto loop2 +endi +if $data31 != 5 then + print ====streamt3=data31=$data31 + goto loop2 +endi + +sql select * from streamt4 order by ts; + +if $rows != 8 then + print ====streamt4=rows4=$rows + goto loop2 +endi +if $data31 != 0 then + print ====streamt4=data31=$data31 + goto loop2 +endi + +sql select * from streamt5 order by ts; + +if $rows != 8 then + print ====streamt5=rows5=$rows + goto loop2 +endi +if $data31 != 3 then + print ====streamt5=data31=$data31 + goto loop2 +endi + + +sql insert into t1 values(1648791212000,5,5,5,5.0,'eee'); +sql insert into t1 values(1648791213000,6,6,6,6.0,'fff'); + +$loop_count = 0 + +loop3: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt1 order by ts; + +if $data21 != 5 then + print ====133=rows=$rows + goto loop3 +endi +if $data31 != 6 then + print ====137=rows=$rows + goto loop3 +endi + + +sql delete from t1 where ts >= 1648791211000 and ts <= 1648791214000; + +$loop_count = 0 + +loop4: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt1 order by ts; + +if $rows != 8 then + print ====streamt1=rows1=$rows + goto loop4 +endi +if $data31 != NULL then + print ====streamt1=data31=$data31 + goto loop4 +endi + +sql select * from streamt2 order by ts; + +if $rows != 8 then + print ====streamt2=rows2=$rows + goto loop4 +endi +if $data31 != 100 then + print ====streamt2=data31=$data31 + goto loop4 +endi + +sql select * from streamt3 order by ts; + +if $rows != 8 then + print ====streamt3=rows3=$rows + goto loop4 +endi +if $data31 != 5 then + print ====streamt3=data31=$data31 + goto loop4 +endi + +sql select * from streamt4 order by ts; + +if $rows != 8 then + print ====streamt4=rows4=$rows + goto loop4 +endi +if $data31 != 0 then + print ====streamt4=data31=$data31 + goto loop4 +endi + +sql select * from streamt5 order by ts; + +if $rows != 8 then + print ====streamt5=rows5=$rows + goto loop4 +endi +if $data31 != 3 then + print ====streamt5=data31=$data31 + goto loop4 +endi + + + +sql drop stream if exists streams6; +sql drop stream if exists streams7; +sql drop stream if exists streams8; +sql drop stream if exists streams9; +sql drop stream if exists streams10; +sql drop database if exists test6; +sql create database test6 vgroups 1; +sql use test6; +sql create stable st(ts timestamp, a int, b int , c int, d double, s varchar(20)) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(1,1,1); +sql create stream streams6 trigger at_once into streamt6 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(NULL); +sql create stream streams7 trigger at_once into streamt7 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value,100,200,300); +sql create stream streams8 trigger at_once into streamt8 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next); +sql create stream streams9 trigger at_once into streamt9 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev); +sql create stream streams10 trigger at_once into streamt10 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear); + +sql insert into t1 values(1648791210000,1,1,1,1.0,'aaa'); +sql insert into t1 values(1648791215000,6,8,8,8.0,'bbb'); +sql insert into t1 values(1648791220000,11,10,10,10.0,'ccc'); +sql insert into t1 values(1648791221000,6,6,6,6.0,'fff'); + +sql insert into t2 values(1648791212000,4,4,4,4.0,'ddd'); +sql insert into t2 values(1648791214000,5,5,5,5.0,'eee'); +sql insert into t2 values(1648791216000,2,2,2,2.0,'bbb'); +sql insert into t2 values(1648791222000,6,6,6,6.0,'fff'); + +$loop_count = 0 + +loop5: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt6 order by ts; + +if $rows != 13 then + print ====streamt6=rows1=$rows + goto loop5 +endi +if $data21 != 4 then + print ====streamt6=data21=$data21 + goto loop5 +endi + +sql delete from t2; +print delete from t2; + +$loop_count = 0 + +loop6: + +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt6 order by ts; + +if $rows != 12 then + print ====streamt6=rows2=$rows + goto loop6 +endi +if $data31 != NULL then + print ====streamt6=data31=$data31 + goto loop6 +endi + + +sql select * from streamt7 order by ts; + +if $rows != 12 then + print ====streamt7=rows2=$rows + goto loop6 +endi +if $data31 != 100 then + print ====streamt7=data31=$data31 + goto loop6 +endi + +sql select * from streamt8 order by ts; + +if $rows != 12 then + print ====streamt8=rows3=$rows + goto loop6 +endi +if $data31 != 6 then + print ====streamt8=data31=$data31 + goto loop6 +endi + +sql select * from streamt9 order by ts; + +if $rows != 12 then + print ====streamt9=rows4=$rows + goto loop6 +endi +if $data31 != 1 then + print ====streamt9=data31=$data31 + goto loop6 +endi + +sql select * from streamt10 order by ts; + +if $rows != 12 then + print ====streamt10=rows5=$rows + goto loop6 +endi +if $data21 != 3 then + print ====streamt10=data21=$data21 + return -1 +endi +if $data31 != 4 then + print ====streamt10=data31=$data31 + return -1 +endi +if $data71 != 8 then + print ====streamt10=data71=$data71 + return -1 +endi +if $data91 != 10 then + print ====streamt10=data91=$data91 + return -1 +endi + + + + + + + + + + + + + + + + + + +sql drop stream if exists streams0; +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop stream if exists streams3; +sql drop stream if exists streams4; +sql drop stream if exists streams5; +sql drop stream if exists streams6; +sql drop stream if exists streams7; +sql drop stream if exists streams8; +sql drop stream if exists streams9; +sql drop stream if exists streams10; + +sql use test1; +sql select * from t1; +print $data00 + +$loop_all = $loop_all + 1 +print ============loop_all=$loop_all + +system sh/stop_dnodes.sh + +#goto looptest \ No newline at end of file diff --git a/tests/script/tsim/stream/fillIntervalLinear.sim b/tests/script/tsim/stream/fillIntervalLinear.sim new file mode 100644 index 0000000000000000000000000000000000000000..46ff785fd30082955ef4ebd0eac501618b73dd68 --- /dev/null +++ b/tests/script/tsim/stream/fillIntervalLinear.sim @@ -0,0 +1,695 @@ +$loop_all = 0 +looptest: + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 200 +sql connect + +sql drop stream if exists streams1; +sql drop database if exists test1; +sql create database test1 vgroups 1; +sql use test1; +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20)); +sql create stream streams1 trigger at_once into streamt1 as select _wstart as ts, max(a)+sum(c), avg(b), first(s), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear); +sql insert into t1 values(1648791213000,4,4,4,4.0,'aaa') (1648791216000,5,5,5,5.0,'bbb'); +sql insert into t1 values(1648791210000,1,1,1,1.0,'ccc') (1648791219000,2,2,2,2.0,'ddd') (1648791222000,3,3,3,3.0,'eee'); + + +$loop_count = 0 + +loop1: +sleep 200 +sql use test1; +sql select * from streamt1 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 13 then + print =====rows=$rows + goto loop1 +endi + +if $data01 != 2.000000000 then + print =====data01=$data01 + return -1 +endi +if $data02 != 1.000000000 then + print =====data02=$data02 + return -1 +endi +if $data03 != ccc then + print =====data03=$data03 + return -1 +endi +if $data04 != 1 then + print =====data04=$data04 + return -1 +endi + + +if $data11 != 4.000000000 then + print =====data11=$data11 + return -1 +endi +if $data12 != 2.000000000 then + print =====data12=$data12 + return -1 +endi +if $data13 != NULL then + print =====data13=$data13 + return -1 +endi + + +if $data21 != 6.000000000 then + print =====data21=$data21 + return -1 +endi +if $data22 != 3.000000000 then + print =====data22=$data22 + return -1 +endi +if $data23 != NULL then + print =====data23=$data23 + return -1 +endi + + +if $data31 != 8.000000000 then + print =====data31=$data31 + return -1 +endi +if $data32 != 4.000000000 then + print =====data32=$data32 + return -1 +endi +if $data33 != aaa then + print =====data33=$data33 + return -1 +endi + + +if $data41 != 8.666666667 then + print =====data41=$data41 + return -1 +endi +if $data42 != 4.333333333 then + print =====data42=$data42 + return -1 +endi +if $data43 != NULL then + print =====data43=$data43 + return -1 +endi + + +if $data51 != 9.333333333 then + print =====data01=$data01 + return -1 +endi +if $data52 != 4.666666667 then + print =====data52=$data52 + return -1 +endi +if $data53 != NULL then + print =====data53=$data53 + return -1 +endi + + +if $data61 != 10.000000000 then + print =====data61=$data61 + return -1 +endi +if $data62 != 5.000000000 then + print =====data62=$data62 + return -1 +endi + + +if $data71 != 8.000000000 then + print =====data71=$data71 + return -1 +endi +if $data72 != 4.000000000 then + print =====data72=$data72 + return -1 +endi + + +if $data81 != 6.000000000 then + print =====data81=$data81 + return -1 +endi +if $data82 != 3.000000000 then + print =====data82=$data82 + return -1 +endi + + +if $data91 != 4.000000000 then + print =====data91=$data91 + return -1 +endi +if $data92 != 2.000000000 then + print =====data92=$data92 + return -1 +endi + +if $data[10][1] != 4.666666667 then + print =====data[10][1]=$data[10][1] + return -1 +endi +if $data[10][2] != 2.333333333 then + print =====data[10][2]=$data[10][2] + return -1 +endi + + +if $data[11][1] != 5.333333333 then + print =====data[11][1]=$data[11][1] + return -1 +endi +if $data[11][2] != 2.666666667 then + print =====data[11][2]=$data[11][2] + return -1 +endi + + +if $data[12][1] != 6.000000000 then + print =====data[12][1]=$data[12][1] + return -1 +endi +if $data[12][2] != 3.000000000 then + print =====data[12][2]=$data[12][2] + return -1 +endi + + + +sql drop stream if exists streams2; +sql drop database if exists test2; +sql create database test2 vgroups 1; +sql use test2; +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20)); +sql create stream streams2 trigger at_once into streamt2 as select _wstart as ts, max(a)+sum(c), avg(b), first(s), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear); +sql insert into t1 values(1648791210000,1,1,1,1.0,'ccc') (1648791219000,2,2,2,2.0,'ddd') (1648791222000,3,3,3,3.0,'eee'); +sql insert into t1 values(1648791213000,4,4,4,4.0,'aaa') (1648791216000,5,5,5,5.0,'bbb'); + + +$loop_count = 0 + +loop2: + +sleep 200 + +sql select * from streamt2 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 13 then + print =====rows=$rows + goto loop2 +endi + +if $data01 != 2.000000000 then + print =====data01=$data01 + return -1 +endi +if $data02 != 1.000000000 then + print =====data02=$data02 + return -1 +endi +if $data03 != ccc then + print =====data03=$data03 + return -1 +endi +if $data04 != 1 then + print =====data04=$data04 + return -1 +endi + + +if $data11 != 4.000000000 then + print =====data11=$data11 + return -1 +endi +if $data12 != 2.000000000 then + print =====data12=$data12 + return -1 +endi +if $data13 != NULL then + print =====data13=$data13 + return -1 +endi + + +if $data21 != 6.000000000 then + print =====data21=$data21 + return -1 +endi +if $data22 != 3.000000000 then + print =====data22=$data22 + return -1 +endi +if $data23 != NULL then + print =====data23=$data23 + return -1 +endi + + +if $data31 != 8.000000000 then + print =====data31=$data31 + return -1 +endi +if $data32 != 4.000000000 then + print =====data32=$data32 + return -1 +endi +if $data33 != aaa then + print =====data33=$data33 + return -1 +endi + + +if $data41 != 8.666666667 then + print =====data41=$data41 + return -1 +endi +if $data42 != 4.333333333 then + print =====data42=$data42 + return -1 +endi +if $data43 != NULL then + print =====data43=$data43 + return -1 +endi + + +if $data51 != 9.333333333 then + print =====data01=$data01 + return -1 +endi +if $data52 != 4.666666667 then + print =====data52=$data52 + return -1 +endi +if $data53 != NULL then + print =====data53=$data53 + return -1 +endi + + +if $data61 != 10.000000000 then + print =====data61=$data61 + return -1 +endi +if $data62 != 5.000000000 then + print =====data62=$data62 + return -1 +endi + + +if $data71 != 8.000000000 then + print =====data71=$data71 + return -1 +endi +if $data72 != 4.000000000 then + print =====data72=$data72 + return -1 +endi + + +if $data81 != 6.000000000 then + print =====data81=$data81 + return -1 +endi +if $data82 != 3.000000000 then + print =====data82=$data82 + return -1 +endi + + +if $data91 != 4.000000000 then + print =====data91=$data91 + return -1 +endi +if $data92 != 2.000000000 then + print =====data92=$data92 + return -1 +endi + +if $data[10][1] != 4.666666667 then + print =====data[10][1]=$data[10][1] + return -1 +endi +if $data[10][2] != 2.333333333 then + print =====data[10][2]=$data[10][2] + return -1 +endi + + +if $data[11][1] != 5.333333333 then + print =====data[11][1]=$data[11][1] + return -1 +endi +if $data[11][2] != 2.666666667 then + print =====data[11][2]=$data[11][2] + return -1 +endi + + +if $data[12][1] != 6.000000000 then + print =====data[12][1]=$data[12][1] + return -1 +endi +if $data[12][2] != 3.000000000 then + print =====data[12][2]=$data[12][2] + return -1 +endi + + + +sql drop stream if exists streams3; +sql drop database if exists test3; +sql create database test3 vgroups 1; +sql use test3; +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20)); +sql create stream streams3 trigger at_once into streamt3 as select _wstart as ts, max(a), b+c, s, b+1, 1 from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(linear); +sql insert into t1 values(1648791215000,1,1,1,1.0,'aaa'); +sql insert into t1 values(1648791217000,2,2,2,2.0,'bbb'); +sql insert into t1 values(1648791211000,3,3,3,3.0,'ccc'); +sql insert into t1 values(1648791213000,4,4,4,4.0,'ddd'); + + +$loop_count = 0 + +loop3: +sleep 300 +sql select * from streamt3 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + + +if $rows != 7 then + print =====rows=$rows + goto loop3 +endi + + +if $data01 != 3 then + print =====data01=$data01 + return -1 +endi +if $data02 != 6.000000000 then + print =====data02=$data02 + return -1 +endi +if $data03 != ccc then + print =====data03=$data03 + return -1 +endi + +if $data11 != 3 then + print =====data11=$data11 + return -1 +endi +if $data12 != 7.000000000 then + print =====data12=$data12 + return -1 +endi +if $data13 != NULL then + print =====data13=$data13 + return -1 +endi + + +if $data21 != 4 then + print =====data21=$data21 + return -1 +endi +if $data22 != 8.000000000 then + print =====data22=$data22 + return -1 +endi +if $data23 != ddd then + print =====data23=$data23 + return -1 +endi + + +if $data31 != 2 then + print =====data31=$data31 + return -1 +endi +if $data32 != 5.000000000 then + print =====data32=$data32 + return -1 +endi +if $data33 != NULL then + print =====data33=$data33 + return -1 +endi + + +if $data41 != 1 then + print =====data41=$data41 + return -1 +endi +if $data42 != 2.000000000 then + print =====data42=$data42 + return -1 +endi +if $data43 != aaa then + print =====data43=$data43 + return -1 +endi + + +if $data51 != 1 then + print =====data51=$data51 + return -1 +endi +if $data52 != 3.000000000 then + print =====data52=$data52 + return -1 +endi +if $data53 != NULL then + print =====data53=$data53 + return -1 +endi + + +if $data61 != 2 then + print =====data61=$data61 + return -1 +endi +if $data62 != 4.000000000 then + print =====data62=$data62 + return -1 +endi +if $data63 != bbb then + print =====data63=$data63 + return -1 +endi + + +sql insert into t1 values(1648791212000,5,5,5,5.0,'eee'); +sql insert into t1 values(1648791207000,6,6,6,6.0,'fff') (1648791209000,7,7,7,7.0,'ggg') (1648791219000,8,8,8,8.0,'hhh') (1648791221000,9,9,9,9.0,'iii'); + + + +$loop_count = 0 + +loop4: + +sleep 200 + +sql select * from test3.streamt3 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + + +if $rows != 15 then + print =====rows=$rows + goto loop4 +endi + + +if $data01 != 6 then + print =====data01=$data01 + return -1 +endi +if $data02 != 12.000000000 then + print =====data02=$data02 + return -1 +endi +if $data03 != fff then + print =====data03=$data03 + return -1 +endi + +if $data11 != 6 then + print =====data11=$data11 + return -1 +endi +if $data12 != 13.000000000 then + print =====data12=$data12 + return -1 +endi +if $data13 != NULL then + print =====data13=$data13 + return -1 +endi + + +if $data21 != 7 then + print =====data21=$data21 + return -1 +endi +if $data22 != 14.000000000 then + print =====data22=$data22 + return -1 +endi +if $data23 != ggg then + print =====data23=$data23 + return -1 +endi + + +if $data31 != 5 then + print =====data31=$data31 + return -1 +endi +if $data32 != 10.000000000 then + print =====data32=$data32 + return -1 +endi +if $data33 != NULL then + print =====data33=$data33 + return -1 +endi + +if $data51 != 5 then + print =====data51=$data51 + return -1 +endi +if $data52 != 10.000000000 then + print =====data52=$data52 + return -1 +endi +if $data53 != eee then + print =====data53=$data53 + return -1 +endi + + +if $data[11][1] != 5 then + print =====data[11][1]=$data[11][1] + return -1 +endi +if $data[11][2] != 10.000000000 then + print =====data[11][2]=$data[11][2] + return -1 +endi +if $data[11][3] != NULL then + print =====data[11][3]=$data[11][3] + return -1 +endi + +if $data[12][1] != 8 then + print =====data[12][1]=$data[12][1] + return -1 +endi +if $data[12][2] != 16.000000000 then + print =====data[12][2]=$data[12][2] + return -1 +endi +if $data[12][3] != hhh then + print =====data[12][3]=$data[12][3] + return -1 +endi + +if $data[13][1] != 8 then + print =====data[13][1]=$data[13][1] + return -1 +endi +if $data[13][2] != 17.000000000 then + print =====data[13][2]=$data[13][2] + return -1 +endi +if $data[13][3] != NULL then + print =====data[13][3]=$data[13][3] + return -1 +endi + +if $data[14][1] != 9 then + print =====data[14][1]=$data[14][1] + return -1 +endi +if $data[14][2] != 18.000000000 then + print =====data[14][2]=$data[14][2] + return -1 +endi +if $data[14][3] != iii then + print =====data[14][3]=$data[14][3] + return -1 +endi + + + + + + + + + + + + + + + + + + + + + + + + +sql drop stream if exists streams0; +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop stream if exists streams3; +sql drop stream if exists streams4; +sql drop stream if exists streams5; +sql drop stream if exists streams6; +sql drop stream if exists streams7; +sql drop stream if exists streams8; + +sql use test1; +sql select * from t1; +print $data00 + +$loop_all = $loop_all + 1 +print ============loop_all=$loop_all + +system sh/stop_dnodes.sh + +#goto looptest \ No newline at end of file diff --git a/tests/script/tsim/stream/fillIntervalPartitionBy.sim b/tests/script/tsim/stream/fillIntervalPartitionBy.sim new file mode 100644 index 0000000000000000000000000000000000000000..384aa2c8e49a091d30e5faf5bad0ed6bea183e48 --- /dev/null +++ b/tests/script/tsim/stream/fillIntervalPartitionBy.sim @@ -0,0 +1,171 @@ +$loop_all = 0 +looptest: + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 200 +sql connect + +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop stream if exists streams3; +sql drop stream if exists streams4; +sql drop stream if exists streams5; +sql drop database if exists test1; +sql create database test1 vgroups 1; +sql use test1; +sql create stable st(ts timestamp, a int, b int , c int, d double, s varchar(20)) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); +sql create stream streams1 trigger at_once into streamt1 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(NULL); +sql create stream streams2 trigger at_once into streamt2 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(value,100,200,300); +sql create stream streams3 trigger at_once into streamt3 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(next); +sql create stream streams4 trigger at_once into streamt4 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(prev); +sql create stream streams5 trigger at_once into streamt5 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(linear); + +sql insert into t1 values(1648791210000,0,0,0,0.0,'aaa'); +sql insert into t1 values(1648791213000,1,1,1,1.0,'bbb'); +sql insert into t1 values(1648791215000,5,5,5,5.0,'ccc'); +sql insert into t1 values(1648791216000,6,6,6,6.0,'ddd'); +sql insert into t2 values(1648791210000,7,0,0,0.0,'aaa'); +sql insert into t2 values(1648791213000,8,1,1,1.0,'bbb'); +sql insert into t2 values(1648791215000,9,5,5,5.0,'ccc'); +sql insert into t2 values(1648791216000,10,6,6,6.0,'ddd'); + +$loop_count = 0 + +loop2: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + + +sql select * from streamt1 order by group_id, ts; + +if $rows != 14 then + print ====streamt1=rows1=$rows + goto loop2 +endi + +sql select * from streamt2 order by group_id, ts; + +if $rows != 14 then + print ====streamt2=rows2=$rows + goto loop2 +endi + +sql select * from streamt3 order by group_id, ts; + +if $rows != 14 then + print ====streamt3=rows3=$rows + goto loop2 +endi + +sql select * from streamt4 order by group_id, ts; + +if $rows != 14 then + print ====streamt4=rows4=$rows + goto loop2 +endi + +sql select * from streamt5 order by group_id, ts; + +if $rows != 14 then + print ====streamt5=rows5=$rows + goto loop2 +endi + +sql delete from t1 where ts = 1648791216000; +print ======delete from t1 where ts = 1648791216000; + +$loop_count = 0 + +loop3: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt1 order by group_id, ts; + +if $rows != 13 then + print ====streamt1=rows1=$rows + goto loop3 +endi + +sql select * from streamt2 order by group_id, ts; + +if $rows != 13 then + print ====streamt2=rows2=$rows + goto loop3 +endi + +sql select * from streamt3 order by group_id, ts; + +if $rows != 13 then + print ====streamt3=rows3=$rows + goto loop3 +endi + +sql select * from streamt4 order by group_id, ts; + +if $rows != 13 then + print ====streamt4=rows4=$rows + goto loop3 +endi + +sql select * from streamt5 order by group_id, ts; + +if $rows != 13 then + print ====streamt5=rows5=$rows + goto loop3 +endi + + + + + + + + + + + + + + + + + + + + + +sql drop stream if exists streams0; +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop stream if exists streams3; +sql drop stream if exists streams4; +sql drop stream if exists streams5; +sql drop stream if exists streams6; +sql drop stream if exists streams7; +sql drop stream if exists streams8; +sql drop stream if exists streams9; +sql drop stream if exists streams10; + +sql use test1; +sql select * from t1; +print $data00 + +$loop_all = $loop_all + 1 +print ============loop_all=$loop_all + +system sh/stop_dnodes.sh + +#goto looptest \ No newline at end of file diff --git a/tests/script/tsim/stream/fillIntervalPrevNext.sim b/tests/script/tsim/stream/fillIntervalPrevNext.sim new file mode 100644 index 0000000000000000000000000000000000000000..5eab5fdac1c1fcf3e377e7b5e5f049d2ec760ebf --- /dev/null +++ b/tests/script/tsim/stream/fillIntervalPrevNext.sim @@ -0,0 +1,1036 @@ +$loop_all = 0 +looptest: + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 200 +sql connect + +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop database if exists test1; +sql create database test1 vgroups 1; +sql use test1; +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20)); +sql create stream streams1 trigger at_once into streamt1 as select _wstart as ts, count(*) c1, max(b)+sum(a) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev); +sql create stream streams2 trigger at_once into streamt2 as select _wstart as ts, count(*) c1, max(a)+min(c), avg(b) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next); +sql insert into t1 values(1648791213000,4,4,4,4.0,'aaa') (1648791215000,5,5,5,5.0,'aaa'); +sql insert into t1 values(1648791211000,1,1,1,1.0,'aaa') (1648791217000,2,2,2,2.0,'aaa') (1648791220000,3,3,3,3.0,'aaa'); + + +$loop_count = 0 + +loop1: +sleep 200 +sql use test1; +sql select * from streamt1 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 10 then + print =====rows=$rows + goto loop1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop1 +endi + +if $data02 != 2.000000000 then + print =====data02=$data02 + goto loop1 +endi + + +if $data11 != 1 then + print =====data11=$data11 + goto loop1 +endi + +if $data12 != 2.000000000 then + print =====data12=$data12 + goto loop1 +endi + + +if $data21 != 1 then + print =====data21=$data21 + goto loop1 +endi + +if $data22 != 8.000000000 then + print =====data22=$data22 + goto loop1 +endi + + +if $data31 != 1 then + print =====data31=$data31 + goto loop1 +endi + +if $data32 != 8.000000000 then + print =====data32=$data32 + goto loop1 +endi + + +if $data41 != 1 then + print =====data41=$data41 + goto loop1 +endi + +if $data42 != 10.000000000 then + print =====data42=$data42 + goto loop1 +endi + + +if $data51 != 1 then + print =====data01=$data01 + goto loop1 +endi + +if $data52 != 10.000000000 then + print =====data52=$data52 + goto loop1 +endi + + +if $data61 != 1 then + print =====data61=$data61 + goto loop1 +endi + +if $data62 != 4.000000000 then + print =====data62=$data62 + goto loop1 +endi + + +if $data71 != 1 then + print =====data71=$data71 + goto loop1 +endi + +if $data72 != 4.000000000 then + print =====data72=$data72 + goto loop1 +endi + + +if $data81 != 1 then + print =====data81=$data81 + goto loop1 +endi + +if $data82 != 4.000000000 then + print =====data82=$data82 + goto loop1 +endi + + +if $data91 != 1 then + print =====data91=$data91 + goto loop1 +endi + +if $data92 != 6.000000000 then + print =====data92=$data92 + goto loop1 +endi + +sql use test1; +sql select * from streamt2 order by ts; + +print next----------------------151 + +if $rows != 10 then + print =====rows=$rows + goto loop1 +endi + +if $data02 != 2.000000000 then + print =====data02=$data02 + goto loop1 +endi +if $data03 != 1.000000000 then + print =====data03=$data03 + goto loop1 +endi + +if $data12 != 8.000000000 then + print =====data12=$data12 + goto loop1 +endi +if $data13 != 4.000000000 then + print =====data13=$data13 + goto loop1 +endi + + +if $data22 != 8.000000000 then + print =====data22=$data22 + goto loop1 +endi +if $data23 != 4.000000000 then + print =====data23=$data23 + goto loop1 +endi + + +if $data32 != 10.000000000 then + print =====data32=$data32 + goto loop1 +endi +if $data33 != 5.000000000 then + print =====data33=$data33 + goto loop1 +endi + + +if $data42 != 10.000000000 then + print =====data42=$data42 + goto loop1 +endi +if $data43 != 5.000000000 then + print =====data43=$data43 + goto loop1 +endi + + +if $data52 != 4.000000000 then + print =====data52=$data52 + goto loop1 +endi +if $data53 != 2.000000000 then + print =====data53=$data53 + goto loop1 +endi + + +if $data62 != 4.000000000 then + print =====data62=$data62 + goto loop1 +endi +if $data63 != 2.000000000 then + print =====data63=$data63 + goto loop1 +endi + + +if $data72 != 6.000000000 then + print =====data72=$data72 + return -1 +endi +if $data73 != 3.000000000 then + print =====data73=$data73 + return -1 +endi + + +if $data82 != 6.000000000 then + print =====data82=$data82 + return -1 +endi +if $data83 != 3.000000000 then + print =====data83=$data83 + return -1 +endi + + +if $data92 != 6.000000000 then + print =====data92=$data92 + return -1 +endi +if $data93 != 3.000000000 then + print =====data93=$data93 + return -1 +endi + + + +sql drop stream if exists streams5; +sql drop stream if exists streams6; +sql drop database if exists test5; +sql create database test5 vgroups 1; +sql use test5; +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20)); +sql create stream streams5 trigger at_once into streamt5 as select _wstart as ts, count(*) c1, max(b)+sum(a) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev); +sql create stream streams6 trigger at_once into streamt6 as select _wstart as ts, count(*) c1, max(a)+min(c), avg(b) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next); +sql insert into t1 values(1648791211000,1,1,1,1.0,'aaa') (1648791217000,2,2,2,2.0,'aaa') (1648791220000,3,3,3,3.0,'aaa'); +sql insert into t1 values(1648791213000,4,4,4,4.0,'aaa') (1648791215000,5,5,5,5.0,'aaa'); + +$loop_count = 0 + +loop5: +sleep 200 +sql select * from streamt5 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 10 then + print =====rows=$rows + goto loop5 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop5 +endi + +if $data02 != 2.000000000 then + print =====data02=$data02 + goto loop5 +endi + + +if $data11 != 1 then + print =====data11=$data11 + goto loop5 +endi + +if $data12 != 2.000000000 then + print =====data12=$data12 + goto loop5 +endi + + +if $data21 != 1 then + print =====data21=$data21 + goto loop5 +endi + +if $data22 != 8.000000000 then + print =====data22=$data22 + goto loop5 +endi + + +if $data31 != 1 then + print =====data31=$data31 + goto loop5 +endi + +if $data32 != 8.000000000 then + print =====data32=$data32 + goto loop5 +endi + + +if $data41 != 1 then + print =====data41=$data41 + goto loop5 +endi + +if $data42 != 10.000000000 then + print =====data42=$data42 + goto loop5 +endi + + +if $data51 != 1 then + print =====data01=$data01 + goto loop5 +endi + +if $data52 != 10.000000000 then + print =====data52=$data52 + goto loop5 +endi + + +if $data61 != 1 then + print =====data61=$data61 + goto loop5 +endi + +if $data62 != 4.000000000 then + print =====data62=$data62 + goto loop5 +endi + + +if $data71 != 1 then + print =====data71=$data71 + goto loop5 +endi + +if $data72 != 4.000000000 then + print =====data72=$data72 + goto loop5 +endi + + +if $data81 != 1 then + print =====data81=$data81 + goto loop5 +endi + +if $data82 != 4.000000000 then + print =====data82=$data82 + goto loop5 +endi + + +if $data91 != 1 then + print =====data91=$data91 + goto loop5 +endi + +if $data92 != 6.000000000 then + print =====data92=$data92 + goto loop5 +endi + + +$loop_count = 0 + +loop6: + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sleep 200 + +sql select * from streamt6 order by ts; + +if $rows != 10 then + print =====rows=$rows + goto loop6 +endi + +if $data02 != 2.000000000 then + print =====data02=$data02 + goto loop6 +endi +if $data03 != 1.000000000 then + print =====data03=$data03 + goto loop6 +endi + +if $data12 != 8.000000000 then + print =====data12=$data12 + goto loop6 +endi +if $data13 != 4.000000000 then + print =====data13=$data13 + goto loop6 +endi + + +if $data22 != 8.000000000 then + print =====data22=$data22 + goto loop6 +endi +if $data23 != 4.000000000 then + print =====data23=$data23 + goto loop6 +endi + + +if $data32 != 10.000000000 then + print =====data32=$data32 + goto loop6 +endi +if $data33 != 5.000000000 then + print =====data33=$data33 + goto loop6 +endi + + +if $data42 != 10.000000000 then + print =====data42=$data42 + goto loop6 +endi +if $data43 != 5.000000000 then + print =====data43=$data43 + goto loop6 +endi + + +if $data52 != 4.000000000 then + print =====data52=$data52 + goto loop6 +endi +if $data53 != 2.000000000 then + print =====data53=$data53 + goto loop6 +endi + + +if $data62 != 4.000000000 then + print =====data62=$data62 + goto loop6 +endi +if $data63 != 2.000000000 then + print =====data63=$data63 + goto loop6 +endi + + +if $data72 != 6.000000000 then + print =====data72=$data72 + return -1 +endi +if $data73 != 3.000000000 then + print =====data73=$data73 + return -1 +endi + + +if $data82 != 6.000000000 then + print =====data82=$data82 + return -1 +endi +if $data83 != 3.000000000 then + print =====data83=$data83 + return -1 +endi + + +if $data92 != 6.000000000 then + print =====data92=$data92 + return -1 +endi +if $data93 != 3.000000000 then + print =====data93=$data93 + return -1 +endi + + + +sql drop stream if exists streams7; +sql drop stream if exists streams8; +sql drop database if exists test7; +sql create database test7 vgroups 1; +sql use test7; +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20)); +sql create stream streams7 trigger at_once into streamt7 as select _wstart as ts, max(a), b+c, s from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(prev); +sql create stream streams8 trigger at_once into streamt8 as select _wstart as ts, max(a), 1, b+1 from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(next); +sql insert into t1 values(1648791215000,1,1,1,1.0,'aaa'); +sql insert into t1 values(1648791217000,2,2,2,2.0,'bbb'); +sql insert into t1 values(1648791211000,3,3,3,3.0,'ccc'); +sql insert into t1 values(1648791213000,4,4,4,4.0,'ddd'); + + +$loop_count = 0 + +loop7: +sleep 300 +sql select * from streamt7 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + + +if $rows != 7 then + print =====rows=$rows + goto loop7 +endi + + +if $data01 != 3 then + print =====data01=$data01 + return -1 +endi +if $data02 != 6.000000000 then + print =====data02=$data02 + return -1 +endi +if $data03 != ccc then + print =====data03=$data03 + return -1 +endi + +if $data11 != 3 then + print =====data11=$data11 + return -1 +endi +if $data12 != 6.000000000 then + print =====data12=$data12 + return -1 +endi +if $data13 != ccc then + print =====data13=$data13 + return -1 +endi + + +if $data21 != 4 then + print =====data21=$data21 + return -1 +endi +if $data22 != 8.000000000 then + print =====data22=$data22 + return -1 +endi +if $data23 != ddd then + print =====data23=$data23 + return -1 +endi + + +if $data31 != 4 then + print =====data31=$data31 + return -1 +endi +if $data32 != 8.000000000 then + print =====data32=$data32 + return -1 +endi +if $data33 != ddd then + print =====data33=$data33 + return -1 +endi + + +if $data41 != 1 then + print =====data41=$data41 + return -1 +endi +if $data42 != 2.000000000 then + print =====data42=$data42 + return -1 +endi +if $data43 != aaa then + print =====data43=$data43 + return -1 +endi + + +if $data51 != 1 then + print =====data51=$data51 + return -1 +endi +if $data52 != 2.000000000 then + print =====data52=$data52 + return -1 +endi +if $data53 != aaa then + print =====data53=$data53 + return -1 +endi + + +if $data61 != 2 then + print =====data61=$data61 + return -1 +endi +if $data62 != 4.000000000 then + print =====data62=$data62 + return -1 +endi +if $data63 != bbb then + print =====data63=$data63 + return -1 +endi + +#-------------- + +sleep 200 +sql select * from streamt8 order by ts; + + +if $rows != 7 then + print =====rows=$rows + return -1 +endi + + +if $data01 != 3 then + print =====data01=$data01 + return -1 +endi +if $data02 != 1 then + print =====data02=$data02 + return -1 +endi +if $data03 != 4.000000000 then + print =====data03=$data03 + return -1 +endi + +if $data11 != 4 then + print =====data11=$data11 + return -1 +endi +if $data12 != 1 then + print =====data12=$data12 + return -1 +endi +if $data13 != 5.000000000 then + print =====data13=$data13 + return -1 +endi + + +if $data21 != 4 then + print =====data21=$data21 + return -1 +endi +if $data22 != 1 then + print =====data22=$data22 + return -1 +endi +if $data23 != 5.000000000 then + print =====data23=$data23 + return -1 +endi + + +if $data31 != 1 then + print =====data31=$data31 + return -1 +endi +if $data32 != 1 then + print =====data32=$data32 + return -1 +endi +if $data33 != 2.000000000 then + print =====data33=$data33 + return -1 +endi + + +if $data41 != 1 then + print =====data41=$data41 + return -1 +endi +if $data42 != 1 then + print =====data42=$data42 + return -1 +endi +if $data43 != 2.000000000 then + print =====data43=$data43 + return -1 +endi + + +if $data51 != 2 then + print =====data51=$data51 + return -1 +endi +if $data52 != 1 then + print =====data52=$data52 + return -1 +endi +if $data53 != 3.000000000 then + print =====data53=$data53 + return -1 +endi + + +if $data61 != 2 then + print =====data61=$data61 + return -1 +endi +if $data62 != 1 then + print =====data62=$data62 + return -1 +endi +if $data63 != 3.000000000 then + print =====data63=$data63 + return -1 +endi + +sql insert into t1 values(1648791212000,5,5,5,5.0,'eee'); +sql insert into t1 values(1648791207000,6,6,6,6.0,'fff') (1648791209000,7,7,7,7.0,'ggg') (1648791219000,8,8,8,8.0,'hhh') (1648791221000,9,9,9,9.0,'iii'); + + + +$loop_count = 0 + +loop8: +sleep 200 +sql select * from streamt7 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + + +if $rows != 15 then + print =====rows=$rows + goto loop8 +endi + + +if $data01 != 6 then + print =====data01=$data01 + return -1 +endi +if $data02 != 12.000000000 then + print =====data02=$data02 + return -1 +endi +if $data03 != fff then + print =====data03=$data03 + return -1 +endi + +if $data11 != 6 then + print =====data11=$data11 + return -1 +endi +if $data12 != 12.000000000 then + print =====data12=$data12 + return -1 +endi +if $data13 != fff then + print =====data13=$data13 + return -1 +endi + + +if $data21 != 7 then + print =====data21=$data21 + return -1 +endi +if $data22 != 14.000000000 then + print =====data22=$data22 + return -1 +endi +if $data23 != ggg then + print =====data23=$data23 + return -1 +endi + + +if $data31 != 7 then + print =====data31=$data31 + return -1 +endi +if $data32 != 14.000000000 then + print =====data32=$data32 + return -1 +endi +if $data33 != ggg then + print =====data33=$data33 + return -1 +endi + +if $data51 != 5 then + print =====data51=$data51 + return -1 +endi +if $data52 != 10.000000000 then + print =====data52=$data52 + return -1 +endi +if $data53 != eee then + print =====data53=$data53 + return -1 +endi + + +if $data[11][1] != 2 then + print =====data[11][1]=$data[11][1] + return -1 +endi +if $data[11][2] != 4.000000000 then + print =====data[11][2]=$data[11][2] + return -1 +endi +if $data[11][3] != bbb then + print =====data[11][3]=$data[11][3] + return -1 +endi + +if $data[12][1] != 8 then + print =====data[12][1]=$data[12][1] + return -1 +endi +if $data[12][2] != 16.000000000 then + print =====data[12][2]=$data[12][2] + return -1 +endi +if $data[12][3] != hhh then + print =====data[12][3]=$data[12][3] + return -1 +endi + +if $data[13][1] != 8 then + print =====data[13][1]=$data[13][1] + return -1 +endi +if $data[13][2] != 16.000000000 then + print =====data[13][2]=$data[13][2] + return -1 +endi +if $data[13][3] != hhh then + print =====data[13][3]=$data[13][3] + return -1 +endi + +if $data[14][1] != 9 then + print =====data[14][1]=$data[14][1] + return -1 +endi +if $data[14][2] != 18.000000000 then + print =====data[14][2]=$data[14][2] + return -1 +endi +if $data[14][3] != iii then + print =====data[14][3]=$data[14][3] + return -1 +endi + +print fill next-----------------890 +sql use test7; +sql select * from streamt8 order by ts; + +if $rows != 15 then + print =====rows=$rows + goto loop8 +endi + + +if $data01 != 6 then + print =====data01=$data01 + return -1 +endi +if $data02 != 1 then + print =====data02=$data02 + return -1 +endi +if $data03 != 7.000000000 then + print =====data03=$data03 + return -1 +endi + +if $data11 != 7 then + print =====data11=$data11 + return -1 +endi +if $data13 != 8.000000000 then + print =====data13=$data13 + return -1 +endi + + +if $data21 != 7 then + print =====data21=$data21 + return -1 +endi +if $data23 != 8.000000000 then + print =====data23=$data23 + return -1 +endi + + +if $data31 != 3 then + print =====data31=$data31 + return -1 +endi +if $data33 != 4.000000000 then + print =====data33=$data33 + return -1 +endi + +if $data51 != 5 then + print =====data51=$data51 + return -1 +endi +if $data53 != 6.000000000 then + print =====data53=$data53 + return -1 +endi + + +if $data[11][1] != 8 then + print =====data[11][1]=$data[11][1] + return -1 +endi +if $data[11][2] != 1 then + print =====data[11][2]=$data[11][2] + return -1 +endi +if $data[11][3] != 9.000000000 then + print =====data[11][3]=$data[11][3] + return -1 +endi + +if $data[12][1] != 8 then + print =====data[12][1]=$data[12][1] + return -1 +endi +if $data[12][3] != 9.000000000 then + print =====data[12][3]=$data[12][3] + return -1 +endi + +if $data[13][1] != 9 then + print =====data[13][1]=$data[13][1] + return -1 +endi +if $data[13][3] != 10.000000000 then + print =====data[13][3]=$data[13][3] + return -1 +endi + +if $data[14][1] != 9 then + print =====data[14][1]=$data[14][1] + return -1 +endi +if $data[14][3] != 10.000000000 then + print =====data[14][3]=$data[14][3] + return -1 +endi + + + + + + + + + + + + + + + + + + + + + + + + +sql drop stream if exists streams0; +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop stream if exists streams3; +sql drop stream if exists streams4; +sql drop stream if exists streams5; +sql drop stream if exists streams6; +sql drop stream if exists streams7; +sql drop stream if exists streams8; + +sql use test1; +sql select * from t1; +print $data00 + +$loop_all = $loop_all + 1 +print ============loop_all=$loop_all + +system sh/stop_dnodes.sh + +#goto looptest \ No newline at end of file diff --git a/tests/script/tsim/stream/fillIntervalValue.sim b/tests/script/tsim/stream/fillIntervalValue.sim new file mode 100644 index 0000000000000000000000000000000000000000..113eae92707a9592c66a61529cdcda47a6e008bb --- /dev/null +++ b/tests/script/tsim/stream/fillIntervalValue.sim @@ -0,0 +1,488 @@ +$loop_all = 0 +looptest: + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 200 +sql connect + +sql drop database if exists test; +sql create database test vgroups 1; +sql use test; + +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));; +sql create stream streams1 trigger at_once into streamt as select _wstart ts, count(*) c1 from t1 where ts > 1648791210000 and ts < 1648791413000 interval(10s) fill(value, 100); +sql insert into t1 values(1648791213000,1,2,3,1.0,'aaa'); +sleep 100 +sql insert into t1 values(1648791233000,1,2,3,1.0,'aaa'); +sql insert into t1 values(1648791223000,1,2,3,1.0,'aaa'); +sql insert into t1 values(1648791283000,1,2,3,1.0,'aaa'); +sql insert into t1 values(1648791253000,1,2,3,1.0,'aaa'); + +$loop_count = 0 + +loop0: +sleep 200 +sql select * from streamt order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 8 then + print =====rows=$rows + goto loop0 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop0 +endi + +if $data11 != 1 then + print =====data11=$data11 + goto loop0 +endi + +if $data21 != 1 then + print =====data21=$data21 + goto loop0 +endi + +if $data31 != 100 then + print =====data31=$data31 + goto loop0 +endi + +if $data41 != 1 then + print =====data41=$data41 + goto loop0 +endi + +if $data51 != 100 then + print =====data01=$data01 + goto loop0 +endi + +if $data61 != 100 then + print =====data61=$data61 + goto loop0 +endi + +if $data71 != 1 then + print =====data71=$data71 + goto loop0 +endi + +sql drop stream if exists streams2; +sql drop database if exists test2; +sql create database test2 vgroups 1; +sql use test2; +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20)); +sql create stream streams2 trigger at_once into streamt2 as select _wstart as ts, count(*) c1, max(b)+sum(a) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value, 100,200); +sql insert into t1 values(1648791211000,1,1,1,1.0,'aaa') (1648791217000,2,2,2,2.0,'aaa') (1648791220000,3,3,3,3.0,'aaa'); +sql insert into t1 values(1648791213000,4,4,4,4.0,'aaa') (1648791215000,5,5,5,5.0,'aaa'); + +$loop_count = 0 + +loop1: +sleep 200 +sql select * from streamt2 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 10 then + print =====rows=$rows + goto loop1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop1 +endi + +if $data02 != 2.000000000 then + print =====data02=$data02 + goto loop1 +endi + + +if $data11 != 100 then + print =====data11=$data11 + goto loop1 +endi + +if $data12 != 200.000000000 then + print =====data12=$data12 + goto loop1 +endi + + +if $data21 != 1 then + print =====data21=$data21 + goto loop1 +endi + +if $data22 != 8.000000000 then + print =====data22=$data22 + goto loop1 +endi + + +if $data31 != 100 then + print =====data31=$data31 + goto loop1 +endi + +if $data32 != 200.000000000 then + print =====data32=$data32 + goto loop1 +endi + + +if $data41 != 1 then + print =====data41=$data41 + goto loop1 +endi + +if $data42 != 10.000000000 then + print =====data42=$data42 + goto loop1 +endi + + +if $data51 != 100 then + print =====data01=$data01 + goto loop1 +endi + +if $data52 != 200.000000000 then + print =====data52=$data52 + goto loop1 +endi + + +if $data61 != 1 then + print =====data61=$data61 + goto loop1 +endi + +if $data62 != 4.000000000 then + print =====data62=$data62 + goto loop1 +endi + + +if $data71 != 100 then + print =====data71=$data71 + goto loop1 +endi + +if $data72 != 200.000000000 then + print =====data72=$data72 + goto loop1 +endi + + +if $data81 != 100 then + print =====data81=$data81 + goto loop1 +endi + +if $data82 != 200.000000000 then + print =====data82=$data82 + goto loop1 +endi + + +if $data91 != 1 then + print =====data91=$data91 + goto loop1 +endi + +if $data92 != 6.000000000 then + print =====data92=$data92 + goto loop1 +endi + +sql drop stream if exists streams3; +sql drop database if exists test3; +sql create database test3 vgroups 1; +sql use test3; +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20)); +sql create stream streams3 trigger at_once into streamt3 as select _wstart as ts, max(b), a+b, c from t1 where ts >= 1648791200000 and ts < 1648791261000 interval(10s) sliding(3s) fill(value, 100,200,300); + +sql insert into t1 values(1648791220000,1,1,1,1.0,'aaa'); +sleep 100 +sql insert into t1 values(1648791260000,1,1,1,1.0,'aaa'); +sleep 100 +sql insert into t1 values(1648791200000,1,1,1,1.0,'aaa'); + +$loop_count = 0 + +loop3: +sleep 200 +sql select * from streamt3 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 23 then + print =====rows=$rows + goto loop3 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop3 +endi + +if $data02 != 2.000000000 then + print =====data02=$data02 + goto loop3 +endi + +if $data03 != 1 then + print =====data03=$data03 + goto loop3 +endi + + +if $data21 != 1 then + print =====data21=$data21 + goto loop3 +endi + +if $data22 != 2.000000000 then + print =====data22=$data22 + goto loop3 +endi + +if $data23 != 1 then + print =====data23=$data23 + goto loop3 +endi + + +if $data31 != 100 then + print =====data31=$data31 + goto loop3 +endi + +if $data32 != 200.000000000 then + print =====data32=$data32 + goto loop3 +endi + +if $data33 != 300 then + print =====data33=$data33 + goto loop3 +endi + +if $data61 != 100 then + print =====data61=$data61 + goto loop3 +endi + +if $data62 != 200.000000000 then + print =====data62=$data62 + goto loop3 +endi + +if $data63 != 300 then + print =====data63=$data63 + goto loop3 +endi + + +if $data71 != 1 then + print =====data71=$data71 + goto loop3 +endi + +if $data72 != 2.000000000 then + print =====data72=$data72 + goto loop3 +endi + +if $data73 != 1 then + print =====data73=$data73 + goto loop3 +endi + + +if $data91 != 1 then + print =====data91=$data91 + goto loop3 +endi + +if $data92 != 2.000000000 then + print =====data92=$data92 + goto loop3 +endi + +if $data93 != 1 then + print =====data93=$data93 + goto loop3 +endi + + +if $data[10][1] != 100 then + print =====data[10][1]=$data[10][1] + goto loop3 +endi + +if $data[10][2] != 200.000000000 then + print =====data[10][2]=$data[10][2] + goto loop3 +endi + +if $data[10][3] != 300 then + print =====data[10][3]=$data[10][3] + goto loop3 +endi + +if $data[19][1] != 100 then + print =====data[19][1]=$data[19][1] + goto loop3 +endi + +if $data[19][2] != 200.000000000 then + print =====data[19][2]=$data[19][2] + goto loop3 +endi + +if $data[19][3] != 300 then + print =====data[19][3]=$data[19][3] + goto loop3 +endi + + +if $data[20][1] != 1 then + print =====data[20][1]=$data[20][1] + goto loop3 +endi + +if $data[20][2] != 2.000000000 then + print =====data[20][2]=$data[20][2] + goto loop3 +endi + +if $data[20][3] != 1 then + print =====data[20][3]=$data[20][3] + goto loop3 +endi + + +if $data[22][1] != 1 then + print =====data[22][1]=$data[22][1] + goto loop3 +endi + +if $data[22][2] != 2.000000000 then + print =====data[22][2]=$data[22][2] + goto loop3 +endi + +if $data[22][3] != 1 then + print =====data[22][3]=$data[22][3] + goto loop3 +endi + + +sql drop stream if exists streams4; +sql drop database if exists test4; +sql create database test4 vgroups 1; +sql use test4; + +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));; +sql create stream streams4 trigger at_once into streamt4 as select _wstart ts, count(*) c1 from t1 where ts > 1648791210000 and ts < 1648791413000 interval(10s) fill(NULL); +sql insert into t1 values(1648791213000,1,2,3,1.0,'aaa'); +sql insert into t1 values(1648791233000,1,2,3,1.0,'aaa'); + +$loop_count = 0 + +loop4: +sleep 200 +sql select * from streamt4 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 3 then + print =====rows=$rows + goto loop4 +endi + +if $data11 != NULL then + print =====data11=$data11 + goto loop4 +endi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +sql drop stream if exists streams0; +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop stream if exists streams3; +sql drop stream if exists streams4; +sql drop stream if exists streams5; +sql drop stream if exists streams6; +sql drop stream if exists streams7; +sql drop stream if exists streams8; + +sql use test; +sql select * from t1; +print $data00 + +$loop_all = $loop_all + 1 +print ============loop_all=$loop_all + +system sh/stop_dnodes.sh + +#goto looptest \ No newline at end of file diff --git a/tests/script/tsim/stream/partitionby.sim b/tests/script/tsim/stream/partitionby.sim index e5e02c3873252a7d942ee5a5c07772c89aa97111..bc2c07b951373ae924d836664977dfe5897e845a 100644 --- a/tests/script/tsim/stream/partitionby.sim +++ b/tests/script/tsim/stream/partitionby.sim @@ -5,13 +5,14 @@ sleep 50 sql connect sql create database test vgroups 4; +sql create database test0 vgroups 1; sql use test; sql create stable st(ts timestamp, a int, b int , c int, d double) tags(ta int,tb int,tc int); sql create table ts1 using st tags(1,1,1); sql create table ts2 using st tags(2,2,2); sql create table ts3 using st tags(3,2,2); sql create table ts4 using st tags(4,2,2); -sql create stream stream_t1 trigger at_once into streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st partition by ta,tb,tc interval(10s); +sql create stream stream_t1 trigger at_once into test0.streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st partition by ta,tb,tc interval(10s); sql insert into ts1 values(1648791213001,1,12,3,1.0); sql insert into ts2 values(1648791213001,1,12,3,1.0); @@ -22,7 +23,7 @@ $loop_count = 0 loop0: sleep 300 -sql select * from streamtST1; +sql select * from test0.streamtST1; $loop_count = $loop_count + 1 if $loop_count == 10 then @@ -34,6 +35,29 @@ print =====rows=$rows goto loop0 endi +sql insert into ts1 values(1648791223001,1,12,3,1.0); +sql insert into ts2 values(1648791223001,1,12,3,1.0); + +sql insert into ts3 values(1648791223001,1,12,3,1.0); +sql insert into ts4 values(1648791223001,1,12,3,1.0); +sleep 300 +sql delete from st where ts = 1648791223001; + +loop00: +sleep 300 +sql select * from test0.streamtST1; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 4 then + print =====rows=$rows + goto loop00 +endi + + print =====loop0 sql create database test1 vgroups 1; diff --git a/tests/script/tsim/stream/partitionbyColumnInterval.sim b/tests/script/tsim/stream/partitionbyColumnInterval.sim index 24fdb9c99445864b01e95b21aa2db4c103054223..fd1d796fdb561813079f1f752cf73536af521caf 100644 --- a/tests/script/tsim/stream/partitionbyColumnInterval.sim +++ b/tests/script/tsim/stream/partitionbyColumnInterval.sim @@ -562,6 +562,53 @@ if $data21 != 1 then goto loop14 endi +sql drop stream if exists streams5; +sql drop database if exists test5; +sql create database test5 vgroups 4; +sql use test5; +sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); +sql create table t3 using st tags(2,2,2); +sql create table t4 using st tags(2,2,2); +sql create stream streams5 trigger at_once into test.streamt5 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a interval(10s); + +sql insert into t1 values(1648791213000,1,2,3,1.0); +sql insert into t2 values(1648791213000,2,2,3,1.0); +sql insert into t3 values(1648791213000,3,2,3,1.0); +sql insert into t4 values(1648791213000,4,2,3,1.0); + +sql insert into t1 values(1648791223000,1,2,3,1.0); +sql insert into t2 values(1648791223000,2,2,3,1.0); +sql insert into t3 values(1648791223000,3,2,3,1.0); +sql insert into t4 values(1648791223000,4,2,3,1.0); + +sleep 300 + +sql delete from st where ts = 1648791223000; + +sql select * from test.streamt5; + +$loop_count = 0 + +loop15: +sleep 50 +sql select * from test.streamt5 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $rows != 4 then + print =====rows=$rows + print =====rows=$rows + print =====rows=$rows +# goto loop15 +endi + + + $loop_all = $loop_all + 1 print ============loop_all=$loop_all diff --git a/tests/system-test/2-query/interp.py b/tests/system-test/2-query/interp.py index 7bf0191ec176c8a833eb3ff16fbb007e456fe93f..bee20710b51c19448fe7a7563596976c4fe3d639 100644 --- a/tests/system-test/2-query/interp.py +++ b/tests/system-test/2-query/interp.py @@ -356,8 +356,261 @@ class TDTestCase: tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:16', '2020-02-01 00:00:19') every(1s) fill(linear)") tdSql.checkRows(0) + tdLog.printNoPrefix("==========step8:test _irowts with interp") + + # fill null + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(null)") + tdSql.checkRows(9) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:08.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:08.500') + tdSql.checkData(2, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:09.500') + tdSql.checkData(4, 0, '2020-02-01 00:00:10.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:10.500') + tdSql.checkData(6, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(7, 0, '2020-02-01 00:00:11.500') + tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') + + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(null)") + tdSql.checkRows(13) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:04.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:05.000') + tdSql.checkData(2, 0, '2020-02-01 00:00:06.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:07.000') + tdSql.checkData(4, 0, '2020-02-01 00:00:08.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(6, 0, '2020-02-01 00:00:10.000') + tdSql.checkData(7, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') + tdSql.checkData(9, 0, '2020-02-01 00:00:13.000') + tdSql.checkData(10, 0, '2020-02-01 00:00:14.000') + tdSql.checkData(11, 0, '2020-02-01 00:00:15.000') + tdSql.checkData(12, 0, '2020-02-01 00:00:16.000') + + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(null)") + tdSql.checkRows(6) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:07.000') + tdSql.checkData(2, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(4, 0, '2020-02-01 00:00:13.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:15.000') + + # fill value + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(value, 1)") + tdSql.checkRows(9) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:08.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:08.500') + tdSql.checkData(2, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:09.500') + tdSql.checkData(4, 0, '2020-02-01 00:00:10.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:10.500') + tdSql.checkData(6, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(7, 0, '2020-02-01 00:00:11.500') + tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') + + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(value, 1)") + tdSql.checkRows(13) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:04.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:05.000') + tdSql.checkData(2, 0, '2020-02-01 00:00:06.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:07.000') + tdSql.checkData(4, 0, '2020-02-01 00:00:08.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(6, 0, '2020-02-01 00:00:10.000') + tdSql.checkData(7, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') + tdSql.checkData(9, 0, '2020-02-01 00:00:13.000') + tdSql.checkData(10, 0, '2020-02-01 00:00:14.000') + tdSql.checkData(11, 0, '2020-02-01 00:00:15.000') + tdSql.checkData(12, 0, '2020-02-01 00:00:16.000') + + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(value, 1)") + tdSql.checkRows(6) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:07.000') + tdSql.checkData(2, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(4, 0, '2020-02-01 00:00:13.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:15.000') + + # fill prev + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(prev)") + tdSql.checkRows(9) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:08.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:08.500') + tdSql.checkData(2, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:09.500') + tdSql.checkData(4, 0, '2020-02-01 00:00:10.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:10.500') + tdSql.checkData(6, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(7, 0, '2020-02-01 00:00:11.500') + tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') + + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(prev)") + tdSql.checkRows(12) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:06.000') + tdSql.checkData(2, 0, '2020-02-01 00:00:07.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:08.000') + tdSql.checkData(4, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:10.000') + tdSql.checkData(6, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(7, 0, '2020-02-01 00:00:12.000') + tdSql.checkData(8, 0, '2020-02-01 00:00:13.000') + tdSql.checkData(9, 0, '2020-02-01 00:00:14.000') + tdSql.checkData(10, 0, '2020-02-01 00:00:15.000') + tdSql.checkData(11, 0, '2020-02-01 00:00:16.000') + + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(prev)") + tdSql.checkRows(6) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:07.000') + tdSql.checkData(2, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(4, 0, '2020-02-01 00:00:13.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:15.000') + + # fill next + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(next)") + tdSql.checkRows(9) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:08.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:08.500') + tdSql.checkData(2, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:09.500') + tdSql.checkData(4, 0, '2020-02-01 00:00:10.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:10.500') + tdSql.checkData(6, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(7, 0, '2020-02-01 00:00:11.500') + tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') + + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(next)") + tdSql.checkRows(12) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:04.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:05.000') + tdSql.checkData(2, 0, '2020-02-01 00:00:06.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:07.000') + tdSql.checkData(4, 0, '2020-02-01 00:00:08.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(6, 0, '2020-02-01 00:00:10.000') + tdSql.checkData(7, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') + tdSql.checkData(9, 0, '2020-02-01 00:00:13.000') + tdSql.checkData(10, 0, '2020-02-01 00:00:14.000') + tdSql.checkData(11, 0, '2020-02-01 00:00:15.000') + + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(next)") + tdSql.checkRows(6) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:07.000') + tdSql.checkData(2, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(4, 0, '2020-02-01 00:00:13.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:15.000') + + # fill linear + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(linear)") + tdSql.checkRows(9) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:08.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:08.500') + tdSql.checkData(2, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:09.500') + tdSql.checkData(4, 0, '2020-02-01 00:00:10.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:10.500') + tdSql.checkData(6, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(7, 0, '2020-02-01 00:00:11.500') + tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') + + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") + tdSql.checkRows(11) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:06.000') + tdSql.checkData(2, 0, '2020-02-01 00:00:07.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:08.000') + tdSql.checkData(4, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:10.000') + tdSql.checkData(6, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(7, 0, '2020-02-01 00:00:12.000') + tdSql.checkData(8, 0, '2020-02-01 00:00:13.000') + tdSql.checkData(9, 0, '2020-02-01 00:00:14.000') + tdSql.checkData(10, 0, '2020-02-01 00:00:15.000') + + tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(linear)") + tdSql.checkRows(6) + tdSql.checkCols(2) + + tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') + tdSql.checkData(1, 0, '2020-02-01 00:00:07.000') + tdSql.checkData(2, 0, '2020-02-01 00:00:09.000') + tdSql.checkData(3, 0, '2020-02-01 00:00:11.000') + tdSql.checkData(4, 0, '2020-02-01 00:00:13.000') + tdSql.checkData(5, 0, '2020-02-01 00:00:15.000') + + # multiple _irowts + tdSql.query(f"select interp(c0),_irowts from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") + tdSql.checkRows(11) + tdSql.checkCols(2) + + tdSql.checkData(0, 1, '2020-02-01 00:00:05.000') + tdSql.checkData(1, 1, '2020-02-01 00:00:06.000') + tdSql.checkData(2, 1, '2020-02-01 00:00:07.000') + tdSql.checkData(3, 1, '2020-02-01 00:00:08.000') + tdSql.checkData(4, 1, '2020-02-01 00:00:09.000') + tdSql.checkData(5, 1, '2020-02-01 00:00:10.000') + tdSql.checkData(6, 1, '2020-02-01 00:00:11.000') + tdSql.checkData(7, 1, '2020-02-01 00:00:12.000') + tdSql.checkData(8, 1, '2020-02-01 00:00:13.000') + tdSql.checkData(9, 1, '2020-02-01 00:00:14.000') + tdSql.checkData(10, 1, '2020-02-01 00:00:15.000') + + tdSql.query(f"select _irowts, interp(c0), interp(c0), _irowts from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") + tdSql.checkRows(11) + tdSql.checkCols(4) - tdLog.printNoPrefix("==========step8:test intra block interpolation") + cols = (0, 3) + for i in cols: + tdSql.checkData(0, i, '2020-02-01 00:00:05.000') + tdSql.checkData(1, i, '2020-02-01 00:00:06.000') + tdSql.checkData(2, i, '2020-02-01 00:00:07.000') + tdSql.checkData(3, i, '2020-02-01 00:00:08.000') + tdSql.checkData(4, i, '2020-02-01 00:00:09.000') + tdSql.checkData(5, i, '2020-02-01 00:00:10.000') + tdSql.checkData(6, i, '2020-02-01 00:00:11.000') + tdSql.checkData(7, i, '2020-02-01 00:00:12.000') + tdSql.checkData(8, i, '2020-02-01 00:00:13.000') + tdSql.checkData(9, i, '2020-02-01 00:00:14.000') + tdSql.checkData(10, i, '2020-02-01 00:00:15.000') + + + tdLog.printNoPrefix("==========step9:test intra block interpolation") tdSql.execute(f"drop database {dbname}"); tdSql.prepare() @@ -551,7 +804,7 @@ class TDTestCase: tdSql.checkData(0, 0, 15) tdSql.checkData(1, 0, 15) - tdLog.printNoPrefix("==========step9:test multi-interp cases") + tdLog.printNoPrefix("==========step10:test multi-interp cases") tdSql.query(f"select interp(c0),interp(c1),interp(c2),interp(c3) from {dbname}.{tbname} range('2020-02-09 00:00:05', '2020-02-13 00:00:05') every(1d) fill(null)") tdSql.checkRows(5) tdSql.checkCols(4) @@ -601,7 +854,7 @@ class TDTestCase: for i in range (tdSql.queryCols): tdSql.checkData(0, i, 13) - tdLog.printNoPrefix("==========step10:test error cases") + tdLog.printNoPrefix("==========step11:test error cases") tdSql.error(f"select interp(c0) from {dbname}.{tbname}") tdSql.error(f"select interp(c0) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05')") diff --git a/tests/system-test/7-tmq/subscribeDb3.py b/tests/system-test/7-tmq/subscribeDb3.py index e8e475456cfa56240e4c5df5654b5e68eca9324d..0ff609ab6bc1cbeac9c02dead2ed06b6b7d6f5d0 100644 --- a/tests/system-test/7-tmq/subscribeDb3.py +++ b/tests/system-test/7-tmq/subscribeDb3.py @@ -295,7 +295,7 @@ class TDTestCase: ifManualCommit = 1 keyList = 'group.id:cgrp1,\ enable.auto.commit:true,\ - auto.commit.interval.ms:1000,\ + auto.commit.interval.ms:200,\ auto.offset.reset:earliest' self.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit) diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c index ca3d464da769a9da8c87abd2be466ac2269fabcd..56ba622a9cc522cd77b1126f0efe916ed5f4a0e6 100644 --- a/utils/test/c/sml_test.c +++ b/utils/test/c/sml_test.c @@ -879,7 +879,7 @@ int sml_16960_Test() { "{" "\"timestamp\":" "" - "{ \"value\": 1349020800000, \"type\": \"ms\" }" + "{ \"value\": 1664418955000, \"type\": \"ms\" }" "," "\"value\":" "" @@ -916,7 +916,7 @@ int sml_16960_Test() { "{" "\"timestamp\":" "" - "{ \"value\": 1349020800001, \"type\": \"ms\" }" + "{ \"value\": 1664418955001, \"type\": \"ms\" }" "," "\"value\":" "" @@ -953,7 +953,7 @@ int sml_16960_Test() { "{" "\"timestamp\":" "" - "{ \"value\": 1349020800002, \"type\": \"ms\" }" + "{ \"value\": 1664418955002, \"type\": \"ms\" }" "," "\"value\":" "" @@ -990,7 +990,7 @@ int sml_16960_Test() { "{" "\"timestamp\":" "" - "{ \"value\": 1349020800003, \"type\": \"ms\" }" + "{ \"value\": 1664418955003, \"type\": \"ms\" }" "," "\"value\":" "" @@ -1027,7 +1027,7 @@ int sml_16960_Test() { "{" "\"timestamp\":" "" - "{ \"value\": 1349020800004, \"type\": \"ms\" }" + "{ \"value\": 1664418955004, \"type\": \"ms\" }" "," "\"value\":" ""