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

UNION ALL throws SemanticException when trying to remove partition predicates: fail to find child from parent

    XMLWordPrintableJSON

Details

    Description

      Reproduce sql:

      drop table if exists tez_test_t1;
      create table tez_test_t1(md_exper string);
      insert into tez_test_t1 values('tez_test_t1-md_expr');

      drop table if exists tez_test_t5;
      create table tez_test_t5(md_exper string, did string);
      insert into tez_test_t5 values('tez_test_t5-md_expr','tez_test_t5-did');

      drop table if exists tez_test_t2;
      create table tez_test_t2(did string);
      insert into tez_test_t2 values('tez_test_t2-did');

      SELECT  md_exper,null as ads_h5_gap , null as first_login_did, null as inclick_did
          FROM tez_test_t1 
      UNION ALL 
      SELECT md_exper, ads_h5_gap , 
         NULL AS first_login_did,did AS  inclick_did
         FROM tez_test_t5  
         LATERAL VIEW explode(split('0,6', ',')) gaps AS ads_h5_gap 
      UNION ALL 
         SELECT '' AS md_exper,'0,6' as ads_h5_gap ,  
         did AS first_login_did, NULL AS inclick_did
         FROM tez_test_t2 
         GROUP BY did;

       

      StackTrace

      2022-11-27T09:31:06,801 ERROR [21d35a7f-9625-46ae-9c3d-13ca925f55cb main]: ql.Driver ()) - FAILED: SemanticException Exception when trying to remove partition predicates: fail to find child from parent

      org.apache.hadoop.hive.ql.parse.SemanticException: Exception when trying to remove partition predicates: fail to find child from parent

              at org.apache.hadoop.hive.ql.exec.Operator.removeChildAndAdoptItsChildren(Operator.java:859)

              at org.apache.hadoop.hive.ql.parse.GenTezUtils.removeUnionOperators(GenTezUtils.java:348)

              at org.apache.hadoop.hive.ql.parse.TezCompiler.generateTaskTree(TezCompiler.java:573)

              at org.apache.hadoop.hive.ql.parse.TaskCompiler.compile(TaskCompiler.java:241)

              at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:12333)

              at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:330)

              at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:286)

      Attachments

        Issue Links

          Activity

            People

              kkasa Krisztian Kasa
              houzhizhen Zhizhen Hou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m