MaxGekk commented on a change in pull request #30776:
URL: https://github.com/apache/spark/pull/30776#discussion_r544601712
##########
File path:
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsAtomicPartitionManagement.java
##########
@@ -82,4 +82,27 @@ void createPartitions(
* @return true if partitions were deleted, false if any partition not exists
*/
boolean dropPartitions(InternalRow[] idents);
+
+ /**
+ * Drop an array of partitions atomically from table.
+ * <p>
+ * If any partition doesn't exists,
+ * the operation of dropPartitions need to be safely rolled back.
+ *
+ * If the catalog supports the option to purge a table, this method must be
overridden. The
+ * default implementation falls back to {@link
#dropPartitions(InternalRow[])} dropPartitions} if
+ * the purge option is set to false. Otherwise, it throws {@link
UnsupportedOperationException}.
+ *
+ * @param idents an array of partition identifiers
+ * @param purge whether a partition should be purged
+ * @return true if partitions were deleted, false if any partition not exists
+ *
+ * @since 3.2.0
+ */
+ default boolean dropPartitions(InternalRow[] idents, boolean purge) {
Review comment:
Why is having this in 3.1 important? Just in case, this PR has conflicts
in branch-3.1. I could change `@since 3.2.0` -> `@since 3.1.0`, and open new PR
for 3.1 if you think it makes sense.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]