@@ -508,6 +508,44 @@ public static Map<Long, String> getCatalogObjectFullNames(List<Long> ids) {
508
508
return catalogIdAndNameMap ;
509
509
}
510
510
511
+ public static Map <Long , String > getSchemaObjectFullNames (List <Long > ids ) {
512
+ List <SchemaPO > schemaPOs =
513
+ SessionUtils .getWithoutCommit (
514
+ SchemaMetaMapper .class , mapper -> mapper .listSchemaPOsBySchemaIds (ids ));
515
+
516
+ if (schemaPOs == null || schemaPOs .isEmpty ()) {
517
+ return new HashMap <>();
518
+ }
519
+
520
+ List <Long > catalogIds =
521
+ schemaPOs .stream ().map (SchemaPO ::getCatalogId ).collect (Collectors .toList ());
522
+
523
+ Map <Long , String > catalogIdAndNameMap = getCatalogIdAndNameMap (catalogIds );
524
+
525
+ HashMap <Long , String > schemaIdAndNameMap = new HashMap <>();
526
+
527
+ schemaPOs .forEach (
528
+ schemaPO -> {
529
+ if (schemaPO .getSchemaId () == null ) {
530
+ schemaIdAndNameMap .put (schemaPO .getSchemaId (), null );
531
+ return ;
532
+ }
533
+
534
+ String catalogName = catalogIdAndNameMap .getOrDefault (schemaPO .getCatalogId (), null );
535
+ if (catalogName == null ) {
536
+ LOG .warn ("The catalog of schema {} may be deleted" , schemaPO .getSchemaId ());
537
+ schemaIdAndNameMap .put (schemaPO .getSchemaId (), null );
538
+ return ;
539
+ }
540
+
541
+ String fullName = DOT_JOINER .join (catalogName , schemaPO .getSchemaName ());
542
+
543
+ schemaIdAndNameMap .put (schemaPO .getSchemaId (), fullName );
544
+ });
545
+
546
+ return schemaIdAndNameMap ;
547
+ }
548
+
511
549
public static Map <Long , String > getCatalogIdAndNameMap (List <Long > catalogIds ) {
512
550
List <CatalogPO > catalogPOs =
513
551
SessionUtils .getWithoutCommit (
0 commit comments