I\'m running this snippet to sort an RDD of points, ordering the RDD and taking the K-nearest points from a given point:
def getKNN(sparkContext:SparkContext, k:
For me helped this, because SparkContext was already created
val sc = SparkContext.getOrCreate()
Before i tried with this
val conf = new SparkConf().setAppName("Testing").setMaster("local").set("spark.driver.allowMultipleContexts", "true")
val sc = SparkContext(conf)
But it was broken when i ran
spark.createDataFrame(rdd, schema)