You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "rambleraptor (via GitHub)" <gi...@apache.org> on 2026/04/28 23:28:18 UTC
[PR] Schema ids can not be the same in REST Fixture [iceberg]
rambleraptor opened a new pull request, #16148:
URL: https://github.com/apache/iceberg/pull/16148
Right now, the REST Fixture allows you to set multiple schemas with the same schema id. This shouldn't be allowed, since it breaks the idea that each schema has a unique ID.
I've added in a validation into the REST Fixture and added a test.
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Schema ids can not be the same in REST Fixture [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #16148:
URL: https://github.com/apache/iceberg/pull/16148#discussion_r3168131940
##########
core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java:
##########
@@ -1037,6 +1038,50 @@ private static Pair<List<FileScanTask>, String> planFilesFor(
}
@SuppressWarnings("FutureReturnValueIgnored")
+ private static void applyUpdates(
+ TableMetadata base, TableMetadata.Builder builder, List<MetadataUpdate> updates) {
+ updates.forEach(
+ update -> {
+ if (update instanceof MetadataUpdate.AddSchema) {
+ Schema schema = ((MetadataUpdate.AddSchema) update).schema();
+ validateSchemaId(base, schema);
+ }
+ update.applyTo(builder);
+ });
+ }
+
+ private static void applyUpdates(
+ ViewMetadata base, ViewMetadata.Builder builder, List<MetadataUpdate> updates) {
+ updates.forEach(
+ update -> {
+ if (update instanceof MetadataUpdate.AddSchema) {
Review Comment:
validations like these shouldn't be part of applying an update. We do have requirements that are being executed before applying updates and we check them in `UpdateRequirements`
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Schema ids can not be the same in REST Fixture [iceberg]
Posted by "gaborkaszab (via GitHub)" <gi...@apache.org>.
gaborkaszab commented on code in PR #16148:
URL: https://github.com/apache/iceberg/pull/16148#discussion_r3168831361
##########
core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java:
##########
@@ -3986,6 +3987,112 @@ protected RESTSessionCatalog newSessionCatalog(
return catalog;
}
+ @Test
+ public void testAddSchemaWithExistingIdAndDifferentSchema() {
Review Comment:
I think here the point is that we can't know if the requests are created via the Table/View API from the Java lib, because there are other projects, other custom implementations that could leverage the reference IRC implementation for testing. So the question is how far do we wanna go with input verification on the reference IRC side. Since this is a reference, demonstration purpose implementation, I'd lean toward not to seek thoroughness because that'd shift the focus of the implementation.
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Schema ids can not be the same in REST Fixture [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16148:
URL: https://github.com/apache/iceberg/pull/16148#issuecomment-4585297707
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Schema ids can not be the same in REST Fixture [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #16148:
URL: https://github.com/apache/iceberg/pull/16148#discussion_r3168182335
##########
core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java:
##########
@@ -3986,6 +3987,112 @@ protected RESTSessionCatalog newSessionCatalog(
return catalog;
}
+ @Test
+ public void testAddSchemaWithExistingIdAndDifferentSchema() {
Review Comment:
there is actually code in `TableMetadata` / `ViewMetadata` that would detect that schemas differ and would assign it a different schema ID, so I don't see how this would fail in practice when the normal Table / View APIs are being used.
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Schema ids can not be the same in REST Fixture [iceberg]
Posted by "rambleraptor (via GitHub)" <gi...@apache.org>.
rambleraptor commented on PR #16148:
URL: https://github.com/apache/iceberg/pull/16148#issuecomment-4345884359
This is the same behavior for all of those ID types.
All of our implementations test against the REST Fixture. Case in point, this would've caught a bug in iceberg-terraform. If we're testing against this, we should make it conform to the spec in the strongest ways possible.
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Schema ids can not be the same in REST Fixture [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #16148:
URL: https://github.com/apache/iceberg/pull/16148#discussion_r3168188880
##########
core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java:
##########
@@ -3986,6 +3987,112 @@ protected RESTSessionCatalog newSessionCatalog(
return catalog;
}
+ @Test
+ public void testAddSchemaWithExistingIdAndDifferentSchema() {
Review Comment:
here's for example the relevant part for a Table: https://github.com/apache/iceberg/blob/1d6c685c1391df604d59f3335a1fba7a1af2c25f/core/src/main/java/org/apache/iceberg/TableMetadata.java#L1646
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Schema ids can not be the same in REST Fixture [iceberg]
Posted by "gaborkaszab (via GitHub)" <gi...@apache.org>.
gaborkaszab commented on PR #16148:
URL: https://github.com/apache/iceberg/pull/16148#issuecomment-4342917856
Thank you for looking into this, @rambleraptor!
Just to understand the context: isn't this the behavior now for all the metadata elements that have an ID, like partition specs, sort orders, schemas, etc.? I believe that the reference IRC implementation is more for demonstration purposes and not for full coverage on all the inputs (including input validation). I also see that we don't even validate the requirements within UpdateTableRequest. This makes me think that this is on purpose.
If we added schema validations now, it's hard to argue why stop here and not to add validation for everything else too, that would push the focus on a more thorough implementation from demonstration purposes.
I wonder what others think here.
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Schema ids can not be the same in REST Fixture [iceberg]
Posted by "rambleraptor (via GitHub)" <gi...@apache.org>.
rambleraptor closed pull request #16148: Schema ids can not be the same in REST Fixture
URL: https://github.com/apache/iceberg/pull/16148
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org