embulk-parser-jsonpath 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/README.md +1 -1
- data/build.gradle +1 -1
- data/src/main/java/org/embulk/parser/jsonpath/JsonpathParserPlugin.java +11 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fa00c28b1cddf31875627709899e97cd22e68c2
|
4
|
+
data.tar.gz: 9dce9b4ee36202ef63065b676221622f420091f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce5b684201f61e8afc284c64b32e9470f468c93ea68b739815507b40c4ad69f703c766bb0eb4a834cabc019826bb519d0bb69f9ff9f0c97aa1afdc5ebd7eb2bc
|
7
|
+
data.tar.gz: 20732822287850a87b98828efd4e272f179237dcd0416960a0b066b20578675c36530869fc7d7aa9bc7ed269a7746c6da908d0337c78034aedbe4f7cfb2b86b9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -5,7 +5,7 @@ The JSON with [JSONPath](http://goessner.net/articles/JsonPath/) parser plugin f
|
|
5
5
|
## Overview
|
6
6
|
|
7
7
|
* **Plugin type**: parser
|
8
|
-
* **Guess supported**: yes
|
8
|
+
* **Guess supported**: yes (A JSON data size supports up to 32KB. [#476](https://github.com/embulk/embulk/issues/476))
|
9
9
|
|
10
10
|
## Configuration
|
11
11
|
|
data/build.gradle
CHANGED
@@ -25,6 +25,7 @@ import org.msgpack.value.Value;
|
|
25
25
|
import org.slf4j.Logger;
|
26
26
|
|
27
27
|
import java.io.IOException;
|
28
|
+
import java.util.Locale;
|
28
29
|
import java.util.Map;
|
29
30
|
|
30
31
|
import static java.util.Locale.ENGLISH;
|
@@ -84,7 +85,7 @@ public class JsonpathParserPlugin
|
|
84
85
|
|
85
86
|
setColumnNameValues(schema);
|
86
87
|
|
87
|
-
logger.
|
88
|
+
logger.info("JSONPath = " + jsonRoot);
|
88
89
|
final TimestampParser[] timestampParsers = Timestamps.newTimestampColumnParsers(task, task.getSchemaConfig());
|
89
90
|
final JsonParser jsonParser = new JsonParser();
|
90
91
|
final boolean stopOnInvalidRecord = task.getStopOnInvalidRecord();
|
@@ -95,8 +96,16 @@ public class JsonpathParserPlugin
|
|
95
96
|
try (FileInputInputStream is = new FileInputInputStream(input)) {
|
96
97
|
while (is.nextFile()) {
|
97
98
|
// TODO more efficient handling.
|
99
|
+
Value value;
|
98
100
|
String json = JsonPath.read(is, jsonRoot).toString();
|
99
|
-
|
101
|
+
try {
|
102
|
+
value = jsonParser.parse(json);
|
103
|
+
}
|
104
|
+
catch (Exception ex) {
|
105
|
+
logger.error(String.format(Locale.ENGLISH, "Parse failed input data = '%s'", json));
|
106
|
+
throw new DataException(String.format(Locale.ENGLISH, "Parse failed reason = %s, input data = '%s'", ex.getMessage(), json));
|
107
|
+
}
|
108
|
+
|
100
109
|
if (!value.isArrayValue()) {
|
101
110
|
throw new JsonRecordValidateException("Json string is not representing array value.");
|
102
111
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-parser-jsonpath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroyuki Sato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,7 +110,7 @@ files:
|
|
110
110
|
- src/test/java/org/embulk/parser/jsonpath/cast/TestStringCast.java
|
111
111
|
- classpath/accessors-smart-1.1.jar
|
112
112
|
- classpath/asm-5.0.3.jar
|
113
|
-
- classpath/embulk-parser-jsonpath-0.1.
|
113
|
+
- classpath/embulk-parser-jsonpath-0.1.2.jar
|
114
114
|
- classpath/json-path-2.2.0.jar
|
115
115
|
- classpath/json-smart-2.2.1.jar
|
116
116
|
- classpath/slf4j-api-1.7.16.jar
|