nastra commented on issue #9723:
URL: https://github.com/apache/iceberg/issues/9723#issuecomment-1952909031

   > @amogh-jahagirdar
   > 
   > After taken a closer look, `latest_schema_id` behaves strangely for ALTER 
TABLE. ALTER TABLE updates the metadata file and its `current-schema-id`, but 
it will not update the snapshot. If `latest_schema_id` is associated with the 
metadata file, the value should be 1. Now the `latest_schema_id` is associated 
with the snapshot in the metadata file, so the value is 0.
   > 
   > Isn't this confusing consider that this table is `metadata_log_entries` 
and metadata file should be the main entity to be associated with? A user won't 
be able to know without documentation or a better name for the column.
   > 
   > IMO,
   > 
   > * `schema_id` in the metadata table should be associated with the metadata 
file.
   > * `schema_id` associated with the snapshot should be added to the snapshot 
table.
   > 
   > Consider the following example. If `latest_schema_id` in second row is 1, 
it will clearly show that the schema has been updated in that commit.
   > 
   > ```
   > > create table iceberg.default.t1 (c1 integer);
   > > alter table iceberg.default.t1 add column c2 varchar;
   > timestamp               |                             file                 
         | latest_snapshot_id  | latest_schema_id | latest_sequence_number
   > 
------------------------+-----------------------------------------------------------+---------------------+------------------+------------------------
   > 2024-01-22 08:11:35.128  | 
00000-9e475095-c0f2-4249-92b5-d744f208a624.metadata.json | 3603548602758670925 
|                0 |                      1
   > 2024-01-22 08:11:49.279  | 
00001-c357b5f7-1d55-45d8-be6d-f1bbdd0de184.metadata.json | 3603548602758670925 
|                0 |                      1
   > (2 rows)
   > ```
   
   @oneonestar the issue was auto-closed when the PR was merged. Can you please 
open a separate issue for this?


-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to