@@ -268,15 +268,13 @@ impl<'a> Binder {
268
268
) -> Result < Plan > {
269
269
let use_query = matches ! ( & stage_table_info. stage_info. file_format_params,
270
270
FileFormatParams :: Parquet ( fmt) if fmt. missing_field_as == NullAs :: Error ) ;
271
+ let case_sensitive = stage_table_info. copy_into_table_options . column_match_mode
272
+ == Some ( ColumnMatchMode :: CaseSensitive ) ;
271
273
272
274
if use_query {
273
275
let mut select_list =
274
276
Vec :: with_capacity ( copy_into_table_plan. required_source_schema . num_fields ( ) ) ;
275
- let case_sensitive = plan
276
- . stage_table_info
277
- . copy_into_table_options
278
- . column_match_mode
279
- == Some ( ColumnMatchMode :: CaseSensitive ) ;
277
+
280
278
for dest_field in copy_into_table_plan. required_source_schema . fields ( ) . iter ( ) {
281
279
let column = Expr :: ColumnRef {
282
280
span : None ,
@@ -331,6 +329,7 @@ impl<'a> Binder {
331
329
stage_table_info. files_info . clone ( ) ,
332
330
& None ,
333
331
stage_table_info. files_to_copy . clone ( ) ,
332
+ case_sensitive,
334
333
)
335
334
. await ?;
336
335
copy_into_table_plan. project_columns = Some ( bind_context. columns . clone ( ) ) ;
@@ -486,6 +485,8 @@ impl<'a> Binder {
486
485
alias : & Option < TableAlias > ,
487
486
) -> Result < Plan > {
488
487
let table_ctx = self . ctx . clone ( ) ;
488
+ let case_sensitive = stage_table_info. copy_into_table_options . column_match_mode
489
+ == Some ( ColumnMatchMode :: CaseSensitive ) ;
489
490
let ( s_expr, mut from_context) = self
490
491
. bind_stage_table (
491
492
table_ctx,
@@ -494,6 +495,7 @@ impl<'a> Binder {
494
495
stage_table_info. files_info . clone ( ) ,
495
496
alias,
496
497
stage_table_info. files_to_copy . clone ( ) ,
498
+ case_sensitive,
497
499
)
498
500
. await ?;
499
501
0 commit comments