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

   ### Purpose
   
   `TableWriteImpl` builds its `DefaultValueRow` once in the constructor, sized 
to the constructor row type. `withWriteType` refreshed the write type and the 
not-null indexes but left the `DefaultValueRow` untouched, so once the write 
type changed the stale default value row no longer matched the rows it wraps. 
The Spark copy-on-write rewrite writes with the row-tracking-extended type, and 
a partial write uses a narrowed projection, both of which shift arity and 
positions. Reading an appended position that is null, such as the null sequence 
number the rewrite carries, fell through to the default row's underlying array 
of the old length and crashed the write with an 
`ArrayIndexOutOfBoundsException`. This rebuilds the default value row from the 
new write type so its arity and positions follow the type.
   
   ### Tests
   
   Added `testWithWriteTypeRebuildsDefaultValueRow`: after switching to the 
row-tracking-extended write type with a null sequence number, an explicit value 
on the defaulted column survives the type change.
   
   Added `testWithWriteTypeSubstitutesDefaultValue`: same shape but the 
defaulted column is left null, so the rebuilt default value row fills the 
column default at its new position.
   
   ### API and Format
   
   No.
   
   ### Documentation
   
   No.
   


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