|
31 | 31 | import org.apache.gravitino.storage.relational.mapper.MetalakeMetaMapper;
|
32 | 32 | import org.apache.gravitino.storage.relational.mapper.ModelMetaMapper;
|
33 | 33 | import org.apache.gravitino.storage.relational.mapper.SchemaMetaMapper;
|
34 |
| -import org.apache.gravitino.storage.relational.mapper.TableColumnMapper; |
35 | 34 | import org.apache.gravitino.storage.relational.mapper.TableMetaMapper;
|
36 | 35 | import org.apache.gravitino.storage.relational.mapper.TopicMetaMapper;
|
37 | 36 | import org.apache.gravitino.storage.relational.po.CatalogPO;
|
@@ -432,48 +431,6 @@ public static Map<Long, String> getTopicObjectsFullName(List<Long> topicIds) {
|
432 | 431 | return topicIdAndNameMap;
|
433 | 432 | }
|
434 | 433 |
|
435 |
| - /** |
436 |
| - * Retrieves a map of Column object IDs to their full names. |
437 |
| - * |
438 |
| - * @param columnIds A list of Column object IDs to fetch names for. |
439 |
| - * @return A Map where the key is the Column ID and the value is the Column full name. The map may |
440 |
| - * contain null values for the names if its parent object is deleted. Returns an empty map if |
441 |
| - * no Column objects are found for the given IDs. {@code @example} value of column full name: |
442 |
| - * "catalog1.schema1.table1.column1" |
443 |
| - */ |
444 |
| - public static Map<Long, String> getColumnObjectsFullName(List<Long> columnIds) { |
445 |
| - List<ColumnPO> columnPOs = |
446 |
| - SessionUtils.getWithoutCommit( |
447 |
| - TableColumnMapper.class, mapper -> mapper.listColumnPOsByColumnIds(columnIds)); |
448 |
| - |
449 |
| - if (columnPOs == null || columnPOs.isEmpty()) { |
450 |
| - return new HashMap<>(); |
451 |
| - } |
452 |
| - |
453 |
| - List<Long> tableIds = columnPOs.stream().map(ColumnPO::getTableId).collect(Collectors.toList()); |
454 |
| - |
455 |
| - Map<Long, String> tableIdAndNameMap = getTableObjectsFullName(tableIds); |
456 |
| - |
457 |
| - HashMap<Long, String> columnIdAndNameMap = new HashMap<>(); |
458 |
| - |
459 |
| - columnPOs.forEach( |
460 |
| - columnPO -> { |
461 |
| - // since the table can be deleted, we need to check the |
462 |
| - // null value, and when table is deleted, we will set fullName of columnPO to null |
463 |
| - String tableName = tableIdAndNameMap.getOrDefault(columnPO.getTableId(), null); |
464 |
| - if (tableName == null) { |
465 |
| - LOG.warn("The table of column {} may be deleted", columnPO.getColumnId()); |
466 |
| - columnIdAndNameMap.put(columnPO.getColumnId(), null); |
467 |
| - return; |
468 |
| - } |
469 |
| - |
470 |
| - String fullName = DOT_JOINER.join(tableName, columnPO.getColumnName()); |
471 |
| - columnIdAndNameMap.put(columnPO.getColumnId(), fullName); |
472 |
| - }); |
473 |
| - |
474 |
| - return columnIdAndNameMap; |
475 |
| - } |
476 |
| - |
477 | 434 | /**
|
478 | 435 | * Retrieves a map of Catalog object IDs to their full names.
|
479 | 436 | *
|
|
0 commit comments