Commit Graph

5755 Commits

Author SHA1 Message Date
347cceb530 [Feature](inverted index) push count on index down to scan node (#22687)
Co-authored-by: airborne12 <airborne12@gmail.com>
2023-09-02 22:24:43 +08:00
ace51358d0 [Enhance](ip)optimize priority_ network matching logic (#23784)
If the user has configured the wrong priority_network, direct startup failure to avoid users mistakenly assuming that the configuration is correct
If the user has not configured p_ n. Select only the last IP from the IPv4 list, rather than selecting from all IPs, to avoid users' servers not supporting IPv4
2023-09-02 21:24:11 +08:00
e9104765ea [fix](doc) modify the document error,about outfile (#22475) 2023-09-02 21:14:59 +08:00
45414db1ba [enhancement](table-meta) flush column unique ids for tables before 1.2 automatically (#23616) 2023-09-02 14:56:48 +08:00
de8fa2cff5 [Fix](thrift) Add fe master check in some thrift calls (#23757)
Signed-off-by: Jack Drogon <jack.xsuperman@gmail.com>
2023-09-02 14:05:31 +08:00
f1c354e0cf [improvement](colocate table) forbit change colocate table's replica allocation (#23064) 2023-09-02 13:54:25 +08:00
bbc893c953 [Enhancement](binlog) Add ModifyPartition, BatchModifyPartitions && ReplacePartitionOperationLog support (#23773) 2023-09-02 13:19:07 +08:00
228f0ac5bb [Feature](Multi-Catalog) support query doris bitmap column in external jdbc catalog (#23021) 2023-09-02 12:46:33 +08:00
68aa4867b0 [fix](map_agg) lost scale information for decimal type (#23776) 2023-09-02 08:03:33 +08:00
b3ccc53f24 [improvement](profile)Add workload group in audit log and profile (#23761) 2023-09-02 01:09:23 +08:00
6630f92878 [Enhancement](Load) stream tvf support json (#23752)
stream tvf support json

[{"id":1, "name":"ftw", "age":18}]
[{"id":2, "name":"xxx", "age":17}]
[{"id":3, "name":"yyy", "age":19}]
example:

curl -v --location-trusted -u root: -H "sql: insert into test.t1(c1, c2) select id, name from http_stream(\"format\" = \"json\", \"strip_outer_array\" = \"true\", \"read_json_by_line\" = \"true\")" -T /root/json_file.json http://127.0.0.1:8030/api/_http_stream
2023-09-02 01:09:06 +08:00
75e2bc8a25 [function](bitmap) support bitmap_to_base64 and bitmap_from_base64 (#23759) 2023-09-02 00:58:48 +08:00
295ea482a1 [improvement](log) optimize template function log for performance (#23746)
change log level to debug and use format in template function log for performance.
2023-09-01 19:02:33 +08:00
0b94eee4c7 [fix](rest)query_info returns empty rows #23595 2023-09-01 18:50:49 +08:00
797d9de192 [fix](Nereids) When col stats is Unknow, not expression should return the stats with selectivity of 1 2023-09-01 17:36:31 +08:00
e3bbba82cf [Fix](planner) fix to_date failed in create table as select (#23613)
Problem:
when create table as select using to_date function, it would failed

Example:
create table test_to_date properties('replication_num' = '1') as select to_date('20230816') as datev2;

Reason:
after release version 2.0, datev1 is disabled, but to_date function signature does not upgrade, so it failed when checking return type of to_date

Solved:
when getfunction, forbidden to_date with return type date_v1, datetime v1 also changed to datetime v2 and decimal v2 changed to decimal v3
2023-09-01 17:28:40 +08:00
b5232ce0d7 [fix](nereids) NormalizeAggregate may push redundant expr to child project node (#23700)
NormalizeAggregate may push exprs to child project node. We need make sure there is no redundant expr in the pushed down expr list. This pr use 'Set' to make sure of that.
2023-09-01 17:16:10 +08:00
e3886bcf2a [fix](tablet sheduler) change sched period back to 1s (#23573)
This reverts commit 285bf978442fdff65fda5264ff40bd8291954ef2.

* change tablet sched peroid back to 1s
2023-09-01 15:29:59 +08:00
9d2fc78bd5 [fix](cooldown) Fix potential data loss when clone task's dst tablet is cooldown replica (#17644)
Co-authored-by: Yongqiang YANG <98214048+dataroaring@users.noreply.github.com>
Co-authored-by: Kang <kxiao.tiger@gmail.com>
2023-09-01 15:27:52 +08:00
b843b79ddc [fix](tablet clone) fix tablet sched ctx toString cause null exeption (#23731) 2023-09-01 15:05:28 +08:00
Pxl
0e9dd348fb [Improvment](materialized-view) add short circuit for selectBestMV #23743 2023-09-01 14:46:54 +08:00
5b2360e836 [opt](planner) speed up computeColumnsFilter on ScanNode (#23742)
computeColumnsFilter compute filter on all table base schema's column.
However, it table is very wide, such as 5000 columns. It will take a
long time. This PR compare conjuncts size and columns size. If conjuncts
size is small than columns size, then collect slots from conjuncts to
avoid traverse all columns.
2023-09-01 14:22:17 +08:00
e88c218390 [Improve](Job)Job internal interface provides immediate scheduling (#23735)
Delete meaningless job status
System scheduling is executed in the time wheel
Optimize window calculation code
2023-09-01 12:50:08 +08:00
d96bc2de1a [enhance](policy) Support to change table's storage policy if the two policy has same resource (#23665) 2023-09-01 11:25:27 +08:00
d6450a3f1c [Fix](statistics)Fix external table auto analyze bugs (#23574)
1. Fix auto analyze external table recursively load schema cache bug.
2. Move some function in StatisticsAutoAnalyzer class to TableIf. So that external table and internal table could implement the logic separately. 
3. Disable external catalog auto analyze by default, could open it by adding catalog property "enable.auto.analyze"="true"
2023-09-01 10:58:14 +08:00
9a7e8b298a [Improvement](statistics)Show column stats even when error occurred (#23703)
Before, show column stats will ignore column with error.
In this pr, when min or max value failed to deserialize, show column stats will use N/A as value of min or max, and still show the rest stats. (count, null_count, ndv and so on).
2023-09-01 10:57:37 +08:00
b93a1a83a5 [opt](Nereids) let keywords list same with legacy planner (#23632) 2023-09-01 10:24:30 +08:00
hzq
16d6357266 [fix] (mac compile) Fix mac compile error & fe start time related (#23727)
Fix of PR #23582

Some Fe codes are deleted by [Improvement](pipeline) Cancel outdated query if original fe restarts #23582 , need to be added back;
Fix mac build failed caused by wrong thrift declaration order.
2023-09-01 08:02:30 +08:00
52e645abd2 [Feature](Nereids): support cte for update and delete statements of Nereids (#23384) 2023-08-31 23:36:27 +08:00
e680d42fe7 [feature](information_schema)add metadata_name_ids for quickly get catlogs,db,table and add profiling table in order to Compatible with mysql (#22702)
add information_schema.metadata_name_idsfor quickly get catlogs,db,table.

1. table  struct :   
```mysql
mysql> desc  internal.information_schema.metadata_name_ids;
+---------------+--------------+------+-------+---------+-------+
| Field         | Type         | Null | Key   | Default | Extra |
+---------------+--------------+------+-------+---------+-------+
| CATALOG_ID    | BIGINT       | Yes  | false | NULL    |       |
| CATALOG_NAME  | VARCHAR(512) | Yes  | false | NULL    |       |
| DATABASE_ID   | BIGINT       | Yes  | false | NULL    |       |
| DATABASE_NAME | VARCHAR(64)  | Yes  | false | NULL    |       |
| TABLE_ID      | BIGINT       | Yes  | false | NULL    |       |
| TABLE_NAME    | VARCHAR(64)  | Yes  | false | NULL    |       |
+---------------+--------------+------+-------+---------+-------+
6 rows in set (0.00 sec) 


mysql> select * from internal.information_schema.metadata_name_ids where CATALOG_NAME="hive1" limit 1 \G;
*************************** 1. row ***************************
   CATALOG_ID: 113008
 CATALOG_NAME: hive1
  DATABASE_ID: 113042
DATABASE_NAME: ssb1_parquet
     TABLE_ID: 114009
   TABLE_NAME: dates
1 row in set (0.07 sec)
```

2. when you create / drop catalog , need not refresh catalog . 
```mysql
mysql> select count(*) from internal.information_schema.metadata_name_ids\G; 
*************************** 1. row ***************************
count(*): 21301
1 row in set (0.34 sec)


mysql> drop catalog hive2;
Query OK, 0 rows affected (0.01 sec)

mysql> select count(*) from internal.information_schema.metadata_name_ids\G; 
*************************** 1. row ***************************
count(*): 10665
1 row in set (0.04 sec) 


mysql> create catalog hive3 ... 
mysql> select count(*) from internal.information_schema.metadata_name_ids\G;                                                                        
*************************** 1. row ***************************
count(*): 21301
1 row in set (0.32 sec)
```

3. create / drop table , need not refresh catalog .  
```mysql
mysql> CREATE TABLE IF NOT EXISTS demo.example_tbl ... ;


mysql> select count(*) from internal.information_schema.metadata_name_ids\G; 
*************************** 1. row ***************************
count(*): 10666
1 row in set (0.04 sec)

mysql> drop table demo.example_tbl;
Query OK, 0 rows affected (0.01 sec)

mysql> select count(*) from internal.information_schema.metadata_name_ids\G; 
*************************** 1. row ***************************
count(*): 10665
1 row in set (0.04 sec) 

```

4. you can set query time , prevent queries from taking too long . 
```

fe.conf :  query_metadata_name_ids_timeout 

the time used to obtain all tables in one database

```
5. add information_schema.profiling in order to Compatible with  mysql

```mysql
mysql> select * from information_schema.profiling;
Empty set (0.07 sec)

mysql> set profiling=1;                                                                                 
Query OK, 0 rows affected (0.01 sec)
```
2023-08-31 21:22:26 +08:00
b5e8217743 [opt](Nereids) speed up deepEquals of TreeNode (#23710) 2023-08-31 19:38:44 +08:00
3a34ec95af [FE](fucntion) add date_floor/ceil in FE function (#23539) 2023-08-31 19:26:47 +08:00
da5c78019c [opt](fe-ui) support read hardware info from aarch64 MacOS (#23708)
update the version of oshi and jna to support read hardware info from aarch64 MacOS
2023-08-31 18:16:33 +08:00
hzq
c083336bbe [Improvement](pipeline) Cancel outdated query if original fe restarts (#23582)
If any FE restarts, queries that is emitted from this FE will be cancelled.

Implementation of #23704
2023-08-31 17:58:52 +08:00
7379cdc995 [feature](nereids) support subquery in select list (#23271)
1. add scalar subquery's output to LogicalApply's output
2. for in and exists subquery's, add mark join slot into LogicalApply's output
3. forbid push down alias through join if the project list have any mark join slots.
4. move normalize aggregate rule to analysis phase
2023-08-31 15:51:32 +08:00
126606cb4d [Fix](cache) fix query cache returns wrong result after deleting partitions. (#23555)
The reason is that sql cache just use partitionKey , latestVersion and latestTime to check if the cache should be returned, if we delete some partition(s) which is not the latest updated partition, all above values are not changed, so the cache will hit.
Use a field to save the partition num of these tables and sum the partition nums and send it to BE, there are two situations which contains delete-partition ops:

- just delete some partition(s), so the sum of partition num will be lower than before.
- delete some partition(s) coexists with add some partition(s), so the latest time or latest version will be higher than before.
2023-08-31 14:22:52 +08:00
Pxl
f35ab37e1e [Bug](materialized-view) fix load db use analyzer to analyze diffrent metaindex (#23673)
fix load db use analyzer to analyze diffrent metaindex
2023-08-31 12:35:38 +08:00
41c5e00071 [fix](planner)fix bug of resolve column (#23512)
if resolve a inline view column failed, we try to resolve it again by removing the  table name. But it's wrong if the table name(may be the inlineview's alias) is same as some table name inside inlineview. So this pr check the table name, and only remove it when there is no table inside the inlineview has the same name with the column's table name
2023-08-31 12:25:26 +08:00
897151fc2b [fix](Nereids) set operation syntax is not compatible with legacy planner (#23668)
for example
```sql
WITH A AS (SELECT * FROM B)
SELECT * FROM C
UNION
SELECT * FROM D
```

the scope of CTE in Nereids is the first set oeprand.
the scope of CTE in legacy planner is the whole statement.
2023-08-31 11:55:35 +08:00
ab85fb3592 [Fix](PhysicalPlanTranslator) forget setPushDownAggNoGrouping in OlapScanNode (#23675)
* [Fix](PhysicalPlanTranslator) forget setPushDownAggNoGrouping in OlapScanNode

* use relation id instead of table id
2023-08-31 11:49:55 +08:00
08b4977d44 [fix](deploy) fix deploy manager can't drop node (#23667) 2023-08-31 10:53:34 +08:00
96c4471b4a [feature](udf) udf array/map support decimal and update doc (#23560)
* update

* decimal

* update table name

* remove log

* add log
2023-08-31 07:44:18 +08:00
Pxl
7f4f39551a [Bug](materialized-view) fix change base schema when create mv (#23607)
* fix change base schema when create mv

* fix

* fix
2023-08-30 21:00:12 +08:00
4f26750c91 [Improvement](statistics)Disable file cache while running analysis tasks. (#23663)
Disable file cache while running analysis tasks. Analyze tasks are background tasks, shouldn't affect user local cache data.
2023-08-30 20:50:12 +08:00
b7404896fa [improvement](catalog) avoid calling checksum when replaying creating jdbc catalog and fix ranger issue (#22369)
1. jdbc
Before, in the constructor of Jdbc catalog, we may call checksum action of the jdbc driver.
But the download link of the jdbc driver may not be available when replaying, causing replay error.

This PR change the logic to avoid calling checksum when replaying creating jdbc catalog.

2. ranger
After this PR, when creating catalog, it will try to init access controller to make sure the config is ok.

3. catalog priv check
When creating/dropping/altering/ catalog, doris will only use internal access controller to check catalog level priv.
2023-08-30 19:24:11 +08:00
05771e8a14 [Enhancement](Load) stream Load using SQL (#23362)
Using stream load in SQL mode

for example:
example.csv

10000,北京
10001,天津
curl -v --location-trusted -u root: -H "sql: insert into test.t1(c1, c2) select c1,c2 from stream(\"format\" = \"CSV\", \"column_separator\" = \",\")" -T example.csv http://127.0.0.1:8030/api/_stream_load_with_sql
curl -v --location-trusted -u root: -H "sql: insert into test.t2(c1, c2, c3) select c1,c2, 'aaa' from stream(\"format\" = \"CSV\", \"column_separator\" = \",\")" -T example.csv http://127.0.0.1:8030/api/_stream_load_with_sql
curl -v --location-trusted -u root: -H "sql: insert into test.t3(c1, c2) select c1, count(1) from stream(\"format\" = \"CSV\", \"column_separator\" = \",\") group by c1" -T example.csv http://127.0.0.1:8030/api/_stream_load_with_sql
2023-08-30 19:02:48 +08:00
e1743b70f2 [enhancement](nereids)remove useless cast for floatlike type (#23621)
convert cast(c1 AS double) > 2.0 to c1 >= 2 (c1 is integer like type)
2023-08-30 19:00:16 +08:00
cc6cbc04af [improvement](jdbc catalog) Remove useless mysql jdbc connection parameters (#23647) 2023-08-30 17:47:04 +08:00
ade598e043 [feature](Nereids): eliminate distinct for max/min/any_value (#23428)
eliminate distinct for max/min/any_value function
```
max(distinct value) = max(value)
```
2023-08-30 17:23:10 +08:00
a136836770 [feature](Nereids) add two functions: char and covert (#23104)
add [char](https://doris.apache.org/zh-CN/docs/dev/sql-manual/sql-functions/string-functions/char/?_highlight=char) func
```
mysql> select char(68, 111, 114, 105, 115);
+--------------------------------------+
| char('utf8', 68, 111, 114, 105, 115) |
+--------------------------------------+
| Doris                                |
+--------------------------------------+
```

convert func
```
MySQL root@127.0.0.1:(none)> select convert(1 using gbk);
+-------------------+
| convert(1, 'gbk') |
+-------------------+
| 1                 |
+-------------------+
```
2023-08-30 17:09:06 +08:00