@@ -323,6 +323,7 @@ impl Proxy {
323
323
part_info : & PartitionInfo ,
324
324
) -> Result < TableInfo > {
325
325
let get_inner = |i| async move {
326
+ // TODO: the remote engine should provide a method to get all sub table names.
326
327
let sub_partition_table_name = util:: get_sub_partition_name ( base_name, part_info, i) ;
327
328
let table = self
328
329
. instance
@@ -344,16 +345,12 @@ impl Proxy {
344
345
Ok ( table)
345
346
} ;
346
347
347
- let part_num = part_info. get_definition_num ( ) ;
348
- if part_num == 1 {
349
- return get_inner ( 0 ) . await ;
350
- }
351
-
352
- // Loop get sub tables to get table info in case of some of them has problems.
353
- for i in 0 ..part_info. get_definition_num ( ) - 1 {
348
+ let part_num = part_info. get_partition_num ( ) ;
349
+ // Loop all sub tables to get table info in case of some of them has problems.
350
+ for i in 0 ..part_num - 1 {
354
351
let ret = get_inner ( i) . await ;
355
- if let Err ( err ) = ret {
356
- warn ! ( "Failed to get table info, err:{err :?}" ) ;
352
+ if let Err ( e ) = ret {
353
+ warn ! ( "Failed to get table info, err:{e :?}" ) ;
357
354
} else {
358
355
return ret;
359
356
}
@@ -432,7 +429,7 @@ impl Proxy {
432
429
let partition_table_info = table_info_in_meta. unwrap ( ) ;
433
430
434
431
// If table not exists, open it.
435
- let table = self
432
+ let table_info = self
436
433
. get_partition_table_info (
437
434
catalog_name,
438
435
schema_name,
@@ -447,9 +444,9 @@ impl Proxy {
447
444
catalog_name : catalog_name. to_string ( ) ,
448
445
schema_name : schema_name. to_string ( ) ,
449
446
table_name : partition_table_info. name ,
450
- table_schema : table . table_schema ,
451
- engine : table . engine ,
452
- table_options : table . options ,
447
+ table_schema : table_info . table_schema ,
448
+ engine : table_info . engine ,
449
+ table_options : table_info . options ,
453
450
partition_info : partition_table_info. partition_info ,
454
451
} ;
455
452
let create_table_request = CreateTableRequest {
0 commit comments