trino-client 1.0.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -1
- data/.github/dependabot.yaml +10 -0
- data/.github/release-drafter.yml +45 -0
- data/.github/workflows/codeql-analysis.yml +71 -0
- data/.github/workflows/release-drafter.yml +29 -0
- data/.github/workflows/ruby.yml +23 -14
- data/.standard.yml +15 -0
- data/.standard_todo.yml +80 -0
- data/ChangeLog.md +46 -0
- data/Gemfile +3 -2
- data/Rakefile +8 -9
- data/lib/trino/client/faraday_client.rb +13 -5
- data/lib/trino/client/query.rb +5 -3
- data/lib/trino/client/statement_client.rb +5 -3
- data/lib/trino/client/version.rb +1 -1
- data/lib/trino/client.rb +2 -4
- data/lib/trino-client.rb +1 -1
- data/modelgen/modelgen.rb +3 -5
- data/modelgen/trino_models.rb +18 -20
- data/publish.rb +1 -2
- data/release.rb +10 -10
- data/spec/basic_query_spec.rb +1 -1
- data/spec/client_spec.rb +16 -16
- data/spec/gzip_spec.rb +1 -1
- data/spec/model_spec.rb +5 -3
- data/spec/spec_helper.rb +3 -2
- data/spec/statement_client_spec.rb +120 -123
- data/spec/tpch_query_spec.rb +1 -1
- data/trino-client-ruby/lib/trino-client-ruby.rb +1 -1
- data/trino-client-ruby/trino-client-ruby.gemspec +4 -4
- data/trino-client.gemspec +15 -14
- metadata +81 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75f357cf3802250a811cc36eb0a90df8285b3af65628b9f565925717e93eacc0
|
4
|
+
data.tar.gz: 0a2ef69d01c1de0a89ce43a3484e327f79d9c1c7ea25505256966e0e92898937
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ed54c1d18de055e1e5ad13f56c43e43281c3d461528715f3d1714e6be36c0f515eea276dd4a828291df3e683f4795b92ecb9ff020449b55a09518ccc47e1218
|
7
|
+
data.tar.gz: 8da515df1401c00c1bedf58548a30f9eec14ead897c564dab3200f6a57f08883e5a5d94f1a4864fb93a17ddbef868eea56703cf1c86b4ccd3ca5c749d718f1c4
|
data/.github/CODEOWNERS
CHANGED
@@ -1 +1 @@
|
|
1
|
-
* @treasure-data/
|
1
|
+
* @treasure-data/query
|
@@ -0,0 +1,45 @@
|
|
1
|
+
name-template: 'v$RESOLVED_VERSION'
|
2
|
+
tag-template: 'v$RESOLVED_VERSION'
|
3
|
+
categories:
|
4
|
+
- title: '🚀 Features'
|
5
|
+
labels:
|
6
|
+
- 'feature'
|
7
|
+
- 'enhancement'
|
8
|
+
- title: '🐛 Bug Fixes'
|
9
|
+
labels:
|
10
|
+
- 'bug'
|
11
|
+
- title: '👋 Deprecated'
|
12
|
+
labels:
|
13
|
+
- 'deprecation'
|
14
|
+
- title: '⛓ Dependency Updates'
|
15
|
+
label:
|
16
|
+
- 'library-update'
|
17
|
+
- 'test-library-update'
|
18
|
+
- 'dependencies'
|
19
|
+
- title: '🛠 Internal Updates'
|
20
|
+
label:
|
21
|
+
- 'internal'
|
22
|
+
- 'kaizen'
|
23
|
+
- 'chore'
|
24
|
+
- title: '📚 Docs'
|
25
|
+
labels:
|
26
|
+
- 'doc'
|
27
|
+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
28
|
+
|
29
|
+
template: |
|
30
|
+
## What's Changed
|
31
|
+
$CHANGES
|
32
|
+
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
|
33
|
+
|
34
|
+
autolabeler:
|
35
|
+
- label: 'doc'
|
36
|
+
files:
|
37
|
+
- '*.md'
|
38
|
+
- '*.yml'
|
39
|
+
- '*.yaml'
|
40
|
+
- label: 'bug'
|
41
|
+
title:
|
42
|
+
- '/fix/i'
|
43
|
+
- label: 'deprecation'
|
44
|
+
title:
|
45
|
+
- '/deprecate/i'
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
2
|
+
# to commit it to your repository.
|
3
|
+
#
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
5
|
+
# or to provide custom queries or build logic.
|
6
|
+
#
|
7
|
+
# ******** NOTE ********
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
10
|
+
# supported CodeQL languages.
|
11
|
+
#
|
12
|
+
name: "CodeQL"
|
13
|
+
|
14
|
+
on:
|
15
|
+
push:
|
16
|
+
branches: [master]
|
17
|
+
pull_request:
|
18
|
+
# The branches below must be a subset of the branches above
|
19
|
+
branches: [master]
|
20
|
+
schedule:
|
21
|
+
- cron: "15 3 * * 1"
|
22
|
+
|
23
|
+
jobs:
|
24
|
+
analyze:
|
25
|
+
name: Analyze
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
permissions:
|
28
|
+
actions: read
|
29
|
+
contents: read
|
30
|
+
security-events: write
|
31
|
+
|
32
|
+
strategy:
|
33
|
+
fail-fast: false
|
34
|
+
matrix:
|
35
|
+
language: ["ruby"]
|
36
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
37
|
+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
38
|
+
|
39
|
+
steps:
|
40
|
+
- name: Checkout repository
|
41
|
+
uses: actions/checkout@v3
|
42
|
+
|
43
|
+
# Initializes the CodeQL tools for scanning.
|
44
|
+
- name: Initialize CodeQL
|
45
|
+
uses: github/codeql-action/init@v2
|
46
|
+
with:
|
47
|
+
languages: ${{ matrix.language }}
|
48
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
49
|
+
# By default, queries listed here will override any specified in a config file.
|
50
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
51
|
+
|
52
|
+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
53
|
+
# queries: security-extended,security-and-quality
|
54
|
+
|
55
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
56
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
57
|
+
- name: Autobuild
|
58
|
+
uses: github/codeql-action/autobuild@v2
|
59
|
+
|
60
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
61
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
62
|
+
|
63
|
+
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
64
|
+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
65
|
+
|
66
|
+
# - run: |
|
67
|
+
# echo "Run, Build Application using script"
|
68
|
+
# ./location_of_script_within_repo/buildscript.sh
|
69
|
+
|
70
|
+
- name: Perform CodeQL Analysis
|
71
|
+
uses: github/codeql-action/analyze@v2
|
@@ -0,0 +1,29 @@
|
|
1
|
+
---
|
2
|
+
name: Release Drafter
|
3
|
+
|
4
|
+
on:
|
5
|
+
workflow_dispatch:
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- master
|
9
|
+
pull_request:
|
10
|
+
# Only following types are handled by the action, but one can default to all as well
|
11
|
+
types: [opened, reopened, synchronize]
|
12
|
+
# pull_request_target event is required for auto-labeler to support PRs from forks
|
13
|
+
pull_request_target:
|
14
|
+
types: [opened, reopened, synchronize]
|
15
|
+
|
16
|
+
permissions:
|
17
|
+
contents: read
|
18
|
+
|
19
|
+
jobs:
|
20
|
+
update_release_draft:
|
21
|
+
permissions:
|
22
|
+
contents: write
|
23
|
+
pull-requests: write
|
24
|
+
runs-on: ubuntu-latest
|
25
|
+
steps:
|
26
|
+
# Drafts your next Release notes as Pull Requests are merged into "master"
|
27
|
+
- uses: release-drafter/release-drafter@v5
|
28
|
+
env:
|
29
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
data/.github/workflows/ruby.yml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
---
|
1
2
|
# This workflow uses actions that are not certified by GitHub.
|
2
3
|
# They are provided by a third-party and are governed by
|
3
4
|
# separate terms of service, privacy policy, and support
|
@@ -7,24 +8,32 @@
|
|
7
8
|
|
8
9
|
name: Ruby
|
9
10
|
|
10
|
-
on:
|
11
|
+
on:
|
12
|
+
push:
|
13
|
+
branches:
|
14
|
+
- main
|
15
|
+
- master
|
16
|
+
pull_request:
|
11
17
|
|
12
18
|
jobs:
|
13
19
|
test:
|
14
20
|
runs-on: ubuntu-latest
|
15
21
|
strategy:
|
22
|
+
fail-fast: false
|
16
23
|
matrix:
|
17
|
-
ruby-version: ['2.
|
18
|
-
|
24
|
+
ruby-version: ['2.7', '3.0', '3.2']
|
25
|
+
faraday-version: ['~> 1', '~> 2']
|
26
|
+
env:
|
27
|
+
FARADAY_VERSION: ${{ matrix.faraday-version }}
|
28
|
+
timeout-minutes: 5 # Typically ends within 1-2 min
|
19
29
|
steps:
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
run: bundle exec rake spec
|
30
|
+
- uses: actions/checkout@v3
|
31
|
+
- name: Set up Ruby
|
32
|
+
uses: ruby/setup-ruby@v1
|
33
|
+
with:
|
34
|
+
ruby-version: ${{ matrix.ruby-version }}
|
35
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
36
|
+
- name: Check coding style
|
37
|
+
run: bundle exec standardrb
|
38
|
+
- name: Run tests
|
39
|
+
run: bundle exec rake spec
|
data/.standard.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
fix: false
|
3
|
+
format: progress # default: Standard::Formatter
|
4
|
+
default_ignores: false # default: true
|
5
|
+
|
6
|
+
ignore:
|
7
|
+
- 'vendor/bundle/**/*'
|
8
|
+
- lib/trino/client/model_versions/0.149.rb
|
9
|
+
- lib/trino/client/model_versions/0.153.rb
|
10
|
+
- lib/trino/client/model_versions/0.173.rb
|
11
|
+
- lib/trino/client/model_versions/0.178.rb
|
12
|
+
- lib/trino/client/model_versions/0.205.rb
|
13
|
+
- lib/trino/client/model_versions/303.rb
|
14
|
+
- lib/trino/client/model_versions/316.rb
|
15
|
+
- lib/trino/client/model_versions/351.rb
|
data/.standard_todo.yml
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
ignore:
|
3
|
+
- 'lib/trino/client/*.rb':
|
4
|
+
- Layout/EmptyLinesAroundModuleBody
|
5
|
+
- Layout/FirstHashElementIndentation
|
6
|
+
- Layout/SpaceAroundEqualsInParameterDefault
|
7
|
+
- Layout/SpaceInsideBlockBraces
|
8
|
+
- Layout/SpaceInsideBlockBraces
|
9
|
+
- Lint/AssignmentInCondition
|
10
|
+
- Lint/UselessAssignment
|
11
|
+
- Naming/VariableName
|
12
|
+
- Performance/RegexpMatch
|
13
|
+
- Performance/StringReplacement
|
14
|
+
- Style/ConditionalAssignment
|
15
|
+
- Style/HashConversion
|
16
|
+
- Style/HashSyntax
|
17
|
+
- Style/NilComparison
|
18
|
+
- Style/RedundantBegin
|
19
|
+
- Style/RedundantFileExtensionInRequire
|
20
|
+
- Style/RedundantInterpolation
|
21
|
+
- Style/RedundantReturn
|
22
|
+
- Style/RedundantSelf
|
23
|
+
- Style/SafeNavigation
|
24
|
+
- Style/Semicolon
|
25
|
+
- Style/StringLiterals
|
26
|
+
- Style/StringLiteralsInInterpolation
|
27
|
+
- Style/TernaryParentheses
|
28
|
+
- Style/TrailingCommaInHashLiteral
|
29
|
+
|
30
|
+
- 'modelgen/model_versions.rb': &modelgen_common
|
31
|
+
- Style/StringLiterals # TODO: Remove this later
|
32
|
+
- Layout/DotPosition # TODO: Remove this later
|
33
|
+
# NOTE: Selecting the below items
|
34
|
+
- Layout/ArrayAlignment
|
35
|
+
- Layout/EmptyLinesAroundExceptionHandlingKeywords
|
36
|
+
- Layout/FirstArrayElementIndentation
|
37
|
+
- Layout/FirstHashElementIndentation
|
38
|
+
- Lint/AssignmentInCondition
|
39
|
+
- Lint/Syntax
|
40
|
+
- Lint/UselessAssignment
|
41
|
+
- Performance/FlatMap
|
42
|
+
- Performance/RegexpMatch
|
43
|
+
- Style/InfiniteLoop
|
44
|
+
- Style/RedundantRegexpCharacterClass
|
45
|
+
- Style/RedundantRegexpEscape
|
46
|
+
- Style/StringLiteralsInInterpolation
|
47
|
+
- 'modelgen/modelgen.rb': *modelgen_common
|
48
|
+
- 'modelgen/models.rb': *modelgen_common
|
49
|
+
- 'modelgen/trino_models.rb': *modelgen_common
|
50
|
+
- 'spec/*.rb':
|
51
|
+
- Style/StringLiterals # TODO: Remove this later
|
52
|
+
- Layout/DotPosition # TODO: Remove this later
|
53
|
+
- Style/RedundantBegin
|
54
|
+
- Style/TrailingCommaInHashLiteral
|
55
|
+
- Lint/Void
|
56
|
+
- Layout/FirstHashElementIndentation
|
57
|
+
- Style/For
|
58
|
+
- Style/Semicolon
|
59
|
+
- Lint/UselessAssignment
|
60
|
+
- Style/MixinUsage
|
61
|
+
# NOTE: Selecting the below items
|
62
|
+
- Layout/ClosingParenthesisIndentation
|
63
|
+
- Layout/HashAlignment
|
64
|
+
- Layout/IndentationConsistency
|
65
|
+
- Layout/MultilineMethodCallBraceLayout
|
66
|
+
- Layout/MultilineMethodCallIndentation
|
67
|
+
- Lint/ElseLayout
|
68
|
+
- Lint/ParenthesesAsGroupedExpression
|
69
|
+
- Style/HashSyntax
|
70
|
+
- Style/IfWithSemicolon
|
71
|
+
- Style/MethodCallWithoutArgsParentheses
|
72
|
+
- Style/OneLineConditional
|
73
|
+
- Style/RescueStandardError
|
74
|
+
- Style/StderrPuts
|
75
|
+
- '**/*.gemspec':
|
76
|
+
- Layout/ExtraSpacing
|
77
|
+
- 'release.rb':
|
78
|
+
- Style/TrailingCommaInArguments
|
79
|
+
- Style/SlicingWithRange
|
80
|
+
- Style/GlobalStdStream
|
data/ChangeLog.md
CHANGED
@@ -1,5 +1,51 @@
|
|
1
1
|
trino-client-ruby
|
2
2
|
====
|
3
|
+
## 2.0.0
|
4
|
+
- Bump actions/checkout from 2 to 3 ([#99](https://github.com/treasure-data/trino-client-ruby/issues/99)) [[3022dc1](https://github.com/treasure-data/trino-client-ruby/commit/3022dc1)]
|
5
|
+
- linter: Enable linter on lib ([#98](https://github.com/treasure-data/trino-client-ruby/issues/98)) [[1c043cd](https://github.com/treasure-data/trino-client-ruby/commit/1c043cd)]
|
6
|
+
- ci: fix typo ([#97](https://github.com/treasure-data/trino-client-ruby/issues/97)) [[69d966d](https://github.com/treasure-data/trino-client-ruby/commit/69d966d)]
|
7
|
+
- Faraday 2.x and 1.x cross support ([#94](https://github.com/treasure-data/trino-client-ruby/issues/94)) [[401639e](https://github.com/treasure-data/trino-client-ruby/commit/401639e)]
|
8
|
+
- "push" event on pull requests are redundant ([#95](https://github.com/treasure-data/trino-client-ruby/issues/95)) [[f935407](https://github.com/treasure-data/trino-client-ruby/commit/f935407)]
|
9
|
+
- Fix for Ruby 3.2.x ([#92](https://github.com/treasure-data/trino-client-ruby/issues/92)) [[3e8fad5](https://github.com/treasure-data/trino-client-ruby/commit/3e8fad5)]
|
10
|
+
- Update CODEOWNERS [[4d8709a](https://github.com/treasure-data/trino-client-ruby/commit/4d8709a)]
|
11
|
+
- Merge pull request [#90](https://github.com/treasure-data/trino-client-ruby/issues/90) from treasure-data/release-drafter [[390a745](https://github.com/treasure-data/trino-client-ruby/commit/390a745)]
|
12
|
+
- Merge pull request [#80](https://github.com/treasure-data/trino-client-ruby/issues/80) from treasure-data/dependabot/bundler/rspec-tw-3.12.0 [[b525d85](https://github.com/treasure-data/trino-client-ruby/commit/b525d85)]
|
13
|
+
- Migrate legacy "should" to "expect" [[9c22bb0](https://github.com/treasure-data/trino-client-ruby/commit/9c22bb0)]
|
14
|
+
- Bump rake so it works with rspec 3.x [[7354526](https://github.com/treasure-data/trino-client-ruby/commit/7354526)]
|
15
|
+
- Update rspec requirement from ~> 2.13.0 to ~> 3.12.0 [[0c82814](https://github.com/treasure-data/trino-client-ruby/commit/0c82814)]
|
16
|
+
- Merge pull request [#91](https://github.com/treasure-data/trino-client-ruby/issues/91) from treasure-data/dependabot/bundler/standard-tw-1.24.3 [[ec7a559](https://github.com/treasure-data/trino-client-ruby/commit/ec7a559)]
|
17
|
+
- Remove the deprecated "test_files" to make the gem package smaller [[7e03774](https://github.com/treasure-data/trino-client-ruby/commit/7e03774)]
|
18
|
+
- Use parentheses with complex conditions [[c6351b7](https://github.com/treasure-data/trino-client-ruby/commit/c6351b7)]
|
19
|
+
- Remove redundant escape [[b52d244](https://github.com/treasure-data/trino-client-ruby/commit/b52d244)]
|
20
|
+
- Update standard requirement from ~> 1.12.1 to ~> 1.24.3 [[0723dc7](https://github.com/treasure-data/trino-client-ruby/commit/0723dc7)]
|
21
|
+
- Introduce release-drafter github action [[7cf538b](https://github.com/treasure-data/trino-client-ruby/commit/7cf538b)]
|
22
|
+
- Run unit tests in github actions with ruby 3 ([#89](https://github.com/treasure-data/trino-client-ruby/issues/89)) [[58e899d](https://github.com/treasure-data/trino-client-ruby/commit/58e899d)]
|
23
|
+
- Upgrade minimum ruby version to 2.7 ([#86](https://github.com/treasure-data/trino-client-ruby/issues/86)) [[07921fd](https://github.com/treasure-data/trino-client-ruby/commit/07921fd)]
|
24
|
+
- Bump ruby/setup-ruby from 1.61.0 to 1.133.2 ([#85](https://github.com/treasure-data/trino-client-ruby/issues/85)) [[79e722c](https://github.com/treasure-data/trino-client-ruby/commit/79e722c)]
|
25
|
+
- Update dependabot.yaml [[96cf01d](https://github.com/treasure-data/trino-client-ruby/commit/96cf01d)]
|
26
|
+
- Update addressable requirement from ~> 2.4.0 to ~> 2.8.1 ([#82](https://github.com/treasure-data/trino-client-ruby/issues/82)) [[24b0c9e](https://github.com/treasure-data/trino-client-ruby/commit/24b0c9e)]
|
27
|
+
- Update simplecov requirement from ~> 0.10.0 to ~> 0.22.0 ([#83](https://github.com/treasure-data/trino-client-ruby/issues/83)) [[8e46420](https://github.com/treasure-data/trino-client-ruby/commit/8e46420)]
|
28
|
+
- Merge pull request [#79](https://github.com/treasure-data/trino-client-ruby/issues/79) from treasure-data/dependabot/bundler/standard-tw-1.12.1 [[d82433f](https://github.com/treasure-data/trino-client-ruby/commit/d82433f)]
|
29
|
+
- Reformat [[8fb2672](https://github.com/treasure-data/trino-client-ruby/commit/8fb2672)]
|
30
|
+
- Update standard requirement from ~> 1.0.0 to ~> 1.12.1 [[bbb900f](https://github.com/treasure-data/trino-client-ruby/commit/bbb900f)]
|
31
|
+
- Create dependabot.yaml [[d1b619a](https://github.com/treasure-data/trino-client-ruby/commit/d1b619a)]
|
32
|
+
- Merge pull request [#78](https://github.com/treasure-data/trino-client-ruby/issues/78) from treasure-data/standardrb [[bed70c9](https://github.com/treasure-data/trino-client-ruby/commit/bed70c9)]
|
33
|
+
- Reformat Rakefile and etc [[6e08989](https://github.com/treasure-data/trino-client-ruby/commit/6e08989)]
|
34
|
+
- Introduce standard [[009173e](https://github.com/treasure-data/trino-client-ruby/commit/009173e)]
|
35
|
+
- Merge pull request [#76](https://github.com/treasure-data/trino-client-ruby/issues/76) from treasure-data/SECU-1152 [[5c9b488](https://github.com/treasure-data/trino-client-ruby/commit/5c9b488)]
|
36
|
+
- Remove ruby 2.5 from testing targets [[cdaa0e4](https://github.com/treasure-data/trino-client-ruby/commit/cdaa0e4)]
|
37
|
+
- Create codeql-analysis.yml [[116a17f](https://github.com/treasure-data/trino-client-ruby/commit/116a17f)]
|
38
|
+
- Merge pull request [#77](https://github.com/treasure-data/trino-client-ruby/issues/77) from treasure-data/retry-interval [[cfd99f6](https://github.com/treasure-data/trino-client-ruby/commit/cfd99f6)]
|
39
|
+
- Update retryable errors [[e8878f6](https://github.com/treasure-data/trino-client-ruby/commit/e8878f6)]
|
40
|
+
- Minor change for retry logic for testing [[190fd92](https://github.com/treasure-data/trino-client-ruby/commit/190fd92)]
|
41
|
+
|
42
|
+
## 1.0.2
|
43
|
+
- Merge pull request [#75](https://github.com/treasure-data/trino-client-ruby/issues/75) from evgeniy-b/1-0-1-fixes [[4cdd21f](https://github.com/treasure-data/trino-client-ruby/commit/4cdd21f)]
|
44
|
+
- Faraday basic auth deprecation fix [[5c20266](https://github.com/treasure-data/trino-client-ruby/commit/5c20266)]
|
45
|
+
- Gem::Specification#has_rdoc deprecation fix [[baaec53](https://github.com/treasure-data/trino-client-ruby/commit/baaec53)]
|
46
|
+
- Convert model_version to string to use gsub() [[7118ad5](https://github.com/treasure-data/trino-client-ruby/commit/7118ad5)]
|
47
|
+
- Fix model version check (operator priority) [[31c22f3](https://github.com/treasure-data/trino-client-ruby/commit/31c22f3)]
|
48
|
+
|
3
49
|
## 1.0.1
|
4
50
|
- Merge pull request [#73](https://github.com/treasure-data/trino-client-ruby/issues/73) from pedrombl/update-faraday [[2a6482c](https://github.com/treasure-data/trino-client-ruby/commit/2a6482c)]
|
5
51
|
- Merge pull request [#74](https://github.com/treasure-data/trino-client-ruby/issues/74) from takezoe/alias-gem [[6829f5b](https://github.com/treasure-data/trino-client-ruby/commit/6829f5b)]
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
|
-
require
|
2
|
+
require "bundler/gem_tasks"
|
3
3
|
|
4
|
-
require
|
5
|
-
require
|
4
|
+
require "rake/testtask"
|
5
|
+
require "rake/clean"
|
6
6
|
|
7
|
-
require
|
7
|
+
require "rspec/core/rake_task"
|
8
8
|
|
9
9
|
RSpec::Core::RakeTask.new(:spec)
|
10
10
|
|
11
|
-
task :
|
11
|
+
task default: [:spec, :build]
|
12
12
|
|
13
13
|
GEN_MODEL_VERSIONS = %w[
|
14
14
|
351
|
15
15
|
]
|
16
16
|
|
17
17
|
namespace "modelgen" do
|
18
|
-
task :
|
19
|
-
require
|
18
|
+
task latest: :all do
|
19
|
+
require "erb"
|
20
20
|
erb = ERB.new(File.read("modelgen/models.rb"))
|
21
21
|
@versions = GEN_MODEL_VERSIONS
|
22
22
|
@latest_version = GEN_MODEL_VERSIONS.last
|
@@ -24,7 +24,7 @@ namespace "modelgen" do
|
|
24
24
|
File.write("lib/trino/client/models.rb", data)
|
25
25
|
end
|
26
26
|
|
27
|
-
task :
|
27
|
+
task all: GEN_MODEL_VERSIONS
|
28
28
|
|
29
29
|
GEN_MODEL_VERSIONS.each do |ver|
|
30
30
|
file "build/trino-#{ver}.tar.gz" do
|
@@ -42,4 +42,3 @@ namespace "modelgen" do
|
|
42
42
|
task ver => "lib/trino/client/model_versions/#{ver}.rb"
|
43
43
|
end
|
44
44
|
end
|
45
|
-
|
@@ -14,6 +14,8 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
module Trino::Client
|
17
|
+
FARADAY1_USED = Faraday::VERSION.start_with?("1.")
|
18
|
+
private_constant :FARADAY1_USED
|
17
19
|
|
18
20
|
require 'cgi'
|
19
21
|
|
@@ -70,18 +72,24 @@ module Trino::Client
|
|
70
72
|
url = "#{ssl ? "https" : "http"}://#{server}"
|
71
73
|
proxy = options[:http_proxy] || options[:proxy] # :proxy is obsoleted
|
72
74
|
|
73
|
-
faraday_options = {url: url
|
75
|
+
faraday_options = {url: url}
|
76
|
+
faraday_options[:proxy] = "#{proxy}" if proxy
|
74
77
|
faraday_options[:ssl] = ssl if ssl
|
75
78
|
|
76
79
|
faraday = Faraday.new(faraday_options) do |faraday|
|
77
80
|
if options[:user] && options[:password]
|
78
|
-
faraday
|
81
|
+
# https://lostisland.github.io/faraday/middleware/authentication
|
82
|
+
if FARADAY1_USED
|
83
|
+
faraday.request(:basic_auth, options[:user], options[:password])
|
84
|
+
else
|
85
|
+
faraday.request :authorization, :basic, options[:user], options[:password]
|
86
|
+
end
|
79
87
|
end
|
80
88
|
if options[:follow_redirect]
|
81
|
-
faraday.
|
89
|
+
faraday.response :follow_redirects
|
82
90
|
end
|
83
91
|
if options[:gzip]
|
84
|
-
faraday.
|
92
|
+
faraday.request :gzip
|
85
93
|
end
|
86
94
|
faraday.response :logger if options[:http_debug]
|
87
95
|
faraday.adapter Faraday.default_adapter
|
@@ -123,7 +131,7 @@ module Trino::Client
|
|
123
131
|
|
124
132
|
def self.optional_headers(options)
|
125
133
|
usePrestoHeader = false
|
126
|
-
if
|
134
|
+
if options[:model_version] && options[:model_version] < 351
|
127
135
|
usePrestoHeader = true
|
128
136
|
end
|
129
137
|
|
data/lib/trino/client/query.rb
CHANGED
@@ -16,7 +16,8 @@
|
|
16
16
|
module Trino::Client
|
17
17
|
|
18
18
|
require 'faraday'
|
19
|
-
require '
|
19
|
+
require 'faraday/gzip'
|
20
|
+
require 'faraday/follow_redirects'
|
20
21
|
require 'trino/client/models'
|
21
22
|
require 'trino/client/errors'
|
22
23
|
require 'trino/client/faraday_client'
|
@@ -106,11 +107,12 @@ module Trino::Client
|
|
106
107
|
raise TrinoError, "Query #{@api.current_results.id} has no columns"
|
107
108
|
end
|
108
109
|
|
109
|
-
|
110
|
+
loop do
|
110
111
|
if data = @api.current_results.data
|
111
112
|
block.call(data)
|
112
113
|
end
|
113
|
-
|
114
|
+
break unless advance_and_raise
|
115
|
+
end
|
114
116
|
end
|
115
117
|
|
116
118
|
def query_info
|
@@ -34,7 +34,7 @@ module Trino::Client
|
|
34
34
|
@state = :running
|
35
35
|
@retry_timeout = options[:retry_timeout] || 120
|
36
36
|
if model_version = @options[:model_version]
|
37
|
-
@models = ModelVersions.const_get("V#{model_version.gsub(".", "_")}")
|
37
|
+
@models = ModelVersions.const_get("V#{model_version.to_s.gsub(".", "_")}")
|
38
38
|
else
|
39
39
|
@models = Models
|
40
40
|
end
|
@@ -193,7 +193,7 @@ module Trino::Client
|
|
193
193
|
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
194
194
|
attempts = 0
|
195
195
|
|
196
|
-
|
196
|
+
loop do
|
197
197
|
begin
|
198
198
|
response = @faraday.get(uri)
|
199
199
|
rescue Faraday::TimeoutError, Faraday::ConnectionFailed
|
@@ -218,7 +218,9 @@ module Trino::Client
|
|
218
218
|
|
219
219
|
attempts += 1
|
220
220
|
sleep attempts * 0.1
|
221
|
-
|
221
|
+
|
222
|
+
break unless (Process.clock_gettime(Process::CLOCK_MONOTONIC) - start) < @retry_timeout && !client_aborted?
|
223
|
+
end
|
222
224
|
|
223
225
|
exception! TrinoHttpError.new(408, "Trino API error due to timeout")
|
224
226
|
end
|
data/lib/trino/client/version.rb
CHANGED
data/lib/trino/client.rb
CHANGED
data/lib/trino-client.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require
|
1
|
+
require "trino/client"
|
data/modelgen/modelgen.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
if ARGV.length != 4
|
3
2
|
puts "usage: <model-version> <trino-source-dir> <template.erb> <output.rb>"
|
4
3
|
exit 1
|
@@ -70,7 +69,7 @@ name_mapping = Hash[*%w[
|
|
70
69
|
StatementStats StageStats ClientStageStats
|
71
70
|
ClientStageStats StageStats ClientStageStats
|
72
71
|
QueryResults Column ClientColumn
|
73
|
-
].each_slice(3).map { |x, y, z| [[x,y], z] }.flatten(1)]
|
72
|
+
].each_slice(3).map { |x, y, z| [[x, y], z] }.flatten(1)]
|
74
73
|
|
75
74
|
path_mapping = Hash[*%w[
|
76
75
|
ClientColumn client/trino-client/src/main/java/io/trino/client/Column.java
|
@@ -82,7 +81,7 @@ PartitionedOutputInfo core/trino-main/src/main/java/io/trino/operator/Partitione
|
|
82
81
|
TableWriterInfo core/trino-main/src/main/java/io/trino/operator/TableWriterOperator.java
|
83
82
|
TableInfo core/trino-main/src/main/java/io/trino/execution/TableInfo.java
|
84
83
|
DynamicFiltersStats core/trino-main/src/main/java/io/trino/server/DynamicFilterService.java
|
85
|
-
].map.with_index { |v,i| i % 2 == 0 ? v : (source_path + "/" + v) }]
|
84
|
+
].map.with_index { |v, i| (i % 2 == 0) ? v : (source_path + "/" + v) }]
|
86
85
|
|
87
86
|
# model => [ [key,nullable,type], ... ]
|
88
87
|
extra_fields = {
|
@@ -107,7 +106,7 @@ formatter = TrinoModels::ModelFormatter.new(
|
|
107
106
|
primitive_types: assume_primitive,
|
108
107
|
skip_types: skipped_models,
|
109
108
|
simple_classes: predefined_simple_classes,
|
110
|
-
enum_types: enum_types
|
109
|
+
enum_types: enum_types
|
111
110
|
)
|
112
111
|
formatter.format(models)
|
113
112
|
|
@@ -116,4 +115,3 @@ formatter.format(models)
|
|
116
115
|
|
117
116
|
data = erb.result
|
118
117
|
File.write(output_path, data)
|
119
|
-
|