public class HiveMetaStoreUtils extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
HiveMetaStoreUtils() |
Modifier and Type | Method and Description |
---|---|
static Deserializer |
getDeserializer(org.apache.hadoop.conf.Configuration conf,
Partition part,
Table table)
getDeserializer
Get the Deserializer for a partition.
|
static Deserializer |
getDeserializer(org.apache.hadoop.conf.Configuration conf,
Table table,
boolean skipConfError)
getDeserializer
Get the Deserializer for a table.
|
static Deserializer |
getDeserializer(org.apache.hadoop.conf.Configuration conf,
Table table,
boolean skipConfError,
String lib) |
static Class<? extends Deserializer> |
getDeserializerClass(org.apache.hadoop.conf.Configuration conf,
Table table) |
static FieldSchema |
getFieldSchemaFromTypeInfo(String fieldName,
TypeInfo typeInfo)
Convert TypeInfo to FieldSchema.
|
static List<FieldSchema> |
getFieldsFromDeserializer(String tableName,
Deserializer deserializer) |
static IMetaStoreClient |
getHiveMetastoreClient(HiveConf hiveConf)
Get or create a hive client depending on whether it exits in cache or not
|
public static Deserializer getDeserializer(org.apache.hadoop.conf.Configuration conf, Table table, boolean skipConfError) throws MetaException
conf
- - hadoop configtable
- the tableMetaException
- if any problems instantiating the Deserializer
todo - this should move somewhere into serde.jarpublic static Deserializer getDeserializer(org.apache.hadoop.conf.Configuration conf, Table table, boolean skipConfError, String lib) throws MetaException
MetaException
public static Class<? extends Deserializer> getDeserializerClass(org.apache.hadoop.conf.Configuration conf, Table table) throws Exception
Exception
public static Deserializer getDeserializer(org.apache.hadoop.conf.Configuration conf, Partition part, Table table) throws MetaException
conf
- - hadoop configpart
- the partitiontable
- the tableMetaException
- if any problems instantiating the Deserializerpublic static List<FieldSchema> getFieldsFromDeserializer(String tableName, Deserializer deserializer) throws SerDeException, MetaException
tableName
- name of the tabledeserializer
- deserializer to useSerDeException
- if the serde throws an exceptionMetaException
- if one of the fields or types in the table is invalidpublic static FieldSchema getFieldSchemaFromTypeInfo(String fieldName, TypeInfo typeInfo)
public static IMetaStoreClient getHiveMetastoreClient(HiveConf hiveConf) throws MetaException, IOException
hiveConf
- The hive configurationMetaException
- When HiveMetaStoreClient couldn't be createdIOException
Copyright © 2022 The Apache Software Foundation. All rights reserved.