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

refactor!: proof_of_sql_parser::intermediate_ast::Identifier with sqlparser::ast::Ident in the proof-of-sql crate #382

Merged
merged 9 commits into from
Dec 16, 2024

Conversation

varshith257
Copy link
Contributor

@varshith257 varshith257 commented Nov 19, 2024

Please be sure to look over the pull request guidelines here: https://github.com/spaceandtimelabs/sxt-proof-of-sql/blob/main/CONTRIBUTING.md#submit-pr.

Please go through the following checklist

Rationale for this change

This PR addresses the need to replace the proof_of_sql_parser::Identifier with the sqlparser::ast::Ident in the proof-of-sql crate as part of a larger transition toward integrating the sqlparser .

This change is a subtask of issue #235, with the main goal of streamlining the repository by switching to the sqlparser crate and gradually replacing intermediary constructs like proof_of_sql_parser::intermediate_ast with sqlparser::ast.

What changes are included in this PR?

  • All instances of proof_of_sql_parser::Identifier have been replaced with sqlparser::ast::Ident

  • A few of them required an identifier (e.g. Expression::Column, etc..), which is dependent on the Identifier and will be migrated at the refactoring of Exprs.

  • Every usage of Identifier has been updated to maintain the original functionality, ensuring no changes to the logic or behavior.

  • The breaking change here is that Ident doesn't support Copy trait so we have needed the clones in the places where values are moved

  • Deleted the test we_cannot_convert_a_record_batch_if_it_has_repeated_column_names because the sqlparser now differentiates between uppercase and lowercase identifiers. Case normalization is no longer applied and sqlparser treats a and A as distinct identifiers.

  • Examples are updated to align with sqlparser's case-sensitive behavior.

Are these changes tested?

Yes

Part of #235

@varshith257 varshith257 force-pushed the refactor-ident branch 4 times, most recently from 56bd993 to 216f1dc Compare November 24, 2024 19:37
@iajoiner iajoiner enabled auto-merge November 25, 2024 11:50
auto-merge was automatically disabled November 25, 2024 14:05

Head branch was pushed to by a user without write access

@varshith257 varshith257 force-pushed the refactor-ident branch 4 times, most recently from f3a774a to 806ffd9 Compare November 26, 2024 16:52
@iajoiner iajoiner mentioned this pull request Nov 27, 2024
5 tasks
@varshith257 varshith257 force-pushed the refactor-ident branch 3 times, most recently from 7e39f30 to 7b485b3 Compare November 28, 2024 08:37
Copy link
Contributor

@iajoiner iajoiner left a comment

Choose a reason for hiding this comment

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

@varshith257 Really thanks for your hard work! This is mostly good.
One comment:
Please remove changes to the examples. Changes in the rest of the code base should be sufficient in getting them to work.

@varshith257 varshith257 force-pushed the refactor-ident branch 2 times, most recently from bee2ad2 to db13153 Compare December 12, 2024 14:17
@iajoiner iajoiner force-pushed the refactor-ident branch 6 times, most recently from d848826 to 044b954 Compare December 12, 2024 15:20
@varshith257 varshith257 force-pushed the refactor-ident branch 3 times, most recently from 0be1a68 to 5920731 Compare December 12, 2024 18:09
Copy link
Contributor

@JayWhite2357 JayWhite2357 left a comment

Choose a reason for hiding this comment

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

Thanks for this PR!
Two requests, and then I'll merge it.

  1. Don't normalize the identifier names. Leave them as is.
  2. Don't panic when converting Ident to Identifier. Instead return an Error. Not every valid Ident is a valid Identifier.

@varshith257 varshith257 force-pushed the refactor-ident branch 2 times, most recently from bc85e1f to 0f69d0f Compare December 16, 2024 10:02
@iajoiner
Copy link
Contributor

@JayWhite2357 In terms of WASM sizes I think we can proceed with the changes.

JayWhite2357
JayWhite2357 previously approved these changes Dec 16, 2024
iajoiner
iajoiner previously approved these changes Dec 16, 2024
Copy link
Contributor

@iajoiner iajoiner left a comment

Choose a reason for hiding this comment

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

@varshith257 Thanks again for your hard work!

@iajoiner iajoiner enabled auto-merge December 16, 2024 20:41
@iajoiner iajoiner merged commit be3853a into spaceandtimelabs:main Dec 16, 2024
11 of 12 checks passed
@varshith257 varshith257 deleted the refactor-ident branch December 16, 2024 21:08
Copy link

🎉 This PR is included in version 0.63.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants