presto-client 0.6.4 → 0.6.5

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: 23d42cbbd7d572f7238f5e39af0cca4e40035573fef9077ccef1f7852160921e
4
- data.tar.gz: af8a62c9ec3e04a5022a92a296a6c502eedbfaebe699d68084ee1095f11a8f64
3
+ metadata.gz: 8cb6ac1dfeb58b647cc65a99ccce35255a53bbf4d06b9f7079f37f079f514e1e
4
+ data.tar.gz: eb1128d76aa3997753e599d004017ad237e246076e81fd4590f7b13d0c0051fa
5
5
  SHA512:
6
- metadata.gz: b74979366b8c96380c8efac4bec4fa28cdc064925535c66901bdd6f4254aca35596db73da704762736282046c140d78ca783f10fc5146199eb1eafe67eace673
7
- data.tar.gz: 1dfddc8c0a767d672bc5a807e2a01503d2b1e20f94cbcf88ae32ccf6bdc89d8a54adc05818094a6eb00ef0be1ad566f879dedbaae217ae6ee9934e18f0d7bd00
6
+ metadata.gz: 2f1edf235287c8f796ff8b68c6692ec40e9553f92553005762464316c315382c90141f6a0482985c13460fad3a817271de8fcf51bb22267ec987e6366c7da2c7
7
+ data.tar.gz: 703da9686376aa49ac0fb477d7a41ac4eae255a10342aecb1ce6bd1646c9f64f67ab43a03f53f47409489f99f5078e5cbdf790982cae48b714105b28db2df99c
data/ChangeLog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  presto-client-ruby
2
2
  ====
3
+ ## 0.6.5
4
+ - Add gzip option ([#68](https://github.com/treasure-data/presto-client-ruby/issues/68)) [[1f43629](https://github.com/treasure-data/presto-client-ruby/commit/1f43629)]
5
+ - Bump tiny-presto to 0.0.7 to use docker image in GitHub Container Registry ([#69](https://github.com/treasure-data/presto-client-ruby/issues/69)) [[57b5045](https://github.com/treasure-data/presto-client-ruby/commit/57b5045)]
6
+
3
7
  ## 0.6.4
4
8
  - 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
9
  - Update README.md to describe follow_redirect option [[83f8a05](https://github.com/treasure-data/presto-client-ruby/commit/83f8a05)]
data/Gemfile CHANGED
@@ -2,5 +2,5 @@ source 'https://rubygems.org/'
2
2
  gemspec
3
3
 
4
4
  group :development, :test do
5
- gem 'tiny-presto', '~> 0.0.5'
5
+ gem 'tiny-presto', '~> 0.0.7'
6
6
  end
data/README.md CHANGED
@@ -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
+ * **gzip** enables gzip compression.
104
105
  * **follow_redirect** enables HTTP redirection support.
105
106
  * **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.
106
107
 
@@ -63,6 +63,9 @@ module Presto::Client
63
63
  if options[:follow_redirect]
64
64
  faraday.use FaradayMiddleware::FollowRedirects
65
65
  end
66
+ if options[:gzip]
67
+ faraday.use FaradayMiddleware::Gzip
68
+ end
66
69
  faraday.response :logger if options[:http_debug]
67
70
  faraday.adapter Faraday.default_adapter
68
71
  end
@@ -15,6 +15,6 @@
15
15
  #
16
16
  module Presto
17
17
  module Client
18
- VERSION = "0.6.4"
18
+ VERSION = "0.6.5"
19
19
  end
20
20
  end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Presto::Client::Client do
4
4
  before(:all) do
5
5
  WebMock.disable!
6
- @cluster = TinyPresto::Cluster.new('316')
6
+ @cluster = TinyPresto::Cluster.new('ghcr.io/trinodb/presto', '316')
7
7
  @container = @cluster.run
8
8
  @client = Presto::Client.new(server: 'localhost:8080', catalog: 'memory', user: 'test-user', schema: 'default')
9
9
  loop do
data/spec/gzip_spec.rb ADDED
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+
3
+ describe Presto::Client::Client do
4
+ before(:all) do
5
+ @spec_path = File.dirname(__FILE__)
6
+ WebMock.disable!
7
+ @cluster = TinyPresto::Cluster.new('ghcr.io/trinodb/presto', '316')
8
+ @container = @cluster.run
9
+ @client = Presto::Client.new(server: 'localhost:8080', catalog: 'tpch', user: 'test-user', schema: 'tiny', gzip: true, http_debug: true)
10
+ loop do
11
+ begin
12
+ # Make sure to all workers are available.
13
+ @client.run('select 1234')
14
+ break
15
+ rescue StandardError => exception
16
+ puts "Waiting for cluster ready... #{exception}"
17
+ sleep(5)
18
+ end
19
+ end
20
+ puts 'Cluster is ready'
21
+ end
22
+
23
+ after(:all) do
24
+ @cluster.stop
25
+ WebMock.enable!
26
+ end
27
+
28
+ it 'tpch q01 with gzip option' do
29
+ $stdout = StringIO.new
30
+ begin
31
+ q = File.read("#{@spec_path}/tpch/q01.sql")
32
+ columns, rows = run_with_retry(@client, q)
33
+ expect(columns.length).to be(10)
34
+ expect(rows.length).to be(4)
35
+ expect($stdout.string).to include ('content-encoding: "gzip"')
36
+ ensure
37
+ $stdout = STDOUT
38
+ end
39
+ end
40
+ end
@@ -4,7 +4,7 @@ describe Presto::Client::Client do
4
4
  before(:all) do
5
5
  @spec_path = File.dirname(__FILE__)
6
6
  WebMock.disable!
7
- @cluster = TinyPresto::Cluster.new('316')
7
+ @cluster = TinyPresto::Cluster.new('ghcr.io/trinodb/presto', '316')
8
8
  @container = @cluster.run
9
9
  @client = Presto::Client.new(server: 'localhost:8080', catalog: 'tpch', user: 'test-user', schema: 'tiny')
10
10
  loop 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.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-19 00:00:00.000000000 Z
11
+ date: 2021-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -168,6 +168,7 @@ files:
168
168
  - release.rb
169
169
  - spec/basic_query_spec.rb
170
170
  - spec/client_spec.rb
171
+ - spec/gzip_spec.rb
171
172
  - spec/model_spec.rb
172
173
  - spec/spec_helper.rb
173
174
  - spec/statement_client_spec.rb
@@ -200,6 +201,7 @@ summary: Presto client library
200
201
  test_files:
201
202
  - spec/basic_query_spec.rb
202
203
  - spec/client_spec.rb
204
+ - spec/gzip_spec.rb
203
205
  - spec/model_spec.rb
204
206
  - spec/spec_helper.rb
205
207
  - spec/statement_client_spec.rb