本文整理了Java中org.apache.hadoop.hive.metastore.api.Table.isSetId()
方法的一些代码示例,展示了Table.isSetId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.isSetId()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.metastore.api.Table
类名称:Table
方法名:isSetId
[英]Returns true if field id is set (has been assigned a value) and false otherwise
[中]如果设置了字段id(已赋值),则返回true,否则返回false
代码示例来源:origin: apache/hive
boolean first = true;
if (isSetId()) {
sb.append("id:");
sb.append(this.id);
代码示例来源:origin: apache/hive
List<Object> list = new ArrayList<Object>();
boolean present_id = true && (isSetId());
list.add(present_id);
if (present_id)
代码示例来源:origin: apache/hive
if (struct.isSetId()) {
oprot.writeFieldBegin(ID_FIELD_DESC);
oprot.writeI64(struct.id);
代码示例来源:origin: apache/hive
lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
if (lastComparison != 0) {
return lastComparison;
if (isSetId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
if (lastComparison != 0) {
代码示例来源:origin: apache/hive
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetId()) {
optionals.set(0);
if (struct.isSetId()) {
oprot.writeI64(struct.id);
代码示例来源:origin: apache/hive
if (tbl.isSetId()) {
throw new InvalidObjectException("Id shouldn't be set but table "
+ tbl.getDbName() + "." + tbl.getTableName() + "has the Id set to "
代码示例来源:origin: apache/hive
return false;
boolean this_present_id = true && this.isSetId();
boolean that_present_id = true && that.isSetId();
if (this_present_id || that_present_id) {
if (!(this_present_id && that_present_id))
代码示例来源:origin: apache/hive
@Test
public void testCreateAndGetTableWithDriver() throws Exception {
String dbName = "createDb";
String tblName = "createTbl";
client.dropTable(dbName, tblName);
silentDropDatabase(dbName);
new DatabaseBuilder()
.setName(dbName)
.create(client, conf);
createTable(dbName, tblName);
Table tblRead = client.getTable(dbName, tblName);
Assert.assertTrue(tblRead.isSetId());
long firstTableId = tblRead.getId();
createTable(dbName, tblName + "_2");
Table tblRead2 = client.getTable(dbName, tblName + "_2");
Assert.assertTrue(tblRead2.isSetId());
Assert.assertNotEquals(firstTableId, tblRead2.getId());
}
代码示例来源:origin: apache/hive
return isSetId();
case TABLE_NAME:
return isSetTableName();
代码示例来源:origin: apache/hive
Assert.assertTrue(table.getTTable().isSetId());
table.getTTable().unsetId();
代码示例来源:origin: apache/hive
Assert.assertTrue(tbl.isSetId());
tbl.unsetId();
代码示例来源:origin: apache/hive
@Test
public void testAlterTable() throws Exception {
Table originalTable = testTables[2];
String originalTableName = originalTable.getTableName();
String originalDatabase = originalTable.getDbName();
Table newTable = getTableWithAllParametersSet();
newTable.setTableName(originalTableName);
newTable.setDbName(originalDatabase);
// Partition keys can not be set, but getTableWithAllParametersSet is added one, so remove for
// this test
newTable.setPartitionKeys(originalTable.getPartitionKeys());
client.alter_table(originalDatabase, originalTableName, newTable);
Table alteredTable = client.getTable(originalDatabase, originalTableName);
// The extra parameters will be added on server side, so check that the required ones are
// present
for(String key: newTable.getParameters().keySet()) {
Assert.assertEquals("parameters are present", newTable.getParameters().get(key),
alteredTable.getParameters().get(key));
}
// The parameters are checked manually, so do not check them
newTable.setParameters(alteredTable.getParameters());
// Some of the data is set on the server side, so reset those
newTable.setCreateTime(alteredTable.getCreateTime());
newTable.setCreationMetadata(alteredTable.getCreationMetadata());
newTable.setWriteId(alteredTable.getWriteId());
Assert.assertTrue(alteredTable.isSetId());
alteredTable.unsetId();
Assert.assertEquals("The table data should be the same", newTable, alteredTable);
}
代码示例来源:origin: apache/hive
table.setWriteId(createdTable.getWriteId());
Assert.assertTrue(createdTable.isSetId());
createdTable.unsetId();
Assert.assertEquals("create/get table data", table, createdTable);
代码示例来源:origin: apache/hive
private Table createTestTable() throws HiveException, AlreadyExistsException {
Database db = new Database();
db.setName(dbName);
hive.createDatabase(db, true);
Table table = new Table(dbName, tableName);
table.setDbName(dbName);
table.setInputFormatClass(TextInputFormat.class);
table.setOutputFormatClass(HiveIgnoreKeyTextOutputFormat.class);
table.setPartCols(partCols);
hive.createTable(table);
table = hive.getTable(dbName, tableName);
Assert.assertTrue(table.getTTable().isSetId());
table.getTTable().unsetId();
for (Map<String, String> partSpec : parts) {
hive.createPartition(table, partSpec);
}
return table;
}
代码示例来源:origin: apache/hive
Assert.assertTrue(ft.getTTable().isSetId());
ft.getTTable().unsetId();
代码示例来源:origin: apache/hive
Assert.assertTrue(tbl2.isSetId());
assertEquals(tbl2.getDbName(), dbName);
assertEquals(tbl2.getTableName(), tblName);
代码示例来源:origin: apache/hive
createTable(hmsc, true);
Table table = hmsc.getTable(dbName, tableName);
Assert.assertTrue(table.isSetId());
table.unsetId();
populatePartitions(hmsc, table, Arrays.asList("isLocatedInTablePath", "isLocatedOutsideTablePath"));
内容来源于网络,如有侵权,请联系作者删除!