Commit Graph

102 Commits

Author SHA1 Message Date
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
slzhou f9da4abdcb fix: change more variable names 2023-05-19 15:38:52 +08:00
shenglian zhou f36b0be17d fix: join eq conditions not only for tag 2023-05-19 14:32:03 +08:00
shenglian zhou 629ab2b85f fix: extract tag equal condition 2023-05-15 16:10:11 +08:00
dapan1121 a1eefd25ea fix: count wrong group number issue 2023-05-09 11:33:47 +08:00
Xiaoyu Wang 5b7ec8ade5 fix: invalid write memory when query policy is 4 2023-02-28 10:41:13 +08:00
Xiaoyu Wang c597de099f merge main 2023-02-20 13:41:27 +08:00
Xiaoyu Wang de92def988 fix: query compatible with lower version messages 2023-02-13 15:25:00 +08:00
Xiaoyu Wang 3382a24a69 merge main 2023-02-10 18:03:11 +08:00
Xiaoyu Wang 98e2fa2d7b feat: add ignore update option for create stream 2023-02-08 18:46:12 +08:00
Xiaoyu Wang 8b6a50d970 feat: add explain test case 2023-02-07 18:35:42 +08:00
Xiaoyu Wang fdde287ca9 merge main 2023-01-04 11:43:20 +08:00
Ganlin Zhao b55af6372c fix(query): fix count/hyperloglog return additional row in group by
when queryPolicy is set to 3.
2022-12-28 17:28:40 +08:00
Shengliang Guan 664dcb6b4e Merge branch 'main' into merge/mainto3.0_1226 2022-12-26 09:26:54 +08:00
dapan1121 978d45ffc1 enh: optimize converting timestamp at client side 2022-12-15 16:56:35 +08:00
Xiaoyu Wang 2f9753c540 event window query 2022-12-13 14:18:03 +08:00
Xiaoyu Wang bc413b8fff feat: add stream option 'delete_mark' 2022-12-06 16:07:11 +08:00
slzhou 259b893f0a fix: integration test of table count scan 2022-11-30 15:42:45 +08:00
Xiaoyu Wang 555f2cb981 merge 3.0 2022-11-29 13:16:54 +08:00
Xiaoyu Wang 70164f9f20 enh: group by tbname optimize 2022-11-24 15:16:38 +08:00
Xiaoyu Wang 40c7562470 enh: optimize statement for querying the number of sub tables of the super table 2022-11-15 16:38:51 +08:00
Xiaoyu Wang e8c0515dce enh: flag of whether the subplan is added as a show statement 2022-10-28 10:46:04 +08:00
Haojun Liao abff4fb1f2
Merge pull request #17336 from taosdata/feature/3_liaohj
other:merge 3.0, and support last query cache
2022-10-20 18:15:38 +08:00
Xiaoyu Wang 601f0f3edf fix: handle coverity scan 2022-10-19 13:56:39 +08:00
Haojun Liao aa9c99fa53 Merge branch '3.0' into feature/3_liaohj 2022-10-16 12:50:05 +08:00
Xiaoyu Wang 242a53c285 enh: do coverity scan 2022-10-13 17:03:40 +08:00
Xiaoyu Wang 3cce178721 enh: do coverity scan 2022-10-13 16:43:56 +08:00
Haojun Liao 18740e7b48 other:merge 3.0, and support last query cache 2022-10-13 15:35:51 +08:00
Xiaoyu Wang 5d0357fc47 fix: very long string serialization problem 2022-09-29 11:14:35 +08:00
54liuyao 747297bd28 feat(stream): stream fill 2022-09-27 18:11:44 +08:00
Xiaoyu Wang 1d62834e5c feat(stream): tag and child table name improvement 2022-09-26 18:39:47 +08:00
Shengliang Guan 778aa44fc2
Merge pull request #17018 from taosdata/fix/3.0_bugfix_wxy
fix: subplans under set operator use different group ids
2022-09-23 14:03:05 +08:00
Xiaoyu Wang ee9190e9c0 fix: subplans under set operator use different group ids 2022-09-23 11:26:03 +08:00
Xiaoyu Wang 50ebcb5006 feat: case when expression 2022-09-22 19:20:21 +08:00
Xiaoyu Wang d1d55f4e78 enh: physical plan serialization supports cross-platform 2022-09-19 16:50:00 +08:00
Xiaoyu Wang 74f75893ea enh: physical plan serialization supports cross-platform 2022-09-19 15:56:14 +08:00
Xiaoyu Wang 70bc3e6984 enh: plan serialization optimize 2022-09-19 14:21:41 +08:00
Shengliang Guan 755a175118
Merge pull request #16874 from taosdata/enh/3.0_plan_msg
enh: plan serialization optimize
2022-09-16 19:58:23 +08:00
Xiaoyu Wang 2992f50175 enh: plan serialization optimize 2022-09-16 10:10:24 +08:00
Xiaoyu Wang b9a2d3251c enh: plan serialization optimize 2022-09-15 22:45:03 +08:00
Xiaoyu Wang e2586979eb enh: the delete physical plan increases the timestamp interval of the actual deleted data 2022-09-14 17:51:21 +08:00
Xiaoyu Wang fbcef61d06 enh: add binary serialization method to node structure 2022-09-14 10:34:13 +08:00
Xiaoyu Wang 26a1bb437c enh: add binary serialization method to node structure 2022-09-13 16:53:26 +08:00
Xiaoyu Wang 82fcd22107 enh: add binary serialization method to node structure 2022-09-13 15:57:17 +08:00
Xiaoyu Wang f40d838fe7 enh: add binary serialization method to node structure 2022-09-13 15:07:31 +08:00
Xiaoyu Wang f32a17580c enh: add binary serialization method to node structure 2022-09-13 13:31:35 +08:00
Xiaoyu Wang ff9d673489 enh: add binary serialization method to node structure 2022-09-13 10:48:39 +08:00
Xiaoyu Wang d66bb918a4 enh: add binary serialization method to node structure 2022-09-09 08:30:45 +08:00
Xiaoyu Wang 3f5746d20b enh: add binary serialization method to node structure 2022-09-08 15:43:14 +08:00
Xiaoyu Wang e5aa7eeac6 enh: add binary serialization method to node structure 2022-09-07 16:48:54 +08:00
Xiaoyu Wang 5cfb023d01 enh: add binary serialization method to node structure 2022-09-06 17:26:37 +08:00
Xiaoyu Wang 983ac86a49 enh: add binary serialization method to node structure 2022-09-06 13:40:43 +08:00