You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/12 16:07:03 UTC
[GitHub] [arrow-datafusion] jackwener commented on issue #3864: Replace `Filter: Boolean(false)` with `EmptyRelation`
jackwener commented on issue #3864:
URL: https://github.com/apache/arrow-datafusion/issues/3864#issuecomment-1312516923
Datafusion only can propagate `EmptyRelation` just `optimizer_config.max_passes` times. Because we depend on multi-passes optimization to multiply elimination.
In other words, we currently don't have really `EmptyRelationPropagation`.
We can reproduce it.
After 3 optimizations, the plan can continue to be eliminated.
```sql
CREATE TABLE IF NOT EXISTS t1 AS VALUES(1,'HELLO'),(12,'DATAFUSION');
CREATE TABLE IF NOT EXISTS t2 AS VALUES(1,'HELLO'),(12,'DATAFUSION');
CREATE TABLE IF NOT EXISTS t3 AS VALUES(1,'HELLO'),(12,'DATAFUSION');
explain verbose select column1 from t1 join ( select column1 from t2 join (select column1 from t3 where false ) as ta2 on t2.column1 = ta2.column1 ) as ta1 on t1.column1 = ta1.column1;
```
The `root` cause is currently optimization is incomplete. We just have top-down optimize, we don't have bottom-up optimize.
If we have bottom-up optimize, we can do `EmptyRelationPropagation` in once optimization.
--
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@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org