我在嘗試在完成所有處理後將文件寫入s3時發生了一些奇怪的錯誤。 我想知道內存分配是否與此有關。 任何建議都會有幫助。 我在獨立模式下運行Spark 2.1.0。將文件寫入s3的錯誤 - pyspark
的錯誤是如下:
17/09/26 15:50:27 ERROR Utils: Aborting task
org.apache.spark.SparkException: Python worker exited unexpectedly (crashed)
at org.apache.spark.api.python.PythonRunner$$anon$1.read(PythonRDD.scala:230)
at org.apache.spark.api.python.PythonRunner$$anon$1.next(PythonRDD.scala:156)
at org.apache.spark.api.python.PythonRunner$$anon$1.next(PythonRDD.scala:152)
at org.apache.spark.InterruptibleIterator.next(InterruptibleIterator.scala:43)
at scala.collection.Iterator$$anon$12.nextCur(Iterator.scala:434)
....
Caused by: java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:197)
at java.io.DataInputStream.readFully(DataInputStream.java:169)
at org.apache.spark.api.python.PythonRunner$$anon$1.read(PythonRDD.scala:169)
... 21 more
17/09/26 15:50:28 ERROR FileFormatWriter: Job job_20170926152633_0010 aborted.
17/09/26 15:50:28 ERROR Executor: Exception in task 270.0 in stage 10.0 (TID 6680)
org.apache.spark.SparkException: Task failed while writing rows
at
org.apache.spark.sql.execution.datasources.FileFormatWriter
$.org$apache$
spark$sql$execution$datasources$FileFormatWriter$
$executeTask(FileFormatWriter.scala:204)
at
.FileFormatWriter$$anonfun$write$1$$anonfun$3.\
apply(FileFormatWriter.scala:128)
該文件寫入到S3中的代碼如下:
df.write.format("parquet") \
.option("x-amz-server-side-encryption", "AES256") \
.mode("append") \
.save(s3_path)
您可以先嚐試寫入s3,而不加密並追加模式像這樣'df.write.parquet(s3_path)' – maxmithun
檢查此鏈接可能有助於啓用加密。 https://stackoverflow.com/questions/45461299/how-to-specify-server-side-encryption-for-s3-put-in-pyspark – maxmithun