@Override public Partition getPartition(String catName, String dbName, String tblName, List<String> part_vals, String validWriteIds) throws MetaException, NoSuchObjectException { catName = normalizeIdentifier(catName); dbName = StringUtils.normalizeIdentifier(dbName); tblName = StringUtils.normalizeIdentifier(tblName); if (!shouldCacheTable(catName, dbName, tblName) || (canUseEvents && rawStore.isActiveTransaction())) { return rawStore.getPartition( catName, dbName, tblName, part_vals, validWriteIds); } Partition part = sharedCache.getPartitionFromCache(catName, dbName, tblName, part_vals); if (part == null) { // The table containing the partition is not yet loaded in cache return rawStore.getPartition( catName, dbName, tblName, part_vals, validWriteIds); } if (validWriteIds != null) { Table table = sharedCache.getTableFromCache(catName, dbName, tblName); if (table == null) { // The table containing the partition is not yet loaded in cache return rawStore.getPartition( catName, dbName, tblName, part_vals, validWriteIds); } part.setParameters(adjustStatsParamsForGet(table.getParameters(), part.getParameters(), part.getWriteId(), validWriteIds)); } return part; }
private Partition get_partition_by_name_core(final RawStore ms, final String catName, final String db_name, final String tbl_name, final String part_name) throws TException { fireReadTablePreEvent(catName, db_name, tbl_name); List<String> partVals; try { partVals = getPartValsFromName(ms, catName, db_name, tbl_name, part_name); } catch (InvalidObjectException e) { throw new NoSuchObjectException(e.getMessage()); } Partition p = ms.getPartition(catName, db_name, tbl_name, partVals); p = FilterUtils.filterPartitionIfEnabled(isServerFilterEnabled, filterHook, p); if (p == null) { throw new NoSuchObjectException(TableName.getQualified(catName, db_name, tbl_name) + " partition (" + part_name + ") not found"); } return p; }
Partition oldTmpPart = msdb.getPartition(catName, dbname, name, tmpPart.getValues()); oldParts.add(oldTmpPart); partValsList.add(tmpPart.getValues());
@Override public Partition get_partition(final String db_name, final String tbl_name, final List<String> part_vals) throws MetaException, NoSuchObjectException { String[] parsedDbName = parseDbName(db_name, conf); startPartitionFunction("get_partition", parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tbl_name, part_vals); Partition ret = null; Exception ex = null; try { authorizeTableForPartitionMetadata(parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tbl_name); fireReadTablePreEvent(parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tbl_name); ret = getMS().getPartition(parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tbl_name, part_vals); ret = FilterUtils.filterPartitionIfEnabled(isServerFilterEnabled, filterHook, ret); } catch (Exception e) { ex = e; throwMetaException(e); } finally { endFunction("get_partition", ret != null, ex, tbl_name); } return ret; }
part = ms.getPartition(catName, db_name, tbl_name, part_vals); tbl = get_table_core(catName, db_name, tbl_name, null); tableDataShouldBeDeleted = checkTableDataShouldBeDeleted(tbl, deleteData);
"Unable to alter partition because table or database does not exist."); oldPart = msdb.getPartition(catName, dbname, name, new_part.getValues()); if (MetaStoreServerUtils.requireCalStats(oldPart, new_part, tbl, environmentContext)) { oldPart = msdb.getPartition(catName, dbname, name, part_vals); } catch (NoSuchObjectException e) { check_part = msdb.getPartition(catName, dbname, name, new_part.getValues()); } catch(NoSuchObjectException e) {
old_part = ms.getPartition(part.getCatName(), part.getDbName(), part .getTableName(), part.getValues()); } catch (NoSuchObjectException e) {
@Override Partition run(RawStore ms) throws Exception { return ms.getPartition(db_name, tbl_name, part_vals); } });
@Override public Partition getPartition(String catName, String dbName, String tblName, List<String> part_vals) throws MetaException, NoSuchObjectException { catName = normalizeIdentifier(catName); dbName = StringUtils.normalizeIdentifier(dbName); tblName = StringUtils.normalizeIdentifier(tblName); if (!shouldCacheTable(catName, dbName, tblName)) { return rawStore.getPartition(catName, dbName, tblName, part_vals); } Partition part = sharedCache.getPartitionFromCache(catName, dbName, tblName, part_vals); if (part == null) { // The table containing the partition is not yet loaded in cache return rawStore.getPartition(catName, dbName, tblName, part_vals); } return part; }
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; } }
private Partition get_partition_by_name_core(final RawStore ms, final String db_name, final String tbl_name, final String part_name) throws MetaException, NoSuchObjectException, TException { List<String> partVals = null; try { partVals = getPartValsFromName(ms, db_name, tbl_name, part_name); } catch (InvalidObjectException e) { throw new NoSuchObjectException(e.getMessage()); } Partition p = ms.getPartition(db_name, tbl_name, partVals); if (p == null) { throw new NoSuchObjectException(db_name + "." + tbl_name + " partition (" + part_name + ") not found"); } return p; }
private Partition get_partition_by_name_core(final RawStore ms, final String db_name, final String tbl_name, final String part_name) throws MetaException, NoSuchObjectException, TException { List<String> partVals = null; try { partVals = getPartValsFromName(ms, db_name, tbl_name, part_name); } catch (InvalidObjectException e) { throw new NoSuchObjectException(e.getMessage()); } Partition p = ms.getPartition(db_name, tbl_name, partVals); if (p == null) { throw new NoSuchObjectException(db_name + "." + tbl_name + " partition (" + part_name + ") not found"); } return p; }
public Partition get_partition(final String db_name, final String tbl_name, final List<String> part_vals) throws MetaException, NoSuchObjectException { startPartitionFunction("get_partition", db_name, tbl_name, part_vals); Partition ret = null; Exception ex = null; try { ret = getMS().getPartition(db_name, tbl_name, part_vals); } catch (Exception e) { ex = e; if (e instanceof MetaException) { throw (MetaException) e; } else if (e instanceof NoSuchObjectException) { throw (NoSuchObjectException) e; } else { MetaException me = new MetaException(e.toString()); me.initCause(e); throw me; } } finally { endFunction("get_partition", ret != null, ex, tbl_name); } return ret; }
private Partition get_partition_by_name_core(final RawStore ms, final String db_name, final String tbl_name, final String part_name) throws MetaException, NoSuchObjectException, TException { fireReadTablePreEvent(db_name, tbl_name); List<String> partVals = null; try { partVals = getPartValsFromName(ms, db_name, tbl_name, part_name); } catch (InvalidObjectException e) { throw new NoSuchObjectException(e.getMessage()); } Partition p = ms.getPartition(db_name, tbl_name, partVals); if (p == null) { throw new NoSuchObjectException(db_name + "." + tbl_name + " partition (" + part_name + ") not found"); } return p; }
private Partition get_partition_by_name_core(final RawStore ms, final String db_name, final String tbl_name, final String part_name) throws MetaException, NoSuchObjectException, TException { fireReadTablePreEvent(db_name, tbl_name); List<String> partVals = null; try { partVals = getPartValsFromName(ms, db_name, tbl_name, part_name); } catch (InvalidObjectException e) { throw new NoSuchObjectException(e.getMessage()); } Partition p = ms.getPartition(db_name, tbl_name, partVals); if (p == null) { throw new NoSuchObjectException(db_name + "." + tbl_name + " partition (" + part_name + ") not found"); } return p; }
@Override public Partition get_partition(final String db_name, final String tbl_name, final List<String> part_vals) throws MetaException, NoSuchObjectException { startPartitionFunction("get_partition", db_name, tbl_name, part_vals); Partition ret = null; Exception ex = null; try { fireReadTablePreEvent(db_name, tbl_name); ret = getMS().getPartition(db_name, tbl_name, part_vals); } catch (Exception e) { ex = e; if (e instanceof MetaException) { throw (MetaException) e; } else if (e instanceof NoSuchObjectException) { throw (NoSuchObjectException) e; } else { throw newMetaException(e); } } finally { endFunction("get_partition", ret != null, ex, tbl_name); } return ret; }
@Override public Partition get_partition(final String db_name, final String tbl_name, final List<String> part_vals) throws MetaException, NoSuchObjectException { startPartitionFunction("get_partition", db_name, tbl_name, part_vals); Partition ret = null; Exception ex = null; try { fireReadTablePreEvent(db_name, tbl_name); ret = getMS().getPartition(db_name, tbl_name, part_vals); } catch (Exception e) { ex = e; if (e instanceof MetaException) { throw (MetaException) e; } else if (e instanceof NoSuchObjectException) { throw (NoSuchObjectException) e; } else { throw newMetaException(e); } } finally { endFunction("get_partition", ret != null, ex, tbl_name); } return ret; }
private Partition get_partition_by_name_core(final RawStore ms, final String catName, final String db_name, final String tbl_name, final String part_name) throws TException { fireReadTablePreEvent(catName, db_name, tbl_name); List<String> partVals; try { partVals = getPartValsFromName(ms, catName, db_name, tbl_name, part_name); } catch (InvalidObjectException e) { throw new NoSuchObjectException(e.getMessage()); } Partition p = ms.getPartition(catName, db_name, tbl_name, partVals); if (p == null) { throw new NoSuchObjectException(getCatalogQualifiedTableName(catName, db_name, tbl_name) + " partition (" + part_name + ") not found"); } return p; }
@Override public Partition get_partition(final String db_name, final String tbl_name, final List<String> part_vals) throws MetaException, NoSuchObjectException { String[] parsedDbName = parseDbName(db_name, conf); startPartitionFunction("get_partition", parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tbl_name, part_vals); Partition ret = null; Exception ex = null; try { fireReadTablePreEvent(parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tbl_name); ret = getMS().getPartition(parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tbl_name, part_vals); } catch (Exception e) { ex = e; throwMetaException(e); } finally { endFunction("get_partition", ret != null, ex, tbl_name); } return ret; }