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

Make comparison of filter predicates in q files deterministic

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • Testing Infrastructure
    • None

    Description

      I have been hitting this issue while submitting patches to test HIVE-17432.

      Basically, the order on which the rewriting might create the children of AND operations is not deterministic. Thus, tests might fail because the created golden file is not the same, thought the test should pass because they just simply do not follow same order:

      predicate: ((d_year >= 1992) and (d_year <= 1997) and ((c_city = 'UNITED KI1') or (c_city = 'UNITED KI5')) and ((s_city = 'UNITED KI1') or (s_city = 'UNITED KI5'))) (type: boolean)
      
      predicate: ((d_year <= 1997) and (d_year >= 1992) and ((c_city = 'UNITED KI1') or (c_city = 'UNITED KI5')) and ((s_city = 'UNITED KI1') or (s_city = 'UNITED KI5'))) (type: boolean)
      

      This patches fixes the issue by sorting the children of some expressions (currently AND and OR children) when we run explain plan and we are running in test mode.

      Attachments

        1. HIVE-17510.patch
          15 kB
          jcamachorodriguez
        2. HIVE-17510.01.patch
          1.16 MB
          jcamachorodriguez

        Issue Links

          Activity

            People

              jcamacho Jesús Camacho Rodríguez
              jcamacho Jesús Camacho Rodríguez
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: