Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在其他会话或视图中使用我的 udf,所以有没有办法注册用 Python 或 scala 编写的永久 Spark UDF?
你不能。Spark 没有“服务器”,它与资源管理器(Yarn/Kubernetes/Mesos)对话,并为每个作业重新部署自己。您需要将代码作为您提交的包的一部分,或者在您包含在作业中的 jar/zip 文件中的预包中。在这两种情况下,您都需要注册 udf。