jayzhan211 commented on issue #10102:
URL: https://github.com/apache/datafusion/issues/10102#issuecomment-2100049278

   > > > How does the selection happens ?
   > > 
   > > 
   > > I think you can select with something like `my_struct_col['foo']` which 
returns the 'foo' field.
   > > However now re-reading this ticket, I think it would be possible to 
create a user defined function like `COLUMN` by Implemening 
[`return_type_from_exprs`](https://docs.rs/datafusion/latest/datafusion/logical_expr/trait.ScalarUDFImpl.html#method.return_type_from_exprs)
 to 🤔
   > 
   > What I was trying to say is that looking at that UDF isn't clear for me 
how the other fields are dropped. It seems that Datafusion performs an 
intersection between the field names returned by the return type and the ones 
returned by array_struct ?
   
   @edmondop
   By default the column name is named c0, c1 ... which defined in 
`array_struct`, so in `return_type` we also find the associated column with 
name c0, c1 ... 


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

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