private IMetaStoreClient getMSC() throws HiveException { try { return hive.getMSC(); } catch (MetaException ex) { throw new HiveException(ex); } }
/** * Get the parameter map of the Entity. */ public Map<String, String> getParameters() { if (p != null) { return p.getParameters(); } else { return t.getParameters(); } }
public void alterTable(Table newTbl, boolean cascade, EnvironmentContext environmentContext, boolean transactional) throws HiveException { alterTable(newTbl.getCatName(), newTbl.getDbName(), newTbl.getTableName(), newTbl, cascade, environmentContext, transactional); }
/** * Removes the materialized view from the cache. * * @param materializedViewTable the materialized view to remove */ public void dropMaterializedView(Table materializedViewTable) { dropMaterializedView(materializedViewTable.getDbName(), materializedViewTable.getTableName()); }
@Nullable public StorageHandlerInfo getStorageHandlerInfo(Table table) throws HiveException { try { HiveStorageHandler storageHandler = createStorageHandler(table.getTTable()); return storageHandler == null ? null : storageHandler.getStorageHandlerInfo(table.getTTable()); } catch (Exception e) { throw new HiveException(e); } } }
public void setBucketNum(final int bucketNum) throws HiveException{ this.bucketNum = bucketNum; if (bucketNumSet) { throw new HiveException("Bucket number is already set"); } bucketNumSet = true; }
/** * @return include the db name */ public String getCompleteName() { return getTable().getCompleteName() + "@" + getName(); }
/** * Test basic Hive class interaction, that: * - We can have different Hive objects throughout the lifetime of this thread. */ public void testHiveCloseCurrent() throws Throwable { Hive hive1 = Hive.get(); Hive.closeCurrent(); Hive hive2 = Hive.get(); Hive.closeCurrent(); assertTrue(hive1 != hive2); }
private void checkMmLb(Partition part) throws HiveException { if (!part.isStoredAsSubDirectories()) { return; } throw new HiveException("Converting list bucketed tables stored as subdirectories " + " to MM is not supported. Please re-create a table in the desired format."); }
private void checkMmLb(Table tbl) throws HiveException { if (!tbl.isStoredAsSubDirectories()) { return; } // TODO [MM gap?]: by design; no-one seems to use LB tables. They will work, but not convert. // It's possible to work around this by re-creating and re-inserting the table. throw new HiveException("Converting list bucketed tables stored as subdirectories " + " to MM is not supported. Please re-create a table in the desired format."); }
private static boolean isLockableTable(Table t) { if (t.isTemporary()) { return false; } switch (t.getTableType()) { case MANAGED_TABLE: case MATERIALIZED_VIEW: return true; default: return false; } }
/** * Query metadata to see if a database with the given name already exists. * * @param dbName * @return true if a database with the given name already exists, false if * does not exist. * @throws HiveException */ public boolean databaseExists(String dbName) throws HiveException { return getDatabase(dbName) != null; }
@Override public org.apache.hadoop.hive.metastore.api.Table getTable(String catName, String dbName, String tableName) throws TException { return getTable(catName, dbName, tableName, false); }
/** * Get all tables for the specified database. * @param dbName * @return List of all tables * @throws HiveException */ public List<Table> getAllTableObjects(String dbName) throws HiveException { return getTableObjects(dbName, ".*", null); }
private void checkShutdown() throws HiveException { if (shutdown) { throw new HiveException("FAILED: Operation cancelled"); } } /**
/** * The base implementation must be overridden by the Decimal specialization */ @Override public Object writeValue(HiveDecimal value) throws HiveException { throw new HiveException("Internal error: should not reach here"); }
/** * The base implementation must be overridden by the Timestamp specialization */ @Override public Object writeValue(TimestampWritableV2 value) throws HiveException { throw new HiveException("Internal error: should not reach here"); }
/** * The base implementation must be overridden by the HiveIntervalDayTime specialization */ @Override public Object writeValue(HiveIntervalDayTimeWritable value) throws HiveException { throw new HiveException("Internal error: should not reach here"); }
/** * The base implementation must be overridden by the HiveIntervalDayTime specialization */ public Object setValue(Object field, HiveIntervalDayTimeWritable value) throws HiveException { throw new HiveException("Internal error: should not reach here"); }