samidare 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
- data/lib/samidare.rb +1 -1
- data/lib/samidare/bigquery_utility.rb +1 -1
- data/lib/samidare/embulk_utility.rb +5 -0
- data/lib/samidare/version.rb +1 -1
- data/spec/samidare/embulk_utility_spec.rb +25 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa6eff2457ffc6b011ac5964a02aee5808f22178
|
4
|
+
data.tar.gz: 2c9a55067831fad943ad9900894deaacd8f0dc71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cb4b1a5ab045538a6b936e11820c53df438d356528e0ca79c4b220b7997de560e0b35cf071b7bdb3f31a18f584f0810d9d83e8ecf17a6572abf1c2e5fdefc4a
|
7
|
+
data.tar.gz: 622a00ae3eb3f3566d99a3415bccbfe2f67ed83d33068519d97aefe5eca591d92dc0d674748acc9716a6b4c8691328238ae09bddaf93348688cd3b97b1e2331b
|
data/lib/samidare.rb
CHANGED
@@ -32,7 +32,7 @@ module Samidare
|
|
32
32
|
log "table: #{table.name} - does not exist"
|
33
33
|
end
|
34
34
|
|
35
|
-
cmd = "embulk run #{
|
35
|
+
cmd = "embulk run #{config['config_dir']}/#{db_name}/#{table.name}.yml"
|
36
36
|
log "cmd: #{cmd}"
|
37
37
|
result = system(cmd) ? 'success' : 'error'
|
38
38
|
|
@@ -54,7 +54,7 @@ module Samidare
|
|
54
54
|
password = db_info['password']
|
55
55
|
database = db_info['database']
|
56
56
|
query = Samidare::BigQueryUtility.generate_sql(table_info.name, column_infos)
|
57
|
-
project = @config['
|
57
|
+
project = @config['project_id']
|
58
58
|
p12_keyfile_path = @config['key']
|
59
59
|
service_account_email = @config['service_email']
|
60
60
|
dataset = db_info['bq_dataset']
|
@@ -117,10 +117,15 @@ module Samidare
|
|
117
117
|
TYPE_MAPPINGS = {
|
118
118
|
'int' => 'integer',
|
119
119
|
'tinyint' => 'integer',
|
120
|
+
'smallint' => 'integer',
|
121
|
+
'mediumint' => 'integer',
|
120
122
|
'bigint' => 'integer',
|
123
|
+
'float' => 'float',
|
121
124
|
'double' => 'float',
|
122
125
|
'decimal' => 'float',
|
126
|
+
'char' => 'string',
|
123
127
|
'varchar' => 'string',
|
128
|
+
'tinytext' => 'string',
|
124
129
|
'text' => 'string',
|
125
130
|
'date' => 'timestamp',
|
126
131
|
'datetime' => 'timestamp',
|
data/lib/samidare/version.rb
CHANGED
@@ -21,11 +21,26 @@ describe Samidare::EmbulkUtility::ColumnInfo do
|
|
21
21
|
it { expect(subject).to eq 'integer' }
|
22
22
|
end
|
23
23
|
|
24
|
+
context 'smallint' do
|
25
|
+
let(:data_type) { 'smallint' }
|
26
|
+
it { expect(subject).to eq 'integer' }
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'mediumint' do
|
30
|
+
let(:data_type) { 'mediumint' }
|
31
|
+
it { expect(subject).to eq 'integer' }
|
32
|
+
end
|
33
|
+
|
24
34
|
context 'bigint' do
|
25
35
|
let(:data_type) { 'bigint' }
|
26
36
|
it { expect(subject).to eq 'integer' }
|
27
37
|
end
|
28
38
|
|
39
|
+
context 'float' do
|
40
|
+
let(:data_type) { 'float' }
|
41
|
+
it { expect(subject).to eq 'float' }
|
42
|
+
end
|
43
|
+
|
29
44
|
context 'double' do
|
30
45
|
let(:data_type) { 'double' }
|
31
46
|
it { expect(subject).to eq 'float' }
|
@@ -36,11 +51,21 @@ describe Samidare::EmbulkUtility::ColumnInfo do
|
|
36
51
|
it { expect(subject).to eq 'float' }
|
37
52
|
end
|
38
53
|
|
54
|
+
context 'char' do
|
55
|
+
let(:data_type) { 'char' }
|
56
|
+
it { expect(subject).to eq 'string' }
|
57
|
+
end
|
58
|
+
|
39
59
|
context 'varchar' do
|
40
60
|
let(:data_type) { 'varchar' }
|
41
61
|
it { expect(subject).to eq 'string' }
|
42
62
|
end
|
43
63
|
|
64
|
+
context 'tinytext' do
|
65
|
+
let(:data_type) { 'tinytext' }
|
66
|
+
it { expect(subject).to eq 'string' }
|
67
|
+
end
|
68
|
+
|
44
69
|
context 'text' do
|
45
70
|
let(:data_type) { 'text' }
|
46
71
|
it { expect(subject).to eq 'string' }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: samidare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryoji Kobori
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -201,3 +201,4 @@ test_files:
|
|
201
201
|
- spec/samidare/embulk_utility_spec.rb
|
202
202
|
- spec/samidare_spec.rb
|
203
203
|
- spec/spec_helper.rb
|
204
|
+
has_rdoc:
|