Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Calcite has a set of rules to remove sections of a query plan known never produces any rows. In some cases the whole plan can be removed. Such plans are represented with a single Values operators with no tuples. ex.:
select y + 1 from (select a1 y, b1 z from t1 where b1 > 10) q WHERE 1=0
HiveValues(tuples=[[]])
Other cases when plan has outer join or set operators some branches can be replaced with empty values moving forward in some cases the join/set operator can be removed
select a2, b2 from t2 where 1=0 union select a1, b1 from t1
HiveAggregate(group=[{0, 1}])
HiveTableScan(table=[[default, t1]], table:alias=[t1])
Attachments
Issue Links
- is related to
-
CALCITE-5282 JdbcValues should add CAST on NULL values
- Open
-
HIVE-26582 Cartesian join fails if the query has an empty table when cartesian product edge is used
- Open
-
HIVE-24466 insert queries should not launch job when condition in the query would output 0 rows
- Open
-
HIVE-26559 Skip unnecessary get all partition operations when where condition with 1=0 in CBO.
- Open
-
HIVE-26618 Add setting to turn on/off removing sections of a query plan known never produces rows
- Resolved
-
HIVE-27253 Support array type when query does not produce any rows
- Resolved
-
HIVE-17342 Where condition with 1=0 should be treated similar to limit 0
- Resolved
- is required by
-
HIVE-25953 Drop HiveRelMdPredicates::getPredicates(Join...) to use that of RelMdPredicates
- In Progress
- relates to
-
HIVE-26817 Set column names in result schema when plan has Values root
- Resolved
- links to