voonhous commented on PR #18806:
URL: https://github.com/apache/hudi/pull/18806#issuecomment-7090655914

   Revisiting this before i forget. 
   
   `hoodie.datasource.write.reconcile.schema` is used to determine which schema 
the write uses when incoming batch's schema differs from the table's according 
to the doc. 
   
   if it is **false** incoming batch schema becomes the write schema. If it is 
**true** table's schema will only stay the same or grow, but never shrink in 
terms of column count. 
   
   So intent of this config under **true** is an operation on columns instead 
of types.
   
   I checked the code and it seems that the above config 
`hoodie.datasource.write.reconcile.schema` is also deprecated after `0.14.1` 
and `hoodie.write.set.null.for.missing.columns` is the designated replacement.
   
   The replacement seems to be a little more accurate in description of what it 
is doing. 
   
   We can revisit this in the future. I feel that the docs **are accurate**. 
The schema-on-write page and its promotion charge describes thedefault write 
path when `reconcile.schema=false`. On that path, the 2 type promotion works, 
the page never mentions reconcile. We were not clear to mention that the chart 
doesn't hold for `reconcile.schema=true`.
   
   The code is wrong in `reconcileSchemasLegacy` where the branch used when 
`reconcile.schema=true` and `schema-on-read` is off.
   
   This bug is in a config that is deprecated since 0.14.1 so i think we don't 
really have to fix it yet. The schema evolution flow here is a little too 
complicated with all the reconcile, schema-on-read and schema-on-write path 
which means with 3 configs, we have about 2^3 = 8 paths we need to test. 
Something i feel is a little too convoluted. We will have to redo this code 
path to improve devex and ux in the future. Just my 2c.


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