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

spanner/spansql: Support conditional expressions #5837

Closed
tyamagu2 opened this issue Apr 1, 2022 · 3 comments · Fixed by #5836
Closed

spanner/spansql: Support conditional expressions #5837

tyamagu2 opened this issue Apr 1, 2022 · 3 comments · Fixed by #5836
Assignees
Labels
api: spanner Issues related to the Spanner API. priority: p2 Moderately-important priority. Fix may not be included in next release.

Comments

@tyamagu2
Copy link
Contributor

tyamagu2 commented Apr 1, 2022

spansql fails to parse statements that contain conditional expressions like SELECT CASE 1 WHEN 1 THEN "X" WHEN 2 THEN "Y" ELSE NULL END.

@tyamagu2 tyamagu2 added the triage me I really want to be triaged. label Apr 1, 2022
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Apr 1, 2022
@rahul2393
Copy link
Contributor

rahul2393 commented Apr 4, 2022

Hello @tyamagu2, thanks for opening the issue here, can you share your brief usecase for using spansql/spannertest, spansql/spannertest packages lag behind compared to the actualy cloud spanner feature wise and functionality wise, We are thinking of freezing the development of spansql/spannertest packages and recommend to use officially supported https://cloud.google.com/spanner/docs/emulator for in-memory usage.

@tyamagu2
Copy link
Contributor Author

tyamagu2 commented Apr 4, 2022

Hi @rahul2393 . I actually don't use spansql/spannertest. I use cloudspannerecosystem/yo to generate go code from spanner DDL file, and yo v2 uses spansql to parse DDL statements. I'm trying to generate code from the DDL statement that contains a column definition like the following, so I need spansql to support parsing either CASE or IF expression.

InProgress BOOL AS (CASE WHEN Status = "in_progress" THEN TRUE ELSE NULL END) STORED

@rahul2393 rahul2393 added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed triage me I really want to be triaged. labels Apr 4, 2022
@rahul2393
Copy link
Contributor

ok in the Readme of cloudspannerecosystem/yo its mentioned that application is not officially supported as part of the Cloud Spanner product but since the change is small it's ok for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. priority: p2 Moderately-important priority. Fix may not be included in next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants