[
https://issues.apache.org/jira/browse/SPARK-55211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18140125#comment-18140125
]
Monica G commented on SPARK-55211:
----------------------------------
Looks like part of this is already in {{{}ConvertToCatalyst{}}}. If the middle
UDF only takes inputs from other Python UDFs and feeds another Python UDF,
Spark can keep the chain in Python. There’s a test for that in
{{{}ConvertToCatalystSuite{}}}.
The case I’m still curious about is {{{}outer(middle(inner(x), y)){}}}, where
{{y}} is a regular column. That falls outside the {{hasOnlyPythonUDFInputs}}
check. I haven’t run it yet to see whether transpiling {{middle}} actually adds
another trip to Python.
> Create an optimizer rule to choose when to use transpiled
> ---------------------------------------------------------
>
> Key: SPARK-55211
> URL: https://issues.apache.org/jira/browse/SPARK-55211
> Project: Spark
> Issue Type: Sub-task
> Components: SQL
> Affects Versions: 4.2.0
> Reporter: Holden Karau
> Priority: Major
>
> Extend the optimizer so:
> It chooses transpiled expressions when they preserve chaining
> It avoids transpilation when it would introduce extra serialization or stage
> breaks
> It can mix transpiled and native UDFs safely
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]