-
Notifications
You must be signed in to change notification settings - Fork 3k
Update TableTestBase tests to run with formats v1 and v2 #936
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -243,11 +243,11 @@ static Schema wrapFileSchema(Types.StructType fileSchema) { | |
|
|
||
| static class IndexedManifestEntry implements ManifestEntry, IndexedRecord { | ||
| private final org.apache.avro.Schema avroSchema; | ||
| private final long commitSnapshotId; | ||
| private final Long commitSnapshotId; | ||
rdblue marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| private final V1Metadata.IndexedDataFile fileWrapper; | ||
| private ManifestEntry wrapped = null; | ||
|
|
||
| IndexedManifestEntry(long commitSnapshotId, Types.StructType partitionType) { | ||
| IndexedManifestEntry(Long commitSnapshotId, Types.StructType partitionType) { | ||
|
Contributor
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. Copied manifests will use a null snapshot ID. |
||
| this.avroSchema = AvroSchemaUtil.convert(entrySchema(partitionType), "manifest_entry"); | ||
| this.commitSnapshotId = commitSnapshotId; | ||
| // TODO: when v2 data files differ from v1, this should use a v2 wrapper | ||
|
|
@@ -281,7 +281,8 @@ public Object get(int i) { | |
| // if the entry's sequence number is null, then it will inherit the sequence number of the current commit. | ||
| // to validate that this is correct, check that the snapshot id is either null (will also be inherited) or | ||
| // that it matches the id of the current commit. | ||
| Preconditions.checkState(wrapped.snapshotId() == null || commitSnapshotId == wrapped.snapshotId(), | ||
| Preconditions.checkState( | ||
| wrapped.snapshotId() == null || wrapped.snapshotId().equals(commitSnapshotId), | ||
| "Found unassigned sequence number for an entry from snapshot: %s", wrapped.snapshotId()); | ||
| return null; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does this mean manifests will be written with the v2 schema (i.e. with sequence numbers) even though
TableMetadatais v1 and the manifest list is written with v1? And this should work because we do a projection on read and sequence number is optional?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.
This is the constructor used to create an append or rewritten manifest, so this makes the manifests that are passed into
FastAppend,MergeAppend, andRewriteManifestssupport sequence numbers. It is needed for the last case: when rewriting a manifest for a v2 table, we need to preserve sequence numbers.This works for v1 because v1 tables will ignore the new fields.