-
Notifications
You must be signed in to change notification settings - Fork 27
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
Could hammer support generated columns? #38
Comments
Thanks for the report. hammer uses https://pkg.go.dev/cloud.google.com/go/spanner/spansql for parsing DDL. spansql can correctly parse the following DDLs. CREATE TABLE user (
Id STRING(20) NOT NULL,
FirstName STRING(50),
LastName STRING(50),
Age INT64 NOT NULL,
FullName STRING(100) AS (ARRAY_TO_STRING([FirstName, LastName], " ")) STORED,
) PRIMARY KEY (Id); But, when I try to parse the next DDL, I seem to get an error. CREATE TABLE user (
Id STRING(20) NOT NULL,
FirstName STRING(50),
LastName STRING(50),
Age INT64 NOT NULL,
AgeAbove18 INT64 AS (IF(Age > 18, Age, NULL)) STORED;
) PRIMARY KEY (Id); Detailed conditions are not known, but https://github.com/googleapis/google-cloud-go/tree/main/spanner/spansql needs to be modified to correct this. |
I've created a PR for this issue. googleapis/google-cloud-go#6341 However, there are few conditional expressions that are not yet supported. |
|
This change is included in the v0.5.10 release. |
Hi there,
We want to add a generated column to our schema, but hammer doesn't like the syntax. The DDL is like:
expiry TIMESTAMP AS (IF(status IS NULL, updated_at, '10000-01-01 00:00:00 UTC')) STORED
Thanks.
James
The text was updated successfully, but these errors were encountered: