/** * Given a catalog name and database name, cram them together into one string. These can be * parsed apart again via {@link #parseDbName(String, Configuration)}. * @param catalogName catalog name. This cannot be null. If this might be null use * {@link #prependCatalogToDbName(String, String, Configuration)} instead. * @param dbName database name. * @return one string that contains both. */ public static String prependNotNullCatToDbName(String catalogName, String dbName) { assert catalogName != null; return prependCatalogToDbName(catalogName, dbName, null); }
@Deprecated public boolean dropPartition(String db_name, String tbl_name, List<String> part_vals, EnvironmentContext env_context) throws TException { return client.drop_partition_with_environment_context(prependCatalogToDbName(db_name, conf), tbl_name, part_vals, true, env_context); }
@Override public boolean deletePartitionColumnStatistics(String catName, String dbName, String tableName, String partName, String colName) throws TException { return client.delete_partition_column_statistics(prependCatalogToDbName(catName, dbName, conf), tableName, partName, colName); }
@Override public void markPartitionForEvent(String catName, String db_name, String tbl_name, Map<String, String> partKVs, PartitionEventType eventType) throws TException { client.markPartitionForEvent(prependCatalogToDbName(catName, db_name, conf), tbl_name, partKVs, eventType); }
@Override public List<String> get_all_databases() throws MetaException { // get_databases filters results already. No need to filter here return get_databases(MetaStoreUtils.prependCatalogToDbName(null, null, conf)); }
@Override public boolean dropPartition(String catName, String db_name, String tbl_name, String name, boolean deleteData) throws TException { return client.drop_partition_by_name_with_environment_context(prependCatalogToDbName( catName, db_name, conf), tbl_name, name, deleteData, null); }
@Override public void alterFunction(String catName, String dbName, String funcName, Function newFunction) throws TException { client.alter_function(prependCatalogToDbName(catName, dbName, conf), funcName, newFunction); }
protected void drop_table_with_environment_context(String catName, String dbname, String name, boolean deleteData, EnvironmentContext envContext) throws TException { client.drop_table_with_environment_context(prependCatalogToDbName(catName, dbname, conf), name, deleteData, envContext); }
@Override public List<String> getAllTables(String catName, String dbName) throws TException { List<String> tableNames = client.get_all_tables( prependCatalogToDbName(catName, dbName, conf)); return FilterUtils.filterTableNamesIfEnabled(isClientFilterEnabled, filterHook, catName, dbName, tableNames); }
@Override public List<String> getAllDatabases(String catName) throws TException { List<String> databases = client.get_databases(prependCatalogToDbName(catName, null, conf)); return FilterUtils.filterDbNamesIfEnabled(isClientFilterEnabled, filterHook, databases); }
@Override public List<TableMeta> getTableMeta(String catName, String dbPatterns, String tablePatterns, List<String> tableTypes) throws TException { List<TableMeta> tableMetas = client.get_table_meta(prependCatalogToDbName( catName, dbPatterns, conf), tablePatterns, tableTypes); return FilterUtils.filterTableMetasIfEnabled(isClientFilterEnabled, filterHook, catName,dbPatterns, tableMetas); }
@Override public List<FieldSchema> getFields(String catName, String db, String tableName) throws TException { List<FieldSchema> fields = client.get_fields(prependCatalogToDbName(catName, db, conf), tableName); return deepCopyFieldSchemas(fields); }
@Override public List<String> getTables(String catName, String dbName, String tablePattern) throws TException { List<String> tables = client.get_tables(prependCatalogToDbName(catName, dbName, conf), tablePattern); return FilterUtils.filterTableNamesIfEnabled(isClientFilterEnabled, filterHook, catName, dbName, tables); }
@Override public Partition getPartition(String catName, String dbName, String tblName, List<String> partVals) throws TException { Partition p = client.get_partition(prependCatalogToDbName(catName, dbName, conf), tblName, partVals); return deepCopy(FilterUtils.filterPartitionIfEnabled(isClientFilterEnabled, filterHook, p)); }
@Override public PartitionSpecProxy listPartitionSpecs(String catName, String dbName, String tableName, int maxParts) throws TException { List<PartitionSpec> partitionSpecs = client.get_partitions_pspec(prependCatalogToDbName(catName, dbName, conf), tableName, maxParts); partitionSpecs = FilterUtils.filterPartitionSpecsIfEnabled(isClientFilterEnabled, filterHook, partitionSpecs); return PartitionSpecProxy.Factory.get(partitionSpecs); }
@Override public List<String> listPartitionNames(String catName, String dbName, String tableName, int maxParts) throws TException { List<String> partNames = client.get_partition_names( prependCatalogToDbName(catName, dbName, conf), tableName, shrinkMaxtoShort(maxParts)); return FilterUtils.filterPartitionNamesIfEnabled( isClientFilterEnabled, filterHook, catName, dbName, tableName, partNames); }
@Override public List<Partition> listPartitions(String catName, String db_name, String tbl_name, List<String> part_vals, int max_parts) throws TException { List<Partition> parts = client.get_partitions_ps(prependCatalogToDbName(catName, db_name, conf), tbl_name, part_vals, shrinkMaxtoShort(max_parts)); return deepCopyPartitions(FilterUtils.filterPartitionsIfEnabled(isClientFilterEnabled, filterHook, parts)); }
@Override public List<Partition> listPartitionsWithAuthInfo(String catName, String dbName, String tableName, List<String> partialPvals, int maxParts, String userName, List<String> groupNames) throws TException { List<Partition> parts = client.get_partitions_ps_with_auth(prependCatalogToDbName(catName, dbName, conf), tableName, partialPvals, shrinkMaxtoShort(maxParts), userName, groupNames); return deepCopyPartitions(FilterUtils.filterPartitionsIfEnabled(isClientFilterEnabled, filterHook, parts)); }
@Override public List<Partition> listPartitions(String catName, String db_name, String tbl_name, int max_parts) throws TException { List<Partition> parts = client.get_partitions(prependCatalogToDbName(catName, db_name, conf), tbl_name, shrinkMaxtoShort(max_parts)); return deepCopyPartitions( FilterUtils.filterPartitionsIfEnabled(isClientFilterEnabled, filterHook, parts)); }
@Override public List<Partition> getPartitionsByNames(String catName, String db_name, String tbl_name, List<String> part_names, boolean getColStats) throws TException { checkDbAndTableFilters(catName, db_name, tbl_name); GetPartitionsByNamesRequest gpbnr = new GetPartitionsByNamesRequest(prependCatalogToDbName(catName, db_name, conf), tbl_name); gpbnr.setNames(part_names); gpbnr.setGet_col_stats(getColStats); List<Partition> parts = client.get_partitions_by_names_req(gpbnr).getPartitions(); return deepCopyPartitions(FilterUtils.filterPartitionsIfEnabled(isClientFilterEnabled, filterHook, parts)); }