org.apache.spark.sql.analysisexception:未定义函数:“coalesce”

drnojrws  于 2021-05-27  发布在  Spark
关注(0)|答案(1)|浏览(636)

spark(2.4.5)在尝试执行类似于下面所示的select查询时抛出以下错误。

org.apache.spark.sql.AnalysisException: Undefined function: 'coalesce'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 12
SELECT cast(coalesce(column1,'') as string) as id,cast(coalesce(column2,'2020-01-01') as date) as date1
from 4dea68ed921940e58f027e7146d495a4

表4dea68ed921940e58f027e7146d495a4是在spark from dataframe中创建的临时视图。只有在某些过程之后,此错误才会间歇性地发生。任何帮助都将不胜感激。

dpiehjr4

dpiehjr41#

spark的工作是通过livy提交的。作业包含两个可选参数,只提供了一个。提供所有参数解决了问题。不知道为什么不提供可选参数会导致这种奇怪的行为,但解决了这个问题

相关问题