-
Notifications
You must be signed in to change notification settings - Fork 413
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
z-order fails on table that is partitioned by value with space #2834
Comments
Thank you for providing some reproduction code! I was able to quickly turn that into a pytest case to verify this behavior |
i think hitting a encode here can solve the issue
|
You're already looking at the same code I am 😄 The |
@rtyler It seems in build_compaction/z-order_plan both push the object_meta into Ok(ObjectMeta {
location: file_stats.object_store_path(), impl LogicalFile<'_> {
/// Path to the files storage location.
pub fn path(&self) -> Cow<'_, str> {
percent_decode_str(self.path.value(self.index)).decode_utf8_lossy()
}
/// An object store [`Path`] to the file.
///
/// this tries to parse the file string and if that fails, it will return the string as is.
// TODO assert consisent handling of the paths encoding when reading log data so this logic can be removed.
pub fn object_store_path(&self) -> Path {
let path = self.path();
// Try to preserve percent encoding if possible
match Path::parse(path.as_ref()) {
Ok(path) => path,
Err(_) => Path::from(path.as_ref()),
}
} |
could this happen with any character that get's uri-encoded in a partition? |
@jgeraerts very likely 🫠 |
Thanks for looking into it @rtyler, let me know if I can help. I'm decently familiar with Delta + Python, but Rust is not in my language pool yet. I'm guessing it's just a few lines missed in z-order section given how other operations using the partitions do work. |
Environment
Delta-rs version: 0.19.1
Binding: Python
Environment:
Bug
When you try to z-order on a table that is partitioned by a field whose value contains space, it errors out.
I was able to reproduce the issue on local filesystem (MacOS) as well as Google Cloud Storage (I didn't try AWS).
What happened:
Create a delta table and partition it by a column, whose values contain space (e.g. {"country": "Costa Rica"}). The partition is successfully created with
country=Costa%20Rica
to mitigate space in path.When you perform z-order on the table, the space is not mitigated (e.g. it looks for
country=Costa Rica
)What you expected to happen:
z-order is performed successfully with using the mitigated path.
How to reproduce it:
More details:
I tried few other operations available at DeltaTable level. Z-Ordering seems to be the only one that has this pathing issue. I believe the fix needs to be on Rust side.
The text was updated successfully, but these errors were encountered: