Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ulysses-you committed Jun 20, 2020
1 parent 3a646a2 commit 1fb9dc6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -1177,7 +1177,7 @@ object SQLConf {
.createWithDefault(4 * 1024 * 1024)

val FILES_MIN_PARTITION_NUM = buildConf("spark.sql.files.minPartitionNum")
.doc("The suggested (not guaranteed) minimum number of splitting file partitions. " +
.doc("The suggested (not guaranteed) minimum number of split file partitions. " +
"If not set, the default value is `spark.default.parallelism`. This configuration is " +
"effective only when using file-based sources such as Parquet, JSON and ORC.")
.version("3.1.0")
Expand Down
Expand Up @@ -550,14 +550,14 @@ class FileSourceStrategySuite extends QueryTest with SharedSparkSession with Pre
}

withSQLConf(SQLConf.FILES_MIN_PARTITION_NUM.key -> "16") {
val partitions = (1 to 100).map(i => s"file$i" -> 128*1024*1024)
val partitions = (1 to 100).map(i => s"file$i" -> 128 * 1024 * 1024)
val table = createTable(files = partitions)
// partition is limit by filesMaxPartitionBytes(128MB)
// partition is limited by filesMaxPartitionBytes(128MB)
assert(table.rdd.partitions.length == 100)
}

withSQLConf(SQLConf.FILES_MIN_PARTITION_NUM.key -> "32") {
val partitions = (1 to 800).map(i => s"file$i" -> 4*1024*1024)
val partitions = (1 to 800).map(i => s"file$i" -> 4 * 1024 * 1024)
val table = createTable(files = partitions)
assert(table.rdd.partitions.length == 50)
}
Expand Down

0 comments on commit 1fb9dc6

Please sign in to comment.