jackylk commented on a change in pull request #3515: [CARBONDATA-3623]: Fixed 
global sort compaction failure on timestamp column
URL: https://github.com/apache/carbondata/pull/3515#discussion_r360404061
 
 

 ##########
 File path: 
integration/spark2/src/main/scala/org/apache/carbondata/spark/rdd/CarbonTableCompactor.scala
 ##########
 @@ -399,30 +393,24 @@ class CarbonTableCompactor(carbonLoadModel: 
CarbonLoadModel,
   def dataFrameOfSegments(
       sparkSession: SparkSession,
       carbonTable: CarbonTable,
-      segments: Array[Segment]
-  ): DataFrame = {
-    val columns = carbonTable
-          .getCreateOrderColumn()
-      .asScala
-      .map(_.getColName)
-      .toArray
-    val schema = SparkTypeConverter.createSparkSchema(carbonTable, columns)
-    val rdd: RDD[Row] = new CarbonScanRDD[CarbonRow](
-      sparkSession,
-      columnProjection = new CarbonProjection(columns),
-      null,
-      carbonTable.getAbsoluteTableIdentifier,
-      carbonTable.getTableInfo.serialize,
-      carbonTable.getTableInfo,
-      new CarbonInputMetrics,
-      null,
-      null,
-      classOf[CarbonRowReadSupport],
-      splitsOfSegments(sparkSession, carbonTable, segments))
-      .map { row =>
-        new GenericRow(row.getData.asInstanceOf[Array[Any]])
-      }
-    sparkSession.createDataFrame(rdd, schema)
+      segments: Array[Segment]): DataFrame = {
+    try {
+      CarbonSession
+        .threadSet(CarbonCommonConstants.CARBON_INPUT_SEGMENTS +
 
 Review comment:
   please add comment to explain why this is needed

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to