Content-Length: 314297 | pFad | http://github.com/apache/iceberg/pull/4322

30 Core: Add REST catalog table requests and responses by rdblue · Pull Request #4322 · apache/iceberg · GitHub
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: Add REST catalog table requests and responses #4322

Merged
merged 1 commit into from
Mar 16, 2022

Conversation

rdblue
Copy link
Contributor

@rdblue rdblue commented Mar 13, 2022

This adds REST request and response classes for table operations.

  • CreateTableRequest is used to create tables
  • UpdateTableRequest is used to update tables by applying a list of MetadataUpdate changes
  • LoadTableResponse is used for create, load, and update
  • DropTableResponse is used for drop

UpdateTableRequest includes a set of assertions from the REST spec, with some additions that were needed to get tests working:

  • AssertTableDoesNotExist is used for create table transactions
  • AssertTableUUID checks that the table UUID has not changed from the base metadata (prevents errors from concurrent drop/create)
  • AssertLastAssignedFieldId is used to check that no concurrent operation has assigned schema field IDs that may conflict
  • AssertLastAssignedPartitionId is used to check that no concurrent operation has assigned partition field IDs that may conflict

UpdateTableRequest will automatically add assertions for the requested changes.

This is part of #4241.

@github-actions github-actions bot added the core label Mar 13, 2022
@rdblue
Copy link
Contributor Author

rdblue commented Mar 13, 2022

This is blocked by #4320. Will rebase when that one is committed.

@rdblue rdblue force-pushed the add-table-requests-responses branch 2 times, most recently from 9701a0d to f863fa3 Compare March 15, 2022 03:29
@rdblue rdblue force-pushed the add-table-requests-responses branch from f863fa3 to 4245c4d Compare March 15, 2022 15:22
@danielcweeks danielcweeks self-requested a review March 15, 2022 21:49
update((MetadataUpdate.SetDefaultPartitionSpec) update);
} else if (update instanceof MetadataUpdate.SetDefaultSortOrder) {
update((MetadataUpdate.SetDefaultSortOrder) update);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

you might want an else to throw at the end otherwise future updates (if there are any) may fall through.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Other updates are okay. These methods just add requirements, so things like AddSnapshot are supposed to fall through without changing anything.

@rdblue rdblue requested a review from danielcweeks March 15, 2022 22:48

// For Jackson to properly fail when deserializing, this needs to be boxed.
// Otherwise, the boolean is parsed according to "loose" javascript JSON rules.
private Boolean dropped;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little confused about the conditions under which dropped would be false. According to the spec, 404 should be returned if the table is not found. 401/403 for auth. So how do we get a 200/202 response with a false flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, we need to remove 404 from the spec. The catalog API requires that the catalog should return false if the table does not exist and does not allow throwing NoSuchTableException. I'll open a PR to clarify the REST spec.

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








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/apache/iceberg/pull/4322

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy