embulk-filter-join_file 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/build.gradle +1 -1
- data/src/main/java/org/embulk/filter/join_file/FilteredPageOutput.java +10 -17
- 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: c5f9a086691645351c64c10d5ae574b8c4a52d05
|
4
|
+
data.tar.gz: c70bffc4d85ce981518b4bbf63704330502d5a21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60ad2a0158a482f0c51582afcbd55ee31c757a4c20879b4b032ef4b7dcc1888e07bbbfa34bb3c1a48538dc122803c0a4a22340c7f26e4a322c67ace06de32fa9
|
7
|
+
data.tar.gz: 35b8ef8dae9788fd29d34870dc0e1b6033330f1ed8583a50fbc26228020df648e79b7eaf1d62f99eccf003be8760911aa389cc13f6c62fa5e80cf1b52e00534a
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ This plugin combine rows from file having data format like a table, based on a c
|
|
19
19
|
- **joined_column_prefix**: prefix added to joined data columns (string, default: `"_joined_by_embulk_"`)
|
20
20
|
- **file_path**: path of file (string, required)
|
21
21
|
- **file_format**: file format (string, required, supported: `csv`, `tsv`, `yaml`, `json`)
|
22
|
-
- **columns**: required columns of
|
22
|
+
- **columns**: required columns of data from the file (array of hash, required)
|
23
23
|
- **name**: name of the column
|
24
24
|
- **type**: type of the column (see below)
|
25
25
|
- **format**: format of the timestamp if type is timestamp
|
data/build.gradle
CHANGED
@@ -22,9 +22,7 @@ public class FilteredPageOutput
|
|
22
22
|
{
|
23
23
|
private final org.slf4j.Logger logger = Exec.getLogger(FilteredPageOutput.class);
|
24
24
|
private final PageReader pageReader;
|
25
|
-
private final
|
26
|
-
private final Schema inputSchema;
|
27
|
-
private final Schema outputSchema;
|
25
|
+
private final PageBuilder pageBuilder;
|
28
26
|
private final Column joinBaseColumn;
|
29
27
|
private final HashMap<String, HashMap<String, String>> table;
|
30
28
|
private final List<Column> joinColumns;
|
@@ -41,9 +39,7 @@ public class FilteredPageOutput
|
|
41
39
|
)
|
42
40
|
{
|
43
41
|
this.pageReader = new PageReader(inputSchema);
|
44
|
-
this.
|
45
|
-
this.inputSchema = inputSchema;
|
46
|
-
this.outputSchema = outputSchema;
|
42
|
+
this.pageBuilder = new PageBuilder(Exec.getBufferAllocator(), outputSchema, pageOutput);
|
47
43
|
this.joinBaseColumn = joinBaseColumn;
|
48
44
|
this.table = table;
|
49
45
|
this.joinColumns = joinColumns;
|
@@ -54,33 +50,30 @@ public class FilteredPageOutput
|
|
54
50
|
@Override
|
55
51
|
public void add(Page page)
|
56
52
|
{
|
57
|
-
|
58
|
-
pageReader.setPage(page);
|
53
|
+
pageReader.setPage(page);
|
59
54
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
}
|
65
|
-
pageBuilder.finish();
|
55
|
+
while (pageReader.nextRecord()) {
|
56
|
+
setInputValues(pageBuilder);
|
57
|
+
setJoinedValues(pageBuilder);
|
58
|
+
pageBuilder.addRecord();
|
66
59
|
}
|
67
60
|
}
|
68
61
|
|
69
62
|
@Override
|
70
63
|
public void finish()
|
71
64
|
{
|
72
|
-
|
65
|
+
pageBuilder.finish();
|
73
66
|
}
|
74
67
|
|
75
68
|
@Override
|
76
69
|
public void close()
|
77
70
|
{
|
78
71
|
pageReader.close();
|
79
|
-
|
72
|
+
pageBuilder.close();
|
80
73
|
}
|
81
74
|
|
82
75
|
private void setInputValues(PageBuilder pageBuilder) {
|
83
|
-
for (Column inputColumn:
|
76
|
+
for (Column inputColumn: pageReader.getSchema().getColumns()) {
|
84
77
|
if (pageReader.isNull(inputColumn)) {
|
85
78
|
pageBuilder.setNull(inputColumn);
|
86
79
|
continue;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-filter-join_file
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Civitaspo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -61,7 +61,7 @@ files:
|
|
61
61
|
- src/main/java/org/embulk/filter/join_file/JoinFileFilterPlugin.java
|
62
62
|
- src/main/java/org/embulk/filter/join_file/TableBuilder.java
|
63
63
|
- src/test/java/org/embulk/filter/join_file/TestJoinFileFilterPlugin.java
|
64
|
-
- classpath/embulk-filter-join_file-0.0.
|
64
|
+
- classpath/embulk-filter-join_file-0.0.2.jar
|
65
65
|
homepage: https://github.com/civitaspo/embulk-filter-join_file
|
66
66
|
licenses:
|
67
67
|
- MIT
|