Hi all, In CALCITE-1056 <https://issues.apache.org/jira/browse/CALCITE-1056> was optimized planning by returning RelBuilder.empty() when the predicate in the filter is always false.
Drill can dynamically describe columns at runtime, but some of them, or their actual types may be unknown at planning time. Drill is able to return column info for the queries that do not return any results. But with the change which was made in CALCITE-1056 <https://issues.apache.org/jira/browse/CALCITE-1056>, it becomes impossible since for the cases when a predicate is always false, RelBuilder.empty() is returned. Is it acceptable to make RelBuilder.filter() configurable to avoid returning RelBuilder.empty()? I propose to change condition on this line <https://github.com/apache/calcite/blob/fb760a6f4e0cf8ccf92380dd676a72d00402d53e/core/src/main/java/org/apache/calcite/tools/RelBuilder.java#L921> into *x.isAlwaysFalse() && simplify*. Also, some other Hook may be created for this goal when we will decide to use such approach. -- Kind regards, Volodymyr Vysotskyi
