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

LEFT OUTER JOIN does not generate transitive IS NOT NULL filter on right side (HiveJoinAddNotNullRule bails out for outer joins)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0-alpha-1
    • CBO

    Description

      For instance, given the following query:

      SELECT t0.col0, t0.col1
      FROM
        (
          SELECT col0, col1 FROM tab
        ) AS t0
        LEFT JOIN
        (
          SELECT col0, col1 FROM tab
        ) AS t1
      ON t0.col0 = t1.col0 AND t0.col1 = t1.col1
      

      we could still infer that col0 and col1 cannot be null in the right input and introduce the corresponding filter predicate. Currently, the rule just bails out if it is not an inner join.
      https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java#L79

      Attachments

        1. HIVE-21230.1.patch
          20 kB
          Vineet Garg
        2. HIVE-21230.2.patch
          1.28 MB
          Vineet Garg
        3. HIVE-21230.3.patch
          1.28 MB
          Vineet Garg
        4. HIVE-21230.4.patch
          1.28 MB
          Vineet Garg
        5. HIVE-21230.5.patch
          1.28 MB
          Vineet Garg
        6. HIVE-21230.6.patch
          1.28 MB
          Vineet Garg
        7. HIVE-21230.7.patch
          1.23 MB
          Vineet Garg
        8. HIVE-21230.8.patch
          1.24 MB
          Vineet Garg

        Issue Links

          Activity

            People

              vgarg Vineet Garg
              jcamacho Jesús Camacho Rodríguez
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: