anvsk commented on issue #538:
URL: https://github.com/apache/iceberg-go/issues/538#issuecomment-3219199039
> This test I hacked into `table/transaction_test.go` is also passing:
>
> func (s *SparkIntegrationTestSuite) TestAddSchemaRegression() {
> icebergSchema := iceberg.NewSchema(0,
> iceberg.NestedField{ID: 1, Name: "foo", Type:
iceberg.PrimitiveTypes.Bool},
> iceberg.NestedField{ID: 2, Name: "bar", Type:
iceberg.PrimitiveTypes.String},
> iceberg.NestedField{ID: 3, Name: "baz", Type:
iceberg.PrimitiveTypes.Int32},
> )
>
> tbl, err := s.cat.CreateTable(s.ctx, catalog.ToIdentifier("default",
"go_test_set_properties"), icebergSchema)
> s.Require().NoError(err)
> meta := tbl.Metadata()
> oldLast := tbl.Schema().HighestFieldID()
>
> icebergSchema2 := iceberg.NewSchema(0,
> iceberg.NestedField{ID: 1, Name: "foo", Type:
iceberg.PrimitiveTypes.Bool},
> iceberg.NestedField{ID: 2, Name: "bar", Type:
iceberg.PrimitiveTypes.String},
> )
>
> add := table.NewAddSchemaUpdate(icebergSchema2)
> set := table.NewSetCurrentSchemaUpdate(-1)
> reqs := []table.Requirement{
> table.AssertTableUUID(meta.TableUUID()),
> table.AssertLastAssignedFieldID(oldLast),
> }
>
> _, _, err = s.cat.CommitTable(s.ctx, tbl, reqs, []table.Update{add,
set})
> s.Require().NoError(err)
> }
<img width="1341" height="974" alt="Image"
src="https://github.com/user-attachments/assets/cb43b667-bf60-47c0-991c-f24972d99350"
/>
thank you ! i debug my code , but not go into your code func , i am using
the catalog of rest , it just do a post request,so it lost the last column id
set , and return "invalid_metadata",so i think table.addSchemaUpdate should add
field lastColumnID
--
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]