td-client 0.8.12 → 0.8.13

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ == 2012-04-03 version 0.8.13
3
+
4
+ * Added Job#hive_result_schema
5
+
6
+
2
7
  == 2012-03-12 version 0.8.12
3
8
 
4
9
  * Client#run_schedule returns an array of ScheduledJob
data/lib/td/client.rb CHANGED
@@ -121,16 +121,16 @@ class Client
121
121
  # => Job
122
122
  def job(job_id)
123
123
  job_id = job_id.to_s
124
- type, query, status, url, debug, start_at, end_at, rset = @api.show_job(job_id)
124
+ type, query, status, url, debug, start_at, end_at, rset, hive_result_schema = @api.show_job(job_id)
125
125
  rset = ResultSet.new(self, rset) if rset
126
- Job.new(self, job_id, type, query, status, url, debug, start_at, end_at, nil, rset)
126
+ Job.new(self, job_id, type, query, status, url, debug, start_at, end_at, nil, rset, hive_result_schema)
127
127
  end
128
128
 
129
129
  # => type:Symbol, url:String
130
130
  def job_status(job_id)
131
- type, query, status, url, debug, start_at, end_at, rset = @api.show_job(job_id)
131
+ type, query, status, url, debug, start_at, end_at, rset, hive_result_schema = @api.show_job(job_id)
132
132
  rset = ResultSet.new(self, rset) if rset
133
- return query, status, url, debug, start_at, end_at, rset
133
+ return query, status, url, debug, start_at, end_at, rset, hive_result_schema
134
134
  end
135
135
 
136
136
  # => result:[{column:String=>value:Object]
data/lib/td/client/api.rb CHANGED
@@ -301,7 +301,13 @@ class API
301
301
  start_at = js['start_at']
302
302
  end_at = js['end_at']
303
303
  result = js['result']
304
- return [type, query, status, url, debug, start_at, end_at, result]
304
+ hive_result_schema = (js['hive_result_schema'] || '')
305
+ if hive_result_schema.empty?
306
+ hive_result_schema = nil
307
+ else
308
+ hive_result_schema = JSON.parse(hive_result_schema)
309
+ end
310
+ return [type, query, status, url, debug, start_at, end_at, result, hive_result_schema]
305
311
  end
306
312
 
307
313
  def job_result(job_id)
@@ -152,7 +152,7 @@ class Job < Model
152
152
  STATUS_KILLED = "killed"
153
153
  FINISHED_STATUS = [STATUS_SUCCESS, STATUS_ERROR, STATUS_KILLED]
154
154
 
155
- def initialize(client, job_id, type, query, status=nil, url=nil, debug=nil, start_at=nil, end_at=nil, result=nil, rset=nil)
155
+ def initialize(client, job_id, type, query, status=nil, url=nil, debug=nil, start_at=nil, end_at=nil, result=nil, rset=nil, hive_result_schema=nil)
156
156
  super(client)
157
157
  @job_id = job_id
158
158
  @type = type
@@ -164,9 +164,11 @@ class Job < Model
164
164
  @end_at = end_at
165
165
  @result = result
166
166
  @rset = rset
167
+ @hive_result_schema = hive_result_schema
167
168
  end
168
169
 
169
170
  attr_reader :job_id, :type, :rset
171
+ attr_reader :hive_result_schema
170
172
 
171
173
  def wait(timeout=nil)
172
174
  # TODO
@@ -261,13 +263,14 @@ class Job < Model
261
263
  end
262
264
 
263
265
  def update_status!
264
- query, status, url, debug, start_at, end_at, rset = @client.job_status(@job_id)
266
+ query, status, url, debug, start_at, end_at, rset, hive_result_schema = @client.job_status(@job_id)
265
267
  @query = query
266
268
  @status = status
267
269
  @url = url
268
270
  @debug = debug
269
271
  @start_at = start_at
270
272
  @end_at = end_at
273
+ @hive_result_schema = hive_result_schema
271
274
  self
272
275
  end
273
276
  end
@@ -1,5 +1,5 @@
1
1
  module TreasureData
2
2
 
3
- VERSION = '0.8.12'
3
+ VERSION = '0.8.13'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: td-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.12
4
+ version: 0.8.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-12 00:00:00.000000000Z
12
+ date: 2012-04-03 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack
16
- requirement: &70219943379240 !ruby/object:Gem::Requirement
16
+ requirement: &70110623163420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.4.4
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70219943379240
24
+ version_requirements: *70110623163420
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &70219943378640 !ruby/object:Gem::Requirement
27
+ requirement: &70110623162680 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.4.3
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70219943378640
35
+ version_requirements: *70110623162680
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70219943377980 !ruby/object:Gem::Requirement
38
+ requirement: &70110623162020 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 2.8.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70219943377980
46
+ version_requirements: *70110623162020
47
47
  description:
48
48
  email:
49
49
  executables: []