當前位置: 首頁>>代碼示例>>Java>>正文


Java PartitionSpec類代碼示例

本文整理匯總了Java中org.apache.hadoop.hive.metastore.api.PartitionSpec的典型用法代碼示例。如果您正苦於以下問題:Java PartitionSpec類的具體用法?Java PartitionSpec怎麽用?Java PartitionSpec使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PartitionSpec類屬於org.apache.hadoop.hive.metastore.api包,在下文中一共展示了PartitionSpec類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: transformOutboundPartitionSpecs

import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入依賴的package包/類
@Override
public List<PartitionSpec> transformOutboundPartitionSpecs(List<PartitionSpec> partitionSpecs) {
  for (PartitionSpec partitionSpec : partitionSpecs) {
    transformOutboundPartitionSpec(partitionSpec);
  }
  return partitionSpecs;
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:8,代碼來源:DatabaseMappingImpl.java

示例3: 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

示例4: transformOutboundPartitionSpecs

import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入依賴的package包/類
@Test
public void transformOutboundPartitionSpecs() throws Exception {
  List<PartitionSpec> partitionSpecs = new ArrayList<>();
  partitionSpecs.add(partitionSpec);
  List<PartitionSpec> result = databaseMapping.transformOutboundPartitionSpecs(partitionSpecs);
  assertThat(result, is(sameInstance(partitionSpecs)));
  PartitionSpec resultSpec = result.get(0);
  assertThat(resultSpec, is(sameInstance(partitionSpec)));
  assertThat(resultSpec.getDbName(), is(OUT_DB_NAME));
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:11,代碼來源:DatabaseMappingImplTest.java

示例5: transformInboundPartitionSpecs

import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入依賴的package包/類
@Test
public void transformInboundPartitionSpecs() throws Exception {
  List<PartitionSpec> partitionSpecs = Lists.newArrayList(partitionSpec);
  List<PartitionSpec> result = databaseMapping.transformInboundPartitionSpecs(partitionSpecs);
  assertThat(result, is(sameInstance(partitionSpecs)));
  PartitionSpec resultSpec = result.get(0);
  assertThat(resultSpec, is(sameInstance(partitionSpec)));
  assertThat(resultSpec.getDbName(), is(IN_DB_NAME));
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:10,代碼來源:DatabaseMappingImplTest.java

示例6: 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

示例7: get_partitions_pspec

import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入依賴的package包/類
@Test
public void get_partitions_pspec() throws NoSuchObjectException, MetaException, TException {
  List<PartitionSpec> partitionSpecs = Lists.newArrayList();
  List<PartitionSpec> outbound = Lists.newArrayList();
  when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound");
  when(primaryClient.get_partitions_pspec("inbound", "table", (short) 10)).thenReturn(partitionSpecs);
  when(primaryMapping.transformOutboundPartitionSpecs(partitionSpecs)).thenReturn(outbound);
  List<PartitionSpec> result = handler.get_partitions_pspec(DB_P, "table", (short) 10);
  assertThat(result, is(outbound));
  verify(primaryMapping, never()).checkWritePermissions(DB_P);
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:12,代碼來源:FederatedHMSHandlerTest.java

示例8: get_part_specs_by_filter

import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public List<PartitionSpec> get_part_specs_by_filter(final String dbName, final String tblName,
                                                    final String filter, final int maxParts)
    throws TException {
    throw unimplemented("get_part_specs_by_filter", new Object[]{dbName, tblName, filter, maxParts});
}
 
開發者ID:Netflix,項目名稱:metacat,代碼行數:10,代碼來源:CatalogThriftHiveMetastore.java

示例9: 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

示例10: transformOutboundPartitionSpec

import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入依賴的package包/類
@Override
public PartitionSpec transformOutboundPartitionSpec(PartitionSpec request) {
  return request;
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:5,代碼來源:IdentityMapping.java

示例11: transformOutboundPartitionSpecs

import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入依賴的package包/類
@Override
public List<PartitionSpec> transformOutboundPartitionSpecs(List<PartitionSpec> partitionSpecs) {
  return partitionSpecs;
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:5,代碼來源:IdentityMapping.java

示例12: transformInboundPartitionSpecs

import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入依賴的package包/類
@Override
public List<PartitionSpec> transformInboundPartitionSpecs(List<PartitionSpec> partitionSpecs) {
  return partitionSpecs;
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:5,代碼來源:IdentityMapping.java

示例13: transformOutboundPartitionSpec

import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入依賴的package包/類
@Test
public void transformOutboundPartitionSpec() throws Exception {
  PartitionSpec partitionSpec = new PartitionSpec();
  PartitionSpec result = databaseMapping.transformOutboundPartitionSpec(partitionSpec);
  assertThat(result, is(sameInstance(partitionSpec)));
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:7,代碼來源:IdentityMappingTest.java

示例14: transformOutboundPartitionSpecs

import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入依賴的package包/類
@Test
public void transformOutboundPartitionSpecs() throws Exception {
  List<PartitionSpec> partitionSpecs = new ArrayList<>();
  List<PartitionSpec> result = databaseMapping.transformOutboundPartitionSpecs(partitionSpecs);
  assertThat(result, is(sameInstance(partitionSpecs)));
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:7,代碼來源:IdentityMappingTest.java

示例15: transformInboundPartitionSpecs

import org.apache.hadoop.hive.metastore.api.PartitionSpec; //導入依賴的package包/類
@Test
public void transformInboundPartitionSpecs() throws Exception {
  List<PartitionSpec> partitionSpecs = new ArrayList<>();
  List<PartitionSpec> result = databaseMapping.transformInboundPartitionSpecs(partitionSpecs);
  assertThat(result, is(sameInstance(partitionSpecs)));
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:7,代碼來源:IdentityMappingTest.java


注:本文中的org.apache.hadoop.hive.metastore.api.PartitionSpec類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。