yyanyy edited a comment on pull request #2521:
URL: https://github.com/apache/iceberg/pull/2521#issuecomment-828793923


   > I was wondering about the other NPE in #2495, i was hoping that would have 
been caught by some backwards compatibility tests. I also have no problem with 
doing more testing and such in another pr
   
   I think the hard part is that this specific change (and some other spec 
changes) is adding a field regardless of table versions, and to ensure backward 
compatibility which means to test on a table before this logic is introduced, 
we need to have a fine grain control of creating these metadata files to mimic 
the old behavior when creating the table, so that we can drop things introduced 
in the new logic. And this basically means to create the table from scratch. 
    - Tests like `TestManifestListVersions` covers part of that but it only 
test the basic interaction, no the end to end table operation exists in such 
tests that could catch problem in `ManifestFileUtil` which is used during table 
commit. 
    - Some tests extending `TableTestBase` in core package try to test backward 
compatibility by running tests with table v1 and v2 format, but again they 
won't capture logic introduced in all versions of the spec. 
   
   I think a way of achieving it could be to add resource files (including data 
file and all metadata files all the way to the json file) with all 
optional/later introduced fields missing, and these resource files could be 
readily readable as an existing table (instead of creating tables via code as 
those tests currently do). And then we let tests that extend `TableTestBase` to 
interact with this table. I've created an issue to track this: #2542
   
   ---
   I'm merging in this change to unblock bug fixes, but please feel free to 
continue the discussion here/in #2542 or ping me directly on slack. Thank you 
again @chenjunjiedada @RussellSpitzer @jackye1995 for the review and quick 
response! And thanks Jack for creating the issue!


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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to