public class AvroSchemaConverter extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static org.apache.avro.Schema |
convertToSchema(org.apache.paimon.types.DataType schema,
Map<String,String> rowNameMapping)
Converts Paimon
DataType (can be nested) into an Avro schema. |
static org.apache.avro.Schema |
convertToSchema(org.apache.paimon.types.DataType dataType,
String rowName,
Map<String,String> rowNameMapping)
Converts Paimon
DataType (can be nested) into an Avro schema. |
static org.apache.paimon.types.DataType |
extractKeyTypeToAvroMap(org.apache.paimon.types.DataType type) |
static org.apache.paimon.types.DataType |
extractValueTypeToAvroMap(org.apache.paimon.types.DataType type) |
static boolean |
isArrayMap(org.apache.paimon.types.DataType type) |
public static org.apache.avro.Schema convertToSchema(org.apache.paimon.types.DataType schema,
Map<String,String> rowNameMapping)
DataType (can be nested) into an Avro schema.
Use "org.apache.paimon.avro.generated.record" as the type name.
schema - the schema type, usually it should be the top level record type, e.g. not a
nested typeSchema matching this logical type.public static org.apache.avro.Schema convertToSchema(org.apache.paimon.types.DataType dataType,
String rowName,
Map<String,String> rowNameMapping)
DataType (can be nested) into an Avro schema.
The "{rowName}_" is used as the nested row type name prefix in order to generate the right schema. Nested record type that only differs with type name is still compatible.
dataType - logical typerowName - the record nameSchema matching this logical type.public static boolean isArrayMap(org.apache.paimon.types.DataType type)
public static org.apache.paimon.types.DataType extractKeyTypeToAvroMap(org.apache.paimon.types.DataType type)
public static org.apache.paimon.types.DataType extractValueTypeToAvroMap(org.apache.paimon.types.DataType type)
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.