无需更改 Python UDF 中的代码即可进行箭头优化.pdf

编号:718962 PDF 30页 1.26MB 下载积分:VIP专享
下载报告请您先登录!

无需更改 Python UDF 中的代码即可进行箭头优化.pdf

1、No-Code Change in Your Python UDF for Arrow OptimizationHyukjin KwonJune 10,2025IntroductionWhat Im presenting todayRun custom logicFlexible data processing and ability to use external Python librariesWidely used in the PySpark ecosystemHowever,they are slow,and traditional Pandas UDFs are hard to l

2、earnOptimization using Apache ArrowCan be turned on or off easily with environment settings and a new parameterSeveral times faster performanceNo need to change existing code just enable one environment setting(Databricks-specific)Integration with Photon is in progressWhat is a Python UDF?Arrow-opti

3、mized Python UDFBenchmark results!5Python UDFWhat is a Python UDF?User Defined FunctionWrite data processing logic directly in Python code within PySparkfrom pyspark.sql.functions import udfudfdef my_upper(s):return s.upper()df.select(my_udf(df.name)7Why is it widely used?Enables interoperability wi

4、th other systems using external libraries not supported by PySparkExisting logic that used to run on a single node can be reused and scaled out across a distributed systemfrom pyspark.sql.functions import udfudfdef my_existing_func(s):import thirdpartyreturn pute(s)df.select(my_existing_func(df.name

5、)8Integrate with existing working logic and external librariesWhy is it widely used?PySparks built-in expressions make it difficult to represent complex conditions or custom logicPython UDFs can solve these cases much more easilyimport refrom pyspark.sql.functions import udfudfdef clean_username(ema

6、il):username=email.split()0return re.sub(ra-zA-Z,username)#Extracts only the username from an#email address and filters out special#characters or digitsdf.select(clean_udf(df.email)9Complex logic hard to express with SQL or the standard DataFrame APIBut the performance is.10Spark ExecutorPython work

友情提示

1、下载报告失败解决办法
2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
4、本站报告下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。

本文(无需更改 Python UDF 中的代码即可进行箭头优化.pdf)为本站 (Flechazo) 主动上传,三个皮匠报告文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三个皮匠报告文库(点击联系客服),我们立即给予删除!

温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。
客服
商务合作
小程序
服务号
折叠