Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1711#discussion_r159816797
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAlterTableCompactionCommand.scala
---
@@ -79,6 +81,14 @@ case class CarbonAlterTableCompactionCommand(
relation.carbonTable
}
+ val isLoadInProgress =
SegmentStatusManager.checkIfAnyLoadInProgressForTable(table)
+ if (isLoadInProgress) {
+ val message = "Cannot run data loading and compaction on same table
concurrently. " +
+ "Please wait for load to finish"
+ LOGGER.error(message)
+ throw new Exception(message)
--- End diff --
Better to create a new exception class for this kind of error, you can name
it `ConcurrentOperationException`. We can use this in other similar places in
the future.
---