Github user gvramana commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1677#discussion_r157829373
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala
---
@@ -597,14 +602,18 @@ case class CarbonLoadDataCommand(
}
val partitionSchema =
StructType(table.getPartitionInfo(table.getTableName).getColumnSchemaList.asScala.map(field
=>
-
metastoreSchema.fields.find(_.name.equalsIgnoreCase(field.getColumnName))).map(_.get))
-
+
metastoreSchema.fields.find(_.name.equalsIgnoreCase(field.getColumnName))).map(_.get))
+ val overWriteLocal = if (overWrite && partition.nonEmpty) {
--- End diff --
In case of dynamic partition overwrite, existing partitions which are not
present in current load won't be deleted so handle them.
---