Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
4.0.0
-
None
-
None
Description
With PK constraints on store table, the following query fails to remove the entire join (and cut the query short).
explain select count(1) from store_sales, store where ss_store_sk = s_store_sk and s_store_sk is null and ss_sold_date_sk between 2450816 and 2450816+365;
Calcite generates the following optimized query, but the NullScan optimizer does not kick in for the query.
SELECT COUNT(*) AS `$f0` FROM (SELECT * FROM (SELECT 0 AS `DUMMY` FROM `tpcds_bin_partitioned_orc_10000`.`store_sales`) AS `t` WHERE FALSE) AS `t0`, (SELECT * FROM (SELECT 0 AS `DUMMY` FROM `tpcds_bin_partitioned_orc_10000`.`store`) AS `t1` WHERE FALSE) AS `t2`