voonhous opened a new issue, #21102:
URL: https://github.com/apache/hudi/issues/21102

   ### Bug Description
   
   **What happened:**
   
   On a METADATA_ONLY bootstrapped table, an expression index is built from the 
bootstrap skeleton file alone. The skeleton only holds the meta columns, so the 
indexed data column reads as all null. Data skipping on the expression index 
then drops files that hold matching rows.
   
   `upper(driver) = 'DRIVER_5'` returns 0 rows with data skipping on, and 1 row 
with it off. COW and MOR behave the same.
   
   **What you expected:**
   
   The same rows with data skipping on as with it off.
   
   **Steps to reproduce:**
   
   1. METADATA_ONLY bootstrap a partitioned parquet source table.
   2. Upsert into the table with 
`hoodie.metadata.index.column.stats.enable=true`.
   3. `create index idx_upper_driver on t using column_stats(driver) 
options(expr='upper')`
   4. Query `upper(driver) = 'DRIVER_5'` with `hoodie.enable.data.skipping` on 
and off.
   
   ### Cause
   
   `SparkMetadataWriterUtils#getExpressionIndexRecordsIterator` 
(`hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/utils/SparkMetadataWriterUtils.java:333`)
 reads each base file as `new HoodieBaseFile(filePath)`, without its bootstrap 
source file. The file group reader then reads the skeleton with the data 
schema, and the data columns come back null.
   
   The resulting stats look like a genuine all-null column (null count = value 
count), so the missing-stats handling from #20328 does not apply.
   
   The column stats index is not affected: a skeleton file has no stats for 
data columns, and #20328 keeps such files (#20266).
   
   ### Environment
   
   **Hudi version:** master (5cd6566)
   **Query engine:** Spark
   **Relevant configs:** METADATA_ONLY bootstrap, expression index with column 
stats
   


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