public Table build(Configuration conf) throws MetaException {
    if (tableName == null) {
      throw new MetaException("You must set the table name");
    }
    if (ownerType == null) {
      ownerType = PrincipalType.USER;
    }
    if (owner == null) {
      try {
        owner = SecurityUtils.getUser();
      } catch (IOException e) {
        throw MetaStoreUtils.newMetaException(e);
      }
    }
    if (catName == null) catName = MetaStoreUtils.getDefaultCatalog(conf);
    Table t = new Table(tableName, dbName, owner, createTime, lastAccessTime, retention, buildSd(),
        partCols, tableParams, viewOriginalText, viewExpandedText, type);
    if (rewriteEnabled) t.setRewriteEnabled(true);
    if (temporary) t.setTemporary(temporary);
    t.setCatName(catName);
    if (!mvReferencedTables.isEmpty()) {
      Set<String> tablesUsed = mvReferencedTables.stream()
              .map(sourceTable -> TableName.getDbTable(
                      sourceTable.getTable().getDbName(), sourceTable.getTable().getTableName()))
              .collect(Collectors.toSet());
      CreationMetadata cm = new CreationMetadata(catName, dbName, tableName, tablesUsed);
      cm.setSourceTables(mvReferencedTables);
      if (mvValidTxnList != null) cm.setValidTxnList(mvValidTxnList);
      t.setCreationMetadata(cm);
    }
    return t;
  }
Build a {@link Table}.  The database name and table name must be provided, plus whatever is
needed by the underlying {@link StorageDescriptorBuilder}.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/client/builder/TableBuilder.java