get method

Future<Table> get(
  1. String projectId,
  2. String datasetId,
  3. String tableId, {
  4. String? selectedFields,
  5. String? view,
  6. String? $fields,
})

Gets the specified table resource by table ID.

This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.

Request parameters:

projectId - Required. Project ID of the requested table Value must have pattern ^\[^/\]+$.

datasetId - Required. Dataset ID of the requested table Value must have pattern ^\[^/\]+$.

tableId - Required. Table ID of the requested table Value must have pattern ^\[^/\]+$.

selectedFields - List of table schema fields to return (comma-separated). If unspecified, all fields are returned. A fieldMask cannot be used here because the fields will automatically be converted from camelCase to snake_case and the conversion will fail if there are underscores. Since these are fields in BigQuery table schemas, underscores are allowed.

view - Optional. Specifies the view that determines which table information is returned. By default, basic table information and storage statistics (STORAGE_STATS) are returned. Possible string values are:

  • "TABLE_METADATA_VIEW_UNSPECIFIED" : The default value. Default to the STORAGE_STATS view.
  • "BASIC" : Includes basic table information including schema and partitioning specification. This view does not include storage statistics such as numRows or numBytes. This view is significantly more efficient and should be used to support high query rates.
  • "STORAGE_STATS" : Includes all information in the BASIC view as well as storage statistics (numBytes, numLongTermBytes, numRows and lastModifiedTime).
  • "FULL" : Includes all table information, including storage statistics. It returns same information as STORAGE_STATS view, but may contain additional information in the future.

$fields - Selector specifying which fields to include in a partial response.

Completes with a Table.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<Table> get(
  core.String projectId,
  core.String datasetId,
  core.String tableId, {
  core.String? selectedFields,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (selectedFields != null) 'selectedFields': [selectedFields],
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'projects/' +
      core.Uri.encodeFull('$projectId') +
      '/datasets/' +
      core.Uri.encodeFull('$datasetId') +
      '/tables/' +
      core.Uri.encodeFull('$tableId');

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return Table.fromJson(response_ as core.Map<core.String, core.dynamic>);
}