What's the difference between UDF and custom expression as far as Spark DataFrame/SQL context is concerned? In particular, are both of them opaque to Catalyst? What are the reasons to use one vs the other?
(Custom expressions were mentioned, for example, here - although in that case they weren't needed.)