You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/11/05 06:42:35 UTC
[GitHub] [carbondata] jackylk commented on a change in pull request #3426:
[CARBONDATA-3560] Fixed issues for Add Segment
jackylk commented on a change in pull request #3426: [CARBONDATA-3560] Fixed issues for Add Segment
URL: https://github.com/apache/carbondata/pull/3426#discussion_r342400922
##########
File path: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAddLoadCommand.scala
##########
@@ -92,6 +92,24 @@ case class CarbonAddLoadCommand(
val segmentPath = options.getOrElse(
"path", throw new UnsupportedOperationException("PATH is manadatory"))
+ val allSegments = SegmentStatusManager.readLoadMetadata(carbonTable.getMetadataPath)
+
+ // If a path is already added then we should block the adding of the same path again.
+ if (allSegments.exists(a =>
+ a.getPath != null && a.getPath.equalsIgnoreCase(segmentPath)
+ )) {
+ throw new AnalysisException(s"Cannot add the segment. This path is already in use by " +
Review comment:
change message to `path already exists in table status file, can not add same segment path repeatedly: $path`
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services