RussellSpitzer commented on a change in pull request #1471:
URL: https://github.com/apache/iceberg/pull/1471#discussion_r490575500



##########
File path: 
spark/src/main/java/org/apache/iceberg/actions/RemoveOrphanFilesAction.java
##########
@@ -79,6 +87,20 @@
     }
   }, DataTypes.StringType);
 
+  private static final UserDefinedFunction decodeUDF = functions.udf((String 
fullyQualifiedPath) -> {
+    return URLDecoder.decode(fullyQualifiedPath, "UTF-8");
+  }, DataTypes.StringType);
+
+  /**
+   * Transform a file path to
+   * {@code Dataset<Row<file_path_no_scheme_authority, 
file_path_with_scheme_authority>>}
+   */
+  private static final UserDefinedFunction addFilePathOnlyUDF = 
functions.udf((String fullyQualifiedPath) -> {
+    Path path = new Path(fullyQualifiedPath);
+    // only_path, fully qualified path
+    return RowFactory.create(path.toUri().getPath(), path.toUri().toString());
+  }, DataTypes.createStructType(fileDetailStructType().fields()));

Review comment:
       See comment here 
https://github.com/apache/iceberg/pull/1471/files#r490575150 for more thoughts




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

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