adarshsanjeev commented on code in PR #15689:
URL: https://github.com/apache/druid/pull/15689#discussion_r1475764572
##########
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:
Instead of remove the delete call, we can add a directory like
`druid-export/` to the path, and delete it for REPLACE. This way, we would not
delete any other files unless the user stores them in a directory with the same
name.
--
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]