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 SELECT AS VALUE and SELECT AS typename #122

Merged

Conversation

apstndb
Copy link
Contributor

@apstndb apstndb commented Sep 29, 2024

This PR add support of SELECT AS VALUE #97 and SELECT AS typename #89.

SELECT AS VALUE
https://cloud.google.com/spanner/docs/reference/standard-sql/query-syntax#select_as_value

SELECT AS typename
https://cloud.google.com/spanner/docs/reference/standard-sql/query-syntax#select_as_typename

They and SELECT AS STRUCT are generalized as ast.SelectAs.

Note: This PR depends on ast.NamedType in #121, so it is needed to rebase after #121 is merged. rebased

fix #97

@apstndb apstndb closed this Sep 29, 2024
@apstndb apstndb reopened this Sep 29, 2024
@apstndb apstndb changed the title Support SELECT AS VALUE and SELECT AS typename (DONT MERGE) Support SELECT AS VALUE and SELECT AS typename Sep 29, 2024
@apstndb apstndb changed the title (DONT MERGE) Support SELECT AS VALUE and SELECT AS typename (DO NOT MERGE) Support SELECT AS VALUE and SELECT AS typename Sep 29, 2024
@apstndb apstndb mentioned this pull request Sep 29, 2024
5 tasks
@apstndb apstndb marked this pull request as draft September 29, 2024 11:15
@apstndb apstndb changed the title (DO NOT MERGE) Support SELECT AS VALUE and SELECT AS typename Support SELECT AS VALUE and SELECT AS typename Sep 29, 2024
@apstndb apstndb force-pushed the feature/generalized-select-as branch from 60d020c to b9e8f3c Compare October 1, 2024 04:01
@apstndb
Copy link
Contributor Author

apstndb commented Oct 1, 2024

Rebase to reduce dependency to other branch.

@apstndb apstndb marked this pull request as ready for review October 1, 2024 04:09
ast/ast.go Outdated
@@ -443,7 +453,8 @@ type Select struct {
Select token.Pos // position of "select" keyword

Distinct bool
AsStruct bool
AsStruct bool // deprecated, use As
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure this deprecation is necessary. Could we remove it simply?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed ff14fe6

It is because I didn't sure the deprecation policy of memefish.
Current policy: We can change any AST node without breaking change notification because there are no release version.
Is it correct?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have no time to maintain codes with some deprecations. Also, we have no plan to publish a major version, so we can easily introduce breaking changes IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for answering!

We can make breaking changes to v0.x.y at any time, but the release process itself is a significant effort, so I think the current policy is fine.

Copy link
Collaborator

@makenowjust makenowjust left a comment

Choose a reason for hiding this comment

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

LGTM!

@makenowjust makenowjust merged commit ad392f1 into cloudspannerecosystem:main Oct 18, 2024
2 checks passed
@apstndb apstndb deleted the feature/generalized-select-as branch October 18, 2024 18:39
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.

Incompatibility: SELECT AS VALUE is not supported
2 participants