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

   ### Describe the bug
   
   This appears to have regressed somewhere between v48 and v49.
   
   
   ### To Reproduce
   
   ```
   DataFusion CLI v50.3.0
   > create table source as
   select null as col
   union all
   select null
   union all
   select null
   ;
   
   0 row(s) fetched. 
   Elapsed 0.009 seconds.
   
   > select
       array_agg(distinct col) within group (order by col)
   from source
   group by all
   ;
   
   Arrow error: Invalid argument error: The data type type Null has no natural 
order
   ```
   
   ### Expected behavior
   
   ```
   DataFusion CLI v48.0.1
   > create table source as
   select null as col
   union all
   select null
   union all
   select null
   ;
   
   0 row(s) fetched. 
   Elapsed 0.011 seconds.
   
   > select
       array_agg(distinct col) within group (order by col)
   from source
   group by all
   ;
   
   +--------------------------------+
   | array_agg(DISTINCT source.col) |
   +--------------------------------+
   | [NULL]                         |
   +--------------------------------+
   1 row(s) fetched. 
   Elapsed 0.019 seconds.
   ```
   
   ### Additional context
   
   The exact semantics of a `Null` typed column is perhaps debatable, but if 
this behavior is intentional, we should probably catch this at planning time 
instead of letting it err at execution time.


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