alamb opened a new issue, #13186:
URL: https://github.com/apache/datafusion/issues/13186
### Describe the bug
There is a bug in calculating filter statistics that results in an internal
error
### To Reproduce
Reproducer
```sql
create table cpu (time timestamp, usage_idle float, usage_user float, cpu
int);
insert into cpu values ('1970-01-01 00:00:00', 1.0, 2.0, 3);
copy (select * from cpu) to '/tmp/foo.parquet';
select time, rn
from (
select time, row_number() OVER (ORDER BY usage_idle, time) as rn
from '/tmp/foo.parquet'
where cpu = 3
) where rn > 0;
```
Results in
```
ProjectionPushdown
caused by
Internal error: Only intervals with the same data type are comparable,
lhs:Float32, rhs:UInt64.
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
I expect it to produce a row:
```
+---------------------+----+
| time | rn |
+---------------------+----+
| 1970-01-01T00:00:00 | 1 |
+---------------------+----+
1 row(s) fetched.
```
### Additional context
We found a bug with some of our internal tests in InfluxDB 3.0
I believe this is a regression introduced by
4659096f9c0d30bbea59256af8f8e9b73b921cb7 /
https://github.com/apache/datafusion/pull/12281 which added a projection to
`FilterExec`
However, as the projection is not applied to the statistics, the reported
output schema and statistics are inconsistent which causes issues upstream.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]