[ 
https://issues.apache.org/jira/browse/HIVE-26779?focusedWorklogId=859396&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-859396
 ]

ASF GitHub Bot logged work on HIVE-26779:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Apr/23 11:46
            Start Date: 27/Apr/23 11:46
    Worklog Time Spent: 10m 
      Work Description: kasakrisz commented on PR #4272:
URL: https://github.com/apache/hive/pull/4272#issuecomment-1525549613

   @aturoczy 
   I agree. But this one is just 972 lines :) Look at `SemanticAnalyzer`.
   I'm not aware of any ongoing or planned refactor.
   Since one of the inputs of these methods is a query plan writing unit tests 
requires some plan generating logic which gives us the ability to define plans 
in an easily understand way.
   For example 
   * calling the parser and compiler on a test sql
   * or implement utility methods to build a Hive operator tree similar to 
Calcite `RelBuilder`.
   




Issue Time Tracking
-------------------

    Worklog Id:     (was: 859396)
    Time Spent: 40m  (was: 0.5h)

> UNION ALL throws SemanticException when trying to remove partition 
> predicates: fail to find child from parent
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-26779
>                 URL: https://issues.apache.org/jira/browse/HIVE-26779
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 4.0.0-alpha-2
>            Reporter: Zhizhen Hou
>            Assignee: Zhizhen Hou
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> {quote}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;
> {quote}
>  
> 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)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to