ueshin opened a new pull request, #47202:
URL: https://github.com/apache/spark/pull/47202

   ### What changes were proposed in this pull request?
   
   Introduce `spark.profile.render` for SparkSession-based profiling.
   
   It uses `flameprof` for the default renderer.
   
   ```
   $ pip install flameprof
   $ bin/pyspark
   ```
   
   ```py
   from pyspark.sql.functions import pandas_udf
   
   spark.conf.set("spark.sql.pyspark.udf.profiler", "perf")
   
   df = spark.range(10)
   
   @pandas_udf("long")
   def add1(x):
       return x + 1
   
   added = df.select(add1("id"))
   added.show()
   
   spark.profile.render(id=2)
   ```
   
   <img width="1103" alt="pyspark-udf-profile" 
src="https://github.com/apache/spark/assets/506656/795972e8-f7eb-4b89-89fc-3d8d18b86541";>
   
   ### Why are the changes needed?
   
   Better debuggability.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, `spark.profile.render` will be available.
   
   ### How was this patch tested?
   
   Added/updated the related tests, and manually.
   
   ### 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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to