-
Notifications
You must be signed in to change notification settings - Fork 103
feat: support operator== for Literal/Manifest/ManifestList #147
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 1 commit
Commits
Show all changes
4 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -68,13 +68,13 @@ struct ICEBERG_EXPORT DataFile { | |||||
| /// Field id: 134 | ||||||
| /// Type of content stored by the data file: data, equality deletes, or position | ||||||
| /// deletes (all v1 files are data files) | ||||||
| Content content; | ||||||
| Content content = Content::kData; | ||||||
| /// Field id: 100 | ||||||
| /// Full URI for the file with FS scheme | ||||||
| std::string file_path; | ||||||
| /// Field id: 101 | ||||||
| /// File format type, avro, orc, parquet, or puffin | ||||||
| FileFormatType file_format; | ||||||
| FileFormatType file_format = FileFormatType::kUnknown; | ||||||
|
dongxiao1198 marked this conversation as resolved.
Outdated
|
||||||
| /// Field id: 102 | ||||||
| /// Partition data tuple, schema based on the partition spec output using partition | ||||||
| /// field ids | ||||||
|
|
@@ -146,7 +146,7 @@ struct ICEBERG_EXPORT DataFile { | |||||
| std::optional<int32_t> sort_order_id; | ||||||
| /// This field is not included in spec, so it is not serialized into the manifest file. | ||||||
| /// It is just store in memory representation used in process. | ||||||
| int32_t partition_spec_id; | ||||||
| int32_t partition_spec_id = 0; | ||||||
|
Member
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.
Suggested change
|
||||||
| /// Field id: 142 | ||||||
| /// The _row_id for the first row in the data file. | ||||||
| /// | ||||||
|
|
@@ -261,6 +261,8 @@ struct ICEBERG_EXPORT DataFile { | |||||
| SchemaField::MakeOptional(145, "content_size_in_bytes", iceberg::int64(), | ||||||
| "The length of referenced content stored in the file"); | ||||||
|
|
||||||
| bool operator==(const DataFile& other) const; | ||||||
|
|
||||||
| static std::shared_ptr<StructType> Type(std::shared_ptr<StructType> partition_type); | ||||||
| }; | ||||||
|
|
||||||
|
|
@@ -272,7 +274,7 @@ struct ICEBERG_EXPORT ManifestEntry { | |||||
| /// Field id: 0 | ||||||
| /// Used to track additions and deletions. Deletes are informational only and not used | ||||||
| /// in scans. | ||||||
| ManifestStatus status; | ||||||
| ManifestStatus status = ManifestStatus::kAdded; | ||||||
| /// Field id: 1 | ||||||
| /// Snapshot id where the file was added, or deleted if status is 2. Inherited when | ||||||
| /// null. | ||||||
|
|
@@ -297,6 +299,8 @@ struct ICEBERG_EXPORT ManifestEntry { | |||||
| inline static const SchemaField kFileSequenceNumber = | ||||||
| SchemaField::MakeOptional(4, "file_sequence_number", iceberg::int64()); | ||||||
|
|
||||||
| bool operator==(const ManifestEntry& other) const; | ||||||
|
|
||||||
| static std::shared_ptr<StructType> TypeFromPartitionType( | ||||||
| std::shared_ptr<StructType> partition_type); | ||||||
| static std::shared_ptr<StructType> TypeFromDataFileType( | ||||||
|
|
||||||
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -40,7 +40,7 @@ namespace iceberg { | |||||
| struct ICEBERG_EXPORT PartitionFieldSummary { | ||||||
| /// Field id: 509 | ||||||
| /// Whether the manifest contains at least one partition with a null value for the field | ||||||
| bool contains_null; | ||||||
| bool contains_null = false; | ||||||
|
dongxiao1198 marked this conversation as resolved.
Outdated
|
||||||
| /// Field id: 518 | ||||||
| /// Whether the manifest contains at least one partition with a NaN value for the field | ||||||
| std::optional<bool> contains_nan; | ||||||
|
|
@@ -64,6 +64,8 @@ struct ICEBERG_EXPORT PartitionFieldSummary { | |||||
| inline static const SchemaField kUpperBound = SchemaField::MakeOptional( | ||||||
| 511, "upper_bound", iceberg::binary(), "Partition upper bound for all files"); | ||||||
|
|
||||||
| bool operator==(const PartitionFieldSummary& other) const; | ||||||
|
|
||||||
| static const StructType& Type(); | ||||||
| }; | ||||||
|
|
||||||
|
|
@@ -83,26 +85,26 @@ struct ICEBERG_EXPORT ManifestFile { | |||||
| std::string manifest_path; | ||||||
| /// Field id: 501 | ||||||
| /// Length of the manifest file in bytes | ||||||
| int64_t manifest_length; | ||||||
| int64_t manifest_length = 0; | ||||||
| /// Field id: 502 | ||||||
| /// ID of a partition spec used to write the manifest; must be listed in table metadata | ||||||
| /// partition-specs | ||||||
| int32_t partition_spec_id; | ||||||
| int32_t partition_spec_id = 0; | ||||||
|
Member
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.
Suggested change
|
||||||
| /// Field id: 517 | ||||||
| /// The type of files tracked by the manifest, either data or delete files; 0 for all v1 | ||||||
| /// manifests | ||||||
| Content content; | ||||||
| Content content = Content::kData; | ||||||
| /// Field id: 515 | ||||||
| /// The sequence number when the manifest was added to the table; use 0 when reading v1 | ||||||
| /// manifest lists | ||||||
| int64_t sequence_number; | ||||||
| int64_t sequence_number = 0; | ||||||
|
Member
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.
Suggested change
|
||||||
| /// Field id: 516 | ||||||
| /// The minimum data sequence number of all live data or delete files in the manifest; | ||||||
| /// use 0 when reading v1 manifest lists | ||||||
| int64_t min_sequence_number; | ||||||
| int64_t min_sequence_number = 0; | ||||||
|
dongxiao1198 marked this conversation as resolved.
Outdated
|
||||||
| /// Field id: 503 | ||||||
| /// ID of the snapshot where the manifest file was added | ||||||
| int64_t added_snapshot_id; | ||||||
| int64_t added_snapshot_id = 0; | ||||||
|
dongxiao1198 marked this conversation as resolved.
Outdated
|
||||||
| /// Field id: 504 | ||||||
| /// Number of entries in the manifest that have status ADDED (1), when null this is | ||||||
| /// assumed to be non-zero | ||||||
|
|
@@ -137,7 +139,7 @@ struct ICEBERG_EXPORT ManifestFile { | |||||
| std::vector<uint8_t> key_metadata; | ||||||
| /// Field id: 520 | ||||||
| /// The starting _row_id to assign to rows added by ADDED data files | ||||||
| int64_t first_row_id; | ||||||
| int64_t first_row_id = 0; | ||||||
|
dongxiao1198 marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| /// \brief Checks if this manifest file contains entries with ADDED status. | ||||||
| bool has_added_files() const { return added_files_count.value_or(1) > 0; } | ||||||
|
|
@@ -188,6 +190,8 @@ struct ICEBERG_EXPORT ManifestFile { | |||||
| 520, "first_row_id", iceberg::int64(), | ||||||
| "Starting row ID to assign to new rows in ADDED data files"); | ||||||
|
|
||||||
| bool operator==(const ManifestFile& other) const; | ||||||
|
|
||||||
| static const StructType& Type(); | ||||||
| }; | ||||||
|
|
||||||
|
|
||||||
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.
Uh oh!
There was an error while loading. Please reload this page.