zeroshade commented on code in PR #1437:
URL: https://github.com/apache/iceberg-go/pull/1437#discussion_r3566743613
##########
table/orphan_cleanup.go:
##########
@@ -664,6 +698,17 @@ func normalizeNonURLPath(path string) string {
return strings.ReplaceAll(normalized, "\\", "/")
}
+// filePathKey returns the path component used to compare listed files with
+// references before applying scheme and authority mismatch policy.
+func filePathKey(file string) string {
+ parsedURL, err := url.Parse(file)
Review Comment:
`url.Parse` on a bare Windows path like `C:/data/file.parquet` interprets
`C` as the scheme, so this returns only `parsedURL.Path` and drops the drive
letter — `C:/data/file.parquet` and `D:/data/file.parquet` then map to the same
key `/data/file.parquet`. With `PrefixMismatchIgnore` a wrong-drive file can be
wrongly treated as referenced; with the default error mode, unrelated
drive-local paths can trigger errors. Suggest only URL-parsing strings that
contain `://` (or an explicit `file:` scheme) and otherwise returning
`normalizeNonURLPath(file)`, plus a Windows drive-letter test case.
--
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]