gatesn commented on issue #14993:
URL: https://github.com/apache/datafusion/issues/14993#issuecomment-2704555746

   > I think I was suggesting this (though I haven't thought about the API it 
too carefully)
   
   That feels like quite a roundabout way to do it, assuming I'm understanding 
correctly. DataFusion would ask which expressions can be pushed down, the 
provider would reply with some (typically) randomly generated column name 
string corresponding to the expression, augment its schema to include these 
expressions, and then  DataFusion will ask for that column as part of the 
projection?
   
   Is there a specific objection to general case? Similarly, I haven't thought 
through this fully in the context of DataFusion.
   
   But roughly, DataFusion asks the table provider which expressions it can 
push-down, and the node is configured with both a projection expression and a 
filter expression. *Exact* same mechanism as filter expressions.
   
   In your example, the expression would be `$.getitem("user").getitem("name")`
   
   An advanced table provider could do with that as it pleases. 
   
   A simple one can construction the old (existing) projection mask with 
`expr.accessed_fields() -> ["user"]` or similar, projects out the fields, and 
then invokes the projection expression:  
   
   `expr.evaluate(self.project(expr.accessed_fields()))`


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