abmo-x commented on code in PR #7363: URL: https://github.com/apache/iceberg/pull/7363#discussion_r1171708861
########## spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/procedures/AddFilesProcedure.java: ########## @@ -170,7 +173,8 @@ private void importFileTable( if (table.spec().isUnpartitioned()) { Preconditions.checkArgument( - partitions.isEmpty(), "Cannot add partitioned files to an unpartitioned table"); + !Spark3Util.isPartitioned(spark(), tableLocation), Review Comment: As we now rely on table's partitionSpec to get the partition paths, if a table is unpartitioned `partitions.isEmpty` will always be true. Hence we need this check for unpartitioned tables to do a quick check if the path contains any dir. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org