ueshin opened a new pull request, #47284:
URL: https://github.com/apache/spark/pull/47284
### What changes were proposed in this pull request?
Ignores `connect.Column.to_plan` from `with_origin`.
### Why are the changes needed?
Capturing call site on `connect.Column.to_plan` takes long time when
creating proto plans if there are many `connect.Column` objects, although the
call sites on `connect.Column.to_plan` are not necessary.
E.g.,
```py
from pyspark.sql import functions as F
df = createDataFrame()
def schema():
return df.select(*([F.col("a"), F.col("b"), F.col("c"), F.col("d")] *
10)).schema
benchmark(schema)
```
<img width="1109" alt="Screenshot 2024-07-10 at 13 40 33"
src="https://github.com/apache/spark/assets/506656/776978ce-bef9-47ef-b4a5-0d206683736d">
The total function calls / duration for this is:
- before
```
28393570 function calls (28381720 primitive calls) in 3.450 seconds
```
- after
```
109970 function calls (98120 primitive calls) in 0.184 seconds
```
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
The existing tests.
### Was this patch authored or co-authored using generative AI tooling?
No.
--
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]