Skip to content

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

Merged
morningman merged 2 commits into
apache:branch-2.1from
zy-kkk:fix_0807_2
Aug 14, 2024
Merged

[branch-2.1][fix](expr) Enhance SQL Expression Handling by Introducing printSqlInParens to CompoundPredicate#39082
morningman merged 2 commits into
apache:branch-2.1from
zy-kkk:fix_0807_2

Conversation

@zy-kkk

@zy-kkkzy-kkk commented Aug 8, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown

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-kkkzy-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 CompoundPredicateAug 13, 2024
@zy-kkk
zy-kkk marked this pull request as ready for review August 13, 2024 09:24
@zy-kkk

Copy link
Copy Markdown
MemberAuthor

run buildall

@zy-kkkzy-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 CompoundPredicateAug 13, 2024
@zy-kkk

Copy link
Copy Markdown
MemberAuthor

run buildall

@morningman
morningman merged commit c12137a into apache:branch-2.1Aug 14, 2024
@yiguoleiyiguolei mentioned this pull request Sep 5, 2024
3 tasks
Sign up for freeto 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

@zy-kkk@doris-robot@morningman