Created
May 20, 2015 08:18
-
-
Save tchikuba/c1c9e48f88ff7c6d2c94 to your computer and use it in GitHub Desktop.
td-client-rubyのqueryメソッドのインタフェース(2015/05/20時点)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @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