File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
ice/src/main/java/com/altinity/ice/cli Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -493,10 +493,14 @@ void delete(
493493 String partitionJson ,
494494 @ CommandLine .Option (
495495 names = "--dry-run" ,
496- description = "Log files that would be deleted without actually deleting them" ,
497- defaultValue = " true" )
498- boolean dryRun )
496+ description =
497+ "Log files that would be deleted without actually deleting them ( true by default) " )
498+ Boolean dryRun )
499499 throws IOException {
500+ if (dryRun == null ) {
501+ dryRun = true ;
502+ }
503+
500504 try (RESTCatalog catalog = loadCatalog (this .configFile ())) {
501505 List <PartitionFilter > partitions = new ArrayList <>();
502506 if (partitionJson != null && !partitionJson .isEmpty ()) {
Original file line number Diff line number Diff line change @@ -62,20 +62,17 @@ public static void run(
6262
6363 if (!filesToDelete .isEmpty ()) {
6464 if (dryRun ) {
65- logger .info ("Dry run: The following files would be deleted:" );
6665 for (DataFile file : filesToDelete ) {
67- logger .info (" {}" , file .path ());
66+ logger .info ("To be deleted: {}" , file .location ());
6867 }
6968 } else {
7069 RewriteFiles rewrite = table .newRewrite ();
7170 for (DataFile deleteFile : filesToDelete ) {
71+ logger .info ("Deleting {}" , deleteFile .location ());
7272 rewrite .deleteFile (deleteFile );
7373 }
7474 rewrite .commit ();
75- logger .info ("Partition(s) deleted." );
7675 }
77- } else {
78- logger .info ("No files found for the partition(s)." );
7976 }
8077 }
8178}
You can’t perform that action at this time.
0 commit comments