Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

Code Block
linenumberstrue
require 'td'
require 'td-client'
cln = TreasureData::Client.new(ENV['TREASURE_DATA_API_KEY'])
job = cln.query('testdb', 'SELECT COUNT(1) FROM www_access')
until job.finished?
  sleep 2
  job.update_progress!
end
job.update_status!  # get latest info
job.result_each { |row| p row }


job.result_each(&block) does not put the job result into memory. It iterates through the rows in a streaming fashion.

List and Get the Status of Jobs

...