Skip to content
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

[branch-2.1][fix](expr) Enhance SQL Expression Handling by Introducing printSqlInParens to CompoundPredicate #39082

Merged
merged 2 commits into from
Aug 14, 2024

Conversation

zy-kkk
Copy link
Member

@zy-kkk zy-kkk commented Aug 8, 2024

pick #39064

This PR enhances SQL expression handling by introducing a printSqlInParens flag to the CompoundPredicate class and setting it to true. This ensures that expressions in a CompoundPredicate are always enclosed in parentheses, similar to how it is handled in a BinaryPredicate. . By removing redundant handling of CompoundPredicate, the logic for handling SQL generation in the JdbcScanNode node has been simplified as the updated toSql method now handles this uniformly across expressions.

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

…Parens to CompoundPredicate (apache#39064)

This PR enhances SQL expression handling by introducing a printSqlInParens flag to the CompoundPredicate class and setting it to true. This ensures that expressions in a CompoundPredicate are always enclosed in parentheses, similar to how it is handled in a BinaryPredicate. . By removing redundant handling of CompoundPredicate, the logic for handling SQL generation in the JdbcScanNode node has been simplified as the updated toSql method now handles this uniformly across expressions.
@zy-kkk zy-kkk changed the title [fix](expr) Add Parentheses for CompoundPredicates in toSqlImpl and conjunctExprToString Methods [fix](expr) Enhance SQL Expression Handling by Introducing printSqlInParens to CompoundPredicate Aug 13, 2024
@zy-kkk zy-kkk marked this pull request as ready for review August 13, 2024 09:24
@zy-kkk
Copy link
Member Author

zy-kkk commented Aug 13, 2024

run buildall

@zy-kkk zy-kkk changed the title [fix](expr) Enhance SQL Expression Handling by Introducing printSqlInParens to CompoundPredicate [branch-2.1][fix](expr) Enhance SQL Expression Handling by Introducing printSqlInParens to CompoundPredicate Aug 13, 2024
@zy-kkk
Copy link
Member Author

zy-kkk commented Aug 13, 2024

run buildall

@morningman morningman merged commit c12137a into apache:branch-2.1 Aug 14, 2024
20 of 21 checks passed
@yiguolei yiguolei mentioned this pull request Sep 5, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants