embulk-parser-none 0.1.0 → 0.2.0
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/CHANGELOG.md +8 -0
- data/README.md +20 -6
- data/build.gradle +1 -1
- data/example.yml +2 -3
- data/src/main/java/org/embulk/parser/NoneParserPlugin.java +6 -6
- 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: f2a6433aa02f99f9554a850e1fcec087939c1179
|
4
|
+
data.tar.gz: 1223f3f2db887407f2d3bc85deb88f1420e2e144
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04a4996c216196c7a3179402f2ca544073498b85fd385a29d330df89e57ee8df4f5a48c1b44efcfd60cbb75fc0d7cb10ecda50538e673d48cef3b08c7692a9e6
|
7
|
+
data.tar.gz: 30055a20f014a87621ea0558687c3fb08e6e61ceb8f1940a109d074487e8f241aabd9a03148ff9082cc7b48ff5ff91c124a51f9a27e2fa0073eb9256275dadeb
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -15,7 +15,7 @@ $ embulk gem install embulk-parser-none
|
|
15
15
|
|
16
16
|
## Configuration
|
17
17
|
|
18
|
-
- **
|
18
|
+
- **column_name**: A column name which this plugin outputs (string, default: "payload")
|
19
19
|
|
20
20
|
## Example
|
21
21
|
|
@@ -24,9 +24,8 @@ in:
|
|
24
24
|
type: file
|
25
25
|
path_prefix: example.txt
|
26
26
|
parser:
|
27
|
-
type:
|
28
|
-
|
29
|
-
message_key: message
|
27
|
+
type: none
|
28
|
+
column_name: payload
|
30
29
|
```
|
31
30
|
|
32
31
|
Assume the input file (example.txt) is as following:
|
@@ -40,14 +39,26 @@ then this plugin treats as:
|
|
40
39
|
|
41
40
|
```
|
42
41
|
+----------------+
|
43
|
-
|
|
42
|
+
| payload:string |
|
44
43
|
+----------------+
|
45
44
|
| foo bar baz |
|
46
45
|
| foo bar baz |
|
47
46
|
+----------------+
|
48
47
|
```
|
49
48
|
|
50
|
-
To
|
49
|
+
To recover a file, you may use [embulk-formatter-single_value](https://github.com/sonots/embulk-formatter-single_value) as:
|
50
|
+
|
51
|
+
```
|
52
|
+
out:
|
53
|
+
type: file
|
54
|
+
path_prefix: example.txt
|
55
|
+
sequence_format: ""
|
56
|
+
file_ext: .out
|
57
|
+
formatter:
|
58
|
+
type: single_value
|
59
|
+
```
|
60
|
+
|
61
|
+
or csv formatter as:
|
51
62
|
|
52
63
|
```
|
53
64
|
out:
|
@@ -57,7 +68,9 @@ out:
|
|
57
68
|
file_ext: .out
|
58
69
|
formatter:
|
59
70
|
type: csv
|
71
|
+
delimiter: 0
|
60
72
|
quote_policy: NONE
|
73
|
+
header_line: false
|
61
74
|
```
|
62
75
|
|
63
76
|
## ChangeLOG
|
@@ -69,6 +82,7 @@ out:
|
|
69
82
|
Run example:
|
70
83
|
|
71
84
|
```
|
85
|
+
$ embulk gem install embulk-formatter-single_value
|
72
86
|
$ ./gradlew classpath
|
73
87
|
$ embulk run -I lib example.yml
|
74
88
|
```
|
data/build.gradle
CHANGED
data/example.yml
CHANGED
@@ -3,12 +3,11 @@ in:
|
|
3
3
|
path_prefix: example.txt
|
4
4
|
parser:
|
5
5
|
type: none
|
6
|
-
|
6
|
+
column_name: payload
|
7
7
|
out:
|
8
8
|
type: file
|
9
9
|
path_prefix: example.txt
|
10
10
|
sequence_format: ""
|
11
11
|
file_ext: .out
|
12
12
|
formatter:
|
13
|
-
type:
|
14
|
-
quote_policy: NONE
|
13
|
+
type: single_value
|
@@ -33,9 +33,9 @@ public class NoneParserPlugin
|
|
33
33
|
public interface PluginTask
|
34
34
|
extends Task, LineDecoder.DecoderTask //, TimestampParser.Task
|
35
35
|
{
|
36
|
-
@Config("
|
37
|
-
@ConfigDefault("\"
|
38
|
-
public String
|
36
|
+
@Config("column_name")
|
37
|
+
@ConfigDefault("\"payload\"")
|
38
|
+
public String getColumnName();
|
39
39
|
}
|
40
40
|
|
41
41
|
@Override
|
@@ -43,9 +43,9 @@ public class NoneParserPlugin
|
|
43
43
|
{
|
44
44
|
PluginTask task = config.loadConfig(PluginTask.class);
|
45
45
|
ArrayList<ColumnConfig> columns = new ArrayList<ColumnConfig>();
|
46
|
-
final String
|
46
|
+
final String columnName = task.getColumnName();
|
47
47
|
|
48
|
-
columns.add(new ColumnConfig(
|
48
|
+
columns.add(new ColumnConfig(columnName, STRING ,config));
|
49
49
|
|
50
50
|
Schema schema = new SchemaConfig(columns).toSchema();
|
51
51
|
control.run(task.dump(), schema);
|
@@ -59,7 +59,7 @@ public class NoneParserPlugin
|
|
59
59
|
LineDecoder lineDecoder = new LineDecoder(input,task);
|
60
60
|
PageBuilder pageBuilder = new PageBuilder(Exec.getBufferAllocator(), schema, output);
|
61
61
|
String line = null;
|
62
|
-
final String
|
62
|
+
final String columnName = task.getColumnName();
|
63
63
|
|
64
64
|
while( input.nextFile() ){
|
65
65
|
while(true){
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-parser-none
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -60,7 +60,7 @@ files:
|
|
60
60
|
- lib/embulk/parser/none.rb
|
61
61
|
- src/main/java/org/embulk/parser/NoneParserPlugin.java
|
62
62
|
- src/test/java/org/embulk/parser/TestNoneParserPlugin.java
|
63
|
-
- classpath/embulk-parser-none-0.
|
63
|
+
- classpath/embulk-parser-none-0.2.0.jar
|
64
64
|
homepage: https://github.com/sonots/embulk-parser-none
|
65
65
|
licenses:
|
66
66
|
- MIT
|