public class TableSchemaResolver extends Object
| Constructor and Description |
|---|
TableSchemaResolver(HoodieTableMetaClient metaClient) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.parquet.schema.MessageType |
convertAvroSchemaToParquet(org.apache.avro.Schema schema)
Convert a avro scheme to the parquet format.
|
org.apache.avro.Schema |
convertParquetSchemaToAvro(org.apache.parquet.schema.MessageType parquetSchema)
Convert a parquet scheme to the avro format.
|
org.apache.avro.Schema |
getTableAvroSchema()
Gets full schema (user + metadata) for a hoodie table in Avro format.
|
org.apache.avro.Schema |
getTableAvroSchema(boolean includeMetadataFields)
Gets schema for a hoodie table in Avro format, can choice if include metadata fields.
|
org.apache.avro.Schema |
getTableAvroSchemaWithoutMetadataFields()
Gets users data schema for a hoodie table in Avro format.
|
org.apache.avro.Schema |
getTableAvroSchemaWithoutMetadataFields(HoodieInstant instant)
Gets users data schema for a hoodie table in Avro format of the instant.
|
org.apache.parquet.schema.MessageType |
getTableParquetSchema()
Gets full schema (user + metadata) for a hoodie table in Parquet format.
|
static boolean |
isSchemaCompatible(org.apache.avro.Schema oldSchema,
org.apache.avro.Schema newSchema)
HUDI specific validation of schema evolution.
|
static boolean |
isSchemaCompatible(String oldSchema,
String newSchema) |
org.apache.parquet.schema.MessageType |
readSchemaFromBaseFile(org.apache.hadoop.fs.Path parquetFilePath)
Read the parquet schema from a parquet File.
|
org.apache.parquet.schema.MessageType |
readSchemaFromLastCompaction(Option<HoodieInstant> lastCompactionCommitOpt)
Read schema from a data file from the last compaction commit done.
|
static org.apache.parquet.schema.MessageType |
readSchemaFromLogFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
Read the schema from the log file on path.
|
org.apache.parquet.schema.MessageType |
readSchemaFromLogFile(Option<HoodieInstant> lastCompactionCommitOpt,
org.apache.hadoop.fs.Path path)
Read the schema from the log file on path.
|
org.apache.parquet.schema.MessageType |
readSchemaFromLogFile(org.apache.hadoop.fs.Path path)
Read the schema from the log file on path.
|
public TableSchemaResolver(HoodieTableMetaClient metaClient)
public org.apache.avro.Schema getTableAvroSchema()
throws Exception
Exceptionpublic org.apache.avro.Schema getTableAvroSchema(boolean includeMetadataFields)
throws Exception
includeMetadataFields - choice if include metadata fieldsExceptionpublic org.apache.parquet.schema.MessageType getTableParquetSchema()
throws Exception
Exceptionpublic org.apache.avro.Schema getTableAvroSchemaWithoutMetadataFields()
throws Exception
Exceptionpublic org.apache.avro.Schema getTableAvroSchemaWithoutMetadataFields(HoodieInstant instant) throws Exception
instant - will get the instant data schemaExceptionpublic org.apache.avro.Schema convertParquetSchemaToAvro(org.apache.parquet.schema.MessageType parquetSchema)
parquetSchema - The parquet schema to convertpublic org.apache.parquet.schema.MessageType convertAvroSchemaToParquet(org.apache.avro.Schema schema)
schema - The avro schema to convertpublic static boolean isSchemaCompatible(org.apache.avro.Schema oldSchema,
org.apache.avro.Schema newSchema)
oldSchema - Older schema to check.newSchema - Newer schema to check.public org.apache.parquet.schema.MessageType readSchemaFromBaseFile(org.apache.hadoop.fs.Path parquetFilePath)
throws IOException
IOExceptionpublic org.apache.parquet.schema.MessageType readSchemaFromLastCompaction(Option<HoodieInstant> lastCompactionCommitOpt) throws Exception
Exceptionpublic org.apache.parquet.schema.MessageType readSchemaFromLogFile(org.apache.hadoop.fs.Path path)
throws IOException
IOExceptionpublic org.apache.parquet.schema.MessageType readSchemaFromLogFile(Option<HoodieInstant> lastCompactionCommitOpt, org.apache.hadoop.fs.Path path) throws Exception
Exceptionpublic static org.apache.parquet.schema.MessageType readSchemaFromLogFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
throws IOException
IOExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.