bigquery 0.3.0 → 0.4.0

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
  SHA1:
3
- metadata.gz: 20fc5558fdf2c8d418732427cf1224e24a843d90
4
- data.tar.gz: d9dd7002fb14a039121696cac189995f43a0bca4
3
+ metadata.gz: 6982c1cc6c0aa808ef9f46d125de87294bd2e30e
4
+ data.tar.gz: 8a466b535aa30ebc3314cdb01a2f6e09876cd659
5
5
  SHA512:
6
- metadata.gz: 921eff01e2524cbbac496452255425e8ddc6c281500de221aa13a75bc084241117cbd734ddbe50a75b51faf5c27127389e195177c83e92a5cc8b90f27cfb68c6
7
- data.tar.gz: fd8e7a36683589f98df3dcaf1be567343649c3822b9730f12d4311fdabe2e4c5500b51dfeecaf229bfa69b839b08d35345c1cf7ed09254ecbc88c40f4aea956c
6
+ metadata.gz: d97e7043f9f7ad3719398e555702a3ca6551baa25f2dbe1389bbec26c5934b1af188f0a7e505ff6f23eb9fc02fc7f52caf8ed5b5fcb26b75f51feaa56d198a70
7
+ data.tar.gz: f17749dd5a100d85c7c9adb0aff5780e4bd6d098b0ac73bb5e0c684649fa0e812b6422d3d28789ad516e4dcc557ad3e53c9ccd2a70be715e73b25f499bd21d84
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.4.0
2
+ * Added BigQuery::Client#insert_job. https://cloud.google.com/bigquery/docs/reference/v2/jobs/insert
3
+
1
4
  # 0.3.0
2
5
  * Added support to insert to allow for array of rows
3
6
  * Locked the google-api-client gem to ~> 0.7.X
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bigquery (0.3.0)
4
+ bigquery (0.4.0)
5
5
  google-api-client (~> 0.7.1)
6
6
  retriable (~> 1.4)
7
7
 
@@ -1,3 +1,5 @@
1
+ # https://cloud.google.com/bigquery/docs/reference/v2/jobs
2
+
1
3
  module BigQuery
2
4
  class Client
3
5
  module Jobs
@@ -33,6 +35,15 @@ module BigQuery
33
35
  api(api_method: @bq.jobs.get_query_results,
34
36
  parameters: opts)
35
37
  end
38
+
39
+ # Insert a job
40
+ #
41
+ # @param options [Hash] hash of job options
42
+ # @return [Hash] json api response
43
+ def insert_job(opts)
44
+ api(api_method: @bq.jobs.insert,
45
+ body_object: {configuration: opts})
46
+ end
36
47
  end
37
48
  end
38
49
  end
@@ -1,3 +1,3 @@
1
1
  module BigQuery
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
data/test/bigquery.rb CHANGED
@@ -99,4 +99,10 @@ class BigQueryTest < MiniTest::Unit::TestCase
99
99
 
100
100
  assert_equal result['kind'], "bigquery#tableDataInsertAllResponse"
101
101
  end
102
+
103
+ def test_for_insert_job
104
+ res = @bq.insert_job(query: {query: "SELECT * FROM [#{config['dataset']}.test] LIMIT 1"})
105
+
106
+ assert_equal result['kind'], "bigquery#job"
107
+ end
102
108
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Bronte
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-28 00:00:00.000000000 Z
12
+ date: 2014-11-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: retriable