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

PartitionPruner::removeNonPartCols needs to handle AND/OR cases

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

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.1, 2.1.1, 2.2.0
    • 3.0.0
    • Logical Optimizer
    • None

    Description

      create table daysales (customer int) partitioned by (dt string);
      
      insert into daysales partition(dt='2001-01-01') values(1);
      
      select * from daysales where nvl(dt='2001-01-01' and customer=1, false);
      0 ROWS
      

      https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ppr/PartitionPruner.java#L384

      2017-03-05T12:37:47,153  WARN [6f053d71-6ad6-4ad0-833d-337f2d499c82 main] ppr.PartitionPruner: The expr = NVL(((dt = '2001-01-01') and null),false)
      

      Because true and null => null, this turns into NVL(null, false)

      Attachments

        1. HIVE-16113.1.patch
          10 kB
          Gopal Vijayaraghavan
        2. HIVE-16113.2.patch
          38 kB
          Remus Rusanu
        3. HIVE-16113.3.patch
          38 kB
          Remus Rusanu
        4. HIVE-16113.4.patch
          40 kB
          Remus Rusanu

        Issue Links

        Activity

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

          People

            rusanu Remus Rusanu Assign to me
            gopalv Gopal Vijayaraghavan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment