Commit Graph

6930 Commits

Author SHA1 Message Date
05a390e050 [refactor](jdbc catalog) split oceanbase jdbc executor (#34869) (#35175)
pick #34869
2024-05-22 19:09:35 +08:00
291cf57c54 [Configurations](multi-catalog) Add enable_parquet_filter_by_min_max and enable_orc_filter_by_min_max Session variables. (#35012) (#35164)
backport #35012
2024-05-22 19:06:12 +08:00
05cedfca4e [fix](hudi) catch exception when getting hudi partition (#35027) (#35159)
bp #35027
2024-05-22 18:44:19 +08:00
9ed4a2023b [fix](Nereids) DatetimeV2 round floor and round ceiling is wrong (#35153) (#35155)
pick from master #35153

1.  round floor was incorrectly implemented as round
2. round ceiling not really round because use double type when divide
2024-05-22 16:23:20 +08:00
15f70c8183 [Feat](planner)create table stmt offer default distribution attribute :random distribution and auto bucket (#35189)
Co-authored-by: feiniaofeiafei <moailing@selectdb.com>
2024-05-22 15:18:29 +08:00
dbf7a76592 Revert "[Chore](rollup) check duplicate column name when create table with rollup (#34827)"
This reverts commit 4a8df535537e8eab8fa2ad54934a185e17d4e660.
2024-05-22 10:19:51 +08:00
af7b16f213 [optimize](desc) display the correct data type of aggStateType (#34968)
If a table column is AGG_STATE type, we can't get the clear defined data type if we use `desc tbl` statement.

create table a_table(
    k1 int null,
    k2 agg_state<max_by(int not null,int)> generic,
    k3 agg_state<group_concat(string)> generic
)
aggregate key (k1)
distributed BY hash(k1) buckets 3
properties("replication_num" = "1");

before optimize:

mysql> desc a_table;
+-------+------------------------------------------------+------+-------+---------+---------+
| Field | Type                                           | Null | Key   | Default | Extra   |
+-------+------------------------------------------------+------+-------+---------+---------+
| k1    | INT                                            | Yes  | true  | NULL    |         |
| k2    | org.apache.doris.catalog.AggStateType@239f771c | No   | false | NULL    | GENERIC |
| k3    | org.apache.doris.catalog.AggStateType@2e535f50 | No   | false | NULL    | GENERIC |
+-------+------------------------------------------------+------+-------+---------+---------+
3 rows in set (0.00 sec)


after optimize:

mysql> desc a_table;
+-------+------------------------------------+------+-------+---------+---------+
| Field | Type                               | Null | Key   | Default | Extra   |
+-------+------------------------------------+------+-------+---------+---------+
| k1    | INT                                | Yes  | true  | NULL    |         |
| k2    | AGG_STATE<max_by(INT, INT NULL)>   | No   | false | NULL    | GENERIC |
| k3    | AGG_STATE<group_concat(TEXT NULL)> | No   | false | NULL    | GENERIC |
+-------+------------------------------------+------+-------+---------+---------+


Co-authored-by: duanxujian <duanxujian@jd.com>
2024-05-22 10:03:31 +08:00
e8fb47bec1 [fix](broker load) Make Config.enable_pipeline_load works as expected for BrokerLoad (#35105)
* FIX LOAD PROFILE

* FIX
2024-05-22 10:02:02 +08:00
7ae83b60fd [opt](Nereids) opt locality under multi-replica (#34927)
Make tablet locality fixed under multi-replica cases.
Session variable: set enable_ordered_scan_range_locations = true, default false;
3 replica tpcds 100g: 7% improvement
2024-05-22 10:00:13 +08:00
37f1bf317c [fix](statistics)Disable fetch min/max column stats through HMS, because the value may inaccurate and misleading. (#35124) (#35145)
backport #35124
2024-05-21 22:58:12 +08:00
009ab77c25 [feature](iceberg)Support write to iceberg for 2.1 (#35103) #34257 #33629
bp: #34257 #33629
2024-05-21 22:46:37 +08:00
903ff32021 [opt](fe) exit FE when transfer to (non)master failed (#34809) (#35158)
bp #34809
2024-05-21 22:31:47 +08:00
98f8eb5c43 [opt](split) get file splits in batch mode (#34032) (#35107)
bp  #34032
2024-05-21 22:27:07 +08:00
0599cb2efd fix replica's remote data size set to data size (#35098)
fix replica's remote data size set to data size
2024-05-21 16:48:08 +08:00
706c9c473b [fix](autobucket) calc bucket num exclude today's partition #34304 #35129 2024-05-21 15:49:16 +08:00
44bb2bb639 [opt](routine-load) do not schedule invalid task (#34918) 2024-05-21 13:02:42 +08:00
c0fd98abe5 [Fix](tvf) Fix that tvf reading empty files in compressed formats. (#34926)
1. Fix the issue with tvf reading empty compressed files.
2. move two test cases (`test_local_tvf_compression` and `test_s3_tvf_compression`) from p2 to p0
2024-05-21 12:59:31 +08:00
f3762322c8 [opt](nereids)new way to set pre-agg status (#34738) 2024-05-21 12:54:49 +08:00
518b143caa [feat](Nereids)choose agg mv in cbo #35020 2024-05-21 12:54:10 +08:00
45c145fdf7 [fix](Nereids) LogicalPlanDeepCopier copy scan conjuncts in wrong way (#35077)
pick from master #35076

intro by PR #34933
This PR attempts to address the issue of losing conjuncts
when performing a deep copy of the outer structure.
However, the timing of copying the conjuncts is incorrect,
resulting in the inability to map slots within the conjuncts
to the output of the outer structure.
2024-05-20 21:49:53 +08:00
42425808a1 [Cherry-Pick](branch-2.1) Pick "Fix multiple replica partial update auto inc data inconsistency problem #34788" (#35056)
* [Fix](auto inc) Fix multiple replica partial update auto inc data inconsistency problem (#34788)

* **Problem:** For tables with auto-increment columns, updating partial columns can cause data inconsistency among replicas.

**Cause:** Previously, the implementation for updating partial columns in tables with auto-increment columns was done independently on each BE (Backend), leading to potential inconsistencies in the auto-increment column values generated by each BE.

**Solution:** Before distributing blocks, determine if the update involves partial columns of a table with an auto-increment column. If so, add the auto-increment column to the last column of the block. After distributing to each BE, each BE will check if the data key for the partial column update exists. If it exists, the previous auto-increment column value is used; if not, the auto-increment column value from the last column of the block is used. This ensures that the auto-increment column values are consistent across different BEs.

* 2

* [Fix](regression-test) Fix auto inc partial update unstable regression test (#34940)
2024-05-20 15:43:46 +08:00
a43c6eca22 [chore](femetaversion) add a check in fe code to avoid fe meta version changed during pick PR (#35039)
* [chore](femetaversion) add a check in fe code to avoid fe meta version changed during pick PR

* f

* f

---------

Co-authored-by: yiguolei <yiguolei@gmail.com>
2024-05-20 13:29:17 +08:00
be50139eb1 [Fix](Nereids) fix leading with cte and same subqueryalias name (#34838) (#35047)
fix leading with cte and same subqueryalias name
Example:
with tbl1 as select t1.c1 from t1
select tbl2.c2 from (select / * + leading(t2 tbl1) * / tbl1.c1, t2.c2 from tbl1 join t2) as tbl2 join t3;
Reason:
in this case, before getting analyzed preprocess would change subquery tbl2 to cte plan, and this cte plan should be in upper level cte plan, but not in logical result sink plan
2024-05-20 10:44:22 +08:00
5ac4ea2cd9 [Fix](Nereids) fix leading hint with update of alias name (#34434) (#35046)
Problem:
when using leading like leading(tbl1 tbl2) in
"select * from (select tbl1.c1 from t1 as tbl1 join t2 as tbl2) join t3 as tbl2 on tbl2.c3 != 101;",
in which tbl2.c3 means t3.c3 but not t2.c3
Causes and solved:
when finding columns in condition, leading hint would find tbl2.c3's RelationId, and when we collect RelationId and aliasName
we should update it if aliasName is repeat
2024-05-20 10:40:10 +08:00
7c29a964e5 [Fix](Nereids) fix leading with multi level of brace pairs (#34169) (#35043)
fix leading with multi level of brace pairs
example:
leading(t1 {{t2 t3} {t4 t5}} t6) can be reduced to leading(t1 {t2 t3 {t4 t5}} t6)
also update cases which remove project node from explain shape plan
2024-05-20 10:28:22 +08:00
a6a398d7a4 [Fix](function) remove datev2 signature of microsecond #35017 2024-05-19 19:58:02 +08:00
22f85be712 [fix](hive-ctas) support create hive table with full quolified name (#34984)
Before, when executing `create table hive.db.table as select` to create table in hive catalog,
if current catalog is not hive catalog, the default engine name will be filled with `olap`, which is wrong.

This PR will fill the default engine name base on specified catalog.
2024-05-18 18:42:43 +08:00
89d5f2e816 [fix](multi-catalog)remove http scheme in oss endpoint (#34907)
remove http scheme in oss endpoint, scheme maybe appear in url (http://bucket.http//.region.aliyuncs.com) if use http client
2024-05-18 18:42:33 +08:00
a59f9c3fa1 [fix](planner) fix unrequired slot bug when join node introduced by #25204 (#34923)
before fix, join node will retain some slots, which are not materialized and unrequired.
join node need remove these slots and not make them be output slots.

Signed-off-by: nextdreamblue <zxw520blue1@163.com>
2024-05-18 18:40:56 +08:00
435147d449 [enhance](mtmv) MTMV deal partition use name instead of id (#34910)
partition id will change when insert overwrite

When the materialized view runs a task, if the base table is in insert overwrite, the materialized view task may report an error: partition not found by partitionId

Upgrade compatibility: Hive currently does not support automatic refresh, so it has no impact
2024-05-18 18:40:29 +08:00
81bcb9d490 [opt](planner)(Nereids) support auto aggregation for random distributed table (#33630)
support auto aggregation for querying detail data of random distributed table:
the same key column will return only one row.
2024-05-18 18:40:16 +08:00
bfd875eae3 [opt](nereids) lazy get expression map when comparing hypergraph (#34753) 2024-05-18 18:38:19 +08:00
9b5028785d [fix](prepare) fix datetimev2 return err when binary_row_format (#34662)
fix datetimev2 return err when binary_row_format. before pr, Backend return datetimev2 alwary by to_string.
fix datatimev2 return metadata loss scale.
2024-05-18 18:37:41 +08:00
05605d99a9 [opt](routine-load) optimize routine load task allocation algorithm (#34778) 2024-05-18 18:37:41 +08:00
cc11e50200 [fix](mtmv)Fix slot desc wrong in query rewrite by materialized view when query is complex (#34904) 2024-05-18 18:37:10 +08:00
73419c2431 [enhance](mtmv)MTMV support hive table determine whether the data is sync (#34845)
Previously supported, this PR only turns on the switch
2024-05-18 18:35:42 +08:00
b51a4212d6 [fix](txn insert) Fix txn insert values error when connect to follower fe (#34950) 2024-05-18 18:33:55 +08:00
a07876e807 [fix](planner)correlated predicate should include isnull predicate (#34833) 2024-05-18 18:28:54 +08:00
8264078a9a [fix](nereids)4 phase agg may lost parameter in some case (#34816) 2024-05-18 18:28:41 +08:00
5719f6ff0c [fix](planner) fix date_xxx functions without complete function signature (#34761)
Problem:
When using current_date as input of functions like date_sub,
fold constant would failed cause of missing of function signature in Planner

Solved:
Add complete function signature of functions like date_sub
2024-05-18 18:26:38 +08:00
71caf88ec1 [opt](mtmv) Optimize the logic of slot mapping generate for performance (#34597)
Slot mapping is used for materialized view rewritting
given the relation mapping, the slot mapping is the same

Optimize the slot mapping genarate logic
Cache the slot mapping in materialization context by realation mapping key
2024-05-18 18:25:43 +08:00
Pxl
4a8df53553 [Chore](rollup) check duplicate column name when create table with rollup (#34827)
check duplicate column name when create table with rollup
2024-05-18 18:23:44 +08:00
38bac76b37 [opt](mtmv) Cache materialization check result for performance (#34301)
Need check materialization sql pattern in different abstract rule when rewrite by materialized view.
Such as the subClass of AbstractMaterializedViewJoinRule, MaterializedViewScanRule, AbstractMaterializedViewAggregateRule.
This check result can be cached when has checked, this can avoid unnecessary repeat check
2024-05-18 18:14:59 +08:00
30a036e7a4 [feature](mtmv) create mtmv support partitions rollup (#31812)
if create MTMV `date_trunc(`xxx`,'month')`
when related table is `range` partition,and have 3 partitions:
```
20200101-20200102
20200102-20200103
20200201-20200202
```
then MTMV will have 2 partitions:
```
20200101-20200201
20200201-20200301
```

when related table is `list` partition,and have 3 partitions:
```
(20200101,20200102)
(20200103)
(20200201)
```
then MTMV will have 2 partitions:
```
(20200101,20200102,20200103)
(20200201)
```
2024-05-18 18:14:48 +08:00
f7801948ad fix backup and restore failed between force_replication_allocation setted and not setted clusters (#34608) 2024-05-18 18:14:18 +08:00
b6409f5584 [improvement](inverted index) Disable the use of skipping write index on load (#34719)
When `skip_write_index_on_load` is turned on, users will get an error when querying for the latest data(not compacted), giving them a bad experience. And we can use `inverted_index_ram_dir_enable = true` and `inverted_index_storage_format=V2` to reduce IO and CPU consumption. So we disable it now.

1. Disable setting `skip_write_index_on_load` to `true` in create table stmt.
2. Disable setting `skip_write_index_on_load` to `true` in alter table properties stmt. You can still alter `skip_write_index_on_load` to `false`.

Co-authored-by: Luennng <luennng@gmail.com>
2024-05-18 18:07:51 +08:00
c71d0b6b22 [fix](Nereids) cast from json should always nullable (#34707) 2024-05-18 18:06:23 +08:00
5012ddd87a [fix](Nereids) fix sql cache return old value when truncate partition (#34698)
1. fix sql cache return old value when truncate partition
2. use expire_sql_cache_in_fe_second to control the expire time of the sql cache which in the NereidsSqlCacheManager
2024-05-18 18:05:31 +08:00
b3b848f862 [feature](Nereids): eliminate useless project (#34611) 2024-05-18 18:05:00 +08:00
b76cfcd007 [refactor](mtmv) Materialization context and mtmv decoupling (#34093) (#34916)
Decoupling the MTMV from the materialization context.
Change MaterializationContext to abstract which is the materialization desc.
It now has AsyncMaterializationContext sub class, can also has other type of MaterializationContext such as
SyncMaterializationContext and so on.
2024-05-17 22:54:21 +08:00