Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cpp/src/arrow/filesystem/hdfs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ class TestHadoopFileSystemGeneric : public ::testing::Test,
bool allow_write_file_over_dir() const override { return true; }
bool allow_move_dir_over_non_empty_dir() const override { return true; }
bool have_implicit_directories() const override { return true; }
bool allow_append_to_new_file() const override { return false; }

std::shared_ptr<FileSystem> GetEmptyFileSystem() override {
// Since the HDFS contents are kept persistently between test runs,
Expand Down
5 changes: 4 additions & 1 deletion cpp/src/arrow/io/hdfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,10 @@ class HadoopFileSystem::HadoopFileSystemImpl {
int16_t replication, int64_t default_block_size,
std::shared_ptr<HdfsOutputStream>* file) {
int flags = O_WRONLY;
if (append) flags |= O_APPEND;
// Hadoop's FileSystem::append (unlike a POSIX O_CREAT|O_APPEND open) requires
// the target file to already exist, so only request append semantics if the
// file is actually there.
if (append && Exists(path)) flags |= O_APPEND;

errno = 0;
hdfsFile handle =
Expand Down