jackylk commented on a change in pull request #3389: [CARBONDATA-3524] Support global_sort compaction
URL:
https://github.com/apache/carbondata/pull/3389#discussion_r329313283
##########
File path: integration/spark2/src/main/scala/org/apache/carbondata/spark/rdd/CarbonTableCompactor.scala
##########
@@ -325,4 +339,65 @@ class CarbonTableCompactor(carbonLoadModel: CarbonLoadModel,
}
}
+ /**
+ * compact segments by global sort
+ */
+ def compactSegmentsByGlobalSort(
+ sparkSession: SparkSession,
+ carbonLoadModel: CarbonLoadModel,
+ carbonMergerMapping: CarbonMergerMapping): Array[(String, Boolean)] = {
+ val dataFrame = SegmentUtils.dataFrameOfSegments(
+ sparkSession,
+ carbonLoadModel.getCarbonDataLoadSchema.getCarbonTable,
+ carbonMergerMapping.validSegments)
+ val outputModel = getLoadModelForGlobalSort(
+ sparkSession, carbonLoadModel.getCarbonDataLoadSchema.getCarbonTable,
+ carbonMergerMapping.validSegments)
+ outputModel.setSegmentId(carbonMergerMapping.mergedLoadName.split("_")(1))
+ DataLoadProcessBuilderOnSpark.loadDataUsingGlobalSort(
+ sparkSession,
+ Option(dataFrame),
+ outputModel,
+ SparkSQLUtil.sessionState(sparkSession).newHadoopConf()
+ )
+ .map { row =>
Review comment:
fix code style
----------------------------------------------------------------
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]
With regards,
Apache Git Services