Module: BigQuery::Client::Jobs

Included in:
BigQuery::Client
Defined in:
lib/big_query/client/jobs.rb

Instance Method Summary collapse

Instance Method Details

#get_query_results(id, opts = {}) ⇒ Hash

Gets the results of a given job

Parameters:

  • id (Integer)

    job id to fetch

  • options (Hash)

    bigquery opts accepted

Returns:

  • (Hash)

    json api response



30
31
32
33
34
35
# File 'lib/big_query/client/jobs.rb', line 30

def get_query_results(id, opts = {})
  opts['jobId'] ||= id

  api(api_method: @bq.jobs.get_query_results,
      parameters: opts)
end

#job(id, opts = {}) ⇒ Hash

Fetches a bigquery job by id

Parameters:

  • id (Integer)

    job id to fetch

  • options (Hash)

    bigquery opts accepted

Returns:

  • (Hash)

    json api response



9
10
11
12
13
14
# File 'lib/big_query/client/jobs.rb', line 9

def job(id, opts = {})
  opts['jobId'] ||= id

  api(api_method: @bq.jobs.get,
      parameters: opts)
end

#jobs(opts = {}) ⇒ Hash

lists all the jobs

Parameters:

  • options (Hash)

    bigquery opts accepted

Returns:

  • (Hash)

    json api response



20
21
22
23
# File 'lib/big_query/client/jobs.rb', line 20

def jobs(opts = {})
  api(api_method: @bq.jobs.list,
      parameters: opts)
end