From 723e4f1b3ed6ac1293f7cd7aadb8ba9f262010b2 Mon Sep 17 00:00:00 2001 From: panbingkun <84731559@qq.com> Date: Fri, 22 Dec 2023 21:35:59 +0800 Subject: [PATCH] Spark: Fix AddFilesProcedure error message when no partitions are found (#9357) --- .../org/apache/iceberg/spark/procedures/AddFilesProcedure.java | 2 +- .../org/apache/iceberg/spark/procedures/AddFilesProcedure.java | 2 +- .../org/apache/iceberg/spark/procedures/AddFilesProcedure.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java b/spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java index 7ed239149d1c..6a0570677673 100644 --- a/spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java +++ b/spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java @@ -196,7 +196,7 @@ private void importFileTable( importPartitions(table, ImmutableList.of(partition), checkDuplicateFiles); } else { Preconditions.checkArgument( - !partitions.isEmpty(), "Cannot find any matching partitions in table %s", partitions); + !partitions.isEmpty(), "Cannot find any matching partitions in table %s", table.name()); importPartitions(table, partitions, checkDuplicateFiles); } } diff --git a/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java b/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java index 7ed239149d1c..6a0570677673 100644 --- a/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java +++ b/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java @@ -196,7 +196,7 @@ private void importFileTable( importPartitions(table, ImmutableList.of(partition), checkDuplicateFiles); } else { Preconditions.checkArgument( - !partitions.isEmpty(), "Cannot find any matching partitions in table %s", partitions); + !partitions.isEmpty(), "Cannot find any matching partitions in table %s", table.name()); importPartitions(table, partitions, checkDuplicateFiles); } } diff --git a/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java b/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java index 7ed239149d1c..6a0570677673 100644 --- a/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java +++ b/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java @@ -196,7 +196,7 @@ private void importFileTable( importPartitions(table, ImmutableList.of(partition), checkDuplicateFiles); } else { Preconditions.checkArgument( - !partitions.isEmpty(), "Cannot find any matching partitions in table %s", partitions); + !partitions.isEmpty(), "Cannot find any matching partitions in table %s", table.name()); importPartitions(table, partitions, checkDuplicateFiles); } }