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

Provide support for complex expressions in ON clauses for OUTER joins

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
    • 2.2.0
    • 2.2.0
    • CBO, Parser
    • None

    Description

      Follow-up of HIVE-15211.

      Currently, we have some restrictions on the predicates that we can use in ON clauses for outer joins.

      This patch is an extension to overcome these restrictions. Follow-up work will focus on identifying some cases, such as disjunctive predicates, that can be run more efficiently than with a cartesian product.

      It will allow to write queries that currently fail in Hive such as:

      -- Disjunctions
      SELECT *
      FROM src1 LEFT OUTER JOIN src
      ON (src1.key=src.key
        OR src1.value between 100 and 102
        OR src.value between 100 and 102)
      LIMIT 10;
      -- Conjunction with multiple inputs references in one side
      SELECT *
      FROM src1 RIGHT OUTER JOIN src
      ON (src1.key+src.key >= 100
        AND src1.key+src.key <= 102)
      LIMIT 10;
      -- Conjunct with no references
      SELECT *
      FROM src1 FULL OUTER JOIN src
      ON (src1.value between 100 and 102
        AND src.value between 100 and 102
        AND true)
      LIMIT 10;
      

      Attachments

        1. HIVE-15251.01.patch
          519 kB
          Jesus Camacho Rodriguez
        2. HIVE-15251.patch
          462 kB
          Jesus Camacho Rodriguez

        Issue Links

        Activity

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

          People

            jcamachorodriguez Jesus Camacho Rodriguez Assign to me
            jcamachorodriguez Jesus Camacho Rodriguez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment