forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
61192: multi-region: Unblock IMPORT into allowable multi-region tables r=otan,arulajmani,pbardea a=ajstorm Unblock IMPORTing into allowable multi-region tables. We only support importing into GLOBAL and REGIONAL BY TABLE tables as cockroachdb#61133 is blocking IMPORT into any tables which have columns generated using a user defined type (which covers REGIONAL BY ROW tables, as they have the crdb_region column which is generated using the crdb_internal_region type). This commit includes tests for both IMPORT and IMPORT INTO, as well as cases which illustrate cockroachdb#61133 for non-multi-region tables. Of note is the change to remove validation in create_table.go . This change was required as the validation at this point is not possible from within IMPORT, and it was uncovered through testing that this validation when generating the LocalityConfig was not required anyway, as we validate before writing the descriptors in all cases (i.e. after the LocalityConfig is generated, but before the descriptors are written to disk). Release note: None Release justification: Fixes bug in interaction between existing functionality and new multi-region feature. Co-authored-by: Adam Storm <[email protected]>
- Loading branch information
Showing
11 changed files
with
201 additions
and
25 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
10 changes: 10 additions & 0 deletions
10
pkg/ccl/importccl/testdata/avro/simple-schema-multi-region-regional-by-row.sql
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,10 @@ | ||
-- noinspection SqlDialectInspectionForFile | ||
|
||
-- noinspection SqlNoDataSourceInspectionForFile | ||
|
||
CREATE TABLE public.simple ( | ||
i integer PRIMARY KEY, | ||
s text, | ||
b bytea | ||
) LOCALITY REGIONAL BY ROW; | ||
|
10 changes: 10 additions & 0 deletions
10
pkg/ccl/importccl/testdata/avro/simple-schema-multi-region.sql
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,10 @@ | ||
-- noinspection SqlDialectInspectionForFile | ||
|
||
-- noinspection SqlNoDataSourceInspectionForFile | ||
|
||
CREATE TABLE public.simple ( | ||
i integer PRIMARY KEY, | ||
s text, | ||
b bytea | ||
) LOCALITY REGIONAL BY TABLE; | ||
|
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