public class SchemaUtil extends Object
| Constructor and Description |
|---|
SchemaUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,String> |
convertParquetSchemaToHiveSchema(org.apache.parquet.schema.MessageType messageType)
Returns equivalent Hive table schema read from a parquet file
|
static String |
generateCreateDDL(org.apache.parquet.schema.MessageType storageSchema,
HiveSyncConfig config,
String inputFormatClass,
String outputFormatClass,
String serdeClass) |
static String |
generateSchemaString(org.apache.parquet.schema.MessageType storageSchema) |
static String |
generateSchemaString(org.apache.parquet.schema.MessageType storageSchema,
List<String> colsToSkip) |
static SchemaDifference |
getSchemaDifference(org.apache.parquet.schema.MessageType storageSchema,
Map<String,String> tableSchema,
List<String> partitionKeys)
Get the schema difference between the storage schema and hive table schema
|
static boolean |
isSchemaTypeUpdateAllowed(String prevType,
String newType) |
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
|
public static SchemaDifference getSchemaDifference(org.apache.parquet.schema.MessageType storageSchema, Map<String,String> tableSchema, List<String> partitionKeys)
public static Map<String,String> convertParquetSchemaToHiveSchema(org.apache.parquet.schema.MessageType messageType) throws IOException
messageType - : Parquet SchemaIOExceptionpublic static boolean isSchemaTypeUpdateAllowed(String prevType, String newType)
public static String generateSchemaString(org.apache.parquet.schema.MessageType storageSchema) throws IOException
IOExceptionpublic static String generateSchemaString(org.apache.parquet.schema.MessageType storageSchema, List<String> colsToSkip) throws IOException
IOExceptionpublic static String generateCreateDDL(org.apache.parquet.schema.MessageType storageSchema, HiveSyncConfig config, String inputFormatClass, String outputFormatClass, String serdeClass) throws IOException
IOExceptionpublic static org.apache.parquet.schema.MessageType readSchemaFromLogFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
throws IOException
IOExceptionCopyright © 2019 The Apache Software Foundation. All rights reserved.