Add support to configure replication factor of delete files. - #219
Merged
shanthoosh merged 10 commits intoJan 7, 2026
Conversation
shanthoosh
force-pushed
the
configure_replication_during_creation
branch
from
December 2, 2025 18:11
19cada3 to
364e96a
Compare
shanthoosh
force-pushed
the
configure_replication_during_creation
branch
from
December 2, 2025 21:30
07b4998 to
9e078c8
Compare
sumedhsakdeo
reviewed
Dec 3, 2025
sumedhsakdeo
reviewed
Dec 3, 2025
sumedhsakdeo
reviewed
Dec 3, 2025
sumedhsakdeo
reviewed
Dec 3, 2025
sumedhsakdeo
reviewed
Dec 3, 2025
sumedhsakdeo
reviewed
Dec 3, 2025
sumedhsakdeo
reviewed
Dec 3, 2025
sumedhsakdeo
reviewed
Dec 3, 2025
sumedhsakdeo
requested changes
Dec 3, 2025
sumedhsakdeo
left a comment
Collaborator
There was a problem hiding this comment.
Left a few comments.
shanthoosh
force-pushed
the
configure_replication_during_creation
branch
2 times, most recently
from
December 9, 2025 23:55
72ffef6 to
350298a
Compare
shanthoosh
force-pushed
the
configure_replication_during_creation
branch
2 times, most recently
from
December 10, 2025 02:10
945cd30 to
f060270
Compare
shanthoosh
force-pushed
the
configure_replication_during_creation
branch
from
December 10, 2025 02:18
f060270 to
3eb8f71
Compare
sumedhsakdeo
reviewed
Jan 5, 2026
shanthoosh
force-pushed
the
configure_replication_during_creation
branch
from
January 5, 2026 20:55
f5418fb to
d3279a5
Compare
shanthoosh
force-pushed
the
configure_replication_during_creation
branch
from
January 5, 2026 21:04
d3279a5 to
84243fa
Compare
shanthoosh
pushed a commit
to shanthoosh/iceberg
that referenced
this pull request
Jul 14, 2026
/linkedin#229) into sql-wire-in # Conflicts: # spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/TestSparkWriteConf.java
This was referenced Jul 14, 2026
mkuchenbecker
pushed a commit
to mkuchenbecker/iceberg
that referenced
this pull request
Jul 21, 2026
…es (v3.5/1.10) Root cause: the linkedin#219/linkedin#229 delete-file replication override was correctly plumbed all the way to the delete OutputFileFactory (SparkPositionDeltaWrite threads deleteFileReplication into the delete factory; OutputFileFactory puts file-replication-factor into the properties map; HadoopFileIO/HadoopOutputFile read it). But the actual data/delete file writers BYPASS HadoopOutputFile.create() (the only place the factor reaches fs.create): - Parquet: ParquetIO.file(HadoopOutputFile) returns parquet's native HadoopOutputFile.fromPath(path, conf), which opens the file at the file system default replication. - ORC: ORC.newFileWriter -> OrcFile.createWriter(path, options); ORC's PhysicalFsWriter uses fs.getDefaultReplication(path). So on real HDFS the position-delete files silently took dfs.replication regardless of the override. This is a pre-existing gap (present in openhouse-1.5.2 too), only surfaced by real-HDFS validation — the LocalFileSystem test harness ignores replication entirely. Fix (guarded by replication > 0, i.e. zero impact when the feature is unused): - HadoopOutputFile: expose getReplication(). - ParquetIO.file(...) both overloads: when a custom replication factor is set, route through ParquetOutputFile so iceberg's HadoopOutputFile.create() (fs.create with the explicit replication) is used. - ORC.newFileWriter: after creating the (empty) writer, apply the requested replication to the file via fs.setReplication so the blocks written use it. Validated on real HDFS (Hadoop 3.2.1, Spark 3.5.2) via the oh-hadoop-spark docker stack, dfs.replication=3: ORC session delete-file-replication=1 -> delete file %r = 1 ORC TBLPROPERTY write.delete-file-replication=2 -> delete file %r = 2 ORC UPDATE (MoR) session=1 -> delete file %r = 1 Parquet session=1 -> delete file %r = 1 Data files continue to follow dfs.replication (%r = 3), no regression. 1.10 / Spark-3.5 only; core orc/ and parquet/ modules are shared, so the same patch should be replayed onto the 1.11 branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LLnVvLYnxjTuH2b5nAHa4A
mkuchenbecker
pushed a commit
to mkuchenbecker/iceberg
that referenced
this pull request
Jul 22, 2026
…es (v3.5/1.10) Root cause: the linkedin#219/linkedin#229 delete-file replication override was correctly plumbed all the way to the delete OutputFileFactory (SparkPositionDeltaWrite threads deleteFileReplication into the delete factory; OutputFileFactory puts file-replication-factor into the properties map; HadoopFileIO/HadoopOutputFile read it). But the actual data/delete file writers BYPASS HadoopOutputFile.create() (the only place the factor reaches fs.create): - Parquet: ParquetIO.file(HadoopOutputFile) returns parquet's native HadoopOutputFile.fromPath(path, conf), which opens the file at the file system default replication. - ORC: ORC.newFileWriter -> OrcFile.createWriter(path, options); ORC's PhysicalFsWriter uses fs.getDefaultReplication(path). So on real HDFS the position-delete files silently took dfs.replication regardless of the override. This is a pre-existing gap (present in openhouse-1.5.2 too), only surfaced by real-HDFS validation — the LocalFileSystem test harness ignores replication entirely. Fix (guarded by replication > 0, i.e. zero impact when the feature is unused): - HadoopOutputFile: expose getReplication(). - ParquetIO.file(...) both overloads: when a custom replication factor is set, route through ParquetOutputFile so iceberg's HadoopOutputFile.create() (fs.create with the explicit replication) is used. - ORC.newFileWriter: after creating the (empty) writer, apply the requested replication to the file via fs.setReplication so the blocks written use it. Validated on real HDFS (Hadoop 3.2.1, Spark 3.5.2) via the oh-hadoop-spark docker stack, dfs.replication=3: ORC session delete-file-replication=1 -> delete file %r = 1 ORC TBLPROPERTY write.delete-file-replication=2 -> delete file %r = 2 ORC UPDATE (MoR) session=1 -> delete file %r = 1 Parquet session=1 -> delete file %r = 1 Data files continue to follow dfs.replication (%r = 3), no regression. 1.10 / Spark-3.5 only; core orc/ and parquet/ modules are shared, so the same patch should be replayed onto the 1.11 branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LLnVvLYnxjTuH2b5nAHa4A (cherry picked from commit 06e05cc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Adds support to configures the replication factor during the creation of the delete files. Enables the spark jobs to set the HDFS delete replication as part of the writer configuration.
Tests