Commit Graph

6191 Commits

Author SHA1 Message Date
62a6b132be [Fix](func numbers) Remove backend_nums argument of numbers function (#25200) 2023-10-10 20:25:58 +08:00
fc1bad9a6b [feature](Nereids) support query MATERIALIZED_VIEW type table (#25227) 2023-10-10 06:44:29 -05:00
67ddfb1abc [fix](httpserver) creating this cookie without the "secure" flag and enabling cross-origin resource safe (#25107) 2023-10-10 06:25:09 -05:00
8b56ca84c7 [fix](Nereids) support AnyDataType in function signature (#25173)
1. support AnyDataType in function signature
2. update histogram signature
2023-10-10 06:09:47 -05:00
0435b286fb [feature](Nereids) support metadata tvf and fix bugs in group_commit() (#25224)
metadata tvf list:
- backends
- catalogs
- frontends
- frontends_disks
- group_commit
- iceberg_meta
- workload_groups

fix group_commit bugs
- throw NPE when properties do not contain 'table_id'
- throw NPE when table_id's table do not exist
- throw class Cast failed when table_id's table's type is not OLAP
2023-10-10 05:20:19 -05:00
7276665f1e [enhancement](Nereids) avoiding broadcast join heuristically and pruning more in CostAndEnforceJob (#25137)
When the rowCount exceeds a certain threshold, refrain from generating a broadcast join.
Only enforce the best expression in CostAndEnforce Job, rather than enforcing every expression.
Remove lower bound group pruning
2023-10-10 13:38:10 +08:00
181c58c691 [fix](Nereids) count_by_enum signature is wrong (#25167) 2023-10-10 13:05:20 +08:00
880d0d7e70 [Bug](pipeline) Support the auto partition in pipeline load (#25176) 2023-10-10 11:51:12 +08:00
59dee6b235 [fix](Nereids) support string cast to complex type (#25154) 2023-10-10 10:26:33 +08:00
f5b826b66d [fix](mark join) mark join column should be nullable (#24910) 2023-10-10 10:10:36 +08:00
90ad48cdb7 [feature](pipelineX) add node id and profilev2 in pipelineX (#25084) 2023-10-10 09:09:26 +08:00
5e8aef4756 [feature](Nereids) fold weeks_sub/add on fe (#25155)
support folding weeks_sub/add on fe
2023-10-09 21:52:44 +08:00
53b46b7e6c [FIX](filter) update for filter_by_select logic (#25007)
this pr is aim to update for filter_by_select logic and change delete limit

only support scala type in delete statement where condition
only support column nullable and predict column support filter_by_select logic, because we can not push down non-scala type to storage layer to pack in predict column but do filter logic
2023-10-09 21:27:40 +08:00
37247ac449 [opt](Nereids) add two args signature to trim family functions (#25169) 2023-10-09 07:17:52 -05:00
08e7a7b932 [feat](optimizer) Scale sample stats with ratio to make it more precise (#25079)
Since Doris support query specific tablet only, so we don't depend on tableSample to do sample, instead use grammar: TABLET(id) to do so. In OlapAnalyzeTask, we calculate which tablets would be hit and set theirs id in it, so we could get how many rows actually queried and furthur we could get the scale up ratio here
2023-10-09 07:01:59 -05:00
400b9f2f97 [Enhancement](log) Improve Safety and Robustness of Log4j Configuration (#24861) 2023-10-09 06:44:37 -05:00
f8eb36158a [fix](Nereids) alias function support arithmetic functions (#25162) 2023-10-09 19:04:47 +08:00
977d119545 [fix](Insert select tvf) fix NPE because tvf do not have catalog name (#25149) 2023-10-09 18:02:43 +08:00
d02ef36631 [opt](Nereids) match predicate support array as first arg (#25172) 2023-10-09 04:17:27 -05:00
263631e983 [improvement](meta) Infer the column name when create view if the column is expression (#24990)
## Proposed changes

Infer the column name when create view if the column is expression

## Further comments
expr column name infer strategy as following:
|      expr       |                example                    |           column name(before)             | Inferred column name(if position is 2)  |
|  -------------  | ---------------------------------------   | ------------------------------            | --------------------------------------  |
| function        | dayofyear()                               | dayofyear()                               | __dayofyear_1                           |
| cast            | cast(1 as bigint)                         | CAST(1 AS BIGINT)                         | __cast_1                                |
| anylyticExpr    | min()                                     | min()                                     | __min_1                                 |
| predicate       | 1 in (1,2,3,4)                            | 1 IN (1, 2, 3, 4)                         | __in_predicate_1                        |
| literal         | 1 or 'string_var_name'                    | 1 or 'string_var_name'                    | __literal_1                             |
| arithmeticExpr  | &                                         | ... & ...                                 | __arithmetic_expr_1                     |
| identifier      | a or b                                    | a or b                                    | a or b                                  |
| case            | CASE WHEN remark = 's' THEN 1 ELSE 2 END  | CASE WHEN remark = 's' THEN 1 ELSE 2 END  | __case_1                                |
| window          | min(timestamp) OVER (...)                 | min(timestamp) OVER(...)                  | __min_1                                 |


SQL for example:
```sql
CREATE VIEW v1 AS 
SELECT 
  error_code,
  1, 
  'string', 
  now(), 
  dayofyear(op_time), 
  cast (source AS BIGINT), 
  min(`timestamp`) OVER (
    ORDER BY 
      op_time DESC ROWS BETWEEN UNBOUNDED PRECEDING
      AND 1 FOLLOWING
  ), 
  1 > 2,
  2 + 3,
  1 IN (1, 2, 3, 4), 
  remark LIKE '%like', 
  CASE WHEN remark = 's' THEN 1 ELSE 2 END,
  TRUE | FALSE 
FROM 
  db_test.table_test1
```

the output column name is as following:
```
error_code
__literal_1
__literal_2
__now_3
__dayofyear_4
__cast_expr_5
__min_6
__binary_predicate_7
__arithmetic_expr_8
__in_predicate_9
__like_predicate_10
__case_expr_11
__arithmetic_expr_12
```
2023-10-09 04:14:01 -05:00
320709b9ff [opt](Nereids) support like and regexp function (#25148) 2023-10-09 02:55:57 -05:00
7ceb029a17 [Fix](statistics)Fix alter column stats data size is always 0 bug (#24891)
Fix alter column stats data size is always 0 bug.
2023-10-09 15:48:11 +08:00
0bf954ba05 [fix](Nereids) unique table support bitmap column (#25160) 2023-10-09 02:39:11 -05:00
4f7fad5498 [fix](Nereids) properties parser should return map (#25150) 2023-10-09 02:32:56 -05:00
cdba4c4775 [fix](Nereids) deep copier generate wrong slot for TVF (#25156) 2023-10-09 14:52:36 +08:00
d34ab7accc [fix](Nereids) bind sink should use full base schema (#25153) 2023-10-09 01:40:57 -05:00
1a6c2a3e84 [fix](Nereids) miss BoolLiteral when convert literal to Nereids' one (#25159) 2023-10-09 01:39:09 -05:00
490563cfdb [fix](Nereids) support empty array and map literal (#25145) 2023-10-09 01:23:51 -05:00
b41ec6a8a4 [feature](Nereids): Pushdown LimitDistinct Through Join (#25113)
Push down limit-distinct through left/right outer join or cross join.

such as select t1.c1 from t1 left join t2 on t1.c1 = t2.c1 order by t1.c1 limit 1;
2023-10-09 14:19:22 +08:00
5a55e47acd [Enhancement](Load) stream tvf support two phase commit (#23800) 2023-10-09 14:15:56 +08:00
e4100b4ebd [bugfix](DDL) Fix the bug of incorrect partition policy setting (#25021) 2023-10-09 11:28:48 +08:00
0f59f49768 [bugfix](policy) Forbid creating policy with same name with different resource name (#25025) 2023-10-09 11:27:49 +08:00
ffaa145728 align node id in explain with nereids node id (#25068)
it is painful to align node in `explain` and node in `explain physical plan`, since they use two different sets of node IDs.
This pr makes 'explain' command use node IDs of their correspond node in 'explain physical plan'
2023-10-09 10:11:36 +08:00
683546f71f [fix](catalog)fix use regex parse partition may cause backtracking (#24876) 2023-10-08 21:04:10 -05:00
6d8391e8b5 [fix](load)fix use regex split partition may cause backtracking (#24903) 2023-10-08 20:56:26 -05:00
7af4be1ee3 [fix](mysqldb) Fix mysqldb upgrade (#25111)
If user has database with same name mysql, will introduce problem when doing checkpoint.

Solution:

Add check for this situation, if duplicate, exit and print log info to prevent damage of metadata;
Add fe config field: mysqldb_replace_name to make things correct if user already has mysql db.
Related pr: #23087 #22868
2023-10-09 09:40:56 +08:00
fe167da2ff [fix](hudi) hbase-2.5.5 conflict with hudi (#25136)
PR https://github.com/apache/doris/pull/24606 has updated hbase version to 2.5.5, but it conflict with hudi, causing error like:
```
org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Unexpected exception: Failed to get hudi partitions
	at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:1021) ~[doris-fe.jar:1.2-SNAPSHOT]
	at org.apache.doris.qe.StmtExecutor.executeByLegacy(StmtExecutor.java:696) ~[doris-fe.jar:1.2-SNAPSHOT]
...
Caused by: java.lang.NullPointerException
	at org.apache.hadoop.fs.FilterFileSystem.getConf(FilterFileSystem.java:524) ~[hadoop-common-3.3.6.jar:?]
	at org.apache.hadoop.hbase.io.hfile.ReaderContext.<init>(ReaderContext.java:53) ~[hbase-server-2.5.5.jar:2.5.5]
	at org.apache.hadoop.hbase.io.hfile.ReaderContextBuilder.build(ReaderContextBuilder.java:106) ~[hbase-server-2.5.5.jar:2.5.5]
```
2023-10-08 23:39:46 +08:00
3a45001447 [fix](Nerids) fix error when the view has lambda functions (#25067)
1. To ensure compatibility with the original optimizer, expose the non-lambda signature of highorder function externally.
2. fix some bugs in toSql function in the original optimizer
2023-10-08 15:45:24 +08:00
541f48a754 [feature](es-catalog) add include_hidden_indexin order to get the hidden index. (#24826) 2023-10-08 14:35:08 +08:00
d517d7ab69 [Fix](point query) Not allow subquery for point query optimization (#25085) 2023-10-08 14:05:41 +08:00
f3b15d859b [Refactor](Export) delete useless code of Export (#24953) 2023-10-08 13:49:09 +08:00
737124aaef [fix](auth)fix use regex verify mysql password may cause backtracking (#24900) 2023-10-07 23:18:20 -05:00
b4e385e926 [fix](export) fix ConcurrentModificationException in export (#25096)
The session variable in export job should be copied from session variable in connection context.
Because both session variable in connection context and in export job may be modified at same time,
cause ConcurrentModificationException like:

2023-10-07 22:56:12,818 WARN (mysql-nio-pool-2|249) [ConnectProcessor.handleQueryException():396] Process one query failed because unknown reason:
java.util.ConcurrentModificationException: null
        at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437) ~[?:1.8.0_131]
        at java.util.HashMap$KeyIterator.next(HashMap.java:1461) ~[?:1.8.0_131]
        at org.apache.doris.qe.VariableMgr.revertSessionValue(VariableMgr.java:238) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:474) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:438) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:353) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:501) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:752) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) ~[doris-fe.jar:1.2-SNAPSHOT]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_131]
        at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_131]
This error is reported by external_table_p0/export/test_export_external_table.groovy
2023-10-08 11:33:27 +08:00
feb1cbe9ed [bug](partition_sort)partition sort need sort all data in two phase global (#24960)
#24886 this PR have mark phase in FE, now add those change in BE.
partition sort need sort all data in two pahse global
2023-10-08 10:46:43 +08:00
4e8cde127c [Enhance](catalog)add table cache in paimon jni (#25014)
- fix get old schema after refresh paimon table
- add table cache in paimon jni
2023-10-08 10:36:18 +08:00
fddef8b473 [fix](es-catalog)fix error when querying the index ,elasticsearch version 8.9.1 (#24839)
Issue Number: close #24833
2023-10-08 10:19:45 +08:00
96eb363b01 [fix](help-module)fix use regex match replaceAll may cause backtracking (#24918) 2023-10-07 21:09:17 -05:00
238c349946 [Fix](replayer) Fix FE crash when replaying analysis logs. (#25024)
Issue Number: close #25023

The detail of this bug has been described at the above issue. We can check if current FE is a master node to avoid such problems.
2023-10-07 23:06:34 +08:00
f3e95608cb (Fix)(RoutineLoad)Query the transaction status NPE when the task has not yet started scheduling (#25074) 2023-10-07 07:26:49 -05:00
b380b8b0b5 [bugfix](multi-catalog) Esexternalcatalog is missing LastUpdateTime. (#24559) 2023-10-07 20:21:33 +08:00