swa 0.8.4 → 0.8.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: f97ea85d4f432b6ea61fb652ce14f5ea50f1827aa3056437869f9eb6fcd28f83
4
- data.tar.gz: 00e6d4f165f754f6dc4d03d4c45c09075b7235961527d1792eec649f8475b67e
3
+ metadata.gz: 731347c42ce0823ababd94ff7eeb58ea42e9d42cfbf152cea6d103356f8ea9d2
4
+ data.tar.gz: fe2feaa04f3fd3df8f2664160b70d362050b587e22772018a6221ebe13482ff5
5
5
  SHA512:
6
- metadata.gz: da5a54d7e1ec1da3b3860cf27ae60e5548eb007679ff7158eb6c8e0ae7f82b49592c553b6920b230773302a7318d5f2d651ba2bfc1d5c7c37d9256bc51fc1aa6
7
- data.tar.gz: 10134f56ec3a62439470d5f0148a8e3df4804338ff86a18c824da2795866fd1512cfab71c75f8bd9de45b1f3f5b1ab7b3c092825e4d88b6c89c47c3640bf084c
6
+ metadata.gz: a2e6b01eb2be3d32536688c14db2b5511281f735b989716a26be37a8feb773ee153497de1a9ac1816112cedf8b5387ab656db38e14da1f8bbe6f6245e37965a1
7
+ data.tar.gz: 9a6939b4984e7a5eb0e2a66e795312e91e634a173310607b2bcf3f2ba4f885a4fc98bb8ee51b6ca201465922c14a60d813f5ac0e54e0321ae8a1e1b4935fc7d9
@@ -112,7 +112,11 @@ module Swa
112
112
  )
113
113
  wait_for_query(start_query_response.query_execution_id)
114
114
  query_results = athena_client.get_query_results(query_execution_id: start_query_response.query_execution_id)
115
- output_results_as_csv(query_results.result_set)
115
+ if query =~ /\AEXPLAIN/
116
+ output_explain_result(query_results.result_set)
117
+ else
118
+ output_results_as_csv(query_results.result_set)
119
+ end
116
120
  end
117
121
 
118
122
  private
@@ -127,6 +131,12 @@ module Swa
127
131
  signal_error error.response.query_execution.status.state_change_reason
128
132
  end
129
133
 
134
+ def output_explain_result(result_set)
135
+ result_set.rows.drop(1).each do |row|
136
+ puts row.data.first.var_char_value
137
+ end
138
+ end
139
+
130
140
  end
131
141
 
132
142
  subcommand ["workgroups", "wgs"], "Show work-groups" do
@@ -27,6 +27,8 @@ module Swa
27
27
  super(arguments)
28
28
  rescue Aws::Errors::MissingCredentialsError
29
29
  signal_error "no credentials provided"
30
+ rescue Aws::Errors::MissingRegionError, Aws::Errors::InvalidRegionError => e
31
+ signal_error e.message
30
32
  rescue Aws::Errors::ServiceError => e
31
33
  signal_error e.message
32
34
  end
data/lib/swa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Swa
2
- VERSION = "0.8.4"
2
+ VERSION = "0.8.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Williams
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-09 00:00:00.000000000 Z
11
+ date: 2024-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler