-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inline only simple expressions in predicate pushdown
This is to fix github issue #10455. We used to inline all predicate when doing push down predicates. This could have problems when the projection columns contains complex expressions like the following: WITH t1 (v) AS (VALUES 1), t2 AS( select if(v = 0, v, v) v from t1 ), t3 AS( select if(v = 0, v, v) v from t2 ), t4 AS( select if(v = 0, v, v) v from t3 ), t5 AS( select if(v = 0, v, v) v from t4 ), t6 AS( select if(v = 0, v, v) v from t5 ), t7 AS( select if(v = 0, v, v) v from t6 ), t8 AS( select if(v = 0, v, v) v from t7 ), t9 AS( select if(v = 0, v, v) v from t8 ), t10 AS( select if(v = 0, v, v) v from t9 ), t11 AS( select if(v = 0, v, v) v from t10 ), t12 AS( select if(v = 0, v, v) v from t11 ), t13 AS( select if(v = 0, v, v) v from t12 ), t14 AS( select if(v = 0, v, v) v from t13 ), t15 AS( select if(v = 0, v, v) v from t14 ), t16 AS( select if(v = 0, v, v) v from t15 ) select * from t16 where v = 0 This short-term fix is to adjust the inlining heuristics to only do it if the expressions are trivial or appear only once (similar to how the InlineProjections rule works)
- Loading branch information
Showing
2 changed files
with
109 additions
and
5 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