use of org.apache.gobblin.data.management.conversion.hive.entities.HiveProcessingEntity in project incubator-gobblin by apache.
the class HiveMaterializerFromEntityQueryGenerator method getConversionEntity.
private HiveProcessingEntity getConversionEntity(HiveWorkUnit hiveWorkUnit) throws IOException, TException, HiveException {
try (AutoReturnableObject<IMetaStoreClient> client = this.pool.getClient()) {
HiveDataset dataset = hiveWorkUnit.getHiveDataset();
HiveDatasetFinder.DbAndTable dbAndTable = dataset.getDbAndTable();
Table table = new Table(client.get().getTable(dbAndTable.getDb(), dbAndTable.getTable()));
Partition partition = null;
if (hiveWorkUnit.getPartitionName().isPresent()) {
partition = new Partition(table, client.get().getPartition(dbAndTable.getDb(), dbAndTable.getTable(), hiveWorkUnit.getPartitionName().get()));
}
return new HiveProcessingEntity(dataset, table, Optional.fromNullable(partition));
}
}
Aggregations