Github user nsyca commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16012#discussion_r89657974
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
    @@ -989,7 +989,7 @@ class Analyzer(
                   withPosition(u) {
                     try {
                       outer.resolve(nameParts, resolver) match {
    -                    case Some(outerAttr) => OuterReference(outerAttr)
    +                    case Some(outerAttr) => OuterReference(outerAttr)()
    --- End diff --
    
    I have not looked at the code changes closely but got a general idea of 
what the originally reported problem is. I second @hvanhovell to not support 
outer reference in a SELECT clause of a subquery in 2.1. Just fix the named 
expression first.
    
    IN subquery might be okay as it reflects the inner join semantics more or 
less. NOT IN subquery is converted to a special case of an anti-join with extra 
logic for the null value.
    
    ````sql
    select *
    from   tbl_a
    where  tbl_a.c1 not in (select tbl_a.c2 from tbl_b)
    ````
    
    Does the LeftAnti with effectively no join predicate, i.e.,
    
    `(isnull(tbl_a.c1 = tbl_a.c2) || (tbl_a.c1 = tbl_a.c2))`
    
    work correctly today? And if it returns a correct result, is it by design, 
not by chance?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to