spark 如何获取读取镶木地板文件的任务数?
How spark get number of tasks reading parquet files?
我在 s3 存储桶的同一目录下有 271 个 parquet 小文件(9KB/文件)。所以,我想了解 spark 在读取这些文件时如何获取任务数?
集群是 aws EMR 5.29,我的 sparkConf 有 --num-executors 2
和 --executor-cores 2
当我运行spark.read.parquet("s3://bucket/path").rdd.getNumPartitions
得到9tasks/partition时,我的问题是为什么?它是如何工作的?
我找到了答案here:
Min(defaultMinSplitSize (128MB, `spark.sql.files.maxPartitionBytes`,
Max(openCostInByte(8MB, `spark.sql.files.openCostInBytes`,
totalSize/defaultParallelism)
)
我在 s3 存储桶的同一目录下有 271 个 parquet 小文件(9KB/文件)。所以,我想了解 spark 在读取这些文件时如何获取任务数?
集群是 aws EMR 5.29,我的 sparkConf 有 --num-executors 2
和 --executor-cores 2
当我运行spark.read.parquet("s3://bucket/path").rdd.getNumPartitions
得到9tasks/partition时,我的问题是为什么?它是如何工作的?
我找到了答案here:
Min(defaultMinSplitSize (128MB, `spark.sql.files.maxPartitionBytes`,
Max(openCostInByte(8MB, `spark.sql.files.openCostInBytes`,
totalSize/defaultParallelism)
)