ad1happy2go commented on issue #10445:
URL: https://github.com/apache/hudi/issues/10445#issuecomment-1878559399
Thanks for raising this @howardcho . Record Index is not working with
INSERT_OVERWRITE_TABLE. It is working with col stats index and bloom. Below is
the minimal reproducible code -
```
# Define your DataFrame
data = [(1, "John", "2022-01-01"), (2, "Jane", "2022-01-02")]
columns = ["id", "name", "updated"]
df = spark.createDataFrame(data, columns)
# Define the Hudi write options
hudi_options = {
'hoodie.table.name': 'table_name',
'hoodie.datasource.write.table.type': 'COPY_ON_WRITE',
'hoodie.datasource.write.operation': 'INSERT_OVERWRITE_TABLE',
'hoodie.datasource.write.recordkey.field': 'id',
'hoodie.datasource.write.precombine.field': 'updated',
'hoodie.metadata.record.index.enable': True,
}
# Write DataFrame to Hudi table
df.write.format("org.apache.hudi").options(**hudi_options).save(PATH)
df.write.format("org.apache.hudi").mode("append").options(**hudi_options).save(PATH)
```
Raised JIRA for the fix - https://issues.apache.org/jira/browse/HUDI-7273
--
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]