Class: Tumugi::Plugin::BigqueryQueryTask
- Inherits:
-
Task
- Object
- Task
- Tumugi::Plugin::BigqueryQueryTask
- Defined in:
- lib/tumugi/plugin/task/bigquery_query.rb
Instance Method Summary collapse
Instance Method Details
#completed? ⇒ Boolean
22 23 24 25 26 27 28 |
# File 'lib/tumugi/plugin/task/bigquery_query.rb', line 22 def completed? if mode.to_sym == :append && !finished? false else super end end |
#output ⇒ Object
18 19 20 |
# File 'lib/tumugi/plugin/task/bigquery_query.rb', line 18 def output @output ||= Tumugi::Plugin::BigqueryTableTarget.new(project_id: project_id, dataset_id: dataset_id, table_id: table_id) end |
#run ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/tumugi/plugin/task/bigquery_query.rb', line 30 def run log "Launching Query" log "Query: #{query}" log "Query destination: #{output}" bq_client = output.client bq_client.query(query, project_id: project_id, dataset_id: output.dataset_id, table_id: output.table_id, mode: mode.to_sym, flatten_results: flatten_results, use_legacy_sql: use_legacy_sql, wait: wait) end |