rdblue commented on a change in pull request #3094:
URL: https://github.com/apache/iceberg/pull/3094#discussion_r711824701



##########
File path: core/src/main/java/org/apache/iceberg/LocationProviders.java
##########
@@ -141,4 +136,41 @@ private static String stripTrailingSlash(String path) {
     }
     return result;
   }
+
+  /**
+   * Get the data file location. For the {@link DefaultLocationProvider}, the 
priority level are
+   * "write.data.path" -> "write.folder-storage.path" -> "table-location/data".
+   * For the {@link ObjectStoreLocationProvider}, the priority level are
+   * "write.data.path" -> "write.object-storage.path" -> 
"write.folder-storage.path" -> "table-location/data".
+   */
+  private static String dataLocation(Map<String, String> properties, String 
tableLocation, boolean isObjectStore) {
+    String dataLocation = properties.get(TableProperties.WRITE_DATA_LOCATION);
+    if (dataLocation == null) {
+      dataLocation = deprecatedDataLocation(properties, isObjectStore);
+      if (dataLocation == null) {
+        dataLocation = String.format("%s/data", tableLocation);
+      }
+    }
+    return dataLocation;
+  }
+
+  private static String deprecatedDataLocation(Map<String, String> properties, 
boolean isObjectStore) {
+    String deprecatedProperty = isObjectStore ?
+        TableProperties.OBJECT_STORE_PATH : 
TableProperties.WRITE_FOLDER_STORAGE_LOCATION;
+
+    String dataLocation = properties.get(deprecatedProperty);
+
+    final String warnMsg = "Table property {} is deprecated, please use " + 
TableProperties.WRITE_DATA_LOCATION +
+        " instead.";
+    if (dataLocation != null) {
+      LOG.warn(warnMsg, deprecatedProperty);
+    } else if (deprecatedProperty.equals(TableProperties.OBJECT_STORE_PATH)) {
+      dataLocation = 
properties.get(TableProperties.WRITE_FOLDER_STORAGE_LOCATION);
+      if (dataLocation != null) {
+        LOG.warn(warnMsg, TableProperties.WRITE_FOLDER_STORAGE_LOCATION);

Review comment:
       No need for warnings. This is not important enough to nag users about.




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