td 0.10.48 → 0.10.49
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.
- data/ChangeLog +5 -0
- data/lib/td/command/job.rb +9 -6
- data/lib/td/command/list.rb +1 -1
- data/lib/td/command/query.rb +5 -1
- data/lib/td/command/sched.rb +1 -0
- data/lib/td/version.rb +1 -1
- metadata +4 -4
data/ChangeLog
CHANGED
data/lib/td/command/job.rb
CHANGED
@@ -76,6 +76,7 @@ module Command
|
|
76
76
|
wait = false
|
77
77
|
output = nil
|
78
78
|
format = 'tsv'
|
79
|
+
render_opts = {}
|
79
80
|
|
80
81
|
op.on('-v', '--verbose', 'show logs', TrueClass) {|b|
|
81
82
|
verbose = b
|
@@ -83,6 +84,9 @@ module Command
|
|
83
84
|
op.on('-w', '--wait', 'wait for finishing the job', TrueClass) {|b|
|
84
85
|
wait = b
|
85
86
|
}
|
87
|
+
op.on('-G', '--vertical', 'use vertical table to show results', TrueClass) {|b|
|
88
|
+
render_opts[:vertical] = b
|
89
|
+
}
|
86
90
|
op.on('-o', '--output PATH', 'write result to the file') {|s|
|
87
91
|
output = s
|
88
92
|
}
|
@@ -112,13 +116,13 @@ module Command
|
|
112
116
|
wait_job(job)
|
113
117
|
if job.success? && job.type == :hive
|
114
118
|
puts "Result :"
|
115
|
-
show_result(job, output, format)
|
119
|
+
show_result(job, output, format, render_opts)
|
116
120
|
end
|
117
121
|
|
118
122
|
else
|
119
123
|
if job.success? && job.type == :hive
|
120
124
|
puts "Result :"
|
121
|
-
show_result(job, output, format)
|
125
|
+
show_result(job, output, format, render_opts)
|
122
126
|
end
|
123
127
|
|
124
128
|
if verbose
|
@@ -186,12 +190,12 @@ module Command
|
|
186
190
|
end
|
187
191
|
end
|
188
192
|
|
189
|
-
def show_result(job, output, format)
|
193
|
+
def show_result(job, output, format, render_opts={})
|
190
194
|
if output
|
191
195
|
write_result(job, output, format)
|
192
196
|
puts "written to #{output} in #{format} format"
|
193
197
|
else
|
194
|
-
render_result(job)
|
198
|
+
render_result(job, render_opts)
|
195
199
|
end
|
196
200
|
end
|
197
201
|
|
@@ -249,7 +253,7 @@ module Command
|
|
249
253
|
end
|
250
254
|
end
|
251
255
|
|
252
|
-
def render_result(job)
|
256
|
+
def render_result(job, opts)
|
253
257
|
require 'json'
|
254
258
|
rows = []
|
255
259
|
job.result_each {|row|
|
@@ -266,7 +270,6 @@ module Command
|
|
266
270
|
}
|
267
271
|
}
|
268
272
|
|
269
|
-
opts = {}
|
270
273
|
opts[:max_width] = 10000
|
271
274
|
if job.hive_result_schema
|
272
275
|
opts[:change_fields] = job.hive_result_schema.map {|name,type| name }
|
data/lib/td/command/list.rb
CHANGED
@@ -260,7 +260,7 @@ module List
|
|
260
260
|
add_list 'sched:delete', %w[name], 'Delete a schedule', 'sched:delete sched1'
|
261
261
|
add_list 'sched:update', %w[name], 'Modify a schedule', 'sched:update sched1 -s "0 */2 * * *" -d my_db -t "Asia/Tokyo" -D 3600'
|
262
262
|
add_list 'sched:history', %w[name max?], 'Show history of scheduled queries', 'sched sched1 --page 1'
|
263
|
-
add_list 'sched:run', %w[name time], 'Run scheduled queries for the specified time', 'sched:run "2013-01-01 00:00:00" -n 6'
|
263
|
+
add_list 'sched:run', %w[name time], 'Run scheduled queries for the specified time', 'sched:run sched1 "2013-01-01 00:00:00" -n 6'
|
264
264
|
|
265
265
|
add_list 'query', %w[sql], 'Issue a query', 'query -d example_db -w -r rset1 "select count(*) from table1"'
|
266
266
|
|
data/lib/td/command/query.rb
CHANGED
@@ -7,6 +7,7 @@ module Command
|
|
7
7
|
wait = false
|
8
8
|
output = nil
|
9
9
|
format = 'tsv'
|
10
|
+
render_opts = {}
|
10
11
|
result_url = nil
|
11
12
|
result_user = nil
|
12
13
|
result_ask_password = false
|
@@ -18,6 +19,9 @@ module Command
|
|
18
19
|
op.on('-w', '--wait', 'wait for finishing the job', TrueClass) {|b|
|
19
20
|
wait = b
|
20
21
|
}
|
22
|
+
op.on('-G', '--vertical', 'use vertical table to show results', TrueClass) {|b|
|
23
|
+
render_opts[:vertical] = b
|
24
|
+
}
|
21
25
|
op.on('-o', '--output PATH', 'write result to the file') {|s|
|
22
26
|
output = s
|
23
27
|
}
|
@@ -71,7 +75,7 @@ module Command
|
|
71
75
|
puts "Status : #{job.status}"
|
72
76
|
if job.success?
|
73
77
|
puts "Result :"
|
74
|
-
show_result(job, output, format)
|
78
|
+
show_result(job, output, format, render_opts)
|
75
79
|
end
|
76
80
|
end
|
77
81
|
end
|
data/lib/td/command/sched.rb
CHANGED
data/lib/td/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: td
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.49
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: msgpack
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.8.
|
69
|
+
version: 0.8.29
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.8.
|
77
|
+
version: 0.8.29
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: td-logger
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|