adriangb commented on PR #23421:
URL: https://github.com/apache/datafusion/pull/23421#issuecomment-4937347727

   > I think as we discussed this is entirely because the circular dependency 
that would be added, right?
   
   Yes, pretty much. The issue in this case is that `PhysicalExpr` declares the 
trait method. For `ScalarUDF` to serialize itself it needs to call 
`PhysicalExtensionCodec::try_encode_udf`. But in order to get a 
`PhysicalExtensionCodec` that needs to be passed in via 
`PhysicalExpr::to_proto` which results in the requirement that `PhysicalExpr` 
reference `PhysicalExtensionCodec` which then references `ScalarUDF`. But 
`ScalarUDF` also references `PhysicalExpr`, creating a circular dependency.
   
   > The solution here is tactical and it solves your immediate problem, but 
I'm wondering if we should take a more strategic approach and think about 
reorganizing some of our traits & crates so that you never had to do that in 
the first place. 
   
   That sounds great. I spent quite some time trying something along these 
lines, but kept hitting dead ends. Do you have a feeling for this being 
possible?


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