Commit Graph

6875 Commits

Author SHA1 Message Date
f9c42f34dd [fix](auth)Compatible with previously enabled ldap configuration (#34891) 2024-05-15 12:36:47 +08:00
30256195c3 fix check column privilege failed by hidden column (#34849)
fix check column privilege failed by hidden column: DORIS_DELETE_SIGN
2024-05-15 10:38:10 +08:00
5ce58ed773 [fix](nereids) runtime filter push-down-cte column mapping bug #34875 2024-05-15 10:31:39 +08:00
00ce05393a [fix](profile) Load profile need to be registered to get real-time profile #34852 2024-05-15 10:29:04 +08:00
7a878eb797 [fix](Export) fix some issues of Export (#34345)
1.  Forbid rollback to the old optimizer in `Export` task. Since originStmt is empty, reverting to the old optimizer when the new optimizer is enabled is meaningless.

2. Display `parallelism` in 'show export'.

3. Create an initial Map for resultAttachedInfo to avoid NullPointerException.

4. Remove the originStmt added in this PR #31020, because the `Export` statement is underlying the Outfile statement, it cannot be treated as `OriginStmt`.
2024-05-15 10:27:53 +08:00
bd41341a97 [bugfix](tvf)catch exception for fetching SchemaTableData #34856 2024-05-14 23:40:50 +08:00
7a480aab45 [fix](nereids) Push max rf into cte #34858 2024-05-14 21:05:18 +08:00
868949c8c0 fix some bugs (#34855) 2024-05-14 19:51:27 +08:00
c35fef631b fix bug in or expansion (#34851) 2024-05-14 19:39:33 +08:00
ff22128013 [fix](profile) Fix content missing of brokerload profile (#34839)
* Fix compile

* fix style

* [fix](profile) Fix content missing of brokerload profile (#33969)
2024-05-14 18:56:58 +08:00
bac51723e8 [fix](Nereids): fix some bugs in or expansion #34840
add unit test
2024-05-14 18:14:11 +08:00
47f0a6734b [fix][nereids] fix misunderstanding about bothSideShuffleKeysAreSameOrder (#34824)
Co-authored-by: zhongjian.xzj <zhongjian.xzj@zhongjianxzjdeMacBook-Pro.local>
2024-05-14 15:17:34 +08:00
0deb629d07 [fix](Nereids): clone the producer plan and put logicalAnchor generated by Or_Expansion above logicalSink (#34771)
* put cte anchor on the root

put logicalAnchor on root

clone plan of cte consumer

* fix unit test
2024-05-14 15:05:27 +08:00
fcf26c9224 [fix](runtimefilter)slot comparison bug #34791 2024-05-14 11:07:19 +08:00
104284bd6f [Refactor](jdbc catalog) Enhance Field Handling in JdbcFieldSchema Using Optional for Better Null Safety (#34730)
In some cases, using Resultset.getxxx cannot correctly handle null data, so I use Optional to enhance the fields of JdbcFieldSchema for better type mapping when some results are null.
2024-05-13 22:37:35 +08:00
22d4543346 [refactor](jdbc catalog) split sap_hana jdbc executor (#34772) 2024-05-13 22:36:52 +08:00
0ae1b9c70a [chore](remove code) Remove dragonbox related (#34528)
* Revert "[refactor](mysql result format) use new serde framework to tuple convert (#25006)"

This reverts commit e5ef0aa6d439c3f9b1f1fe5bc89c9ea6a71d4019.

* run buildall

* MORE

* FIX
2024-05-13 22:16:57 +08:00
5046fa2bea [improvement](mtmv) Split the expression mapping in LogicalCompatibilityContext for performance (#34646)
Need query to view expression mapping when check the logic of hyper graph is equals or not.
Getting all expression mapping one-time may affect performance. So split the expresson to three type
JOIN_EDGE, NODE, FILTER_EDGE and get them step by step.
2024-05-13 22:15:35 +08:00
c62ff0b672 [fix](auth) Disable revoke 'admin' from 'admin'` (#34644) 2024-05-13 22:15:16 +08:00
db15c811f8 [opt](Nereids) enhance properties regulator checking (#34603)
Enhance properties regulator checking:
(1) right bucket shuffle restriction takes effective only when either side has NATUAL shuffle type.
(2) enhance bothSideShuffleKeysAreSameOrder checking if taking EquivalenceExprIds into consideration.


Co-authored-by: zhongjian.xzj <zhongjian.xzj@zhongjianxzjdeMacBook-Pro.local>
2024-05-13 22:15:16 +08:00
d6f300ec62 [fix](Nereids) empty set handle in fe should use result output (#34676) 2024-05-13 22:15:16 +08:00
3ef5ed1ad0 [opt](Nereids) normalize column name of output file (#34650)
when do export to output file, normalize column name.
For example

> SELECT 1 > 2 INTO OUTFILE "..."

the column name of 1 > 2 will be __greater_than_0
2024-05-13 22:12:46 +08:00
792d87c87c [bugfix](multi catalog) fixed an issue in master where hive directory field separator was an empty string causing it to be core (#34594)
Fixed an issue in master where hive directory field separator was an empty string causing it to be core.
2024-05-13 22:12:16 +08:00
e602048f73 [fix](Nereids) Fix materialized view rule to check struct info validity (#34665)
This PR improves the materialized view rule by adding additional validity checks for the struct info. The changes include:

  1. In AbstractMaterializedViewRule.java:
    * Modified the checkPattern method to also check the validity of the struct info using context.getStructInfo().isValid().
    * Updated the error message for invalid struct info to include the view plan string for better debugging.

  2. In StructInfo.java:
    * Enhanced the isValid() method to ensure that all nodes in the hyper graph have non-null expressions, in addition to the existing validity check.

These changes ensure that the materialized view rule properly validates the struct info before proceeding with the optimization. It prevents invalid struct info from being used and provides more detailed error messages for debugging purposes.

The additional validity check in StructInfo.isValid() verifies that all nodes in the hyper graph have non-null expressions, which is necessary for the materialized view rule to function correctly.

By incorporating these validity checks, the materialized view rule becomes more robust and can handle invalid struct info gracefully, improving the overall stability and reliability of the optimization process.
2024-05-13 22:11:53 +08:00
11175208df [fix](delete) storage engine delete do not support bitmap (#34710) 2024-05-13 22:07:53 +08:00
40a1041651 [fix](jdbc catalog) fix jdbc table checksum and query jdbc tvf (#34780) 2024-05-13 18:08:18 +08:00
20a6f2a659 [Cherry-Pick](branch-2.1) Pick "Fix partial update case introduced by #33656 (#34260)" (#34767) 2024-05-13 17:00:04 +08:00
755757e57c check pushDownContext validation after withNewProbeExpression() (#34704) (#34737)
when the runtime filter target to a constant, the PushDownContext.finalTarget is null.
in this case, do not pushdown runtime filter.
example:
select * from (select 1 as x from T1) T2 join T3 on T2.x=T3.x
when push down RF(T3.x->T2.x) inside "select 1 as x from T1", the column x is a constant, and the pushDown stopped.

(cherry picked from commit 7f06cf0a0125d84c41e1edbb71366e293f70239d)
2024-05-12 18:09:13 +08:00
20e2d2e2f8 [Fix](executor)Fix workload thread start failed when follower convert to master 2024-05-12 09:30:14 +08:00
11360b27a2 [fix](catalog) fix potential catalog cache dead lock #34609 (#34614)
bp #34609
2024-05-11 18:06:56 +08:00
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