RyanLin5967 opened a new issue, #918:
URL: https://github.com/apache/hudi-rs/issues/918

   ### Is there an existing issue for this?
   
   - [x] I have searched the existing issues
   
   ### Description of the bug
   
   Currently, the commit-time filter is skipped when 
`hoodie.populate.meta.fields` is false, so an incremental read returns every 
row of each file the window rewrote, changed or not. With meta fields populated 
the same read returns `[('a', 2)]`.
   
   ### Steps To Reproduce
   
   ```python
   import tempfile
   from pyspark.sql import SparkSession
   from hudi import HudiTableBuilder, HudiReadOptions, HudiQueryType
   
   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.populate.meta.fields": "false"}
   for rows in ([("a", 1), ("b", 1)], [("a", 2)]):
       spark.createDataFrame(rows, "id STRING, v LONG").write.format("hudi") \
           .options(**opts).mode("append").save(path)
   
   t = HudiTableBuilder.from_base_uri(path).build()
   c2 = t.get_timeline().get_completed_commits()[1].timestamp
   opt = 
HudiReadOptions().with_query_type(HudiQueryType.Incremental).with_start_timestamp(c2)
   print(sorted((r["id"], r["v"]) for b in t.read(opt) for r in b.to_pylist()))
   # [('a', 2), ('b', 1)], should be [('a', 2)]
   # b did not change in the second commit, which rewrote the file it shares 
with a
   
   spark.read.format("hudi").option("hoodie.datasource.query.type", 
"incremental") \
       .option("hoodie.datasource.read.begin.instanttime", c2).load(path)
   # HoodieException: Incremental queries are not supported when meta fields 
are disabled
   ```
   
   ### Expected behavior
   
   The read fails the way Spark's does, since without `_hoodie_commit_time` 
nothing tells which rows a commit changed.
   
   ### 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]

Reply via email to