public static class Resolver.Promote extends Resolver.Action
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.Resolver.Action.Type
conversion, logicalType, reader, type, writer
Modifier and Type | Method and Description |
---|---|
static boolean |
isValid(Schema w,
Schema r)
Returns true iff w and r are both primitive types and
either they are the same type or w is promotable to r.
|
static Resolver.Action |
resolve(Schema w,
Schema r,
GenericData d)
Return a promotion.
|
public static Resolver.Action resolve(Schema w, Schema r, GenericData d)
w
- Writer's schemar
- Rearder's schemaResolver.Promote
schema if the two schemas are compatible, or
Resolver.ErrorAction.ErrorType.INCOMPATIBLE_SCHEMA_TYPES
if they are not.IllegalArgumentException
- if getType() of the two schemas are
not different.Copyright © 2009–2023 The Apache Software Foundation. All rights reserved.