private List<Partition> deepCopyPartitions(List<Partition> partitions) { return deepCopyPartitions(partitions, null); }
@Override public List<Partition> listPartitionsWithAuthInfo(String db_name, String tbl_name, short max_parts, String user_name, List<String> group_names) throws NoSuchObjectException, MetaException, TException { List<Partition> parts = client.get_partitions_with_auth(db_name, tbl_name, max_parts, user_name, group_names); return fastpath ? parts :deepCopyPartitions(filterHook.filterPartitions(parts)); }
@Override public List<Partition> listPartitionsWithAuthInfo(String db_name, String tbl_name, List<String> part_vals, short max_parts, String user_name, List<String> group_names) throws NoSuchObjectException, MetaException, TException { List<Partition> parts = client.get_partitions_ps_with_auth(db_name, tbl_name, part_vals, max_parts, user_name, group_names); return fastpath ? parts : deepCopyPartitions(filterHook.filterPartitions(parts)); }
@Override public List<Partition> listPartitions(String db_name, String tbl_name, List<String> part_vals, short max_parts) throws NoSuchObjectException, MetaException, TException { List<Partition> parts = client.get_partitions_ps(db_name, tbl_name, part_vals, max_parts); return fastpath ? parts : deepCopyPartitions(filterHook.filterPartitions(parts)); }
/** * @param tbl_name * @param db_name * @param max_parts * @return list of partitions * @throws NoSuchObjectException * @throws MetaException * @throws TException */ @Override public List<Partition> listPartitions(String db_name, String tbl_name, short max_parts) throws NoSuchObjectException, MetaException, TException { List<Partition> parts = client.get_partitions(db_name, tbl_name, max_parts); return fastpath ? parts : deepCopyPartitions(filterHook.filterPartitions(parts)); }
/** * Get list of partitions matching specified filter * @param db_name the database name * @param tbl_name the table name * @param filter the filter string, * for example "part1 = \"p1_abc\" and part2 <= "\p2_test\"". Filtering can * be done only on string partition keys. * @param max_parts the maximum number of partitions to return, * all partitions are returned if -1 is passed * @return list of partitions * @throws MetaException * @throws NoSuchObjectException * @throws TException */ @Override public List<Partition> listPartitionsByFilter(String db_name, String tbl_name, String filter, short max_parts) throws MetaException, NoSuchObjectException, TException { List<Partition> parts = client.get_partitions_by_filter(db_name, tbl_name, filter, max_parts); return fastpath ? parts :deepCopyPartitions(filterHook.filterPartitions(parts)); }
@Override public List<Partition> getPartitionsByNames(String db_name, String tbl_name, List<String> part_names, boolean get_col_stats) throws NoSuchObjectException, MetaException, TException { GetPartitionsByNamesRequest gpbnr = new GetPartitionsByNamesRequest(db_name, tbl_name); gpbnr.setNames(part_names); gpbnr.setGet_col_stats(get_col_stats); List<Partition> parts = client.get_partitions_by_names_req(gpbnr).getPartitions(); return fastpath ? parts : deepCopyPartitions(filterHook.filterPartitions(parts)); }
r.setPartitions(filterHook.filterPartitions(r.getPartitions())); deepCopyPartitions(r.getPartitions(), result);