lib/cns/bigquery1.rb in cns-0.1.5 vs lib/cns/bigquery1.rb in cns-0.1.6
- old
+ new
@@ -6,11 +6,11 @@
# @author Hernani Rodrigues Vaz
module Cns
BD = 'hernanirvaz.coins'
# (see Bigquery)
- class Cns::Bigquery
+ class Bigquery
# @return [Google::Cloud::Bigquery] API bigquery
attr_reader :api
# @return [Google::Cloud::Bigquery::QueryJob] job bigquery
attr_reader :job
# @return [Thor::CoreExt::HashWithIndifferentAccess] opcoes trabalho
@@ -89,12 +89,13 @@
#
# @param cmd (see sql)
# @return [Boolean] job ok?
def job?(cmd)
@job = api.query_job(cmd)
- @job.wait_until_done!
- puts(@job.error['message']) if @job.failed?
- @job.failed?
+ job.wait_until_done!
+ fld = job.failed?
+ puts(job.error['message']) if fld
+ fld
end
# cria Structured Query Language (SQL) job bigquery
#
# @param [String] cmd comando SQL a executar