-
Notifications
You must be signed in to change notification settings - Fork 19
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
Implement CREATE PLACEMENT statement #194
Implement CREATE PLACEMENT statement #194
Conversation
@@ -2421,6 +2424,18 @@ func (p *Parser) parseAlterDatabase(pos token.Pos) *ast.AlterDatabase { | |||
} | |||
} | |||
|
|||
func (p *Parser) parseCreatePlacement(pos token.Pos) *ast.CreatePlacement { | |||
p.expectKeywordLike("PLACEMENT") | |||
name := p.parseIdent() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the official doc, the name
is enclosed in the backticks. Do we need to address this?a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not tested in the real multi regional Enterprise Plus instance, but I believe the product accepts name without backquotes.
$ gcloud spanner databases ddl update news-international-database
--instance=news-international-instance
--ddl="CREATE PLACEMENT americas
OPTIONS (instance_partition='americas-partition')"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Another question: there is no possibility of accepting Path
as a name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a global object and all PLACEMENT KEY
in all schemas of the database shares the same namespace.
https://cloud.google.com/spanner/docs/schema-and-data-model#named-schemas
For example, INFORMATION_SCHEMA.PLACEMENTS
doesn't have a room to have schema information.
https://cloud.google.com/spanner/docs/information-schema#placements
Column name | Type | Description |
---|---|---|
PLACEMENT_NAME | STRING | The name of the placement. |
IS_DEFAULT | BOOL | A boolean that indicates whether the placement is the default placement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good. Thank you!
This PR implements
CREATE PLACEMENT
DDL statement.resolve #165