Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Currently there is a collection of rules (i.e., PruneEmptyRules) which remove sections of a query plan when it does not produce any rows.
At the moment, the removal requires an empty Values operator to be in the plan in order to take effect. However, there are cases where queries involve empty relations/tables and in that case we could remove parts of the plan as well.
The information if a relation is empty or not can be derived from metadata. For example, we could check if the RelMdMaxRowCount returns zero to derive that the relation is empty.
Implementation wise there are various alternatives to consider:
- modify the existing PruneEmptyRule to consider metadata;
- add new pruning rules relying exclusively on metadata;
- add new rules checking metadata and turning the empty relation to an empty Values which can then be handled by existing rules
Attachments
Issue Links
- is related to
-
HIVE-26582 Cartesian join fails if the query has an empty table when cartesian product edge is used
- Open
- links to