Repository navigation
Conversation
Generated-by: OpenAI Codex (GPT-6.2 Sol, xhigh)
|
@XSY-28 Please review your own changes before opening a PR, your AI says these changes haven't been reviewed :-) |
timothyw553
left a comment
There was a problem hiding this comment.
overall LGTM -- left two small comments on keeping single- and three-slash file: handling consistent and using our string helper instead of arrow::internal.
| if (pos == std::string::npos) { | ||
| return file_location; | ||
| const std::string_view uri(file_location); | ||
| if (::arrow::internal::AsciiEqualsCaseInsensitive(uri.substr(0, 6), "file:/") && |
There was a problem hiding this comment.
to my understanding, only the single-slash path normalizes the scheme to lowercase and fails immediately if PathFromUri errors, while file:///... still falls through to the fallback below. with MockFileSystem, wouldn't file:/tmp/x fail while file:///tmp/x returns /tmp/x? should both slash forms share the same scheme normalization and error handling, with mixed-case tests for both?
| if (pos == std::string::npos) { | ||
| return file_location; | ||
| const std::string_view uri(file_location); | ||
| if (::arrow::internal::AsciiEqualsCaseInsensitive(uri.substr(0, 6), "file:/") && |
There was a problem hiding this comment.
could we use StringUtils::EqualsIgnoreCase from "iceberg/util/string_util.h" instead of pulling in arrow::internal (swapping out <arrow/util/string.h>)? keeping the substr(0, 6) boundary also avoids StartsWithIgnoreCase unicode folding changing byte lengths.
- if (::arrow::internal::AsciiEqualsCaseInsensitive(uri.substr(0, 6), "file:/") &&
+ if (StringUtils::EqualsIgnoreCase(uri.substr(0, 6), "file:/") &&Use the Iceberg string helper and report backend URI parser errors consistently for one- and three-slash local paths. Cover mixed-case URIs and backend rejection. Prepared and tested with OpenAI Codex. Reviewed by the PR author before this update.
Fixes #341.
Java Iceberg writes absolute local URIs such as
file:/warehouse/metadata/snap.avro. Arrow already parses this form, but the Iceberg FileIO wrapper passed it to Arrow's filesystem as a bare path. Route the one-slash form through the existing URI parser, normalizing its scheme while preserving the path.The public FileIO test reads the same file through the one-slash, mixed-case, and three-slash forms and checks that a malformed short URI is rejected. This is the separate Arrow change requested in #818. Both new tests fail on the previous code. On macOS, the bundled Arrow suite passes 115 tests and the utility suite passes 431.
Generated by OpenAI Codex (GPT-6.2 Sol, xhigh) on behalf of @XSY-28. Human pre-submission review: unreviewed.
The author has now reviewed these changes.