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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c930b9f8d2efac6c196e72071268d25e0596f107
4
- data.tar.gz: 2a5b3b96c7a8c34c53045a72038634ed06072ab7
3
+ metadata.gz: c5f9a086691645351c64c10d5ae574b8c4a52d05
4
+ data.tar.gz: c70bffc4d85ce981518b4bbf63704330502d5a21
5
5
  SHA512:
6
- metadata.gz: ebce654eaa2b20d892d64d9ceebe0d7f914b762bae4a09fcbafe52b8bea406a5a552aad5a0ad38a9699a40a8763d5043e75ecd5bad0200ad5d50e34bfbf2a20e
7
- data.tar.gz: f53a115e19a1e96a760fc7c65f19479d93f42a36ff31c6473ee4a37959fbc9ec125f82d3a6f89fda2c7fb47dfb8b484fd76e577e6fd40491c221429c135547f9
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 json table (array of hash, required)
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
@@ -12,7 +12,7 @@ configurations {
12
12
  provided
13
13
  }
14
14
 
15
- version = "0.0.1"
15
+ version = "0.0.2"
16
16
  sourceCompatibility = 1.7
17
17
  targetCompatibility = 1.7
18
18
 
@@ -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 PageOutput pageOutput;
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.pageOutput = pageOutput;
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
- try (final PageBuilder pageBuilder = new PageBuilder(Exec.getBufferAllocator(), outputSchema, pageOutput)) {
58
- pageReader.setPage(page);
53
+ pageReader.setPage(page);
59
54
 
60
- while (pageReader.nextRecord()) {
61
- setInputValues(pageBuilder);
62
- setJoinedValues(pageBuilder);
63
- pageBuilder.addRecord();
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
- pageOutput.finish();
65
+ pageBuilder.finish();
73
66
  }
74
67
 
75
68
  @Override
76
69
  public void close()
77
70
  {
78
71
  pageReader.close();
79
- pageOutput.close();
72
+ pageBuilder.close();
80
73
  }
81
74
 
82
75
  private void setInputValues(PageBuilder pageBuilder) {
83
- for (Column inputColumn: inputSchema.getColumns()) {
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.1
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-10-11 00:00:00.000000000 Z
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.1.jar
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