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

recognize transitivity of predicates on join keys

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

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.6.0
    • 0.8.0
    • Query Processor
    • None
    • Reviewed

    Description

      Given

      set hive.mapred.mode=strict;
      create table invites (foo int, bar string) partitioned by (ds string);
      create table invites2 (foo int, bar string) partitioned by (ds string);
      select count(*) from invites join invites2 on invites.ds=invites2.ds where invites.ds='2011-01-01';
      

      currently an error occurs:

      Error in semantic analysis: No Partition Predicate Found for Alias "invites2" Table "invites2"
      

      The optimizer should be able to infer a predicate on invites2 via transitivity. The current lack places a burden on the user to add a redundant predicate, and makes impossible (at least in strict mode) join views where both underlying tables are partitioned (the join select list has to pick one of the tables arbitrarily).

      Attachments

        1. HIVE-1989v1.patch
          7 kB
          Charles Chen
        2. HIVE-1989v10.patch
          459 kB
          Charles Chen
        3. HIVE-1989v11.patch
          388 kB
          Charles Chen
        4. HIVE-1989v12.patch
          437 kB
          Charles Chen
        5. HIVE-1989v4.patch
          249 kB
          Charles Chen
        6. HIVE-1989v5-WITH-HIVE-2382v1.patch
          265 kB
          Charles Chen
        7. HIVE-1989v6-WITH-HIVE-2383v1.patch
          493 kB
          Charles Chen
        8. HIVE-1989v8.patch
          422 kB
          Charles Chen
        9. HIVE-1989v9.patch
          474 kB
          Charles Chen

        Issue Links

        Activity

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

          People

            ccy Charles Chen Assign to me
            jvs John Sichi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment