我已经编写了一个pyspark脚本来执行SQL文件,它在最新版本的spark上运行得很好,但目标机器的版本是2.3.1,并且它抛出了异常:
pyspark.sql.utils.AnalysisException: u"Undefined function: 'array_remove'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'
这些似乎没有出现在旧版本中:(有人能提点建议吗,我已经搜索了很多,但都是徒劳的。
我的sql片段失败的原因是
SELECT NIEDC.*, array_join(array_remove(split(groupedNIEDC.appearedIn,'-'), StudyCode),'-') AS subjects_assigned_to_other_studies
发布于 2021-01-14 05:18:39
在spark版本2.4中添加了array_remove和array_join函数。您可以创建一个自定义定义项并注册它,以便在使用this method的查询中使用。
https://stackoverflow.com/questions/65709578
复制相似问题