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

lateral view followed by mapjoin should not be allowed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Query Processor
    • None

    Description

      Consider the following queries:

      drop table lazy_array_map;
      create table lazy_array_map (map_col map<int,string>, array_col array <string> );
      INSERT OVERWRITE TABLE lazy_array_map select map(1,'one',2,'two',3,'three'), array('100','200','300') FROM src LIMIT 1;

      select /*+ MAPJOIN(a) */ * from
      (SELECT array_col, myCol from lazy_array_map lateral view explode(array_col) X AS myCol) subq1
      join
      src a
      on subq1.myCol = a.key;

      select /*+ MAPJOIN(subq1) */ * from
      (SELECT array_col, myCol from lazy_array_map lateral view explode(array_col) X AS myCol) subq1
      join
      src a
      on subq1.myCol = a.key;

      The last 2 queries should throw an error, but they work fine right now.
      The same affect can be achieved without a mapjoin hint.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              namit Namit Jain
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: