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

   ### Is your feature request related to a problem or challenge?
   
   For a brief time we considered it necessary to extend `StateFieldArgs` to 
include the `nullable` derived from the schema of the first argument. So that 
we could define a list item for the accumulator state like this:
   ```rust
   // The data type and the `nullable` is equivalent to schema of the first 
argument
   Field::new("item", args.input_type.clone(), args.input_nullable)
   ```
   _Note: The field `input_nullable` in the above code does not exist in 
`StateFieldArgs`._
   
   Instead we currently do this in code:
   ```rust
   Field::new("item", args.input_type.clone(), true) // allows null values in 
aggregate computation
   ```
   We take advantage of the fact that currently aggregates do no have any 
special treatment for null values present inside list of accumulator state. So 
we can avoid adding a new field like `input_nullable` to `StateFieldArgs`.
   
   ### Describe the solution you'd like
   
   Capture this decision explicitly as a doc comment to benefit future readers 
of code. Add the comment to the following aggregates:
   1. `sum`
   2. `count`
   3. `array_agg`
   4. `nth_value`
   5. `bit_and_or_xor`
   
   There are no code changes required.
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   See https://github.com/apache/datafusion/issues/11433#issuecomment-2238576514


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