embulk-filter-oracle_lookup 0.1.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9885f845088fdd2241e758fe03112032fcc3b35a16428ffe62aa3e756372ffd
4
- data.tar.gz: 82df7d21ab5a39399139c8ffc7870b165a9455cb44dcc42b220f5c267a8def22
3
+ metadata.gz: 44cbb7d877cf65695955d7aaf6ff74ab3d4471491f879cc44a586742b7a47c0e
4
+ data.tar.gz: b06e0d9ec65af1124c1a67b5cb852b070035ad3c8e18ac7eeb803a55838088cf
5
5
  SHA512:
6
- metadata.gz: 75e96a6ac0cdf490fda5fad8f6c646985f805e89f9024af91330df2d0cde0361503e133f3dc47cc1d1b56feb31a0e4b52ca5cf8d705fbd5d7beebd4bb4ee0e92
7
- data.tar.gz: cd99d4d7b01a25f1b0f8c9429578720d5be694e55e76578ede5d8fcff4be6a70ac6227e5d9bd287786c1ce68dbcd5c04e5b80e7e45d38993be2903f7006cd091
6
+ metadata.gz: 68dfd011dec9ba2970a136806d69ff7dac8100b91a3fe1b400b242c112dc4a7a8a90ed2912a983e4182ebd09df89dc48568b3e7fc40677f449f3d4133dae1954
7
+ data.tar.gz: b21793a7929d8a549ab54fe4fb8c855f1c1dcabcbff835c48c3d598a442b39a102b5ab97aae0ffc49b947e94b28cf77a355afcf70ff615e102e16a52a1ad08ea
data/.gitignore CHANGED
@@ -1,12 +1,12 @@
1
- *~
2
- /pkg/
3
- /tmp/
4
- *.gemspec
5
- .gradle/
6
- /classpath/
7
- build/
8
- .idea
9
- /.settings/
10
- /.metadata/
11
- .classpath
12
- .project
1
+ *~
2
+ /pkg/
3
+ /tmp/
4
+ *.gemspec
5
+ .gradle/
6
+ /classpath/
7
+ build/
8
+ .idea
9
+ /.settings/
10
+ /.metadata/
11
+ .classpath
12
+ .project
@@ -1,22 +1,22 @@
1
- Copyright (c) 2022 InfoObjects
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1
+ Copyright (c) 2022 InfoObjects
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
22
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,134 +1,147 @@
1
- # Oracle lookup filter plugin for Embulk
2
-
3
- An Embulk filter plugin for Lookup Transformation with Oracle database
4
-
5
- ## Configuration
6
-
7
- - **oracle_lookup**: Required attributes for the LookUp Filter Plugin -
8
- - **host**: database host (example `localhost`) (required)
9
- - **port**: database port (example port for oracle `1521`) (required)
10
- - **database**: database name (required)
11
- - **tablename**: table name of your database (required)
12
- - **username**: username for your database (required)
13
- - **password**: password for database (required)
14
- - **mapping_from**: (Name of columns to be matched with table 2 columns) (required)
15
- - **Name of column-1**: column name-1 from input file
16
- - **Name of column-2**: column name-2 from input file etc ...
17
- - **mapping_to**: (Name of columns to be matched with table 1 columns) (required)
18
- - **Name of column-1**: column name-1 from input file
19
- - **Name of column-2**: column name-2 from input file
20
- - **new_columns**: (New generated column names) (required)
21
- - **Name-1,Type-1**: Any Name, Type of the name (name: country_name, type: string)
22
- - **Name-2,Type-2**: Any Name, Type of the name (name: country_address, type: string) etc ...
23
- ## Example - columns
24
-
25
- Input1 for table 1 is as follows :-
26
-
27
- ```
28
- year country_code country_name literacy_rate
29
-
30
- 1990 1 India 80%
31
- 1993 2 USA 83%
32
- 1997 3 JAPAN
33
- 1999 4 China 72%
34
- 2000 5 Ukraine 68%
35
- 2002 6 Italy 79%
36
- 2004 7 UK 75%
37
- 2011 8 NULL 42%
38
- ```
39
-
40
- Input2 for table 2 is as follows :-
41
-
42
- ```
43
- id country_population country_address country_GDP
44
-
45
- 1 11.3 India 1.67
46
- 2 18.2 USA 16.72
47
- 3 30 JAPAN 5.00
48
- 4 4 China 9.33
49
- 5 57 Ukraine 1.08
50
- 6 63 Italy 2.068
51
- 7 17 UK 2.49
52
- 8 28 UAE 1.18
53
-
54
-
55
- Note: country_population is calculated in Billion and country_GDP is calculated in $USD Trillion
56
- ```
57
-
58
- As shown in yaml below, columns mentioned in mapping_from will be mapped with columns mentioned in mapping_to
59
- ie:
60
-
61
-
62
- country_code : id
63
- country_name : country_address
64
-
65
- After successful mapping an Output.csv file containing the columns mentioned in new_columns will be generated
66
-
67
-
68
-
69
- Output File generated :-
70
-
71
- ```
72
- year country_code country_name literacy_rate country_GDP country_population
73
-
74
- 1990 1 India 80% 1.67 11.3
75
- 1993 2 USA 83% 16.72 18.2
76
- 1997 3 JAPAN 5.00 30
77
- 1999 4 China 72% 9.33 4
78
- 2000 5 Ukraine 68% 1.08 57
79
- 2002 6 Italy 79% 2.068 63
80
- 2004 7 UK 75% 2.49 17
81
- 2011 8 NULL 42%
82
- ```
83
-
84
-
85
-
86
- ```yaml
87
- - type: oracle_lookup
88
- lookup_destination: mysql
89
- host: localhost
90
- port: 1521
91
- database: XE
92
- tablename: country
93
- username: sys as sysdba
94
- password: root
95
- mapping_from:
96
- - quarter_number
97
- - attr_1
98
- mapping_to:
99
- - id
100
- - country_address
101
- new_columns:
102
- - { name: country_name, type: string }
103
- - { name: country_address, type: string }
104
- ```
105
-
106
- Notes:
107
- 1. mapping_from attribute should be in same order as mentioned in input file.
108
-
109
- ## Development
110
-
111
- Run example:
112
-
113
- ```
114
- $ ./gradlew package
115
- $ embulk run -I ./lib seed.yml
116
- ```
117
-
118
- Deployment Steps:
119
-
120
- ```
121
- Install ruby in your machine
122
- $ gem install gemcutter (For windows OS)
123
-
124
- $ ./gradlew gemPush
125
- $ gem build NameOfYourPlugins (example: embulk-filter-oracle_lookup)
126
- $ gem push embulk-filter-oracle_lookup-0.1.0.gem (You will get this name after running above command)
127
- ```
128
-
129
-
130
- Release gem:
131
-
132
- ```
133
- $ ./gradlew gemPush
134
- ```
1
+
2
+ <p align="center">
3
+ <a href="https://www.infoobjects.com/" target="blank"><img src="screenshots/logo.png" width="150" alt="InfoObjects Logo" /></a>
4
+ </p>
5
+ <p align="center">Infoobjects is a consulting company that helps enterprises transform how and where they run applications and infrastructure.
6
+ From strategy, to implementation, to ongoing managed services, Infoobjects creates tailored cloud solutions for enterprises at all stages of the cloud journey.</p>
7
+
8
+ # Postgres lookup filter plugin for Embulk
9
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
10
+
11
+ # Oracle lookup filter plugin for Embulk
12
+
13
+ An Embulk filter plugin for Lookup Transformation with Oracle database
14
+
15
+ ## Configuration
16
+
17
+ - **oracle_lookup**: Required attributes for the LookUp Filter Plugin -
18
+ - **host**: database host (example `localhost`) (required)
19
+ - **port**: database port (example port for oracle `1521`) (required)
20
+ - **database**: database name (required)
21
+ - **table**: table name of your database (required)
22
+ - **username**: username for your database (required)
23
+ - **password**: password for database (required)
24
+ - **mapping_from**: (Name of columns to be matched with table 2 columns) (required)
25
+ - **Name of column-1**: column name-1 from input file
26
+ - **Name of column-2**: column name-2 from input file etc ...
27
+ - **mapping_to**: (Name of columns to be matched with table 1 columns) (required)
28
+ - **Name of column-1**: column name-1 from input file
29
+ - **Name of column-2**: column name-2 from input file
30
+ - **new_columns**: (New generated column names) (required)
31
+ - **Name-1,Type-1**: Any Name, Type of the name (name: country_name, type: string)
32
+ - **Name-2,Type-2**: Any Name, Type of the name (name: country_address, type: string) etc ...
33
+ ## Example - columns
34
+
35
+ Input1 for table 1 is as follows :-
36
+
37
+ ```
38
+ year country_code country_name literacy_rate
39
+
40
+ 1990 1 India 80%
41
+ 1993 2 USA 83%
42
+ 1997 3 JAPAN
43
+ 1999 4 China 72%
44
+ 2000 5 Ukraine 68%
45
+ 2002 6 Italy 79%
46
+ 2004 7 UK 75%
47
+ 2011 8 NULL 42%
48
+ ```
49
+
50
+ Input2 for table 2 is as follows :-
51
+
52
+ ```
53
+ id country_population country_address country_GDP
54
+
55
+ 1 11.3 India 1.67
56
+ 2 18.2 USA 16.72
57
+ 3 30 JAPAN 5.00
58
+ 4 4 China 9.33
59
+ 5 57 Ukraine 1.08
60
+ 6 63 Italy 2.068
61
+ 7 17 UK 2.49
62
+ 8 28 UAE 1.18
63
+
64
+
65
+ Note: country_population is calculated in Billion and country_GDP is calculated in $USD Trillion
66
+ ```
67
+
68
+ As shown in yaml below, columns mentioned in mapping_from will be mapped with columns mentioned in mapping_to
69
+ ie:
70
+
71
+
72
+ country_code : id
73
+ country_name : country_address
74
+
75
+ After successful mapping an Output.csv file containing the columns mentioned in new_columns will be generated
76
+
77
+
78
+
79
+ Output File generated :-
80
+
81
+ ```
82
+ year country_code country_name literacy_rate country_GDP country_population
83
+
84
+ 1990 1 India 80% 1.67 11.3
85
+ 1993 2 USA 83% 16.72 18.2
86
+ 1997 3 JAPAN 5.00 30
87
+ 1999 4 China 72% 9.33 4
88
+ 2000 5 Ukraine 68% 1.08 57
89
+ 2002 6 Italy 79% 2.068 63
90
+ 2004 7 UK 75% 2.49 17
91
+ 2011 8 NULL 42%
92
+ ```
93
+
94
+
95
+
96
+ ```yaml
97
+ - type: oracle_lookup
98
+ lookup_destination: mysql
99
+ host: localhost
100
+ port: 1521
101
+ database: XE
102
+ tablename: country
103
+ username: sys as sysdba
104
+ password: root
105
+ mapping_from:
106
+ - quarter_number
107
+ - attr_1
108
+ mapping_to:
109
+ - id
110
+ - country_address
111
+ new_columns:
112
+ - { name: country_name, type: string }
113
+ - { name: country_address, type: string }
114
+ ```
115
+
116
+ Notes:
117
+ 1. mapping_from attribute should be in same order as mentioned in input file.
118
+
119
+ ## Development
120
+
121
+ Run example:
122
+
123
+ ```
124
+ $ ./gradlew package
125
+ $ embulk run -I ./lib seed.yml
126
+ ```
127
+
128
+ Deployment Steps:
129
+
130
+ ```
131
+ Install ruby in your machine
132
+ $ gem install gemcutter (For windows OS)
133
+
134
+ $ ./gradlew gemPush
135
+ $ gem build NameOfYourPlugins (example: embulk-filter-oracle_lookup)
136
+ $ gem push embulk-filter-oracle_lookup-0.1.0.gem (You will get this name after running above command)
137
+ ```
138
+
139
+
140
+ Release gem:
141
+
142
+ ```
143
+ $ ./gradlew gemPush
144
+ ```
145
+ ## Licensing
146
+
147
+ InfoObjects [license](LICENSE) (MIT License)
data/build.gradle CHANGED
@@ -1,98 +1,98 @@
1
- plugins {
2
- id "com.jfrog.bintray" version "1.1"
3
- id "com.github.jruby-gradle.base" version "1.5.0"
4
- id "java"
5
- id "checkstyle"
6
- }
7
- import com.github.jrubygradle.JRubyExec
8
- repositories {
9
- mavenCentral()
10
- jcenter()
11
- }
12
- configurations {
13
- provided
14
- }
15
-
16
- version = "0.1.0"
17
-
18
- sourceCompatibility = 1.8
19
- targetCompatibility = 1.8
20
-
21
- dependencies {
22
- compile "org.embulk:embulk-core:0.9.8"
23
- provided "org.embulk:embulk-core:0.9.8"
24
- // compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
25
- testCompile "junit:junit:4.+"
26
- compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.19'
27
- }
28
-
29
- task classpath(type: Copy, dependsOn: ["jar"]) {
30
- doFirst { file("classpath").deleteDir() }
31
- from (configurations.runtime - configurations.provided + files(jar.archivePath))
32
- into "classpath"
33
- }
34
- clean { delete "classpath" }
35
-
36
- checkstyle {
37
- configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
38
- toolVersion = '6.14.1'
39
- }
40
- checkstyleMain {
41
- configFile = file("${project.rootDir}/config/checkstyle/default.xml")
42
- ignoreFailures = true
43
- }
44
- checkstyleTest {
45
- configFile = file("${project.rootDir}/config/checkstyle/default.xml")
46
- ignoreFailures = true
47
- }
48
- task checkstyle(type: Checkstyle) {
49
- classpath = sourceSets.main.output + sourceSets.test.output
50
- source = sourceSets.main.allJava + sourceSets.test.allJava
51
- }
52
-
53
- task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
54
- jrubyArgs "-S"
55
- script "gem"
56
- scriptArgs "build", "${project.name}.gemspec"
57
- doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
58
- }
59
-
60
- task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
61
- jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "push"
62
- script "pkg/${project.name}-${project.version}.gem"
63
- }
64
-
65
- task "package"(dependsOn: ["gemspec", "classpath"]) {
66
- doLast {
67
- println "> Build succeeded."
68
- println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
69
- }
70
- }
71
-
72
- task gemspec {
73
- ext.gemspecFile = file("${project.name}.gemspec")
74
- inputs.file "build.gradle"
75
- outputs.file gemspecFile
76
- doLast { gemspecFile.write($/
77
- Gem::Specification.new do |spec|
78
- spec.name = "${project.name}"
79
- spec.version = "${project.version}"
80
- spec.authors = ["Infoobjects Inc."]
81
- spec.summary = %[Oracle Lookup filter plugin for Embulk]
82
- spec.description = %[Oracle Lookup]
83
- spec.email = ["utkarsh@infoobjects.com"]
84
- spec.licenses = ["MIT"]
85
- # TODO set this: spec.homepage = "https://github.com/InfoObjects/embulk-filter-oracle_lookup"
86
-
87
- spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
88
- spec.test_files = spec.files.grep(%r"^(test|spec)/")
89
- spec.require_paths = ["lib"]
90
-
91
- #spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
92
- spec.add_development_dependency 'bundler', ['~> 1.0']
93
- spec.add_development_dependency 'rake', ['~> 12.0']
94
- end
95
- /$)
96
- }
97
- }
98
- clean { delete "${project.name}.gemspec" }
1
+ plugins {
2
+ id "com.jfrog.bintray" version "1.1"
3
+ id "com.github.jruby-gradle.base" version "1.5.0"
4
+ id "java"
5
+ id "checkstyle"
6
+ }
7
+ import com.github.jrubygradle.JRubyExec
8
+ repositories {
9
+ mavenCentral()
10
+ jcenter()
11
+ }
12
+ configurations {
13
+ provided
14
+ }
15
+
16
+ version = "0.2.1"
17
+
18
+ sourceCompatibility = 1.8
19
+ targetCompatibility = 1.8
20
+
21
+ dependencies {
22
+ compile "org.embulk:embulk-core:0.9.8"
23
+ provided "org.embulk:embulk-core:0.9.8"
24
+ // compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
25
+ testCompile "junit:junit:4.+"
26
+ compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.19'
27
+ }
28
+
29
+ task classpath(type: Copy, dependsOn: ["jar"]) {
30
+ doFirst { file("classpath").deleteDir() }
31
+ from (configurations.runtime - configurations.provided + files(jar.archivePath))
32
+ into "classpath"
33
+ }
34
+ clean { delete "classpath" }
35
+
36
+ checkstyle {
37
+ configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
38
+ toolVersion = '6.14.1'
39
+ }
40
+ checkstyleMain {
41
+ configFile = file("${project.rootDir}/config/checkstyle/default.xml")
42
+ ignoreFailures = true
43
+ }
44
+ checkstyleTest {
45
+ configFile = file("${project.rootDir}/config/checkstyle/default.xml")
46
+ ignoreFailures = true
47
+ }
48
+ task checkstyle(type: Checkstyle) {
49
+ classpath = sourceSets.main.output + sourceSets.test.output
50
+ source = sourceSets.main.allJava + sourceSets.test.allJava
51
+ }
52
+
53
+ task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
54
+ jrubyArgs "-S"
55
+ script "gem"
56
+ scriptArgs "build", "${project.name}.gemspec"
57
+ doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
58
+ }
59
+
60
+ task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
61
+ jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "push"
62
+ script "pkg/${project.name}-${project.version}.gem"
63
+ }
64
+
65
+ task "package"(dependsOn: ["gemspec", "classpath"]) {
66
+ doLast {
67
+ println "> Build succeeded."
68
+ println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
69
+ }
70
+ }
71
+
72
+ task gemspec {
73
+ ext.gemspecFile = file("${project.name}.gemspec")
74
+ inputs.file "build.gradle"
75
+ outputs.file gemspecFile
76
+ doLast { gemspecFile.write($/
77
+ Gem::Specification.new do |spec|
78
+ spec.name = "${project.name}"
79
+ spec.version = "${project.version}"
80
+ spec.authors = ["Infoobjects Inc."]
81
+ spec.summary = %[Oracle Lookup filter plugin for Embulk]
82
+ spec.description = %[Oracle Lookup]
83
+ spec.email = ["utkarsh@infoobjects.com"]
84
+ spec.licenses = ["MIT"]
85
+ # TODO set this: spec.homepage = "https://github.com/InfoObjects/embulk-filter-oracle_lookup"
86
+
87
+ spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
88
+ spec.test_files = spec.files.grep(%r"^(test|spec)/")
89
+ spec.require_paths = ["lib"]
90
+
91
+ #spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
92
+ spec.add_development_dependency 'bundler', ['~> 1.0']
93
+ spec.add_development_dependency 'rake', ['~> 12.0']
94
+ end
95
+ /$)
96
+ }
97
+ }
98
+ clean { delete "${project.name}.gemspec" }