Use a method inside a UDF function Spark Scala

后端 未结 1 1982
迷失自我
迷失自我 2021-01-28 04:53

I want to use a method located in another class inside a user-designed function but it\'s not working.

I have a method:

 def traitementDataFrameEleve(sc         


        
1条回答
  •  长情又很酷
    2021-01-28 05:48

    It is not allowed to access:

    • distributed data structures (like Dataset or RDD).
    • SparkConext / SparkSession

    from Spark task (transformation, udf application). This is why you get a NPE.

    0 讨论(0)
提交回复
热议问题