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

Parse wide OR and wide AND trees to flat OR/AND trees

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0, 2.0.0
    • Fix Version/s: None
    • Component/s: Logical Optimizer, UDF
    • Labels:
      None

      Description

      Deep trees of AND/OR are hard to traverse particularly when they are merely the same structure in nested form as a version of the operator that takes an arbitrary number of args.

      One potential way to convert the DFS searches into a simpler BFS search is to introduce a new Operator pair named ALL and ANY.

      ALL(A, B, C, D, E) represents AND(AND(AND(AND(E, D), C), B), A)

      ANY(A, B, C, D, E) represents OR(OR(OR(OR(E, D), C),B),A)

      The SemanticAnalyser would be responsible for generating these operators and this would mean that the depth and complexity of traversals for the simplest case of wide AND/OR trees would be trivial.

        Attachments

        1. HIVE-11398.patch
          13 kB
          Jesus Camacho Rodriguez
        2. HIVE-11398.5.patch
          163 kB
          Jesus Camacho Rodriguez
        3. HIVE-11398.4.patch
          163 kB
          Jesus Camacho Rodriguez
        4. HIVE-11398.3.patch
          214 kB
          Jesus Camacho Rodriguez
        5. HIVE-11398.2.patch
          195 kB
          Jesus Camacho Rodriguez

          Issue Links

            Activity

              People

              • Assignee:
                jcamachorodriguez Jesus Camacho Rodriguez
                Reporter:
                gopalv Gopal V
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: