This is an automated email from the ASF dual-hosted git repository.
danny0405 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new 0c3e7638186a fix: fix viewfs schema file creation as not atomic
(#17965)
0c3e7638186a is described below
commit 0c3e7638186ad3a1b95bbe83061b0aaee9c30f85
Author: chaoyang <[email protected]>
AuthorDate: Thu Jan 22 17:33:43 2026 +0800
fix: fix viewfs schema file creation as not atomic (#17965)
* feat: enable temp file creation for viewfs schema
Signed-off-by: TheR1sing3un <[email protected]>
---------
Signed-off-by: TheR1sing3un <[email protected]>
---
hudi-io/src/main/java/org/apache/hudi/storage/HoodieStorage.java | 2 ++
hudi-io/src/main/java/org/apache/hudi/storage/StorageSchemes.java | 7 +++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/hudi-io/src/main/java/org/apache/hudi/storage/HoodieStorage.java
b/hudi-io/src/main/java/org/apache/hudi/storage/HoodieStorage.java
index 004d88b66183..2ec0d048b45d 100644
--- a/hudi-io/src/main/java/org/apache/hudi/storage/HoodieStorage.java
+++ b/hudi-io/src/main/java/org/apache/hudi/storage/HoodieStorage.java
@@ -389,6 +389,8 @@ public abstract class HoodieStorage implements Closeable {
@PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
public final boolean needCreateTempFile() {
return StorageSchemes.HDFS.getScheme().equals(getScheme())
+ // viewfs itself is just an abstraction layer on top of other file
systems based on hadoop like HDFS, therefore, enabling the creation of
temporary files is the safest
+ || StorageSchemes.VIEWFS.getScheme().equals(getScheme())
// Local file will be visible immediately after
LocalFileSystem#create(..), even before the output
// stream is closed, so temporary file is also needed for atomic file
creating with content written.
|| StorageSchemes.FILE.getScheme().equals(getScheme());
diff --git a/hudi-io/src/main/java/org/apache/hudi/storage/StorageSchemes.java
b/hudi-io/src/main/java/org/apache/hudi/storage/StorageSchemes.java
index 77ecb536cf3e..dce67208c485 100644
--- a/hudi-io/src/main/java/org/apache/hudi/storage/StorageSchemes.java
+++ b/hudi-io/src/main/java/org/apache/hudi/storage/StorageSchemes.java
@@ -57,10 +57,9 @@ public enum StorageSchemes {
ABFSS("abfss", null, null, null),
// Aliyun OSS
OSS("oss", null, null, null),
- // View FS for federated setups. If federating across cloud stores, then
append
- // support is false
- // View FS support atomic creation
- VIEWFS("viewfs", null, true, null),
+ // ViewFS is just a layer on top of other file systems based on hadoop like
HDFS.
+ // So file creation is atomic operation but write may not be transactional.
+ VIEWFS("viewfs", false, true, null),
// ALLUXIO
ALLUXIO("alluxio", null, null, null),
// Tencent Cloud Object Storage