findepi opened a new issue, #16134:
URL: https://github.com/apache/datafusion/issues/16134

   ### Describe the bug
   
   When subquery is used in expression context, it must be a scalar subquery, 
i.e. it must produce a singe column and _at most_ one row.
   
   ### To Reproduce
   
   ```
   SELECT
       s.*,
       -- not a scalar subquery
       (SELECT * FROM (VALUES (1), (2)) t(x)) sub 
   FROM (VALUES ('a'), ('b')) s(a);
   ```
   
   ```
   +---+-----+
   | a | sub |
   +---+-----+
   | a | 1   |
   | a | 2   |
   | b | 1   |
   | b | 2   |
   +---+-----+
   ```
   
   ### Expected behavior
   
   an error like the one produced by e.g. Snowflake "Single-row subquery 
returns more than one row."
   
   ### Additional context
   
   _No response_


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