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

Query with union all, lateral view and Join fails with "cannot find parent in the child operator"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.1
    • 4.0.0-alpha-1
    • Physical Optimizer
    • None

    Description

      The following query with Union, Lateral view and Join will fail during execution with the exception below.

      create table t1(col1 int);
      SELECT 1 AS `col1`
      FROM t1
      UNION ALL
        SELECT 2 AS `col1`
        FROM
          (SELECT col1
           FROM t1
          ) x1
          JOIN
            (SELECT col1
            FROM
              (SELECT 
                Row_Number() over (PARTITION BY col1 ORDER BY col1) AS `col1`
              FROM t1
              ) x2 lateral VIEW explode(map(10,1))`mapObj` AS `col2`, `col3`
            ) `expdObj`      
      
      Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Hive internal error: cannot find parent in the child operator!
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:362) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
              at org.apache.hadoop.hive.ql.exec.MapOperator.initializeMapOperator(MapOperator.java:509) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
              at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:116) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
      

      After debugging, seems we have issues in GenMRFileSink1 class in which we are setting incorrect aliasToWork to the MapWork.

      Attachments

        1. HIVE-20331.1.patch
          7 kB
          Aihua Xu

        Activity

          People

            aihuaxu Aihua Xu
            aihuaxu Aihua Xu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: