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 - Project ID of the requested table

datasetId - Dataset ID of the requested table

tableId - Table ID of the requested table

selectedFields - List of fields to return (comma-separated). If unspecified, all fields are returned

view - 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:

  • "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.
  • "FULL" : Includes all table information, including storage statistics. It returns same information as STORAGE_STATS view, but may contain additional information in the future.
  • "STORAGE_STATS" : Includes all information in the BASIC view as well as storage statistics (numBytes, numLongTermBytes, numRows and lastModifiedTime).
  • "TABLE_METADATA_VIEW_UNSPECIFIED" : The default value. Default to the STORAGE_STATS view.

$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/' +
      commons.escapeVariable('$projectId') +
      '/datasets/' +
      commons.escapeVariable('$datasetId') +
      '/tables/' +
      commons.escapeVariable('$tableId');

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