当前位置: 首页>>代码示例>>Java>>正文


Java Table.getTableReference方法代码示例

本文整理汇总了Java中com.google.api.services.bigquery.model.Table.getTableReference方法的典型用法代码示例。如果您正苦于以下问题:Java Table.getTableReference方法的具体用法?Java Table.getTableReference怎么用?Java Table.getTableReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.api.services.bigquery.model.Table的用法示例。


在下文中一共展示了Table.getTableReference方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTable

import com.google.api.services.bigquery.model.Table; //导入方法依赖的package包/类
@Override
public void createTable(Table table) throws IOException {
  TableReference tableReference = table.getTableReference();
  validateWholeTableReference(tableReference);
  synchronized (tables) {
    Map<String, TableContainer> dataset =
        tables.get(tableReference.getProjectId(), tableReference.getDatasetId());
    if (dataset == null) {
      throwNotFound(
          "Tried to get a dataset %s:%s, but no such table was set",
          tableReference.getProjectId(),
          tableReference.getDatasetId());
    }
    TableContainer tableContainer = dataset.get(tableReference.getTableId());
    if (tableContainer == null) {
      tableContainer = new TableContainer(table);
      dataset.put(tableReference.getTableId(), tableContainer);
    }
  }
}
 
开发者ID:apache,项目名称:beam,代码行数:21,代码来源:FakeDatasetService.java

示例2: updateTable

import com.google.api.services.bigquery.model.Table; //导入方法依赖的package包/类
/**
 * Updates the specified Bigquery table to reflect the metadata from the input.
 *
 * <p>Returns the input DestinationTable. If the specified table does not already exist, it will
 * be inserted into the dataset.
 *
 * <p>Clients can call this function directly to update a table on demand, or can pass it to
 * Futures.transform() to update a table produced as the asynchronous result of a load or query
 * job (e.g. to add a description to it).
 */
private DestinationTable updateTable(final DestinationTable destinationTable) {
  Table table = destinationTable.getTable();
  TableReference ref = table.getTableReference();
  try {
    if (checkTableExists(ref.getDatasetId(), ref.getTableId())) {
      // Make sure to use patch() rather than update(). The former changes only those properties
      // which are specified, while the latter would change everything, blanking out unspecified
      // properties.
      bigquery
          .tables()
          .patch(ref.getProjectId(), ref.getDatasetId(), ref.getTableId(), table)
          .execute();
    } else {
      bigquery.tables().insert(ref.getProjectId(), ref.getDatasetId(), table).execute();
    }
    return destinationTable;
  } catch (IOException e) {
    throw BigqueryJobFailureException.create(e);
  }
}
 
开发者ID:google,项目名称:nomulus,代码行数:31,代码来源:BigqueryConnection.java

示例3: updateTable

import com.google.api.services.bigquery.model.Table; //导入方法依赖的package包/类
private static void updateTable(Bigquery bigquery, Table table) throws IOException {
  TableReference ref = table.getTableReference();
  try {
    bigquery
        .tables()
        .update(ref.getProjectId(), ref.getDatasetId(), ref.getTableId(), table)
        .execute();
  } catch (GoogleJsonResponseException e) {
    if (e.getDetails().getCode() == 404) {
      bigquery.tables().insert(ref.getProjectId(), ref.getDatasetId(), table).execute();
    } else {
      logger.warningfmt("UpdateSnapshotViewAction failed, caught exception %s", e.getDetails());
    }
  }
}
 
开发者ID:google,项目名称:nomulus,代码行数:16,代码来源:UpdateSnapshotViewAction.java

示例4: emptyTable

import com.google.api.services.bigquery.model.Table; //导入方法依赖的package包/类
void emptyTable(String projectId, Table table)
        throws IOException
{
    TableReference r = table.getTableReference();
    deleteTable(r.getProjectId(), r.getDatasetId(), r.getTableId());
    createTable(projectId, table);
}
 
开发者ID:treasure-data,项目名称:digdag,代码行数:8,代码来源:BqClient.java


注:本文中的com.google.api.services.bigquery.model.Table.getTableReference方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。