Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORE - Load Table Response Test #5118

Merged
merged 5 commits into from
Jun 29, 2022

Conversation

kbendick
Copy link
Contributor

@kbendick kbendick commented Jun 22, 2022

This PR adds serde tests for LoadTableResponse.

It also removes metadata-location as a required field for LoadTableResponse, as LoadTableResponse is returned in response to a CreateTableRequest for staging a table for creation without committing it during a transaction. There is not yet necessarily a metadata location as the table has not been fully created.

To avoid making a number of things public, I'm reading in existing TableMetadata JSON files and testing LoadTableResponse with those (as LoadTableResponse is what's being tested, not TableMetadata).

@kbendick kbendick force-pushed the kb-load-table-response-tests branch 3 times, most recently from 02e3cc4 to 2fa317f Compare June 23, 2022 05:21
Copy link
Contributor Author

@kbendick kbendick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some notes on what can be done to reduce the scope of things made public or my thoughts on each.

We can also use shims in test code etc to access some values (like lastAssignedFieldId(), but it's just for TestLoadTableResult so that seems like overkill.

cc @rdblue

@kbendick
Copy link
Contributor Author

Not sure why the Flink CI suite was cancelled after many hours, so I’m going to close and reopen to have CI run again.

@kbendick kbendick closed this Jun 23, 2022
@kbendick kbendick reopened this Jun 23, 2022
@kbendick
Copy link
Contributor Author

kbendick commented Jun 23, 2022

Since we’re only testing LoadTableResponse here and not TableMetadata specifically, it might be better to write the JSON out as external files and use TableMetadataParser after reading them in.

We’d still be building the LoadTableResponse via the builder and testing that, but we wouldn’t need to create the TableMetadata instances programmatically.

@kbendick
Copy link
Contributor Author

On reflecting on this a bit, I think writing the JSON out into test files and then parsing it is probably the ideal way to go, given we’re not testing TableMetadata here specifically, just LoadTableResponse.

@kbendick kbendick force-pushed the kb-load-table-response-tests branch from 2fa317f to 9ac577e Compare June 24, 2022 16:33
@github-actions github-actions bot removed the API label Jun 24, 2022
@kbendick kbendick force-pushed the kb-load-table-response-tests branch from 87cc9ab to a0d0f1d Compare June 25, 2022 00:30
@kbendick kbendick force-pushed the kb-load-table-response-tests branch from 3597242 to 7e3e6b9 Compare June 27, 2022 18:39
The table metadata JSON is returned in the `metadata` field. The corresponding file location of table metadata should be returned in the `metadata-location` field, unless it hasn't been determined yet - such as when a transaction begins to stage a table for creation but has not commit.


Clients can check whether metadata has changed by comparing metadata locations after the table has been created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave this as part of the previous paragraph.

Copy link
Contributor Author

@kbendick kbendick Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Updated what was requested to be part of the previous paragraph.

@kbendick kbendick force-pushed the kb-load-table-response-tests branch 2 times, most recently from 5bc8ef9 to 3213221 Compare June 28, 2022 20:56
@kbendick kbendick force-pushed the kb-load-table-response-tests branch 2 times, most recently from 7ac948f to a5f2bb9 Compare June 28, 2022 21:56
…o show metadata-location is not required

* Add TestLoadTableResponse
* Update OpenAPI spec for REST catalog to show that LoadTableResult's `metadata-location` is not required,
  as LoadTableResponse can be sent for a request that open's a transaction to create a table, in which case
  there is no metadata location yet.
@rdblue rdblue added this to the Iceberg 0.14.0 Release milestone Jun 28, 2022
@rdblue rdblue merged commit 878022b into apache:master Jun 29, 2022
@rdblue
Copy link
Contributor

rdblue commented Jun 29, 2022

Thanks, @kbendick

@kbendick kbendick deleted the kb-load-table-response-tests branch June 29, 2022 16:12
namrathamyske pushed a commit to namrathamyske/iceberg that referenced this pull request Jul 10, 2022
namrathamyske pushed a commit to namrathamyske/iceberg that referenced this pull request Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants