org.apache.hadoop.hive.metastore.api.Table.getTableName()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(303)

本文整理了Java中org.apache.hadoop.hive.metastore.api.Table.getTableName()方法的一些代码示例,展示了Table.getTableName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getTableName()方法的具体详情如下:
包路径:org.apache.hadoop.hive.metastore.api.Table
类名称:Table
方法名:getTableName

Table.getTableName介绍

暂无

代码示例

代码示例来源:origin: apache/hive

private Scenario scenarioType(org.apache.hadoop.hive.metastore.api.Table before,
  org.apache.hadoop.hive.metastore.api.Table after) {
 if (before.getDbName().equals(after.getDbName())
   && before.getTableName().equals(after.getTableName())) {
  return isTruncateOp ? Scenario.TRUNCATE : Scenario.ALTER;
 } else {
  return Scenario.RENAME;
 }
}

代码示例来源:origin: apache/hive

@Test(expected = UnknownDBException.class)
public void getTableObjectsByNameBogusCatalog() throws TException {
 client.getTableObjectsByName("nosuch", testTables[0].getDbName(),
   Arrays.asList(testTables[0].getTableName(), testTables[1].getTableName()));
}

代码示例来源:origin: apache/hive

@Test(expected = InvalidObjectException.class)
public void testAppendPartitionByNameBogusCatalog() throws Exception {
 client.appendPartition("nosuch", DB_NAME, tableWithPartitions.getTableName(),
   "year=2017/month=april");
}

代码示例来源:origin: apache/hive

@Test(expected = MetaException.class)
public void testExchangePartitionsEmptyPartSpec() throws Exception {
 Map<String, String> partitionSpecs = new HashMap<>();
 client.exchange_partitions(partitionSpecs, sourceTable.getDbName(),
   sourceTable.getTableName(), destTable.getDbName(), destTable.getTableName());
}

代码示例来源:origin: apache/hive

@Test(expected = NoSuchObjectException.class)
public void testDropTableNoSuchDatabase() throws Exception {
 Table table = testTables[2];
 client.dropTable("no_such_database", table.getTableName(), true, false);
}

代码示例来源:origin: apache/hive

public T onTable(Table table) {
 this.catName = table.getCatName();
 this.dbName = table.getDbName();
 this.tableName = table.getTableName();
 return child;
}

代码示例来源:origin: apache/hive

@Test(expected = MetaException.class)
public void testExchangePartitionEmptyPartSpec() throws Exception {
 Map<String, String> partitionSpecs = new HashMap<>();
 client.exchange_partition(partitionSpecs, sourceTable.getDbName(),
   sourceTable.getTableName(), destTable.getDbName(), destTable.getTableName());
}

代码示例来源:origin: apache/hive

@Test(expected = NoSuchObjectException.class)
public void testDropTableNoSuchTableInTheDatabase() throws Exception {
 Table table = testTables[2];
 client.dropTable(OTHER_DATABASE, table.getTableName(), true, false);
}

代码示例来源:origin: apache/hive

public JSONCreateTableMessage(String server, String servicePrincipal, Table tableObj,
  Iterator<String> fileIter, Long timestamp) {
 this(server, servicePrincipal, tableObj.getDbName(), tableObj.getTableName(),
   tableObj.getTableType(), timestamp);
 try {
  this.tableObjJson = MessageBuilder.createTableObjJson(tableObj);
 } catch (TException e) {
  throw new IllegalArgumentException("Could not serialize: ", e);
 }
 this.files = (fileIter != null) ? Lists.newArrayList(fileIter) : Lists.newArrayList();
}

代码示例来源:origin: apache/hive

@Test(expected = MetaException.class)
public void testExchangePartitionsNonExistingValuesInPartSpec() throws Exception {
 Map<String, String> partitionSpecs = new HashMap<>();
 partitionSpecs.put("ev", "2017");
 partitionSpecs.put("honap", "march");
 partitionSpecs.put("nap", "22");
 client.exchange_partitions(partitionSpecs, sourceTable.getDbName(),
   sourceTable.getTableName(), destTable.getDbName(), destTable.getTableName());
}

代码示例来源:origin: apache/hive

@Test(expected = NoSuchObjectException.class)
public void testGetTableNoSuchTableInTheDatabase() throws Exception {
 Table table = testTables[2];
 client.getTable(OTHER_DATABASE, table.getTableName());
}

代码示例来源:origin: apache/hive

/**
 * Get table name in cat.db.table format.
 * @param table table object
 * @return fully qualified name.
 */
public static String getCatalogQualifiedTableName(Table table) {
 return TableName.getQualified(table.getCatName(), table.getDbName(), table.getTableName());
}

代码示例来源:origin: apache/hive

@Test(expected = MetaException.class)
public void testExchangePartitionNonExistingValuesInPartSpec() throws Exception {
 Map<String, String> partitionSpecs = new HashMap<>();
 partitionSpecs.put("ev", "2017");
 partitionSpecs.put("honap", "march");
 partitionSpecs.put("nap", "22");
 client.exchange_partition(partitionSpecs, sourceTable.getDbName(),
   sourceTable.getTableName(), destTable.getDbName(), destTable.getTableName());
}

代码示例来源:origin: apache/hive

@Test
public void testListTableNamesByFilterCheckCombined() throws Exception {
 // Combined: last_access<=3000 and (Owner="Tester" or param1="param2")
 String filter = hive_metastoreConstants.HIVE_FILTER_FIELD_LAST_ACCESS + "<3000 and ("
        + hive_metastoreConstants.HIVE_FILTER_FIELD_OWNER + "=\"Tester\" or "
        + hive_metastoreConstants.HIVE_FILTER_FIELD_PARAMS + "param1=\"value2\")";
 List<String> tableNames = client.listTableNamesByFilter(DEFAULT_DATABASE, filter, (short)-1);
 Assert.assertEquals("Found tables", 3, tableNames.size());
 Assert.assertTrue(tableNames.contains(testTables[1].getTableName()));
 Assert.assertTrue(tableNames.contains(testTables[2].getTableName()));
 Assert.assertTrue(tableNames.contains(testTables[4].getTableName()));
}

代码示例来源:origin: apache/hive

private static void removeTempTable(org.apache.hadoop.hive.metastore.api.Table t) {
 String qualifiedTableName = Warehouse.
   getQualifiedName(t.getDbName().toLowerCase(), t.getTableName().toLowerCase());
 SessionState ss = SessionState.get();
 if (ss == null) {
  LOG.warn("No current SessionState, skipping temp partitions for " + qualifiedTableName);
  return;
 }
 ss.getTempPartitions().remove(Warehouse.getQualifiedName(t));
}
private static void createTempTable(org.apache.hadoop.hive.metastore.api.Table t) {

代码示例来源:origin: apache/hive

@Test(expected = MetaException.class)
public void testExchangePartitionsNullSourceDB() throws Exception {
 Map<String, String> partitionSpecs = getPartitionSpec(partitions[1]);
 client.exchange_partitions(partitionSpecs, null, sourceTable.getTableName(),
   destTable.getDbName(), destTable.getTableName());
}

代码示例来源:origin: apache/hive

@Test
public void testListTableNamesByFilterCheckLastAccess() throws Exception {
 String filter = hive_metastoreConstants.HIVE_FILTER_FIELD_LAST_ACCESS + "=1000";
 List<String> tableNames = client.listTableNamesByFilter(DEFAULT_DATABASE, filter, (short)-1);
 Assert.assertEquals("Found tables", 2, tableNames.size());
 Assert.assertTrue(tableNames.contains(testTables[0].getTableName()));
 Assert.assertTrue(tableNames.contains(testTables[2].getTableName()));
}

代码示例来源:origin: apache/hive

@Override
public DropPartitionMessage buildDropPartitionMessage(Table table, Iterator<Partition> partitions) {
 return new JSONDropPartitionMessage(HCAT_SERVER_URL, HCAT_SERVICE_PRINCIPAL, table.getDbName(),
   table.getTableName(), table.getTableType(),
   MessageBuilder.getPartitionKeyValues(table, partitions), now());
}

代码示例来源:origin: apache/hive

@Test(expected = MetaException.class)
public void testExchangePartitionEmptySourceDB() throws Exception {
 Map<String, String> partitionSpecs = getPartitionSpec(partitions[1]);
 client.exchange_partition(partitionSpecs, "", sourceTable.getTableName(), destTable.getDbName(),
   destTable.getTableName());
}

代码示例来源:origin: apache/hive

private void setTableSkipProperty(
  IMetaStoreClient msClient, String tbl, String val) throws Exception {
 Table table = msClient.getTable(ss.getCurrentDatabase(), tbl);
 table.getParameters().put(StatsUpdaterThread.SKIP_STATS_AUTOUPDATE_PROPERTY, val);
 msClient.alter_table(table.getDbName(), table.getTableName(), table);
}

相关文章

Table类方法