scala - Spark error: "ERROR Utils: Exception while deleting Spark temp dir:" -
edit: adding details requested
while running simple spark code written in scala, locally on windows 7 64bit in administrator mode, execution ends in error detailed below. code write output expected (saveastextfile
) before throwing error.
(based on google search, others have same problem adding sc.stop()
@ end of code suggested on board not help.)
the code:
import org.apache.spark.sparkcontext import org.apache.spark.sparkconf object test { def main(args: array[string]) { system.setproperty("hadoop.home.dir", "c:/prog/winutil/") val inputfile1 = "./textinput.txt" val conf = new sparkconf().setappname("testing") val sc = new sparkcontext(conf) val data = sc.textfile(inputfile1) val outputfile = "./output" data.saveastextfile(outputfile) sc.stop() } }
and error message:
error utils: exception while deleting spark temp dir: [userpath]\appdata\local\temp\spark-a790ba3f-af1e-4d2b-80e8-4085caaad04b\userfiles -904e004e-4ca2-43a8-8689-684cc401b827 java.io.ioexception: failed delete: [userpath]\appdata\local\temp\spark -a790ba3f-af1e-4d2b-80e8-4085caaad04b\userfiles-904e004e-4ca2-43a8-8689-684cc401 b827 @ org.apache.spark.util.utils$.deleterecursively(utils.scala:933) @ org.apache.spark.util.utils$$anon$4$$anonfun$run$1$$anonfun$apply$mcv $sp$2.apply(utils.scala:181) @ org.apache.spark.util.utils$$anon$4$$anonfun$run$1$$anonfun$apply$mcv $sp$2.apply(utils.scala:179) @ scala.collection.mutable.hashset.foreach(hashset.scala:79) @ org.apache.spark.util.utils$$anon$4$$anonfun$run$1.apply$mcv$sp(utils .scala:179) @ org.apache.spark.util.utils$$anon$4$$anonfun$run$1.apply(utils.scala: 177) @ org.apache.spark.util.utils$$anon$4$$anonfun$run$1.apply(utils.scala: 177) @ org.apache.spark.util.utils$.loguncaughtexceptions(utils.scala:1618) @ org.apache.spark.util.utils$$anon$4.run(utils.scala:177)
fixed me after moving count() & take() statements on rdd before saving parquet using saveasparquetfile. try moving rdd.take() before u call saveasparquetfile.
Comments
Post a Comment