Commit Graph

6845 Commits

Author SHA1 Message Date
e417a5cc36 [fix](replication_allocation) fix two problems for force_olap_table_replication_allocation #34554 2024-05-11 15:04:35 +08:00
9915862bf7 [opt](nereids)estimate rowcount for is-null filter when column stats are not available (#34519)
* estimate rowcount for is-null filter when column stats are not available
2024-05-11 15:04:35 +08:00
c742a327e6 [Fix](Planner) add date/month/year add function fe constant fold with dateV2/dateTimeV2 (#34483)
Problem and Cause:
In original planner, date_add function would choose different data type of datetime or datev2. Which when original planner choose datev2 as constant date type. Fe could not folding date_add function because missing of function signature of folding constant date_add(datev2, int)

Solved:
Add corresponding function signatures of date_add/months_add/years_add in original planner
2024-05-11 15:04:35 +08:00
958f1a2d2d [enhance](mtmv) add baseTablesOneLevel for MTMVRelation and MTMVRelationManager (#34593)
baseTables in MTMVRelation  stores all baseTables in the nested materialized view,
now adding baseTablesOneLevel to only store the baseTables at the current level.
2024-05-11 15:04:35 +08:00
1dcf8a470e [fix](Nereids): fix choose id when there is enforcer in group (#34573) 2024-05-11 15:04:35 +08:00
58c19e33b3 [fix](round) Fix incorrect decimal scale inference in round functions (#34471)
* FIX NEEDED

* FORMAT

* FORMAT

* FIX TEST
2024-05-11 11:42:12 +08:00
7ba66c5890 [branch-2.1](routine-load) do not schedule task when there is no data (#34654) 2024-05-11 11:01:18 +08:00
dd1b54cf62 [pick](nereids)Runtime filter pushdown refactor for branch-2.1 (#34682)
* [refactor](Nereids)refactor runtime filter generator (#34275)

1. unify the process of generating rf for hash join and for nested loop join
2. fix some bugs in generating rf
3. remove some duplicated check

(cherry picked from commit 07267faac0d9c6ef3bb1fd4ee101b4c761c8a2f2)

* [refactor](nereids) do not deny a runtime filter by removing an entry in aliasMap (#34559)

in current version, there are 2 approaches to verify whether a join condition can be used to generate a runtime filter, they are
1. remove the output slot from aliasMap
2. pushDownVisitor.visit(...) return false
the 1st approach has some drawbacks, we prefer to the 2ed approach.
In this pr, all the cases are handled by the 2ed approach, and remove the related code for the 1st approach.

(cherry picked from commit a29082bf31e66efa2df193b38347e610f2bf7464)

* rebase
2024-05-11 09:44:24 +08:00
e38801968d [Fix](functions) Fix bug in makedate and str_to_date functions 2024-05-10 22:14:25 +08:00
d5d6c7f8a4 [opt](nereids) optimize str-like-col range filter estimation (#34542)
we have an order reserved mappping from string to double.
for string column A, we have double values for A.min and A.max.
when estimating A<"abc", A.min/max could be used to judge whether 'abc' is between A.min and A.max, but it cannot be used to do range estimation. suppose "abc" is mapped to double x. if we compute selectivity by formula "sel = (x-A.min)/(A.max-A.min)", we are likely to obtain extreme values.
2024-05-10 22:14:00 +08:00
ec34bc0386 [bug](config) Fix modifying label_num_threshold does not take effect (#34575) 2024-05-10 22:12:17 +08:00
296c343179 [improve](shcema change)fix alter table faild when modify multiple columns with column changed positions (#34244) 2024-05-10 22:11:45 +08:00
9a94681b29 [refactor](type) AggStateType should not extends ScalarType (#34463)
1. let AggStateType extends Type
2. remove useless interface isFixedLengthType and supportsTablePartitioning
3. let MapType implement interface isSupported
4. let VariantType extends ScalarType
2024-05-10 22:10:42 +08:00
853dbdcb00 [Feature](PreparedStatement) implement general server side prepared (#33807) 2024-05-10 22:10:11 +08:00
391dc35e17 [fix](Nereids) array_intersect should be a variadic function (#34543) 2024-05-10 22:06:45 +08:00
7c52b9f36e [fix](txn insert) Txn insert stuck if execute on observer fe (#34547) 2024-05-10 22:05:53 +08:00
d038d3bf21 [improve](restore) Release useless info for the finished job to reduce mem usage (#34513) 2024-05-10 22:05:09 +08:00
19c20247f4 [Fix](job)Reclaim resources held by finished tasks (#34506)
closeOrReleaseResources(), which is responsible for safely closing or releasing the stmtExecutor, command, and ctx objects. The method follows a null check pattern to avoid NullPointerExceptions and ensures that resources are properly cleaned up when they are no longer needed. This improves code readability and maintains a consistent approach to resource management.
2024-05-10 22:04:49 +08:00
7c56c17ecc [Fix](nereids) fix NormalizeRepeat, change the outputExpression rewrite logic (#34196)
In NormalizeRepeat, three parts of the outputExpression of LogicalRepeat need to be pushed down and outputted by bottom project: flattenGroupingSetExpr, argumentsOfGroupingScalarFunction, argumentsOfAggregateFunction.
In the original code, use these three parts to rewrite the outputExpressions of LogicalRepeat to slots.This can cause problems in some cases, for example:
```sql
SELECT
	ROUND( SUM(pk + 1) - 3) col_alias1,
	pk + 1 AS col_alias3 
	FROM
	table_20_undef_partitions2_keys3_properties4_distributed_by53
GROUP BY
	GROUPING SETS ((pk), ()) ;
```
The three parts expression needed to be pushed down are: pk, pk+1. The original code use pk+1 to rewrite the pk + 1 AS col_alias3  to slot. But the pk+1 is not in the list of grouping outputs, and then report error.
This pr change the rewrite process,  divide the expression needed to be pushed down  into 2 parts: one is (flattenGroupingSetExpr) and the other one is (argumentsOfGroupingScalarFunction, argumentsOfAggregateFunction).
 and use the flattenGroupingSetExpr rewrite all LogicalRepeat outputExpressions, and use the argumentsOfGroupingScalarFunction, argumentsOfAggregateFunction to rewrite only the agg function arguments and the grouping scalar function.
So, in the above sql, the pk + 1 AS col_alias3  will not be rewritten to slot, and can be computed.
2024-05-10 22:03:31 +08:00
89091363d9 Revert "[chore](log) add try lock db failed log (#34503)"
This reverts commit e34860b86a1cf0e5aa7afa3633fa3772230e2024.
2024-05-10 17:34:43 +08:00
7bd04b43d9 [fix](tablet schedule) disable schedule need clear running tasks (#34461) 2024-05-10 14:47:02 +08:00
e34860b86a [chore](log) add try lock db failed log (#34503) 2024-05-10 14:46:49 +08:00
b7c2bf81fe [chore](planner) remove some useless code (#34430)
remove vectorAnalyze and computeOutputColumn function on Expr
remove vectorOpcode and outputColumn attribute on Expr
remove useless static LOG object on some Expr class
2024-05-10 14:39:17 +08:00
520774a24b [fix](serde) fix ipv4/v6 serde functions for arrow, orc, parquet format (#34042)
this PR is from @sjyango work in #32326,
wants merge #32326 into master branch, but it's draft and not maintain long time. so have this new PR.
Co-authored-by: sjyango <sjyang2022@zju.edu.cn>
2024-05-10 14:37:04 +08:00
07207b7b51 [feature](shuffle) enable strict consistency dml by default (#32958) (#34641) 2024-05-10 14:31:50 +08:00
5a3107442a [feature](tvf) support query table value function (#34516) (#34640)
This PR supports a Table Value Function called `Query`. He can push a query directly to the catalog source for execution by specifying `catalog` and `query` without parsing by Doris. Doris only receives the results returned by the query.
Currently only JDBC Catalog is supported.

Example:

```
Doris > desc function query('catalog' = 'mysql','query' = 'select count(*) as cnt from test.test');           
+-------+--------+------+------+---------+-------+
| Field | Type   | Null | Key  | Default | Extra |
+-------+--------+------+------+---------+-------+
| cnt   | BIGINT | Yes  | true | NULL    | NONE  |
+-------+--------+------+------+---------+-------+

Doris > select * from query('catalog' = 'mysql','query' = 'select count(*) as cnt from test.test');           
+----------+
| cnt      |
+----------+
| 30000000 |
+----------+
```
2024-05-10 14:29:17 +08:00
60e5583b01 [fix](nereids-Branch-2.1) fix bug: try to prune a not-exist rf #34630 2024-05-10 14:28:19 +08:00
c055174483 [fix](insert) fix forget to abort txn when insert checkStrictMode failed (#34612) (#34632) 2024-05-10 11:29:11 +08:00
7a40f2a547 [branch-2.1](resource)fix check available fail when s3 aws_token is set and reset as, sk faild on be. (#34219) 2024-05-09 19:06:14 +08:00
53332eb4ba [fix](catalog) refactor the schema cache for external table (#34517) (#34599)
bp #34517
2024-05-09 18:02:18 +08:00
3ae3f9d6e1 [opt](catalog) support using loading cache for db/table list in external catalog (#33610) (#34596)
bp #33610
2024-05-09 17:50:39 +08:00
8fa1b78d7b Revert "[feature](shuffle) enable strict consistency dml by default (#32958)"
This reverts commit 400105a92182755bdd95a58a7d378d67c6b27f51.
2024-05-08 23:00:46 +08:00
7ec12eed9f Fix duplicate normal workload group when upgrade 2.0->2.1.1->2.1.2 (#34560) 2024-05-08 21:59:26 +08:00
202cdb2744 [fix](mtmv)fix refresh failed when not use db before create MTMV (#34431) (#34522)
when create MTMV,we will save current ctl and db.

when refresh MTMV,will create an ConnectContext, and set same ctl, db to ctx

when db,ctx dropped, task will be failed.

But sometimes deleting a db does not actually have an impact, so changing it to not directly fail. If refreshing the data does cause an error, then giving the user an error message
2024-05-08 16:03:22 +08:00
400105a921 [feature](shuffle) enable strict consistency dml by default (#32958) 2024-05-08 11:00:14 +08:00
39fdc9ba0c [refactor](executor)Rename workload schedule policy #34497 2024-05-08 08:35:20 +08:00
182177def0 [Improve](config)The stream_load label length is changed to a configurable (#34459)
pick from #33745
2024-05-07 20:43:16 +08:00
ac56255f82 [opt](inverted index) the "unicode" tokenizer can be configured to disable stop words. (#34467) 2024-05-07 18:23:43 +08:00
63cd632abe Revert "[fix](statistics) Use column update rows to decide min/max stats are valid or not (#34263)"
This reverts commit 8db4d48731688354d6ee3ae22e02041419ca73e0.
2024-05-07 08:09:37 +08:00
a33715bc1c [fix](partial update) only unique table with MOW insert with target columns can consider be a partial update (#33656)
* [fix](partial update) only unique table with MOW insert with target columns can consider be a partial update

Signed-off-by: nextdreamblue <zxw520blue1@163.com>

* fix 1

Signed-off-by: nextdreamblue <zxw520blue1@163.com>

---------

Signed-off-by: nextdreamblue <zxw520blue1@163.com>
2024-05-07 07:53:25 +08:00
92dc8ed718 [opt](mtmv) Add enable materialized view nest rewrite switch (#34197)
* [opt](mtmv) Add enable materialized view nest rewrite switch

* fix ut

* fix ut2
2024-05-07 07:51:18 +08:00
818022cadf [Fix](MethodName) fix method issue #34178 2024-05-07 07:50:54 +08:00
2b5bac3b60 [enhance](serde) expr serde support gson (#34180)
In the future, it can be easier to change to Expression to avoid metadata compatibility issues
2024-05-07 07:50:27 +08:00
e840102e99 [Feat](nereids)nereids support create table like (#34025)
nereids support create table like statement.
e.g. CREATE TABLE test1.table2 LIKE test1.table1
2024-05-07 07:50:19 +08:00
8f40882701 [fix](nereids) disable PROJECT_OTHER_JOIN_CONDITION rule if bitmap filter is enabled. #34189
this pr is a quick solution, but not complete.
runtime filter on NestLoopJoin suffers this bug even without PROJECT_OTHER_JOIN_CONDITION rule.

for example, when enable Min_Max Runtime filter, the target Expression is n_regionkey, but it should be "n_regionkey - 28"
explain
select n_nationkey, nrkey
from (select n_regionkey -28 nrkey, n_nationkey from nation) T
join region on nrkey > r_regionkey;

we will refactor RuntimeFilterGenerator to completely solve this issue in following pr.
2024-05-07 07:49:35 +08:00
74029f56d4 [BugFix](TabletInvertedIndex) fix replica not found in TabletInvertedIndex (#34117)
* fix replica not found in TabletInvertedIndex
2024-05-07 07:48:13 +08:00
fe7d2b8159 [Fix](nereids) ignore slot implements SlotNotFromChildren when check the slot from children in NormalizeAggregate (#34171) 2024-05-07 07:48:05 +08:00
f90c2f6401 fix syntax error for CreateTableLikeStmt with partition properties (#34187)
fix syntax error for CreateTableLikeStmt with partition properties
2024-05-07 07:47:39 +08:00
8ee7bc430d [fix](Nereids) should derive stats asap to avoid npe (#34238)
we do derive stats job eager to avoid un derive stats due to merge group and optimize group
consider:
  we have two groups burned by order: G1 and G2
  then we have job by order derive G2, optimize group expression in G2,
    derive G1, optimize group expression in G1
  if G1 merged into G2, then we maybe generated job optimize group G2 before derive G1
  in this case, we will do get stats from G1's child before derive G1's child stats
  then we will meet NPE in CostModel.
2024-05-07 07:47:07 +08:00
Pxl
e66dcd0e72 [Bug](materialized-view) change nvl to ifnull when create mv (#34272)
change nvl to ifnull when create mv
2024-05-07 07:45:33 +08:00