forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix](variant) filter with variant access may lead to to parition/tab…
…let prune fall through (apache#32560) Query like `select * from ut_p partitions(p2) where cast(var['a'] as int) > 0` will fall through parition/tablet prunning since it's plan like ``` mysql> explain analyzed plan select * from ut_p where id = 3 and cast(var['a'] as int) = 789; +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Explain String(Nereids Planner) | +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | LogicalResultSink[26] ( outputExprs=[id#0, var#1] ) | | +--LogicalProject[25] ( distinct=false, projects=[id#0, var#1], excepts=[] ) | | +--LogicalFilter[24] ( predicates=((cast(var#4 as INT) = 789) AND (id#0 = 3)) ) | | +--LogicalFilter[23] ( predicates=(0 = __DORIS_DELETE_SIGN__#2) ) | | +--LogicalProject[22] ( distinct=false, projects=[id#0, var#1, __DORIS_DELETE_SIGN__#2, __DORIS_VERSION_COL__#3, element_at(var#1, 'a') AS `var`#4], excepts=[] ) | | +--LogicalOlapScan ( qualified=regression_test_variant_p0.ut_p, indexName=<index_not_selected>, selectedIndexId=10145, preAgg=ON ) | +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 6 rows in set (0.01 sec) ``` with an extra LogicalProject on top of LogicalOlapScan, so we should handle such case to prune parition/tablet
- Loading branch information
Showing
5 changed files
with
297 additions
and
74 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !sql -- | ||
1 {"a":1} | ||
|
||
-- !sql -- | ||
7 {"a":2} | ||
|
||
-- !sql -- | ||
1 {"a":1} | ||
7 {"a":2} | ||
|
||
-- !sql -- | ||
7 {"a":2} | ||
|
||
-- !sql -- | ||
16 {"a":3} | ||
|
||
-- !sql -- | ||
16 {"a":3} | ||
|
||
-- !sql -- | ||
16 {"a":3} | ||
|
||
-- !sql -- | ||
1 {"a":1} | ||
|
||
-- !sql -- | ||
6 {"x":"123"} | ||
|
Oops, something went wrong.