Skip to content

Commit 75e7f32

Browse files
craig[bot]yuzefovich
andcommitted
148134: sqlccl: remove ignored internal error in ExplainGist that's been fixed r=yuzefovich a=yuzefovich See: #133129. Epic: None Release note: None 148168: workloadccl: remove stale comment around importing fixtures r=yuzefovich a=yuzefovich This commit deletes now-stale comment that was added in 09abc26. That change made a switch from using IMPORT TABLE to IMPORT INTO for importing fixtures as a temporary workaround. However, since then we completely deprecated IMPORT TABLE syntax, so the only way to import the data now is to create the tables separately, which makes the comment confusing. Epic: None Release note: None 148248: parser: remove IMPORT TABLE and IMPORT non-INTO support r=yuzefovich a=yuzefovich **parser: remove IMPORT TABLE and IMPORT non-INTO support** PGDUMP and MYSQLDUMP code is now being removed, so remove the parser support. Release note (sql change): IMPORT TABLE as well PGDUMP and MYSQLDUMP formats of IMPORT are now fully removed. These have been deprecated since 23.2. **tree: remove unused Into and Bundle fields of Import** Also update one spot under assumption that `tree.Import.Table` is now always non-nil. Epic: None 148329: execbuilder: fix a silly bug around finding the most recent full stat r=yuzefovich a=yuzefovich This commit fixes a bug that was added in 3bc0992. In short, in a complicated logical expression we had `v1 && v2 || v3` when we wanted `v1 && (v2 || v3)`. This allowed us to hit an index of bounds when evaluating `v3`, which in this concrete case could mean that we iterated over all stats and didn't find any full ones. There are two other places with similar conditionals, and they have the correct usage of parenthesis, so I didn't change the structure overall. I did find that we want to also skip the merged stat, depending on the session variable. Also the bug seems quite difficult to hit, so I omitted the release note. Fixes: #148316. Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]>
5 parents ee5f7d2 + d709309 + 594ea7a + c9b1c1e + cabf482 commit 75e7f32

File tree

16 files changed

+188
-354
lines changed

16 files changed

+188
-354
lines changed
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import_stmt ::=
2-
'IMPORT' import_format file_location 'WITH' kv_option_list
3-
| 'IMPORT' import_format file_location
4-
| 'IMPORT' 'TABLE' table_name 'FROM' import_format file_location 'WITH' kv_option_list
5-
| 'IMPORT' 'TABLE' table_name 'FROM' import_format file_location
6-
| 'IMPORT' 'INTO' table_name '(' insert_column_list ')' import_format 'DATA' '(' file_location ( ( ',' file_location ) )* ')' 'WITH' kv_option_list
2+
'IMPORT' 'INTO' table_name '(' insert_column_list ')' import_format 'DATA' '(' file_location ( ( ',' file_location ) )* ')' 'WITH' kv_option_list
73
| 'IMPORT' 'INTO' table_name '(' insert_column_list ')' import_format 'DATA' '(' file_location ( ( ',' file_location ) )* ')'
84
| 'IMPORT' 'INTO' table_name import_format 'DATA' '(' file_location ( ( ',' file_location ) )* ')' 'WITH' kv_option_list
95
| 'IMPORT' 'INTO' table_name import_format 'DATA' '(' file_location ( ( ',' file_location ) )* ')'

docs/generated/sql/bnf/stmt_block.bnf

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,7 @@ explain_stmt ::=
238238
| 'EXPLAIN' 'ANALYSE' '(' explain_option_list ')' explainable_stmt
239239

240240
import_stmt ::=
241-
'IMPORT' import_format string_or_placeholder opt_with_options
242-
| 'IMPORT' 'TABLE' table_name 'FROM' import_format string_or_placeholder opt_with_options
243-
| 'IMPORT' 'INTO' table_name '(' insert_column_list ')' import_format 'DATA' '(' string_or_placeholder_list ')' opt_with_options
241+
'IMPORT' 'INTO' table_name '(' insert_column_list ')' import_format 'DATA' '(' string_or_placeholder_list ')' opt_with_options
244242
| 'IMPORT' 'INTO' table_name import_format 'DATA' '(' string_or_placeholder_list ')' opt_with_options
245243

246244
insert_stmt ::=
@@ -719,24 +717,20 @@ explainable_stmt ::=
719717
explain_option_list ::=
720718
( explain_option_name ) ( ( ',' explain_option_name ) )*
721719

720+
insert_column_list ::=
721+
( insert_column_item ) ( ( ',' insert_column_item ) )*
722+
722723
import_format ::=
723724
name
724725

725-
string_or_placeholder ::=
726-
non_reserved_word_or_sconst
727-
| 'PLACEHOLDER'
726+
string_or_placeholder_list ::=
727+
( string_or_placeholder ) ( ( ',' string_or_placeholder ) )*
728728

729729
opt_with_options ::=
730730
'WITH' kv_option_list
731731
| 'WITH' 'OPTIONS' '(' kv_option_list ')'
732732
|
733733

734-
insert_column_list ::=
735-
( insert_column_item ) ( ( ',' insert_column_item ) )*
736-
737-
string_or_placeholder_list ::=
738-
( string_or_placeholder ) ( ( ',' string_or_placeholder ) )*
739-
740734
insert_target ::=
741735
table_name_opt_idx
742736
| table_name_opt_idx 'AS' table_alias_name
@@ -775,6 +769,10 @@ reset_session_stmt ::=
775769
reset_csetting_stmt ::=
776770
'RESET' 'CLUSTER' 'SETTING' var_name
777771

772+
string_or_placeholder ::=
773+
non_reserved_word_or_sconst
774+
| 'PLACEHOLDER'
775+
778776
opt_with_restore_options ::=
779777
'WITH' restore_options_list
780778
| 'WITH' 'OPTIONS' '(' restore_options_list ')'
@@ -2032,16 +2030,12 @@ drop_policy_stmt ::=
20322030
explain_option_name ::=
20332031
non_reserved_word
20342032

2035-
non_reserved_word_or_sconst ::=
2036-
non_reserved_word
2037-
| 'SCONST'
2033+
insert_column_item ::=
2034+
column_name
20382035

20392036
kv_option_list ::=
20402037
( kv_option ) ( ( ',' kv_option ) )*
20412038

2042-
insert_column_item ::=
2043-
column_name
2044-
20452039
session_var ::=
20462040
'identifier'
20472041
| 'identifier' session_var_parts
@@ -2059,6 +2053,10 @@ var_name ::=
20592053
name
20602054
| name attrs
20612055

2056+
non_reserved_word_or_sconst ::=
2057+
non_reserved_word
2058+
| 'SCONST'
2059+
20622060
restore_options_list ::=
20632061
( restore_options ) ( ( ',' restore_options ) )*
20642062

@@ -2925,15 +2923,15 @@ non_reserved_word ::=
29252923
| col_name_keyword
29262924
| type_func_name_keyword
29272925

2926+
column_name ::=
2927+
name
2928+
29282929
kv_option ::=
29292930
name '=' string_or_placeholder
29302931
| name
29312932
| 'SCONST' '=' string_or_placeholder
29322933
| 'SCONST'
29332934

2934-
column_name ::=
2935-
name
2936-
29372935
session_var_parts ::=
29382936
( '.' 'identifier' ) ( ( '.' 'identifier' ) )*
29392937

pkg/ccl/testccl/sqlccl/explain_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ func TestExplainGist(t *testing.T) {
191191
// Ignore all errors except the internal ones.
192192
for _, knownErr := range []string{
193193
"expected equivalence dependants to be its closure", // #119045
194-
"not in index", // #133129
195194
} {
196195
if strings.Contains(err.Error(), knownErr) {
197196
// Don't fail the test on a set of known errors.

pkg/ccl/workloadccl/fixture.go

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -374,17 +374,7 @@ func ImportFixture(
374374
defer enableFn()
375375
}
376376

377-
pathPrefix := csvServer
378-
if pathPrefix == `` {
379-
pathPrefix = `workload://`
380-
}
381-
382-
// Pre-create tables. It's required that we pre-create the tables before we
383-
// parallelize the IMPORT because for multi-region setups, the create table
384-
// will end up modifying the crdb_internal_region type (to install back
385-
// references). If create table is done in parallel with IMPORT, some IMPORT
386-
// jobs may fail because the type is being modified concurrently with the
387-
// IMPORT. Removing the need to pre-create is being tracked with #70987.
377+
// Prepare the tables for ingestion via IMPORT INTO.
388378
const maxTableBatchSize = 5000
389379
currentTable := 0
390380
for currentTable < len(tables) {
@@ -404,6 +394,11 @@ func ImportFixture(
404394
currentTable += maxTableBatchSize
405395
}
406396

397+
pathPrefix := csvServer
398+
if pathPrefix == `` {
399+
pathPrefix = `workload://`
400+
}
401+
407402
// Default to unbounded unless a flag exists for it.
408403
concurrencyLimit := math.MaxInt
409404
if flagser, ok := gen.(workload.Flagser); ok {

pkg/internal/sqlsmith/bulkio.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ func makeImport(s *Smither) (tree.Statement, bool) {
258258

259259
return &tree.Import{
260260
Table: tree.NewUnqualifiedTableName(tab),
261-
Into: true,
262261
FileFormat: "CSV",
263262
Files: files,
264263
Options: tree.KVOptions{

pkg/jobs/jobspb/jobs.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ message ImportDetails {
714714
bool schemas_published = 24;
715715
bool tables_published = 13;
716716

717+
// TODO(yuzefovich): remove this.
717718
bool parse_bundle_schema = 14;
718719

719720
// DefaultIntSize is the integer type that a "naked" int will be resolved

pkg/sql/importer/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ go_library(
3838
"//pkg/jobs/joberror",
3939
"//pkg/jobs/jobspb",
4040
"//pkg/jobs/jobsprofiler",
41-
"//pkg/keys",
4241
"//pkg/kv",
4342
"//pkg/kv/kvpb",
4443
"//pkg/kv/kvserver/kvserverbase",

0 commit comments

Comments
 (0)