cryptoe commented on code in PR #15689:
URL: https://github.com/apache/druid/pull/15689#discussion_r1475585658


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:
##########
@@ -1872,6 +1871,44 @@ private static QueryDefinition makeQueryDefinition(
       } else {
         return queryDef;
       }
+    } else if (querySpec.getDestination() instanceof ExportMSQDestination) {
+      final ExportMSQDestination exportMSQDestination = (ExportMSQDestination) 
querySpec.getDestination();
+      final StorageConnectorProvider storageConnectorProvider = 
exportMSQDestination.getStorageConnectorProvider();
+
+      final ResultFormat resultFormat = exportMSQDestination.getResultFormat();
+
+      // If the statement is a 'REPLACE' statement, delete the existing files 
at the destination.
+      if (exportMSQDestination.getReplaceTimeChunks() != null) {
+        if 
(Intervals.ONLY_ETERNITY.equals(exportMSQDestination.getReplaceTimeChunks())) {
+          StorageConnector storageConnector = storageConnectorProvider.get();
+          try {
+            storageConnector.deleteRecursively("");

Review Comment:
   Even I think a manifest file is a better alternative. Since it would be a 
bit more work, what we can do now is to remove the delete call, document it as 
a known bug and get this in druid 29. 
   Post that, we can add the manifest deletion as part of a follow up PR. 
   How does that plan sound to you @gianm @adarshsanjeev  ?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to