diff --git a/paimon-core/src/test/java/org/apache/paimon/table/system/TagsTableTest.java b/paimon-core/src/test/java/org/apache/paimon/table/system/TagsTableTest.java index 8f8029cde785..7ee8cd53d75c 100644 --- a/paimon-core/src/test/java/org/apache/paimon/table/system/TagsTableTest.java +++ b/paimon-core/src/test/java/org/apache/paimon/table/system/TagsTableTest.java @@ -40,6 +40,8 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.TreeMap; import static org.assertj.core.api.Assertions.assertThat; @@ -89,11 +91,12 @@ void testTagsTable() throws Exception { } private List getExpectedResult() { - List internalRows = new ArrayList<>(); + Map tagToRows = new TreeMap<>(); for (Pair snapshot : tagManager.tagObjects()) { Tag tag = snapshot.getKey(); String tagName = snapshot.getValue(); - internalRows.add( + tagToRows.put( + tagName, GenericRow.of( BinaryString.fromString(tagName), tag.id(), @@ -109,6 +112,11 @@ private List getExpectedResult() { : BinaryString.fromString( tag.getTagTimeRetained().toString()))); } + + List internalRows = new ArrayList<>(); + for (Map.Entry entry : tagToRows.entrySet()) { + internalRows.add(entry.getValue()); + } return internalRows; } }