-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spark 3.5: Use File.separator
instead of hardcode in RewriteTablePath
#12066
base: main
Are you sure you want to change the base?
Conversation
if (!path.startsWith(toRemove)) { | ||
throw new IllegalArgumentException( | ||
String.format("Path %s does not start with %s", path, toRemove)); | ||
} | ||
return path.substring(toRemove.length()); | ||
} | ||
|
||
public static String appendFileSeparatorIfNotExists(String path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe maybeAppendFileSeparator
?
Thanks @manuzhang , i saw this too when working on OSSing the original implementation and thought about this but never got around to simplifying it. One doubt I had was, File.separator is potentially different when running on different platform, do we care? Shouldnt we preserve the path/ make the same path if we run on different plartform? |
You are right @szehon-ho! This is a mistake on my part. We probably can't do this because the Java ENV in use by the application doesn't necessarily match the files system being used. (almost certainly does not) For example should my path on S3 be different if I make my Table using an application running from a windows machine vs a linux machine? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot that the Iceberg Client File.Seperator will have no relationship to the actual Filesystem being used
No description provided.