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

fix(spanner): upgrade spanner client to latest to support NUMERIC types #565

Merged

Conversation

kylechadha
Copy link
Contributor

Update spanner library to latest, cloud.google.com/go/spanner@v1.18.0

This prevents error: :1.57: got "NUMERIC", want scalar type

Fixes: #564

@coveralls
Copy link

coveralls commented May 14, 2021

Pull Request Test Coverage Report for Build 388

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 57.418%

Totals Coverage Status
Change from base Build 361: 0.0%
Covered Lines: 3611
Relevant Lines: 6289

💛 - Coveralls

dhui
dhui previously approved these changes May 15, 2021
Copy link
Member

@dhui dhui 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 reporting the issue and fixing it!

@@ -151,6 +151,14 @@ func TestCleanStatements(t *testing.T) {
SET OPTIONS (allow_commit_timestamp=true);`,
expected: []string{"ALTER TABLE users ALTER COLUMN created SET OPTIONS (allow_commit_timestamp = true)"},
},
{
name: "column with NUMERIC type",
Copy link
Member

Choose a reason for hiding this comment

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

This only tests that cleanStatements() passes. It doesn't test running the statement against the emulator. Was this your intention?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, just updated where the last spanner upgrade PR did #427 -- will add a migration to test this case as well. Let me know if there's anywhere else that should be updated!

Copy link
Member

@dhui dhui May 18, 2021

Choose a reason for hiding this comment

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

If DDL parsing is all you want to test, then this is fine. But if you want to test table creation, then this doesn't test that. I'm fine either way.

EDIT: I see you added a new example migration that creates a table w/ a numeric column. These examples should be run as part of a normal test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @dhui not sure I understand, when you say 'these examples' are you saying the tests are good as is, or that I should remove the migrations and add a new test function? If you have an example of what you're referring to that would be great

@kylechadha
Copy link
Contributor Author

@dhui Looks like the Spanner tests pass -- Not sure why the Cassandra migrations would have failed. Possible they're flappy?

@dhui dhui merged commit 1695f40 into golang-migrate:master May 19, 2021
@kylechadha kylechadha deleted the add-support-for-spanner-numeric-type branch May 19, 2021 16:11
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.

Spanner NUMERIC types not supported by current spanner client v1.9.0
3 participants