embulk-filter-timestamp_format 0.2.1 → 0.2.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a2a594a84f03137480454f65b2ee9f5e3bbc58a
|
4
|
+
data.tar.gz: 836fb23b2550507518b6f2de9ca77b3220e09457
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7deb792bec505f3cd70e0e191d98473d383d4f58dddba199dad285c47f0cf2fb003fb2e8face50336bfb9577e769b7d673fa99e2ce4be2a21269a0a2b0cb831
|
7
|
+
data.tar.gz: 0135e7bca5a55b62b31e6768e3b1a7e3e4ebfa1caa66bd289187d1a8fdd512bd270041d626205a10bad1d6abe33e36834a87aea3da3cca93e52cff6c2325ae1d
|
data/CHANGELOG.md
CHANGED
data/build.gradle
CHANGED
@@ -50,7 +50,8 @@ public class ColumnVisitorImpl
|
|
50
50
|
String name = columnConfig.getName();
|
51
51
|
if (name.startsWith("$.")) {
|
52
52
|
String firstName = name.split("\\.", 3)[1]; // check only top level column name
|
53
|
-
|
53
|
+
String firstPartName = firstName.split("\\[")[0];
|
54
|
+
shouldCastSet.add(firstPartName);
|
54
55
|
continue;
|
55
56
|
}
|
56
57
|
shouldCastSet.add(name);
|
@@ -78,9 +78,9 @@ public class JsonVisitor
|
|
78
78
|
return shouldVisitSet.contains(jsonPath);
|
79
79
|
}
|
80
80
|
|
81
|
-
public Value visit(String
|
81
|
+
public Value visit(String rootPath, Value value)
|
82
82
|
{
|
83
|
-
if (!shouldVisit(
|
83
|
+
if (!shouldVisit(rootPath)) {
|
84
84
|
return value;
|
85
85
|
}
|
86
86
|
if (value.isArrayValue()) {
|
@@ -88,9 +88,9 @@ public class JsonVisitor
|
|
88
88
|
int size = arrayValue.size();
|
89
89
|
Value[] newValue = new Value[size];
|
90
90
|
for (int i = 0; i < size; i++) {
|
91
|
-
String k = new StringBuilder(
|
91
|
+
String k = new StringBuilder(rootPath).append("[").append(Integer.toString(i)).append("]").toString();
|
92
92
|
if (!shouldVisit(k)) {
|
93
|
-
k = new StringBuilder(
|
93
|
+
k = new StringBuilder(rootPath).append("[*]").toString(); // try [*] too
|
94
94
|
}
|
95
95
|
Value v = arrayValue.get(i);
|
96
96
|
newValue[i] = visit(k, v);
|
@@ -105,7 +105,7 @@ public class JsonVisitor
|
|
105
105
|
for (Map.Entry<Value, Value> entry : mapValue.entrySet()) {
|
106
106
|
Value k = entry.getKey();
|
107
107
|
Value v = entry.getValue();
|
108
|
-
String newPath = new StringBuilder(
|
108
|
+
String newPath = new StringBuilder(rootPath).append(".").append(k.asStringValue().asString()).toString();
|
109
109
|
Value r = visit(newPath, v);
|
110
110
|
newValue[i++] = k;
|
111
111
|
newValue[i++] = r;
|
@@ -113,15 +113,15 @@ public class JsonVisitor
|
|
113
113
|
return ValueFactory.newMap(newValue, true);
|
114
114
|
}
|
115
115
|
else if (value.isIntegerValue()) {
|
116
|
-
ColumnConfig columnConfig = jsonPathColumnConfigMap.get(
|
116
|
+
ColumnConfig columnConfig = jsonPathColumnConfigMap.get(rootPath);
|
117
117
|
return jsonCaster.fromLong(columnConfig, value.asIntegerValue());
|
118
118
|
}
|
119
119
|
else if (value.isFloatValue()) {
|
120
|
-
ColumnConfig columnConfig = jsonPathColumnConfigMap.get(
|
120
|
+
ColumnConfig columnConfig = jsonPathColumnConfigMap.get(rootPath);
|
121
121
|
return jsonCaster.fromDouble(columnConfig, value.asFloatValue());
|
122
122
|
}
|
123
123
|
else if (value.isStringValue()) {
|
124
|
-
ColumnConfig columnConfig = jsonPathColumnConfigMap.get(
|
124
|
+
ColumnConfig columnConfig = jsonPathColumnConfigMap.get(rootPath);
|
125
125
|
return jsonCaster.fromString(columnConfig, value.asStringValue());
|
126
126
|
}
|
127
127
|
else {
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-filter-timestamp_format
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ~>
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.0'
|
20
14
|
requirement: !ruby/object:Gem::Requirement
|
21
15
|
requirements:
|
22
16
|
- - ~>
|
23
17
|
- !ruby/object:Gem::Version
|
24
18
|
version: '1.0'
|
19
|
+
name: bundler
|
25
20
|
prerelease: false
|
26
21
|
type: :development
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
22
|
version_requirements: !ruby/object:Gem::Requirement
|
30
23
|
requirements:
|
31
|
-
- -
|
24
|
+
- - ~>
|
32
25
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
34
28
|
requirement: !ruby/object:Gem::Requirement
|
35
29
|
requirements:
|
36
30
|
- - '>='
|
37
31
|
- !ruby/object:Gem::Version
|
38
32
|
version: '10.0'
|
33
|
+
name: rake
|
39
34
|
prerelease: false
|
40
35
|
type: :development
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
41
|
description: A filter plugin for Embulk to change timestamp format.
|
42
42
|
email:
|
43
43
|
- sonots@gmail.com
|
@@ -102,7 +102,7 @@ files:
|
|
102
102
|
- src/main/java/org/embulk/filter/timestamp_format/cast/TimestampCast.java
|
103
103
|
- src/test/java/org/embulk/filter/timestamp_format/TestTimestampFormatConverter.java
|
104
104
|
- src/test/java/org/embulk/filter/timestamp_format/TestTimestampUnit.java
|
105
|
-
- classpath/embulk-filter-timestamp_format-0.2.
|
105
|
+
- classpath/embulk-filter-timestamp_format-0.2.3.jar
|
106
106
|
homepage: https://github.com/sonots/embulk-filter-timestamp_format
|
107
107
|
licenses:
|
108
108
|
- MIT
|