public class Hive
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
alterDatabase(java.lang.String dbName,
Database db) |
void |
alterIndex(java.lang.String dbName,
java.lang.String baseTblName,
java.lang.String idxName,
Index newIdx)
Updates the existing index metadata with the new metadata.
|
void |
alterPartition(java.lang.String tblName,
Partition newPart)
Updates the existing partition metadata with the new metadata.
|
void |
alterPartition(java.lang.String dbName,
java.lang.String tblName,
Partition newPart)
Updates the existing partition metadata with the new metadata.
|
void |
alterPartitions(java.lang.String tblName,
java.util.List<Partition> newParts)
Updates the existing table metadata with the new metadata.
|
void |
alterTable(java.lang.String tblName,
Table newTbl)
Updates the existing table metadata with the new metadata.
|
void |
cancelDelegationToken(java.lang.String tokenStrForm) |
static void |
closeCurrent() |
protected static void |
copyFiles(HiveConf conf,
Path srcf,
Path destf,
FileSystem fs) |
void |
createDatabase(Database db)
Create a Database.
|
void |
createDatabase(Database db,
boolean ifNotExist)
Create a database
|
void |
createIndex(java.lang.String tableName,
java.lang.String indexName,
java.lang.String indexHandlerClass,
java.util.List<java.lang.String> indexedCols,
java.lang.String indexTblName,
boolean deferredRebuild,
java.lang.String inputFormat,
java.lang.String outputFormat,
java.lang.String serde,
java.lang.String storageHandler,
java.lang.String location,
java.util.Map<java.lang.String,java.lang.String> idxProps,
java.util.Map<java.lang.String,java.lang.String> tblProps,
java.util.Map<java.lang.String,java.lang.String> serdeProps,
java.lang.String collItemDelim,
java.lang.String fieldDelim,
java.lang.String fieldEscape,
java.lang.String lineDelim,
java.lang.String mapKeyDelim,
java.lang.String indexComment) |
Partition |
createPartition(Table tbl,
java.util.Map<java.lang.String,java.lang.String> partSpec)
Creates a partition.
|
Partition |
createPartition(Table tbl,
java.util.Map<java.lang.String,java.lang.String> partSpec,
Path location,
java.util.Map<java.lang.String,java.lang.String> partParams,
java.lang.String inputFormat,
java.lang.String outputFormat,
int numBuckets,
java.util.List<FieldSchema> cols,
java.lang.String serializationLib,
java.util.Map<java.lang.String,java.lang.String> serdeParams,
java.util.List<java.lang.String> bucketCols,
java.util.List<Order> sortCols)
Creates a partition
|
void |
createRole(java.lang.String roleName,
java.lang.String ownerName) |
void |
createTable(java.lang.String tableName,
java.util.List<java.lang.String> columns,
java.util.List<java.lang.String> partCols,
java.lang.Class<? extends InputFormat> fileInputFormat,
java.lang.Class<?> fileOutputFormat)
Creates a table metdata and the directory for the table data
|
void |
createTable(java.lang.String tableName,
java.util.List<java.lang.String> columns,
java.util.List<java.lang.String> partCols,
java.lang.Class<? extends InputFormat> fileInputFormat,
java.lang.Class<?> fileOutputFormat,
int bucketCount,
java.util.List<java.lang.String> bucketCols)
Creates a table metdata and the directory for the table data
|
void |
createTable(Table tbl)
Creates the table with the give objects
|
void |
createTable(Table tbl,
boolean ifNotExists)
Creates the table with the give objects
|
boolean |
databaseExists(java.lang.String dbName)
Query metadata to see if a database with the given name already exists.
|
boolean |
deletePartitionColumnStatistics(java.lang.String dbName,
java.lang.String tableName,
java.lang.String partName,
java.lang.String colName) |
boolean |
deleteTableColumnStatistics(java.lang.String dbName,
java.lang.String tableName,
java.lang.String colName) |
void |
dropDatabase(java.lang.String name)
Drop a database.
|
void |
dropDatabase(java.lang.String name,
boolean deleteData,
boolean ignoreUnknownDb)
Drop a database
|
void |
dropDatabase(java.lang.String name,
boolean deleteData,
boolean ignoreUnknownDb,
boolean cascade)
Drop a database
|
boolean |
dropIndex(java.lang.String db_name,
java.lang.String tbl_name,
java.lang.String index_name,
boolean deleteData) |
boolean |
dropPartition(java.lang.String tblName,
java.util.List<java.lang.String> part_vals,
boolean deleteData) |
boolean |
dropPartition(java.lang.String db_name,
java.lang.String tbl_name,
java.util.List<java.lang.String> part_vals,
boolean deleteData) |
void |
dropRole(java.lang.String roleName) |
void |
dropTable(java.lang.String tableName)
Drops table along with the data in it.
|
void |
dropTable(java.lang.String dbName,
java.lang.String tableName)
Drops table along with the data in it.
|
void |
dropTable(java.lang.String dbName,
java.lang.String tableName,
boolean deleteData,
boolean ignoreUnknownTab)
Drops the table.
|
void |
exchangeTablePartitions(java.util.Map<java.lang.String,java.lang.String> partitionSpecs,
java.lang.String sourceDb,
java.lang.String sourceTable,
java.lang.String destDb,
java.lang.String destinationTableName) |
PrincipalPrivilegeSet |
get_privilege_set(HiveObjectType objectType,
java.lang.String db_name,
java.lang.String table_name,
java.util.List<java.lang.String> part_values,
java.lang.String column_name,
java.lang.String user_name,
java.util.List<java.lang.String> group_names) |
static Hive |
get() |
static Hive |
get(HiveConf c)
Gets hive object for the current thread.
|
static Hive |
get(HiveConf c,
boolean needsRefresh)
get a connection to metastore.
|
java.util.List<java.lang.String> |
getAllDatabases()
Get all existing database names.
|
java.util.Set<Partition> |
getAllPartitionsForPruner(Table tbl)
Get all the partitions; unlike
getPartitions(Table), does not include auth. |
java.util.List<java.lang.String> |
getAllRoleNames()
Get all existing role names.
|
java.util.List<java.lang.String> |
getAllTables()
Get all table names for the current database.
|
java.util.List<java.lang.String> |
getAllTables(java.lang.String dbName)
Get all table names for the specified database.
|
HiveConf |
getConf() |
Database |
getDatabase(java.lang.String dbName)
Get the database by name.
|
Database |
getDatabaseCurrent()
Get the Database object for current database
|
java.util.List<java.lang.String> |
getDatabasesByPattern(java.lang.String databasePattern)
Get all existing databases that match the given
pattern.
|
java.lang.String |
getDelegationToken(java.lang.String owner,
java.lang.String renewer) |
static java.util.List<FieldSchema> |
getFieldsFromDeserializer(java.lang.String name,
Deserializer serde) |
Index |
getIndex(java.lang.String qualifiedIndexName) |
Index |
getIndex(java.lang.String baseTableName,
java.lang.String indexName) |
Index |
getIndex(java.lang.String dbName,
java.lang.String baseTableName,
java.lang.String indexName) |
java.util.List<Index> |
getIndexes(java.lang.String dbName,
java.lang.String tblName,
short max) |
Partition |
getPartition(Table tbl,
java.util.Map<java.lang.String,java.lang.String> partSpec,
boolean forceCreate) |
Partition |
getPartition(Table tbl,
java.util.Map<java.lang.String,java.lang.String> partSpec,
boolean forceCreate,
java.lang.String partPath,
boolean inheritTableSpecs)
Returns partition metadata
|
ColumnStatistics |
getPartitionColumnStatistics(java.lang.String dbName,
java.lang.String tableName,
java.lang.String partName,
java.lang.String colName) |
java.util.List<java.lang.String> |
getPartitionNames(java.lang.String tblName,
short max) |
java.util.List<java.lang.String> |
getPartitionNames(java.lang.String dbName,
java.lang.String tblName,
java.util.Map<java.lang.String,java.lang.String> partSpec,
short max) |
java.util.List<java.lang.String> |
getPartitionNames(java.lang.String dbName,
java.lang.String tblName,
short max) |
java.util.List<Partition> |
getPartitions(Table tbl)
get all the partitions that the table has
|
java.util.List<Partition> |
getPartitions(Table tbl,
java.util.Map<java.lang.String,java.lang.String> partialPartSpec)
get all the partitions of the table that matches the given partial
specification.
|
java.util.List<Partition> |
getPartitions(Table tbl,
java.util.Map<java.lang.String,java.lang.String> partialPartSpec,
short limit)
get all the partitions of the table that matches the given partial
specification.
|
java.util.List<Partition> |
getPartitionsByFilter(Table tbl,
java.lang.String filter)
Get a list of Partitions by filter.
|
java.util.List<Partition> |
getPartitionsByNames(Table tbl,
java.util.List<java.lang.String> partNames)
Get all partitions of the table that matches the list of given partition names.
|
java.util.List<Partition> |
getPartitionsByNames(Table tbl,
java.util.Map<java.lang.String,java.lang.String> partialPartSpec)
get all the partitions of the table that matches the given partial
specification.
|
Table |
getTable(java.lang.String tableName)
Returns metadata for the table named tableName
|
Table |
getTable(java.lang.String tableName,
boolean throwException)
Returns metadata for the table named tableName
|
Table |
getTable(java.lang.String dbName,
java.lang.String tableName)
Returns metadata of the table
|
Table |
getTable(java.lang.String dbName,
java.lang.String tableName,
boolean throwException)
Returns metadata of the table
|
ColumnStatistics |
getTableColumnStatistics(java.lang.String dbName,
java.lang.String tableName,
java.lang.String colName) |
java.util.List<java.lang.String> |
getTablesByPattern(java.lang.String tablePattern)
Returns all existing tables from default database which match the given
pattern.
|
java.util.List<java.lang.String> |
getTablesByPattern(java.lang.String dbName,
java.lang.String tablePattern)
Returns all existing tables from the specified database which match the given
pattern.
|
java.util.List<java.lang.String> |
getTablesForDb(java.lang.String database,
java.lang.String tablePattern)
Returns all existing tables from the given database which match the given
pattern.
|
boolean |
grantPrivileges(PrivilegeBag privileges) |
boolean |
grantRole(java.lang.String roleName,
java.lang.String userName,
PrincipalType principalType,
java.lang.String grantor,
PrincipalType grantorType,
boolean grantOption) |
java.util.List<Role> |
listRoles(java.lang.String userName,
PrincipalType principalType) |
java.util.ArrayList<java.util.LinkedHashMap<java.lang.String,java.lang.String>> |
loadDynamicPartitions(Path loadPath,
java.lang.String tableName,
java.util.Map<java.lang.String,java.lang.String> partSpec,
boolean replace,
int numDP,
boolean holdDDLTime,
boolean listBucketingEnabled)
Given a source directory name of the load path, load all dynamically generated partitions
into the specified table and return a list of strings that represent the dynamic partition
paths.
|
void |
loadPartition(Path loadPath,
java.lang.String tableName,
java.util.Map<java.lang.String,java.lang.String> partSpec,
boolean replace,
boolean holdDDLTime,
boolean inheritTableSpecs,
boolean isSkewedStoreAsSubdir)
Load a directory into a Hive Table Partition - Alters existing content of
the partition with the contents of loadPath.
|
void |
loadTable(Path loadPath,
java.lang.String tableName,
boolean replace,
boolean holdDDLTime)
Load a directory into a Hive Table.
|
Table |
newTable(java.lang.String tableName) |
protected static boolean |
renameFile(HiveConf conf,
Path srcf,
Path destf,
FileSystem fs,
boolean replace) |
void |
renamePartition(Table tbl,
java.util.Map<java.lang.String,java.lang.String> oldPartSpec,
Partition newPart)
Rename a old partition to new partition
|
protected static void |
replaceFiles(Path srcf,
Path destf,
Path oldPath,
HiveConf conf)
Replaces files in the partition with new data set specified by srcf.
|
boolean |
revokePrivileges(PrivilegeBag privileges) |
boolean |
revokeRole(java.lang.String roleName,
java.lang.String userName,
PrincipalType principalType) |
static void |
set(Hive hive) |
java.util.List<HiveObjectPrivilege> |
showPrivilegeGrant(HiveObjectType objectType,
java.lang.String principalName,
PrincipalType principalType,
java.lang.String dbName,
java.lang.String tableName,
java.util.List<java.lang.String> partValues,
java.lang.String columnName) |
java.util.List<Role> |
showRoleGrant(java.lang.String principalName,
PrincipalType principalType) |
boolean |
updatePartitionColumnStatistics(ColumnStatistics statsObj) |
boolean |
updateTableColumnStatistics(ColumnStatistics statsObj) |
void |
validatePartitionNameCharacters(java.util.List<java.lang.String> partVals) |
public static Hive get(HiveConf c) throws HiveException
c - new Hive ConfigurationHiveExceptionpublic static Hive get(HiveConf c, boolean needsRefresh) throws HiveException
c - new confneedsRefresh - if true then creates a new oneHiveExceptionpublic static Hive get() throws HiveException
HiveExceptionpublic static void set(Hive hive)
public static void closeCurrent()
public void createDatabase(Database db, boolean ifNotExist) throws AlreadyExistsException, HiveException
db - ifNotExist - if true, will ignore AlreadyExistsException exceptionAlreadyExistsExceptionHiveExceptionpublic void createDatabase(Database db) throws AlreadyExistsException, HiveException
db - AlreadyExistsExceptionHiveExceptionpublic void dropDatabase(java.lang.String name)
throws HiveException,
NoSuchObjectException
name - NoSuchObjectExceptionHiveExceptionHiveMetaStoreClient.dropDatabase(java.lang.String)public void dropDatabase(java.lang.String name,
boolean deleteData,
boolean ignoreUnknownDb)
throws HiveException,
NoSuchObjectException
name - deleteData - ignoreUnknownDb - if true, will ignore NoSuchObjectExceptionHiveExceptionNoSuchObjectExceptionpublic void dropDatabase(java.lang.String name,
boolean deleteData,
boolean ignoreUnknownDb,
boolean cascade)
throws HiveException,
NoSuchObjectException
name - deleteData - ignoreUnknownDb - if true, will ignore NoSuchObjectExceptioncascade - if true, delete all tables on the DB if exists. Othewise, the query
will fail if table still exists.HiveExceptionNoSuchObjectExceptionpublic void createTable(java.lang.String tableName,
java.util.List<java.lang.String> columns,
java.util.List<java.lang.String> partCols,
java.lang.Class<? extends InputFormat> fileInputFormat,
java.lang.Class<?> fileOutputFormat)
throws HiveException
tableName - name of the tablecolumns - list of fields of the tablepartCols - partition keys of the tablefileInputFormat - Class of the input format of the table data filefileOutputFormat - Class of the output format of the table data fileHiveException - thrown if the args are invalid or if the metadata or the data
directory couldn't be createdpublic void createTable(java.lang.String tableName,
java.util.List<java.lang.String> columns,
java.util.List<java.lang.String> partCols,
java.lang.Class<? extends InputFormat> fileInputFormat,
java.lang.Class<?> fileOutputFormat,
int bucketCount,
java.util.List<java.lang.String> bucketCols)
throws HiveException
tableName - name of the tablecolumns - list of fields of the tablepartCols - partition keys of the tablefileInputFormat - Class of the input format of the table data filefileOutputFormat - Class of the output format of the table data filebucketCount - number of buckets that each partition (or the table itself) should
be divided intoHiveException - thrown if the args are invalid or if the metadata or the data
directory couldn't be createdpublic void alterTable(java.lang.String tblName,
Table newTbl)
throws InvalidOperationException,
HiveException
tblName - name of the existing tablenewTbl - new name of the table. could be the old nameInvalidOperationException - if the changes in metadata is not acceptableorg.apache.thrift.TExceptionHiveExceptionpublic void alterIndex(java.lang.String dbName,
java.lang.String baseTblName,
java.lang.String idxName,
Index newIdx)
throws InvalidOperationException,
HiveException
idxName - name of the existing indexnewIdx - new name of the index. could be the old nameInvalidOperationException - if the changes in metadata is not acceptableorg.apache.thrift.TExceptionHiveExceptionpublic void alterPartition(java.lang.String tblName,
Partition newPart)
throws InvalidOperationException,
HiveException
tblName - name of the existing tablenewPart - new partitionInvalidOperationException - if the changes in metadata is not acceptableorg.apache.thrift.TExceptionHiveExceptionpublic void alterPartition(java.lang.String dbName,
java.lang.String tblName,
Partition newPart)
throws InvalidOperationException,
HiveException
dbName - name of the exiting table's databasetblName - name of the existing tablenewPart - new partitionInvalidOperationException - if the changes in metadata is not acceptableorg.apache.thrift.TExceptionHiveExceptionpublic void alterPartitions(java.lang.String tblName,
java.util.List<Partition> newParts)
throws InvalidOperationException,
HiveException
tblName - name of the existing tablenewParts - new partitionsInvalidOperationException - if the changes in metadata is not acceptableorg.apache.thrift.TExceptionHiveExceptionpublic void renamePartition(Table tbl, java.util.Map<java.lang.String,java.lang.String> oldPartSpec, Partition newPart) throws HiveException
tbl - existing tableoldPartSpec - spec of old partitionnewPart - new partitionInvalidOperationException - if the changes in metadata is not acceptableorg.apache.thrift.TExceptionHiveExceptionpublic void alterDatabase(java.lang.String dbName,
Database db)
throws HiveException
HiveExceptionpublic void createTable(Table tbl) throws HiveException
tbl - a table objectHiveExceptionpublic void createTable(Table tbl, boolean ifNotExists) throws HiveException
tbl - a table objectifNotExists - if true, ignore AlreadyExistsExceptionHiveExceptionpublic void createIndex(java.lang.String tableName,
java.lang.String indexName,
java.lang.String indexHandlerClass,
java.util.List<java.lang.String> indexedCols,
java.lang.String indexTblName,
boolean deferredRebuild,
java.lang.String inputFormat,
java.lang.String outputFormat,
java.lang.String serde,
java.lang.String storageHandler,
java.lang.String location,
java.util.Map<java.lang.String,java.lang.String> idxProps,
java.util.Map<java.lang.String,java.lang.String> tblProps,
java.util.Map<java.lang.String,java.lang.String> serdeProps,
java.lang.String collItemDelim,
java.lang.String fieldDelim,
java.lang.String fieldEscape,
java.lang.String lineDelim,
java.lang.String mapKeyDelim,
java.lang.String indexComment)
throws HiveException
tableName - table nameindexName - index nameindexHandlerClass - index handler classindexedCols - index columnsindexTblName - index table's namedeferredRebuild - referred build index table's datainputFormat - input formatoutputFormat - output formatserde - storageHandler - index table's storage handlerlocation - locationidxProps - idxserdeProps - serde propertiescollItemDelim - fieldDelim - fieldEscape - lineDelim - mapKeyDelim - HiveExceptionpublic Index getIndex(java.lang.String qualifiedIndexName) throws HiveException
HiveExceptionpublic Index getIndex(java.lang.String baseTableName, java.lang.String indexName) throws HiveException
HiveExceptionpublic Index getIndex(java.lang.String dbName, java.lang.String baseTableName, java.lang.String indexName) throws HiveException
HiveExceptionpublic boolean dropIndex(java.lang.String db_name,
java.lang.String tbl_name,
java.lang.String index_name,
boolean deleteData)
throws HiveException
HiveExceptionpublic void dropTable(java.lang.String tableName)
throws HiveException
tableName - table to dropHiveException - thrown if the drop failspublic void dropTable(java.lang.String dbName,
java.lang.String tableName)
throws HiveException
dbName - database where the table livestableName - table to dropHiveException - thrown if the drop failspublic void dropTable(java.lang.String dbName,
java.lang.String tableName,
boolean deleteData,
boolean ignoreUnknownTab)
throws HiveException
dbName - tableName - deleteData - deletes the underlying data along with metadataignoreUnknownTab - an exception if thrown if this is falser and table doesn't existHiveExceptionpublic HiveConf getConf()
public Table getTable(java.lang.String tableName) throws HiveException
tableName - the name of the tableHiveException - if there's an internal error or if the
table doesn't existpublic Table getTable(java.lang.String tableName, boolean throwException) throws HiveException
tableName - the name of the tablethrowException - controls whether an exception is thrown or a returns a nullHiveException - if there's an internal error or if the
table doesn't existpublic Table getTable(java.lang.String dbName, java.lang.String tableName) throws HiveException
dbName - the name of the databasetableName - the name of the tableHiveException - if there's an internal error or if the table doesn't existpublic Table getTable(java.lang.String dbName, java.lang.String tableName, boolean throwException) throws HiveException
dbName - the name of the databasetableName - the name of the tablethrowException - controls whether an exception is thrown or a returns a nullHiveExceptionpublic java.util.List<java.lang.String> getAllTables()
throws HiveException
HiveExceptionpublic java.util.List<java.lang.String> getAllTables(java.lang.String dbName)
throws HiveException
dbName - HiveExceptionpublic java.util.List<java.lang.String> getTablesByPattern(java.lang.String tablePattern)
throws HiveException
tablePattern - java re patternHiveExceptionpublic java.util.List<java.lang.String> getTablesByPattern(java.lang.String dbName,
java.lang.String tablePattern)
throws HiveException
dbName - tablePattern - HiveExceptionpublic java.util.List<java.lang.String> getTablesForDb(java.lang.String database,
java.lang.String tablePattern)
throws HiveException
database - the database nametablePattern - java re patternHiveExceptionpublic java.util.List<java.lang.String> getAllDatabases()
throws HiveException
HiveExceptionpublic java.util.List<java.lang.String> getDatabasesByPattern(java.lang.String databasePattern)
throws HiveException
databasePattern - java re patternHiveExceptionpublic boolean grantPrivileges(PrivilegeBag privileges) throws HiveException
HiveExceptionpublic boolean revokePrivileges(PrivilegeBag privileges) throws HiveException
privileges - a bag of privilegesHiveExceptionpublic boolean databaseExists(java.lang.String dbName)
throws HiveException
dbName - HiveExceptionpublic Database getDatabase(java.lang.String dbName) throws HiveException
dbName - the name of the database.HiveExceptionpublic Database getDatabaseCurrent() throws HiveException
HiveExceptionpublic void loadPartition(Path loadPath,
java.lang.String tableName,
java.util.Map<java.lang.String,java.lang.String> partSpec,
boolean replace,
boolean holdDDLTime,
boolean inheritTableSpecs,
boolean isSkewedStoreAsSubdir)
throws HiveException
loadPath - Directory containing files to load into TabletableName - name of table to be loaded.partSpec - defines which partition needs to be loadedreplace - if true - replace files in the partition, otherwise add files to
the partitionholdDDLTime - if true, force [re]create the partitioninheritTableSpecs - if true, on [re]creating the partition, take the
location/inputformat/outputformat/serde details from table specHiveExceptionpublic java.util.ArrayList<java.util.LinkedHashMap<java.lang.String,java.lang.String>> loadDynamicPartitions(Path loadPath,
java.lang.String tableName,
java.util.Map<java.lang.String,java.lang.String> partSpec,
boolean replace,
int numDP,
boolean holdDDLTime,
boolean listBucketingEnabled)
throws HiveException
loadPath - tableName - partSpec - replace - numDP - number of dynamic partitionsholdDDLTime - HiveExceptionpublic void loadTable(Path loadPath,
java.lang.String tableName,
boolean replace,
boolean holdDDLTime)
throws HiveException
loadPath - Directory containing files to load into TabletableName - name of table to be loaded.replace - if true - replace files in the table, otherwise add files to tableholdDDLTime - HiveExceptionpublic Partition createPartition(Table tbl, java.util.Map<java.lang.String,java.lang.String> partSpec) throws HiveException
tbl - table for which partition needs to be createdpartSpec - partition keys and their valuesHiveException - if table doesn't exist or partition already existspublic Partition createPartition(Table tbl, java.util.Map<java.lang.String,java.lang.String> partSpec, Path location, java.util.Map<java.lang.String,java.lang.String> partParams, java.lang.String inputFormat, java.lang.String outputFormat, int numBuckets, java.util.List<FieldSchema> cols, java.lang.String serializationLib, java.util.Map<java.lang.String,java.lang.String> serdeParams, java.util.List<java.lang.String> bucketCols, java.util.List<Order> sortCols) throws HiveException
tbl - table for which partition needs to be createdpartSpec - partition keys and their valueslocation - location of this partitionpartParams - partition parametersinputFormat - the inputformat classoutputFormat - the outputformat classnumBuckets - the number of bucketscols - the column schemaserializationLib - the serde classserdeParams - the serde parametersbucketCols - the bucketing columnssortCols - sort columns and orderHiveException - if table doesn't exist or partition already existspublic Partition getPartition(Table tbl, java.util.Map<java.lang.String,java.lang.String> partSpec, boolean forceCreate) throws HiveException
HiveExceptionpublic Partition getPartition(Table tbl, java.util.Map<java.lang.String,java.lang.String> partSpec, boolean forceCreate, java.lang.String partPath, boolean inheritTableSpecs) throws HiveException
tbl - the partition's tablepartSpec - partition keys and valuesforceCreate - if this is true and partition doesn't exist then a partition is
createdpartPath - the path where the partition data is locatedinheritTableSpecs - whether to copy over the table specs for if/of/serdeHiveExceptionpublic boolean dropPartition(java.lang.String tblName,
java.util.List<java.lang.String> part_vals,
boolean deleteData)
throws HiveException
HiveExceptionpublic boolean dropPartition(java.lang.String db_name,
java.lang.String tbl_name,
java.util.List<java.lang.String> part_vals,
boolean deleteData)
throws HiveException
HiveExceptionpublic java.util.List<java.lang.String> getPartitionNames(java.lang.String tblName,
short max)
throws HiveException
HiveExceptionpublic java.util.List<java.lang.String> getPartitionNames(java.lang.String dbName,
java.lang.String tblName,
short max)
throws HiveException
HiveExceptionpublic java.util.List<java.lang.String> getPartitionNames(java.lang.String dbName,
java.lang.String tblName,
java.util.Map<java.lang.String,java.lang.String> partSpec,
short max)
throws HiveException
HiveExceptionpublic java.util.List<Partition> getPartitions(Table tbl) throws HiveException
tbl - object for which partition is neededHiveExceptionpublic java.util.Set<Partition> getAllPartitionsForPruner(Table tbl) throws HiveException
getPartitions(Table), does not include auth.tbl - table for which partitions are neededHiveExceptionpublic java.util.List<Partition> getPartitions(Table tbl, java.util.Map<java.lang.String,java.lang.String> partialPartSpec, short limit) throws HiveException
tbl - object for which partition is needed. Must be partitioned.limit - number of partitions to returnHiveExceptionpublic java.util.List<Partition> getPartitions(Table tbl, java.util.Map<java.lang.String,java.lang.String> partialPartSpec) throws HiveException
tbl - object for which partition is needed. Must be partitioned.HiveExceptionpublic java.util.List<Partition> getPartitionsByNames(Table tbl, java.util.Map<java.lang.String,java.lang.String> partialPartSpec) throws HiveException
tbl - object for which partition is needed. Must be partitioned.partialPartSpec - partial partition specification (some subpartitions can be empty).HiveExceptionpublic java.util.List<Partition> getPartitionsByNames(Table tbl, java.util.List<java.lang.String> partNames) throws HiveException
tbl - object for which partition is needed. Must be partitioned.partNames - list of partition namesHiveExceptionpublic java.util.List<Partition> getPartitionsByFilter(Table tbl, java.lang.String filter) throws HiveException, MetaException, NoSuchObjectException, org.apache.thrift.TException
tbl - The table containing the partitions.filter - A string represent partition predicates.HiveExceptionMetaExceptionNoSuchObjectExceptionorg.apache.thrift.TExceptionpublic void validatePartitionNameCharacters(java.util.List<java.lang.String> partVals)
throws HiveException
HiveExceptionpublic void createRole(java.lang.String roleName,
java.lang.String ownerName)
throws HiveException
HiveExceptionpublic void dropRole(java.lang.String roleName)
throws HiveException
HiveExceptionpublic java.util.List<java.lang.String> getAllRoleNames()
throws HiveException
HiveExceptionpublic java.util.List<Role> showRoleGrant(java.lang.String principalName, PrincipalType principalType) throws HiveException
HiveExceptionpublic boolean grantRole(java.lang.String roleName,
java.lang.String userName,
PrincipalType principalType,
java.lang.String grantor,
PrincipalType grantorType,
boolean grantOption)
throws HiveException
HiveExceptionpublic boolean revokeRole(java.lang.String roleName,
java.lang.String userName,
PrincipalType principalType)
throws HiveException
HiveExceptionpublic java.util.List<Role> listRoles(java.lang.String userName, PrincipalType principalType) throws HiveException
HiveExceptionpublic PrincipalPrivilegeSet get_privilege_set(HiveObjectType objectType, java.lang.String db_name, java.lang.String table_name, java.util.List<java.lang.String> part_values, java.lang.String column_name, java.lang.String user_name, java.util.List<java.lang.String> group_names) throws HiveException
objectType - hive object typedb_name - database nametable_name - table namepart_values - partition valuescolumn_name - column nameuser_name - user namegroup_names - group namesHiveExceptionpublic java.util.List<HiveObjectPrivilege> showPrivilegeGrant(HiveObjectType objectType, java.lang.String principalName, PrincipalType principalType, java.lang.String dbName, java.lang.String tableName, java.util.List<java.lang.String> partValues, java.lang.String columnName) throws HiveException
objectType - hive object typeprincipalName - principalType - dbName - tableName - partValues - columnName - HiveExceptionprotected static boolean renameFile(HiveConf conf, Path srcf, Path destf, FileSystem fs, boolean replace) throws HiveException
HiveExceptionprotected static void copyFiles(HiveConf conf, Path srcf, Path destf, FileSystem fs) throws HiveException
HiveExceptionprotected static void replaceFiles(Path srcf,
Path destf,
Path oldPath,
HiveConf conf)
throws HiveException
srcf - Source directory to be renamed to tmppath. It should be a
leaf directory where the final data files reside. However it
could potentially contain subdirectories as well.destf - The directory where the final data needs to gooldPath - The directory where the old data location, need to be cleaned up.HiveExceptionpublic void exchangeTablePartitions(java.util.Map<java.lang.String,java.lang.String> partitionSpecs,
java.lang.String sourceDb,
java.lang.String sourceTable,
java.lang.String destDb,
java.lang.String destinationTableName)
throws HiveException
HiveExceptionpublic static java.util.List<FieldSchema> getFieldsFromDeserializer(java.lang.String name, Deserializer serde) throws HiveException
HiveExceptionpublic java.util.List<Index> getIndexes(java.lang.String dbName, java.lang.String tblName, short max) throws HiveException
HiveExceptionpublic boolean updateTableColumnStatistics(ColumnStatistics statsObj) throws HiveException
HiveExceptionpublic boolean updatePartitionColumnStatistics(ColumnStatistics statsObj) throws HiveException
HiveExceptionpublic ColumnStatistics getTableColumnStatistics(java.lang.String dbName, java.lang.String tableName, java.lang.String colName) throws HiveException
HiveExceptionpublic ColumnStatistics getPartitionColumnStatistics(java.lang.String dbName, java.lang.String tableName, java.lang.String partName, java.lang.String colName) throws HiveException
HiveExceptionpublic boolean deleteTableColumnStatistics(java.lang.String dbName,
java.lang.String tableName,
java.lang.String colName)
throws HiveException
HiveExceptionpublic boolean deletePartitionColumnStatistics(java.lang.String dbName,
java.lang.String tableName,
java.lang.String partName,
java.lang.String colName)
throws HiveException
HiveExceptionpublic Table newTable(java.lang.String tableName) throws HiveException
HiveExceptionpublic java.lang.String getDelegationToken(java.lang.String owner,
java.lang.String renewer)
throws HiveException
HiveExceptionpublic void cancelDelegationToken(java.lang.String tokenStrForm)
throws HiveException
HiveExceptionCopyright © 2012 The Apache Software Foundation