-
Notifications
You must be signed in to change notification settings - Fork 6
MLE-25073 Fixing zip bug when writing to S3 on Windows #573
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
Conversation
|
Copyright Validation Results ✅ Valid Files
✅ All files have valid copyright headers! |
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.
Pull Request Overview
This PR fixes a bug where writing zip files to S3 on Windows would fail due to incorrect path separator handling. The issue occurred because string concatenation with File.separator would insert Windows backslashes (\) into S3 URLs.
Key Changes:
- Replaced string-based path construction with Hadoop
Pathobjects to ensure platform-independent path handling - Changed
zipFilePathfield fromStringtoPathtype for type safety - Removed unused logger instance and consolidated logging to use
Util.MAIN_LOGGER
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| final String timestamp = new SimpleDateFormat("yyyyMMddHHmmssZ").format(new Date()); | ||
| return String.format("%s%s%s-%d.zip", path, File.separator, timestamp, partitionId); | ||
| final String zipFilename = String.format("%s-%d.zip", timestamp, partitionId); | ||
| // Fixed a bug in 2.0 by using a Path here instead of string concatenation with File.separator. |
Copilot
AI
Nov 5, 2025
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.
The comment mentions fixing 'a bug in 2.0' but doesn't specify what version this fix is being introduced in. Consider clarifying the version context (e.g., 'Fixed a bug present in 2.0' or 'Fix for bug discovered in 2.0, resolved in 2.1').
| // Fixed a bug in 2.0 by using a Path here instead of string concatenation with File.separator. | |
| // Fixed a bug present in 2.0 (where string concatenation with File.separator was used); resolved in 2.1 by using a Path here instead. |
Couldn't come up with a test for this, as this only fails on Windows. Added a comment instead. This is the only writer that was improperly doing String concatenation with File.separator. Each other writer was already using a Path object.
b397be9 to
83ebfb3
Compare
|




Couldn't come up with a test for this, as this only fails on Windows. Added a comment instead. This is the only writer that was improperly doing String concatenation with File.separator. Each other writer was already using a Path object.