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

Support parsing SQL Server SELECT TRIM #30249

Merged
merged 3 commits into from
Feb 24, 2024
Merged

Support parsing SQL Server SELECT TRIM #30249

merged 3 commits into from
Feb 24, 2024

Conversation

zzzk1
Copy link
Contributor

@zzzk1 zzzk1 commented Feb 22, 2024

Fixes #29162.

Changes proposed in this pull request:

Task

This issue is to support more SQL Server sql parsing, as follows:

SELECT TRIM( '.,! ' FROM '     #     test    .') AS Result
SELECT TRIM(LEADING '.,! ' FROM  '     .#     test    .') AS Result
SELECT TRIM(TRAILING '.,! ' FROM '     .#     test    .') AS Result
SELECT TRIM(BOTH '123' FROM '123abc123') AS Result

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.

@strongduanmu
Copy link
Member

Hi @zzzk1, thank you for your contribution. Please solve ci exception on your local machine.

@zzzk1
Copy link
Contributor Author

zzzk1 commented Feb 23, 2024

@strongduanmu pls take a look

@@ -6436,7 +6436,7 @@
</order-by>
</select>

<select sql-case-id="select_with_trim_function">
<select sql-case-id="select_with_trim_function1">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the sql-case-id with a meaningful name.

@@ -6517,7 +6517,84 @@
<simple-table name="employees" start-index="210" stop-index="218" literal-start-index="210" literal-stop-index="218" />
</from>
</select>


<select sql-case-id="select_with_trim_function2">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the sql-case-id with a meaningful name.

</projections>
</select>

<select sql-case-id="select_with_trim_function3">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the sql-case-id with a meaningful name.

</projections>
</select>

<select sql-case-id="select_with_trim_function4">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the sql-case-id with a meaningful name.

</projections>
</select>

<select sql-case-id="select_with_trim_function5">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the sql-case-id with a meaningful name.

@strongduanmu
Copy link
Member

Hi @zzzk1, thank you for your contribution. I leave some comment, please take a look.

@zzzk1 zzzk1 requested a review from strongduanmu February 24, 2024 04:53
Copy link
Member

@strongduanmu strongduanmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution, merged.

@strongduanmu strongduanmu merged commit 2c3eb0c into apache:master Feb 24, 2024
139 checks passed
@zzzk1 zzzk1 deleted the SQL-Server-SELECT-TRIM-29542 branch February 24, 2024 07:10
@strongduanmu strongduanmu mentioned this pull request Feb 24, 2024
6 tasks
@strongduanmu
Copy link
Member

Hi @zzzk1, can you take a look at #30270, I made some minor optimizations.
You can get this code conduct from doc - https://shardingsphere.apache.org/community/cn/involved/conduct/code/#g4-%E8%A7%84%E8%8C%83.

@zzzk1
Copy link
Contributor Author

zzzk1 commented Feb 24, 2024

Hi @zzzk1, can you take a look at #30270, I made some minor optimizations. You can get this code conduct from doc - shardingsphere.apache.org/community/cn/involved/conduct/code/#g4-%E8%A7%84%E8%8C%83.

sorry about that i will be prudently next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support parsing SQL Server SELECT TRIM( sql
2 participants