Method: BigQuery::Client::Tables#table_data

Defined in:
lib/big_query/client/tables.rb

#table_data(tableId, dataset = @dataset) ⇒ Hash

Returns all rows of table data

Parameters:

  • tableId (String)

    id of the table to look for

  • dataset (String) (defaults to: @dataset)

    dataset to look for

Returns:

  • (Hash)

    json api response



36
37
38
39
40
41
# File 'lib/big_query/client/tables.rb', line 36

def table_data(tableId, dataset = @dataset)
  response = api(api_method: @bq.tabledata.list,
                 parameters: { 'datasetId' => dataset,
                               'tableId' => tableId })
  response['rows'] || []
end