public class HiveShimV100 extends Object implements HiveShim
| Constructor and Description |
|---|
HiveShimV100() |
| Modifier and Type | Method and Description |
|---|---|
void |
alterPartition(org.apache.hadoop.hive.metastore.IMetaStoreClient client,
String databaseName,
String tableName,
org.apache.hadoop.hive.metastore.api.Partition partition) |
void |
alterTable(org.apache.hadoop.hive.metastore.IMetaStoreClient client,
String databaseName,
String tableName,
org.apache.hadoop.hive.metastore.api.Table table)
Alters a Hive table.
|
org.apache.flink.api.common.serialization.BulkWriter.Factory<org.apache.flink.table.data.RowData> |
createOrcBulkWriterFactory(org.apache.hadoop.conf.Configuration conf,
String schema,
org.apache.flink.table.types.logical.LogicalType[] fieldTypes)
Create orc
BulkWriter.Factory for different hive versions. |
void |
createTableWithConstraints(org.apache.hadoop.hive.metastore.IMetaStoreClient client,
org.apache.hadoop.hive.metastore.api.Table table,
org.apache.hadoop.conf.Configuration conf,
org.apache.flink.table.api.constraints.UniqueConstraint pk,
List<Byte> pkTraits,
List<String> notNullCols,
List<Byte> nnTraits)
Creates a table with PK and NOT NULL constraints.
|
org.apache.hadoop.hive.ql.udf.generic.SimpleGenericUDAFParameterInfo |
createUDAFParameterInfo(org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector[] params,
boolean isWindowing,
boolean distinct,
boolean allColumns)
Creates SimpleGenericUDAFParameterInfo.
|
Optional<org.apache.hadoop.hive.ql.exec.FunctionInfo> |
getBuiltInFunctionInfo(String name)
Get a Hive built-in function by name.
|
Class<?> |
getDateDataTypeClass()
Hive Date data type class was changed in Hive 3.1.0.
|
List<org.apache.hadoop.hive.metastore.api.FieldSchema> |
getFieldsFromDeserializer(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hive.metastore.api.Table table,
boolean skipConfError)
Get Hive table schema from deserializer.
|
org.apache.hadoop.hive.metastore.IMetaStoreClient |
getHiveMetastoreClient(org.apache.hadoop.hive.conf.HiveConf hiveConf)
Create a Hive Metastore client based on the given HiveConf object.
|
Class<?> |
getHiveMetaStoreUtilsClass()
Get the class of Hive's HiveMetaStoreUtils as it was split from MetaStoreUtils class in Hive
3.1.0.
|
Class |
getHiveOutputFormatClass(Class outputFormatClz)
For a given OutputFormat class, get the corresponding
HiveOutputFormat class. |
org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter |
getHiveRecordWriter(org.apache.hadoop.mapred.JobConf jobConf,
Class outputFormatClz,
Class<? extends org.apache.hadoop.io.Writable> outValClz,
boolean isCompressed,
Properties tableProps,
org.apache.hadoop.fs.Path outPath)
Get Hive's FileSinkOperator.RecordWriter.
|
Class<?> |
getMetaStoreUtilsClass()
Get the class of Hive's MetaStoreUtils because its package name was changed in Hive 3.1.0.
|
Set<String> |
getNotNullColumns(org.apache.hadoop.hive.metastore.IMetaStoreClient client,
org.apache.hadoop.conf.Configuration conf,
String dbName,
String tableName)
Get the set of columns that have NOT NULL constraints.
|
Optional<org.apache.flink.table.api.constraints.UniqueConstraint> |
getPrimaryKey(org.apache.hadoop.hive.metastore.IMetaStoreClient client,
String dbName,
String tableName,
byte requiredTrait)
Get the primary key of a Hive table and convert it to a UniqueConstraint.
|
Class<?> |
getTimestampDataTypeClass()
Hive Timestamp data type class was changed in Hive 3.1.0.
|
List<String> |
getViews(org.apache.hadoop.hive.metastore.IMetaStoreClient client,
String databaseName)
Get a list of views in the given database from the given Hive Metastore client.
|
org.apache.hadoop.io.Writable |
hivePrimitiveToWritable(Object value)
Converts a Hive primitive java object to corresponding Writable object.
|
boolean |
isDateStats(org.apache.hadoop.hive.metastore.api.ColumnStatisticsData colStatsData)
Whether a Hive ColumnStatisticsData is for DATE columns.
|
Set<String> |
listBuiltInFunctions()
List names of all built-in functions.
|
java.time.LocalDate |
toFlinkDate(Object hiveDate)
Converts a hive date instance to LocalDate which is expected by DataFormatConverter.
|
org.apache.flink.table.catalog.stats.CatalogColumnStatisticsDataDate |
toFlinkDateColStats(org.apache.hadoop.hive.metastore.api.ColumnStatisticsData hiveDateColStats)
Generate Flink CatalogColumnStatisticsDataDate from Hive ColumnStatisticsData for DATE
columns.
|
java.time.LocalDateTime |
toFlinkTimestamp(Object hiveTimestamp)
Converts a hive timestamp instance to LocalDateTime which is expected by DataFormatConverter.
|
Object |
toHiveDate(Object flinkDate)
Converts a Flink date instance to what's expected by Hive.
|
org.apache.hadoop.hive.metastore.api.ColumnStatisticsData |
toHiveDateColStats(org.apache.flink.table.catalog.stats.CatalogColumnStatisticsDataDate flinkDateColStats)
Generate Hive ColumnStatisticsData from Flink CatalogColumnStatisticsDataDate for DATE
columns.
|
Object |
toHiveTimestamp(Object flinkTimestamp)
Converts a Flink timestamp instance to what's expected by Hive.
|
public org.apache.hadoop.hive.metastore.IMetaStoreClient getHiveMetastoreClient(org.apache.hadoop.hive.conf.HiveConf hiveConf)
HiveShimgetHiveMetastoreClient in interface HiveShimhiveConf - HiveConf instancepublic List<String> getViews(org.apache.hadoop.hive.metastore.IMetaStoreClient client, String databaseName) throws org.apache.hadoop.hive.metastore.api.UnknownDBException, org.apache.thrift.TException
HiveShimgetViews in interface HiveShimclient - Hive Metastore clientdatabaseName - the name of the databaseorg.apache.hadoop.hive.metastore.api.UnknownDBException - if the database doesn't existorg.apache.thrift.TException - for any other generic exceptions caused by Thriftpublic void alterTable(org.apache.hadoop.hive.metastore.IMetaStoreClient client,
String databaseName,
String tableName,
org.apache.hadoop.hive.metastore.api.Table table)
throws org.apache.hadoop.hive.metastore.api.InvalidOperationException,
org.apache.hadoop.hive.metastore.api.MetaException,
org.apache.thrift.TException
HiveShimalterTable in interface HiveShimclient - the Hive metastore clientdatabaseName - the name of the database to which the table belongstableName - the name of the table to be alteredtable - the new Hive tableorg.apache.hadoop.hive.metastore.api.InvalidOperationExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.thrift.TExceptionpublic void alterPartition(org.apache.hadoop.hive.metastore.IMetaStoreClient client,
String databaseName,
String tableName,
org.apache.hadoop.hive.metastore.api.Partition partition)
throws org.apache.hadoop.hive.metastore.api.InvalidOperationException,
org.apache.hadoop.hive.metastore.api.MetaException,
org.apache.thrift.TException
alterPartition in interface HiveShimorg.apache.hadoop.hive.metastore.api.InvalidOperationExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.thrift.TExceptionpublic org.apache.hadoop.hive.ql.udf.generic.SimpleGenericUDAFParameterInfo createUDAFParameterInfo(org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector[] params,
boolean isWindowing,
boolean distinct,
boolean allColumns)
HiveShimcreateUDAFParameterInfo in interface HiveShimpublic Class<?> getMetaStoreUtilsClass()
HiveShimgetMetaStoreUtilsClass in interface HiveShimpublic Class<?> getHiveMetaStoreUtilsClass()
HiveShimgetHiveMetaStoreUtilsClass in interface HiveShimpublic Class<?> getDateDataTypeClass()
HiveShimgetDateDataTypeClass in interface HiveShimpublic Class<?> getTimestampDataTypeClass()
HiveShimgetTimestampDataTypeClass in interface HiveShimpublic org.apache.hadoop.hive.metastore.api.ColumnStatisticsData toHiveDateColStats(org.apache.flink.table.catalog.stats.CatalogColumnStatisticsDataDate flinkDateColStats)
HiveShimtoHiveDateColStats in interface HiveShimpublic boolean isDateStats(org.apache.hadoop.hive.metastore.api.ColumnStatisticsData colStatsData)
HiveShimisDateStats in interface HiveShimpublic org.apache.flink.table.catalog.stats.CatalogColumnStatisticsDataDate toFlinkDateColStats(org.apache.hadoop.hive.metastore.api.ColumnStatisticsData hiveDateColStats)
HiveShimtoFlinkDateColStats in interface HiveShimpublic org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter getHiveRecordWriter(org.apache.hadoop.mapred.JobConf jobConf,
Class outputFormatClz,
Class<? extends org.apache.hadoop.io.Writable> outValClz,
boolean isCompressed,
Properties tableProps,
org.apache.hadoop.fs.Path outPath)
HiveShimgetHiveRecordWriter in interface HiveShimpublic Class getHiveOutputFormatClass(Class outputFormatClz)
HiveShimHiveOutputFormat class.getHiveOutputFormatClass in interface HiveShimpublic List<org.apache.hadoop.hive.metastore.api.FieldSchema> getFieldsFromDeserializer(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hive.metastore.api.Table table, boolean skipConfError)
HiveShimgetFieldsFromDeserializer in interface HiveShimpublic Set<String> listBuiltInFunctions()
HiveShimlistBuiltInFunctions in interface HiveShimpublic Optional<org.apache.hadoop.hive.ql.exec.FunctionInfo> getBuiltInFunctionInfo(String name)
HiveShimgetBuiltInFunctionInfo in interface HiveShimpublic Set<String> getNotNullColumns(org.apache.hadoop.hive.metastore.IMetaStoreClient client, org.apache.hadoop.conf.Configuration conf, String dbName, String tableName)
HiveShimgetNotNullColumns in interface HiveShimpublic Optional<org.apache.flink.table.api.constraints.UniqueConstraint> getPrimaryKey(org.apache.hadoop.hive.metastore.IMetaStoreClient client, String dbName, String tableName, byte requiredTrait)
HiveShimgetPrimaryKey in interface HiveShimpublic Object toHiveTimestamp(Object flinkTimestamp)
HiveShimtoHiveTimestamp in interface HiveShimpublic java.time.LocalDateTime toFlinkTimestamp(Object hiveTimestamp)
HiveShimtoFlinkTimestamp in interface HiveShimpublic Object toHiveDate(Object flinkDate)
HiveShimtoHiveDate in interface HiveShimpublic java.time.LocalDate toFlinkDate(Object hiveDate)
HiveShimtoFlinkDate in interface HiveShimpublic org.apache.hadoop.io.Writable hivePrimitiveToWritable(Object value)
HiveShimhivePrimitiveToWritable in interface HiveShimpublic void createTableWithConstraints(org.apache.hadoop.hive.metastore.IMetaStoreClient client,
org.apache.hadoop.hive.metastore.api.Table table,
org.apache.hadoop.conf.Configuration conf,
org.apache.flink.table.api.constraints.UniqueConstraint pk,
List<Byte> pkTraits,
List<String> notNullCols,
List<Byte> nnTraits)
HiveShimcreateTableWithConstraints in interface HiveShimpublic org.apache.flink.api.common.serialization.BulkWriter.Factory<org.apache.flink.table.data.RowData> createOrcBulkWriterFactory(org.apache.hadoop.conf.Configuration conf,
String schema,
org.apache.flink.table.types.logical.LogicalType[] fieldTypes)
HiveShimBulkWriter.Factory for different hive versions.createOrcBulkWriterFactory in interface HiveShimCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.