Commit Graph

33 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
Ganlin Zhao 49fc02c52e fix coverity issue 2023-02-24 10:08:53 +08:00
Ganlin Zhao 4b81962269 fix asserts 2023-01-04 09:16:00 +08:00
Xiaoyu Wang dc0d3745a7 enh: fill value supports implicit type conversion 2022-11-17 15:48:42 +08:00
Haojun Liao 5dcfaf3bd6 refactor: remove redundant codes. 2022-10-19 18:00:15 +08:00
Ganlin Zhao 16fb3525aa fix: coverity issues
CID: 399527
2022-10-17 18:37:16 +08:00
Ganlin Zhao 7e54b77024 fix: coverity issues
CID: 354728
2022-10-17 15:20:36 +08:00
Ganlin Zhao 2abd0eec40 fix: coverity issues
CID: 354727
2022-10-17 15:03:01 +08:00
Ganlin Zhao 84817bf743 fix: coverity issues
CID: 354715
2022-10-17 12:48:14 +08:00
Xiaoyu Wang cc1d37cfe5 fix: some problems of parser 2022-08-29 17:23:29 +08:00
wangmm0220 085ace59e0 fix:to_json() function 2022-07-01 16:47:54 +08:00
afwerar 51721dfc47 fix(os): win run error 2022-05-19 10:37:11 +08:00
Xiaoyu Wang 41e36dddb7 fix: some problems of parser 2022-05-11 19:03:59 +08:00
wangmm0220 32577d4196 refactor: add json tag function for sql parser 2022-04-14 18:24:21 +08:00
Ganlin Zhao a59b558331 feat(query): add cast function
TD-14242
2022-04-11 20:22:53 +08:00
Ganlin Zhao 772a5d114a [TD-14525]<fix>: fix taosd crash if scalar function has constant param 2022-04-07 10:30:41 +08:00
Ganlin Zhao cd972fdb00 [TD-14525]<fix>: fix taosd crash if scalar function has constant param 2022-04-07 10:26:18 +08:00
dapan1121 398a41d09b feature/qnode 2022-04-06 15:20:38 +08:00
afwerar 222db126bc [TD-13758]<fix>: redefine memory api. 2022-03-26 00:29:53 +08:00
afwerar 159c2671a2 [TD-13767]<fix>: forbid wchar_t. 2022-03-18 16:48:12 +08:00
afwerar 394178da68 [TD-13767]<fix>: only use iconv. 2022-03-18 13:23:48 +08:00
Xiaoyu Wang 08fb912aad TD-13852 create super table implement 2022-03-05 18:12:08 -05:00
Xiaoyu Wang 213793be49 TD-13747 merge 3.0 2022-03-02 04:24:59 -05:00
Shengliang Guan 175cbfb82d common 2022-02-28 17:46:02 +08:00
Haojun Liao c4bd887e63 [td-11818]support create child table. 2021-12-28 20:03:41 +08:00
Xiaoyu Wang 5e981e43ad TD-11819 Parsing insert statement and assembling binary objects. 2021-12-09 03:39:15 -05:00
Haojun Liao 86b6c42ce9 [td-10564] refactor and add test cases. 2021-10-29 11:22:23 +08:00
Haojun Liao eba7327888 [td-10564] add more code for query module. 2021-10-11 15:49:10 +08:00
Haojun Liao 1d5f98fe6a [td-10529]Add unit test for parser module. 2021-10-09 14:01:56 +08:00
Haojun Liao 77094cc5ab [td-10529]fix compiler error. 2021-10-08 21:52:18 +08:00
Haojun Liao 819c7fc030 [td-10529] fix compiler error 2021-10-08 20:33:46 +08:00
Shengliang Guan 140ec7c8aa [TD-10430] adjust util and common module 2021-10-04 12:09:50 +08:00
Shengliang Guan c0a171b144 [TD-10430] adjust os module 2021-10-03 10:32:14 +08:00