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

   ### Describe the bug
   
   I'm looking for a way to pass down the input field into my UDAF, as I need 
the field metadata to access the Arrow extension metadata. It looks like 
[`AccumulatorArgs.schema`](https://docs.rs/datafusion/latest/datafusion/logical_expr/function/struct.AccumulatorArgs.html#structfield.schema)
 is the intended way to do this, but this is empty for scalar input.
   
   ### To Reproduce
   
   ```
   git clone https://github.com/geoarrow/geoarrow-rs
   cd geoarrow-rs
   git checkout 3e45aa368715ccff7ba0a6f76abd11539ba548b3
   cargo test -p geodatafusion udf::native::bounding_box::extent::test::test -- 
--nocapture
   ```
   
   This tests the following SQL:
   ```sql
   select ST_Extent(ST_GeomFromText('POLYGON((743238 2967416,743238 2967450,
                                 743265 2967450,743265.625 2967416,743238 
2967416))'));
   ```
   
   You can see
   ```
   [rust/geodatafusion/src/udf/native/bounding_box/extent.rs:63:9] 
&acc_args.schema = Schema {
       fields: [],
       metadata: {},
   }
   ```
   where the `Schema` passed in to the accumulator is empty.
   
   I figure that here the `Schema` is supposed to be non-empty with the correct 
input field types.
   
   ### Expected behavior
   
   `Schema` should include the input fields from the scalar input.
   
   ### Additional context
   
   cc @timsaucer as you asked to let you know if I hit any other bugs with 
extension types.


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