Skip to content

Instantly share code, notes, and snippets.

@tchikuba
Created May 20, 2015 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tchikuba/c1c9e48f88ff7c6d2c94 to your computer and use it in GitHub Desktop.
Save tchikuba/c1c9e48f88ff7c6d2c94 to your computer and use it in GitHub Desktop.
td-client-rubyのqueryメソッドのインタフェース(2015/05/20時点)
# @param [String] db_name
# @param [String] q
# @param [String] result_url
# @param [Fixnum] priority
# @param [Fixnum] retry_limit
# @param [Hash] opts
# @return [Job]
def query(db_name, q, result_url=nil, priority=nil, retry_limit=nil, opts={})
# for compatibility, assume type is hive unless specifically specified
type = opts[:type] || opts['type'] || :hive
raise ArgumentError, "The specified query type is not supported: #{type}" unless [:hive, :pig, :impala, :presto].include?(type)
job_id = @api.query(q, type, db_name, result_url, priority, retry_limit, opts)
Job.new(self, job_id, type, q)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment