Commit Graph

216 Commits

Author SHA1 Message Date
dapan1121 ce2635074d enh: add uid/vgid functions 2023-06-26 11:48:47 +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
Haojun Liao 7ef16e1922 other: merge main. 2023-05-12 11:49:53 +08:00
Haojun Liao 17a5691afb refactor: remove assert. 2023-04-27 15:37:33 +08:00
kailixu 77a8e3b213 Merge branch '3.0' into enh/TD-21161-3.0 2023-04-21 16:04:09 +08:00
Ganlin Zhao 9581dcae7f enh: add param for to_unixtimestamp to return timestamp type 2023-04-18 14:17:22 +08:00
kailixu e976fcb91d Merge branch '3.0' into enh/TD-21161-3.0 2023-04-07 17:51:35 +08:00
Xiaoyu Wang c134432c45 merge main 2023-04-06 09:31:45 +08:00
Ganlin Zhao 23ec9287c9 fix: fix tsim crash on windows due to invalid input to strftime 2023-04-04 10:33:41 +08:00
Ganlin Zhao 6c64b760a0 fix: fix tsim crash on windows due to invalid input to strftime 2023-04-03 17:58:43 +08:00
kailixu 37bc1bca36 enh: column/row max length support up to 64K 2023-04-03 17:00:52 +08:00
dapan1121 22ad3129b9 fix: query schema is old issue 2023-03-28 15:21:47 +08:00
t_max b2610da03c fix: TIMETRUNCATE with 1d return unexpected result 2023-03-09 14:29:05 +08:00
Haojun Liao 7fe250412f refactor:do some internal refactor. 2023-02-20 10:13:11 +08:00
Haojun Liao 8d187efc18 refactor:do some internal refactor. 2023-02-20 10:04:08 +08:00
Ganlin Zhao 0ddb9be3d9 fix assert in sclfunc.c 2023-01-03 15:47:22 +08:00
Shengliang Guan 6d94afe48f
Revert "refact: adjust some assert cases" 2022-12-07 21:51:17 +08:00
Shengliang Guan d5126d469a refact: replcase ASSERT with tAssert 2022-12-07 18:42:48 +08:00
Shengliang Guan f69a188f7e refact: replcase ASSERT with tAssert 2022-12-07 18:37:40 +08:00
Ganlin Zhao e18da31a5d enh(query): add timetruncate function ignore timezone option for 1d 2022-12-05 12:00:12 +08:00
Ganlin Zhao dff0b3c4bb fix: [ASAN] heap buffer overflow in sclfunc.c 2022-11-23 22:43:11 +08:00
Ganlin Zhao 4f176e325d fix: [ASAN] devive by zero 2022-11-21 18:01:48 +08:00
Ganlin Zhao cf601b206f fix(query): ASAN heap buffer overflow
TD-20454
2022-11-16 15:00:57 +08:00
Ganlin Zhao aae3475900 fix(query): ASAN heap buffer overflow
TD-20454
2022-11-16 14:36:51 +08:00
Ganlin Zhao 652c6388f2 fix: fix valgrind invalid read error 2022-11-09 16:40:17 +08:00
Haojun Liao 03f4918b3b refactor: do some internal refactor. 2022-11-04 18:46:48 +08:00
Ganlin Zhao 3a4dc8f0da Merge branch '3.0' into fix/coverity_glzhao 2022-10-25 09:47:46 +08:00
Ganlin Zhao 23b7150dee fix: coverity issues
CID: 399845
2022-10-24 19:20:10 +08:00
Haojun Liao ae625d3199 refactor: remove redundant codes and do some internal refactor. 2022-10-19 22:33:15 +08:00
Hongze Cheng d8e32fb439 more code format 2022-10-13 14:03:23 +08:00
Shengliang Guan 5a8172d6c2
Merge pull request #17298 from taosdata/fix/glzhao_coverity
fix: fix coverity issues
2022-10-11 18:51:52 +08:00
Ganlin Zhao 37a9143fcb fix: coverity issues
CID: 400170
2022-10-11 14:33:10 +08:00
Haojun Liao 187735dede fix(query): fix the invalid write. 2022-10-11 10:49:19 +08:00
Haojun Liao 2dcb5a9c29 fix(query): fix an typo. 2022-10-10 22:00:36 +08:00
Haojun Liao 73b5a001d6 fix(query): fix invalid type convert in cast function. 2022-10-10 19:15:52 +08:00
Ganlin Zhao c4aa94b236 fix(query): fix nested query length(ltrim/rtrim) result incorrect
TD-18388
2022-08-15 14:07:17 +08:00
Haojun Liao 24218752ab refactor: optimize tablescan perf. 2022-08-01 16:41:14 +08:00
Haojun Liao a2a2dbd68a refactor: optimize the build block perf. 2022-08-01 13:11:32 +08:00
dapan1121 741f8f7e55 fix: remove filter ut 2022-07-23 14:55:12 +08:00
Ganlin Zhao 4dbb2debc0 fix(query): fix memory leak in histogram param validation
TD-17598
2022-07-20 14:54:40 +08:00
afwerar fa96e64ee0 os: win format negative timestamp error 2022-07-18 16:53:20 +08:00
Ganlin Zhao 5b12fcb3a1 feat(query): add selective function scalar version 2022-07-18 15:23:28 +08:00
Ganlin Zhao 75371098a6 refactor 2022-07-18 15:14:20 +08:00
Ganlin Zhao a4d86275d2 feat(query): add first/last/last_row scalar version 2022-07-18 15:06:21 +08:00
Ganlin Zhao a80027736d feat(query): add top/bottom function scalar version 2022-07-18 14:47:53 +08:00
Ganlin Zhao e37bdbd5c9 feat(query): add histogram function scalar version
TD-17344
2022-07-18 13:37:18 +08:00
Ganlin Zhao 107cb15dbd feat(query): add stateduration function scalar version 2022-07-17 22:52:40 +08:00
Ganlin Zhao 810be53374 fix(query): fix state operator check 2022-07-16 17:01:44 +08:00
Ganlin Zhao 3bcd669fcd feat(query): add statecount function scalar version 2022-07-16 16:46:03 +08:00
Ganlin Zhao 790cecf123 feat(query): add diff function scalar version 2022-07-16 15:04:45 +08:00