This is an automated email from the ASF dual-hosted git repository.
zhoujinsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git
The following commit(s) were added to refs/heads/master by this push:
new dad2c9fbe [Hotfix][ams] Fix ResourceMapper.selectResourcesByGroup
result mapping (#4194)
dad2c9fbe is described below
commit dad2c9fbea624e159653c123e2747c6091ea9cc0
Author: Darcy <[email protected]>
AuthorDate: Tue Apr 21 21:18:34 2026 +0800
[Hotfix][ams] Fix ResourceMapper.selectResourcesByGroup result mapping
(#4194)
The @Result property names did not match the fields on Resource:
- group -> groupName
- container -> containerName
- totalMemory -> memoryMb
The start_time column and its @Result mapping were removed because
Resource has no startTime field; MyBatis would silently drop it anyway.
This method is currently only declared/implemented via
DefaultOptimizerManager.listResourcesByGroup with no caller on master,
so no behavioral change is observable. Fixing it now unblocks any future
caller (e.g. auto-restart feature) from getting back empty-field Resource
objects.
---
.../apache/amoro/server/persistence/mapper/ResourceMapper.java | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git
a/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/ResourceMapper.java
b/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/ResourceMapper.java
index a52da89e5..319b214f5 100644
---
a/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/ResourceMapper.java
+++
b/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/ResourceMapper.java
@@ -59,15 +59,14 @@ public interface ResourceMapper {
ResourceGroup selectResourceGroup(@Param("resourceGroup") String groupName);
@Select(
- "SELECT resource_id, group_name, container_name, start_time,
thread_count, total_memory, properties"
+ "SELECT resource_id, group_name, container_name, thread_count,
total_memory, properties"
+ " FROM resource WHERE group_name = #{resourceGroup}")
@Results({
@Result(property = "resourceId", column = "resource_id"),
- @Result(property = "group", column = "group_name"),
- @Result(property = "container", column = "container_name"),
- @Result(property = "startTime", column = "start_time", typeHandler =
Long2TsConverter.class),
+ @Result(property = "groupName", column = "group_name"),
+ @Result(property = "containerName", column = "container_name"),
@Result(property = "threadCount", column = "thread_count"),
- @Result(property = "totalMemory", column = "total_memory"),
+ @Result(property = "memoryMb", column = "total_memory"),
@Result(property = "properties", column = "properties", typeHandler =
Map2StringConverter.class)
})
List<Resource> selectResourcesByGroup(@Param("resourceGroup") String
groupName);