QiangCai commented on a change in pull request #3912:
URL: https://github.com/apache/carbondata/pull/3912#discussion_r514046333
##########
File path:
integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala
##########
@@ -143,10 +145,16 @@ object DataLoadProcessBuilderOnSpark {
var numPartitions = CarbonDataProcessorUtil.getGlobalSortPartitions(
configuration.getDataLoadProperty(CarbonCommonConstants.LOAD_GLOBAL_SORT_PARTITIONS))
+
+ // if numPartitions user does not specify and not specified in config then
dynamically calculate
+ if (numPartitions == 0) {
+ numPartitions = Math.ceil(model.getTotalSize.toDouble /
defaultMaxSplitBytes).toInt
+ }
+
+ // after calculation based on size if still zero then take the partition
number
if (numPartitions <= 0) {
numPartitions = convertRDD.partitions.length
Review comment:
numPartitions = Math.min(convertRDD.partitions.length, dynamic partition
number)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]