-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](nereids) Remove Nondeterministic to avoid ambiguity when decidea expression is nondeterministic or not #39801
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
[fix](nereids) Remove Nondeterministic to avoid ambiguity when decidea expression is nondeterministic or not #39801
Conversation
… a expression is nondeterministic or not
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
| || cachedVariable.getRealExpression().anyMatch(expr -> expr instanceof ExpressionTrait | ||
| && !((ExpressionTrait) expr).isDeterministic())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove expr instanceof ExpressionTrait because Expression is always ExpressionTrait
| * Identify the expression is containing deterministic expr or not | ||
| */ | ||
| default boolean containsNondeterministic() { | ||
| return anyMatch(expr -> expr instanceof ExpressionTrait && !((ExpressionTrait) expr).isDeterministic()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove expr instanceof ExpressionTrait
|
run buildall |
TPC-H: Total hot run time: 37853 ms |
TPC-DS: Total hot run time: 191496 ms |
ClickBench: Total hot run time: 30.42 s |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
…a expression is nondeterministic or not (apache#39801) ## Proposed changes In apache#36111, we add `isDeterministic` method in class `ExpressionTrait` to identify the expression is deterministic or not. But `unix_timestamp` doesn't extend Nondeterministic, but it is not deterministic when it's children is empty. and is not deterministic when children is not empty. If we use` instanceOf Nondeterministic `to indentify if expression is is not deterministic, that is confused. So we do something as fllowing: 1. Remove Nondeterministic class, and use `isDeterministic` to indentify it's deterministic. 2. Add `containsNondeterministic` method in `ExpressionTrait` to identify it contains nondeterministic expression or not. 3. `isDeterministic` only identify current expression is deterministic or not. would identify if contains nondeterministic or not
…a expression is nondeterministic or not (apache#39801) ## Proposed changes In apache#36111, we add `isDeterministic` method in class `ExpressionTrait` to identify the expression is deterministic or not. But `unix_timestamp` doesn't extend Nondeterministic, but it is not deterministic when it's children is empty. and is not deterministic when children is not empty. If we use` instanceOf Nondeterministic `to indentify if expression is is not deterministic, that is confused. So we do something as fllowing: 1. Remove Nondeterministic class, and use `isDeterministic` to indentify it's deterministic. 2. Add `containsNondeterministic` method in `ExpressionTrait` to identify it contains nondeterministic expression or not. 3. `isDeterministic` only identify current expression is deterministic or not. would identify if contains nondeterministic or not
…m_bytes foldable properties (apache#39944) ## Proposed changes fix the conflict between apache#39801 and apache#39891
…a expression is nondeterministic or not (#39801) ## Proposed changes In #36111, we add `isDeterministic` method in class `ExpressionTrait` to identify the expression is deterministic or not. But `unix_timestamp` doesn't extend Nondeterministic, but it is not deterministic when it's children is empty. and is not deterministic when children is not empty. If we use` instanceOf Nondeterministic `to indentify if expression is is not deterministic, that is confused. So we do something as fllowing: 1. Remove Nondeterministic class, and use `isDeterministic` to indentify it's deterministic. 2. Add `containsNondeterministic` method in `ExpressionTrait` to identify it contains nondeterministic expression or not. 3. `isDeterministic` only identify current expression is deterministic or not. would identify if contains nondeterministic or not
Proposed changes
In #36111, we add
isDeterministicmethod in classExpressionTraitto identify the expression is deterministic or not.But
unix_timestampdoesn't extend Nondeterministic, but it is not deterministic when it's children is empty. and is not deterministic when children is not empty. If we useinstanceOf Nondeterministicto indentify if expression is is not deterministic, that is confused.So we do something as fllowing:
isDeterministicto indentify it's deterministic.containsNondeterministicmethod inExpressionTraitto identify it contains nondeterministic expression or not.isDeterministiconly identify current expression is deterministic or not. would identify if contains nondeterministic or not