Commit Graph

226 Commits

Author SHA1 Message Date
dapan1121 2713f4f6d4 feat: support create topic as stable with conditions 2023-05-25 19:01:58 +08:00
Dingle Zhang 984211f3b4
Feature/3.0 geometry (#21037)
* Add GEOMETRY data type and make sql.c able to parse it. The GEMETRY works like BINARY so far.

* add GEOMETRY type into gConvertTypes to fix some issues like DELETE calling

* change some test cases to make sure no same timestamp is inserted, and add my smoketest.sh

* Add a function MakePoint() and introduce a lib geometry

* implement sql functions GeomFromText() and AsText()

* Use GEOS *_r funcions instead for thread safety

* Handle with TSDB_DATA_TYPE_GEOMETRY when INSERT geometry data by converting WKT.
Add geosWrapper to wrap the basic GEOS functions for TDEngine.

* refactor AsText and MakePoint functions to be like GeomFromText

* Show WKT when print geometry data in screen
Dump hex data when dump geometry data in a file

* define TYPE_BYTES item for TSDB_DATA_TYPE_GEOMETRY, which casued some strange issues.

* set number of decimals of WKT to 6

* Implement SQL function Intersects()

* refactor geometry sql functions

* Add geosErrMsgeHandler() to get the GEOS error detail

* use threadlocal to instantiate SGeosContext
call destroyGeosContext() only if the thread exists

* remove SGeosContext *context param for all geometry functions since we use thread local one,
so that all caller do not need to know the context.

* Modify Intersects() to call PreparedIntersects() when one of param is a constant, which has higher performance.

* rename prepareFn() to initCtxFn() to avoid confusion with PreparedFn

* Add prefix "ST_" for all geometry functions

* move getThreadLocalGeosCtx() and destroyThreadLocalGeosCtx() into util,
so that all unit test tools can compile

* Add unit test for geometry lib, only test MakePoint so far

* refactor and enhance existing cases in geomFuncTest

* implement NULL type and NULL value test for geomFuncTest

* add test on geomFromText()

* add unit test on AsText() in geomFuncTest

* combine some makePointFunction test items

* add intersectsFunctionTwoColumns test
refactor on callGeomFromTextWrapper functions

* enhance intersectsFunction test to add cases like input constant , NULL type, NULL value, or wrong content

* add more cases into intersectsFunction test

* Add basic test on geometry in system test

* Add ST_GeomFromText and ST_AsText function test in system test on geometry

* add ST_Intersects function test in system test on geometry

* support to check expectedErrno in system test on geometry

* adjust geomTest unit test and geometry system test

* add geometry data type and functions in doc english version

* implement touchesFunction() in geometry lib
refactor geometry relation functions model

* separate gemFuncTest into several src files

* add unit test on touchesFunction

* support sql function ST_Touches()
add system test on ST_Touches

* add docs for ST_Touches()

* Add ST_Contains()

* Add ST_Covers()

* Add ST_Equals()

* add swapAllowed param for geomRelationFunction()
read geom2 earlier intead of at doGeosRelation()

* Add ST_ContainsProperly()

* build on windows

* Merge from 3.0 to 3.0_geometry

* change macro definition TSDB_DATA_TYPE_GEOMETRY as the last one for compatibility

* change '\\NULL' to 'NULL' back in shellDumpFieldToFile()

* add /usr/local/include into include directory

* add /usr/local/inlcude and /usr/local/lib in cmake.platform for DARWIN
2023-05-24 15:36:46 +08:00
dapan1121 cf7b4593e7 feat: add drop dnode unsafe command 2023-05-16 09:50:10 +08:00
Haojun Liao b98a465304 fix: fix syntax error. 2023-05-13 20:47:38 +08:00
dapan1121 a8c65cd25a feat: support restore dnode clause 2023-05-09 19:19:14 +08:00
dapan1121 3c2fc48e74 feat: support new table_prefix/table_suffix mode 2023-04-21 14:17:07 +08:00
Xiaoyu Wang 4c04b155d5 merge main 2023-04-11 15:56:28 +08:00
Xiaoyu Wang e2f82f4423 merge main 2023-04-10 09:56:03 +08:00
Xiaoyu Wang 9b2a94f281 fix: column comment is not supported 2023-04-04 18:04:10 +08:00
Xiaoyu Wang cc7485812a feat: add 'or replace' clause to 'create function' statement 2023-04-04 17:45:18 +08:00
Xiaoyu Wang daaf4871ac feat: table level privilege syntax 2023-03-28 18:43:58 +08:00
Xiaoyu Wang fbc9b2404e feat: add sql command 'balance vgroup leader' 2023-03-22 09:53:56 +08:00
cadem ea35f0ae11 feat/balance vgroup leader 2023-03-22 09:36:59 +08:00
Xiaoyu Wang 4c8bab7e58 merge main 2023-03-08 10:59:33 +08:00
Xiaoyu Wang df0d200f59 feat: the compact command adds 'start with end with' clause 2023-03-07 15:24:04 +08:00
Xiaoyu Wang 599967d39f feat: add language clause for create function 2023-03-04 11:08:50 +08:00
Xiaoyu Wang 3382a24a69 merge main 2023-02-10 18:03:11 +08:00
Xiaoyu Wang fcff07675d merge main 2023-02-09 11:29:38 +08:00
Xiaoyu Wang 9bc225ffda merge 3.0 2023-02-09 09:44:29 +08:00
Xiaoyu Wang 09925437e3 merge main 2023-02-08 09:51:52 +08:00
Xiaoyu Wang a52371959e feat: add ignore update option for create stream 2023-02-07 19:31:08 +08:00
dapan1121 ef89a31e8f feat: force fill function 2023-02-03 15:37:04 +08:00
Xiaoyu Wang 9df6f69371 merge 3.0 2023-01-04 15:02:31 +08:00
Alex Duan 0c422345b3 feat: support show cluster alive; and show db.alive; 2022-12-29 18:07:57 +08:00
Xiaoyu Wang b52ebb6fd5 feat: sql command 'compact database' 2022-12-27 11:11:02 +08:00
Ganlin Zhao b1a1e49cb7 Merge branch '3.0' into feat/TS-2158 2022-12-19 17:03:34 +08:00
Xiaoyu Wang 4cfa6cea33 enh: tsma support first/last/count functions 2022-12-19 10:57:56 +08:00
Ganlin Zhao 09061bcc57 Merge branch '3.0' into feat/TS-2158 2022-12-19 09:23:32 +08:00
Xiaoyu Wang d3cb2a3a0a merge main 2022-12-18 20:36:06 +08:00
Ganlin Zhao 61cfca6eb9 feat(query): add _isfilled pseudocolumn to indicate data is origin
or filled.
2022-12-14 16:23:49 +08:00
Xiaoyu Wang 2f9753c540 event window query 2022-12-13 14:18:03 +08:00
Xiaoyu Wang b69725adaa enh: shielding database option 'strict' 2022-12-13 10:00:24 +08:00
Xiaoyu Wang bc413b8fff feat: add stream option 'delete_mark' 2022-12-06 16:07:11 +08:00
Xiaoyu Wang 4e8acca2eb feat: sql command 'show user privileges' 2022-11-30 19:24:15 +08:00
Xiaoyu Wang 38f20ec32d enh: show table tags command extension 2022-11-10 17:22:13 +08:00
Xiaoyu Wang ae4354c277 enh: add sql command 'drop dnode id force' 2022-10-31 10:30:54 +08:00
Xiaoyu Wang 02ac6fa552 enh: add unit test and delete useless code 2022-10-26 17:01:55 +08:00
Xiaoyu Wang 0fdce91b5a fix: wrong permissions of 'show variables' command 2022-10-24 16:34:10 +08:00
Xiaoyu Wang 947e9d6458 fix: some problems of parser 2022-10-12 10:16:29 +08:00
Xiaoyu Wang 73642ac3a2 feat: sql command 'show table tags from table_name' 2022-09-29 16:16:49 +08:00
Xiaoyu Wang 8caa36299c feat: add the _irowts pseudo column to output the timestamp of the interp 2022-09-27 15:23:24 +08:00
Xiaoyu Wang 1d62834e5c feat(stream): tag and child table name improvement 2022-09-26 18:39:47 +08:00
Xiaoyu Wang 50ebcb5006 feat: case when expression 2022-09-22 19:20:21 +08:00
Xiaoyu Wang 6cf578f299 feat: database option 'tsdb_pagesize' 2022-09-13 14:19:50 +08:00
Xiaoyu Wang ccaf6f8a78 feat: add database option 'table_prefix' and 'table_suffix' 2022-09-03 11:22:36 +08:00
Xiaoyu Wang 594e4b376e feat: sql command 'show vnodes' and database option 'sst_trigger' 2022-09-01 19:01:37 +08:00
Xiaoyu Wang 9a9aef985e enh: show command optimize 2022-08-11 20:26:40 +08:00
Xiaoyu Wang 4f0c6d3aa4 enh: show command optimize 2022-08-11 15:37:26 +08:00
Xiaoyu Wang f977117c6c fix: db options rename 2022-07-27 11:55:19 +08:00
Xiaoyu Wang 1ddbff0acf feat: add db options of wal 2022-07-25 21:09:06 +08:00
Xiaoyu Wang 7c585d8ed9 fix: database options 'strict' and 'cachelast' syntax adjustments 2022-07-16 11:47:26 +08:00
Xiaoyu Wang 43b5ca1efe feat: support pseudo columns such as _qstart, _qend and _qduration 2022-07-13 15:13:01 +08:00
Xiaoyu Wang 0bc700eb82 feat: sql command 'trim database' 2022-07-11 10:53:06 +08:00
Xiaoyu Wang 0bf399a67e merge 3.0 2022-07-06 18:53:54 +08:00
Xiaoyu Wang 025b7782e1 feat: add db option 'cachelastsize' 2022-07-06 18:47:33 +08:00
Xiaoyu Wang 78a237554d fix: compile error 2022-07-06 13:53:47 +08:00
Xiaoyu Wang c8508248e2 feat: sql command 'insert ... select' 2022-07-05 21:12:10 +08:00
Xiaoyu Wang 1530b33991 feat: support 'select *, expr from ...' syntax 2022-06-30 16:16:05 +08:00
Xiaoyu Wang ae076af4f1 feat: sql system info function 'database()', 'client_version()', 'server_version()', 'server_status()', 'current_user()' and 'user()' 2022-06-29 11:41:32 +08:00
Xiaoyu Wang 4fcd667bf6 feat: sql command 'show consumers' and 'show subscriptions' 2022-06-23 18:03:15 +08:00
Xiaoyu Wang a5ca4965a4 feat: some sql syntax adjustments 2022-06-22 16:35:14 +08:00
Xiaoyu Wang bac6e27c20 feat: sql command 'interp' 2022-06-19 19:39:12 +08:00
Xiaoyu Wang 22d1422b49 feat: sql command 'show table distributed' 2022-06-18 18:37:18 +08:00
Xiaoyu Wang 48f730fbcf feat: the sql command 'create dnode' is compatible with the 2.x version syntax 2022-06-18 14:49:36 +08:00
Xiaoyu Wang a06b329bee feat: sql command 'show create database', 'show create table', 'show create stable' and 'alter local' 2022-06-17 21:16:13 +08:00
Xiaoyu Wang aea4f9c69b feat: rollup options adjust 2022-06-17 17:27:42 +08:00
Xiaoyu Wang 19ab15b19f feat: super table join 2022-06-15 13:49:29 +08:00
Xiaoyu Wang 380a071551 fix: handle the memory leak of parser 2022-06-13 14:54:38 +08:00
Xiaoyu Wang 46bac2f579 fix: a problem of interval distributed split 2022-06-10 14:28:58 +08:00
Xiaoyu Wang 2bf16fbf43 feat: vgroup manage command 2022-06-07 15:02:41 +08:00
Xiaoyu Wang 6dc64627cd feat: vgroup manage command 2022-06-07 11:53:32 +08:00
Xiaoyu Wang 74026205a7 feat: sql command 'delete from' 2022-06-04 19:54:55 +08:00
Liu Jicong c3296fe890 merge from 3.0 2022-05-31 16:44:27 +08:00
Xiaoyu Wang 44b00ed346 fix: error in data precision of super table query 2022-05-31 15:12:31 +08:00
Xiaoyu Wang ce166fb146 fix: error in data precision of super table query 2022-05-31 15:07:15 +08:00
Xiaoyu Wang fdd00a6582 feat: sql command 'create topic as {database | stable| query}' 2022-05-30 11:59:23 +08:00
Xiaoyu Wang 070f60409b feat: sql command 'drop cgroup' 2022-05-25 21:20:11 +08:00
Xiaoyu Wang 6e50691b29 feat: sql command 'grant', 'revoke', 'kill transaction' and 'show transactions' 2022-05-07 17:37:17 +08:00
Xiaoyu Wang 6d449c8224 enh: refactor db and table options 2022-04-27 18:18:37 +08:00
Xiaoyu Wang 20879d0ef7 fix: some syntax parsing problems 2022-04-22 18:23:37 +08:00
Xiaoyu Wang 6f377189d0 feat: sql command 'create function' 2022-04-20 17:43:02 +08:00
Xiaoyu Wang 5dea946bd4 feat: sql command 'create table ... rollup ...' 2022-04-20 14:05:08 +08:00
Ganlin Zhao ad7323166a Merge branch '3.0' into feature/TD-14243 2022-04-16 12:51:49 +08:00
Xiaoyu Wang e2164bf8cb feat: CREATE STREAM statement implement, and syntax of JSON data type implement. 2022-04-15 19:35:46 +08:00
Xiaoyu Wang ba1f3f7815 feat: CREATE STREAM statement implement, and syntax of JSON data type implement. 2022-04-15 18:30:01 +08:00
Ganlin Zhao e655a3cc1d feat(query): support timezone() function
TD-14243
2022-04-15 13:15:29 +08:00
Ganlin Zhao 0439e4f9f7 Merge branch '3.0' into feature/TD-14243 2022-04-15 10:16:55 +08:00
Xiaoyu Wang 7efb34fdfa enh(query): increase the validity check of function parameters 2022-04-14 15:53:41 +08:00
Xiaoyu Wang 8118a20649 enh(query): increase the validity check of function parameters 2022-04-14 15:49:57 +08:00
Ganlin Zhao 8572bd2afa feat(query): add TK_TODAY in keyword hashtable
TD-14243
2022-04-13 21:22:57 +08:00
Xiaoyu Wang d8762d401f feat(query): child table or normal table support JOIN-clause 2022-04-12 20:02:16 +08:00
Xiaoyu Wang a6b5dd8ef0 create/drop/show bnode/snode/mnode frontend implement 2022-04-09 14:57:28 +08:00
Xiaoyu Wang 07892f0f62 sort plan bugfix 2022-04-07 19:28:00 +08:00
Xiaoyu Wang a7aa815215 db/table options adjust 2022-04-07 18:19:20 +08:00
Xiaoyu Wang 9e9805f7b7 condition bugfix 2022-04-02 01:13:20 -04:00
Xiaoyu Wang 4ff2ad2c39 all ddl statement syntax define, and ORDER BY clause bugfix 2022-04-01 04:31:24 -04:00
Xiaoyu Wang db08d3ca9b TD-14392 bugfix 2022-03-31 22:38:48 -04:00
Xiaoyu Wang ba80c7478f TD-14405 TD-14404 desc and reset query cache statement implement 2022-03-31 02:19:11 -04:00
Xiaoyu Wang 03771c84f5 TD-14396 explain parser and planner implement 2022-03-30 02:50:50 -04:00
Xiaoyu Wang e7a54cfa39 TD-14330 bugfix 2022-03-29 04:04:04 -04:00
Xiaoyu Wang a0ef66528c sort bugfix, and pseudo column implement 2022-03-28 07:26:06 -04:00
Xiaoyu Wang 11636180ad rollup syntax and msg adjust 2022-03-28 05:08:48 -04:00
Xiaoyu Wang 9ca80596e4 merge 3.0 2022-03-21 02:00:30 -04:00
Xiaoyu Wang 1ee1691ae1 logic plan code reorganize 2022-03-17 22:28:21 -04:00
Xiaoyu Wang 4e0b56324a TD-13675 rollup, alter db, alter table syntax definition 2022-03-16 07:28:40 -04:00
Xiaoyu Wang f8f7aabfd9 TD-13597 create/drop topic, alter database, drop index, drop qnode statement implement 2022-03-16 02:08:59 -04:00
Xiaoyu Wang 4281664e03 TD-14068 create qnode implement 2022-03-15 08:04:52 -04:00
Xiaoyu Wang eae2d7b661 TD-13675 create sma index grammar 2022-03-15 04:00:09 -04:00
Xiaoyu Wang b2291cb4f3 TD-14043 show dnodes/mnodes/modules/qnodes/user_functions/user_indexes/user_stables/user_tables/user_streams/user_users/vgroups rewirte 2022-03-13 23:45:24 -04:00
Xiaoyu Wang 54e15db2f5 TD-13747 show mnodes 2022-03-10 21:02:47 -05:00
Xiaoyu Wang f88de49f55 TD-13881 implement create/alter/drop/show user, create/drop/show dnode, drop database, show stables and drop table 2022-03-07 07:18:05 -05:00
Xiaoyu Wang 08fb912aad TD-13852 create super table implement 2022-03-05 18:12:08 -05:00
Xiaoyu Wang 92cd252b70 TD-13706 integration create table stmt and insert stmt 2022-03-04 05:43:23 -05:00
Xiaoyu Wang 441db317fd TD-13706 client modify vnode process integration 2022-03-03 07:25:16 -05:00
Xiaoyu Wang db8669a3ce TD-13037 merge 3.0 2022-02-28 21:40:50 -05:00
Xiaoyu Wang 195ff4f52f TD-13705 parser integrate and CREATE DATABASE implement 2022-02-28 21:13:22 -05:00
Shengliang Guan 5101c0571f minor changes 2022-02-28 17:39:07 +08:00
Xiaoyu Wang 2624a81a30 TD-13495 planner refactoring 2022-02-12 18:47:47 -05:00
Xiaoyu Wang 59ebc0a1bc TD-13338 SELECT statement translate code 2022-02-07 05:13:10 -05:00
Xiaoyu Wang 55bb9cce20 TD-13197 SELECT statement syntax definition 2022-01-27 11:28:13 -05:00
Xiaoyu Wang 45c4099e99 TD-13197 SELECT statement syntax definition 2022-01-27 01:32:40 -05:00
Xiaoyu Wang d5107df7ed TD-13120 SELECT statement syntax definition 2022-01-23 22:29:46 -05:00
Xiaoyu Wang 573cbff2ca TD-13120 SELECT statement syntax definition 2022-01-23 07:34:16 -05:00
Haojun Liao c4bd887e63 [td-11818]support create child table. 2021-12-28 20:03:41 +08:00
Shengliang Guan d20aa8f8f3 [TD-10430] check util and common files 2021-10-04 20:42:53 +08:00
Shengliang Guan 140ec7c8aa [TD-10430] adjust util and common module 2021-10-04 12:09:50 +08:00