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

   ### Is there an existing issue for this?
   
   - [x] I have searched the existing issues
   
   ### Description of the bug
   
   Currently, a table bootstrapped in the default METADATA_ONLY mode is read 
from its skeleton files alone, so every data column, the record key field 
included, comes back NULL with no error. A FULL_RECORD bootstrap reads right.
   
   ### 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())
   src, path = tempfile.mkdtemp(), tempfile.mkdtemp()
   spark.createDataFrame([("a", 1), ("b", 2)], "id STRING, v 
LONG").write.mode("overwrite").parquet(src)
   spark.createDataFrame([], "id STRING, v 
LONG").write.format("hudi").options(**{
       "hoodie.table.name": "t", "hoodie.datasource.write.recordkey.field": 
"id",
       "hoodie.datasource.write.keygenerator.class": 
"org.apache.hudi.keygen.NonpartitionedKeyGenerator",
       "hoodie.metadata.enable": "false", "hoodie.datasource.write.operation": 
"bootstrap",
       "hoodie.bootstrap.base.path": src}).mode("overwrite").save(path)
   # the default mode selector is METADATA_ONLY, so path holds skeleton files 
and the data stays in src
   
   t = HudiTableBuilder.from_base_uri(path).build()
   print([(r["id"], r["v"]) for b in t.read(HudiReadOptions()) for r in 
b.to_pylist()])
   # [(None, None), (None, None)], should be [('a', 1), ('b', 2)]
   
   print(sorted((r["id"], r["v"]) for r in 
spark.read.format("hudi").load(path).collect()))
   # [('a', 1), ('b', 2)], so Hudi's Spark reader merges the skeleton files 
with the source files
   ```
   
   ### Expected behavior
   
   The read returns the source rows, as Spark's does, or refuses the table.
   
   ### 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
   
   After an upsert, the file groups it rewrote read right and the rest stay 
NULL.


-- 
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