private List<Table> deepCopyTables(List<Table> tables) { List<Table> copy = null; if (tables != null) { copy = new ArrayList<Table>(); for (Table tab : tables) { copy.add(deepCopy(tab)); } } return copy; }
protected List<FieldSchema> deepCopyFieldSchemas(List<FieldSchema> schemas) { List<FieldSchema> copy = null; if (schemas != null) { copy = new ArrayList<FieldSchema>(); for (FieldSchema schema : schemas) { copy.add(deepCopy(schema)); } } return copy; }
private List<Partition> deepCopyPartitions( Collection<Partition> src, List<Partition> dest) { if (src == null) { return dest; } if (dest == null) { dest = new ArrayList<Partition>(src.size()); } for (Partition part : src) { dest.add(deepCopy(part)); } return dest; }
public Partition appendPartitionByName(String dbName, String tableName, String partName, EnvironmentContext envContext) throws InvalidObjectException, AlreadyExistsException, MetaException, TException { Partition p = client.append_partition_by_name_with_environment_context(dbName, tableName, partName, envContext); return fastpath ? p : deepCopy(p); }
public Partition appendPartition(String db_name, String table_name, List<String> part_vals, EnvironmentContext envContext) throws TException { Partition p = client.append_partition_with_environment_context(db_name, table_name, part_vals, envContext); return fastpath ? p : deepCopy(p); }
public Partition appendPartition(String dbName, String tableName, String partName, EnvironmentContext envContext) throws TException { Partition p = client.append_partition_by_name_with_environment_context(dbName, tableName, partName, envContext); return fastpath ? p : deepCopy(p); }
public Partition add_partition(Partition new_part, EnvironmentContext envContext) throws TException { Partition p = client.add_partition_with_environment_context(new_part, envContext); return fastpath ? p : deepCopy(p); }
/** * @param name * @return the type * @throws MetaException * @throws TException * @throws NoSuchObjectException * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#get_type(java.lang.String) */ public Type getType(String name) throws NoSuchObjectException, MetaException, TException { return deepCopy(client.get_type(name)); }
@Override public Function getFunction(String dbName, String funcName) throws MetaException, TException { Function f = client.get_function(dbName, funcName); return fastpath ? f : deepCopy(f); }
/** * @param name * @return map of types * @throws MetaException * @throws TException * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#get_type_all(java.lang.String) */ public Map<String, Type> getTypeAll(String name) throws MetaException, TException { Map<String, Type> result = null; Map<String, Type> fromClient = client.get_type_all(name); if (fromClient != null) { result = new LinkedHashMap<>(); for (String key : fromClient.keySet()) { result.put(key, deepCopy(fromClient.get(key))); } } return result; }
@Override public Partition getPartitionWithAuthInfo(String db_name, String tbl_name, List<String> part_vals, String user_name, List<String> group_names) throws MetaException, UnknownTableException, NoSuchObjectException, TException { Partition p = client.get_partition_with_auth(db_name, tbl_name, part_vals, user_name, group_names); return fastpath ? p : deepCopy(filterHook.filterPartition(p)); }
@Override public Partition getPartition(String db, String tableName, String partName) throws MetaException, TException, UnknownTableException, NoSuchObjectException { Partition p = client.get_partition_by_name(db, tableName, partName); return fastpath ? p : deepCopy(filterHook.filterPartition(p)); }
/** * @param name * @return the database * @throws NoSuchObjectException * @throws MetaException * @throws TException * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#get_database(java.lang.String) */ @Override public Database getDatabase(String name) throws NoSuchObjectException, MetaException, TException { Database d = client.get_database(name); return fastpath ? d :deepCopy(filterHook.filterDatabase(d)); }
/** * @param tbl_name * @param db_name * @param part_vals * @return the partition * @throws MetaException * @throws TException * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#get_partition(java.lang.String, * java.lang.String, java.util.List) */ @Override public Partition getPartition(String db_name, String tbl_name, List<String> part_vals) throws NoSuchObjectException, MetaException, TException { Partition p = client.get_partition(db_name, tbl_name, part_vals); return fastpath ? p : deepCopy(filterHook.filterPartition(p)); }
/** * @param name * @param dbname * @return the table * @throws NoSuchObjectException * @throws MetaException * @throws TException * @throws NoSuchObjectException * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#get_table(java.lang.String, * java.lang.String) */ @Override public Table getTable(String dbname, String name) throws MetaException, TException, NoSuchObjectException { GetTableRequest req = new GetTableRequest(dbname, name); req.setCapabilities(version); Table t = client.get_table_req(req).getTable(); return fastpath ? t : deepCopy(filterHook.filterTable(t)); }