Github user lianhuiwang commented on the issue:
https://github.com/apache/spark/pull/14111
@cloud-fan I don't think it is a bug of constraints propagation because
filter with the uncorrelated scalar subquery needs to push down due to it can
filter many records.
In addition, like query:
```
with avg_table as
(select avg (key) as avg_key from t3)
select 1 as col
from t3 where key > (select avg_key from avg_table)
union all
select 1 as col from t1 join (select key, value from t2
where key > (select avg_key from avg_table))t on (t1.key = t.key)
```
When BroadcastExchangeExec has one same subquery that also appears in
other places of this query, The first place will at firstly prepare subquery,
But the second place in BroadcastExchangeExec will firstly wait for subquery
because in BroadcastExchangeExec.doPrepare it will execute child plan.
So BroadcastExchangeExec's child plan needs to wait for the subquery
Results that the first place has been submitted.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]