athena_csv 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2234c75ec7b1bbcb05d99ce7ea772050ec0839362b290a8b91743fa55f65ebd7
4
+ data.tar.gz: 6f282e3d8d34660e103977902de9c79e362c3ba7298c664242eb3c204d3b3e16
5
+ SHA512:
6
+ metadata.gz: d68e78b3d46aeb358e4b714ff7e5b6ae4312390fcfe27f980620b107f68c60b75652244ab566cabcb7151a8c0956d1af66e367207fd87d2e99111fb4ed02b146
7
+ data.tar.gz: cfc15690c3e1bccb6f756f5a9873e519ebbe0a469f0b7d7c5fc29419255fa517dd290cff47eb4f2ebf12bdad6ebfcff410983b2141c5a207d29de7f69776486b
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.4.4
7
+ before_install: gem install bundler -v 1.16.5
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at dchatterjee@prognos.ai. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in athena_csv.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,636 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ athena_csv (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ aws-eventstream (1.0.1)
10
+ aws-partitions (1.106.0)
11
+ aws-sdk (3.0.1)
12
+ aws-sdk-resources (~> 3)
13
+ aws-sdk-acm (1.13.0)
14
+ aws-sdk-core (~> 3, >= 3.26.0)
15
+ aws-sigv4 (~> 1.0)
16
+ aws-sdk-acmpca (1.6.0)
17
+ aws-sdk-core (~> 3, >= 3.26.0)
18
+ aws-sigv4 (~> 1.0)
19
+ aws-sdk-alexaforbusiness (1.11.0)
20
+ aws-sdk-core (~> 3, >= 3.26.0)
21
+ aws-sigv4 (~> 1.0)
22
+ aws-sdk-apigateway (1.21.0)
23
+ aws-sdk-core (~> 3, >= 3.26.0)
24
+ aws-sigv4 (~> 1.0)
25
+ aws-sdk-applicationautoscaling (1.15.0)
26
+ aws-sdk-core (~> 3, >= 3.26.0)
27
+ aws-sigv4 (~> 1.0)
28
+ aws-sdk-applicationdiscoveryservice (1.7.0)
29
+ aws-sdk-core (~> 3, >= 3.26.0)
30
+ aws-sigv4 (~> 1.0)
31
+ aws-sdk-appstream (1.18.0)
32
+ aws-sdk-core (~> 3, >= 3.26.0)
33
+ aws-sigv4 (~> 1.0)
34
+ aws-sdk-appsync (1.8.0)
35
+ aws-sdk-core (~> 3, >= 3.26.0)
36
+ aws-sigv4 (~> 1.0)
37
+ aws-sdk-athena (1.6.0)
38
+ aws-sdk-core (~> 3, >= 3.26.0)
39
+ aws-sigv4 (~> 1.0)
40
+ aws-sdk-autoscaling (1.11.0)
41
+ aws-sdk-core (~> 3, >= 3.26.0)
42
+ aws-sigv4 (~> 1.0)
43
+ aws-sdk-autoscalingplans (1.7.0)
44
+ aws-sdk-core (~> 3, >= 3.26.0)
45
+ aws-sigv4 (~> 1.0)
46
+ aws-sdk-batch (1.9.0)
47
+ aws-sdk-core (~> 3, >= 3.26.0)
48
+ aws-sigv4 (~> 1.0)
49
+ aws-sdk-budgets (1.12.0)
50
+ aws-sdk-core (~> 3, >= 3.26.0)
51
+ aws-sigv4 (~> 1.0)
52
+ aws-sdk-cloud9 (1.6.0)
53
+ aws-sdk-core (~> 3, >= 3.26.0)
54
+ aws-sigv4 (~> 1.0)
55
+ aws-sdk-clouddirectory (1.9.0)
56
+ aws-sdk-core (~> 3, >= 3.26.0)
57
+ aws-sigv4 (~> 1.0)
58
+ aws-sdk-cloudformation (1.10.0)
59
+ aws-sdk-core (~> 3, >= 3.26.0)
60
+ aws-sigv4 (~> 1.0)
61
+ aws-sdk-cloudfront (1.10.0)
62
+ aws-sdk-core (~> 3, >= 3.26.0)
63
+ aws-sigv4 (~> 1.0)
64
+ aws-sdk-cloudhsm (1.8.0)
65
+ aws-sdk-core (~> 3, >= 3.26.0)
66
+ aws-sigv4 (~> 1.0)
67
+ aws-sdk-cloudhsmv2 (1.8.0)
68
+ aws-sdk-core (~> 3, >= 3.26.0)
69
+ aws-sigv4 (~> 1.0)
70
+ aws-sdk-cloudsearch (1.5.0)
71
+ aws-sdk-core (~> 3, >= 3.26.0)
72
+ aws-sigv4 (~> 1.0)
73
+ aws-sdk-cloudsearchdomain (1.5.0)
74
+ aws-sdk-core (~> 3, >= 3.26.0)
75
+ aws-sigv4 (~> 1.0)
76
+ aws-sdk-cloudtrail (1.6.0)
77
+ aws-sdk-core (~> 3, >= 3.26.0)
78
+ aws-sigv4 (~> 1.0)
79
+ aws-sdk-cloudwatch (1.12.0)
80
+ aws-sdk-core (~> 3, >= 3.26.0)
81
+ aws-sigv4 (~> 1.0)
82
+ aws-sdk-cloudwatchevents (1.10.0)
83
+ aws-sdk-core (~> 3, >= 3.26.0)
84
+ aws-sigv4 (~> 1.0)
85
+ aws-sdk-cloudwatchlogs (1.10.0)
86
+ aws-sdk-core (~> 3, >= 3.26.0)
87
+ aws-sigv4 (~> 1.0)
88
+ aws-sdk-codebuild (1.21.0)
89
+ aws-sdk-core (~> 3, >= 3.26.0)
90
+ aws-sigv4 (~> 1.0)
91
+ aws-sdk-codecommit (1.10.0)
92
+ aws-sdk-core (~> 3, >= 3.26.0)
93
+ aws-sigv4 (~> 1.0)
94
+ aws-sdk-codedeploy (1.10.0)
95
+ aws-sdk-core (~> 3, >= 3.26.0)
96
+ aws-sigv4 (~> 1.0)
97
+ aws-sdk-codepipeline (1.9.0)
98
+ aws-sdk-core (~> 3, >= 3.26.0)
99
+ aws-sigv4 (~> 1.0)
100
+ aws-sdk-codestar (1.7.0)
101
+ aws-sdk-core (~> 3, >= 3.26.0)
102
+ aws-sigv4 (~> 1.0)
103
+ aws-sdk-cognitoidentity (1.5.0)
104
+ aws-sdk-core (~> 3, >= 3.26.0)
105
+ aws-sigv4 (~> 1.0)
106
+ aws-sdk-cognitoidentityprovider (1.10.0)
107
+ aws-sdk-core (~> 3, >= 3.26.0)
108
+ aws-sigv4 (~> 1.0)
109
+ aws-sdk-cognitosync (1.5.0)
110
+ aws-sdk-core (~> 3, >= 3.26.0)
111
+ aws-sigv4 (~> 1.0)
112
+ aws-sdk-comprehend (1.8.0)
113
+ aws-sdk-core (~> 3, >= 3.26.0)
114
+ aws-sigv4 (~> 1.0)
115
+ aws-sdk-configservice (1.18.0)
116
+ aws-sdk-core (~> 3, >= 3.26.0)
117
+ aws-sigv4 (~> 1.0)
118
+ aws-sdk-connect (1.8.0)
119
+ aws-sdk-core (~> 3, >= 3.26.0)
120
+ aws-sigv4 (~> 1.0)
121
+ aws-sdk-core (3.35.0)
122
+ aws-eventstream (~> 1.0)
123
+ aws-partitions (~> 1.0)
124
+ aws-sigv4 (~> 1.0)
125
+ jmespath (~> 1.0)
126
+ aws-sdk-costandusagereportservice (1.5.0)
127
+ aws-sdk-core (~> 3, >= 3.26.0)
128
+ aws-sigv4 (~> 1.0)
129
+ aws-sdk-costexplorer (1.11.0)
130
+ aws-sdk-core (~> 3, >= 3.26.0)
131
+ aws-sigv4 (~> 1.0)
132
+ aws-sdk-databasemigrationservice (1.11.0)
133
+ aws-sdk-core (~> 3, >= 3.26.0)
134
+ aws-sigv4 (~> 1.0)
135
+ aws-sdk-datapipeline (1.5.0)
136
+ aws-sdk-core (~> 3, >= 3.26.0)
137
+ aws-sigv4 (~> 1.0)
138
+ aws-sdk-dax (1.7.0)
139
+ aws-sdk-core (~> 3, >= 3.26.0)
140
+ aws-sigv4 (~> 1.0)
141
+ aws-sdk-devicefarm (1.12.0)
142
+ aws-sdk-core (~> 3, >= 3.26.0)
143
+ aws-sigv4 (~> 1.0)
144
+ aws-sdk-directconnect (1.8.0)
145
+ aws-sdk-core (~> 3, >= 3.26.0)
146
+ aws-sigv4 (~> 1.0)
147
+ aws-sdk-directoryservice (1.10.0)
148
+ aws-sdk-core (~> 3, >= 3.26.0)
149
+ aws-sigv4 (~> 1.0)
150
+ aws-sdk-dlm (1.5.0)
151
+ aws-sdk-core (~> 3, >= 3.26.0)
152
+ aws-sigv4 (~> 1.0)
153
+ aws-sdk-dynamodb (1.15.0)
154
+ aws-sdk-core (~> 3, >= 3.26.0)
155
+ aws-sigv4 (~> 1.0)
156
+ aws-sdk-dynamodbstreams (1.5.0)
157
+ aws-sdk-core (~> 3, >= 3.26.0)
158
+ aws-sigv4 (~> 1.0)
159
+ aws-sdk-ec2 (1.53.0)
160
+ aws-sdk-core (~> 3, >= 3.26.0)
161
+ aws-sigv4 (~> 1.0)
162
+ aws-sdk-ecr (1.8.0)
163
+ aws-sdk-core (~> 3, >= 3.26.0)
164
+ aws-sigv4 (~> 1.0)
165
+ aws-sdk-ecs (1.22.0)
166
+ aws-sdk-core (~> 3, >= 3.26.0)
167
+ aws-sigv4 (~> 1.0)
168
+ aws-sdk-efs (1.6.0)
169
+ aws-sdk-core (~> 3, >= 3.26.0)
170
+ aws-sigv4 (~> 1.0)
171
+ aws-sdk-eks (1.6.0)
172
+ aws-sdk-core (~> 3, >= 3.26.0)
173
+ aws-sigv4 (~> 1.0)
174
+ aws-sdk-elasticache (1.9.0)
175
+ aws-sdk-core (~> 3, >= 3.26.0)
176
+ aws-sigv4 (~> 1.0)
177
+ aws-sdk-elasticbeanstalk (1.13.0)
178
+ aws-sdk-core (~> 3, >= 3.26.0)
179
+ aws-sigv4 (~> 1.0)
180
+ aws-sdk-elasticloadbalancing (1.7.0)
181
+ aws-sdk-core (~> 3, >= 3.26.0)
182
+ aws-sigv4 (~> 1.0)
183
+ aws-sdk-elasticloadbalancingv2 (1.16.0)
184
+ aws-sdk-core (~> 3, >= 3.26.0)
185
+ aws-sigv4 (~> 1.0)
186
+ aws-sdk-elasticsearchservice (1.14.0)
187
+ aws-sdk-core (~> 3, >= 3.26.0)
188
+ aws-sigv4 (~> 1.0)
189
+ aws-sdk-elastictranscoder (1.6.0)
190
+ aws-sdk-core (~> 3, >= 3.26.0)
191
+ aws-sigv4 (~> 1.0)
192
+ aws-sdk-emr (1.7.0)
193
+ aws-sdk-core (~> 3, >= 3.26.0)
194
+ aws-sigv4 (~> 1.0)
195
+ aws-sdk-firehose (1.8.0)
196
+ aws-sdk-core (~> 3, >= 3.26.0)
197
+ aws-sigv4 (~> 1.0)
198
+ aws-sdk-fms (1.6.0)
199
+ aws-sdk-core (~> 3, >= 3.26.0)
200
+ aws-sigv4 (~> 1.0)
201
+ aws-sdk-gamelift (1.9.0)
202
+ aws-sdk-core (~> 3, >= 3.26.0)
203
+ aws-sigv4 (~> 1.0)
204
+ aws-sdk-glacier (1.13.0)
205
+ aws-sdk-core (~> 3, >= 3.26.0)
206
+ aws-sigv4 (~> 1.0)
207
+ aws-sdk-glue (1.20.0)
208
+ aws-sdk-core (~> 3, >= 3.26.0)
209
+ aws-sigv4 (~> 1.0)
210
+ aws-sdk-greengrass (1.9.0)
211
+ aws-sdk-core (~> 3, >= 3.26.0)
212
+ aws-sigv4 (~> 1.0)
213
+ aws-sdk-guardduty (1.10.0)
214
+ aws-sdk-core (~> 3, >= 3.26.0)
215
+ aws-sigv4 (~> 1.0)
216
+ aws-sdk-health (1.7.0)
217
+ aws-sdk-core (~> 3, >= 3.26.0)
218
+ aws-sigv4 (~> 1.0)
219
+ aws-sdk-iam (1.10.0)
220
+ aws-sdk-core (~> 3, >= 3.26.0)
221
+ aws-sigv4 (~> 1.0)
222
+ aws-sdk-importexport (1.5.0)
223
+ aws-sdk-core (~> 3, >= 3.26.0)
224
+ aws-sigv2 (~> 1.0)
225
+ aws-sdk-inspector (1.11.0)
226
+ aws-sdk-core (~> 3, >= 3.26.0)
227
+ aws-sigv4 (~> 1.0)
228
+ aws-sdk-iot (1.18.0)
229
+ aws-sdk-core (~> 3, >= 3.26.0)
230
+ aws-sigv4 (~> 1.0)
231
+ aws-sdk-iot1clickdevicesservice (1.5.0)
232
+ aws-sdk-core (~> 3, >= 3.26.0)
233
+ aws-sigv4 (~> 1.0)
234
+ aws-sdk-iot1clickprojects (1.5.0)
235
+ aws-sdk-core (~> 3, >= 3.26.0)
236
+ aws-sigv4 (~> 1.0)
237
+ aws-sdk-iotanalytics (1.9.0)
238
+ aws-sdk-core (~> 3, >= 3.26.0)
239
+ aws-sigv4 (~> 1.0)
240
+ aws-sdk-iotdataplane (1.5.0)
241
+ aws-sdk-core (~> 3, >= 3.26.0)
242
+ aws-sigv4 (~> 1.0)
243
+ aws-sdk-iotjobsdataplane (1.6.0)
244
+ aws-sdk-core (~> 3, >= 3.26.0)
245
+ aws-sigv4 (~> 1.0)
246
+ aws-sdk-kinesis (1.8.0)
247
+ aws-sdk-core (~> 3, >= 3.26.0)
248
+ aws-sigv4 (~> 1.0)
249
+ aws-sdk-kinesisanalytics (1.7.0)
250
+ aws-sdk-core (~> 3, >= 3.26.0)
251
+ aws-sigv4 (~> 1.0)
252
+ aws-sdk-kinesisvideo (1.6.0)
253
+ aws-sdk-core (~> 3, >= 3.26.0)
254
+ aws-sigv4 (~> 1.0)
255
+ aws-sdk-kinesisvideoarchivedmedia (1.6.0)
256
+ aws-sdk-core (~> 3, >= 3.26.0)
257
+ aws-sigv4 (~> 1.0)
258
+ aws-sdk-kinesisvideomedia (1.5.0)
259
+ aws-sdk-core (~> 3, >= 3.26.0)
260
+ aws-sigv4 (~> 1.0)
261
+ aws-sdk-kms (1.11.0)
262
+ aws-sdk-core (~> 3, >= 3.26.0)
263
+ aws-sigv4 (~> 1.0)
264
+ aws-sdk-lambda (1.13.0)
265
+ aws-sdk-core (~> 3, >= 3.26.0)
266
+ aws-sigv4 (~> 1.0)
267
+ aws-sdk-lambdapreview (1.5.0)
268
+ aws-sdk-core (~> 3, >= 3.26.0)
269
+ aws-sigv4 (~> 1.0)
270
+ aws-sdk-lex (1.8.0)
271
+ aws-sdk-core (~> 3, >= 3.26.0)
272
+ aws-sigv4 (~> 1.0)
273
+ aws-sdk-lexmodelbuildingservice (1.11.0)
274
+ aws-sdk-core (~> 3, >= 3.26.0)
275
+ aws-sigv4 (~> 1.0)
276
+ aws-sdk-lightsail (1.10.0)
277
+ aws-sdk-core (~> 3, >= 3.26.0)
278
+ aws-sigv4 (~> 1.0)
279
+ aws-sdk-machinelearning (1.5.0)
280
+ aws-sdk-core (~> 3, >= 3.26.0)
281
+ aws-sigv4 (~> 1.0)
282
+ aws-sdk-macie (1.5.0)
283
+ aws-sdk-core (~> 3, >= 3.26.0)
284
+ aws-sigv4 (~> 1.0)
285
+ aws-sdk-marketplacecommerceanalytics (1.5.0)
286
+ aws-sdk-core (~> 3, >= 3.26.0)
287
+ aws-sigv4 (~> 1.0)
288
+ aws-sdk-marketplaceentitlementservice (1.5.0)
289
+ aws-sdk-core (~> 3, >= 3.26.0)
290
+ aws-sigv4 (~> 1.0)
291
+ aws-sdk-marketplacemetering (1.5.0)
292
+ aws-sdk-core (~> 3, >= 3.26.0)
293
+ aws-sigv4 (~> 1.0)
294
+ aws-sdk-mediaconvert (1.16.0)
295
+ aws-sdk-core (~> 3, >= 3.26.0)
296
+ aws-sigv4 (~> 1.0)
297
+ aws-sdk-medialive (1.14.0)
298
+ aws-sdk-core (~> 3, >= 3.26.0)
299
+ aws-sigv4 (~> 1.0)
300
+ aws-sdk-mediapackage (1.8.0)
301
+ aws-sdk-core (~> 3, >= 3.26.0)
302
+ aws-sigv4 (~> 1.0)
303
+ aws-sdk-mediastore (1.6.0)
304
+ aws-sdk-core (~> 3, >= 3.26.0)
305
+ aws-sigv4 (~> 1.0)
306
+ aws-sdk-mediastoredata (1.6.0)
307
+ aws-sdk-core (~> 3, >= 3.26.0)
308
+ aws-sigv4 (~> 1.0)
309
+ aws-sdk-mediatailor (1.6.0)
310
+ aws-sdk-core (~> 3, >= 3.26.0)
311
+ aws-sigv4 (~> 1.0)
312
+ aws-sdk-migrationhub (1.7.0)
313
+ aws-sdk-core (~> 3, >= 3.26.0)
314
+ aws-sigv4 (~> 1.0)
315
+ aws-sdk-mobile (1.5.0)
316
+ aws-sdk-core (~> 3, >= 3.26.0)
317
+ aws-sigv4 (~> 1.0)
318
+ aws-sdk-mq (1.7.0)
319
+ aws-sdk-core (~> 3, >= 3.26.0)
320
+ aws-sigv4 (~> 1.0)
321
+ aws-sdk-mturk (1.8.0)
322
+ aws-sdk-core (~> 3, >= 3.26.0)
323
+ aws-sigv4 (~> 1.0)
324
+ aws-sdk-neptune (1.6.0)
325
+ aws-sdk-core (~> 3, >= 3.26.0)
326
+ aws-sigv4 (~> 1.0)
327
+ aws-sdk-opsworks (1.8.0)
328
+ aws-sdk-core (~> 3, >= 3.26.0)
329
+ aws-sigv4 (~> 1.0)
330
+ aws-sdk-opsworkscm (1.9.0)
331
+ aws-sdk-core (~> 3, >= 3.26.0)
332
+ aws-sigv4 (~> 1.0)
333
+ aws-sdk-organizations (1.15.0)
334
+ aws-sdk-core (~> 3, >= 3.26.0)
335
+ aws-sigv4 (~> 1.0)
336
+ aws-sdk-pi (1.5.0)
337
+ aws-sdk-core (~> 3, >= 3.26.0)
338
+ aws-sigv4 (~> 1.0)
339
+ aws-sdk-pinpoint (1.11.0)
340
+ aws-sdk-core (~> 3, >= 3.26.0)
341
+ aws-sigv4 (~> 1.0)
342
+ aws-sdk-polly (1.13.0)
343
+ aws-sdk-core (~> 3, >= 3.26.0)
344
+ aws-sigv4 (~> 1.0)
345
+ aws-sdk-pricing (1.5.0)
346
+ aws-sdk-core (~> 3, >= 3.26.0)
347
+ aws-sigv4 (~> 1.0)
348
+ aws-sdk-rds (1.35.0)
349
+ aws-sdk-core (~> 3, >= 3.26.0)
350
+ aws-sigv4 (~> 1.0)
351
+ aws-sdk-redshift (1.13.0)
352
+ aws-sdk-core (~> 3, >= 3.26.0)
353
+ aws-sigv4 (~> 1.0)
354
+ aws-sdk-rekognition (1.13.0)
355
+ aws-sdk-core (~> 3, >= 3.26.0)
356
+ aws-sigv4 (~> 1.0)
357
+ aws-sdk-resourcegroups (1.7.0)
358
+ aws-sdk-core (~> 3, >= 3.26.0)
359
+ aws-sigv4 (~> 1.0)
360
+ aws-sdk-resourcegroupstaggingapi (1.5.0)
361
+ aws-sdk-core (~> 3, >= 3.26.0)
362
+ aws-sigv4 (~> 1.0)
363
+ aws-sdk-resources (3.25.0)
364
+ aws-sdk-acm (~> 1)
365
+ aws-sdk-acmpca (~> 1)
366
+ aws-sdk-alexaforbusiness (~> 1)
367
+ aws-sdk-apigateway (~> 1)
368
+ aws-sdk-applicationautoscaling (~> 1)
369
+ aws-sdk-applicationdiscoveryservice (~> 1)
370
+ aws-sdk-appstream (~> 1)
371
+ aws-sdk-appsync (~> 1)
372
+ aws-sdk-athena (~> 1)
373
+ aws-sdk-autoscaling (~> 1)
374
+ aws-sdk-autoscalingplans (~> 1)
375
+ aws-sdk-batch (~> 1)
376
+ aws-sdk-budgets (~> 1)
377
+ aws-sdk-cloud9 (~> 1)
378
+ aws-sdk-clouddirectory (~> 1)
379
+ aws-sdk-cloudformation (~> 1)
380
+ aws-sdk-cloudfront (~> 1)
381
+ aws-sdk-cloudhsm (~> 1)
382
+ aws-sdk-cloudhsmv2 (~> 1)
383
+ aws-sdk-cloudsearch (~> 1)
384
+ aws-sdk-cloudsearchdomain (~> 1)
385
+ aws-sdk-cloudtrail (~> 1)
386
+ aws-sdk-cloudwatch (~> 1)
387
+ aws-sdk-cloudwatchevents (~> 1)
388
+ aws-sdk-cloudwatchlogs (~> 1)
389
+ aws-sdk-codebuild (~> 1)
390
+ aws-sdk-codecommit (~> 1)
391
+ aws-sdk-codedeploy (~> 1)
392
+ aws-sdk-codepipeline (~> 1)
393
+ aws-sdk-codestar (~> 1)
394
+ aws-sdk-cognitoidentity (~> 1)
395
+ aws-sdk-cognitoidentityprovider (~> 1)
396
+ aws-sdk-cognitosync (~> 1)
397
+ aws-sdk-comprehend (~> 1)
398
+ aws-sdk-configservice (~> 1)
399
+ aws-sdk-connect (~> 1)
400
+ aws-sdk-costandusagereportservice (~> 1)
401
+ aws-sdk-costexplorer (~> 1)
402
+ aws-sdk-databasemigrationservice (~> 1)
403
+ aws-sdk-datapipeline (~> 1)
404
+ aws-sdk-dax (~> 1)
405
+ aws-sdk-devicefarm (~> 1)
406
+ aws-sdk-directconnect (~> 1)
407
+ aws-sdk-directoryservice (~> 1)
408
+ aws-sdk-dlm (~> 1)
409
+ aws-sdk-dynamodb (~> 1)
410
+ aws-sdk-dynamodbstreams (~> 1)
411
+ aws-sdk-ec2 (~> 1)
412
+ aws-sdk-ecr (~> 1)
413
+ aws-sdk-ecs (~> 1)
414
+ aws-sdk-efs (~> 1)
415
+ aws-sdk-eks (~> 1)
416
+ aws-sdk-elasticache (~> 1)
417
+ aws-sdk-elasticbeanstalk (~> 1)
418
+ aws-sdk-elasticloadbalancing (~> 1)
419
+ aws-sdk-elasticloadbalancingv2 (~> 1)
420
+ aws-sdk-elasticsearchservice (~> 1)
421
+ aws-sdk-elastictranscoder (~> 1)
422
+ aws-sdk-emr (~> 1)
423
+ aws-sdk-firehose (~> 1)
424
+ aws-sdk-fms (~> 1)
425
+ aws-sdk-gamelift (~> 1)
426
+ aws-sdk-glacier (~> 1)
427
+ aws-sdk-glue (~> 1)
428
+ aws-sdk-greengrass (~> 1)
429
+ aws-sdk-guardduty (~> 1)
430
+ aws-sdk-health (~> 1)
431
+ aws-sdk-iam (~> 1)
432
+ aws-sdk-importexport (~> 1)
433
+ aws-sdk-inspector (~> 1)
434
+ aws-sdk-iot (~> 1)
435
+ aws-sdk-iot1clickdevicesservice (~> 1)
436
+ aws-sdk-iot1clickprojects (~> 1)
437
+ aws-sdk-iotanalytics (~> 1)
438
+ aws-sdk-iotdataplane (~> 1)
439
+ aws-sdk-iotjobsdataplane (~> 1)
440
+ aws-sdk-kinesis (~> 1)
441
+ aws-sdk-kinesisanalytics (~> 1)
442
+ aws-sdk-kinesisvideo (~> 1)
443
+ aws-sdk-kinesisvideoarchivedmedia (~> 1)
444
+ aws-sdk-kinesisvideomedia (~> 1)
445
+ aws-sdk-kms (~> 1)
446
+ aws-sdk-lambda (~> 1)
447
+ aws-sdk-lambdapreview (~> 1)
448
+ aws-sdk-lex (~> 1)
449
+ aws-sdk-lexmodelbuildingservice (~> 1)
450
+ aws-sdk-lightsail (~> 1)
451
+ aws-sdk-machinelearning (~> 1)
452
+ aws-sdk-macie (~> 1)
453
+ aws-sdk-marketplacecommerceanalytics (~> 1)
454
+ aws-sdk-marketplaceentitlementservice (~> 1)
455
+ aws-sdk-marketplacemetering (~> 1)
456
+ aws-sdk-mediaconvert (~> 1)
457
+ aws-sdk-medialive (~> 1)
458
+ aws-sdk-mediapackage (~> 1)
459
+ aws-sdk-mediastore (~> 1)
460
+ aws-sdk-mediastoredata (~> 1)
461
+ aws-sdk-mediatailor (~> 1)
462
+ aws-sdk-migrationhub (~> 1)
463
+ aws-sdk-mobile (~> 1)
464
+ aws-sdk-mq (~> 1)
465
+ aws-sdk-mturk (~> 1)
466
+ aws-sdk-neptune (~> 1)
467
+ aws-sdk-opsworks (~> 1)
468
+ aws-sdk-opsworkscm (~> 1)
469
+ aws-sdk-organizations (~> 1)
470
+ aws-sdk-pi (~> 1)
471
+ aws-sdk-pinpoint (~> 1)
472
+ aws-sdk-polly (~> 1)
473
+ aws-sdk-pricing (~> 1)
474
+ aws-sdk-rds (~> 1)
475
+ aws-sdk-redshift (~> 1)
476
+ aws-sdk-rekognition (~> 1)
477
+ aws-sdk-resourcegroups (~> 1)
478
+ aws-sdk-resourcegroupstaggingapi (~> 1)
479
+ aws-sdk-route53 (~> 1)
480
+ aws-sdk-route53domains (~> 1)
481
+ aws-sdk-s3 (~> 1)
482
+ aws-sdk-sagemaker (~> 1)
483
+ aws-sdk-sagemakerruntime (~> 1)
484
+ aws-sdk-secretsmanager (~> 1)
485
+ aws-sdk-serverlessapplicationrepository (~> 1)
486
+ aws-sdk-servicecatalog (~> 1)
487
+ aws-sdk-servicediscovery (~> 1)
488
+ aws-sdk-ses (~> 1)
489
+ aws-sdk-shield (~> 1)
490
+ aws-sdk-signer (~> 1)
491
+ aws-sdk-simpledb (~> 1)
492
+ aws-sdk-sms (~> 1)
493
+ aws-sdk-snowball (~> 1)
494
+ aws-sdk-sns (~> 1)
495
+ aws-sdk-sqs (~> 1)
496
+ aws-sdk-ssm (~> 1)
497
+ aws-sdk-states (~> 1)
498
+ aws-sdk-storagegateway (~> 1)
499
+ aws-sdk-support (~> 1)
500
+ aws-sdk-swf (~> 1)
501
+ aws-sdk-transcribeservice (~> 1)
502
+ aws-sdk-translate (~> 1)
503
+ aws-sdk-waf (~> 1)
504
+ aws-sdk-wafregional (~> 1)
505
+ aws-sdk-workdocs (~> 1)
506
+ aws-sdk-workmail (~> 1)
507
+ aws-sdk-workspaces (~> 1)
508
+ aws-sdk-xray (~> 1)
509
+ aws-sdk-route53 (1.15.0)
510
+ aws-sdk-core (~> 3, >= 3.26.0)
511
+ aws-sigv4 (~> 1.0)
512
+ aws-sdk-route53domains (1.7.0)
513
+ aws-sdk-core (~> 3, >= 3.26.0)
514
+ aws-sigv4 (~> 1.0)
515
+ aws-sdk-s3 (1.23.0)
516
+ aws-sdk-core (~> 3, >= 3.26.0)
517
+ aws-sdk-kms (~> 1)
518
+ aws-sigv4 (~> 1.0)
519
+ aws-sdk-sagemaker (1.21.0)
520
+ aws-sdk-core (~> 3, >= 3.26.0)
521
+ aws-sigv4 (~> 1.0)
522
+ aws-sdk-sagemakerruntime (1.6.0)
523
+ aws-sdk-core (~> 3, >= 3.26.0)
524
+ aws-sigv4 (~> 1.0)
525
+ aws-sdk-secretsmanager (1.18.0)
526
+ aws-sdk-core (~> 3, >= 3.26.0)
527
+ aws-sigv4 (~> 1.0)
528
+ aws-sdk-serverlessapplicationrepository (1.8.0)
529
+ aws-sdk-core (~> 3, >= 3.26.0)
530
+ aws-sigv4 (~> 1.0)
531
+ aws-sdk-servicecatalog (1.11.0)
532
+ aws-sdk-core (~> 3, >= 3.26.0)
533
+ aws-sigv4 (~> 1.0)
534
+ aws-sdk-servicediscovery (1.7.0)
535
+ aws-sdk-core (~> 3, >= 3.26.0)
536
+ aws-sigv4 (~> 1.0)
537
+ aws-sdk-ses (1.13.0)
538
+ aws-sdk-core (~> 3, >= 3.26.0)
539
+ aws-sigv4 (~> 1.0)
540
+ aws-sdk-shield (1.8.0)
541
+ aws-sdk-core (~> 3, >= 3.26.0)
542
+ aws-sigv4 (~> 1.0)
543
+ aws-sdk-signer (1.4.0)
544
+ aws-sdk-core (~> 3, >= 3.26.0)
545
+ aws-sigv4 (~> 1.0)
546
+ aws-sdk-simpledb (1.5.0)
547
+ aws-sdk-core (~> 3, >= 3.26.0)
548
+ aws-sigv2 (~> 1.0)
549
+ aws-sdk-sms (1.5.0)
550
+ aws-sdk-core (~> 3, >= 3.26.0)
551
+ aws-sigv4 (~> 1.0)
552
+ aws-sdk-snowball (1.9.0)
553
+ aws-sdk-core (~> 3, >= 3.26.0)
554
+ aws-sigv4 (~> 1.0)
555
+ aws-sdk-sns (1.7.0)
556
+ aws-sdk-core (~> 3, >= 3.26.0)
557
+ aws-sigv4 (~> 1.0)
558
+ aws-sdk-sqs (1.9.0)
559
+ aws-sdk-core (~> 3, >= 3.26.0)
560
+ aws-sigv4 (~> 1.0)
561
+ aws-sdk-ssm (1.31.0)
562
+ aws-sdk-core (~> 3, >= 3.26.0)
563
+ aws-sigv4 (~> 1.0)
564
+ aws-sdk-states (1.7.0)
565
+ aws-sdk-core (~> 3, >= 3.26.0)
566
+ aws-sigv4 (~> 1.0)
567
+ aws-sdk-storagegateway (1.12.0)
568
+ aws-sdk-core (~> 3, >= 3.26.0)
569
+ aws-sigv4 (~> 1.0)
570
+ aws-sdk-support (1.5.0)
571
+ aws-sdk-core (~> 3, >= 3.26.0)
572
+ aws-sigv4 (~> 1.0)
573
+ aws-sdk-swf (1.5.0)
574
+ aws-sdk-core (~> 3, >= 3.26.0)
575
+ aws-sigv4 (~> 1.0)
576
+ aws-sdk-transcribeservice (1.10.0)
577
+ aws-sdk-core (~> 3, >= 3.26.0)
578
+ aws-sigv4 (~> 1.0)
579
+ aws-sdk-translate (1.6.0)
580
+ aws-sdk-core (~> 3, >= 3.26.0)
581
+ aws-sigv4 (~> 1.0)
582
+ aws-sdk-waf (1.10.0)
583
+ aws-sdk-core (~> 3, >= 3.26.0)
584
+ aws-sigv4 (~> 1.0)
585
+ aws-sdk-wafregional (1.10.0)
586
+ aws-sdk-core (~> 3, >= 3.26.0)
587
+ aws-sigv4 (~> 1.0)
588
+ aws-sdk-workdocs (1.6.0)
589
+ aws-sdk-core (~> 3, >= 3.26.0)
590
+ aws-sigv4 (~> 1.0)
591
+ aws-sdk-workmail (1.6.0)
592
+ aws-sdk-core (~> 3, >= 3.26.0)
593
+ aws-sigv4 (~> 1.0)
594
+ aws-sdk-workspaces (1.8.0)
595
+ aws-sdk-core (~> 3, >= 3.26.0)
596
+ aws-sigv4 (~> 1.0)
597
+ aws-sdk-xray (1.8.0)
598
+ aws-sdk-core (~> 3, >= 3.26.0)
599
+ aws-sigv4 (~> 1.0)
600
+ aws-sigv2 (1.0.1)
601
+ aws-sigv4 (1.0.3)
602
+ coderay (1.1.2)
603
+ diff-lcs (1.3)
604
+ jmespath (1.4.0)
605
+ method_source (0.9.0)
606
+ pry (0.11.3)
607
+ coderay (~> 1.1.0)
608
+ method_source (~> 0.9.0)
609
+ rake (10.5.0)
610
+ rspec (3.8.0)
611
+ rspec-core (~> 3.8.0)
612
+ rspec-expectations (~> 3.8.0)
613
+ rspec-mocks (~> 3.8.0)
614
+ rspec-core (3.8.0)
615
+ rspec-support (~> 3.8.0)
616
+ rspec-expectations (3.8.2)
617
+ diff-lcs (>= 1.2.0, < 2.0)
618
+ rspec-support (~> 3.8.0)
619
+ rspec-mocks (3.8.0)
620
+ diff-lcs (>= 1.2.0, < 2.0)
621
+ rspec-support (~> 3.8.0)
622
+ rspec-support (3.8.0)
623
+
624
+ PLATFORMS
625
+ x64-mingw32
626
+
627
+ DEPENDENCIES
628
+ athena_csv!
629
+ aws-sdk
630
+ bundler (~> 1.16)
631
+ pry
632
+ rake (~> 10.0)
633
+ rspec (~> 3.0)
634
+
635
+ BUNDLED WITH
636
+ 1.17.0
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Dhrubajyoti Chatterjee
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # AthenaCsv
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/athena_csv`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'athena_csv'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install athena_csv
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/athena_csv. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the AthenaCsv project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/athena_csv/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,33 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "athena_csv/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "athena_csv"
7
+ spec.version = AthenaCsv::VERSION
8
+ spec.authors = ["Dhrubajyoti Chatterjee"]
9
+ spec.email = ["dchatterjee@prognos.ai"]
10
+
11
+ spec.summary = %q{Write athena query result into CSV}
12
+ spec.description = %q{Executes a query in aws athena and parse the result to write into a csv file}
13
+ spec.homepage = "https://github.com/Dhrubajyotic"
14
+ spec.license = "MIT"
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host
18
+
19
+ # Specify which files should be added to the gem when it is released.
20
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
22
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
+ end
24
+ spec.bindir = "exe"
25
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
+ spec.require_paths = ["lib"]
27
+
28
+ spec.add_development_dependency "bundler", "~> 1.16"
29
+ spec.add_development_dependency "rake", "~> 10.0"
30
+ spec.add_development_dependency "rspec", "~> 3.0"
31
+ spec.add_development_dependency "aws-sdk"
32
+ spec.add_development_dependency "pry"
33
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "athena_csv"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,12 @@
1
+ module AthenaCsv; class Configuration
2
+
3
+ attr_accessor :host, :user, :password, :dbname
4
+
5
+ def initialize(args)
6
+ @host = args.fetch(:host, nil)
7
+ @user = args.fetch(:user, nil)
8
+ @password = args.fetch(:password, nil)
9
+ @dbname = args.fetch(:dbname, nil)
10
+ end
11
+
12
+ end; end
@@ -0,0 +1,78 @@
1
+ require 'aws-sdk'
2
+
3
+ module AthenaCsv; class Client
4
+
5
+ attr_reader :config
6
+
7
+ def initialize
8
+ @config = {
9
+ dbname: AthenaCsv.config.dbname,
10
+ user: AthenaCsv.config.user,
11
+ password: AthenaCsv.config.password,
12
+ host: AthenaCsv.config.host,
13
+ region: 'us-east-1',
14
+ output_location: 's3://aws-athena-query-results-333957572119-us-east-1',
15
+ s3_encryption: 'SSE_S3'
16
+ }
17
+ @client = athenaClient
18
+ @result = []
19
+ end
20
+
21
+ def run(sql)
22
+ query_exec_id = execute(sql)
23
+ puts 'Execution started with Id: ' + query_exec_id
24
+ begin
25
+ query_exec_state = status(query_exec_id)
26
+ #puts query_exec_state
27
+ #sleep(5)
28
+ end while query_exec_state == 'RUNNING'
29
+ puts 'Execution completed -- fetching result started'
30
+ begin
31
+ result, next_token = result_set(query_exec_id, next_token)
32
+ @result.push(*result)
33
+ end while next_token != nil
34
+ puts "Total rows fetched as Result: #{@result.length}"
35
+ return @result
36
+ end
37
+
38
+ private
39
+
40
+ def athenaClient
41
+ Aws::Athena::Client.new(
42
+ region: @config[:region],
43
+ access_key_id: @config[:user],
44
+ secret_access_key: @config[:password]
45
+ )
46
+ end
47
+
48
+ def execute(sql)
49
+ @client.start_query_execution({
50
+ query_string: sql,
51
+ #client_request_token: "IdempotencyToken",
52
+ query_execution_context: {
53
+ database: @config[:dbname],
54
+ },
55
+ result_configuration: {
56
+ output_location: @config[:output_location],
57
+ encryption_configuration: {
58
+ encryption_option: @config[:s3_encryption]
59
+ },
60
+ },
61
+ }).query_execution_id
62
+ end
63
+
64
+ def status(execution_id)
65
+ @client.get_query_execution({
66
+ query_execution_id: execution_id,
67
+ }).query_execution.status.state
68
+ end
69
+
70
+ def result_set(execution_id, next_token=nil)
71
+ response = @client.get_query_results({
72
+ query_execution_id: execution_id,
73
+ next_token: next_token,
74
+ max_results: 1000,
75
+ })
76
+ return response.result_set.rows, response.next_token
77
+ end
78
+ end; end
@@ -0,0 +1,28 @@
1
+ require 'csv'
2
+
3
+ module AthenaCsv; class Output;
4
+
5
+ attr_reader :query, :file_path
6
+
7
+ def initialize(query, file_path)
8
+ @query = query
9
+ @file_path = file_path
10
+ end
11
+
12
+ def query_results
13
+ @query_result_rows ||= Client.new.run(query)
14
+ end
15
+
16
+ def values(row)
17
+ row.data.map {|cell| cell.var_char_value}
18
+ end
19
+
20
+ def generate_csv
21
+ CSV.open(file_path, "wb") do |csv|
22
+ query_results.each do |row|
23
+ csv << values(row)
24
+ end
25
+ end
26
+ end
27
+
28
+ end; end
@@ -0,0 +1,3 @@
1
+ module AthenaCsv
2
+ VERSION = "0.1.0"
3
+ end
data/lib/athena_csv.rb ADDED
@@ -0,0 +1,12 @@
1
+ require "athena_csv/version"
2
+
3
+ root_directory = File.expand_path("../", File.dirname(__FILE__))
4
+
5
+ Dir["#{root_directory}/lib/athena_csv/*.rb"].sort.each {|file| require file }
6
+
7
+ module AthenaCsv
8
+
9
+ def self.config(args={})
10
+ @config ||= Configuration.new(args)
11
+ end
12
+ end
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: athena_csv
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dhrubajyoti Chatterjee
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-10-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: aws-sdk
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: Executes a query in aws athena and parse the result to write into a csv
84
+ file
85
+ email:
86
+ - dchatterjee@prognos.ai
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - ".gitignore"
92
+ - ".rspec"
93
+ - ".travis.yml"
94
+ - CODE_OF_CONDUCT.md
95
+ - Gemfile
96
+ - Gemfile.lock
97
+ - LICENSE.txt
98
+ - README.md
99
+ - Rakefile
100
+ - athena_csv.gemspec
101
+ - bin/console
102
+ - bin/setup
103
+ - lib/athena_csv.rb
104
+ - lib/athena_csv/configuration.rb
105
+ - lib/athena_csv/connection.rb
106
+ - lib/athena_csv/output.rb
107
+ - lib/athena_csv/version.rb
108
+ homepage: https://github.com/Dhrubajyotic
109
+ licenses:
110
+ - MIT
111
+ metadata: {}
112
+ post_install_message:
113
+ rdoc_options: []
114
+ require_paths:
115
+ - lib
116
+ required_ruby_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ requirements: []
127
+ rubyforge_project:
128
+ rubygems_version: 2.7.7
129
+ signing_key:
130
+ specification_version: 4
131
+ summary: Write athena query result into CSV
132
+ test_files: []