You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "bersprockets (via GitHub)" <gi...@apache.org> on 2023/05/24 01:44:47 UTC

[GitHub] [spark] bersprockets commented on pull request #41287: [SPARK-43760][SQL] Nullability of scalar subquery results

bersprockets commented on PR #41287:
URL: https://github.com/apache/spark/pull/41287#issuecomment-1560343612

   Is there some setting needed to materialize the issue? Using the queries you added as tests (in `scalar-subquery-predicate.sql` and `scalar-subquery-select.sql`), I am getting your expected results on the master branch:
   ```
   spark-sql (default)> select version();
   3.5.0 5f325ec917ced819a19911b472ebf7eb52010203
   Time taken: 2.69 seconds, Fetched 1 row(s)
   spark-sql (default)> select *
                      > from range(1, 3) t1
                      > where (select sum(c) from (
                      >         select t2.id * t2.id c
                      >         from range (1, 2) t2 where t1.id = t2.id
                      >         group by t2.id
                      >        )
                      > ) is not null;
   1
   Time taken: 1.141 seconds, Fetched 1 row(s)
   spark-sql (default)> select *
                      > from
                      > (
                      >  select t1.id c1, (
                      >                     select sum(c)
                      >                     from (
                      >                       select t2.id * t2.id c
                      >                       from range (1, 2) t2 where t1.id = t2.id
                      >                       group by t2.id
                      >                     )
                      >                    ) c2
                      >  from range (1, 3) t1
                      > ) t
                      > where t.c2 is not null;
   1	1
   Time taken: 0.404 seconds, Fetched 1 row(s)
   spark-sql (default)> 
   ```


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org