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

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

                Author: ASF GitHub Bot
            Created on: 03/Sep/19 20:46
            Start Date: 03/Sep/19 20:46
    Worklog Time Spent: 10m 
      Work Description: jcamachor commented on pull request #755: HIVE-22107 
Correlated subquery producing wrong schema
URL: https://github.com/apache/hive/pull/755#discussion_r320470567
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java
 ##########
 @@ -199,7 +199,7 @@ private RexNode rewriteScalar(RelMetadataQuery mq, 
RexSubQuery e, Set<Correlatio
 
       // id is appended since there could be multiple scalar subqueries and 
FILTER
       // is created using field name
-      String indicator = "alwaysTrue" + e.rel.getId();
+      String indicator = "trueLiteral";
 
 Review comment:
   Please move this to a private static constant variable at the class level, 
so you do not have to declare multiple times same String value.
   In addition, can this name clash with any other column name in the operator?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


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

            Worklog Id:     (was: 305873)
    Remaining Estimate: 0h
            Time Spent: 10m

> Correlated subquery producing wrong schema
> ------------------------------------------
>
>                 Key: HIVE-22107
>                 URL: https://issues.apache.org/jira/browse/HIVE-22107
>             Project: Hive
>          Issue Type: Bug
>          Components: Logical Optimizer
>    Affects Versions: 4.0.0
>            Reporter: Vineet Garg
>            Assignee: Vineet Garg
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>         Attachments: HIVE-22107.1.patch, HIVE-22107.2.patch, 
> HIVE-22107.3.patch, HIVE-22107.4.patch, HIVE-22107.5.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> *Repro*
> {code:sql}
> create table test(id int, name string,dept string);
> insert into test values(1,'a','it'),(2,'b','eee'),(NULL, 'c', 'cse');
> select distinct 'empno' as eid, a.id from test a where NOT EXISTS (select 
> c.id from test c where a.id=c.id);
> {code}
> {code}
> +-------+--------+
> |  eid  |  a.id  |
> +-------+--------+
> | NULL  | empno  |
> +-------+--------+
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to