https://bigdataschool.ru/blog/udf-features-in-spark-sql.html
Что не так с UDF-функциями в Apache Spark SQL и как это исправить