varun-lakhyani commented on code in PR #14933:
URL: https://github.com/apache/iceberg/pull/14933#discussion_r2675880601
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/actions/TestSnapshotTableAction.java:
##########
@@ -65,4 +70,66 @@ public void testSnapshotWithParallelTasks() throws
IOException {
.execute();
assertThat(snapshotThreadsIndex.get()).isEqualTo(2);
}
+
+ @TestTemplate
+ public void testSnapshotWithOverlappingLocation() throws IOException {
+ String catalogType = catalogConfig.get(ICEBERG_CATALOG_TYPE);
+ assumeThat(catalogType).isNotEqualTo(ICEBERG_CATALOG_TYPE_HADOOP);
Review Comment:
> Why do we don't test with hadoop?
Hadoop doesn't allow custom destination location via .tableLocation() when
done this it fails even before the check while `StagedSparkTable
stagedTable = stageDestTable();`
Error Message:
`TestSnapshotTableAction > testSnapshotWithOverlappingLocation() >
catalogName = testhadoop, implementation =
org.apache.iceberg.spark.SparkCatalog, config = {type=hadoop,
cache-enabled=false} FAILED
java.lang.IllegalArgumentException: Cannot set a custom location for a
path-based table. Expected
file:/tmp/warehouse62334905503302693.tmp/default/table but got
/tmp/junit-17415081344650343329/newJunit10343828823716601592`
because of HadoopCatalog withLocation() check
`public TableBuilder withLocation(String location) {
Preconditions.checkArgument(
location == null || location.equals(defaultLocation),
"Cannot set a custom location for a path-based table. Expected "
+ defaultLocation
+ " but got "
+ location);
return this;
}`
So, when we can't give custom location and TestBase predefine the warehouse
using which hadoop always derives non-overlapping location the test seems
useless unless we change the warehouse.
For the same reason I skipped Hadoop catalog for the tests including
.tableLocation().
Do let me know If I should think otherwise
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]