vinishjail97 commented on code in PR #1064:
URL: https://github.com/apache/incubator-xtable/pull/1064#discussion_r4808147537
##########
xtable-core/src/main/java/org/apache/xtable/delta/DeltaPathUtils.java:
##########
@@ -74,6 +81,23 @@ public static String getPathForDeltaLog(String
tableBasePath, String dataFilePat
: dataFilePath;
}
+ /** Returns a comparison key without changing the path that is written to
the Delta log. */
+ public static String fileIdentity(String path) {
Review Comment:
`isUnderBasePath` below treats any two schemes as equal when the authority
and path match, so I think other aliases (for example `s3n://`) would still
show up as an add/remove pair. Would it be reasonable to key on authority +
path here, so the two rules stay in step?
##########
xtable-core/src/main/java/org/apache/xtable/delta/DeltaPathUtils.java:
##########
@@ -74,6 +81,23 @@ public static String getPathForDeltaLog(String
tableBasePath, String dataFilePat
: dataFilePath;
}
+ /** Returns a comparison key without changing the path that is written to
the Delta log. */
+ public static String fileIdentity(String path) {
+ String s3aPrefix = "s3a://";
+ return path.startsWith(s3aPrefix) ? "s3://" +
path.substring(s3aPrefix.length()) : path;
+ }
+
+ /** Compares snapshot files to previous Delta files keyed by {@link
#fileIdentity}. */
+ public static <P> FilesDiff<InternalFile, P> diffSnapshotFiles(
Review Comment:
This repeats `FilesDiff.findNewAndRemovedFiles(List, Map)` with only the key
changed. The existing `FilesDiff` overloaded method that takes a key function
could avoid the copy?
--
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]