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

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

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

Table.unsetCatName介绍

暂无

代码示例

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

@Test
public void getTableMeta() throws TException {
 String dbName = "db9";
 // For this one don't specify a location to make sure it gets put in the catalog directory
 Database db = new DatabaseBuilder()
   .setName(dbName)
   .build(conf);
 db.unsetCatalogName();
 client.createDatabase(db);
 String[] tableNames = {"table_in_other_catalog_1", "table_in_other_catalog_2", "random_name"};
 List<TableMeta> expected = new ArrayList<>(tableNames.length);
 for (int i = 0; i < tableNames.length; i++) {
  Table table = new TableBuilder()
    .inDb(db)
    .setTableName(tableNames[i])
    .addCol("id", "int")
    .addCol("name", "string")
    .build(conf);
  table.unsetCatName();
  client.createTable(table);
  TableMeta tableMeta = new TableMeta(dbName, tableNames[i], TableType.MANAGED_TABLE.name());
  tableMeta.setCatName(expectedCatalog());
  expected.add(tableMeta);
 }
 List<String> types = Collections.singletonList(TableType.MANAGED_TABLE.name());
 List<TableMeta> actual = client.getTableMeta(dbName, "*", types);
 Assert.assertEquals(new TreeSet<>(expected), new TreeSet<>(actual));
 actual = client.getTableMeta("*", "table_*", types);
 Assert.assertEquals(expected.subList(0, 2), actual.subList(0, 2));
}

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

t.unsetCatName();
client.createTable(t);

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

.addTableParam("PARTITION_LEVEL_PRIVILEGE", "true")
  .build(conf);
table.unsetCatName();
client.createTable(table);

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

@Test
public void tablesGetExists() throws TException {
 String dbName = "db_in_other_catalog";
 // For this one don't specify a location to make sure it gets put in the catalog directory
 Database db = new DatabaseBuilder()
   .setName(dbName)
   .build(conf);
 db.unsetCatalogName();
 client.createDatabase(db);
 String[] tableNames = new String[4];
 for (int i = 0; i < tableNames.length; i++) {
  tableNames[i] = "table_in_other_catalog_" + i;
  Table table = new TableBuilder()
    .inDb(db)
    .setTableName(tableNames[i])
    .addCol("col1_" + i, ColumnType.STRING_TYPE_NAME)
    .addCol("col2_" + i, ColumnType.INT_TYPE_NAME)
    .build(conf);
  table.unsetCatName();
  client.createTable(table);
 }
 Set<String> tables = new HashSet<>(client.getTables(dbName, "*e_in_other_*"));
 Assert.assertEquals(4, tables.size());
 for (String tableName : tableNames) Assert.assertTrue(tables.contains(tableName));
 List<String> fetchedNames = client.getTables(dbName, "*_3");
 Assert.assertEquals(1, fetchedNames.size());
 Assert.assertEquals(tableNames[3], fetchedNames.get(0));
 Assert.assertTrue("Table exists", client.tableExists(dbName, tableNames[0]));
 Assert.assertFalse("Table not exists", client.tableExists(dbName, "non_existing_table"));
}

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

.addPartCol("partcol", "string")
  .build(conf);
table.unsetCatName();
client.createTable(table);

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

@Test
public void tablesList() throws TException {
 String dbName = "db_in_other_catalog";
 // For this one don't specify a location to make sure it gets put in the catalog directory
 Database db = new DatabaseBuilder()
   .setName(dbName)
   .build(conf);
 db.unsetCatalogName();
 client.createDatabase(db);
 String[] tableNames = new String[4];
 for (int i = 0; i < tableNames.length; i++) {
  tableNames[i] = "table_in_other_catalog_" + i;
  TableBuilder builder = new TableBuilder()
    .inDb(db)
    .setTableName(tableNames[i])
    .addCol("col1_" + i, ColumnType.STRING_TYPE_NAME)
    .addCol("col2_" + i, ColumnType.INT_TYPE_NAME);
  if (i == 0) builder.addTableParam("the_key", "the_value");
  Table table = builder.build(conf);
  table.unsetCatName();
  client.createTable(table);
 }
 String filter = hive_metastoreConstants.HIVE_FILTER_FIELD_PARAMS + "the_key=\"the_value\"";
 List<String> fetchedNames = client.listTableNamesByFilter(dbName, filter, (short)-1);
 Assert.assertEquals(1, fetchedNames.size());
 Assert.assertEquals(tableNames[0], fetchedNames.get(0));
}

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

.addPartCol("partcol", "string")
  .build(conf);
table.unsetCatName();
client.createTable(table);

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

.addPartCol("partcol", "string")
  .build(conf);
table.unsetCatName();
client.createTable(table);

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

.addCol("col6", "int")
  .build(conf);
table.unsetCatName();

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

.addPartCol("partcol", "string")
  .build(conf);
table.unsetCatName();
client.createTable(table);

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

unsetCatName();
} else {
 setCatName((String)value);

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

t.unsetCatName();
client.createTable(t);

代码示例来源:origin: org.apache.hive/hive-standalone-metastore

unsetCatName();
} else {
 setCatName((String)value);

相关文章

Table类方法