bigquery_migration 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/bigquery_migration/table_data.rb +8 -2
- data/lib/bigquery_migration/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce47a4ba011b85511ddfcdb55489abd8bddebdb4
|
4
|
+
data.tar.gz: 2c22d84df63cc2a0000fb05f07f062332528cfb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af8b65b3735dff7e674528121dd145b1b14b346a58b3928e16375f4bbd0bb757d7ecb370fa8efd6a65aafd7f625fde5ede18b1f2533551c8a34dd0db5d077809
|
7
|
+
data.tar.gz: 4bad1538699ecdee97efa129bf8bd7900fb8cd3913c5363b134b6c10d8b6a2ed02423d089944fc67c115b72d677f111b9016d532890d59e78b6f2119f793df05
|
data/CHANGELOG.md
CHANGED
@@ -95,9 +95,9 @@ class BigqueryMigration
|
|
95
95
|
end
|
96
96
|
elsif column[:mode] == 'REPEATED'
|
97
97
|
v = row[:v]
|
98
|
-
count < v.length ? value.push(v[count][:v]) : value.push(nil)
|
98
|
+
count < v.length ? value.push(normalize_value(v[count][:v])) : value.push(nil)
|
99
99
|
elsif count == 0
|
100
|
-
value.push(row[:v])
|
100
|
+
value.push((normalize_value(row[:v])))
|
101
101
|
else
|
102
102
|
value.push(nil)
|
103
103
|
end
|
@@ -105,6 +105,12 @@ class BigqueryMigration
|
|
105
105
|
value
|
106
106
|
end
|
107
107
|
|
108
|
+
# special treatment empty hash.
|
109
|
+
# nil is converted into {} by to_h
|
110
|
+
private def normalize_value(v)
|
111
|
+
v.is_a?(Hash) && v.empty? ? nil : v
|
112
|
+
end
|
113
|
+
|
108
114
|
private def generate_nil_count(fields)
|
109
115
|
fields.inject(0) do |acc, f|
|
110
116
|
f[:type] == 'RECORD' ? acc + generate_nil_count(f[:fields]) : acc + 1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bigquery_migration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-api-client
|