embulk-filter-insert 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +1 -1
- data/embulk-filter-insert.gemspec +2 -2
- data/lib/embulk/filter/insert.rb +8 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6ec98f49b300a5295a25b3e7288a2ccaecbc604
|
4
|
+
data.tar.gz: f7fa87af36670ed506075408bc3da63e8250bbad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 480d40a1b6cec6316720122aed2b62b37ec7adbc4ac234f038fe17ed7ab7076d7d9c691de5ba2b94912a9678f649d7101463530d640f57dc1e0c79cda716ed99
|
7
|
+
data.tar.gz: 90729d989b45eaa63b893b8e6b055dd9915c5677c61b0df93eae85cebcc892f8039c975909061a6d25e49d65db3e650367dce725e5550e8d38bc63f71860bfbc
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
jruby-9.0.
|
1
|
+
jruby-9.0.4.0
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ Either "column" or "columns" is required for specifying inserted column(s).
|
|
17
17
|
|
18
18
|
The "column" associate array can contain following optional configuration.
|
19
19
|
|
20
|
-
- **as**: type of the constant vaule in the column, i.e. boolean, long, double, string or
|
20
|
+
- **as**: type of the constant vaule in the column, i.e. boolean, long, double, string, timestamp or json(string, default: string)
|
21
21
|
|
22
22
|
### Position
|
23
23
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
spec.name = "embulk-filter-insert"
|
4
|
-
spec.version = "1.1.
|
4
|
+
spec.version = "1.1.1"
|
5
5
|
spec.authors = ["Masahiro Yoshizawa"]
|
6
6
|
spec.summary = "Embulk filter plugin that inserts column(s) at any position"
|
7
7
|
spec.description = "Embulk filter plugin that inserts column(s) at any position (e.g., the top/bottom of the columns, before/after the specified column name)"
|
@@ -15,6 +15,6 @@ Gem::Specification.new do |spec|
|
|
15
15
|
|
16
16
|
#spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
|
17
17
|
spec.add_development_dependency 'bundler', ['~> 1.0']
|
18
|
-
spec.add_development_dependency 'embulk', ['
|
18
|
+
spec.add_development_dependency 'embulk', ['>= 0.8.9']
|
19
19
|
spec.add_development_dependency 'rake', ['>= 10.0']
|
20
20
|
end
|
data/lib/embulk/filter/insert.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'json'
|
1
2
|
module Embulk
|
2
3
|
module Filter
|
3
4
|
|
@@ -97,6 +98,10 @@ module Embulk
|
|
97
98
|
:type => type
|
98
99
|
}
|
99
100
|
|
101
|
+
# In the following case, this plugin inserts null
|
102
|
+
# e.g., { type: insert, column: { user_id: null, as: long } }
|
103
|
+
return column if column[:value].nil?
|
104
|
+
|
100
105
|
case type
|
101
106
|
when :boolean
|
102
107
|
column[:value] = (column[:value] != "false")
|
@@ -108,8 +113,10 @@ module Embulk
|
|
108
113
|
# do nothing
|
109
114
|
when :timestamp
|
110
115
|
column[:value] = Date.parse(column[:value])
|
116
|
+
when :json
|
117
|
+
column[:value] = JSON.parse(column[:value])
|
111
118
|
else
|
112
|
-
raise ArgumentError, "Unknown type #{type}: supported types are boolean, long, double, string and
|
119
|
+
raise ArgumentError, "Unknown type #{type}: supported types are boolean, long, double, string, timestamp and json"
|
113
120
|
end
|
114
121
|
|
115
122
|
column
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-filter-insert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro Yoshizawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: embulk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.8.9
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.8.9
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|