Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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