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

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

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

Table.isSetId介绍

[英]Returns true if field id is set (has been assigned a value) and false otherwise
[中]如果设置了字段id(已赋值),则返回true,否则返回false

代码示例

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

  1. boolean first = true;
  2. if (isSetId()) {
  3. sb.append("id:");
  4. sb.append(this.id);

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

  1. List<Object> list = new ArrayList<Object>();
  2. boolean present_id = true && (isSetId());
  3. list.add(present_id);
  4. if (present_id)

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

  1. if (struct.isSetId()) {
  2. oprot.writeFieldBegin(ID_FIELD_DESC);
  3. oprot.writeI64(struct.id);

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

  1. lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
  2. if (lastComparison != 0) {
  3. return lastComparison;
  4. if (isSetId()) {
  5. lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
  6. if (lastComparison != 0) {

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

  1. TTupleProtocol oprot = (TTupleProtocol) prot;
  2. BitSet optionals = new BitSet();
  3. if (struct.isSetId()) {
  4. optionals.set(0);
  5. if (struct.isSetId()) {
  6. oprot.writeI64(struct.id);

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

  1. if (tbl.isSetId()) {
  2. throw new InvalidObjectException("Id shouldn't be set but table "
  3. + tbl.getDbName() + "." + tbl.getTableName() + "has the Id set to "

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

  1. return false;
  2. boolean this_present_id = true && this.isSetId();
  3. boolean that_present_id = true && that.isSetId();
  4. if (this_present_id || that_present_id) {
  5. if (!(this_present_id && that_present_id))

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

  1. @Test
  2. public void testCreateAndGetTableWithDriver() throws Exception {
  3. String dbName = "createDb";
  4. String tblName = "createTbl";
  5. client.dropTable(dbName, tblName);
  6. silentDropDatabase(dbName);
  7. new DatabaseBuilder()
  8. .setName(dbName)
  9. .create(client, conf);
  10. createTable(dbName, tblName);
  11. Table tblRead = client.getTable(dbName, tblName);
  12. Assert.assertTrue(tblRead.isSetId());
  13. long firstTableId = tblRead.getId();
  14. createTable(dbName, tblName + "_2");
  15. Table tblRead2 = client.getTable(dbName, tblName + "_2");
  16. Assert.assertTrue(tblRead2.isSetId());
  17. Assert.assertNotEquals(firstTableId, tblRead2.getId());
  18. }

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

  1. return isSetId();
  2. case TABLE_NAME:
  3. return isSetTableName();

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

  1. Assert.assertTrue(table.getTTable().isSetId());
  2. table.getTTable().unsetId();

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

  1. Assert.assertTrue(tbl.isSetId());
  2. tbl.unsetId();

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

  1. @Test
  2. public void testAlterTable() throws Exception {
  3. Table originalTable = testTables[2];
  4. String originalTableName = originalTable.getTableName();
  5. String originalDatabase = originalTable.getDbName();
  6. Table newTable = getTableWithAllParametersSet();
  7. newTable.setTableName(originalTableName);
  8. newTable.setDbName(originalDatabase);
  9. // Partition keys can not be set, but getTableWithAllParametersSet is added one, so remove for
  10. // this test
  11. newTable.setPartitionKeys(originalTable.getPartitionKeys());
  12. client.alter_table(originalDatabase, originalTableName, newTable);
  13. Table alteredTable = client.getTable(originalDatabase, originalTableName);
  14. // The extra parameters will be added on server side, so check that the required ones are
  15. // present
  16. for(String key: newTable.getParameters().keySet()) {
  17. Assert.assertEquals("parameters are present", newTable.getParameters().get(key),
  18. alteredTable.getParameters().get(key));
  19. }
  20. // The parameters are checked manually, so do not check them
  21. newTable.setParameters(alteredTable.getParameters());
  22. // Some of the data is set on the server side, so reset those
  23. newTable.setCreateTime(alteredTable.getCreateTime());
  24. newTable.setCreationMetadata(alteredTable.getCreationMetadata());
  25. newTable.setWriteId(alteredTable.getWriteId());
  26. Assert.assertTrue(alteredTable.isSetId());
  27. alteredTable.unsetId();
  28. Assert.assertEquals("The table data should be the same", newTable, alteredTable);
  29. }

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

  1. table.setWriteId(createdTable.getWriteId());
  2. Assert.assertTrue(createdTable.isSetId());
  3. createdTable.unsetId();
  4. Assert.assertEquals("create/get table data", table, createdTable);

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

  1. private Table createTestTable() throws HiveException, AlreadyExistsException {
  2. Database db = new Database();
  3. db.setName(dbName);
  4. hive.createDatabase(db, true);
  5. Table table = new Table(dbName, tableName);
  6. table.setDbName(dbName);
  7. table.setInputFormatClass(TextInputFormat.class);
  8. table.setOutputFormatClass(HiveIgnoreKeyTextOutputFormat.class);
  9. table.setPartCols(partCols);
  10. hive.createTable(table);
  11. table = hive.getTable(dbName, tableName);
  12. Assert.assertTrue(table.getTTable().isSetId());
  13. table.getTTable().unsetId();
  14. for (Map<String, String> partSpec : parts) {
  15. hive.createPartition(table, partSpec);
  16. }
  17. return table;
  18. }

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

  1. Assert.assertTrue(ft.getTTable().isSetId());
  2. ft.getTTable().unsetId();

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

  1. Assert.assertTrue(tbl2.isSetId());
  2. assertEquals(tbl2.getDbName(), dbName);
  3. assertEquals(tbl2.getTableName(), tblName);

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

  1. createTable(hmsc, true);
  2. Table table = hmsc.getTable(dbName, tableName);
  3. Assert.assertTrue(table.isSetId());
  4. table.unsetId();
  5. populatePartitions(hmsc, table, Arrays.asList("isLocatedInTablePath", "isLocatedOutsideTablePath"));

相关文章

Table类方法