本文整理了Java中org.apache.hadoop.hive.ql.metadata.Hive.alterPartitions()
方法的一些代码示例,展示了Hive.alterPartitions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hive.alterPartitions()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.metadata.Hive
类名称:Hive
方法名:alterPartitions
[英]Updates the existing table metadata with the new metadata.
[中]使用新元数据更新现有表元数据。
代码示例来源:origin: apache/drill
private int updatePartitions(Hive db) throws InvalidOperationException, HiveException {
if (!partUpdates.isEmpty()) {
List<Partition> updatedParts = Lists.newArrayList(partUpdates.values());
if (updatedParts.contains(null) && work.isStatsReliable()) {
LOG.debug("Stats requested to be reliable. Empty stats found and hence failing the task.");
return -1;
} else {
LOG.debug("Bulk updating partitions..");
EnvironmentContext environmentContext = new EnvironmentContext();
environmentContext.putToProperties(StatsSetupConst.STATS_GENERATED, StatsSetupConst.TASK);
db.alterPartitions(tableFullName, Lists.newArrayList(partUpdates.values()),
environmentContext);
LOG.debug("Bulk updated " + partUpdates.values().size() + " partitions.");
}
}
return 0;
}
代码示例来源:origin: apache/hive
if (values.get(0).result instanceof Partition) {
List<Partition> results = Lists.transform(values, FooterStatCollector.EXTRACT_RESULT_FUNCTION);
db.alterPartitions(tableFullName, results, environmentContext, true);
LOG.debug("Bulk updated {} partitions of {}.", results.size(), tableFullName);
} else {
代码示例来源:origin: apache/hive
db.alterPartitions(tableFullName, updates, environmentContext, true);
代码示例来源:origin: apache/drill
db.alterTable(alterTbl.getOldName(), tbl, alterTbl.getIsCascade(), alterTbl.getEnvironmentContext());
} else {
db.alterPartitions(tbl.getTableName(), allPartitions, alterTbl.getEnvironmentContext());
代码示例来源:origin: apache/hive
db.alterPartitions(Warehouse.getQualifiedName(tbl.getTTable()), allPartitions, environmentContext, isTxn);
代码示例来源:origin: apache/drill
db.alterPartitions(tableFullName, updates, environmentContext);
代码示例来源:origin: com.facebook.presto.hive/hive-apache
private int updatePartitions() throws InvalidOperationException, HiveException {
if (!partUpdates.isEmpty()) {
List<Partition> updatedParts = Lists.newArrayList(partUpdates.values());
if (updatedParts.contains(null) && work.isStatsReliable()) {
LOG.debug("Stats requested to be reliable. Empty stats found and hence failing the task.");
return -1;
} else {
LOG.debug("Bulk updating partitions..");
db.alterPartitions(tableFullName, Lists.newArrayList(partUpdates.values()));
LOG.debug("Bulk updated " + partUpdates.values().size() + " partitions.");
}
}
return 0;
}
代码示例来源:origin: apache/lens
/**
* Update existing partitions
* @param client hive client instance
* @param fact fact name
* @param partitions partitions to be updated
* @throws InvalidOperationException
* @throws HiveException
*/
public void updatePartitions(String storageTable, Hive client, String fact, List<Partition> partitions)
throws InvalidOperationException, HiveException {
boolean success = false;
try {
client.alterPartitions(storageTable, partitions, null);
success = true;
} finally {
if (success) {
commitUpdatePartition(partitions);
} else {
rollbackUpdatePartition(partitions);
}
}
}
代码示例来源:origin: org.apache.lens/lens-cube
/**
* Update existing partitions
* @param client hive client instance
* @param fact fact name
* @param partitions partitions to be updated
* @throws InvalidOperationException
* @throws HiveException
*/
public void updatePartitions(String storageTable, Hive client, String fact, List<Partition> partitions)
throws InvalidOperationException, HiveException {
boolean success = false;
try {
client.alterPartitions(storageTable, partitions, null);
success = true;
} finally {
if (success) {
commitUpdatePartition(partitions);
} else {
rollbackUpdatePartition(partitions);
}
}
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
db.alterTable(alterTbl.getOldName(), tbl, alterTbl.getIsCascade());
} else {
db.alterPartitions(tbl.getTableName(), allPartitions);
代码示例来源:origin: com.facebook.presto.hive/hive-apache
db.alterPartitions(tableFullName, updates);
内容来源于网络,如有侵权,请联系作者删除!