@Override public HCatPartition deserializePartition(String hcatPartitionStringRep) throws HCatException { HCatPartition hcatPartition = MetadataSerializer.get().deserializePartition(hcatPartitionStringRep); hcatPartition.hcatTable(getTable(hcatPartition.getDatabaseName(), hcatPartition.getTableName())); return hcatPartition; }
@Override public List<HCatPartition> getPartitions(String dbName, String tblName) throws HCatException { List<HCatPartition> hcatPtns = new ArrayList<HCatPartition>(); try { HCatTable hcatTable = getTable(dbName, tblName); List<Partition> hivePtns = hmsClient.listPartitions( checkDB(dbName), tblName, (short) -1); for (Partition ptn : hivePtns) { hcatPtns.add(new HCatPartition(hcatTable, ptn)); } } catch (NoSuchObjectException e) { throw new ObjectNotFoundException( "NoSuchObjectException while retrieving partition.", e); } catch (MetaException e) { throw new HCatException( "MetaException while retrieving partition.", e); } catch (TException e) { throw new ConnectionFailureException( "TException while retrieving partition.", e); } return hcatPtns; }
@Override public HCatPartitionSpec deserializePartitionSpec(List<String> hcatPartitionSpecStrings) throws HCatException { HCatPartitionSpec hcatPartitionSpec = MetadataSerializer.get() .deserializePartitionSpec(hcatPartitionSpecStrings); hcatPartitionSpec .hcatTable(getTable(hcatPartitionSpec.getDbName(), hcatPartitionSpec.getTableName())); return hcatPartitionSpec; } }
HCatPartition partition = null; try { HCatTable hcatTable = getTable(dbName, tableName); List<HCatFieldSchema> partitionColumns = hcatTable.getPartCols(); if (partitionColumns.size() != partitionSpec.size()) {
@Override public List<HCatPartition> listPartitionsByFilter(String dbName, String tblName, String filter) throws HCatException { List<HCatPartition> hcatPtns = new ArrayList<HCatPartition>(); try { HCatTable table = getTable(dbName, tblName); List<Partition> hivePtns = hmsClient.listPartitionsByFilter( table.getDbName(), table.getTableName(), filter, (short) -1); for (Partition ptn : hivePtns) { hcatPtns.add(new HCatPartition(table, ptn)); } } catch (MetaException e) { throw new HCatException("MetaException while fetching partitions.", e); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException( "NoSuchObjectException while fetching partitions.", e); } catch (TException e) { throw new ConnectionFailureException( "TException while fetching partitions.", e); } return hcatPtns; }
@Override @InterfaceAudience.LimitedPrivate({"Hive"}) @InterfaceStability.Evolving public HCatPartitionSpec getPartitionSpecs(String dbName, String tableName, int maxPartitions) throws HCatException { try { return new HCatPartitionSpec(getTable(dbName, tableName), hmsClient.listPartitionSpecs(dbName, tableName, maxPartitions)); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException( "NoSuchObjectException while retrieving partition.", e); } catch (MetaException e) { throw new HCatException( "MetaException while retrieving partition.", e); } catch (TException e) { throw new ConnectionFailureException( "TException while retrieving partition.", e); } }
@Override @InterfaceAudience.LimitedPrivate({"Hive"}) @InterfaceStability.Evolving public HCatPartitionSpec listPartitionSpecsByFilter(String dbName, String tblName, String filter, int maxPartitions) throws HCatException { try { return new HCatPartitionSpec(getTable(dbName, tblName), hmsClient.listPartitionSpecsByFilter(dbName, tblName, filter, maxPartitions)); } catch(MetaException e) { throw new HCatException("MetaException while fetching partitions.", e); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException( "NoSuchObjectException while fetching partitions.", e); } catch (TException e) { throw new ConnectionFailureException( "TException while fetching partitions.", e); } }
@Override public HCatPartition deserializePartition(String hcatPartitionStringRep) throws HCatException { HCatPartition hcatPartition = MetadataSerializer.get().deserializePartition(hcatPartitionStringRep); hcatPartition.hcatTable(getTable(hcatPartition.getDatabaseName(), hcatPartition.getTableName())); return hcatPartition; }
@Override public HCatPartitionSpec deserializePartitionSpec(List<String> hcatPartitionSpecStrings) throws HCatException { HCatPartitionSpec hcatPartitionSpec = MetadataSerializer.get() .deserializePartitionSpec(hcatPartitionSpecStrings); hcatPartitionSpec .hcatTable(getTable(hcatPartitionSpec.getDbName(), hcatPartitionSpec.getTableName())); return hcatPartitionSpec; } }
@Override public HCatPartitionSpec deserializePartitionSpec(List<String> hcatPartitionSpecStrings) throws HCatException { HCatPartitionSpec hcatPartitionSpec = MetadataSerializer.get() .deserializePartitionSpec(hcatPartitionSpecStrings); hcatPartitionSpec .hcatTable(getTable(hcatPartitionSpec.getDbName(), hcatPartitionSpec.getTableName())); return hcatPartitionSpec; } }
@Override public HCatPartition deserializePartition(String hcatPartitionStringRep) throws HCatException { HCatPartition hcatPartition = MetadataSerializer.get().deserializePartition(hcatPartitionStringRep); hcatPartition.hcatTable(getTable(hcatPartition.getDatabaseName(), hcatPartition.getTableName())); return hcatPartition; }
@Override public HCatPartitionSpec deserializePartitionSpec(List<String> hcatPartitionSpecStrings) throws HCatException { HCatPartitionSpec hcatPartitionSpec = MetadataSerializer.get() .deserializePartitionSpec(hcatPartitionSpecStrings); hcatPartitionSpec .hcatTable(getTable(hcatPartitionSpec.getDbName(), hcatPartitionSpec.getTableName())); return hcatPartitionSpec; } }
@Override public HCatPartition deserializePartition(String hcatPartitionStringRep) throws HCatException { HCatPartition hcatPartition = MetadataSerializer.get().deserializePartition(hcatPartitionStringRep); hcatPartition.hcatTable(getTable(hcatPartition.getDatabaseName(), hcatPartition.getTableName())); return hcatPartition; }
@Override public List<HCatPartition> listPartitionsByFilter(String dbName, String tblName, String filter) throws HCatException { List<HCatPartition> hcatPtns = new ArrayList<HCatPartition>(); try { HCatTable table = getTable(dbName, tblName); List<Partition> hivePtns = hmsClient.listPartitionsByFilter( table.getDbName(), table.getTableName(), filter, (short) -1); for (Partition ptn : hivePtns) { hcatPtns.add(new HCatPartition(table, ptn)); } } catch (MetaException e) { throw new HCatException("MetaException while fetching partitions.", e); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException( "NoSuchObjectException while fetching partitions.", e); } catch (TException e) { throw new ConnectionFailureException( "TException while fetching partitions.", e); } return hcatPtns; }
@Override @InterfaceAudience.LimitedPrivate({"Hive"}) @InterfaceStability.Evolving public HCatPartitionSpec getPartitionSpecs(String dbName, String tableName, int maxPartitions) throws HCatException { try { return new HCatPartitionSpec(getTable(dbName, tableName), hmsClient.listPartitionSpecs(dbName, tableName, maxPartitions)); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException( "NoSuchObjectException while retrieving partition.", e); } catch (MetaException e) { throw new HCatException( "MetaException while retrieving partition.", e); } catch (TException e) { throw new ConnectionFailureException( "TException while retrieving partition.", e); } }
@Override @InterfaceAudience.LimitedPrivate({"Hive"}) @InterfaceStability.Evolving public HCatPartitionSpec getPartitionSpecs(String dbName, String tableName, int maxPartitions) throws HCatException { try { return new HCatPartitionSpec(getTable(dbName, tableName), hmsClient.listPartitionSpecs(dbName, tableName, maxPartitions)); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException( "NoSuchObjectException while retrieving partition.", e); } catch (MetaException e) { throw new HCatException( "MetaException while retrieving partition.", e); } catch (TException e) { throw new ConnectionFailureException( "TException while retrieving partition.", e); } }
@Override @InterfaceAudience.LimitedPrivate({"Hive"}) @InterfaceStability.Evolving public HCatPartitionSpec getPartitionSpecs(String dbName, String tableName, int maxPartitions) throws HCatException { try { return new HCatPartitionSpec(getTable(dbName, tableName), hmsClient.listPartitionSpecs(dbName, tableName, maxPartitions)); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException( "NoSuchObjectException while retrieving partition.", e); } catch (MetaException e) { throw new HCatException( "MetaException while retrieving partition.", e); } catch (TException e) { throw new ConnectionFailureException( "TException while retrieving partition.", e); } }
@Override @InterfaceAudience.LimitedPrivate({"Hive"}) @InterfaceStability.Evolving public HCatPartitionSpec listPartitionSpecsByFilter(String dbName, String tblName, String filter, int maxPartitions) throws HCatException { try { return new HCatPartitionSpec(getTable(dbName, tblName), hmsClient.listPartitionSpecsByFilter(dbName, tblName, filter, maxPartitions)); } catch(MetaException e) { throw new HCatException("MetaException while fetching partitions.", e); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException( "NoSuchObjectException while fetching partitions.", e); } catch (TException e) { throw new ConnectionFailureException( "TException while fetching partitions.", e); } }
@Override @InterfaceAudience.LimitedPrivate({"Hive"}) @InterfaceStability.Evolving public HCatPartitionSpec listPartitionSpecsByFilter(String dbName, String tblName, String filter, int maxPartitions) throws HCatException { try { return new HCatPartitionSpec(getTable(dbName, tblName), hmsClient.listPartitionSpecsByFilter(dbName, tblName, filter, maxPartitions)); } catch(MetaException e) { throw new HCatException("MetaException while fetching partitions.", e); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException( "NoSuchObjectException while fetching partitions.", e); } catch (TException e) { throw new ConnectionFailureException( "TException while fetching partitions.", e); } }
@Override @InterfaceAudience.LimitedPrivate({"Hive"}) @InterfaceStability.Evolving public HCatPartitionSpec listPartitionSpecsByFilter(String dbName, String tblName, String filter, int maxPartitions) throws HCatException { try { return new HCatPartitionSpec(getTable(dbName, tblName), hmsClient.listPartitionSpecsByFilter(dbName, tblName, filter, maxPartitions)); } catch(MetaException e) { throw new HCatException("MetaException while fetching partitions.", e); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException( "NoSuchObjectException while fetching partitions.", e); } catch (TException e) { throw new ConnectionFailureException( "TException while fetching partitions.", e); } }