LuciferYang opened a new pull request, #13231:
URL: https://github.com/apache/gravitino/pull/13231

   ### What changes were proposed in this pull request?
   
   `IndexImpl` now deep-copies `fieldNames` at construction and on 
`fieldNames()`, and snapshots `properties` into an `ImmutableMap`. 
`equals`/`hashCode` semantics are unchanged.
   
   ### Why are the changes needed?
   
   The index stored and returned the caller's `String[][]` and `Map` by 
reference, so mutating the caller's arrays before or after `Indexes.of` changed 
the built index and drifted its equality.
   
   Fix: #13230
   
   ### Does this PR introduce _any_ user-facing change?
   
   No API change. A built index is now immutable: mutating the caller's arrays 
or map no longer changes the index. `equals`/`hashCode` semantics are unchanged.
   
   ### How was this patch tested?
   
   Added `TestIndexes`, which pins that mutating the caller-supplied arrays and 
map does not change the built index; it fails on the pre-fix tree and passes 
after the fix.
   


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