However, if I read in one single .bz2, would I still get one single giant partition?
Or will Spark support automatic split one .bz2 to multiple partitions?
n
ファイルを読み取るパーティションを指定するbzip2
と、Spark はn
ファイルを並列で読み取るタスクを生成します。のデフォルト値n
は に設定されていsc.defaultParallelism
ます。パーティションの数は、textFile
( docs ) の呼び出しの 2 番目の引数です。
. one giant .gz file will read in to a single partition.
いつでもできることに注意してください
sc.textFile(myGiantGzipFile).repartition(desiredNumberOfPartitions)
ファイルが読み取られた後、必要な数のパーティションを取得します。
Also, how do I know how many partitions it would be while Hadoop read in it from one bz2 file
.
これはyourRDD.partitions.size
、scala api または yourRDD.getNumPartitions()
python api 用です。