当前位置: 首页>>代码示例>>Java>>正文


Java PartitionSpec.setDbName方法代码示例

本文整理汇总了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);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:24,代码来源:DatabaseMappingImplTest.java

示例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;
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:8,代码来源:DatabaseMappingImpl.java

示例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);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:15,代码来源:FederatedHMSHandlerTest.java

示例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;
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:6,代码来源:DatabaseMappingImpl.java


注:本文中的org.apache.hadoop.hive.metastore.api.PartitionSpec.setDbName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。