本文整理了Java中org.apache.hadoop.hive.ql.metadata.Hive.setPartitionColumnStatistics()
方法的一些代码示例,展示了Hive.setPartitionColumnStatistics()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hive.setPartitionColumnStatistics()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.metadata.Hive
类名称:Hive
方法名:setPartitionColumnStatistics
暂无
代码示例来源:origin: apache/drill
private int persistColumnStats(Hive db) throws HiveException, MetaException, IOException {
List<ColumnStatistics> colStats = new ArrayList<>();
colStats.add(constructColumnStatsFromInput());
SetPartitionsStatsRequest request = new SetPartitionsStatsRequest(colStats);
db.setPartitionColumnStatistics(request);
return 0;
}
代码示例来源:origin: apache/drill
private int persistColumnStats(Hive db) throws HiveException, MetaException, IOException {
// Construct a column statistics object from the result
List<ColumnStatistics> colStats = constructColumnStatsFromPackedRows(db);
// Persist the column statistics object to the metastore
// Note, this function is shared for both table and partition column stats.
SetPartitionsStatsRequest request = new SetPartitionsStatsRequest(colStats);
if (work.getColStats() != null && work.getColStats().getNumBitVector() > 0) {
request.setNeedMerge(true);
}
db.setPartitionColumnStatistics(request);
return 0;
}
代码示例来源:origin: apache/hive
private int persistColumnStats(Hive db) throws HiveException, MetaException, IOException {
ColumnStatistics colStats = constructColumnStatsFromInput();
ColumnStatisticsDesc colStatsDesc = colStats.getStatsDesc();
// We do not support stats replication for a transactional table yet. If we are converting
// a non-transactional table to a transactional table during replication, we might get
// column statistics but we shouldn't update those.
if (work.getColStats() != null &&
AcidUtils.isTransactionalTable(getHive().getTable(colStatsDesc.getDbName(),
colStatsDesc.getTableName()))) {
LOG.debug("Skipped updating column stats for table " +
TableName.getDbTable(colStatsDesc.getDbName(), colStatsDesc.getTableName()) +
" because it is converted to a transactional table during replication.");
return 0;
}
SetPartitionsStatsRequest request =
new SetPartitionsStatsRequest(Collections.singletonList(colStats));
db.setPartitionColumnStatistics(request);
return 0;
}
代码示例来源:origin: apache/hive
public int persistColumnStats(Hive db, Table tbl) throws HiveException, MetaException, IOException {
// Construct a column statistics object from the result
List<ColumnStatistics> colStats = constructColumnStatsFromPackedRows(tbl);
// Persist the column statistics object to the metastore
// Note, this function is shared for both table and partition column stats.
if (colStats.isEmpty()) {
return 0;
}
SetPartitionsStatsRequest request = new SetPartitionsStatsRequest(colStats);
request.setNeedMerge(colStatDesc.isNeedMerge());
HiveTxnManager txnMgr = AcidUtils.isTransactionalTable(tbl)
? SessionState.get().getTxnMgr() : null;
if (txnMgr != null) {
request.setValidWriteIdList(AcidUtils.getTableValidWriteIdList(conf,
AcidUtils.getFullTableName(tbl.getDbName(), tbl.getTableName())).toString());
request.setWriteId(txnMgr.getAllocatedTableWriteId(tbl.getDbName(), tbl.getTableName()));
}
db.setPartitionColumnStatistics(request);
return 0;
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
private int persistPartitionStats() throws HiveException, MetaException, IOException {
// Fetch result of the analyze table partition (p1=c1).. compute statistics for columns ..
// Construct a column statistics object from the result
List<ColumnStatistics> colStats = constructColumnStatsFromPackedRows();
// Persist the column statistics object to the metastore
db.setPartitionColumnStatistics(new SetPartitionsStatsRequest(colStats));
return 0;
}
内容来源于网络,如有侵权,请联系作者删除!