You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "neilconway (via GitHub)" <gi...@apache.org> on 2026/04/14 14:13:55 UTC
[I] Deduplicate uncorrelated scalar subqueries [datafusion]
neilconway opened a new issue, #21619:
URL: https://github.com/apache/datafusion/issues/21619
### Is your feature request related to a problem or challenge?
Per https://github.com/apache/datafusion/pull/21240#discussion_r3065275637 , if the same subquery (identical SQL text) appears multiple times in a query, it will be planned and evaluated multiple times. In principle it should be fine to evaluate it only once, provided the subquery doesn't contain any volatile functions (e.g., `random()`).
### Describe the solution you'd like
_No response_
### Describe alternatives you've considered
_No response_
### 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: 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] Deduplicate uncorrelated scalar subqueries [datafusion]
Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on issue #21619:
URL: https://github.com/apache/datafusion/issues/21619#issuecomment-4611626528
```
DataFusion CLI v53.1.0
> SELECT (SELECT random()) - (SELECT random());
+---------------------+
| random() - random() |
+---------------------+
| -0.2737928838032696 |
+---------------------+
1 row(s) fetched.
Elapsed 0.003 seconds.
```
On main:
```
+---------------------+
| random() - random() |
+---------------------+
| 0.0 |
+---------------------+
1 row(s) fetched.
Elapsed 0.008 seconds.
```
I'm looking into this.
--
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