Uploaded image for project: 'Tajo (Retired)'
  1. Tajo (Retired)
  2. TAJO-741

GreedyHeuristicJoinOrderAlgorithm removes some join pairs.

    XMLWordPrintableJSON

Details

    Description

      I found a bug for GreedyHeuristicJoinOrderAlgorithm as follows:

      1. Table Schema

      create external table table1 (id int, name text, score float, type text) using csv with ('csvfile.delimiter'='|') location 'hdfs://server01:9010/tajo/warehouse/table1' ;
      
      create external table table3 (id int, name text, score float, type text) using csv with ('csvfile.delimiter'='|') location 'hdfs://localhost:9010/tajo/warehouse/table3' ;
      
      create external table table4 (id int, name text, score float, type text) using csv with ('csvfile.delimiter'='|') location 'hdfs://localhost:9010/tajo/warehouse/table4' ;
      

      2. Table Data

      2.1 table1
      1|name1-1|1.1|a
      2|name1-2|2.3|b
      3|name1-3|3.4|c
      4|name1-4|4.5|d
      5|name1-5|5.6|e
      
      2.2 table3
      1|name3-1|0.1|a
      2|name3-2|0.2|b
      3|name3-3|0.3|b
      
      2.3 table4
      1|name4-1|22.3|a
      2|name4-2|23.4|b
      3|name4-3|24.5|cc
      5|name4-4|25.6|ee
      6|name4-5|31.1|ff
      7|name4-6|32.3|gg
      

      3. Query

      select a.name, c.name, a.type, c.type from table1 a join table3 b on (a.id = b.id) join table4 c on (b.id = c.id) where a.type =  c.type;
      

      4. Expected Result

      name,  name,  type,  type
      -------------------------------
      name1-1,  name4-1,  a,  a
      name1-2,  name4-2,  b,  b
      

      5. Actual Result

      name,  name,  type,  type
      -------------------------------
      name1-1,  name4-1,  a,  a
      name1-2,  name4-2,  b,  b
      name1-3,  name4-3,  c,  cc
      

      I found that default.a.type (TEXT) = default.c.type (TEXT) is in initiative plan result and FPD result.
      But after executing GreedyHeuristicJoinOrderAlgorithm, it disappeared in logical plan.

      Attachments

        1. TAJO-741_5.patch
          50 kB
          JaeHwa Jung
        2. TAJO-741_4.patch
          38 kB
          JaeHwa Jung
        3. TAJO-741_3.patch
          31 kB
          JaeHwa Jung
        4. TAJO-741_2.patch
          34 kB
          JaeHwa Jung
        5. TAJO-741.patch
          11 kB
          JaeHwa Jung

        Issue Links

          Activity

            People

              blrunner JaeHwa Jung
              blrunner JaeHwa Jung
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: