org.apache.hadoop.hive.ql.parse
Class EximUtil

java.lang.Object
  extended by org.apache.hadoop.hive.ql.parse.EximUtil

public class EximUtil
extends Object

EximUtil. Utility methods for the export/import semantic analyzers.


Field Summary
static String METADATA_FORMAT_FORWARD_COMPATIBLE_VERSION
           
static String METADATA_FORMAT_VERSION
           
 
Method Summary
static void createExportDump(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path metadataPath, Table tableHandle, List<Partition> partitions)
           
static void doCheckCompatibility(String currVersion, String version, String fcVersion)
           
static Map<String,String> makePartSpec(List<org.apache.hadoop.hive.metastore.api.FieldSchema> partCols, List<String> partVals)
          Return the partition specification from the specified keys and values
static Map.Entry<org.apache.hadoop.hive.metastore.api.Table,List<org.apache.hadoop.hive.metastore.api.Partition>> readMetaData(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path metadataPath)
           
static String relativeToAbsolutePath(HiveConf conf, String location)
           
static boolean schemaCompare(List<org.apache.hadoop.hive.metastore.api.FieldSchema> newSchema, List<org.apache.hadoop.hive.metastore.api.FieldSchema> oldSchema)
          Compares the schemas - names, types and order, but ignoring comments
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METADATA_FORMAT_VERSION

public static final String METADATA_FORMAT_VERSION
See Also:
Constant Field Values

METADATA_FORMAT_FORWARD_COMPATIBLE_VERSION

public static final String METADATA_FORMAT_FORWARD_COMPATIBLE_VERSION
Method Detail

relativeToAbsolutePath

public static String relativeToAbsolutePath(HiveConf conf,
                                            String location)
                                     throws SemanticException
Throws:
SemanticException

createExportDump

public static void createExportDump(org.apache.hadoop.fs.FileSystem fs,
                                    org.apache.hadoop.fs.Path metadataPath,
                                    Table tableHandle,
                                    List<Partition> partitions)
                             throws SemanticException,
                                    IOException
Throws:
SemanticException
IOException

readMetaData

public static Map.Entry<org.apache.hadoop.hive.metastore.api.Table,List<org.apache.hadoop.hive.metastore.api.Partition>> readMetaData(org.apache.hadoop.fs.FileSystem fs,
                                                                                                                                      org.apache.hadoop.fs.Path metadataPath)
                                                                                                                               throws IOException,
                                                                                                                                      SemanticException
Throws:
IOException
SemanticException

doCheckCompatibility

public static void doCheckCompatibility(String currVersion,
                                        String version,
                                        String fcVersion)
                                 throws SemanticException
Throws:
SemanticException

makePartSpec

public static Map<String,String> makePartSpec(List<org.apache.hadoop.hive.metastore.api.FieldSchema> partCols,
                                              List<String> partVals)
Return the partition specification from the specified keys and values

Parameters:
partCols - the names of the partition keys
partVals - the values of the partition keys
Returns:
the partition specification as a map

schemaCompare

public static boolean schemaCompare(List<org.apache.hadoop.hive.metastore.api.FieldSchema> newSchema,
                                    List<org.apache.hadoop.hive.metastore.api.FieldSchema> oldSchema)
Compares the schemas - names, types and order, but ignoring comments

Parameters:
newSchema - the new schema
oldSchema - the old schema
Returns:
a boolean indicating match


Copyright © 2014 The Apache Software Foundation. All rights reserved.