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

Enhance SQLUtils getExpressionWithoutOutsideParentheses #34804

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Yash-cor
Copy link
Contributor

@Yash-cor Yash-cor commented Feb 27, 2025

Fixes #ISSUSE_ID.

Changes proposed in this pull request:

The function getExpressionWithoutOutsideParentheses in SQLUtils was removing the leading and trailing parentheses, which sometimes caused incorrect text extraction in segments.

For Example in NOT IN clause
text segment was (3,4) NOT IN ((1,2), (3,4))

but it was catching as 3,4) NOT IN ((1,2), (3,4)


Before committing this PR, I'm sure that I have checked the following options:

  • My code follows the code of conduct of this project.
  • I have self-reviewed the commit code.
  • I have (or in comment I request) added corresponding labels for the pull request.
  • I have passed maven check locally : ./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.
  • I have made corresponding changes to the documentation.
  • I have added corresponding unit tests for my changes.
  • I have updated the Release Notes of the current development version. For more details, see Update Release Note

@Yash-cor
Copy link
Contributor Author

Yash-cor commented Feb 27, 2025

We also can modify getExpressionWithoutOutsideParentheses but it would increase the time complexity.
If needed I can make changes such that getExpressionWithoutOutsideParentheses would only remove the useless parenthesis.

@Yash-cor Yash-cor changed the title Issue sql utils Issue SQL Utils in getExpressionWithoutOutsideParentheses Feb 27, 2025
@Yash-cor
Copy link
Contributor Author

Yash-cor commented Mar 3, 2025

Hello @strongduanmu can you review this PR.

@Yash-cor Yash-cor changed the title Issue SQL Utils in getExpressionWithoutOutsideParentheses Enhance SQLUtils getExpressionWithoutOutsideParentheses Mar 4, 2025
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.

1 participant