fix(source): resolve avro Ref
during access
without hack
#19746
Merged
+165
−82
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.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Sequel to #19601 and resolves #17020.
The recursive call is changed from
Self {schema: inner, relax_numeric: self.relax_numeric}.convert_to_datum(v, field_type)
intoself.convert_to_datum(inner, v, field_type)
so thatschema: inner
is passed as argument rather than keep reconstructing newAvroParseOptions
.self: AvroParseOptionsInner
captures the immutable "global" context:relax_numeric: bool
andrefs: NamesRef<'a>
On the use site,
self.schema
is changed toself.lookup_ref(unresolved_schema)
. Note that introducing a new type to distinguishresolved
fromunresolved
would not make it less error-prone for a careless developer - nothing prevents them from matching against unresolvedapache_avro::Schema
directly and ignoringSchema::Ref
.Full removal ofResolvedAvroSchema
will be done in an immediate follow-up, to minimize the signature changes in this PR.ResolvedAvroSchema
will either be fully removed or repurposed to holdHashMap<Name, Schema>
(an ownedNamesRef
) in a follow-up.Same as #19601, this is intended to be part of v2.2 and NOT cherry-picked into earlier versions.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.