module BigQuery::Jobs

Public Instance Methods

fetch_job(id, options = {}) click to toggle source
# File lib/bigquery-client/jobs.rb, line 43
def fetch_job(id, options = {})
  access_api(
    api_method: bigquery.jobs.get,
    parameters: { jobId: id }.merge(options)
  )
end
find_all(query, options = {}) click to toggle source
# File lib/bigquery-client/jobs.rb, line 9
def find_all(query, options = {})
  raise NotImplementedError
end
jobs(options = {}) click to toggle source
# File lib/bigquery-client/jobs.rb, line 36
def jobs(options = {})
  access_api(
    api_method: bigquery.jobs.list,
    parameters: options
  )
end
jobs_query(query, options = {}) click to toggle source
# File lib/bigquery-client/jobs.rb, line 17
def jobs_query(query, options = {})
  default = { query: query, timeoutMs: 600_000 }
  access_api(
    api_method: bigquery.jobs.query,
    body_object: default.merge(options)
  )
end
load(options = {}) click to toggle source
# File lib/bigquery-client/jobs.rb, line 25
def load(options = {})
  access_api(
    api_method: bigquery.jobs.insert,
    body_object: {
      configuration: {
        load: options
      }
    }
  )
end
query(query, options = {}) click to toggle source
# File lib/bigquery-client/jobs.rb, line 13
def query(query, options = {})
  RunQuery.new(self, query, options).call
end
query_results(id, options = {}) click to toggle source
# File lib/bigquery-client/jobs.rb, line 50
def query_results(id, options = {})
  access_api(
    api_method: bigquery.jobs.get_query_results,
    parameters: { jobId: id }.merge(options)
  )
end
sql(query, options = {}) click to toggle source
# File lib/bigquery-client/jobs.rb, line 5
def sql(query, options = {})
  query(query, options).to_a
end