Skip to content

Commit 70f1be6

Browse files
craig[bot]yuzefovich
andcommitted
Merge #148456
148456: importer: remove now-dead code r=yuzefovich a=yuzefovich **importer: remove no longer used fields from the jobs proto** `SkipFKs`, `ParseBundleSchema`, and `DefaultIntSize` fields are no longer used. **importer: remove all code associated with creating new tables** We no longer have the code for IMPORT formats that might create new tables, so we can now assume everywhere that `Table.IsNew` is always `false`. **importer: remove schema-publishing related code** The ability to create new schemas as part of the IMPORT was added in f36a95a and it was only supported in PGDUMP. That code is now gone, so we can remove the schema-publishing related code too. Epic: None Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]>
2 parents 15af2b5 + 9e03428 commit 70f1be6

File tree

4 files changed

+53
-659
lines changed

4 files changed

+53
-659
lines changed

pkg/jobs/jobspb/jobs.proto

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -683,26 +683,21 @@ message ImportDetails {
683683
sqlbase.TableDescriptor desc = 1;
684684
string name = 18;
685685
int64 seq_val = 19;
686-
bool is_new = 20;
687686
bool was_empty = 22;
688687
repeated string target_cols = 21;
689-
reserved 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17;
690-
}
691-
message Schema {
692-
sqlbase.SchemaDescriptor desc = 1;
688+
reserved 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20;
693689
}
694690
message Type {
695691
sqlbase.TypeDescriptor desc = 1;
696692
}
693+
// TODO(yuzefovich): we now can only support importing into a single table via
694+
// a single IMPORT job, so we could change this field.
697695
repeated Table tables = 1 [(gogoproto.nullable) = false];
698-
repeated Schema schemas = 23 [(gogoproto.nullable) = false];
699696
repeated Type types = 26 [(gogoproto.nullable) = false];
700697

701698
repeated string uris = 2 [(gogoproto.customname) = "URIs"];
702699
roachpb.IOFileFormat format = 3 [(gogoproto.nullable) = false];
703700

704-
bool skip_fks = 10 [(gogoproto.customname) = "SkipFKs"];
705-
706701
// walltime is the time at which an import job will write KVs.
707702
int64 walltime = 5;
708703
uint32 parent_id = 6 [
@@ -711,24 +706,15 @@ message ImportDetails {
711706
];
712707

713708
bool prepare_complete = 12;
714-
bool schemas_published = 24;
715709
bool tables_published = 13;
716710

717-
// TODO(yuzefovich): remove this.
718-
bool parse_bundle_schema = 14;
719-
720-
// DefaultIntSize is the integer type that a "naked" int will be resolved
721-
// to during the import. This is set based on the session variable DefaultIntSize
722-
// when the import is planned.
723-
int32 default_int_size = 25;
724-
725711
// If the database being imported into is a multi-region database, then this
726712
// field stores the databases' primary region.
727713
string database_primary_region = 27 [
728714
(gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/sql/catalog/catpb.RegionName"
729715
];
730716

731-
reserved 4, 7, 8, 9, 11, 22;
717+
reserved 4, 7, 8, 9, 10, 11, 14, 22, 23, 24, 25;
732718

733719
// next val: 28
734720
}

pkg/sql/importer/BUILD.bazel

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ go_library(
2626
visibility = ["//visibility:public"],
2727
deps = [
2828
"//pkg/cloud",
29-
"//pkg/clusterversion",
3029
"//pkg/col/coldata",
3130
"//pkg/crosscluster",
3231
"//pkg/featureflag",
@@ -50,9 +49,7 @@ go_library(
5049
"//pkg/sql/catalog/dbdesc",
5150
"//pkg/sql/catalog/descpb",
5251
"//pkg/sql/catalog/descs",
53-
"//pkg/sql/catalog/ingesting",
5452
"//pkg/sql/catalog/resolver",
55-
"//pkg/sql/catalog/rewrite",
5653
"//pkg/sql/catalog/schemadesc",
5754
"//pkg/sql/catalog/schemaexpr",
5855
"//pkg/sql/catalog/tabledesc",
@@ -65,23 +62,19 @@ go_library(
6562
"//pkg/sql/gcjob",
6663
"//pkg/sql/isql",
6764
"//pkg/sql/lexbase",
68-
"//pkg/sql/opt/memo",
6965
"//pkg/sql/pgwire/pgcode",
7066
"//pkg/sql/pgwire/pgerror",
7167
"//pkg/sql/physicalplan",
7268
"//pkg/sql/privilege",
7369
"//pkg/sql/row",
7470
"//pkg/sql/rowenc",
7571
"//pkg/sql/rowexec",
76-
"//pkg/sql/sem/catconstants",
7772
"//pkg/sql/sem/catid",
7873
"//pkg/sql/sem/eval",
7974
"//pkg/sql/sem/idxtype",
8075
"//pkg/sql/sem/tree",
8176
"//pkg/sql/sessiondata",
82-
"//pkg/sql/sqlclustersettings",
8377
"//pkg/sql/sqltelemetry",
84-
"//pkg/sql/stats",
8578
"//pkg/sql/types",
8679
"//pkg/util",
8780
"//pkg/util/bufalloc",

0 commit comments

Comments
 (0)