trino-client 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43cef8b0e4d066cb1621453d85cd356d0403ce64f261c4a87b1d2dd1b3a89088
4
- data.tar.gz: a398c82885cd706560f5aa5dd8bb3ddd285e6af5d380741505be205e24c8dcc1
3
+ metadata.gz: 1c843bb17e992cc4b85e75d9c42b1d28defaab68b26226bd3f5157c9d3f66904
4
+ data.tar.gz: ade30ecd070ae456b719d3339bde72fd3e869a939f1a51dca5044015fd999f43
5
5
  SHA512:
6
- metadata.gz: 1fdced777c13761f88f53a12b8232a7b7aa5bf45511bf9e1035c3a8c22067389e5054383849926b10616985a1926d921b8b5dccf0e2ee06a48f6991c50abb790
7
- data.tar.gz: 57b8fd77d3e3909fc620ebb0e0aeb367d04ad6dd5a382230a4dd98b586381c1b9ef9ff0866e830fbeb1b3b2d1fa20f704abf145500c65f404bb36a8cbcad3da7
6
+ metadata.gz: 054b13b290fb880b8813a04803fd51d9d131ad225ed496b2fdc9df1c7441314692d6d52809fa3bfcafdb15dbebeebcfa94472e6dacbc4358ecc704c7264d8fed
7
+ data.tar.gz: 03674c67087e069bbf0976f612260da62987d394fa262d717a5f11dd1677f7e1fd4b326cc6609e0c9676e953052435516114199f4d09c2276955a37dc440e20d
@@ -0,0 +1,15 @@
1
+ ---
2
+ repos:
3
+ - repo: https://github.com/pre-commit/pre-commit-hooks
4
+ rev: v4.6.0
5
+ hooks:
6
+ - id: trailing-whitespace
7
+ - id: end-of-file-fixer
8
+ - id: check-yaml
9
+ - id: check-added-large-files
10
+ - id: check-merge-conflict
11
+ - id: check-json
12
+ - id: check-case-conflict
13
+ - id: mixed-line-ending
14
+ args: ['--fix=lf']
15
+ - id: forbid-submodules
data/CLAUDE.md ADDED
@@ -0,0 +1,74 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Development Commands
6
+
7
+ ### Testing
8
+ - `bundle exec rake spec` - Run all RSpec tests
9
+ - `bundle exec rspec spec/[filename]_spec.rb` - Run specific test file
10
+
11
+ ### Building
12
+ - `bundle exec rake build` - Build the gem
13
+ - `bundle exec rake` - Default task (runs spec and build)
14
+
15
+ ### Code Quality
16
+ - `bundle exec standardrb` - Run StandardRB linter (code style enforcement)
17
+ - `bundle exec standardrb --fix` - Auto-fix style issues
18
+
19
+ ### Model Generation
20
+ - `bundle exec rake modelgen:latest` - Generate model files from latest Trino version
21
+ - `bundle exec rake modelgen:all` - Generate all model versions
22
+
23
+ ## Architecture Overview
24
+
25
+ This is a Ruby client library for Trino (distributed SQL query engine). The architecture is layered:
26
+
27
+ ### Core Components
28
+
29
+ 1. **Client Layer** (`lib/trino/client/client.rb`):
30
+ - `Trino::Client::Client` - Main API entry point
31
+ - Provides `run()`, `run_with_names()`, `query()`, `kill()` methods
32
+ - Handles synchronous and streaming query execution
33
+
34
+ 2. **Query Layer** (`lib/trino/client/query.rb`):
35
+ - `Query` class - Manages query execution lifecycle
36
+ - Handles streaming results via `each_row`, `each_row_chunk`
37
+ - Provides column metadata and result transformation
38
+
39
+ 3. **Statement Client** (`lib/trino/client/statement_client.rb`):
40
+ - `StatementClient` - Low-level HTTP communication with Trino
41
+ - Manages query state machine (running, finished, failed, aborted)
42
+ - Handles retries, timeouts, and error conditions
43
+ - Supports both JSON and MessagePack response formats
44
+
45
+ 4. **HTTP Layer** (`lib/trino/client/faraday_client.rb`):
46
+ - Uses Faraday for HTTP requests with middleware for gzip and redirects
47
+ - Handles authentication, SSL configuration, proxy settings
48
+
49
+ ### Model System
50
+
51
+ - **Versioned Models** (`lib/trino/client/model_versions/`):
52
+ - Generated from Trino source code for different Trino versions
53
+ - Each version (351, 316, 303, etc.) has its own model definitions
54
+ - Default is version 351
55
+
56
+ - **Model Generation** (`modelgen/`):
57
+ - Automated model generation from Trino Java source
58
+ - Downloads Trino source and extracts model definitions
59
+
60
+ ### Key Features
61
+
62
+ - **Streaming Results**: Query results can be processed row-by-row without loading all data into memory
63
+ - **Timeout Control**: Supports both query-level and plan-level timeouts
64
+ - **Error Recovery**: Built-in retry logic for transient failures (502, 503, 504)
65
+ - **Multiple Result Formats**: Raw arrays, named hashes, or streaming iteration
66
+ - **ROW Type Support**: Can parse Trino ROW types into Ruby hashes via `transform_row`
67
+
68
+ ### Testing
69
+
70
+ Tests are organized by component:
71
+ - `spec/client_spec.rb` - Client API tests
72
+ - `spec/statement_client_spec.rb` - Low-level protocol tests
73
+ - `spec/column_value_parser_spec.rb` - Data parsing tests
74
+ - `spec/tpch_query_spec.rb` - Integration tests with TPC-H queries
data/ChangeLog.md CHANGED
@@ -1,5 +1,11 @@
1
1
  trino-client-ruby
2
2
  ====
3
+ ## 2.2.3
4
+ - Add .github/workflows/publisher.yml [[f9643b2](https://github.com/treasure-data/trino-client-ruby/commit/f9643b2)]
5
+ - Bump actions/checkout from 4 to 5 ([#141](https://github.com/treasure-data/trino-client-ruby/issues/141)) [[61372d4](https://github.com/treasure-data/trino-client-ruby/commit/61372d4)]
6
+ - Update standard requirement from ~> 1.35.0 to ~> 1.50.0 ([#139](https://github.com/treasure-data/trino-client-ruby/issues/139)) [[e4c95a6](https://github.com/treasure-data/trino-client-ruby/commit/e4c95a6)]
7
+ - misc: Add CLAUDE.md and etc ([#138](https://github.com/treasure-data/trino-client-ruby/issues/138)) [[1a0e975](https://github.com/treasure-data/trino-client-ruby/commit/1a0e975)]
8
+
3
9
  ## 2.2.2
4
10
  - Close StatementClient when hitting client-side timeout ([#136](https://github.com/treasure-data/trino-client-ruby/issues/136)) [[b3261b1](https://github.com/treasure-data/trino-client-ruby/commit/b3261b1)]
5
11
  - Tune Ruby versions in CI / Drop ruby 2.7, 3.0 and 3.1 supports ([#135](https://github.com/treasure-data/trino-client-ruby/issues/135)) [[da87c84](https://github.com/treasure-data/trino-client-ruby/commit/da87c84)]
@@ -15,6 +15,6 @@
15
15
  #
16
16
  module Trino
17
17
  module Client
18
- VERSION = "2.2.2"
18
+ VERSION = "2.2.3"
19
19
  end
20
20
  end
data/trino-client.gemspec CHANGED
@@ -31,6 +31,6 @@ Gem::Specification.new do |gem|
31
31
  gem.add_development_dependency "webmock", ["~> 3.0"]
32
32
  gem.add_development_dependency "addressable", "~> 2.8.1" # 2.5.0 doesn't support Ruby 1.9.3
33
33
  gem.add_development_dependency "simplecov", "~> 0.22.0"
34
- gem.add_development_dependency "standard", "~> 1.35.0"
34
+ gem.add_development_dependency "standard", "~> 1.50.0"
35
35
  gem.add_development_dependency "psych", "~> 3"
36
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trino-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-17 00:00:00.000000000 Z
11
+ date: 2025-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -154,14 +154,14 @@ dependencies:
154
154
  requirements:
155
155
  - - "~>"
156
156
  - !ruby/object:Gem::Version
157
- version: 1.35.0
157
+ version: 1.50.0
158
158
  type: :development
159
159
  prerelease: false
160
160
  version_requirements: !ruby/object:Gem::Requirement
161
161
  requirements:
162
162
  - - "~>"
163
163
  - !ruby/object:Gem::Version
164
- version: 1.35.0
164
+ version: 1.50.0
165
165
  - !ruby/object:Gem::Dependency
166
166
  name: psych
167
167
  requirement: !ruby/object:Gem::Requirement
@@ -183,6 +183,8 @@ executables: []
183
183
  extensions: []
184
184
  extra_rdoc_files: []
185
185
  files:
186
+ - ".pre-commit-config.yaml"
187
+ - CLAUDE.md
186
188
  - ChangeLog.md
187
189
  - LICENSE
188
190
  - README.md
@@ -225,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
227
  - !ruby/object:Gem::Version
226
228
  version: '0'
227
229
  requirements: []
228
- rubygems_version: 3.1.6
230
+ rubygems_version: 3.4.19
229
231
  signing_key:
230
232
  specification_version: 4
231
233
  summary: Trino client library