sririshindra commented on PR #50769:
URL: https://github.com/apache/spark/pull/50769#issuecomment-2845039363

   > @sririshindra here's a test that fails for single-pass Analyzer at the 
moment: 
https://github.com/apache/spark/blob/master/sql/core/src/test/resources/sql-tests/inputs/order-by.sql#L42
   > 
   > I added that query. I will add more related test cases later.
   
   @vladimirg-db I am a bit confused, The query that you pointed me to is as 
follows.
   ```
   -- Order by on top of natural join with count(distinct)
   SELECT
     COUNT(DISTINCT col1)
   FROM
     v1
   NATURAL JOIN
     v2
   GROUP BY
     col1
   ORDER BY
     col1
   ;
   
   SELECT
     COUNT(DISTINCT col1)
   FROM
     v1
   NATURAL JOIN
     v1
   GROUP BY
     col1
   ORDER BY
     col1
   ;
   ```
   
   Shouldn't there be a new test that should be added that covers the scenario 
fixed in this PR. Something like
   ```
   SELECT
     COUNT(DISTINCT col1)
   FROM
     v1
   NATURAL JOIN
     v2
   GROUP BY
     col1
   ORDER BY
     col2
   ;
   
   SELECT
     COUNT(DISTINCT col1)
   FROM
     v1
   NATURAL JOIN
     v1
   GROUP BY
     col1
   ORDER BY
     col2
   ;
   ```
   
   IIUC The second set of queries should fail without this change, because 
"col2" is not present in grouping expressions and is not present in 
`Aggregate`'s output. So, shouldn't you add those queries to the 
sql-tests/inputs as part of this PR?


-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to