本文整理汇总了Java中org.apache.hadoop.hive.metastore.api.Partition.getSd方法的典型用法代码示例。如果您正苦于以下问题:Java Partition.getSd方法的具体用法?Java Partition.getSd怎么用?Java Partition.getSd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hive.metastore.api.Partition
的用法示例。
在下文中一共展示了Partition.getSd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HivePartition
import org.apache.hadoop.hive.metastore.api.Partition; //导入方法依赖的package包/类
public HivePartition(Partition partition) {
if (partition == null) {
return;
}
this.partition = partition;
this.values = partition.getValues();
this.tableName = partition.getTableName();
this.dbName = partition.getDbName();
this.createTime = partition.getCreateTime();
this.lastAccessTime = partition.getLastAccessTime();
this.sd = new StorageDescriptorWrapper(partition.getSd());
this.parameters = partition.getParameters();
}
示例2: newReplicaPartition
import org.apache.hadoop.hive.metastore.api.Partition; //导入方法依赖的package包/类
Partition newReplicaPartition(
String eventId,
Table sourceTable,
Partition sourcePartition,
String replicaDatabaseName,
String replicaTableName,
Path replicaPartitionLocation,
ReplicationMode replicationMode) {
Partition replica = partitionTransformation.transform(new Partition(sourcePartition));
replica.setDbName(replicaDatabaseName);
replica.setTableName(replicaTableName);
if (replica.getSd() != null) {
replica.getSd().setLocation(toStringOrNull(replicaPartitionLocation));
}
String sourcePartitionLocation = sourcePartition.getSd() == null ? ""
: toStringOrEmpty(sourcePartition.getSd().getLocation());
// Statistic specific parameters
replica.putToParameters(STATS_GENERATED_VIA_STATS_TASK, Boolean.TRUE.toString());
replica.putToParameters(STATS_GENERATED, Boolean.TRUE.toString());
replica.putToParameters(DO_NOT_UPDATE_STATS, Boolean.TRUE.toString());
// Replication specific parameters
replica.putToParameters(LAST_REPLICATED.parameterName(), DateTime.now(DateTimeZone.UTC).toString());
replica.putToParameters(REPLICATION_EVENT.parameterName(), eventId);
replica.putToParameters(SOURCE_LOCATION.parameterName(), sourcePartitionLocation);
replica.putToParameters(SOURCE_TABLE.parameterName(), Warehouse.getQualifiedName(sourceTable));
replica.putToParameters(SOURCE_METASTORE.parameterName(), sourceMetaStoreUris);
replica.putToParameters(REPLICATION_MODE.parameterName(), replicationMode.name());
return replica;
}
示例3: hasLocation
import org.apache.hadoop.hive.metastore.api.Partition; //导入方法依赖的package包/类
/**
* @param partition
* @return {@code true} if the {@code partition} has location, {@code false} otherwise
*/
public static boolean hasLocation(Partition partition) {
return partition.getSd() != null && !Strings.isNullOrEmpty(partition.getSd().getLocation());
}