-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Conversation
02e3cc4
to
2fa317f
Compare
There was a problem hiding this 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
core/src/test/java/org/apache/iceberg/LocalTableOperations.java
Outdated
Show resolved
Hide resolved
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. |
Since we’re only testing We’d still be building the |
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 |
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Outdated
Show resolved
Hide resolved
2fa317f
to
9ac577e
Compare
87cc9ab
to
a0d0f1d
Compare
core/src/main/java/org/apache/iceberg/rest/RESTObjectMapper.java
Outdated
Show resolved
Hide resolved
3597242
to
7e3e6b9
Compare
core/src/test/java/org/apache/iceberg/rest/requests/TestCreateTableRequest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/rest/responses/LoadTableResponse.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/rest/responses/LoadTableResponse.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/rest/responses/LoadTableResponse.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/LocalTableOperations.java
Outdated
Show resolved
Hide resolved
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Outdated
Show resolved
Hide resolved
5bc8ef9
to
3213221
Compare
core/src/main/java/org/apache/iceberg/rest/responses/LoadTableResponse.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/rest/RequestResponseTestBase.java
Outdated
Show resolved
Hide resolved
7ac948f
to
a5f2bb9
Compare
…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.
core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/iceberg/rest/responses/TestLoadTableResponse.java
Outdated
Show resolved
Hide resolved
Thanks, @kbendick |
This PR adds serde tests for
LoadTableResponse
.It also removes
metadata-location
as a required field forLoadTableResponse
, asLoadTableResponse
is returned in response to aCreateTableRequest
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 testingLoadTableResponse
with those (asLoadTableResponse
is what's being tested, notTableMetadata
).