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

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

本文整理了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

  1. private Scenario scenarioType(org.apache.hadoop.hive.metastore.api.Table before,
  2. org.apache.hadoop.hive.metastore.api.Table after) {
  3. if (before.getDbName().equals(after.getDbName())
  4. && before.getTableName().equals(after.getTableName())) {
  5. return isTruncateOp ? Scenario.TRUNCATE : Scenario.ALTER;
  6. } else {
  7. return Scenario.RENAME;
  8. }
  9. }

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

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

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

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

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

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

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

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

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

  1. public T onTable(Table table) {
  2. this.catName = table.getCatName();
  3. this.dbName = table.getDbName();
  4. this.tableName = table.getTableName();
  5. return child;
  6. }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章

Table类方法