@Override public Table getTable(String catName, String dbName, String tableName) throws MetaException { return getTable(catName, dbName, tableName, null); }
Table alteredTable = objectStore.getTable(DEFAULT_CATALOG_NAME, DB1, "new" + TABLE1); Assert.assertEquals("Owner of table was not altered", newTbl1.getOwner(), alteredTable.getOwner()); Assert.assertEquals("Owner type of table was not altered", newTbl1.getOwnerType(), alteredTable.getOwnerType());
@Override public Table getTable(String catName, String dbName, String tableName, String writeIdList) throws MetaException { return objectStore.getTable(catName, dbName, tableName, writeIdList); }
@Override public Table getTable(String catName, String dbName, String tableName) throws MetaException { return objectStore.getTable(catName, dbName, tableName); }
@Override public Table getTable(String catName, String dbName, String tableName) throws MetaException { return getTableModifier.apply(super.getTable(catName, dbName, tableName)); }
@Override public Table getTable(String catName, String dbName, String tableName, String writeIdList) throws MetaException { return getTableModifier.apply(super.getTable(catName, dbName, tableName, writeIdList)); }
List<String> partitionNames = null; List<Partition> partitions = null; Table tbl = getTable(catName, dbName, tableName, null); try {
@Override public Table markPartitionForEvent(String catName, String dbName, String tblName, Map<String,String> partName, PartitionEventType evtType) throws MetaException, UnknownTableException, InvalidPartitionException, UnknownPartitionException { LOG.debug("Begin executing markPartitionForEvent"); boolean success = false; Table tbl = null; try{ openTransaction(); tbl = getTable(catName, dbName, tblName, null); // Make sure dbName and tblName are valid. if(null == tbl) { throw new UnknownTableException("Table: "+ tblName + " is not found."); } pm.makePersistent(new MPartitionEvent(catName, dbName,tblName,getPartitionStr(tbl, partName), evtType.getValue())); success = commitTransaction(); LOG.debug("Done executing markPartitionForEvent"); } finally { if(!success) { rollbackTransaction(); } } return tbl; }
@Override public boolean isPartitionMarkedForEvent(String catName, String dbName, String tblName, Map<String, String> partName, PartitionEventType evtType) throws UnknownTableException, MetaException, InvalidPartitionException, UnknownPartitionException { boolean success = false; Query query = null; try { LOG.debug("Begin Executing isPartitionMarkedForEvent"); openTransaction(); query = pm.newQuery(MPartitionEvent.class, "dbName == t1 && tblName == t2 && partName == t3 && eventType == t4 && catalogName == t5"); query .declareParameters("java.lang.String t1, java.lang.String t2, java.lang.String t3, int t4," + "java.lang.String t5"); Table tbl = getTable(catName, dbName, tblName, null); // Make sure dbName and tblName are valid. if (null == tbl) { throw new UnknownTableException("Table: " + tblName + " is not found."); } Collection<MPartitionEvent> partEvents = (Collection<MPartitionEvent>) query.executeWithArray(dbName, tblName, getPartitionStr(tbl, partName), evtType.getValue(), catName); pm.retrieveAll(partEvents); success = commitTransaction(); LOG.debug("Done executing isPartitionMarkedForEvent"); return (partEvents != null && !partEvents.isEmpty()) ? true : false; } finally { rollbackAndCleanup(success, query); } }
getTable(catName, dbName, tableName, null).getPartitionKeys(); for (FieldSchema key : cols) { partValuesSelect.append(extractPartitionKey(key, partitionKeys)).append(", ");
Table table = getTable(catName, dbName, tblName); boolean isTxn = TxnUtils.isTransactionalTable(table.getParameters()); if (isTxn && !areTxnStatsSupported) {
dbName = normalizeIdentifier(dbName); tableName = normalizeIdentifier(tableName); Table table = getTable(catName, dbName, tableName, null); if (table == null) { throw new NoSuchObjectException(TableName.getQualified(catName, dbName, tableName)
Table tbl = createTestTbl(dbName, tblName, tblOwner, cols, ptnCols); objectStore.createTable(tbl); tbl = objectStore.getTable(DEFAULT_CATALOG_NAME, dbName, tblName);
Table tbl = createTestTbl(dbName, tblName, tblOwner, cols, ptnCols); objectStore.createTable(tbl); tbl = objectStore.getTable(DEFAULT_CATALOG_NAME, dbName, tblName); tblRead = objectStore.getTable(DEFAULT_CATALOG_NAME, dbName, tblName1); Assert.assertEquals(tbl1, tblRead); tbl2.setTableName(tblName2); objectStore.createTable(tbl2); tbl2 = objectStore.getTable(DEFAULT_CATALOG_NAME, dbName, tblName2); tbl.setOwnerType(PrincipalType.ROLE); objectStore.alterTable(DEFAULT_CATALOG_NAME, dbName, tblName, tbl, null); tbl = objectStore.getTable(DEFAULT_CATALOG_NAME, dbName, tblName);
Table tbl = createTestTbl(dbName, tblName, tblOwner, cols, ptnCols); objectStore.createTable(tbl); tbl = objectStore.getTable(DEFAULT_CATALOG_NAME, dbName, tblName);
@Override public Table getTable(String dbName, String tableName) throws MetaException { Table table = super.getTable(dbName, tableName); if (table == null || filterTables(dbName, Lists.newArrayList(tableName)).isEmpty()) { return null; } return table; }
@Override public Table markPartitionForEvent(String dbName, String tblName, Map<String,String> partName, PartitionEventType evtType) throws MetaException, UnknownTableException, InvalidPartitionException, UnknownPartitionException { LOG.debug("Begin executing markPartitionForEvent"); boolean success = false; Table tbl = null; try{ openTransaction(); tbl = getTable(dbName, tblName); // Make sure dbName and tblName are valid. if(null == tbl) { throw new UnknownTableException("Table: "+ tblName + " is not found."); } pm.makePersistent(new MPartitionEvent(dbName,tblName,getPartitionStr(tbl, partName), evtType.getValue())); success = commitTransaction(); LOG.debug("Done executing markPartitionForEvent"); } finally { if(!success) { rollbackTransaction(); } } return tbl; }
@Override public Table markPartitionForEvent(String dbName, String tblName, Map<String,String> partName, PartitionEventType evtType) throws MetaException, UnknownTableException, InvalidPartitionException, UnknownPartitionException { LOG.debug("Begin executing markPartitionForEvent"); boolean success = false; Table tbl = null; try{ openTransaction(); tbl = getTable(dbName, tblName); // Make sure dbName and tblName are valid. if(null == tbl) { throw new UnknownTableException("Table: "+ tblName + " is not found."); } pm.makePersistent(new MPartitionEvent(dbName,tblName,getPartitionStr(tbl, partName), evtType.getValue())); success = commitTransaction(); LOG.debug("Done executing markPartitionForEvent"); } finally { if(!success) { rollbackTransaction(); } } return tbl; }
@Override public Table markPartitionForEvent(String dbName, String tblName, Map<String,String> partName, PartitionEventType evtType) throws MetaException, UnknownTableException, InvalidPartitionException, UnknownPartitionException { LOG.debug("Begin executing markPartitionForEvent"); boolean success = false; Table tbl = null; try{ openTransaction(); tbl = getTable(dbName, tblName); // Make sure dbName and tblName are valid. if(null == tbl) { throw new UnknownTableException("Table: "+ tblName + " is not found."); } pm.makePersistent(new MPartitionEvent(dbName,tblName,getPartitionStr(tbl, partName), evtType.getValue())); success = commitTransaction(); LOG.debug("Done executing markPartitionForEvent"); } finally { if(!success) { rollbackTransaction(); } } return tbl; }