本文整理汇总了Java中org.apache.hadoop.hive.metastore.api.ColumnStatisticsDesc.setDbName方法的典型用法代码示例。如果您正苦于以下问题:Java ColumnStatisticsDesc.setDbName方法的具体用法?Java ColumnStatisticsDesc.setDbName怎么用?Java ColumnStatisticsDesc.setDbName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hive.metastore.api.ColumnStatisticsDesc
的用法示例。
在下文中一共展示了ColumnStatisticsDesc.setDbName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transformInboundSetPartitionStatsRequest
import org.apache.hadoop.hive.metastore.api.ColumnStatisticsDesc; //导入方法依赖的package包/类
@Test
public void transformInboundSetPartitionStatsRequest() throws Exception {
SetPartitionsStatsRequest setPartitionsStatsRequest = new SetPartitionsStatsRequest();
ColumnStatistics columnStatistics = new ColumnStatistics();
ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc();
statsDesc.setDbName(DB_NAME);
columnStatistics.setStatsDesc(statsDesc);
setPartitionsStatsRequest.setColStats(Lists.newArrayList(columnStatistics));
SetPartitionsStatsRequest result = databaseMapping
.transformInboundSetPartitionStatsRequest(setPartitionsStatsRequest);
assertThat(result, is(sameInstance(setPartitionsStatsRequest)));
ColumnStatistics resultColStats = result.getColStats().get(0);
assertThat(resultColStats, is(sameInstance(columnStatistics)));
assertThat(resultColStats.getStatsDesc(), is(sameInstance(statsDesc)));
assertThat(resultColStats.getStatsDesc().getDbName(), is(IN_DB_NAME));
}
示例2: setColumnStatistics
import org.apache.hadoop.hive.metastore.api.ColumnStatisticsDesc; //导入方法依赖的package包/类
private void setColumnStatistics(TableName tableName, TableStatistics tableStatistics, Table table, Predicate<FieldSchema> fieldsPredicate)
throws TException
{
ColumnStatisticsDesc hiveColumnStatisticsDesc = new ColumnStatisticsDesc();
hiveColumnStatisticsDesc.setIsTblLevel(false);
hiveColumnStatisticsDesc.setDbName(getSchema(tableName));
hiveColumnStatisticsDesc.setTableName(tableName.getSchemalessNameInDatabase());
List<ColumnStatisticsObj> hiveColumnStatisticsObjs = table.getSd().getCols().stream()
.filter(fieldsPredicate)
.map(fieldSchema -> toHiveColumnStatistics(fieldSchema, tableStatistics.getColumns().get(fieldSchema.getName())))
.collect(toList());
org.apache.hadoop.hive.metastore.api.ColumnStatistics hiveColumnStatistics = new org.apache.hadoop.hive.metastore.api.ColumnStatistics();
hiveColumnStatistics.setStatsDesc(hiveColumnStatisticsDesc);
hiveColumnStatistics.setStatsObj(hiveColumnStatisticsObjs);
client.update_table_column_statistics(hiveColumnStatistics);
}
示例3: transformInboundColumnStatistics
import org.apache.hadoop.hive.metastore.api.ColumnStatisticsDesc; //导入方法依赖的package包/类
@Test
public void transformInboundColumnStatistics() throws Exception {
ColumnStatistics columnStatistics = new ColumnStatistics();
ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc();
statsDesc.setDbName(DB_NAME);
columnStatistics.setStatsDesc(statsDesc);
ColumnStatistics result = databaseMapping.transformInboundColumnStatistics(columnStatistics);
assertThat(result, is(sameInstance(columnStatistics)));
assertThat(result.getStatsDesc(), is(sameInstance(columnStatistics.getStatsDesc())));
assertThat(result.getStatsDesc().getDbName(), is(IN_DB_NAME));
}
示例4: transformOutboundColumnStatistics
import org.apache.hadoop.hive.metastore.api.ColumnStatisticsDesc; //导入方法依赖的package包/类
@Test
public void transformOutboundColumnStatistics() throws Exception {
ColumnStatistics columnStatistics = new ColumnStatistics();
ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc();
statsDesc.setDbName(DB_NAME);
columnStatistics.setStatsDesc(statsDesc);
ColumnStatistics result = databaseMapping.transformOutboundColumnStatistics(columnStatistics);
assertThat(result, is(sameInstance(columnStatistics)));
assertThat(result.getStatsDesc(), is(sameInstance(columnStatistics.getStatsDesc())));
assertThat(result.getStatsDesc().getDbName(), is(OUT_DB_NAME));
}