izveigor opened a new issue, #6633: URL: https://github.com/apache/arrow-datafusion/issues/6633
### Describe the bug Median with even number of decimal128 not working (it works with an odd number of decimals). ### To Reproduce ``` ❯ select * from decimal_table; +--------+ | a | +--------+ | 1.1100 | | 1.5600 | | 2.5100 | +--------+ 3 rows in set. Query took 0.000 seconds. ❯ select median(a) from decimal_table; +-------------------------+ | MEDIAN(decimal_table.a) | +-------------------------+ | 1.5600 | +-------------------------+ 1 row in set. Query took 0.037 seconds. ❯ insert into decimal_table values (3.14::decimal); 0 rows in set. Query took 0.001 seconds. ❯ select median(a) from decimal_table; Internal error: Unsupported type in MedianAccumulator: Decimal128(Some(40700),10,4). This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker ``` ### Expected behavior ``` ❯ select * from decimal_table; +--------+ | a | +--------+ | 1.1100 | | 1.5600 | | 2.5100 | +--------+ 3 rows in set. Query took 0.000 seconds. ❯ select median(a) from decimal_table; +-------------------------+ | MEDIAN(decimal_table.a) | +-------------------------+ | 2.0340 | +-------------------------+ 1 row in set. Query took 0.037 seconds. ❯ insert into decimal_table values (3.14::decimal); 0 rows in set. Query took 0.001 seconds. ❯ select median(a) from decimal_table; Internal error: Unsupported type in MedianAccumulator: Decimal128(Some(40700),10,4). This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker ``` ### Additional context _No response_ -- 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]
