gustavodemorais commented on code in PR #30145:
URL: https://github.com/apache/flink/pull/30145#discussion_r4708566740


##########
flink-table/flink-table-common/src/test/java/org/apache/flink/table/catalog/CatalogPropertiesUtilTest.java:
##########
@@ -112,7 +113,16 @@ void testCatalogTableSerde(ResolvedCatalogBaseTable 
testTable) {
         
assertThat(deserializedTable.getOptions()).isEqualTo(testTable.getOptions());
 
         // So far equals doesn't work as UnresolvedDataType doesn't implement 
equals/hashCode
-        
assertThat(testTable.getOrigin()).hasToString(deserializedTable.toString());
+        assertThat(withSortedOptions(testTable.getOrigin()))
+                .isEqualTo(withSortedOptions(deserializedTable));
+    }
+
+    // toString prints options in map order, which differs between map types 
and JDKs
+    private static String withSortedOptions(CatalogBaseTable table) {
+        final Map<String, String> sorted = new TreeMap<>(table.getOptions());
+        return table instanceof CatalogTable
+                ? ((CatalogTable) table).copy(sorted).toString()

Review Comment:
   Minor: since options are already compared on L112, 
`copy(Collections.emptyMap())` would also do it, but sorted is fine too.



-- 
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]

Reply via email to