RussellSpitzer edited a comment on pull request #2496: URL: https://github.com/apache/iceberg/pull/2496#issuecomment-1045139149
> I meant - without any rewriting implementation to change or customize anything - to have the reader check current call stack and detect if the caller is a rewriter, then we can have proper reading for un-materialized defaulted columns I'm not sure how this would work. Given my example again ``` Given Row (A int) File 1 - Row (1) File 2 - Row (2) AlterTable Add Column (B int default (3) Rewrite File 1 File1' = Row(1, 3) or Row(1, null)? ``` If I choose Row(1, 3) then File2 will get a different value if the default is changed. (Forbidding changing the default sounds like an ok solution for this but i'm not a huge fan of table changes that have this kind of non-controlled behavior. A user choosing to Alter the default even after warning would have no real way to tell what rows got the new default and which didn't) If I choose Row(1, null) then for Required B I don't have a problem since I can just read the default, for Optional I have a problem because now have this column as null and not missing. So I'd say i'm +1 on saying defaults are immutable with a strong wording that changing defaults is only allowed with a special flag that strongly encourages users to fully rewrite their datafiles if they only want the default applied to new files added to the table. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
