presto-client 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45c1f4293f282e8926a9aba438e42d15b0398a06f6f868dd467a1f905874e88e
4
- data.tar.gz: add5e079212611da30f8bd66a264bc3586c5ee8c2e66d66b8bca17e03c1b0ad0
3
+ metadata.gz: 23d42cbbd7d572f7238f5e39af0cca4e40035573fef9077ccef1f7852160921e
4
+ data.tar.gz: af8a62c9ec3e04a5022a92a296a6c502eedbfaebe699d68084ee1095f11a8f64
5
5
  SHA512:
6
- metadata.gz: 8198a307d376bc8e81030aa296b11dc77fed2390f9abf69743a4d3a92af5ac0a8101af1c0cd38386bf05f55117ce15a203ecc64a1e68b0f260fade9ebd26142f
7
- data.tar.gz: d2ff31ccc7a069a0a1fc5de6236bcfdb3d5b43efaebaec56d49cda988ca9805aca9d6140a25d31ae49f45144a812e3f731942742fb6b395521df7c7371acd91b
6
+ metadata.gz: b74979366b8c96380c8efac4bec4fa28cdc064925535c66901bdd6f4254aca35596db73da704762736282046c140d78ca783f10fc5146199eb1eafe67eace673
7
+ data.tar.gz: 1dfddc8c0a767d672bc5a807e2a01503d2b1e20f94cbcf88ae32ccf6bdc89d8a54adc05818094a6eb00ef0be1ad566f879dedbaae217ae6ee9934e18f0d7bd00
@@ -0,0 +1 @@
1
+ * @treasure-data/mpp
data/ChangeLog.md CHANGED
@@ -1,5 +1,13 @@
1
1
  presto-client-ruby
2
2
  ====
3
+ ## 0.6.4
4
+ - Merge pull request [#67](https://github.com/treasure-data/presto-client-ruby/issues/67) from takezoe/update-readme-follow-redirect-option [[6da5025](https://github.com/treasure-data/presto-client-ruby/commit/6da5025)]
5
+ - Update README.md to describe follow_redirect option [[83f8a05](https://github.com/treasure-data/presto-client-ruby/commit/83f8a05)]
6
+ - Merge pull request [#66](https://github.com/treasure-data/presto-client-ruby/issues/66) from takezoe/follow-redirect-option [[9f1b297](https://github.com/treasure-data/presto-client-ruby/commit/9f1b297)]
7
+ - Update lib/presto/client/faraday_client.rb [[64c0b81](https://github.com/treasure-data/presto-client-ruby/commit/64c0b81)]
8
+ - Add follow_redirect option [[a103660](https://github.com/treasure-data/presto-client-ruby/commit/a103660)]
9
+ - Create CODEOWNERS [[c8c3251](https://github.com/treasure-data/presto-client-ruby/commit/c8c3251)]
10
+
3
11
  ## 0.6.3
4
12
  - Merge pull request [#56](https://github.com/treasure-data/presto-client-ruby/issues/56) from miniway/more_recent_statementclient [[423ff42](https://github.com/treasure-data/presto-client-ruby/commit/423ff42)]
5
13
  - Make more similar to recent java StatementClient [[94f5193](https://github.com/treasure-data/presto-client-ruby/commit/94f5193)]
data/README.md CHANGED
@@ -27,7 +27,7 @@ client = Presto::Client.new(
27
27
  "raptor.reader_stream_buffer_size": "32MB"
28
28
  },
29
29
  http_proxy: "proxy.example.com:8080",
30
- http_debug: true,
30
+ http_debug: true
31
31
  )
32
32
 
33
33
  # run a query and get results as an array of arrays:
@@ -101,6 +101,7 @@ $ bundle exec rake modelgen:latest
101
101
  * **http_debug** enables debug message to STDOUT for each HTTP requests.
102
102
  * **http_open_timeout** sets timeout in seconds to open new HTTP connection.
103
103
  * **http_timeout** sets timeout in seconds to read data from a server.
104
+ * **follow_redirect** enables HTTP redirection support.
104
105
  * **model_version** set the presto version to which a job is submitted. Supported versions are 316, 303, 0.205, 0.178, 0.173, 0.153 and 0.149. Default is 316.
105
106
 
106
107
  See [RDoc](http://www.rubydoc.info/gems/presto-client/) for the full documentation.
@@ -60,7 +60,9 @@ module Presto::Client
60
60
  if options[:user] && options[:password]
61
61
  faraday.basic_auth(options[:user], options[:password])
62
62
  end
63
-
63
+ if options[:follow_redirect]
64
+ faraday.use FaradayMiddleware::FollowRedirects
65
+ end
64
66
  faraday.response :logger if options[:http_debug]
65
67
  faraday.adapter Faraday.default_adapter
66
68
  end
@@ -16,6 +16,7 @@
16
16
  module Presto::Client
17
17
 
18
18
  require 'faraday'
19
+ require 'faraday_middleware'
19
20
  require 'presto/client/models'
20
21
  require 'presto/client/errors'
21
22
  require 'presto/client/faraday_client'
@@ -15,6 +15,6 @@
15
15
  #
16
16
  module Presto
17
17
  module Client
18
- VERSION = "0.6.3"
18
+ VERSION = "0.6.4"
19
19
  end
20
20
  end
@@ -20,6 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.required_ruby_version = ">= 1.9.1"
21
21
 
22
22
  gem.add_dependency "faraday", ["~> 0.12"]
23
+ gem.add_dependency "faraday_middleware", ["~> 0.12.2"]
23
24
  gem.add_dependency "msgpack", [">= 0.7.0"]
24
25
 
25
26
  gem.add_development_dependency "rake", [">= 0.9.2", "< 11.0"]
@@ -10,6 +10,7 @@ describe Presto::Client::StatementClient do
10
10
  time_zone: "US/Pacific",
11
11
  language: "ja_JP",
12
12
  debug: true,
13
+ follow_redirect: true
13
14
  }
14
15
  end
15
16
 
@@ -229,6 +230,19 @@ describe Presto::Client::StatementClient do
229
230
  statement_client.query_info
230
231
  end.should raise_error(PrestoHttpError, /Presto API returned unexpected data format./)
231
232
  end
233
+
234
+ it "is redirected if server returned 301" do
235
+ stub_request(:get, "http://localhost/v1/query/#{response_json2[:id]}").
236
+ with(headers: headers).
237
+ to_return(status: 301, headers: {"Location" => "http://localhost/v1/query/redirected"})
238
+
239
+ stub_request(:get, "http://localhost/v1/query/redirected").
240
+ with(headers: headers).
241
+ to_return(body: {"queryId" => "queryid"}.to_json)
242
+
243
+ query_info = statement_client.query_info
244
+ query_info.query_id.should == "queryid"
245
+ end
232
246
  end
233
247
 
234
248
  describe "Killing a query" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: presto-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-03 00:00:00.000000000 Z
11
+ date: 2021-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday_middleware
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.12.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.12.2
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: msgpack
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -121,6 +135,7 @@ executables: []
121
135
  extensions: []
122
136
  extra_rdoc_files: []
123
137
  files:
138
+ - ".github/CODEOWNERS"
124
139
  - ".github/PULL_REQUEST_TEMPLATE.md"
125
140
  - ".gitignore"
126
141
  - ".travis.yml"