Package org.apache.avro
Class Resolver.Promote
java.lang.Object
org.apache.avro.Resolver.Action
org.apache.avro.Resolver.Promote
- Enclosing class:
Resolver
In this case, the writer's type needs to be promoted to the reader's. These
are constructed by
resolve(org.apache.avro.Schema, org.apache.avro.Schema, org.apache.avro.generic.GenericData), which will only construct one
when the writer's and reader's schemas are different (ie, no "self
promotion"), and whent the promotion is one allowed by the Avro spec.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.avro.Resolver.Action
Resolver.Action.Type -
Field Summary
Fields inherited from class org.apache.avro.Resolver.Action
conversion, logicalType, reader, type, writer -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns true iff w and r are both primitive types and either they are the same type or w is promotable to r.static Resolver.Actionresolve(Schema w, Schema r, GenericData d) Return a promotion.
-
Method Details
-
resolve
Return a promotion.- Parameters:
w- Writer's schemar- Rearder's schema- Returns:
- a
Resolver.Promoteschema if the two schemas are compatible, orResolver.ErrorAction.ErrorType.INCOMPATIBLE_SCHEMA_TYPESif they are not. - Throws:
IllegalArgumentException- if getType() of the two schemas are not different.
-
isValid
Returns true iff w and r are both primitive types and either they are the same type or w is promotable to r. Should
-