|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hive.metastore.MetaStoreUtils
public class MetaStoreUtils
Field Summary | |
---|---|
static String |
DEFAULT_DATABASE_NAME
|
protected static org.apache.commons.logging.Log |
LOG
|
Constructor Summary | |
---|---|
MetaStoreUtils()
|
Method Summary | |
---|---|
static Table |
createColumnsetSchema(String name,
List<String> columns,
List<String> partCols,
org.apache.hadoop.conf.Configuration conf)
|
static void |
deleteWHDirectory(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf,
boolean use_trash)
|
static String |
getColumnNamesFromFieldSchema(List<FieldSchema> fieldSchemas)
Convert FieldSchemas to columnNames. |
static String |
getColumnTypesFromFieldSchema(List<FieldSchema> fieldSchemas)
Convert FieldSchemas to columnTypes. |
static String |
getDDLFromFieldSchema(String structName,
List<FieldSchema> fieldSchemas)
Convert FieldSchemas to Thrift DDL. |
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,
Properties schema)
getDeserializer Get the Deserializer for a table given its name and properties. |
static Deserializer |
getDeserializer(org.apache.hadoop.conf.Configuration conf,
Table table)
getDeserializer Get the Deserializer for a table. |
static FieldSchema |
getFieldSchemaFromTypeInfo(String fieldName,
TypeInfo typeInfo)
Convert TypeInfo to FieldSchema. |
static List<FieldSchema> |
getFieldsFromDeserializer(String tableName,
Deserializer deserializer)
|
static String |
getFullDDLFromFieldSchema(String structName,
List<FieldSchema> fieldSchemas)
Convert FieldSchemas to Thrift DDL + column names and column types |
static String |
getListType(String t)
|
static String |
getMapType(String k,
String v)
|
static Properties |
getSchema(Partition part,
Table table)
|
static Properties |
getSchema(StorageDescriptor sd,
StorageDescriptor tblsd,
Map<String,String> parameters,
String tableName,
List<FieldSchema> partitionKeys)
|
static Properties |
getSchema(Table table)
|
static Table |
getTable(org.apache.hadoop.conf.Configuration conf,
Properties schema)
|
static void |
makeDir(org.apache.hadoop.fs.Path path,
HiveConf hiveConf)
|
static void |
printStackTrace(Exception e)
printStackTrace Helper function to print an exception stack trace to the log and not stderr |
static void |
recursiveDelete(File f)
recursiveDelete just recursively deletes a dir - you'd think Java would have something to do this?? |
static void |
setSerdeParam(SerDeInfo sdi,
Properties schema,
String param)
|
static String |
typeToThriftType(String type)
Convert type to ThriftType. |
static boolean |
validateColNames(List<FieldSchema> cols)
|
static boolean |
validateName(String name)
validateName Checks the name conforms to our standars which are: "[a-zA-z_0-9]+". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log LOG
public static final String DEFAULT_DATABASE_NAME
Constructor Detail |
---|
public MetaStoreUtils()
Method Detail |
---|
public static void printStackTrace(Exception e)
e
- the exceptionpublic static Table createColumnsetSchema(String name, List<String> columns, List<String> partCols, org.apache.hadoop.conf.Configuration conf) throws MetaException
MetaException
public static void recursiveDelete(File f) throws IOException
f
- - the file/dir to delete
IOException
- propogate f.delete() exceptionspublic static Deserializer getDeserializer(org.apache.hadoop.conf.Configuration conf, Properties schema) throws MetaException
conf
- hadoop configschema
- the properties to use to instantiate the deserializer
MetaException
- 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) throws MetaException
conf
- - hadoop configtable
- the table
MetaException
- if any problems instantiating the Deserializer
todo - this should move somewhere into serde.jarpublic static Deserializer getDeserializer(org.apache.hadoop.conf.Configuration conf, Partition part, Table table) throws MetaException
conf
- - hadoop configpartition
- the partition
MetaException
- if any problems instantiating the Deserializerpublic static void deleteWHDirectory(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, boolean use_trash) throws MetaException
MetaException
public static boolean validateName(String name)
name
- the name to validate
MetaException
- if it doesn't match the pattern.public static boolean validateColNames(List<FieldSchema> cols)
public static String getListType(String t)
public static String getMapType(String k, String v)
public static Table getTable(org.apache.hadoop.conf.Configuration conf, Properties schema) throws MetaException
MetaException
public static void setSerdeParam(SerDeInfo sdi, Properties schema, String param)
public static String typeToThriftType(String type)
public static String getFullDDLFromFieldSchema(String structName, List<FieldSchema> fieldSchemas)
structName
- The name of the tablefieldSchemas
- List of fields along with their schemas
public static String getDDLFromFieldSchema(String structName, List<FieldSchema> fieldSchemas)
public static Properties getSchema(Table table)
public static Properties getSchema(Partition part, Table table)
public static Properties getSchema(StorageDescriptor sd, StorageDescriptor tblsd, Map<String,String> parameters, String tableName, List<FieldSchema> partitionKeys)
public static String getColumnNamesFromFieldSchema(List<FieldSchema> fieldSchemas)
public static String getColumnTypesFromFieldSchema(List<FieldSchema> fieldSchemas)
public static void makeDir(org.apache.hadoop.fs.Path path, HiveConf hiveConf) throws MetaException
MetaException
public static List<FieldSchema> getFieldsFromDeserializer(String tableName, Deserializer deserializer) throws SerDeException, MetaException
tableName
- deserializer
-
SerDeException
MetaException
public static FieldSchema getFieldSchemaFromTypeInfo(String fieldName, TypeInfo typeInfo)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |