Affects Version/s: 1.11.0
Fix Version/s: None
The unit test org.apache.drill.exec.physical.impl.join.TestMergeJoinWithSchemaChanges#testMissingAndNewColumns is subject to random failures, perhaps due to changes in file order in readers.
The test builds a number of input files, then executes queries against them. On most runs, the output is fine:
But, on occasion, the query fails:
The line in the exception above:
The above code has not changed in quite some time. The failure is in the "legacy" external sort.
Although the external sort does support schema changes, it only does so in the form of a union vector, which must be enabled. (Other tests validate that schema changes work.)
What is likely happening here is that the sort sometimes sees two files with differing schemas, sometimes multiple threads run so that a single sort sees only one file. This speculation can be verified by looking at a log file (not available in the test run that failed) to see if the scan under the sort read more than one file.
Or, perhaps the order of the JSON files matters. Perhaps file order varies across machines (since the Linux command to list directories does not guarantee order.)