You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "grevend (via GitHub)" <gi...@apache.org> on 2026/10/12 19:09:47 UTC
[I] MIN/MAX fail with an internal error on RunEndEncoded columns [datafusion]
grevend opened a new issue, #26247:
URL: https://github.com/apache/datafusion/issues/26247
### Describe the bug
`MIN` and `MAX` fail with an internal error when their argument is a `RunEndEncoded` column, both as aggregates (grouped or not) and as window functions. The same queries work on plain and `Dictionary`-encoded columns, and other aggregates such as `SUM` and `AVG` already accept `RunEndEncoded` input.
### To Reproduce
In `datafusion-cli`:
```sql
CREATE TABLE t AS SELECT arrow_cast(arrow_cast(column1, 'UInt32'),
'RunEndEncoded("run_ends": non-null Int32, "values": UInt32)') AS v
FROM (VALUES (1), (1), (3));
SELECT max(v) FROM t;
```
fails with:
```
Internal error: Min/Max accumulator not implemented for type RunEndEncoded("run_ends": non-null Int32, "values": UInt32)
```
### Expected behavior
`SELECT max(v) FROM t` returns `3` as `UInt32`, the same as it does for a `UInt32` or `Dictionary(Int32, UInt32)` column.
### Additional context
`MIN`/`MAX` use a user-defined signature, so their argument type comes only from `get_min_max_result_type` in `datafusion/functions-aggregate/src/min_max.rs`. It unwraps `Dictionary` to its value type, which makes the planner insert a cast, but passes `RunEndEncoded` through unchanged, so the accumulator receives a type it has no implementation for.
#24564 / #24565 added `RunEndEncoded` handling to `coerced_from`, but user-defined signatures don't go through that path, so it doesn't cover `MIN`/`MAX`.
### Willingness to contribute
I plan to contribute a fix for this bug independently
--
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: github-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] MIN/MAX fail with an internal error on RunEndEncoded columns [datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #26247: MIN/MAX fail with an internal error on RunEndEncoded columns
URL: https://github.com/apache/datafusion/issues/26247
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org