voonhous commented on code in PR #18816:
URL: https://github.com/apache/hudi/pull/18816#discussion_r3956837338
##########
hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestCleansCommand.java:
##########
@@ -179,12 +179,10 @@ public void testShowCleanPartitions() {
// There should be two partition path
List<Comparable[]> rows = new ArrayList<>();
- rows.add(new Comparable[]
{HoodieTestCommitMetadataGenerator.DEFAULT_SECOND_PARTITION_PATH,
- HoodieCleaningPolicy.KEEP_LATEST_COMMITS, "1", "0"});
- rows.add(new Comparable[]
{HoodieTestCommitMetadataGenerator.DEFAULT_THIRD_PARTITION_PATH,
- HoodieCleaningPolicy.KEEP_LATEST_COMMITS, "0", "0"});
rows.add(new Comparable[]
{HoodieTestCommitMetadataGenerator.DEFAULT_FIRST_PARTITION_PATH,
HoodieCleaningPolicy.KEEP_LATEST_COMMITS, "1", "0"});
+ rows.add(new Comparable[]
{HoodieTestCommitMetadataGenerator.DEFAULT_SECOND_PARTITION_PATH,
Review Comment:
Agreed, and it was worse than arbitrary -- `DEFAULT_FIRST_PARTITION_PATH` is
`2016/03/15` and `DEFAULT_SECOND_PARTITION_PATH` is `2015/03/16`, so the order
pinned was not even lexicographic. It was just whatever the Avro map iterated
in.
Took the first option, since it fixes the output rather than the assertion:
`showCleanPartitions` now keys the partition metadata through a `TreeMap`
before building the rows, the same treatment `readWriteStatRows` got, and the
test pins that order. `clean showpartitions` is the only caller of it, so
nothing else shifts.
--
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]