yuqi1129 commented on code in PR #6601:
URL: https://github.com/apache/gravitino/pull/6601#discussion_r1987113581
##########
core/src/main/java/org/apache/gravitino/storage/relational/service/MetadataObjectService.java:
##########
@@ -214,4 +233,407 @@ public static String getMetadataObjectFullName(String
type, long metadataObjectI
return fullName;
}
+
+ /**
+ * Retrieves a map of Metalake object IDs to their full names.
+ *
+ * @param ids A list of Metalake object IDs to fetch names for.
+ * @return A Map where the key is the Metalake ID and the value is the
Metalake full name. The map
+ * may contain null values for the names if its parent object is
deleted. Returns an empty map
+ * if no Metalake objects are found for the given IDs. {@code @example}
value of metalake full
+ * name: "metalake1.catalog1.schema1.table1"
+ */
+ public static Map<Long, String> getMetalakeObjectsFullName(List<Long> ids) {
+ List<MetalakePO> metalakePOs =
+ SessionUtils.getWithoutCommit(
+ MetalakeMetaMapper.class, mapper ->
mapper.listMetalakePOsByMetalakeIds(ids));
+
+ if (metalakePOs == null || metalakePOs.isEmpty()) {
+ return new HashMap<>();
+ }
+
+ HashMap<Long, String> metalakeIdAndNameMap = new HashMap<>();
+
+ metalakePOs.forEach(
+ metalakePO -> {
+ if (metalakePO.getMetalakeId() == null) {
Review Comment:
Again, I can't get when will the `MetalakeId` is null and `metalakePO` is
NOT null.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]