Repository navigation
[Server] Authorize the Iceberg REST catalog endpoints #1813
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1067,10 +1067,13 @@ public ListTablesResponse listTables( | |
|
|
||
| /** | ||
| * One page of the tables in a schema that carry an Iceberg metadata pointer, and the token for | ||
| * the page after it. An empty {@code nextPageToken} means the listing is complete. The names are | ||
| * only the tables that carry one, so a page can be empty while more pages remain. | ||
| * the page after it. An empty {@code nextPageToken} means the listing is complete. The DAOs are | ||
| * only the ones that carry one, so a page can be empty while more pages remain. The raw DAOs are | ||
| * returned (rather than converted {@code TableInfo}s) so a caller can authorize the listing per | ||
| * table by id and read each name without materializing an API model; callers must read only eager | ||
| * fields ({@code id}, {@code name}), since the rows are detached once the page returns. | ||
| */ | ||
| public record IcebergTablePage(List<String> tableNames, Optional<String> nextPageToken) {} | ||
| public record IcebergTablePage(List<TableInfoDAO> tableDaos, Optional<String> nextPageToken) {} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: returning detached
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In a follow up PR, I can make a minimum interface and have |
||
|
|
||
| /** | ||
| * Lists the tables in a schema that carry an Iceberg metadata pointer -- a Delta UniForm | ||
|
|
@@ -1095,13 +1098,10 @@ public IcebergTablePage listIcebergTables( | |
| List<TableInfoDAO> page = | ||
| LISTING_HELPER.listEntity(session, Optional.empty(), pageToken, schemaId); | ||
| String nextPageToken = LISTING_HELPER.getNextPageToken(page, Optional.empty()); | ||
| List<String> tableNames = | ||
| page.stream() | ||
| .filter(dao -> dao.getIcebergMetadataLocation() != null) | ||
| .map(TableInfoDAO::getName) | ||
| .toList(); | ||
| List<TableInfoDAO> tableDaos = | ||
| page.stream().filter(dao -> dao.getIcebergMetadataLocation() != null).toList(); | ||
| return new IcebergTablePage( | ||
| tableNames, Optional.ofNullable(nextPageToken).filter(token -> !token.isEmpty())); | ||
| tableDaos, Optional.ofNullable(nextPageToken).filter(token -> !token.isEmpty())); | ||
| }, | ||
| "Failed to list tables", | ||
| /* readOnly= */ true); | ||
|
|
||
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.
nit:
CREATE_ICEBERG_TABLEis identical toCREATE_TABLEexcept for the MANAGED/EXTERNAL discriminator (#location == nullvs#table_type != 'EXTERNAL'). Consider factoring the shared catalog/schema tier + external-location tail so the two policies can't drift.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.
CREATE_ICEBERG_TABLEwill be removed in the next PR in stack once it's able to extracttable_typefor IRC.