persist: Plumb relevant arrow::DataType
s to compaction
#30627
Closed
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 PR plumbs
arrow::datatypes::DataType
from Persist's schema registry down into compaction.Previously we changed compaction to use the most recent schema of any since run (#30382). This would pass the relevant
K::Schema
andV::Schema
s down into compaction, but then map to anarrow::DataType
using the current code.The problem we're running into when trying to stabilize schema evolution in Persist (#30205) is that during 0dt upgrades the new version of Materialize ends up getting some compaction work assigned to it, and writes a batch of data using more nullable types. The old version of Materialize sees the new schema, but maps the
arrow::DataType
to less nullable types because we haven't yet changed howRelationDesc
maps to anarrow::DataType
.After this PR the old version of Materialize should use the more up-to-date version of the
arrow::DataType
mapping and succeed.Note: If this change is undesirable, we can remove it after a single version upgrade.
Motivation
Fixes an issue discovered in: #30205
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.