Posted by
GitBox on
Oct 12, 2020; 9:26am
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/GitHub-carbondata-maheshrajus-opened-a-new-pull-request-3912-WIP-Global-sort-partitions-should-be-dey-tp99835p101727.html
akashrn5 commented on a change in pull request #3912:
URL:
https://github.com/apache/carbondata/pull/3912#discussion_r503160924##########
File path: integration/spark/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala
##########
@@ -227,9 +235,19 @@ object DataLoadProcessBuilderOnSpark {
// 2. sort
var numPartitions = CarbonDataProcessorUtil.getGlobalSortPartitions(
configuration.getDataLoadProperty(CarbonCommonConstants.LOAD_GLOBAL_SORT_PARTITIONS))
- if (numPartitions <= 0) {
+
+ // if numPartitions user does not specify then dynamically calculate
+ if (numPartitions == 0) {
+ // get the size in bytes and convert to size in MB
+ val sizeOfDataFrame = SizeEstimator.estimate(rdd)/1000000
+ // data frame size can not be more than Int size
+ numPartitions = sizeOfDataFrame.toInt/rdd.getNumPartitions
Review comment:
@maheshrajus can you please explain the logic used to determine the partitions in the comment.
----------------------------------------------------------------
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:
[hidden email]