Affects Version/s: 1.10.0
Fix Version/s: 1.13.0
The TestParquetWriter.testDecimal() test recently failed. As it turns out, this test never ran properly before against the "old" Parquet reader. Because the store.parquet.use_new_reader was left at a previous value, sometimes the test would run against the "new" reader (and succeed) or against the "old" reader (and fail.)
Once the test was forced to run against the "old" reader, it fails deep in the Parquet record reader in DrillParquetGroupConverter.getConverterForType().
The code attempts to create a Decimal9 writer by calling SingleMapWriter.decimal9(String name) to create the writer. However, the code in this method says:
And, indeed, the assertion is triggered.
As it turns out, the code for Decimal28 shows the proper solution:
That is, pass the scale and precision to this form of the method which actually creates the writer:
Applying the same pattern to for the Parquet Decimal9 and Decimal18 types allows the above test to get past the asserts. Given this error, it is clear that this test could never have run, and so the error in the Parquet reader was never detected.
It also turns out that the test itself is wrong, reversing the validation and test queries:
Given this, it is the Parquet data that is wrong, not the baseline.