You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "mohammadnaqvi04 (via GitHub)" <gi...@apache.org> on 2026/09/12 22:18:36 UTC

[PR] GH-32438: [C++] Create target file when OpenAppendStream targets a nonexistent path [arrow]

mohammadnaqvi04 opened a new pull request, #51321:
URL: https://github.com/apache/arrow/pull/51321

   ### Rationale for this change
   
   `FileSystem::OpenAppendStream` is [documented](https://github.com/apache/arrow/blob/main/cpp/src/arrow/filesystem/filesystem.h#L339-L341) to create the target file if it doesn't already exist. On HDFS this instead raises a not-found error. `HadoopFileSystemImpl::OpenWritable` always opens in append mode when asked to append, but Hadoop's `FileSystem.append()` requires the file to already exist, unlike a local append-mode open. See #32438.
   
   ### What changes are included in this PR?
   
   - `OpenWritable` now only sets append mode when the target already exists; otherwise it falls back to a plain create, matching every other backend. Adds an existence check against the NameNode before an append-mode open, since that's the only way to know which mode to request.
   - Removed `TestHadoopFileSystemGeneric::allow_append_to_new_file`'s override to `false`, seemingly added when HDFS was first wired into the shared filesystem test suite. HDFS now runs the same append-to-new-file check as every other backend.
   
   ### Are these changes tested?
   
   Yes. With the override removed, `TestHadoopFileSystemGeneric.OpenAppendStream` fails on the unpatched code with the same not-found error from the issue, and passes with this change, run against the Docker-based HDFS test setup (`ci/scripts/integration_hdfs.sh`). The rest of the HDFS C++ suite and `pyarrow.tests.test_fs` pass with no regressions.
   
   Unrelated to this change: `ci/scripts/install_minio.sh` currently fails for anyone building the CI images locally, since MinIO discontinued the binary distribution it fetches from. I patched around it locally to get a working build. If this is fixed properly upstream and CI behaves differently as a result, I wouldn't have had visibility into that from my local setup.
   
   ### Are there any user-facing changes?
   
   Yes: appending to a nonexistent file on HDFS now succeeds and creates the file, instead of raising an error.
   
   **This PR contains a "Critical Fix".** It fixes a case where an operation documented to succeed instead raised an error.
   
   * GitHub Issue: #32438
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-32438: [C++] Create target file when OpenAppendStream targets a nonexistent path [arrow]

Posted by "mohammadnaqvi04 (via GitHub)" <gi...@apache.org>.
mohammadnaqvi04 commented on PR #51321:
URL: https://github.com/apache/arrow/pull/51321#issuecomment-5805295688

   I've rebased onto current main to pick up the minio CI fix that was landing while this PR was open. Could someone please approve the workflow runs on the latest push?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-32438: [C++] Create target file when OpenAppendStream targets a nonexistent path [arrow]

Posted by "mohammadnaqvi04 (via GitHub)" <gi...@apache.org>.
mohammadnaqvi04 commented on PR #51321:
URL: https://github.com/apache/arrow/pull/51321#issuecomment-5761828144

   @pitrou Bumping this for whenever you get a chance. Happy to address anything that needs changing!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-32438: [C++] Create target file when OpenAppendStream targets a nonexistent path [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #51321:
URL: https://github.com/apache/arrow/pull/51321#issuecomment-5649060256

   :warning: GitHub issue #32438 **has been automatically assigned in GitHub** to PR creator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-32438: [C++] Create target file when OpenAppendStream targets a nonexistent path [arrow]

Posted by "mohammadnaqvi04 (via GitHub)" <gi...@apache.org>.
mohammadnaqvi04 commented on PR #51321:
URL: https://github.com/apache/arrow/pull/51321#issuecomment-6074652770

   Hi @pitrou, just following up when you have a moment, no rush. Looks like the CI runs are still waiting on approval, so happy to wait for that or for anyone else to take a look in the meantime. Thanks for your time on this!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org