RussellSpitzer commented on a change in pull request #1471:
URL: https://github.com/apache/iceberg/pull/1471#discussion_r490573264
##########
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:
Isn't this already a struct type? why are we creating a structtype from
it?
----------------------------------------------------------------
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]