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

   ### Is your feature request related to a problem or challenge?
   
   
https://github.com/apache/datafusion/blob/daeb6597a0c7344735460bb2dce13879fd89d7bd/datafusion/expr/src/logical_plan/plan.rs#L2546-L2564
   
   Introduced by #10850 but we don't have any docs on it to explain when to use 
this and what it expects from it's inputs. Also would be nice to fix the error 
message to be more descriptive.
   
   ### Describe the solution you'd like
   
   Docstring highlighting when to use it (apparently more performant than 
`try_new` but need to uphold some invariants regarding the schema as shown by 
the error check), also update the error message. In #17770 we see an error 
message appear like:
   
   ```
   Error during planning: Window has mismatch between number of expressions (1) 
and number of fields in schema (0)
   ```
   
   For query:
   
   ```sql
   WITH suppliers AS (
     SELECT *
     FROM (VALUES (1, 10.0), (1, 20.0)) AS t(nation, acctbal)
   )
   SELECT
     ROW_NUMBER() OVER (PARTITION BY nation ORDER BY acctbal DESC) AS rn
   FROM suppliers AS s
   WHERE acctbal > (
     SELECT AVG(acctbal) FROM suppliers
   );
   ```
   
   But this doesn't make sense (how is "number of fields in schema" zero?).
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to