Skip to content

Commit 143a0e4

Browse files
committed
Added logic to throw exception when the user tries to use -force-no-copy for file(row group/block) with multiple partitions
1 parent d820227 commit 143a0e4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ice/src/main/java/com/altinity/ice/cli/internal/cmd/Insert.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,9 @@ private static List<DataFile> processFile(
427427
if (!inferResult.success()) {
428428
if (options.noCopy || options.s3CopyObject) {
429429
throw new BadRequestException(
430-
String.format("%s: %s", inputFile.location(), inferResult.failureReason()));
430+
String.format(
431+
"%s: %s. In no-copy mode, each file must contain data for only one partition value",
432+
inputFile.location(), inferResult.failureReason()));
431433
}
432434
logger.warn(
433435
"{}: {}. Falling back to full scan (slow)",

ice/src/main/java/com/altinity/ice/cli/internal/iceberg/Partitioning.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ public static InferPartitionKeyResult inferPartitionKey(
185185
if (!minTransformed.equals(maxTransformed)) {
186186
failureReason =
187187
String.format(
188-
"File contains multiple partition values for '%s' (min: %s, max: %s). "
189-
+ "In force-no-copy mode, each file must contain data for only one partition value",
188+
"File contains multiple partition values for '%s' (min: %s, max: %s)",
190189
sourceName, minTransformed, maxTransformed);
191190
break;
192191
}
@@ -197,8 +196,7 @@ public static InferPartitionKeyResult inferPartitionKey(
197196
} else if (!valueTransformed.equals(minTransformed)) {
198197
failureReason =
199198
String.format(
200-
"File contains multiple partition values for '%s' (e.g., %s and %s). "
201-
+ "In force-no-copy mode, each file must contain data for only one partition value",
199+
"File contains multiple partition values for '%s' (e.g., %s and %s)",
202200
sourceName, valueTransformed, minTransformed);
203201
break;
204202
}

0 commit comments

Comments
 (0)