diff --git a/pkg/ccl/importccl/import_stmt_test.go b/pkg/ccl/importccl/import_stmt_test.go index 0d7c9a753a37..744a67ca2cfb 100644 --- a/pkg/ccl/importccl/import_stmt_test.go +++ b/pkg/ccl/importccl/import_stmt_test.go @@ -928,7 +928,7 @@ func TestImportCSVStmt(t *testing.T) { gzip := make([]string, len(files)) for i := range files { - gzip[i] = strings.TrimPrefix(gzipFile(t, filepath.Join(dir, files[i])), dir) + gzip[i] = strings.TrimPrefix(gzipFile(t, filepath.Join(dir, files[i])), dir) + "?param=value" } gzip = nodelocalPrefix(gzip) @@ -1164,7 +1164,7 @@ func TestImportCSVStmt(t *testing.T) { if err := jobutils.VerifySystemJob(t, sqlDB, testNum, jobspb.TypeImport, jobs.StatusSucceeded, jobs.Record{ Username: security.RootUser, - Description: fmt.Sprintf(jobPrefix+` CSV DATA (%s)`+tc.jobOpts, strings.Join(tc.files, ", ")), + Description: fmt.Sprintf(jobPrefix+` CSV DATA (%s)`+tc.jobOpts, strings.ReplaceAll(strings.Join(tc.files, ", "), "?param=value", "")), }); err != nil { t.Fatal(err) } diff --git a/pkg/ccl/importccl/read_import_proc.go b/pkg/ccl/importccl/read_import_proc.go index 1774ce1c81dd..15da68e74317 100644 --- a/pkg/ccl/importccl/read_import_proc.go +++ b/pkg/ccl/importccl/read_import_proc.go @@ -15,6 +15,7 @@ import ( "io" "io/ioutil" "math/rand" + "net/url" "strings" "time" @@ -174,6 +175,9 @@ func guessCompressionFromName( case strings.HasSuffix(name, ".bz2") || strings.HasSuffix(name, ".bz"): return roachpb.IOFileFormat_Bzip default: + if parsed, err := url.Parse(name); err == nil && parsed.Path != name { + return guessCompressionFromName(parsed.Path, hint) + } return roachpb.IOFileFormat_None } }