public class HiveTableUtil extends Object
Modifier and Type | Method and Description |
---|---|
static List<org.apache.hadoop.hive.metastore.api.FieldSchema> |
createHiveColumns(TableSchema schema)
Create Hive columns from Flink TableSchema.
|
static org.apache.hadoop.hive.metastore.api.Partition |
createHivePartition(String dbName,
String tableName,
List<String> values,
org.apache.hadoop.hive.metastore.api.StorageDescriptor sd,
Map<String,String> parameters)
Creates a Hive partition instance.
|
static TableSchema |
createTableSchema(List<org.apache.hadoop.hive.metastore.api.FieldSchema> cols,
List<org.apache.hadoop.hive.metastore.api.FieldSchema> partitionKeys,
Set<String> notNullColumns,
UniqueConstraint primaryKey)
Create a Flink's TableSchema from Hive table's columns and partition keys.
|
static byte |
enableConstraint(byte trait) |
static Optional<String> |
makePartitionFilter(int partColOffset,
List<String> partColNames,
List<Expression> expressions,
HiveShim hiveShim)
Generates a filter string for partition columns from the given filter expressions.
|
static byte |
relyConstraint(byte trait) |
static boolean |
requireEnableConstraint(byte trait) |
static boolean |
requireRelyConstraint(byte trait) |
static boolean |
requireValidateConstraint(byte trait) |
static byte |
validateConstraint(byte trait) |
public static TableSchema createTableSchema(List<org.apache.hadoop.hive.metastore.api.FieldSchema> cols, List<org.apache.hadoop.hive.metastore.api.FieldSchema> partitionKeys, Set<String> notNullColumns, UniqueConstraint primaryKey)
public static List<org.apache.hadoop.hive.metastore.api.FieldSchema> createHiveColumns(TableSchema schema)
public static org.apache.hadoop.hive.metastore.api.Partition createHivePartition(String dbName, String tableName, List<String> values, org.apache.hadoop.hive.metastore.api.StorageDescriptor sd, Map<String,String> parameters)
public static byte enableConstraint(byte trait)
public static byte validateConstraint(byte trait)
public static byte relyConstraint(byte trait)
public static boolean requireEnableConstraint(byte trait)
public static boolean requireValidateConstraint(byte trait)
public static boolean requireRelyConstraint(byte trait)
public static Optional<String> makePartitionFilter(int partColOffset, List<String> partColNames, List<Expression> expressions, HiveShim hiveShim)
partColOffset
- The number of non-partition columns -- used to shift field reference indexpartColNames
- The names of all partition columnsexpressions
- The filter expressions in CNF formCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.