feat(dart): add schema evolution (TypeDef meta share) support#3333
Open
arjav1528 wants to merge 5 commits intoapache:mainfrom
Open
feat(dart): add schema evolution (TypeDef meta share) support#3333arjav1528 wants to merge 5 commits intoapache:mainfrom
arjav1528 wants to merge 5 commits intoapache:mainfrom
Conversation
…efinition handling
…hance TypeResolver
…s and improve error messaging for unsupported compressed TypeDefs
795eb3b to
b4394a4
Compare
…ation and deserialization
b4394a4 to
bf0ca22
Compare
Author
|
@chaokunyang could you please help me with the PR tests |
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.
Why?
When other languages serialize with schema evolution enabled (TypeDef/meta share), Dart could not decode because it did not implement the TypeDef/TypeMeta read/write flow. This blocked cross-language compatibility for evolving schemas (see #3290).
What does this PR do?
FieldDefandRemoteFieldType(Simple, ListSet, Map) inmeta/field_def.dart; extends TypeResolverImpl to parse the full TypeDef body (field header, type info, name bytes or TAG_ID) and to use varuint32 small7 for type IDs in the body and in type meta.(TypeInfo, List<FieldDef>)per index;DeserializationContextgetscurrentRemoteFieldDefs;readTypeInfosets it when returning from shared type meta (new or ref);resetReadContextclears cache andcurrentRemoteFieldDefs.compatibleis true andcurrentRemoteFieldDefsis set,ClassSerializeruses_readByRemoteFieldOrder: iterates remote field defs, reads values by remote type (including nested LIST/SET/MAP), assigns to local fields by name (snake_case) or by index; supports TAG_ID for future tag-based matching.Related issues
Does this PR introduce any user-facing change?
No new public APIs; internal types (
FieldDef,RemoteFieldType) are insrc/metaand used by the resolver/serializer.No. Dart now correctly implements the existing xlang Type Meta / TypeDef format so that Dart can decode data produced by other languages with compatible + meta share enabled.