本文整理匯總了Java中org.apache.hadoop.hive.metastore.api.PartitionSpec.setDbName方法的典型用法代碼示例。如果您正苦於以下問題:Java PartitionSpec.setDbName方法的具體用法?Java PartitionSpec.setDbName怎麽用?Java PartitionSpec.setDbName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.hive.metastore.api.PartitionSpec
的用法示例。
在下文中一共展示了PartitionSpec.setDbName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setUp
import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入方法依賴的package包/類
@Before
public void setUp() {
databaseMapping = new DatabaseMappingImpl(metastoreMapping);
database = new Database();
database.setName(DB_NAME);
partition = new Partition();
partition.setDbName(DB_NAME);
partitions = Lists.newArrayList(partition);
index = new Index();
index.setDbName(DB_NAME);
hiveObjectRef = new HiveObjectRef();
hiveObjectRef.setDbName(DB_NAME);
hiveObjectRef.setObjectType(HiveObjectType.DATABASE);
hiveObjectRef.setObjectName(DB_NAME);
hiveObjectPrivileges = new ArrayList<>();
HiveObjectPrivilege hiveObjectPrivilege = new HiveObjectPrivilege();
hiveObjectPrivilege.setHiveObject(hiveObjectRef);
hiveObjectPrivileges.add(hiveObjectPrivilege);
partitionSpec = new PartitionSpec();
partitionSpec.setDbName(DB_NAME);
when(metastoreMapping.transformInboundDatabaseName(DB_NAME)).thenReturn(IN_DB_NAME);
when(metastoreMapping.transformOutboundDatabaseName(DB_NAME)).thenReturn(OUT_DB_NAME);
}
示例2: transformInboundPartitionSpecs
import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入方法依賴的package包/類
@Override
public List<PartitionSpec> transformInboundPartitionSpecs(List<PartitionSpec> partitionSpecs) {
for (PartitionSpec partitionSpec : partitionSpecs) {
partitionSpec.setDbName(metaStoreMapping.transformInboundDatabaseName(partitionSpec.getDbName()));
}
return partitionSpecs;
}
示例3: add_partitions_pspec
import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入方法依賴的package包/類
@Test
public void add_partitions_pspec() throws InvalidObjectException, AlreadyExistsException, MetaException, TException {
PartitionSpec newPartitionPSpec1 = new PartitionSpec();
newPartitionPSpec1.setDbName(DB_P);
PartitionSpec newPartitionPspec2 = new PartitionSpec();
newPartitionPspec2.setDbName(DB_P);
List<PartitionSpec> inbound = Lists.newArrayList(new PartitionSpec());
List<PartitionSpec> partitionsPspec = Lists.newArrayList(newPartitionPSpec1, newPartitionPspec2);
when(primaryMapping.transformInboundPartitionSpecs(partitionsPspec)).thenReturn(inbound);
when(primaryClient.add_partitions_pspec(inbound)).thenReturn(2);
int result = handler.add_partitions_pspec(partitionsPspec);
assertThat(result, is(2));
verify(primaryMapping, times(2)).checkWritePermissions(DB_P);
}
示例4: transformOutboundPartitionSpec
import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入方法依賴的package包/類
@Override
public PartitionSpec transformOutboundPartitionSpec(PartitionSpec partitionSpec) {
partitionSpec.setDbName(metaStoreMapping.transformOutboundDatabaseName(partitionSpec.getDbName()));
return partitionSpec;
}