try (HiveMetastoreClientPool.MultiClient multiClient = HiveMetastoreClientPool.safeGetClients(namedPools)) { if (multiClient.getClient(target_client).tableExists(this.targetDatabase, this.dataset.table.getTableName())) { this.existingTargetTable = Optional.of(new Table( multiClient.getClient(target_client).getTable(this.targetDatabase, this.dataset.table.getTableName()))); } else { this.existingTargetTable = Optional.absent(); this.sourcePartitions = HiveUtils.getPartitionsMap(multiClient.getClient(source_client), this.dataset.table, this.partitionFilter, this.hivePartitionExtendedFilter); HiveAvroCopyEntityHelper.updatePartitionAttributesIfAvro(this.targetTable, this.sourcePartitions, this); HiveUtils.getPartitionsMap(multiClient.getClient(target_client), this.existingTargetTable.get(), this.partitionFilter, this.hivePartitionExtendedFilter)) : Maps.<List<String>, Partition> newHashMap();
try (HiveMetastoreClientPool.MultiClient multiClient = HiveMetastoreClientPool.safeGetClients(namedPools)) { if (multiClient.getClient(target_client).tableExists(this.targetDatabase, this.dataset.table.getTableName())) { this.existingTargetTable = Optional.of(new Table( multiClient.getClient(target_client).getTable(this.targetDatabase, this.dataset.table.getTableName()))); } else { this.existingTargetTable = Optional.absent(); this.sourcePartitions = HiveUtils.getPartitionsMap(multiClient.getClient(source_client), this.dataset.table, this.partitionFilter, this.hivePartitionExtendedFilter); HiveAvroCopyEntityHelper.updatePartitionAttributesIfAvro(this.targetTable, this.sourcePartitions, this); HiveUtils.getPartitionsMap(multiClient.getClient(target_client), this.existingTargetTable.get(), this.partitionFilter, this.hivePartitionExtendedFilter)) : Maps.<List<String>, Partition> newHashMap();