[GitHub] [carbondata] jackylk commented on a change in pull request #3432: [CARBONDATA-3567] Added validation for compacting mixed format segments

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] jackylk commented on a change in pull request #3432: [CARBONDATA-3567] Added validation for compacting mixed format segments

GitBox
jackylk commented on a change in pull request #3432: [CARBONDATA-3567] Added validation for compacting mixed format segments
URL: https://github.com/apache/carbondata/pull/3432#discussion_r342405277
 
 

 ##########
 File path: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAlterTableCompactionCommand.scala
 ##########
 @@ -276,7 +276,20 @@ case class CarbonAlterTableCompactionCommand(
     val isCompactionTriggerByDDl = true
     val segmentIds: Option[List[String]] = if (compactionType == CompactionType.CUSTOM &&
       alterTableModel.customSegmentIds.isDefined) {
-      alterTableModel.customSegmentIds
+      val ids = alterTableModel.customSegmentIds
+      if (ids != None) {
+        val loadMetadataDetails = carbonLoadModel.getLoadMetadataDetails.asScala
+        for (oneLoad <- loadMetadataDetails) {
+          for (id <- ids.head) {
+            // Other Segment format cannot be compacted
+            if (oneLoad.getLoadName.equalsIgnoreCase(id) &&
+                !oneLoad.getFileFormat.equals(FileFormat.COLUMNAR_V3)) {
+              throw new AnalysisException("Custom compaction should not have other format segments")
 
 Review comment:
   ```suggestion
                 throw new AnalysisException("Custom compaction does not support $format format segment")
   ```

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