niebayes opened a new issue, #24139:
URL: https://github.com/apache/datafusion/issues/24139
Reproduction:
``` sql
DataFusion CLI v54.1.0
> CREATE TABLE metrics (host VARCHAR, bytes_sent DOUBLE, ts BIGINT) AS VALUES
('a', 100.0, 1),
('b', 200.0, 2),
('a', 300.0, 3),
('b', 400.0, 4);
0 row(s) fetched.
Elapsed 0.011 seconds.
> SELECT m.host, m.bytes_sent
FROM metrics m
WHERE m.bytes_sent > (
WITH avg_per_host AS (
SELECT avg(bytes_sent) AS avg_bytes
FROM metrics
WHERE host = m.host
)
SELECT avg_bytes FROM avg_per_host
);
Optimizer rule 'scalar_subquery_to_join' failed
caused by
Schema error: No field named __always_true. Valid fields are
avg_per_host.avg_bytes.
```
--
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]