yuqi1129 commented on code in PR #9430:
URL: https://github.com/apache/gravitino/pull/9430#discussion_r2650920127
##########
core/src/main/java/org/apache/gravitino/storage/relational/service/FilesetMetaService.java:
##########
@@ -125,13 +119,31 @@ public FilesetEntity
getFilesetByIdentifier(NameIdentifier identifier) {
public List<FilesetEntity> listFilesetsByNamespace(Namespace namespace) {
NamespaceUtil.checkFileset(namespace);
- Long schemaId =
- EntityIdService.getEntityId(
- NameIdentifier.of(namespace.levels()), Entity.EntityType.SCHEMA);
-
- List<FilesetPO> filesetPOs =
- SessionUtils.getWithoutCommit(
- FilesetMetaMapper.class, mapper ->
mapper.listFilesetPOsBySchemaId(schemaId));
+ List<FilesetPO> filesetPOs;
+ if (GravitinoEnv.getInstance().config().get(Configs.CACHE_ENABLED)) {
+ Long schemaId =
+ EntityIdService.getEntityId(
+ NameIdentifier.of(namespace.levels()), Entity.EntityType.SCHEMA);
+ filesetPOs =
+ SessionUtils.getWithoutCommit(
+ FilesetMetaMapper.class, mapper ->
mapper.listFilesetPOsBySchemaId(schemaId));
+ } else {
+ String[] namespaceLevels = namespace.levels();
+ filesetPOs =
+ SessionUtils.getWithoutCommit(
+ FilesetMetaMapper.class,
+ mapper ->
+ mapper.listFilesetPOsByFullQualifiedName(
+ namespaceLevels[0], namespaceLevels[1],
namespaceLevels[2]));
+ if (filesetPOs.isEmpty() || filesetPOs.get(0).getSchemaId() == null) {
Review Comment:
I add a test line in the last line of method
TestFilesetMetaService#testFilesetMultipleLocations
<img width="2464" height="1182" alt="image"
src="https://github.com/user-attachments/assets/2ae16cc3-a5c3-41fe-a8d3-4bde28c418df"
/>
and then the result
<img width="1523" height="914" alt="image"
src="https://github.com/user-attachments/assets/a5707849-2057-412c-a5b6-1afed5ecf45c"
/>
--
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]