lokeshj1703 opened a new pull request, #18921:
URL: https://github.com/apache/hudi/pull/18921

   ## What is the purpose of the pull request
   
   `HoodieGlobalSimpleIndex.tagLocationInternal` overrides the parent 
`HoodieSimpleIndex.tagLocationInternal` but was missing the 
`persist`/`unpersist` caching guard that the parent already uses.
   
   `inputRecords` is referenced multiple times across the lazy RDD DAG 
constructed inside `tagGlobalLocationBackToRecords`: once for the key-based 
join (`mapToPair` → `leftOuterJoin`) and once for each derived branch in 
`mergeForPartitionUpdatesAndDeletionsIfNeeded` (`taggedNewRecords`, 
`untaggedUpdatingRecords`, `globalLocations`). Without caching, Spark 
recomputes the full source lineage for each downstream branch, causing the same 
data to be re-read from the source multiple times.
   
   This change mirrors the existing pattern in:
   - `HoodieSimpleIndex.tagLocationInternal`
   - `SparkMetadataTableGlobalRecordLevelIndex.tagLocation`
   
   ## Brief change log
   
   - Add `inputRecords.persist(config.getSimpleIndexInputStorageLevel())` at 
the start of `HoodieGlobalSimpleIndex.tagLocationInternal` when caching is 
enabled
   - Call `inputRecords.unpersist()` after `tagGlobalLocationBackToRecords` 
returns
   
   ## Verify this pull request does not introduce a bug
   
   - Follows identical pattern already in `HoodieSimpleIndex` (parent class)
   - No logic change — only adds caching guard controlled by existing config 
`hoodie.simple.index.use.caching`
   
   ## Does this PR introduce a breaking change?
   
   No.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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