Module: BigQuery::Jobs
- Included in:
- Client
- Defined in:
- lib/bigquery-client/jobs.rb,
lib/bigquery-client/run_query.rb
Defined Under Namespace
Classes: RunQuery
Instance Method Summary collapse
- #fetch_job(id, options = {}) ⇒ Object
- #find_all(query, options = {}) ⇒ Object
- #jobs(options = {}) ⇒ Object
- #jobs_query(query, options = {}) ⇒ Object
- #load(options = {}) ⇒ Object
- #query(query, options = {}) ⇒ Object
- #query_results(id, options = {}) ⇒ Object
- #sql(query, options = {}) ⇒ Object
Instance Method Details
#fetch_job(id, options = {}) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/bigquery-client/jobs.rb', line 43 def fetch_job(id, = {}) access_api( api_method: bigquery.jobs.get, parameters: { jobId: id }.merge() ) end |
#find_all(query, options = {}) ⇒ Object
9 10 11 |
# File 'lib/bigquery-client/jobs.rb', line 9 def find_all(query, = {}) raise NotImplementedError end |
#jobs(options = {}) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/bigquery-client/jobs.rb', line 36 def jobs( = {}) access_api( api_method: bigquery.jobs.list, parameters: ) end |
#jobs_query(query, options = {}) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/bigquery-client/jobs.rb', line 17 def jobs_query(query, = {}) default = { query: query, timeoutMs: 600_000 } access_api( api_method: bigquery.jobs.query, body_object: default.merge() ) end |
#load(options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/bigquery-client/jobs.rb', line 25 def load( = {}) access_api( api_method: bigquery.jobs.insert, body_object: { configuration: { load: } } ) end |
#query(query, options = {}) ⇒ Object
13 14 15 |
# File 'lib/bigquery-client/jobs.rb', line 13 def query(query, = {}) RunQuery.new(self, query, ).call end |
#query_results(id, options = {}) ⇒ Object
50 51 52 53 54 55 |
# File 'lib/bigquery-client/jobs.rb', line 50 def query_results(id, = {}) access_api( api_method: bigquery.jobs.get_query_results, parameters: { jobId: id }.merge() ) end |
#sql(query, options = {}) ⇒ Object
5 6 7 |
# File 'lib/bigquery-client/jobs.rb', line 5 def sql(query, = {}) query(query, ).to_a end |