I executed one simple SQL query and wanted to save the output as a text file on my server. It started to run for almost 3 days and nothing happened. Can you say what is the problem? Or maybe what other codes can I use to save and measure the run time of queries over spark scala?
val in = spark.read.option("header","true").csv("mytablename.csv")
in.registerTempTable("mytablename")
val dn = spark.sql("select * from mytablename").show(10)
val df = spark.time(df.show(10))
df.write.text("file://hadoop/location/text.txt")