zy-kkk opened a new pull request, #39082:
URL: https://github.com/apache/doris/pull/39082
pick #39064
#### Problem Description
The previous implementation of the `toSqlImpl` and `conjunctExprToString`
methods added unnecessary parentheses around all subexpressions, which could
lead to overly complex and redundant SQL expressions.
#### Solution
Modified the logic to add parentheses only around subexpressions that are
`CompoundPredicate` instances, ensuring correct operator precedence without
adding redundant parentheses.
1. **toSqlImpl Method**
- Add parentheses only around `CompoundPredicate` subexpressions.
- Simplified logic to ensure correct operator precedence while avoiding
redundant parentheses.
2. **conjunctExprToString Method**
- Add parentheses only around `CompoundPredicate` child expressions.
- Simplified logic to ensure correct operator precedence while avoiding
redundant parentheses.
#### Detailed Changes
- Updated the `toSqlImpl` method to add parentheses only around
`CompoundPredicate` subexpressions.
- Modified the `conjunctExprToString` method to add parentheses only around
`CompoundPredicate` child expressions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]