embulk-filter-csv_lookup 0.1.1 → 0.1.3
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/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +16 -1
- data/build.gradle +1 -1
- data/classpath/embulk-filter-csv_lookup-0.1.3.jar +0 -0
- data/example/config.yml +2 -6
- data/screenshots/logo.png +0 -0
- data/src/main/java/org/embulk/filter/csv_lookup/CsvLookupFilterPlugin.java +5 -3
- metadata +5 -4
- data/classpath/embulk-filter-csv_lookup-0.1.1.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ccafa3bb3b3f1e20a20057215519b154ca294c269d1f074df4dad20decb9a6f
|
4
|
+
data.tar.gz: b61c6f909b4530b674ba4b368407ec10c95ec58411c1d20bc34af08ed805254c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36a7d0d51e645b3f36f2e8ddb5a8e1d28644a35dd694041c915ed9752f061fcf1cbff824faeeecc88d09fc8a1549df45f9488be624006a8cecf424e6e4e45576
|
7
|
+
data.tar.gz: d8bda98b5b26da4ef42c2f87b2e973536c55ce3fdcf2282f081548ce532019051ab54a61c2d7fcbb99866c18b078736c53c94c19fe560c395a85f766353d346e
|
data/{LICENSE.txt → LICENSE}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,10 +1,20 @@
|
|
1
|
+
<p align="center">
|
2
|
+
<a href="https://www.infoobjects.com/" target="blank"><img src="screenshots/logo.png" width="150" alt="InfoObjects Logo" /></a>
|
3
|
+
</p>
|
4
|
+
<p align="center">Infoobjects is a consulting company that helps enterprises transform how and where they run applications and infrastructure.
|
5
|
+
From strategy, to implementation, to ongoing managed services, Infoobjects creates tailored cloud solutions for enterprises at all stages of the cloud journey.</p>
|
6
|
+
|
7
|
+
|
1
8
|
# CSV lookup filter plugin for Embulk
|
9
|
+
[](LICENSE)
|
2
10
|
|
3
11
|
An Embulk filter plugin for Lookup Transformation with CSV
|
4
12
|
|
5
13
|
## Configuration
|
6
14
|
|
7
15
|
- **csv_lookup**: Required attributes for the LookUp Filter Plugin -
|
16
|
+
- **filters**:
|
17
|
+
- **type**: Name of lookup type (required)
|
8
18
|
- **mapping_from**: (Name of columns to be matched with table 2 columns) (required)
|
9
19
|
- **Name of column-1**: column name-1 from input file
|
10
20
|
- **Name of column-2**: column name-2 from input file etc ...
|
@@ -14,6 +24,7 @@ An Embulk filter plugin for Lookup Transformation with CSV
|
|
14
24
|
- **new_columns**: (New generated column names) (required)
|
15
25
|
- **Name-1,Type-1**: Any Name, Type of the name (name: country_name, type: string)
|
16
26
|
- **Name-2,Type-2**: Any Name, Type of the name (name: country_address, type: string) etc ...
|
27
|
+
- **path_of_lookup_file**: lookup file path (required)
|
17
28
|
## Example - columns
|
18
29
|
|
19
30
|
Input1 for table 1 is as follows :-
|
@@ -113,4 +124,8 @@ Release gem:
|
|
113
124
|
|
114
125
|
```
|
115
126
|
$ ./gradlew gemPush
|
116
|
-
```
|
127
|
+
```
|
128
|
+
|
129
|
+
## Licensing
|
130
|
+
|
131
|
+
InfoObjects [license](LICENSE) (MIT License)
|
data/build.gradle
CHANGED
Binary file
|
data/example/config.yml
CHANGED
@@ -13,9 +13,7 @@ in:
|
|
13
13
|
- {name: attr_1, type: string }
|
14
14
|
filters:
|
15
15
|
- type: csv_lookup
|
16
|
-
|
17
|
-
mappingColumn_Value:
|
18
|
-
- { name: country_name, type: string }
|
16
|
+
path_of_lookup_file: /home/infoobjects/GetFiles/countryKey_countryName.csv
|
19
17
|
new_columns:
|
20
18
|
- { name: country_name, type: string }
|
21
19
|
- { name: country_address, type: string }
|
@@ -26,9 +24,7 @@ filters:
|
|
26
24
|
- id
|
27
25
|
- country_code
|
28
26
|
- type: csv_lookup
|
29
|
-
|
30
|
-
mappingColumn_Value:
|
31
|
-
- { name: country_name, type: string }
|
27
|
+
path_of_lookup_file: /home/infoobjects/GetFiles/countryKey_countryName.csv
|
32
28
|
new_columns:
|
33
29
|
- { name: country_code,type: double }
|
34
30
|
mapping_from:
|
Binary file
|
@@ -37,6 +37,9 @@ public class CsvLookupFilterPlugin
|
|
37
37
|
@Config("new_columns")
|
38
38
|
public SchemaConfig getNewColumns();
|
39
39
|
|
40
|
+
@Config("path_of_lookup_file")
|
41
|
+
public String getPathOfLookupFile();
|
42
|
+
|
40
43
|
}
|
41
44
|
|
42
45
|
@Override
|
@@ -97,10 +100,9 @@ public class CsvLookupFilterPlugin
|
|
97
100
|
for (ColumnConfig columnConfig : task.getNewColumns().getColumns()) {
|
98
101
|
newColumns.add(columnConfig.getName());
|
99
102
|
}
|
100
|
-
String file = "/home/infoobjects/Downloads/sample/countryKey_countryName.csv";
|
101
103
|
BufferedReader reader = null;
|
102
104
|
String line = "";
|
103
|
-
reader = new BufferedReader(new FileReader(
|
105
|
+
reader = new BufferedReader(new FileReader(task.getPathOfLookupFile()));
|
104
106
|
String[] lineDataArray;
|
105
107
|
Map<String, Integer> map1 = new LinkedHashMap<>();
|
106
108
|
List<Integer> list1 = new ArrayList<>();
|
@@ -128,7 +130,7 @@ public class CsvLookupFilterPlugin
|
|
128
130
|
list2.add(map1.get(newColumns.get(x)));
|
129
131
|
}
|
130
132
|
|
131
|
-
CSVReader reader1 = new CSVReader(new FileReader(
|
133
|
+
CSVReader reader1 = new CSVReader(new FileReader(task.getPathOfLookupFile()));
|
132
134
|
String [] nextLine;
|
133
135
|
int i = 0;
|
134
136
|
while ((nextLine = reader1.readNext()) != null) {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-filter-csv_lookup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Infoobjects Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -46,7 +46,7 @@ extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
48
|
- ".gitignore"
|
49
|
-
- LICENSE
|
49
|
+
- LICENSE
|
50
50
|
- README.md
|
51
51
|
- build.gradle
|
52
52
|
- classpath/commons-beanutils-1.9.4.jar
|
@@ -55,7 +55,7 @@ files:
|
|
55
55
|
- classpath/commons-lang3-3.12.0.jar
|
56
56
|
- classpath/commons-logging-1.2.jar
|
57
57
|
- classpath/commons-text-1.9.jar
|
58
|
-
- classpath/embulk-filter-csv_lookup-0.1.
|
58
|
+
- classpath/embulk-filter-csv_lookup-0.1.3.jar
|
59
59
|
- classpath/opencsv-5.6.jar
|
60
60
|
- config/checkstyle/checkstyle.xml
|
61
61
|
- config/checkstyle/default.xml
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- gradlew
|
66
66
|
- gradlew.bat
|
67
67
|
- lib/embulk/filter/csv_lookup.rb
|
68
|
+
- screenshots/logo.png
|
68
69
|
- src/main/java/org/embulk/filter/csv_lookup/CsvLookupFilterPlugin.java
|
69
70
|
- src/test/java/org/embulk/filter/csv_lookup/TestCsvLookupFilterPlugin.java
|
70
71
|
homepage: https://github.com/InfoObjects/embulk-filter-csv_lookup
|
Binary file
|