public class ParquetSchemaUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ParquetSchemaUtil.HasIds |
Modifier and Type | Method and Description |
---|---|
static org.apache.parquet.schema.MessageType |
addFallbackIds(org.apache.parquet.schema.MessageType fileSchema) |
static org.apache.parquet.schema.MessageType |
applyNameMapping(org.apache.parquet.schema.MessageType fileSchema,
NameMapping nameMapping) |
static Schema |
convert(org.apache.parquet.schema.MessageType parquetSchema)
Converts a Parquet schema to an Iceberg schema.
|
static org.apache.parquet.schema.MessageType |
convert(Schema schema,
java.lang.String name) |
static Schema |
convertAndPrune(org.apache.parquet.schema.MessageType parquetSchema)
Converts a Parquet schema to an Iceberg schema and prunes fields without IDs.
|
static org.apache.parquet.schema.Type |
determineListElementType(org.apache.parquet.schema.GroupType array) |
static boolean |
hasIds(org.apache.parquet.schema.MessageType fileSchema) |
static org.apache.parquet.schema.MessageType |
pruneColumns(org.apache.parquet.schema.MessageType fileSchema,
Schema expectedSchema) |
static org.apache.parquet.schema.MessageType |
pruneColumnsFallback(org.apache.parquet.schema.MessageType fileSchema,
Schema expectedSchema)
Prunes columns from a Parquet file schema that was written without field ids.
|
public static org.apache.parquet.schema.MessageType convert(Schema schema, java.lang.String name)
public static Schema convert(org.apache.parquet.schema.MessageType parquetSchema)
parquetSchema
- a Parquet schemapublic static Schema convertAndPrune(org.apache.parquet.schema.MessageType parquetSchema)
parquetSchema
- a Parquet schemapublic static org.apache.parquet.schema.MessageType pruneColumns(org.apache.parquet.schema.MessageType fileSchema, Schema expectedSchema)
public static org.apache.parquet.schema.MessageType pruneColumnsFallback(org.apache.parquet.schema.MessageType fileSchema, Schema expectedSchema)
Files that were written without field ids are read assuming that schema evolution preserved column order. Deleting columns was not allowed.
The order of columns in the resulting Parquet schema matches the Parquet file.
fileSchema
- schema from a Parquet file that does not have field ids.expectedSchema
- expected schemapublic static boolean hasIds(org.apache.parquet.schema.MessageType fileSchema)
public static org.apache.parquet.schema.MessageType addFallbackIds(org.apache.parquet.schema.MessageType fileSchema)
public static org.apache.parquet.schema.MessageType applyNameMapping(org.apache.parquet.schema.MessageType fileSchema, NameMapping nameMapping)
public static org.apache.parquet.schema.Type determineListElementType(org.apache.parquet.schema.GroupType array)