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(
493
493
String partitionJson ,
494
494
@ CommandLine .Option (
495
495
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 )
499
499
throws IOException {
500
+ if (dryRun == null ) {
501
+ dryRun = true ;
502
+ }
503
+
500
504
try (RESTCatalog catalog = loadCatalog (this .configFile ())) {
501
505
List <PartitionFilter > partitions = new ArrayList <>();
502
506
if (partitionJson != null && !partitionJson .isEmpty ()) {
Original file line number Diff line number Diff line change @@ -62,20 +62,17 @@ public static void run(
62
62
63
63
if (!filesToDelete .isEmpty ()) {
64
64
if (dryRun ) {
65
- logger .info ("Dry run: The following files would be deleted:" );
66
65
for (DataFile file : filesToDelete ) {
67
- logger .info (" {}" , file .path ());
66
+ logger .info ("To be deleted: {}" , file .location ());
68
67
}
69
68
} else {
70
69
RewriteFiles rewrite = table .newRewrite ();
71
70
for (DataFile deleteFile : filesToDelete ) {
71
+ logger .info ("Deleting {}" , deleteFile .location ());
72
72
rewrite .deleteFile (deleteFile );
73
73
}
74
74
rewrite .commit ();
75
- logger .info ("Partition(s) deleted." );
76
75
}
77
- } else {
78
- logger .info ("No files found for the partition(s)." );
79
76
}
80
77
}
81
78
}
You can’t perform that action at this time.
0 commit comments