-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Throw on {write.folder-storage.path,write.object-storage.path}
properties
#12315
base: main
Are you sure you want to change the base?
Conversation
…rties Another way of warning non-Java users about the deprecated properties - `write.folder-storage.path` - `write.object-storage.path` This will only warn when `write.data.path` is not set. So hopefuly the number in the logs will be limited.
65ec291
to
6b8db34
Compare
6b8db34
to
216a04a
Compare
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.
I wonder whether the now "illegal" properties should also be caught when setting namespace/table/view properties, so that it becomes impossible to set those properties (and run into hard failures when accessing data).
There seem to be more usages of OBJECT_STORE_PATH
and WRITE_FOLDER_STORAGE_LOCATION
- e.g. IcebergToGlueConverter
and RewriteTablePathUtil
throw new UnsupportedOperationException( | ||
String.format( | ||
"Property '%s' has been deprecated and will be removed in 2.0, use '%s' instead.", | ||
TableProperties.WRITE_FOLDER_STORAGE_LOCATION, | ||
TableProperties.WRITE_DATA_LOCATION)); |
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.
Instead of scattering these exceptions around the code, could we add a new DEPRECATED_PROPERTIES
set like the currently existing RESERVED_PROPERTIES
?
We could throw an exception if the property from this list is written, or read.
This way we can establish a single place where the properties are deprecated.
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.
+1
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.
I've refactored the code to use the DEPRECATED_PROPERTIES
.
My opinion is that we should not fail too fast, because that's annoying to the user. For example, here when you have write.data.path
and any deprecated property, it will not fail because write.data.path
takes priority. Also, other properties, such as write.manifest-lists.enabled
are harmless to have them, since it is now enabled by default. Fail on reading or writing any deprecated property is a bigger discussion, and should happen on the spec level because this is bigger than just the Java implementation, and would like to decouple that from this PR.
{write.folder-storage.path,write.object-storage.path}
properties{write.folder-storage.path,write.object-storage.path}
properties
I think we can just remove them with 2.0, where they are used it is harmless (removing them when you copy a table, rewriting them when you write the base location, etc). |
ba0871f
to
2ae5fca
Compare
ImmutableSet.of( | ||
TableProperties.OBJECT_STORE_PATH, TableProperties.WRITE_FOLDER_STORAGE_LOCATION); | ||
|
||
private static String getProperty(Map<String, String> properties, String key) { |
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 checkDeprecation
?
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.
checkDeprecation
is also not accurate. This method actually does both: get property value and check deprecations.
the implementation/error msg is tied to TableProperties.WRITE_DATA_LOCATION
. Maybe call this getLegacyDataLocation
or sth like that.
The other approach is to define DEPRECATED_PROPERTIES
in TableProperties
class as a map (key = deprecated property, value = new property). maybe we can get to it when the need comes. right now, we can keep the change local to LocationProviders
class
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.
Went for getAndCheckLegacyLocation
since it also applies to metadata. And yes, everything is private, so we can always move to the TableProperties
.
I think that would quite useful to prevent users from putting in any of the "illegal" properties. WDYT? |
I'm not a fan of it, because I think it is very hard to enforce across implementations. For example, we don't support the ones that were deprecated in this PR in PyIceberg/Rust/Go, let other vendors. Since we need to maintain this list, we're also not able to completely remove them at some point. |
16fa9b6
to
bdd63f5
Compare
Another way of warning non-Java users about the deprecated properties
write.folder-storage.path
write.object-storage.path
This will only warn when
write.data.path
is not set. So hopefully the number of occurrences in the logs will be limited.