Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-20749

Constraints: Null scan optimizer does not remove entire TableScan

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.0.0
    • None
    • CBO, Logical Optimizer
    • 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`
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned Assign to me
            gopalv Gopal Vijayaraghavan

            Dates

              Created:
              Updated:

              Slack

                Issue deployment