Skip to content

Commit

Permalink
[CARMEL-6608] Increase bucket table scan partitions (#1269)
Browse files Browse the repository at this point in the history
  • Loading branch information
wakun authored and GitHub Enterprise committed Mar 10, 2023
1 parent 434b16e commit c3f17a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -955,8 +955,11 @@ case class FileSourceScanExec(
var partitionNumber = FilePartition.
minPartitionNumberBySpecifiedSize(fsRelation.sparkSession, selectedPartitions, originSize)

if (partitionNumber > conf.autoBucketedScanMaxPartitions) {
partitionNumber = conf.autoBucketedScanMaxPartitions
val maxBucketedScanMaxPartitions =
Math.max(conf.autoBucketedScanMaxPartitions, relation.bucketSpec.get.numBuckets)

if (partitionNumber > maxBucketedScanMaxPartitions) {
partitionNumber = maxBucketedScanMaxPartitions

FilePartition.maxSplitBytesBySpecifiedNumber(
fsRelation.sparkSession, selectedPartitions, partitionNumber)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6694,11 +6694,7 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
assert(scan.get.optionalBucketSet.isEmpty)
assert(scan.get.disableBucketedScan)

if (maxPartitions > 1) {
assert(scan.get.inputRDD.getNumPartitions > 1)
} else {
assert(scan.get.inputRDD.getNumPartitions == 1)
}
assert(scan.get.inputRDD.getNumPartitions == 2)
}
}
}
Expand Down

0 comments on commit c3f17a5

Please sign in to comment.