Skip to content

Commit d9aa1c8

Browse files
committed
importer: purge all PGDUMP and MYSQLDUMP related code
All this code is no longer used. Note that there are still some more things to clean up (like we can assume that no tables are new, and we don't need to support creating new schemas in IMPORT either), but all those things will be addressed separately. This commit focuses only on removing the related workload readers as well as the roachpb formats. Release note: None
1 parent 75e7f32 commit d9aa1c8

19 files changed

+112
-3420
lines changed

DEPS.bzl

Lines changed: 24 additions & 444 deletions
Large diffs are not rendered by default.

build/bazelutil/distdir_files.bzl

Lines changed: 8 additions & 50 deletions
Large diffs are not rendered by default.

go.mod

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ require (
262262
gopkg.in/yaml.v2 v2.4.0
263263
gopkg.in/yaml.v3 v3.0.1
264264
honnef.co/go/tools v0.5.1
265-
vitess.io/vitess v0.0.0-00010101000000-000000000000
266265
)
267266

268267
require (
@@ -494,8 +493,6 @@ replace github.com/olekukonko/tablewriter => github.com/cockroachdb/tablewriter
494493

495494
replace github.com/abourget/teamcity => github.com/cockroachdb/teamcity v0.0.0-20180905144921-8ca25c33eb11
496495

497-
replace vitess.io/vitess => github.com/cockroachdb/vitess v0.0.0-20210218160543-54524729cc82
498-
499496
replace gopkg.in/yaml.v2 => github.com/cockroachdb/yaml v0.0.0-20210825132133-2d6955c8edbc
500497

501498
replace github.com/docker/docker => github.com/moby/moby v24.0.6+incompatible

go.sum

Lines changed: 0 additions & 115 deletions
Large diffs are not rendered by default.

pkg/backup/restore_job.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -985,9 +985,8 @@ func createImportingDescriptors(
985985
for _, desc := range sqlDescs {
986986
// Decide which offline tables to include in the restore:
987987
//
988-
// - An offline table created by RESTORE or IMPORT PGDUMP is
989-
// fully discarded. The table will not exist in the restoring
990-
// cluster.
988+
// - An offline table created by RESTORE is fully discarded. The table
989+
// will not exist in the restoring cluster.
991990
//
992991
// - An offline table undergoing an IMPORT INTO in traditional
993992
// restore has all importing data elided in the restore

pkg/build/starlarkutil/starlarkutil_test.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@ func TestGetExistingMirrorsFromDepsBzl(t *testing.T) {
1515
depsbzl := `# leading comment
1616
load("@bazel_gazelle//:deps.bzl", "go_repository")
1717
def go_deps():
18-
go_repository(
19-
name = "io_vitess_vitess",
20-
build_file_proto_mode = "disable_global",
21-
importpath = "vitess.io/vitess",
22-
sha256 = "FAKESHA256",
23-
strip_prefix = "github.com/cockroachdb/[email protected]",
24-
urls = ["https://example.com/fakeurl"],
25-
)
2618
go_repository(
2719
name = "com_github_akavel_rsrc",
2820
build_file_proto_mode = "disable_global",
@@ -41,11 +33,8 @@ def go_deps():
4133
`
4234
mirrors, err := downloadableArtifactsFromDepsBzl(depsbzl)
4335
require.NoError(t, err)
44-
require.Equal(t, len(mirrors), 2)
45-
mirror := mirrors["io_vitess_vitess"]
46-
require.Equal(t, mirror.URL, "https://example.com/fakeurl")
47-
require.Equal(t, mirror.Sha256, "FAKESHA256")
48-
mirror = mirrors["com_github_alecthomas_units"]
36+
require.Equal(t, len(mirrors), 1)
37+
mirror := mirrors["com_github_alecthomas_units"]
4938
require.Equal(t, mirror.URL, "https://foo/bar.zip")
5039
require.Equal(t, mirror.Sha256, "abcdefghij")
5140
}

pkg/cmd/cr2pg/sqlstream/stream.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import (
1717
"github.com/cockroachdb/errors"
1818
)
1919

20-
// Modified from importer/read_import_pgdump.go.
21-
2220
// Stream streams an io.Reader into tree.Statements.
2321
type Stream struct {
2422
scan *bufio.Scanner

pkg/roachpb/io-formats.proto

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,17 @@ message IOFileFormat {
1515
Unknown = 0;
1616
CSV = 1;
1717
MysqlOutfile = 2;
18-
Mysqldump = 3;
1918
PgCopy = 4;
20-
PgDump = 5;
2119
Avro = 6;
2220
Parquet = 7;
21+
22+
reserved 3, 5;
2323
}
2424

2525
optional FileFormat format = 1 [(gogoproto.nullable) = false];
2626
optional CSVOptions csv = 2 [(gogoproto.nullable) = false];
2727
optional MySQLOutfileOptions mysql_out = 3 [(gogoproto.nullable) = false];
2828
optional PgCopyOptions pg_copy = 4 [(gogoproto.nullable) = false];
29-
optional MysqldumpOptions mysql_dump = 9 [(gogoproto.nullable) = false];
30-
optional PgDumpOptions pg_dump = 6 [(gogoproto.nullable) = false];
3129
optional AvroOptions avro = 8 [(gogoproto.nullable) = false];
3230
optional ParquetOptions parquet = 10 [(gogoproto.nullable) = false];
3331

@@ -41,6 +39,8 @@ message IOFileFormat {
4139
optional Compression compression = 5 [(gogoproto.nullable) = false];
4240
// If true, don't abort on failures but instead save the offending row and keep on.
4341
optional bool save_rejected = 7 [(gogoproto.nullable) = false];
42+
43+
reserved 6, 9;
4444
}
4545

4646

@@ -103,29 +103,6 @@ message PgCopyOptions {
103103
optional int32 maxRowSize = 3 [(gogoproto.nullable) = false];
104104
}
105105

106-
// PgDumpOptions describe the format of postgresql's pg_dump.
107-
message PgDumpOptions {
108-
// maxRowSize is the maximum row size
109-
optional int32 maxRowSize = 1 [(gogoproto.nullable) = false];
110-
// Indicates the number of rows to import per table.
111-
// Must be a non-zero positive number.
112-
optional int64 row_limit = 2 [(gogoproto.nullable) = false];
113-
// Indicates if all unparseable and parseable, but unimplemented PGDUMP stmts
114-
// should be ignored during IMPORT.
115-
optional bool ignore_unsupported = 3 [(gogoproto.nullable) = false];
116-
// Points to the destination where unsupported statements during a PGDUMP
117-
// import should be logged. This can only be used when ignore_unsupported is
118-
// specified, otherwise the IMPORT errors out on encountering an unsupported
119-
// stmt.
120-
optional string ignore_unsupported_log = 4 [(gogoproto.nullable) = false];
121-
}
122-
123-
message MysqldumpOptions {
124-
// Indicates the number of rows to import per table.
125-
// Must be a non-zero positive number.
126-
optional int64 row_limit = 1 [(gogoproto.nullable) = false];
127-
}
128-
129106
message AvroOptions {
130107
enum Format {
131108
// Avro object container file input

pkg/sql/importer/BUILD.bazel

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ go_library(
1717
"read_import_avro.go",
1818
"read_import_base.go",
1919
"read_import_csv.go",
20-
"read_import_mysql.go",
2120
"read_import_mysqlout.go",
2221
"read_import_pgcopy.go",
23-
"read_import_pgdump.go",
2422
"read_import_workload.go",
2523
"rollback_job.go",
2624
],
@@ -31,7 +29,6 @@ go_library(
3129
"//pkg/clusterversion",
3230
"//pkg/col/coldata",
3331
"//pkg/crosscluster",
34-
"//pkg/docs",
3532
"//pkg/featureflag",
3633
"//pkg/jobs",
3734
"//pkg/jobs/ingeststopped",
@@ -51,7 +48,6 @@ go_library(
5148
"//pkg/sql/catalog/catpb",
5249
"//pkg/sql/catalog/colinfo",
5350
"//pkg/sql/catalog/dbdesc",
54-
"//pkg/sql/catalog/descidgen",
5551
"//pkg/sql/catalog/descpb",
5652
"//pkg/sql/catalog/descs",
5753
"//pkg/sql/catalog/ingesting",
@@ -70,10 +66,8 @@ go_library(
7066
"//pkg/sql/isql",
7167
"//pkg/sql/lexbase",
7268
"//pkg/sql/opt/memo",
73-
"//pkg/sql/parser",
7469
"//pkg/sql/pgwire/pgcode",
7570
"//pkg/sql/pgwire/pgerror",
76-
"//pkg/sql/pgwire/pgnotice",
7771
"//pkg/sql/physicalplan",
7872
"//pkg/sql/privilege",
7973
"//pkg/sql/row",
@@ -96,7 +90,6 @@ go_library(
9690
"//pkg/util/errorutil/unimplemented",
9791
"//pkg/util/hlc",
9892
"//pkg/util/humanizeutil",
99-
"//pkg/util/intsets",
10093
"//pkg/util/ioctx",
10194
"//pkg/util/log",
10295
"//pkg/util/log/eventpb",
@@ -115,8 +108,6 @@ go_library(
115108
"@com_github_cockroachdb_redact//:redact",
116109
"@com_github_lib_pq//oid",
117110
"@com_github_linkedin_goavro_v2//:goavro",
118-
"@io_vitess_vitess//go/sqltypes",
119-
"@io_vitess_vitess//go/vt/sqlparser",
120111
],
121112
)
122113

0 commit comments

Comments
 (0)