suibianwanwank commented on PR #15281:
URL: https://github.com/apache/datafusion/pull/15281#issuecomment-2769836164

   Assume the data of e1 is:
   ```
   b
   1     
   1     
   2     
   2     
   ```
   
   The data for e2 is:
   ```
   b  a
   2   1  
   2   1 
   ```
   For query:
   ```sql
   select e1.b, (select case when max(e2.a) > 10 then 'a' else 'b' end from t2 
e2 where e2.b = e1.b + 1) from t1 e1;
   ```
   The returned result is:
   ```
   e1.b  expr
   2       b
   2       b
   ```
   
   But for the query:
   ```sql
   SELECT
       e1.b,
       CASE 
           WHEN MAX(e2.a) > 10 THEN 'a' 
           ELSE 'b' 
       END AS result
   FROM t2 e2
   LEFT JOIN t1 e1 ON e2.b = e1.b + 1
   GROUP BY e1.b;
   ```
   The returned result is:
   ```
   e1.b  expr
   2       b
   ```


-- 
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.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to