public class HiveSchemaUtils extends Object
| Constructor and Description |
|---|
HiveSchemaUtils() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.flink.table.api.Schema |
convertTableSchema(org.apache.hadoop.hive.metastore.api.Table hiveTable) |
static List<org.apache.hadoop.hive.metastore.api.FieldSchema> |
createHiveColumns(org.apache.flink.table.api.TableSchema schema)
Create Hive columns from Flink TableSchema.
|
static List<String> |
getFieldNames(List<org.apache.hadoop.hive.metastore.api.FieldSchema> fieldSchemas)
Get field names from field schemas.
|
static Pair<List<org.apache.hadoop.hive.metastore.api.FieldSchema>,List<org.apache.hadoop.hive.metastore.api.FieldSchema>> |
splitSchemaByPartitionKeys(List<org.apache.hadoop.hive.metastore.api.FieldSchema> fieldSchemas,
List<String> partitionKeys)
Split the field schemas by given partition keys.
|
static org.apache.flink.table.types.DataType |
toFlinkType(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo hiveType)
Convert Hive data type to a Flink data type.
|
static org.apache.hadoop.hive.serde2.typeinfo.TypeInfo |
toHiveTypeInfo(org.apache.flink.table.types.DataType dataType)
Convert Flink DataType to Hive TypeInfo.
|
public static List<String> getFieldNames(List<org.apache.hadoop.hive.metastore.api.FieldSchema> fieldSchemas)
public static org.apache.flink.table.api.Schema convertTableSchema(org.apache.hadoop.hive.metastore.api.Table hiveTable)
public static org.apache.flink.table.types.DataType toFlinkType(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo hiveType)
hiveType - a Hive data typepublic static List<org.apache.hadoop.hive.metastore.api.FieldSchema> createHiveColumns(org.apache.flink.table.api.TableSchema schema)
public static org.apache.hadoop.hive.serde2.typeinfo.TypeInfo toHiveTypeInfo(org.apache.flink.table.types.DataType dataType)
dataType - a Flink DataTypepublic static Pair<List<org.apache.hadoop.hive.metastore.api.FieldSchema>,List<org.apache.hadoop.hive.metastore.api.FieldSchema>> splitSchemaByPartitionKeys(List<org.apache.hadoop.hive.metastore.api.FieldSchema> fieldSchemas, List<String> partitionKeys)
fieldSchemas - The Hive field schemas.partitionKeys - The partition keys.Copyright © 2022 The Apache Software Foundation. All rights reserved.