-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: add new RESTORE FROM REPLICATION STREAM syntax
This change adds basic SQL syntax to start the ingestion job which will read from the replication stream it is pointed to, and ingest the KVs into the destination tenant's keyspace. Release note (sql change): add SQL syntax for `RESTORE tenant x FROM REPLICATION STREAM FROM 'replication_stream'`. This allows the user to start an ingestion job to ingest KVs from the replication stream into the destination tenant's keyspace.
- Loading branch information
1 parent
59e6d29
commit 4269f1b
Showing
10 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2021 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package tree | ||
|
||
// StreamIngestion represents a RESTORE FROM REPLICATION STREAM statement. | ||
type StreamIngestion struct { | ||
Targets TargetList | ||
From StringOrPlaceholderOptList | ||
} | ||
|
||
var _ Statement = &StreamIngestion{} | ||
|
||
// Format implements the NodeFormatter interface. | ||
func (node *StreamIngestion) Format(ctx *FmtCtx) { | ||
ctx.WriteString("RESTORE ") | ||
ctx.FormatNode(&node.Targets) | ||
ctx.WriteString(" ") | ||
ctx.WriteString("FROM REPLICATION STREAM FROM ") | ||
ctx.FormatNode(&node.From) | ||
} |