public class AvroSchemaConverter extends Object
RowTypeInfo
for
representing objects and converts Avro types into types that are compatible with Flink's Table &
SQL API.
Note: Changes in this class need to be kept in sync with the corresponding runtime classes
AvroRowDeserializationSchema
and AvroRowSerializationSchema
.
Modifier and Type | Method and Description |
---|---|
static org.apache.avro.Schema |
convertToSchema(LogicalType logicalType)
Converts Flink SQL
LogicalType (can be nested) into an Avro schema. |
static org.apache.avro.Schema |
convertToSchema(LogicalType logicalType,
String rowName) |
static <T extends org.apache.avro.specific.SpecificRecord> |
convertToTypeInfo(Class<T> avroClass)
Converts an Avro class into a nested row structure with deterministic field order and data
types that are compatible with Flink's Table & SQL API.
|
static <T> TypeInformation<T> |
convertToTypeInfo(String avroSchemaString)
Converts an Avro schema string into a nested row structure with deterministic field order and
data types that are compatible with Flink's Table & SQL API.
|
static LogicalType |
extractValueTypeToAvroMap(LogicalType type) |
public static <T extends org.apache.avro.specific.SpecificRecord> TypeInformation<Row> convertToTypeInfo(Class<T> avroClass)
avroClass
- Avro specific record that contains schema informationpublic static <T> TypeInformation<T> convertToTypeInfo(String avroSchemaString)
avroSchemaString
- Avro schema definition stringpublic static org.apache.avro.Schema convertToSchema(LogicalType logicalType)
LogicalType
(can be nested) into an Avro schema.logicalType
- logical typeSchema
matching this logical type.public static org.apache.avro.Schema convertToSchema(LogicalType logicalType, String rowName)
public static LogicalType extractValueTypeToAvroMap(LogicalType type)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.