Skip to content
Advertisement

Spark-submit: undefined function parse_url

The function – parse_url always works fine if we working with spark-sql throw sql-client (via thrift server), IPython, pyspark-shell, but it doesn’t work throw spark-submit mode:

JavaScript

The error is:

JavaScript

So, we are using workaround here:

JavaScript

Please, any help with this issue?

Advertisement

Answer

Spark >= 2.0

Same as below, but use SparkSession with Hive support enabled:

JavaScript

Spark < 2.0

parse_url is not a classic sql function. It is a Hive UDF and as such requires HiveContext to work:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement