Commit Graph

65 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
yihaoDeng 349dd69f94 fix compile error 2022-09-08 22:50:50 +08:00
yihaoDeng ca7ca2f1e3 refactor code 2022-07-14 19:23:01 +08:00
yihaoDeng a9e64f2938 feat: add lru to index 2022-07-14 15:17:05 +08:00
yihaoDeng cace9b6be9 feat: add lru to index 2022-07-14 14:51:39 +08:00
yihaoDeng 4b0e8a3919 feat: refactor index code 2022-06-30 20:00:46 +08:00
yihaoDeng eab330c092 enh: refactor index code 2022-06-09 15:14:11 +08:00
yihaoDeng dcc78597bf refactor index code 2022-06-08 21:51:28 +08:00
yihaoDeng 16f8450bbc update test case 2022-06-05 19:44:44 +08:00
afwerar 7b540d91d9 fix(os): add win ctest 2022-05-28 21:08:50 +08:00
yihaoDeng 0b0253f2d1 enh: support tag filter 2022-05-28 17:30:44 +08:00
yihaoDeng 6acbe7e777 enh: support tag filter 2022-05-28 16:15:24 +08:00
yihaoDeng d067104ec1 fix: index memory error 2022-05-25 20:38:25 +08:00
yihaoDeng 8ef6eb4c5f enh: refactor index code 2022-05-24 15:17:14 +08:00
yihaoDeng 6ca5e3ae6e enh: opt index mutex 2022-05-24 13:50:33 +08:00
yihaoDeng f0da893bfb fix: avoid multi thread read/write crash 2022-05-23 21:59:47 +08:00
yihaoDeng fb4982f8ca merge 3.0 2022-05-22 21:41:55 +08:00
yihaoDeng 5a0e7dfa74 enh: refator index/transport code 2022-05-22 19:58:42 +08:00
afwerar 5acf419019 fix(os): win not close file ctest error 2022-05-21 23:47:39 +08:00
yihaoDeng 8f75b96ed4 enh: refator index/transport code 2022-05-21 23:33:39 +08:00
yihaoDeng af9abca851 enh: add UT to CI 2022-05-19 17:38:11 +08:00
yihaoDeng e08dd100a4 enh(index): support more data type 2022-05-06 18:39:28 +08:00
yihaoDeng dc6bdab4e4 enh(index): add prefix query 2022-05-03 21:56:05 +08:00
afwerar fc24521621 fix(os): windows compile 3.0. 2022-04-22 09:54:27 +08:00
yihaoDeng 5cf0c4a61c update code style 2022-03-29 23:11:57 +08:00
afwerar 222db126bc [TD-13758]<fix>: redefine memory api. 2022-03-26 00:29:53 +08:00
Yihao Deng d07b1d9b2c
Merge branch '3.0' into feature/index_oper 2022-03-11 11:48:29 +08:00
afwerar c6de196769 [TD-13765]<fix>: redefine rand api. 2022-03-10 00:36:30 +08:00
yihaoDeng 914b5387c3 make CI/CD happy 2022-03-08 15:07:35 +08:00
yihaoDeng a12bb2dbf0 add UT 2022-03-07 19:42:10 +08:00
yihaoDeng 744f676893 test 2022-03-07 12:27:09 +08:00
yihaoDeng 02507ddbfc add update index 2022-03-05 17:20:09 +08:00
Shengliang Guan 68f3de6111 remove tfile 2022-02-28 13:49:38 +08:00
yihaoDeng 6c0842fb05 add index test 2022-01-20 23:57:21 +08:00
yihaoDeng 2a17fa3948 add tfile analysis tool 2022-01-08 18:56:54 +08:00
yihaoDeng ccbbac4eef refactor code 2022-01-05 23:54:05 +08:00
yihaoDeng a75899024c add test case 2022-01-04 23:09:30 +08:00
yihaoDeng 49ef94fb69 refactor code 2022-01-04 22:58:52 +08:00
yihaoDeng 99379fd5a6 add test case 2022-01-04 20:56:55 +08:00
yihaoDeng 8279e49cb0 optimize read performace case 2022-01-04 20:18:15 +08:00
yihaoDeng cee5a2ecbe optimize tfile 2022-01-04 18:01:31 +08:00
yihaoDeng 4bdac1fdbf optimize tfile 2022-01-04 15:59:54 +08:00
yihaoDeng 4079bd2b55 refactor code 2022-01-04 15:14:12 +08:00
yihaoDeng c1a2366d67 refactor code 2022-01-03 22:28:01 +08:00
yihaoDeng 88ba5faec9 refactor code 2022-01-03 22:12:28 +08:00
yihaoDeng 40fc4b6cf3 fix mem leak and invalid read/write found by valgrind 2022-01-02 17:50:40 +08:00
yihaoDeng db474b2078 refactor code 2022-01-02 14:28:38 +08:00
yihaoDeng 9920b43be5 fix fst bug 2021-12-31 18:06:13 +08:00
yihaoDeng e309048513 handle read/write crash concurrently 2021-12-30 19:24:07 +08:00
yihaoDeng 236b8bc3c8 handle read/write crash concurrently 2021-12-30 17:03:00 +08:00