The PreExecutePrinter and the PostExecutePrinter prints the query input and the output list in alphabetical order in printEntities method.
Our goal is to have the same output from the BeeLine query tests, and the Cli query tests. Since the BeeLine tests are using test specific databases to run the tests, and only converting the results in the end to remove this specific database names from the output, we have to reorder the lists after this conversion.
Raw BeeLine output:
Before patch BeeLine output: