-
Notifications
You must be signed in to change notification settings - Fork 170
Move table-metadata-pointer back to global state, use snapshot,schema,spec,sort-order ids as on-ref state #2626
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 |
|---|---|---|
|
|
@@ -28,14 +28,8 @@ | |
| * Represents the state of an Iceberg table in Nessie. An Iceberg table is globally identified via | ||
| * its {@link Content#getId() unique ID}. | ||
| * | ||
| * <p>The Iceberg-table-state consists of the location to the table-metadata and the state of the ID | ||
| * generators using the serialized version of Iceberg's {@code TableIdGenerators} object. | ||
| * | ||
| * <p>The table-metadata-location is managed on each Nessie reference, which means that all versions | ||
| * of the same table have distinct table-metadata across all named-references (branches and tags). | ||
| * | ||
| * <p>The information needed to generate IDs for an Iceberg table that need to be globally unique, | ||
| * for example the last-column-ID, is managed globally within Nessie. | ||
| * <p>The Iceberg-table-state consists of the location to the table-metadata and the state of | ||
| * relevant IDs using a serialized version of those. | ||
| * | ||
| * <p>When adding a new table (aka content-object identified by a content-id), use a {@link | ||
| * org.projectnessie.model.Operation.Put} without an expected-value. In all other cases (updating an | ||
|
|
@@ -69,20 +63,38 @@ public abstract class IcebergTable extends Content { | |
| @NotBlank | ||
| public abstract String getMetadataLocation(); | ||
|
|
||
| /** Opaque representation of Iceberg's {@code TableIdGenerators}. */ | ||
| public abstract String getIdGenerators(); | ||
| public abstract long getSnapshotId(); | ||
|
Contributor
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. do these need default values? particularly the shcema/specid etc? Or do they have to be specified every time
Member
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. Don't think those should have default values. It uses what Iceberg's |
||
|
|
||
| public abstract int getSchemaId(); | ||
|
|
||
| public abstract int getSpecId(); | ||
|
|
||
| public abstract int getSortOrderId(); | ||
|
|
||
| public static IcebergTable of(String metadataLocation, String idGenerators) { | ||
| public static IcebergTable of( | ||
| String metadataLocation, long snapshotId, int schemaId, int specId, int sortOrderId) { | ||
| return ImmutableIcebergTable.builder() | ||
| .metadataLocation(metadataLocation) | ||
| .idGenerators(idGenerators) | ||
| .snapshotId(snapshotId) | ||
| .schemaId(schemaId) | ||
| .specId(specId) | ||
| .sortOrderId(sortOrderId) | ||
| .build(); | ||
| } | ||
|
|
||
| public static IcebergTable of(String metadataLocation, String idGenerators, String contentId) { | ||
| public static IcebergTable of( | ||
| String metadataLocation, | ||
| long snapshotId, | ||
| int schemaId, | ||
| int specId, | ||
| int sortOrderId, | ||
| String contentId) { | ||
| return ImmutableIcebergTable.builder() | ||
| .metadataLocation(metadataLocation) | ||
| .idGenerators(idGenerators) | ||
| .snapshotId(snapshotId) | ||
| .schemaId(schemaId) | ||
| .specId(specId) | ||
| .sortOrderId(sortOrderId) | ||
| .id(contentId) | ||
| .build(); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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: In the descriptions, If we are naming this variable(
default-sort-order-ID) based on iceberg spec, then other three variable has to bedefault-spec-id,current-schema-id,current-snapshot-idor may be instead of mentioning each field, we just link it to
IcebergRefStateThere 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: i thikn
IDshjould beid