Commit Graph

112 Commits

Author SHA1 Message Date
dapan1121 3045a623e1 Merge remote-tracking branch 'origin/3.0' into feat/TD-24700 2023-08-17 14:16:05 +08:00
Ganlin Zhao 01a7dfbc34 feat: add irate distributed execution 2023-08-15 12:59:30 +08:00
dapan1121 9f0da17c49 Merge remote-tracking branch 'origin/3.0' into feat/TD-24700 2023-06-28 19:40:55 +08:00
dapan1121 4dae9f4eff merge main to 3.0 2023-06-26 18:43:00 +08:00
dapan1121 ce2635074d enh: add uid/vgid functions 2023-06-26 11:48:47 +08:00
dapan1121 170182fecd feat: support fill history with sub request 2023-06-12 16:10:54 +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 0dd0b16842 enh: optimize table scan for last query 2023-05-12 13:30:17 +08:00
Ganlin Zhao 7414f28d17 fix translatefunc not getting precision issue 2023-04-13 11:22:15 +08:00
54liuyao ffa59f69aa fix:add combine function for groupKey 2023-03-23 15:20:45 +08:00
Xiaoyu Wang 09925437e3 merge main 2023-02-08 09:51:52 +08:00
shenglian zhou 3f577c5019 fix: show table distributed only works on super table, child table, and normal table 2023-02-02 11:57:22 +08:00
Ganlin Zhao 5da2fe9bc5 feat(query): add _isfilled pseudocolumn to indicate data is origin
or filled.
2022-12-14 16:56:10 +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
Haojun Liao 03f4918b3b refactor: do some internal refactor. 2022-11-04 18:46:48 +08:00
Xiaoyu Wang 1b179f65b2 fix: interp _irowts error 2022-11-01 13:34:10 +08:00
Xiaoyu Wang 0228caaa0d enh: last cache optimize 2022-10-18 11:38:59 +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 2ccc7471af enh: query get dbcfg optimization 2022-08-31 11:36:59 +08:00
Ganlin Zhao c017e4387f fix(query): forbid interp in super table query
TD-18331
2022-08-11 16:17:38 +08:00
shenglian zhou 03aae25b63 fix: function rename and trigger ci test 2022-08-07 06:39:26 +08:00
shenglian zhou 81d3a2c385 fix: last/first must return not null values 2022-08-06 21:39:53 +08:00
Ganlin Zhao b0becf1ca9 fix(query): fix n-1 function if select column after function position
result row is incorrect.

fix/TD-18040
2022-08-01 14:15:16 +08:00
Xiaoyu Wang 41b8ef7d93 enh: cumulative functions support mixed use 2022-07-29 18:00:48 +08:00
Xiaoyu Wang b12fa7494e enh: add interface for dynamic control data scan 2022-07-27 18:28:54 +08:00
Xiaoyu Wang 958f3586c0 fix: the problem of data loss when interval is used for outer query 2022-07-22 11:41:18 +08:00
Xiaoyu Wang aec4c2313a fix: multi-rows function validity check 2022-07-15 16:17:00 +08:00
Haojun Liao 707f0a837a fix(query): set correct fill output object. 2022-07-14 20:11:29 +08:00
Xiaoyu Wang 4830b7d9d3 feat: support pseudo columns such as _qstart, _qend and _qduration 2022-07-13 18:12:02 +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 e235c9830d merge 3.0 2022-07-01 13:35:07 +08:00
Xiaoyu Wang 8a8939f99c fix: csum/diff/mavg support subquery 2022-07-01 13:31:22 +08:00
Ganlin Zhao 1dd89be98b enh(query): add last_row function without cache
TD-16927
2022-06-30 17:39:20 +08:00
Ganlin Zhao 860bf88f31 feat(query): add last_row function without cache
TD-16927
2022-06-30 17:20:04 +08:00
Xiaoyu Wang 99563fc136
Merge pull request #14376 from taosdata/feature/3.0_debug_wxy
feat: the last_row function supports all scenes
2022-06-30 11:28:53 +08:00
Xiaoyu Wang cf35174d53 feat: the last_row function supports all scenes 2022-06-30 10:23:35 +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
Ganlin Zhao f8bb36ce2c enh(query): add _group_key function for partion by
TD-16805
2022-06-24 20:08:07 +08:00
Xiaoyu Wang 4fcd667bf6 feat: sql command 'show consumers' and 'show subscriptions' 2022-06-23 18:03:15 +08:00
Xiaoyu Wang 45a806f789 feat: sql function 'last_row' 2022-06-21 19:52:26 +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 e224d40480 feat: the unique function and tail function are rewritten as the corresponding clauses 2022-06-16 16:58:55 +08:00
Haojun Liao 771065952e other: merge 3.0 2022-06-15 16:32:28 +08:00
Ganlin Zhao cd94eabc73 add stddev function translate partial/merge 2022-06-14 16:42:05 +08:00
Ganlin Zhao 4113472e89 add avg function translate partial/merge 2022-06-14 15:00:28 +08:00
Haojun Liao 531b85ce22 enh(query): add interp function. 2022-06-14 11:54:13 +08:00
Ganlin Zhao 589b30422f add last function splitting 2022-06-14 10:51:00 +08:00
Ganlin Zhao 9fa641a8b0 Merge branch '3.0' into enh/first_last_split 2022-06-14 10:50:50 +08:00