dramaticlly commented on code in PR #8194:
URL: https://github.com/apache/iceberg/pull/8194#discussion_r1298893101


##########
core/src/main/java/org/apache/iceberg/BaseMetastoreCatalog.java:
##########
@@ -192,6 +195,18 @@ public Table create() {
 
       String baseLocation = location != null ? location : 
defaultWarehouseLocation(identifier);
       tableProperties.putAll(tableOverrideProperties());
+
+      if (Boolean.parseBoolean(
+          
tableProperties.get(TableProperties.LOCATION_CONFLICT_DETECTION_ENABLED))) {
+        boolean conflictLocationDetected =
+            (ops.io() instanceof SupportsPrefixOperations)
+                ? !prefixEmpty((SupportsPrefixOperations) ops.io(), 
baseLocation)
+                : ops.io().newInputFile(baseLocation).exists();

Review Comment:
   thank you for the suggestion @szehon-ho . I added another check to see if io 
is instance of hadoop configurable, and then create a filesystem to see if 
directory is empty by listing recursively. 
   
   There's ongoing PR #8334 trying to add prefix based operation in 
resolveFileIO. But I added test for both hadoop fileIO and resolving fileIO for 
each catalog just to make sure tests get passing regardless. 



-- 
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]

Reply via email to