Iceberg write Invalid POC#1202
Open
michaeldjeffrey wants to merge 5 commits into
Open
Conversation
The key off the Valid variants, so we expose all the fields to the crate so we can implement From for the invalid variants.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces a new pattern for handling and storing invalid (rejected) records for bans, heartbeats, speedtests, and speedtest averages in the
mobile_verifierservice. Now, for each type of record, invalid entries are written to siblinginvalid_*tables with an addedreasoncolumn explaining why the record was rejected. This is achieved through a newValidInvalidWriterabstraction and supporting data structures. The changes also make the schema for valid and invalid tables consistent and easier to maintain.The most important changes are:
1. Introduction of Invalid Record Tables and Writers
invalid_ban,invalid_heartbeat,invalid_speedtest, andinvalid_speedtest_avg, each mirroring the schema of their valid counterpart and adding areasoncolumn for the rejection cause. These modules include constructors for easy conversion from valid to invalid records. [1] [2] [3] [4]ValidInvalidWriterabstraction, which writes valid records to the main table and invalid records to the correspondinginvalid_*table, and updated all writer types to use this pattern. [1] [2]2. Schema and API Improvements
TableDefinition(with_name,with_field) to simplify deriving sibling table definitions for invalid records, ensuring schemas stay in sync.IcebergBan,IcebergHeartbeat,IcebergSpeedtest) to allow construction of invalid record variants. [1] [2] [3]3. Ingestion Pipeline Updates
4. Utility Improvements
reasoncolumn.These changes make the handling of invalid data explicit, auditable, and easier to maintain, while keeping valid and invalid table schemas tightly coupled and reducing code duplication.