Commit Graph

5861 Commits

Author SHA1 Message Date
fca34ec337 [fix](multi-catalog)support bit type and hidden mc secret key (#24124)
support max compute bit type and mask mc secret key
bool type will use bit arrow vector
should mask secret key: close #24019
2023-09-12 10:36:48 +08:00
484215e1cc [fix](Nereids): datetime - offset is wrong & support Two-Digital date (#24201)
- bug: datetime - offset is wrong
- support Two-Digital date
- remove useless override code
2023-09-12 10:17:56 +08:00
6e28d878b5 [fix](hudi) compatible with hudi spark configuration and support skip merge (#24067)
Fix three bugs:
1. Hudi slice maybe has log files only, so `new Path(filePath)`  will throw errors.
2. Hive column names are lowercase only, so match column names in ignore-case-mode.
3.  Compatible with [Spark Datasource Configs](https://hudi.apache.org/docs/configurations/#Read-Options), so users can add `hoodie.datasource.merge.type=skip_merge` in catalog properties to skip merge logs files.
2023-09-11 19:54:59 +08:00
115969c3fb [opt](nereids) improve eliminate outerjoin in cascades (#24120)
* eliminate outer join cascading
2023-09-11 19:42:05 +08:00
a538b4922c [fix](block rule) throw npe when use Nereids explain or fallback (#24182) 2023-09-11 18:03:46 +08:00
b5227af6a1 [Feature](partitions) Support auto partition FE part (#24079) 2023-09-11 17:48:19 +08:00
6384198136 [minor](fe) optimize some log info and imports issue (#24138) 2023-09-11 16:16:58 +08:00
f27f486e8d fix missing stats in physical plan (#24159) 2023-09-11 15:41:32 +08:00
be3618316f [Fix](Nereids) fix infer predicate lost cast of source expression (#23692)
Problem:
When inferring predicate,we lost cast of source expressions and some datatype derivation.

Example:
a = b and cast(a as targetType) = constant
(cast(a as targetType) = constant ) this expression is define as source expression.
we expect getting cast(b as targetType) = constant instead of b = constant

Reason:
When inferring predicate, we will compare original type of a and b. if they can be cast
without precision lost, a new predicate would be created. But created predicate forgot
to cast to target type

Solved:
Add cast to target type, and open make other datatype valid also.
2023-09-11 14:30:31 +08:00
e847091dfe [fix](Nereids): add DateTimeFormatterUtils and fix bug (#24171)
bug
- should reject 20200219 010101
- datetime should be compatible with date
2023-09-11 14:28:03 +08:00
8b5453296e [fix](optimizer) Fix sql block when new optimizer is enabled (#23804)
The check would skipped since when checkBlockPolicy get invoked, new optimizer doesn't do plan yet
2023-09-11 14:27:11 +08:00
b4020a13ef [Improve](Routineload)Set the maximum timeout for obtaining partition to 60s (#24173) 2023-09-11 14:15:06 +08:00
7abd88f1b4 remove editlogport in frontrnds disks (#24047) 2023-09-11 12:38:56 +08:00
9c441a4a16 [feature](Nereids) support create table and ctas (#24150)
Co-authored-by: sohardforaname <organic_chemistry@foxmail.com>
2023-09-11 12:37:58 +08:00
db139cfd6e [fix](log) delete useless log (#24161)
useless log in #23635
2023-09-11 12:08:59 +08:00
d18d272ac2 [improvement](jdbc catalog) Added create jdbc catalog properties validation (#23764) 2023-09-11 10:38:53 +08:00
d2cd0c30c7 [improvement](jdbc catalog) optimize the JDBC Catalog connection error message (#23868) 2023-09-11 10:26:54 +08:00
480fcef0a1 [typo](errmsg) Improve partition error message (#23968) 2023-09-11 10:25:06 +08:00
cd13f9e8c6 [BUG](view) fix can't create view with lambda function (#23942)
before the lambda function Expr not implement toSqlImpl() function.
so it's call parent function, which is not suit for lambda function.
and will be have error when create view.
2023-09-11 10:04:00 +08:00
31bffdb5fc [enhancement](stats) audit for stats collection #24074
log stas collection sqls in audit log
2023-09-11 08:26:12 +08:00
586492c124 [Feature](multi-catalog) Support sql cache for hms catalog (#23391)
**Support sql cache for hms catalog. Legacy planner and Nereids planner are all supported. 
Not support partition cache now, not support federated query now.**
2023-09-10 21:56:35 +08:00
f85da7d942 [improvement](jdbc) add profile for jdbc read and convert phase (#23962)
Add 2 metrics in jdbc scan node profile:
- `CallJniNextTime`: call get next from jdbc result set
- `ConvertBatchTime`: call convert jobject to columm block

Also fix a potential concurrency issue when init jdbc connection cache pool
2023-09-10 21:42:06 +08:00
1df2e4454f [improvememt](file-cache) increase virtual node number to make file cache more even (#24143)
The origin virtual number is Math.max(Math.min(512 / backends.size(), 32), 2);, which is too small,
causing uneven cache distribution when enabling file cache.
2023-09-10 19:56:53 +08:00
102abff071 [Fix](spark-load) ignore column name case in spark load (#23947)
Doris is not case sensitive to field names, so when doing spark load, we can convert all fields to lowercase for matching and loading.
2023-09-10 19:45:01 +08:00
8e171f5cbf [Enhancement](multi-catalog) merge hms partition events. (#22869)
This pr mainly has two changes:

1. add some merge processes about partition events
2. add a ut for `MetastoreEventFactory`. First add some mock classes (`MockCatalog`/`MockDatabase` ...) to simulate the real hms catalog/databases/tables/partitions,  then create a event producer which can produce every kinds of `MetastoreEvent`s randomly. Use two catalogs for test, one is named `testCatalog` and the other is the `validateCatalog`, use event producer to produce many events and let `validateCatalog` to handle all of the events, but `testCatalog` just handles the events  which have been merged by `MetastoreEventFactory`, check if the `validateCatalog` is equals to `testCatalog`.
2023-09-10 18:29:54 +08:00
cae5a9d3cd [Fix](auth) fix revoke role operation cause fe down (#23852)
If there 3 above fe nodes,
the following opeartions will cause all FE nodes down.

DROP USER revoke_test_user
DROP ROLE revoke_test_role
DROP DATABASE IF EXISTS revoke_test_db
CREATE DATABASE revoke_test_db
CREATE ROLE revoke_test_role
CREATE USER revoke_test_user IDENTIFIED BY 'revoke_test_pwd'
GRANT SELECT_PRIV ON revoke_test_db.* TO ROLE 'revoke_test_role'
GRANT 'revoke_test_role' TO revoke_test_user
SHOW GRANTS FOR revoke_test_user
REVOKE 'revoke_test_role' from revoke_test_user
SHOW GRANTS FOR revoke_test_user
DROP USER revoke_test_user
DROP ROLE revoke_test_role
DROP DATABASE revoke_test_db
2023-09-10 16:16:07 +08:00
232b58a27d [fix](broker-load) make sequence column name case insensitive (#24071) 2023-09-10 10:51:07 +08:00
f9a75b5c4f [feature](csv_serde)1.append csv serde for serialize to csv and deserialize from csv. 2.let csvReader use csv serde not text_converter. (#23352)
1. append csv serde for serialize to csv and deserialize from csv.
2. let csvReader use csv serde not text_converter.
2023-09-10 00:16:21 +08:00
7c7e44fcc8 [refactor](nereids) make forbid_unknown_col_stats check more accurate (#24061)
ignore unknown col stats check if:
colunm not used in query
column is Array/Json/Map/Struct type
2023-09-09 22:42:17 +08:00
e09e030652 [fix](Nereids) mv in select materialized_view should disable show table (#24104)
mv in select materialized_view should disable show table,
because Nereids planner can output the string such as
slot#[0] in toSql() of SlotRef. Note this is only a
temporary solution, will use an expression translator later
2023-09-09 21:57:52 +08:00
21e30d4374 [fix](planner)ctas's query part is not analyzed correctly (#24111)
* [fix](planner)ctas's query part is not analyzed correctly
2023-09-09 20:55:09 +08:00
8c2a721873 [opt](nereids)push down filter through window #23935
select rank() over (partition by A, B) as r, sum(x) over(A, C) as s from T;
A is a common partition key for all windowExpressions, that is A is intersection of {A,B} and {A, C}
we could push filter A=1 through this window, since A is a common Partition key:
select * from (select a, row_number() over (partition by a) from win) T where a=1;
origin plan:

----filter((T.a = 1))
----------PhysicalWindow
------------PhysicalQuickSort
--------------PhysicalProject
------------------PhysicalOlapScan[win]
transformed to

----PhysicalWindow
------PhysicalQuickSort
--------PhysicalProject
----------filter((T.a = 1))
------------PhysicalOlapScan[win]
But C=1 can not be pushed through window.
2023-09-09 20:53:31 +08:00
7b62013d21 [refactor](nereids) print "ifnull" instead of "nvl" in explain #23979
'ifnull' is used more general.
2023-09-09 20:33:23 +08:00
6b9698a248 [bugfix](insert into) should not send profile during report process (#24127)
Co-authored-by: yiguolei <yiguolei@gmail.com>
2023-09-09 17:12:35 +08:00
153c7982f3 [Optimize](invert index) Optimize multiple terms conjunction query (#23871) 2023-09-09 01:52:58 +08:00
b5e1e36750 [fix](pipeline)add logs for unstable cases #24073
Issue Number: close #xxx

ShowTableStmtTest.testNoDb and DropDbStmtTest.testNoPriv are unstable cases,error msg is:

java.lang.Exception: Unexpected exception, expected<org.apache.doris.common.AnalysisException> but was<mockit.internal.expectations.invocation.MissingInvocation>
we can not know what is missing ,and this issue cannot be reproduced locally,so add some log
2023-09-09 00:49:40 +08:00
7abd23cad1 [fix](tablet clone) fix be load rebalancer choose candidate tablets #23915
When be load reblancer choose candidate tablets, it will try moving tablets from high load backends to low backend backends. If the higher HIGH BE has no available slot num, it should try next HIGH BE.
2023-09-09 00:48:27 +08:00
2fb4c818da [fix](tablet clone) delete tablet check other catchup #24038
Sometimes FE replica's version is unreliable. FE's replica may bigger than BE's real version. Need check if BE missing version (last failed version > 0).
2023-09-09 00:42:32 +08:00
3e7f531d2b [fix](sec)upgrade org.yaml:snakeyaml to 2.0 #24057 2023-09-09 00:37:07 +08:00
69cc6fee97 [fix](explain) fix explain physical plan with external table issue (#23845)
The `SelectedPartitions` can not be null, or it will throw NPE and fallback to origin planner.
2023-09-08 21:11:48 +08:00
894aa48743 [fix](Nereids) remove PARTITIONS from non-reserved list (#24110)
according to PR #24053, it removed partitions from non-reserved list in
legacy planner's parser. For consistency, remove it from Nereids' parser
too.
2023-09-08 20:47:07 +08:00
929a9ad143 [Fix](RoutineLoad) Delete duplicate attribute in job property #24037 2023-09-08 20:42:28 +08:00
5c2f9eb92e [Improvement] (pipeline) Cancel related query if backend restarts or dead (#23863) 2023-09-08 20:30:52 +08:00
01ea024497 [fix](nereids) runtimefilter not generated after postprocessor (#23948)
fix bug: rf not generated
2023-09-08 17:37:04 +08:00
161520feb4 [feature](Nereids): enable convert CASE WHEN to IF (#24050)
enable rule to convert CASE WHEN to IF.
2023-09-08 16:58:33 +08:00
c0a41dc0f8 [fix](nereids) external scan use STORAGE_ANY instead of ANY as distibution (#24039) 2023-09-08 16:25:35 +08:00
d8bdd6c137 [fix](nereids) avoid throw analysis exception for unsupported type to make ext table goes nereids (#24089)
void throw analysis ex for unsupported type to make ext table goes nereids.
this will improve the nereids' availability for external table if unsupported type is in the basic table schema but not referenced in the real sql.

tested in external table env.

Consider the following case:
select pu.pk_ct_pu as id
  from fms_rd_nc65_zb.NC65P.CT_PU pu
  left join fms_rd_nc65_zb.NC65P.PUB_WF_INSTANCE pwi
    on pu.pk_ct_pu = pwi.billid 
    and pu.vtrantypecode=pwi.billtype
 left join fms_rd_nc65_zb.NC65P.SM_USER su
    on pu.creator = su.cuserid
 where pu.pk_ct_pu='1001A110000000K8XPVN'; 

PUB_WF_INSTANCE table has a BLOB type column and currently it will throw analysis exception and fallback to old optimizer, although this column is not referenced in the real sql. The old optimizer doesn't have the outer join -> inner join rule and the "pu.pk_ct_pu='1001A110000000K8XPVN'; " is not pushed down and the performance will drop down. After the pr, we add the unsupported type instead of throw exception directly, it will decide the unused case and can continue goes nereids and use all advanced optimization for the sql.
2023-09-08 15:56:29 +08:00
82dc970916 [feature](insert) Support group commit insert (#22829) 2023-09-08 15:51:03 +08:00
84c1f5692e [Fix](autobucket) use single replica partition size to calc bucket number #24045 2023-09-08 14:54:02 +08:00
576855acb2 [fix](Nereids): fix regression-test (#24065) 2023-09-08 14:14:48 +08:00