@Override public boolean dropPartition(String catName, String dbName, String tblName, List<String> part_vals) throws MetaException, NoSuchObjectException, InvalidObjectException, InvalidInputException { boolean succ = rawStore.dropPartition(catName, dbName, tblName, part_vals); // in case of event based cache update, cache will be updated during commit. if (succ && !canUseEvents) { catName = normalizeIdentifier(catName); dbName = normalizeIdentifier(dbName); tblName = normalizeIdentifier(tblName); if (!shouldCacheTable(catName, dbName, tblName)) { return succ; } sharedCache.removePartitionFromCache(catName, dbName, tblName, part_vals); } return succ; }
private static void dropAllStoreObjects(RawStore store) throws MetaException, InvalidObjectException, InvalidInputException { try { Deadline.registerIfNot(100000); Deadline.startTimer("getPartition"); List<String> dbs = store.getAllDatabases(DEFAULT_CATALOG_NAME); for (int i = 0; i < dbs.size(); i++) { String db = dbs.get(i); List<String> tbls = store.getAllTables(DEFAULT_CATALOG_NAME, db); for (String tbl : tbls) { List<Partition> parts = store.getPartitions(DEFAULT_CATALOG_NAME, db, tbl, 100); for (Partition part : parts) { store.dropPartition(DEFAULT_CATALOG_NAME, db, tbl, part.getValues()); } store.dropTable(DEFAULT_CATALOG_NAME, db, tbl); } store.dropDatabase(DEFAULT_CATALOG_NAME, db); } } catch (NoSuchObjectException e) { } }
if (!ms.dropPartition(catName, db_name, tbl_name, part_vals)) { throw new MetaException("Unable to drop partition"); } else {
ms.addPartition(destPartition); destPartitions.add(destPartition); ms.dropPartition(parsedSourceDbName[CAT_NAME], partition.getDbName(), sourceTable.getTableName(), partition.getValues());
List<Partition> parts = store.getPartitions(DEFAULT_CATALOG_NAME, db, tbl, 100); for (Partition part : parts) { store.dropPartition(DEFAULT_CATALOG_NAME, db, tbl, part.getValues());
private List<Partition> dropPartitionsCoreNoTxn( final RawStore ms, final Table tbl, final List<List<String>> partsValues) throws MetaException, NoSuchObjectException, InvalidObjectException, InvalidInputException { final List<Partition> deletedPartitions = new ArrayList<Partition>(); Partition part = null; final String dbName = tbl.getDbName(); final String tblName = tbl.getTableName(); for (List<String> partValues : partsValues) { part = ms.getPartition(dbName, tblName, partValues); if (part == null) { throw new NoSuchObjectException("Partition doesn't exist. " + partValues); } if (!ms.dropPartition(dbName, tblName, partValues)) { throw new MetaException("Unable to drop partition"); } deletedPartitions.add(part); } return deletedPartitions; } }
private List<Partition> dropPartitionsCoreNoTxn( final RawStore ms, final Table tbl, final List<List<String>> partsValues) throws MetaException, NoSuchObjectException, InvalidObjectException, InvalidInputException { final List<Partition> deletedPartitions = new ArrayList<Partition>(); Partition part = null; final String dbName = tbl.getDbName(); final String tblName = tbl.getTableName(); for (List<String> partValues : partsValues) { part = ms.getPartition(dbName, tblName, partValues); if (part == null) { throw new NoSuchObjectException("Partition doesn't exist. " + partValues); } if (!ms.dropPartition(dbName, tblName, partValues)) { throw new MetaException("Unable to drop partition"); } deletedPartitions.add(part); } return deletedPartitions; } }
@Override public boolean dropPartition(String catName, String dbName, String tblName, List<String> part_vals) throws MetaException, NoSuchObjectException, InvalidObjectException, InvalidInputException { boolean succ = rawStore.dropPartition(catName, dbName, tblName, part_vals); if (succ) { catName = normalizeIdentifier(catName); dbName = normalizeIdentifier(dbName); tblName = normalizeIdentifier(tblName); if (!shouldCacheTable(catName, dbName, tblName)) { return succ; } sharedCache.removePartitionFromCache(catName, dbName, tblName, part_vals); } return succ; }
ms.dropPartition(dbName, tableName, part.getValues());
if (!ms.dropPartition(db_name, tbl_name, part_vals)) { throw new MetaException("Unable to drop partition");
ms.addPartition(destPartition); destPartitions.add(destPartition); ms.dropPartition(parsedSourceDbName[CAT_NAME], partition.getDbName(), sourceTable.getTableName(), partition.getValues());
destPartition.getSd().setLocation(destPartitionPath.toString()); ms.addPartition(destPartition); ms.dropPartition(partition.getDbName(), sourceTable.getTableName(), partition.getValues());
destPartition.getSd().setLocation(destPartitionPath.toString()); ms.addPartition(destPartition); ms.dropPartition(partition.getDbName(), sourceTable.getTableName(), partition.getValues());
if (!ms.dropPartition(catName, db_name, tbl_name, part_vals)) { throw new MetaException("Unable to drop partition"); } else {
if (!ms.dropPartition(db_name, tbl_name, part_vals)) { throw new MetaException("Unable to drop partition");
checkTrashPurgeCombination(archiveParentDir, db_name + "." + tbl_name + "." + part_vals, mustPurge); if (!ms.dropPartition(db_name, tbl_name, part_vals)) { throw new MetaException("Unable to drop partition");
checkTrashPurgeCombination(archiveParentDir, db_name + "." + tbl_name + "." + part_vals, mustPurge); if (!ms.dropPartition(db_name, tbl_name, part_vals)) { throw new MetaException("Unable to drop partition");