-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[enhance](runtime filter) impl partition pruning in runtime filer (#4…
…7025) This PR implements partition pruning through runtime filters. When executing a SQL query like: ```sql SELECT count(*) FROM int_partition_table WHERE partition_col = ( SELECT partition_col FROM int_partition_table GROUP BY partition_col HAVING count(*) > 0 ORDER BY partition_col DESC LIMIT 1 ) ``` During execution, the backend (BE) will receive a dynamic runtime filter condition `partition_col = xxx`. Since partition_col is a partitioning column, we can use its value to determine if the partition can be pruned. Additionally, this mechanism also supports filtering queries like: ```sql SELECT count(*) FROM int_partition_table WHERE func(partition_col) = xxx ``` If func cannot be evaluated at the frontend (FE), the frontend will not perform partition pruning. However, since the backend can compute func, this mechanism allows us to handle pruning scenarios that are not possible at the frontend, providing a more efficient pruning process on the backend side.
- Loading branch information
1 parent
74e82fd
commit e91468b
Showing
21 changed files
with
398 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,3 @@ INSERT INTO employees VALUES | |
|
||
|
||
msck repair table employees; | ||
|
||
|
44 changes: 44 additions & 0 deletions
44
docker/thirdparties/docker-compose/hive/scripts/create_preinstalled_scripts/run74.hql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
create database if not exists partition_tables; | ||
use partition_tables; | ||
|
||
CREATE TABLE decimal_partition_table ( | ||
id INT, | ||
name STRING, | ||
value FLOAT | ||
) | ||
PARTITIONED BY (partition_col DECIMAL(10, 2)) | ||
STORED AS PARQUET | ||
LOCATION '/user/doris/preinstalled_data/partition_tables/decimal_partition_table'; | ||
|
||
CREATE TABLE int_partition_table ( | ||
id INT, | ||
name STRING, | ||
value FLOAT | ||
) | ||
PARTITIONED BY (partition_col INT) | ||
STORED AS PARQUET | ||
LOCATION '/user/doris/preinstalled_data/partition_tables/int_partition_table'; | ||
|
||
CREATE TABLE string_partition_table ( | ||
id INT, | ||
name STRING, | ||
value FLOAT | ||
) | ||
PARTITIONED BY (partition_col STRING) | ||
STORED AS PARQUET | ||
LOCATION '/user/doris/preinstalled_data/partition_tables/string_partition_table'; | ||
|
||
CREATE TABLE date_partition_table ( | ||
id INT, | ||
name STRING, | ||
value FLOAT | ||
) | ||
PARTITIONED BY (partition_col DATE) | ||
STORED AS PARQUET | ||
LOCATION '/user/doris/preinstalled_data/partition_tables/date_partition_table'; | ||
|
||
|
||
msck repair table decimal_partition_table; | ||
msck repair table int_partition_table; | ||
msck repair table string_partition_table; | ||
msck repair table date_partition_table; |
Binary file added
BIN
+587 Bytes
...preinstalled_data/partition_tables/date_partition_table/partition_col=2025-01-01/000000_0
Binary file not shown.
Binary file added
BIN
+581 Bytes
...preinstalled_data/partition_tables/date_partition_table/partition_col=2025-01-02/000000_0
Binary file not shown.
Binary file added
BIN
+600 Bytes
...preinstalled_data/partition_tables/date_partition_table/partition_col=2025-01-03/000000_0
Binary file not shown.
Binary file added
BIN
+587 Bytes
.../preinstalled_data/partition_tables/decimal_partition_table/partition_col=100.01/000000_0
Binary file not shown.
Binary file added
BIN
+581 Bytes
.../preinstalled_data/partition_tables/decimal_partition_table/partition_col=200.02/000000_0
Binary file not shown.
Binary file added
BIN
+600 Bytes
.../preinstalled_data/partition_tables/decimal_partition_table/partition_col=300.03/000000_0
Binary file not shown.
Binary file added
BIN
+587 Bytes
...e/scripts/preinstalled_data/partition_tables/int_partition_table/partition_col=1/000000_0
Binary file not shown.
Binary file added
BIN
+581 Bytes
...e/scripts/preinstalled_data/partition_tables/int_partition_table/partition_col=2/000000_0
Binary file not shown.
Binary file added
BIN
+600 Bytes
...e/scripts/preinstalled_data/partition_tables/int_partition_table/partition_col=3/000000_0
Binary file not shown.
Binary file added
BIN
+587 Bytes
...cripts/preinstalled_data/partition_tables/string_partition_table/partition_col=A/000000_0
Binary file not shown.
Binary file added
BIN
+581 Bytes
...cripts/preinstalled_data/partition_tables/string_partition_table/partition_col=B/000000_0
Binary file not shown.
Binary file added
BIN
+600 Bytes
...cripts/preinstalled_data/partition_tables/string_partition_table/partition_col=C/000000_0
Binary file not shown.
Oops, something went wrong.