-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[feat](case when) rewrite case when to compound predicate #56756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat](case when) rewrite case when to compound predicate #56756
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
ClickBench: Total hot run time: 30.83 s |
|
run buildall |
27c1884 to
e9380a2
Compare
TPC-DS: Total hot run time: 190543 ms |
ClickBench: Total hot run time: 30.13 s |
e9380a2 to
630b7b8
Compare
|
run buildall |
2 similar comments
|
run buildall |
|
run buildall |
ClickBench: Total hot run time: 30.67 s |
373fa19 to
b4b1650
Compare
|
run buildall |
ClickBench: Total hot run time: 30.78 s |
|
run buildall |
|
run p0 |
|
run cloud_p0 |
|
run nonConcurrent |
|
run vault_p0 |
FE Regression Coverage ReportIncrement line coverage |
ClickBench: Total hot run time: 30.38 s |
FE Regression Coverage ReportIncrement line coverage |
1 similar comment
FE Regression Coverage ReportIncrement line coverage |
b4b1650 to
87ce88c
Compare
|
run buildall |
TPC-DS: Total hot run time: 190849 ms |
ClickBench: Total hot run time: 30.88 s |
FE Regression Coverage ReportIncrement line coverage |
|
run cloud_p0 |
FE Regression Coverage ReportIncrement line coverage |
|
这个优化没有明显的优化点, 相反可能会降低效率. 因为在BE端我们对if 有很多优化,但 <=> 没有. |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
if (a = b, true, c = d) => a = b or c = d, 这 |
for a boolean data type case when expression, if all its when clauses' result are true / false literal, then can rewrite this case when to AND / OR expression. for example: case when a = 1 then true when b = 1 then false else c = 1 end rewrite to: (a = 1) <=> true or (not((b = 1) <=> true) and c = 1) if (a = 1, true, b = 1) rewrite to: (a=1) <=> true or b = 1
for a boolean data type case when expression, if all its when clauses' result are true / false literal, then can rewrite this case when to AND / OR expression. for example: case when a = 1 then true when b = 1 then false else c = 1 end rewrite to: (a = 1) <=> true or (not((b = 1) <=> true) and c = 1) if (a = 1, true, b = 1) rewrite to: (a=1) <=> true or b = 1
for a boolean data type case when expression, if all its when clauses' result are true / false literal, then can rewrite this case when to AND / OR expression. for example: case when a = 1 then true when b = 1 then false else c = 1 end rewrite to: (a = 1) <=> true or (not((b = 1) <=> true) and c = 1) if (a = 1, true, b = 1) rewrite to: (a=1) <=> true or b = 1
for a boolean data type case when expression, if all its when clauses' result are true / false literal, then can rewrite this case when to AND / OR expression. for example: case when a = 1 then true when b = 1 then false else c = 1 end rewrite to: (a = 1) <=> true or (not((b = 1) <=> true) and c = 1) if (a = 1, true, b = 1) rewrite to: (a=1) <=> true or b = 1
for a boolean data type case when expression, if all its when clauses' result are true / false literal, then can rewrite this case when to AND / OR expression. for example: case when a = 1 then true when b = 1 then false else c = 1 end rewrite to: (a = 1) <=> true or (not((b = 1) <=> true) and c = 1) if (a = 1, true, b = 1) rewrite to: (a=1) <=> true or b = 1
for a boolean data type case when expression, if all its when clauses' result are true / false literal, then can rewrite this case when to AND / OR expression. for example: case when a = 1 then true when b = 1 then false else c = 1 end rewrite to: (a = 1) <=> true or (not((b = 1) <=> true) and c = 1) if (a = 1, true, b = 1) rewrite to: (a=1) <=> true or b = 1
for a boolean data type case when expression, if all its when clauses' result are true / false literal, then can rewrite this case when to AND / OR expression.
for example:
then later, there are other rules will opt ' xxx <=> true', 'xxx = true'.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)