2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Spark: サイズが小さいDataFrameを書き出す際の注意点

Last updated at Posted at 2017-05-29
sparkでparquetファイル書き出しする際にハマった
scala
dataframe.write.mode(SaveMode.Overwrite).parquet(s"s3://$bucket/hogehoge")

上記のように書くと,一部のdataframeで正常終了しない(_temporaryは作られるけども)

下記のようにパーティション数を少なくするとうまくいった

scala
dataframe.coalesce(1).write.mode(SaveMode.Overwrite).parquet(s"s3://$bucket/hogehoge")

どうやらdataframeのサイズがパーティション数に対して小さすぎる場合,空のパーティションができてしまうことが原因っぽい?

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?