RyanLin5967 opened a new issue, #916:
URL: https://github.com/apache/hudi-rs/issues/916
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Description of the bug
Currently, listing drops a log file unless the instant in its name
completed, and on table version 6 a log file written while a compaction is
pending is named after that compaction, so those writes are missing from reads.
Table versions 8 and 9 read them.
### Steps To Reproduce
```python
import tempfile
from pyspark.sql import SparkSession
from hudi import HudiTableBuilder, HudiReadOptions
spark = (SparkSession.builder
.config("spark.jars.packages",
"org.apache.hudi:hudi-spark4.0-bundle_2.13:1.2.1")
.config("spark.serializer",
"org.apache.spark.serializer.KryoSerializer").getOrCreate())
path = tempfile.mkdtemp()
opts = {"hoodie.table.name": "t", "hoodie.datasource.write.recordkey.field":
"id",
"hoodie.datasource.write.table.type": "MERGE_ON_READ",
"hoodie.write.table.version": "6",
"hoodie.compact.inline": "false", "hoodie.compact.schedule.inline":
"true",
"hoodie.compact.inline.max.delta.commits": "1"}
for v in (1, 2, 3):
spark.createDataFrame([("a", v)], "id STRING, v
LONG").write.format("hudi") \
.options(**opts).mode("append").save(path)
# the second write schedules a compaction, and the third writes its log file
under that pending instant
t = HudiTableBuilder.from_base_uri(path).build()
print(sorted((r["id"], r["v"]) for b in t.read(HudiReadOptions()) for r in
b.to_pylist()))
# [('a', 2)], should be [('a', 3)]
print(sorted((r["id"], r["v"]) for r in
spark.read.format("hudi").load(path).collect()))
# [('a', 3)], so Hudi's Spark reader reads the write made during the pending
compaction
```
### Expected behavior
The read returns `[('a', 3)]`, as Spark's does.
### Screenshots / Logs
_No response_
### Software information
- Operating system: macOS 26.7.1, arm64 (Darwin 25.6.0)
- Rust version: none, the PyPI wheel on Python 3.12.16
- Project version: hudi 0.5.0, and main (its CI wheel, 0.6.0.dev0)
- Writer: Hudi 1.2.1 (`hudi-spark4.0-bundle_2.13`) on pyspark 4.0.5, Java
21.0.12.1
### Additional context
_No response_
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]