embulk-filter-flatten_json 0.0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cf0081e351fe454511db57422dd700ac5a33d87d
4
+ data.tar.gz: 0e96abc3127d6c7927d9eb063ad5d9f7da30b452
5
+ SHA512:
6
+ metadata.gz: 07e761cc4d4d3a5123717fe5843389fdc51ec0aae4ff55ac40ec00c9430bc854a85ea4c096385e5d2616131e839cc47dfca72ad41b2c67c87ded3bfd1e6c33ca
7
+ data.tar.gz: 7a7c2220afba502bb28ad4d7c4575bc29fec509e9a0afe7b67ca32ce69bdd1e3aca1cc2b0bd0342cde55d50dee866d6037f95d28dd7246029eb44082f8b46d59
@@ -0,0 +1,9 @@
1
+ *~
2
+ /pkg/
3
+ /tmp/
4
+ *.gemspec
5
+ .gradle/
6
+ /classpath/
7
+ build/
8
+ .idea
9
+ *.iml
@@ -0,0 +1,21 @@
1
+
2
+ MIT License
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,51 @@
1
+ # Flatten Json filter plugin for Embulk
2
+
3
+ ## Example
4
+
5
+ filter like below.
6
+
7
+ #### before
8
+
9
+ ```
10
+ c1|c2|c3|json_payload
11
+ 1|civitaspo|5.5|{"id":5,"address":{"zip_code":"123-4567","city":"Tokyo"},"hobbies":["breakdance","motorbike"]}
12
+ 2|mori.ogai|8.8|{"id":8,"address":{"zip_code":"891-0123","city":"Edo"},"hobbies":["novel"]}
13
+ 3|natsume.soseki|9.9|{"id":9,"address":{"zip_code":"456-7891","city":"Edo"},"hobbies":["novel","reading books"]}
14
+ ```
15
+
16
+ #### after
17
+
18
+ ```
19
+ c1|c2|c3|json_payload
20
+ 1|civitaspo|5.5|{"id":5,"address.zip_code":"123-4567","address.city":"Tokyo","hobbies._0":"breakdance","hobbies._1":"motorbike"}
21
+ 2|mori.ogai|8.8|{"id":8,"address.zip_code":"891-0123","address.city":"Edo","hobbies._0":"novel"}
22
+ 3|natsume.soseki|9.9|{"id":9,"address.zip_code":"456-7891","address.city":"Edo","hobbies._0":"novel","hobbies._1":"reading books"}
23
+ ```
24
+
25
+ ## Overview
26
+
27
+ * **Plugin type**: filter
28
+
29
+ ## Configuration
30
+
31
+ - **json_columns**: column name list to flatten json (string, required)
32
+ - **separator**: separator to join keys (string, default: `"."`)
33
+ - **array_index_prefix**: prefix of array index when joining keys (string, default: `"_"`)
34
+
35
+ ## Example
36
+
37
+ ```yaml
38
+ filters:
39
+ - type: flatten_json
40
+ json_column:
41
+ - json_payload
42
+ separator: "."
43
+ array_index_prefix: "_"
44
+ ```
45
+
46
+
47
+ ## Build
48
+
49
+ ```
50
+ $ ./gradlew gem # -t to watch change of files and rebuild continuously
51
+ ```
@@ -0,0 +1,75 @@
1
+ plugins {
2
+ id "com.jfrog.bintray" version "1.1"
3
+ id "com.github.jruby-gradle.base" version "0.1.5"
4
+ id "java"
5
+ }
6
+ import com.github.jrubygradle.JRubyExec
7
+ repositories {
8
+ mavenCentral()
9
+ jcenter()
10
+ }
11
+ configurations {
12
+ provided
13
+ }
14
+
15
+ version = "0.0.1"
16
+ sourceCompatibility = 1.7
17
+ targetCompatibility = 1.7
18
+
19
+ dependencies {
20
+ compile "org.embulk:embulk-core:0.7.4"
21
+ provided "org.embulk:embulk-core:0.7.4"
22
+ // compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
23
+ testCompile "junit:junit:4.+"
24
+ }
25
+
26
+ task classpath(type: Copy, dependsOn: ["jar"]) {
27
+ doFirst { file("classpath").deleteDir() }
28
+ from (configurations.runtime - configurations.provided + files(jar.archivePath))
29
+ into "classpath"
30
+ }
31
+ clean { delete "classpath" }
32
+
33
+ task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
34
+ jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "build"
35
+ script "${project.name}.gemspec"
36
+ doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
37
+ }
38
+
39
+ task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
40
+ jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "push"
41
+ script "pkg/${project.name}-${project.version}.gem"
42
+ }
43
+
44
+ task "package"(dependsOn: ["gemspec", "classpath"]) << {
45
+ println "> Build succeeded."
46
+ println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
47
+ }
48
+
49
+ task gemspec {
50
+ ext.gemspecFile = file("${project.name}.gemspec")
51
+ inputs.file "build.gradle"
52
+ outputs.file gemspecFile
53
+ doLast { gemspecFile.write($/
54
+ Gem::Specification.new do |spec|
55
+ spec.name = "${project.name}"
56
+ spec.version = "${project.version}"
57
+ spec.authors = ["Civitaspo"]
58
+ spec.summary = %[Flatten Json filter plugin for Embulk]
59
+ spec.description = %[Flatten Json]
60
+ spec.email = ["civitaspo@gmail.com"]
61
+ spec.licenses = ["MIT"]
62
+ spec.homepage = "https://github.com/civitaspo/embulk-filter-flatten_json"
63
+
64
+ spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
65
+ spec.test_files = spec.files.grep(%r"^(test|spec)/")
66
+ spec.require_paths = ["lib"]
67
+
68
+ #spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
69
+ spec.add_development_dependency 'bundler', ['~> 1.0']
70
+ spec.add_development_dependency 'rake', ['>= 10.0']
71
+ end
72
+ /$)
73
+ }
74
+ }
75
+ clean { delete "${project.name}.gemspec" }
@@ -0,0 +1,28 @@
1
+ in:
2
+ type: file
3
+ path_prefix: example/data.tsv
4
+ parser:
5
+ type: csv
6
+ delimiter: "\t"
7
+ charset: UTF-8
8
+ newline: CRLF
9
+ null_string: 'NULL'
10
+ skip_header_lines: 1
11
+ comment_line_marker: '#'
12
+ columns:
13
+ - {name: time, type: timestamp, format: "%Y-%m-%d"}
14
+ - {name: id, type: long}
15
+ - {name: name, type: string}
16
+ - {name: score, type: double}
17
+ - {name: json_payload, type: string}
18
+
19
+ filters:
20
+ - type: flatten_json
21
+ json_columns:
22
+ - json_payload
23
+ separator: "."
24
+ array_index_prefix: "_"
25
+
26
+ out:
27
+ type: stdout
28
+
@@ -0,0 +1,101 @@
1
+ time id name score json_payload
2
+ 2015-10-05 08:10:23 +0900 0 Mia O'Conner -4432.147926744348 {"phone_numbers":["526-126-8730 x85186"],"profile":{"like_words":["quos","non","nemo"],"anniversary":{"sint":"illo","excepturi":"debitis"}}}
3
+ 2015-10-08 21:44:59 +0900 1 Eliseo Corwin 4141.920717554467 {"phone_numbers":["159.825.1601 x397","(290) 974-1618"],"profile":{"like_words":["reprehenderit","dolores","impedit"],"anniversary":{"est":"magnam","quisquam":"placeat"}}}
4
+ 2015-10-05 03:11:55 +0900 2 Ms. Scottie Volkman -4923.820691996172 {"phone_numbers":["883-990-2673 x58967"],"profile":{"like_words":["aliquid","voluptates","rerum"],"anniversary":{"consectetur":"soluta","nam":"magnam"}}}
5
+ 2015-10-08 05:14:09 +0900 3 Darron Schmitt 384.20484517056656 {"phone_numbers":[],"profile":{"like_words":["sunt","dolor","ut"],"anniversary":{"eos":"perferendis","vel":"et"}}}
6
+ 2015-10-09 10:06:19 +0900 4 Laisha Rosenbaum -36.09181108735629 {"phone_numbers":["(267) 815-9974 x2753","1-739-737-2677","142-509-2771 x728"],"profile":{"like_words":["nostrum","quia","consequatur"],"anniversary":{"sint":"non","eveniet":"maiores"}}}
7
+ 2015-10-08 09:26:18 +0900 5 Bettye Jerde 2067.063545459357 {"phone_numbers":["433.244.7780 x555"],"profile":{"like_words":["rerum","iusto","voluptatem"],"anniversary":{"culpa":"et","et":"deserunt"}}}
8
+ 2015-10-07 07:33:53 +0900 6 Freda Schuppe -54.355276456200954 {"phone_numbers":["286-465-6157","(659) 856-2332"],"profile":{"like_words":["omnis","quae","architecto"],"anniversary":{"officiis":"quae","at":"ipsa"}}}
9
+ 2015-10-05 07:36:48 +0900 7 Demond Tillman 1790.7849156701966 {"phone_numbers":["(207) 173-0935 x47707","(972) 611-2550"],"profile":{"like_words":["quidem","impedit","expedita"],"anniversary":{"asperiores":"a","ipsum":"saepe"}}}
10
+ 2015-10-08 13:42:55 +0900 8 Avery Emard -795.5506210493577 {"phone_numbers":["931.322.0451 x775","685.790.4415","321.786.6118 x74847"],"profile":{"like_words":["autem","aut","est"],"anniversary":{"ut":"et","esse":"ea"}}}
11
+ 2015-10-10 03:40:54 +0900 9 Beaulah Grant DVM 4856.4772863895005 {"phone_numbers":["(556) 947-8678 x481"],"profile":{"like_words":["quaerat","aut","ratione"],"anniversary":{"labore":"ut","et":"et"}}}
12
+ 2015-10-10 05:10:46 +0900 10 Jamarcus Schoen -3356.545064939012 {"phone_numbers":[],"profile":{"like_words":["animi","cum","nisi"],"anniversary":{"quisquam":"accusantium","pariatur":"voluptates"}}}
13
+ 2015-10-07 04:53:59 +0900 11 Cordelia Heathcote 3677.9704061710245 {"phone_numbers":["687.035.6606 x703","593-641-9937","726.781.6265","627-199-3309"],"profile":{"like_words":["voluptatem","alias","consequuntur"],"anniversary":{"eligendi":"qui","iste":"qui"}}}
14
+ 2015-10-05 18:38:21 +0900 12 Mrs. Ruben Jacobs -4326.797128066129 {"phone_numbers":["375-322-6447 x9836","953-138-8777","555-092-8829 x83248","949-188-3386"],"profile":{"like_words":["repudiandae","fugiat","non"],"anniversary":{"saepe":"omnis","magnam":"ut"}}}
15
+ 2015-10-05 01:14:21 +0900 13 Justen Walker 2477.6985700696196 {"phone_numbers":["855-907-8574","(976) 723-8109","(980) 148-4296 x3667","(357) 797-9272"],"profile":{"like_words":["soluta","sequi","iste"],"anniversary":{"quia":"magnam","ipsam":"tenetur"}}}
16
+ 2015-10-07 18:53:35 +0900 14 Miss Alexandria Leffler -2466.0293261283027 {"phone_numbers":["225.599.7194 x67319","425-992-4931"],"profile":{"like_words":["repellat","harum","qui"],"anniversary":{"illum":"molestiae","quo":"blanditiis"}}}
17
+ 2015-10-06 11:02:13 +0900 15 Melisa Skiles MD 733.7832053401049 {"phone_numbers":["304-000-3480 x15596"],"profile":{"like_words":["officiis","explicabo","consequatur"],"anniversary":{"blanditiis":"esse","aliquam":"odit"}}}
18
+ 2015-10-09 00:52:48 +0900 16 Ms. Elroy Parker -3967.506123266601 {"phone_numbers":["246-141-8677 x4197","(136) 752-9726","809.409.3699","902-521-0567"],"profile":{"like_words":["quasi","fuga","omnis"],"anniversary":{"nam":"at","expedita":"molestias"}}}
19
+ 2015-10-10 19:10:43 +0900 17 Otis McLaughlin 41.921872490003274 {"phone_numbers":["685-076-3279 x423","471.082.7331","547.369.7831 x65400"],"profile":{"like_words":["cum","enim","quam"],"anniversary":{"fugiat":"odio","vel":"expedita"}}}
20
+ 2015-10-06 00:15:26 +0900 18 Monroe Toy -2117.075170733252 {"phone_numbers":["557-825-7955 x297","1-689-083-3688","337-341-5766 x97345","(337) 641-8782"],"profile":{"like_words":["voluptas","rerum","omnis"],"anniversary":{"aut":"a","error":"id"}}}
21
+ 2015-10-06 10:38:02 +0900 19 Alivia Kutch 1666.501904905476 {"phone_numbers":["162-110-6468 x54381","710.874.3750","270.467.1847","663.378.7781"],"profile":{"like_words":["vero","numquam","fugit"],"anniversary":{"fugit":"sit","molestias":"non"}}}
22
+ 2015-10-05 14:57:52 +0900 20 Aliya Carroll -2825.147540051555 {"phone_numbers":[],"profile":{"like_words":["sequi","sit","quia"],"anniversary":{"voluptas":"eligendi","et":"qui"}}}
23
+ 2015-10-05 22:37:44 +0900 21 Mr. Christelle Lemke 3545.5078403636953 {"phone_numbers":["1-988-683-6373 x3417","1-114-546-7179","(828) 333-9781 x4034","482-338-3516"],"profile":{"like_words":["praesentium","quo","omnis"],"anniversary":{"autem":"deserunt","facere":"et"}}}
24
+ 2015-10-06 19:04:25 +0900 22 Alfred Steuber DDS -4212.973988909887 {"phone_numbers":["274-932-2282","1-220-790-1508"],"profile":{"like_words":["tenetur","asperiores","dolorem"],"anniversary":{"rem":"rerum","expedita":"itaque"}}}
25
+ 2015-10-09 05:23:33 +0900 23 Mrs. Sven Borer 2223.4432089373868 {"phone_numbers":[],"profile":{"like_words":["laboriosam","nobis","delectus"],"anniversary":{"sed":"rerum","esse":"perferendis"}}}
26
+ 2015-10-05 23:16:24 +0900 24 Troy Jacobi PhD -510.864561420899 {"phone_numbers":[],"profile":{"like_words":["exercitationem","dolore","fuga"],"anniversary":{"assumenda":"pariatur","asperiores":"aliquid"}}}
27
+ 2015-10-06 01:22:03 +0900 25 Cameron Olson 1836.6844742435364 {"phone_numbers":["516.957.2369 x0302","(372) 824-8008","1-186-456-7642 x82905"],"profile":{"like_words":["ipsum","placeat","pariatur"],"anniversary":{"cumque":"voluptatem","aliquid":"voluptatum"}}}
28
+ 2015-10-09 17:10:32 +0900 26 Fanny Lowe -2445.060696684425 {"phone_numbers":["143.973.2642 x3661","781-316-1042","605.801.4647","872-047-5459"],"profile":{"like_words":["itaque","dolor","enim"],"anniversary":{"nesciunt":"incidunt","nemo":"voluptatem"}}}
29
+ 2015-10-08 03:51:09 +0900 27 Ova Zboncak 431.867126203884 {"phone_numbers":["1-489-050-1902","939.054.8765","967.419.3526","1-987-200-4012"],"profile":{"like_words":["similique","suscipit","laborum"],"anniversary":{"eius":"et","officiis":"eius"}}}
30
+ 2015-10-09 17:54:53 +0900 28 Lauren Schneider -3685.0365213245814 {"phone_numbers":["1-961-415-9753 x62722","1-404-301-3707","703.369.6060 x823","(762) 275-0701"],"profile":{"like_words":["magnam","enim","qui"],"anniversary":{"voluptate":"adipisci","consequatur":"ab"}}}
31
+ 2015-10-08 13:24:57 +0900 29 Stephania Leuschke IV 2412.786778831686 {"phone_numbers":[],"profile":{"like_words":["ab","iste","nemo"],"anniversary":{"vel":"ad","voluptate":"rerum"}}}
32
+ 2015-10-07 23:56:35 +0900 30 Imogene Lynch IV -1349.0703874355058 {"phone_numbers":["703-268-1499","293.299.7856"],"profile":{"like_words":["et","sunt","facere"],"anniversary":{"et":"nostrum","quos":"est"}}}
33
+ 2015-10-10 20:26:25 +0900 31 Guy Tromp 605.3767685907243 {"phone_numbers":["200.597.1001 x7170","433.328.4577","289-683-0581"],"profile":{"like_words":["ab","magni","tempore"],"anniversary":{"eaque":"voluptas","nobis":"tempore"}}}
34
+ 2015-10-06 03:55:39 +0900 32 Brown Grady -817.0288409574459 {"phone_numbers":["418.042.8327 x08326"],"profile":{"like_words":["et","voluptatibus","sit"],"anniversary":{"dolores":"quas","est":"dolor"}}}
35
+ 2015-10-07 10:11:14 +0900 33 Ali Kuphal 539.2035186478329 {"phone_numbers":["(477) 984-2279"],"profile":{"like_words":["sit","cupiditate","reprehenderit"],"anniversary":{"ut":"qui","natus":"voluptatem"}}}
36
+ 2015-10-05 08:47:35 +0900 34 Mr. Madie Fahey -4455.177143750284 {"phone_numbers":[],"profile":{"like_words":["a","id","ut"],"anniversary":{"sint":"adipisci","commodi":"dolor"}}}
37
+ 2015-10-05 11:53:59 +0900 35 Miss Kelsie Bednar 4546.606323682607 {"phone_numbers":["1-848-906-8815 x014"],"profile":{"like_words":["nihil","tempora","aut"],"anniversary":{"natus":"repellat","iste":"dolores"}}}
38
+ 2015-10-05 02:12:38 +0900 36 Dwight Kirlin -4212.797117815089 {"phone_numbers":["503-598-6151 x425","463-136-1004","1-779-383-7884 x124","1-120-764-4385"],"profile":{"like_words":["omnis","quo","ipsum"],"anniversary":{"qui":"aspernatur","sapiente":"nostrum"}}}
39
+ 2015-10-09 02:04:26 +0900 37 Nathen Graham 3368.4562257188736 {"phone_numbers":["903-402-9561","479-370-6943"],"profile":{"like_words":["et","vitae","magni"],"anniversary":{"illo":"occaecati","rem":"eum"}}}
40
+ 2015-10-06 23:00:36 +0900 38 Mr. Odell Bashirian -4360.869166375782 {"phone_numbers":["633-649-3012","(128) 799-7487"],"profile":{"like_words":["quae","unde","ut"],"anniversary":{"assumenda":"laudantium","sit":"ut"}}}
41
+ 2015-10-07 10:43:36 +0900 39 Werner Macejkovic 377.34447698833475 {"phone_numbers":["1-372-789-5800","1-825-339-3406","1-990-882-0560","120-609-2162"],"profile":{"like_words":["repellat","excepturi","blanditiis"],"anniversary":{"et":"rerum","odio":"distinctio"}}}
42
+ 2015-10-07 17:19:16 +0900 40 Oran Reichert -1809.4313301988077 {"phone_numbers":["(114) 508-7391 x164","(137) 390-1658","579-827-6793","(833) 813-6077"],"profile":{"like_words":["velit","numquam","voluptatem"],"anniversary":{"temporibus":"animi","ullam":"quia"}}}
43
+ 2015-10-05 07:08:45 +0900 41 Manuela Zieme 200.43605836432232 {"phone_numbers":["214.417.1892 x28832","(539) 218-2580","465-109-2939"],"profile":{"like_words":["id","officia","vero"],"anniversary":{"velit":"officia","quo":"aliquam"}}}
44
+ 2015-10-06 05:28:32 +0900 42 Makenzie Corwin Sr. -3521.5132009323843 {"phone_numbers":["326-644-1157"],"profile":{"like_words":["iure","quasi","aut"],"anniversary":{"et":"quos","sunt":"harum"}}}
45
+ 2015-10-10 01:22:30 +0900 43 Dulce Gottlieb 2819.4211343193597 {"phone_numbers":["(655) 104-7428 x4269","(189) 685-9093"],"profile":{"like_words":["quis","quis","et"],"anniversary":{"soluta":"et","tempore":"consequuntur"}}}
46
+ 2015-10-06 20:09:31 +0900 44 Thurman Heathcote I -2917.7015036706885 {"phone_numbers":["1-185-603-3249 x71297","1-768-984-7735"],"profile":{"like_words":["vel","dolor","molestiae"],"anniversary":{"quidem":"molestias","sit":"aut"}}}
47
+ 2015-10-06 23:29:06 +0900 45 Chance Wunsch 1788.899961293288 {"phone_numbers":["(492) 144-3322 x80003"],"profile":{"like_words":["sequi","est","quis"],"anniversary":{"illo":"nemo","non":"libero"}}}
48
+ 2015-10-06 22:27:39 +0900 46 Dr. Melvina Hessel -4155.922575808523 {"phone_numbers":["1-308-675-4320 x14340","759-304-6742"],"profile":{"like_words":["aspernatur","labore","sit"],"anniversary":{"quisquam":"qui","deserunt":"iure"}}}
49
+ 2015-10-05 06:11:22 +0900 47 Mr. Milton Bins 4397.56947198665 {"phone_numbers":["168-587-1495 x698","404-543-4201"],"profile":{"like_words":["est","aut","neque"],"anniversary":{"quibusdam":"quia","excepturi":"quaerat"}}}
50
+ 2015-10-09 18:11:08 +0900 48 Jimmy Tremblay -4980.342360050686 {"phone_numbers":["701-193-3725"],"profile":{"like_words":["eveniet","aut","dolores"],"anniversary":{"dolor":"sint","esse":"autem"}}}
51
+ 2015-10-06 02:47:21 +0900 49 Hudson Kessler 1643.9162923395315 {"phone_numbers":["423-661-2592 x0360"],"profile":{"like_words":["sint","rem","consectetur"],"anniversary":{"voluptates":"sed","illo":"et"}}}
52
+ 2015-10-06 10:40:01 +0900 50 Alfonzo Franecki -726.1223452630866 {"phone_numbers":[],"profile":{"like_words":["repellendus","dolorem","ut"],"anniversary":{"molestiae":"ullam","non":"perferendis"}}}
53
+ 2015-10-06 07:29:43 +0900 51 Dr. Herbert Larson 4352.946634639404 {"phone_numbers":["(424) 413-6525 x0131","199-332-4161","560-722-0573 x1787"],"profile":{"like_words":["soluta","non","a"],"anniversary":{"asperiores":"ab","doloremque":"optio"}}}
54
+ 2015-10-10 16:46:42 +0900 52 Verner Klein -2048.28897102871 {"phone_numbers":[],"profile":{"like_words":["et","aut","amet"],"anniversary":{"magnam":"corrupti","qui":"minus"}}}
55
+ 2015-10-09 02:14:51 +0900 53 Dr. Tyrell Kohler 2105.350503921706 {"phone_numbers":[],"profile":{"like_words":["illo","et","consequuntur"],"anniversary":{"sequi":"voluptates","iusto":"officiis"}}}
56
+ 2015-10-05 09:37:56 +0900 54 Shannon Rolfson -1052.1254067200343 {"phone_numbers":[],"profile":{"like_words":["sed","quis","tenetur"],"anniversary":{"quia":"quidem","blanditiis":"assumenda"}}}
57
+ 2015-10-09 15:24:42 +0900 55 Derek Koelpin 3470.838642803441 {"phone_numbers":["467-152-4446 x23571","(579) 395-2764","1-554-002-7634 x4583","1-558-599-5530"],"profile":{"like_words":["qui","voluptates","officiis"],"anniversary":{"ipsa":"amet","illum":"sint"}}}
58
+ 2015-10-10 18:08:41 +0900 56 Aniyah Schuster -2772.080504132075 {"phone_numbers":["1-586-883-9307 x1564"],"profile":{"like_words":["rerum","quasi","quis"],"anniversary":{"facilis":"nam","maiores":"ut"}}}
59
+ 2015-10-10 00:43:33 +0900 57 Karli Hickle 919.8023504703162 {"phone_numbers":["541.691.4578","739-400-8742"],"profile":{"like_words":["quo","neque","provident"],"anniversary":{"nihil":"consequatur","at":"et"}}}
60
+ 2015-10-09 07:48:32 +0900 58 Elody Wuckert -2359.4376129985308 {"phone_numbers":["909.994.7444 x39005","843.917.0299","1-238-108-7727 x17989"],"profile":{"like_words":["nam","debitis","fugiat"],"anniversary":{"quaerat":"delectus","consequatur":"odio"}}}
61
+ 2015-10-05 00:35:45 +0900 59 Itzel Kuhn 1516.5443619909681 {"phone_numbers":[],"profile":{"like_words":["praesentium","qui","dolorum"],"anniversary":{"voluptas":"et","iure":"illo"}}}
62
+ 2015-10-09 23:31:41 +0900 60 Richard Kertzmann -3189.1825883654574 {"phone_numbers":[],"profile":{"like_words":["reiciendis","nostrum","quidem"],"anniversary":{"ex":"aliquid","a":"qui"}}}
63
+ 2015-10-08 20:18:57 +0900 61 Janick Hermiston 3682.004238496748 {"phone_numbers":[],"profile":{"like_words":["reprehenderit","est","beatae"],"anniversary":{"voluptatem":"id","neque":"nostrum"}}}
64
+ 2015-10-06 03:10:56 +0900 62 Constantin Hahn -2502.7343434563977 {"phone_numbers":["479-776-7514 x27905"],"profile":{"like_words":["ullam","voluptatibus","odio"],"anniversary":{"rem":"hic","quia":"id"}}}
65
+ 2015-10-08 10:06:38 +0900 63 Janae Heathcote 1525.8153088035622 {"phone_numbers":["661.749.6189 x187","(814) 542-9547"],"profile":{"like_words":["ut","aut","accusamus"],"anniversary":{"cum":"sit","ea":"id"}}}
66
+ 2015-10-09 07:00:19 +0900 64 Miss Derek Connelly -3305.7365955095793 {"phone_numbers":["(698) 516-9218 x0602","1-111-036-5679","449.179.7832 x70105","372.614.5457"],"profile":{"like_words":["voluptatem","sunt","consequuntur"],"anniversary":{"quia":"labore","beatae":"minima"}}}
67
+ 2015-10-10 23:40:06 +0900 65 Dr. Verdie Grimes 2897.9575187254713 {"phone_numbers":["(657) 510-4491 x1613","1-568-270-4901","961.626.3867","264.646.2482"],"profile":{"like_words":["beatae","sunt","quas"],"anniversary":{"quo":"nostrum","nihil":"qui"}}}
68
+ 2015-10-06 17:38:17 +0900 66 Marjory Treutel -2512.484579055863 {"phone_numbers":["1-593-443-5455 x83020"],"profile":{"like_words":["nostrum","ea","est"],"anniversary":{"molestias":"dolores","nobis":"eos"}}}
69
+ 2015-10-05 03:47:38 +0900 67 Ms. Dominique Gerhold 3017.48858349882 {"phone_numbers":["664-922-0865","457-347-6579","954-954-8299"],"profile":{"like_words":["suscipit","consectetur","rerum"],"anniversary":{"minus":"quo","sint":"laboriosam"}}}
70
+ 2015-10-08 21:05:59 +0900 68 Erika Beer -3494.8352504140703 {"phone_numbers":[],"profile":{"like_words":["dignissimos","reprehenderit","itaque"],"anniversary":{"odio":"nihil","praesentium":"harum"}}}
71
+ 2015-10-05 19:32:34 +0900 69 Emmalee Rippin 3218.347422610198 {"phone_numbers":["906-884-9287","251.430.7519","892-551-1745 x85256","(249) 602-1525"],"profile":{"like_words":["explicabo","quasi","quia"],"anniversary":{"consequatur":"sunt","ea":"iusto"}}}
72
+ 2015-10-06 07:04:27 +0900 70 Miss Evert Leuschke -3117.9131783827206 {"phone_numbers":["(336) 917-4692 x1145","968.169.3858","1-502-540-9114","1-779-600-6620"],"profile":{"like_words":["odio","ipsa","saepe"],"anniversary":{"cumque":"nihil","quidem":"nihil"}}}
73
+ 2015-10-07 00:08:59 +0900 71 Kasey Nienow 2308.443146809218 {"phone_numbers":["1-690-020-3576","(792) 696-9899"],"profile":{"like_words":["eligendi","est","quo"],"anniversary":{"culpa":"omnis","ut":"in"}}}
74
+ 2015-10-08 19:23:45 +0900 72 Taylor Ebert -3017.5726952452765 {"phone_numbers":["(151) 508-2074 x81805","158.738.3745"],"profile":{"like_words":["quia","cumque","omnis"],"anniversary":{"quisquam":"libero","vel":"fugiat"}}}
75
+ 2015-10-08 13:29:05 +0900 73 Cecilia Boehm DDS 3142.8552447435177 {"phone_numbers":["(540) 866-8951","767-558-9842","140-492-6555 x987","(247) 058-6133"],"profile":{"like_words":["et","sequi","accusantium"],"anniversary":{"et":"explicabo","provident":"eligendi"}}}
76
+ 2015-10-10 06:23:52 +0900 74 Zola Daugherty -4346.9288909265515 {"phone_numbers":["694.261.8712","1-417-470-1876","620.765.6750","426-954-9845"],"profile":{"like_words":["nesciunt","quo","ipsam"],"anniversary":{"et":"nam","rem":"magni"}}}
77
+ 2015-10-07 10:43:35 +0900 75 Dorris Satterfield DDS 3229.8550845544773 {"phone_numbers":["281.801.7005","1-755-629-0615"],"profile":{"like_words":["sit","fugiat","a"],"anniversary":{"cumque":"molestias","sunt":"doloribus"}}}
78
+ 2015-10-09 23:23:11 +0900 76 Stephania Krajcik -3948.710489052043 {"phone_numbers":["970.833.5489 x10109","655-357-3915","148-041-9168 x7328","(932) 917-6660"],"profile":{"like_words":["cumque","enim","voluptas"],"anniversary":{"sunt":"et","et":"sit"}}}
79
+ 2015-10-07 07:12:17 +0900 77 Darrell Legros 3913.7582319434946 {"phone_numbers":["1-644-756-9240 x94545","967.608.2903","(104) 826-9507 x07014"],"profile":{"like_words":["laudantium","ullam","nesciunt"],"anniversary":{"quae":"non","laudantium":"dolor"}}}
80
+ 2015-10-08 10:30:12 +0900 78 Polly Ratke -4517.707424646253 {"phone_numbers":["(207) 722-6875 x109","585-097-5162","(338) 697-2066"],"profile":{"like_words":["sit","autem","sit"],"anniversary":{"amet":"distinctio","incidunt":"reiciendis"}}}
81
+ 2015-10-07 14:01:46 +0900 79 Roxane Watsica 1148.4788928360138 {"phone_numbers":["1-910-048-0165 x084","(632) 669-8185","1-937-782-7986 x318"],"profile":{"like_words":["dolore","iure","officiis"],"anniversary":{"sunt":"accusantium","aut":"commodi"}}}
82
+ 2015-10-08 10:08:20 +0900 80 Enid Muller -501.54520131162735 {"phone_numbers":["264.077.5566"],"profile":{"like_words":["magnam","nemo","doloribus"],"anniversary":{"repellendus":"aut","voluptatum":"dolore"}}}
83
+ 2015-10-09 01:58:35 +0900 81 Ms. Annie Olson 766.3846285682511 {"phone_numbers":["1-870-415-8121 x1013","1-736-816-2734","(482) 026-9679 x48879","1-811-920-1648"],"profile":{"like_words":["facilis","quia","qui"],"anniversary":{"at":"illum","qui":"soluta"}}}
84
+ 2015-10-08 09:24:33 +0900 82 Mr. Allison Parker -3848.753667747832 {"phone_numbers":[],"profile":{"like_words":["velit","et","porro"],"anniversary":{"ea":"labore","rerum":"et"}}}
85
+ 2015-10-09 20:00:40 +0900 83 Monserrate Willms 1757.1794781393883 {"phone_numbers":["275.520.1318 x234","136-159-7660","(354) 797-9219","1-835-745-4393"],"profile":{"like_words":["ipsam","est","sed"],"anniversary":{"recusandae":"repellat","ad":"id"}}}
86
+ 2015-10-08 09:49:35 +0900 84 Colton Weimann -4787.601258920462 {"phone_numbers":["1-120-330-3708 x224","1-404-617-8548"],"profile":{"like_words":["ut","iusto","aut"],"anniversary":{"beatae":"in","nam":"molestiae"}}}
87
+ 2015-10-09 22:19:12 +0900 85 Gay Fisher 622.0515339963873 {"phone_numbers":["1-745-000-4538 x884","(437) 579-8927","1-375-197-8603","638-648-9676"],"profile":{"like_words":["dolor","voluptatibus","numquam"],"anniversary":{"nihil":"soluta","odio":"est"}}}
88
+ 2015-10-07 16:01:21 +0900 86 Carolyne Shanahan -4543.494091291478 {"phone_numbers":["449.845.5379 x587","(668) 226-8600","946-251-1177"],"profile":{"like_words":["debitis","magnam","aut"],"anniversary":{"eveniet":"nam","nihil":"consequuntur"}}}
89
+ 2015-10-10 01:12:17 +0900 87 Jovan Mueller 3273.934355493044 {"phone_numbers":["(927) 389-3068 x422","706.063.5935","768-285-0007"],"profile":{"like_words":["at","eum","rem"],"anniversary":{"optio":"ut","nisi":"est"}}}
90
+ 2015-10-06 03:59:37 +0900 88 Larue O'Kon Sr. -3507.3433522027954 {"phone_numbers":["(744) 195-1320","347-485-4459","1-521-350-1041 x1523"],"profile":{"like_words":["autem","minima","reiciendis"],"anniversary":{"voluptate":"ut","iusto":"temporibus"}}}
91
+ 2015-10-06 21:40:24 +0900 89 Lesly Conn 1985.7808303287427 {"phone_numbers":["600.949.0833 x7267","856-412-4252"],"profile":{"like_words":["exercitationem","veritatis","illum"],"anniversary":{"id":"blanditiis","hic":"iste"}}}
92
+ 2015-10-05 22:57:32 +0900 90 Courtney Hickle -3913.6451677336368 {"phone_numbers":["(689) 730-9785","443-627-3678","909-767-6416","938.632.4597"],"profile":{"like_words":["nihil","dolore","est"],"anniversary":{"recusandae":"qui","amet":"suscipit"}}}
93
+ 2015-10-08 09:50:47 +0900 91 Maryam Bernier III 2835.1888780878467 {"phone_numbers":["1-516-296-4405 x9690","1-561-166-3513","(204) 091-8499"],"profile":{"like_words":["voluptatem","et","non"],"anniversary":{"ut":"itaque","est":"voluptatem"}}}
94
+ 2015-10-06 12:02:39 +0900 92 Ada Effertz -2354.9807671571753 {"phone_numbers":["773.602.8464 x29425"],"profile":{"like_words":["eos","iste","impedit"],"anniversary":{"beatae":"sit","deserunt":"ratione"}}}
95
+ 2015-10-08 10:12:04 +0900 93 Roel Witting 1364.810771315596 {"phone_numbers":["931.732.1810","700-965-7494","1-167-739-4851"],"profile":{"like_words":["eum","culpa","quasi"],"anniversary":{"vel":"quo","ullam":"voluptatum"}}}
96
+ 2015-10-09 06:16:54 +0900 94 Jevon Bode -3033.3563074074063 {"phone_numbers":["1-653-381-9114","920.058.9257","169.082.8217","667-284-5869"],"profile":{"like_words":["accusamus","iste","omnis"],"anniversary":{"voluptatibus":"omnis","consequatur":"quis"}}}
97
+ 2015-10-07 23:24:40 +0900 95 Immanuel Pacocha 1164.97220841131 {"phone_numbers":["(163) 677-4839 x9472","(127) 966-9011","1-599-010-0990","1-927-325-2119"],"profile":{"like_words":["ex","sapiente","unde"],"anniversary":{"distinctio":"et","illum":"sunt"}}}
98
+ 2015-10-05 01:59:45 +0900 96 Christian Jacobson -2118.2961781101144 {"phone_numbers":["593.030.1905 x711","989.092.4209","620.559.4132 x99408","1-976-184-0079"],"profile":{"like_words":["neque","facere","odio"],"anniversary":{"ex":"minima","qui":"repellat"}}}
99
+ 2015-10-06 21:29:06 +0900 97 Mrs. Bertha Rath 3690.3967038919336 {"phone_numbers":["630-214-8026","(258) 454-5216","(265) 815-6080"],"profile":{"like_words":["qui","esse","est"],"anniversary":{"iure":"ab","veniam":"eius"}}}
100
+ 2015-10-06 13:25:53 +0900 98 Johnnie McGlynn -1060.280705438417 {"phone_numbers":["679.889.9424 x4608","877.922.7783"],"profile":{"like_words":["porro","pariatur","voluptas"],"anniversary":{"accusantium":"sunt","sed":"dolore"}}}
101
+ 2015-10-07 11:39:22 +0900 99 Elvis Hettinger V 1182.9831705029599 {"phone_numbers":["846-985-5697 x311","993-451-0317"],"profile":{"like_words":["ipsam","laudantium","accusamus"],"anniversary":{"maiores":"et","similique":"blanditiis"}}}
@@ -0,0 +1,6 @@
1
+ #Tue Aug 11 00:26:20 PDT 2015
2
+ distributionBase=GRADLE_USER_HOME
3
+ distributionPath=wrapper/dists
4
+ zipStoreBase=GRADLE_USER_HOME
5
+ zipStorePath=wrapper/dists
6
+ distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
data/gradlew ADDED
@@ -0,0 +1,164 @@
1
+ #!/usr/bin/env bash
2
+
3
+ ##############################################################################
4
+ ##
5
+ ## Gradle start up script for UN*X
6
+ ##
7
+ ##############################################################################
8
+
9
+ # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10
+ DEFAULT_JVM_OPTS=""
11
+
12
+ APP_NAME="Gradle"
13
+ APP_BASE_NAME=`basename "$0"`
14
+
15
+ # Use the maximum available, or set MAX_FD != -1 to use that value.
16
+ MAX_FD="maximum"
17
+
18
+ warn ( ) {
19
+ echo "$*"
20
+ }
21
+
22
+ die ( ) {
23
+ echo
24
+ echo "$*"
25
+ echo
26
+ exit 1
27
+ }
28
+
29
+ # OS specific support (must be 'true' or 'false').
30
+ cygwin=false
31
+ msys=false
32
+ darwin=false
33
+ case "`uname`" in
34
+ CYGWIN* )
35
+ cygwin=true
36
+ ;;
37
+ Darwin* )
38
+ darwin=true
39
+ ;;
40
+ MINGW* )
41
+ msys=true
42
+ ;;
43
+ esac
44
+
45
+ # For Cygwin, ensure paths are in UNIX format before anything is touched.
46
+ if $cygwin ; then
47
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48
+ fi
49
+
50
+ # Attempt to set APP_HOME
51
+ # Resolve links: $0 may be a link
52
+ PRG="$0"
53
+ # Need this for relative symlinks.
54
+ while [ -h "$PRG" ] ; do
55
+ ls=`ls -ld "$PRG"`
56
+ link=`expr "$ls" : '.*-> \(.*\)$'`
57
+ if expr "$link" : '/.*' > /dev/null; then
58
+ PRG="$link"
59
+ else
60
+ PRG=`dirname "$PRG"`"/$link"
61
+ fi
62
+ done
63
+ SAVED="`pwd`"
64
+ cd "`dirname \"$PRG\"`/" >&-
65
+ APP_HOME="`pwd -P`"
66
+ cd "$SAVED" >&-
67
+
68
+ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69
+
70
+ # Determine the Java command to use to start the JVM.
71
+ if [ -n "$JAVA_HOME" ] ; then
72
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73
+ # IBM's JDK on AIX uses strange locations for the executables
74
+ JAVACMD="$JAVA_HOME/jre/sh/java"
75
+ else
76
+ JAVACMD="$JAVA_HOME/bin/java"
77
+ fi
78
+ if [ ! -x "$JAVACMD" ] ; then
79
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80
+
81
+ Please set the JAVA_HOME variable in your environment to match the
82
+ location of your Java installation."
83
+ fi
84
+ else
85
+ JAVACMD="java"
86
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87
+
88
+ Please set the JAVA_HOME variable in your environment to match the
89
+ location of your Java installation."
90
+ fi
91
+
92
+ # Increase the maximum file descriptors if we can.
93
+ if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94
+ MAX_FD_LIMIT=`ulimit -H -n`
95
+ if [ $? -eq 0 ] ; then
96
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97
+ MAX_FD="$MAX_FD_LIMIT"
98
+ fi
99
+ ulimit -n $MAX_FD
100
+ if [ $? -ne 0 ] ; then
101
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
102
+ fi
103
+ else
104
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105
+ fi
106
+ fi
107
+
108
+ # For Darwin, add options to specify how the application appears in the dock
109
+ if $darwin; then
110
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111
+ fi
112
+
113
+ # For Cygwin, switch paths to Windows format before running java
114
+ if $cygwin ; then
115
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117
+
118
+ # We build the pattern for arguments to be converted via cygpath
119
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120
+ SEP=""
121
+ for dir in $ROOTDIRSRAW ; do
122
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
123
+ SEP="|"
124
+ done
125
+ OURCYGPATTERN="(^($ROOTDIRS))"
126
+ # Add a user-defined pattern to the cygpath arguments
127
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129
+ fi
130
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
131
+ i=0
132
+ for arg in "$@" ; do
133
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135
+
136
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138
+ else
139
+ eval `echo args$i`="\"$arg\""
140
+ fi
141
+ i=$((i+1))
142
+ done
143
+ case $i in
144
+ (0) set -- ;;
145
+ (1) set -- "$args0" ;;
146
+ (2) set -- "$args0" "$args1" ;;
147
+ (3) set -- "$args0" "$args1" "$args2" ;;
148
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154
+ esac
155
+ fi
156
+
157
+ # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158
+ function splitJvmOpts() {
159
+ JVM_OPTS=("$@")
160
+ }
161
+ eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162
+ JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163
+
164
+ exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
@@ -0,0 +1,90 @@
1
+ @if "%DEBUG%" == "" @echo off
2
+ @rem ##########################################################################
3
+ @rem
4
+ @rem Gradle startup script for Windows
5
+ @rem
6
+ @rem ##########################################################################
7
+
8
+ @rem Set local scope for the variables with windows NT shell
9
+ if "%OS%"=="Windows_NT" setlocal
10
+
11
+ @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12
+ set DEFAULT_JVM_OPTS=
13
+
14
+ set DIRNAME=%~dp0
15
+ if "%DIRNAME%" == "" set DIRNAME=.
16
+ set APP_BASE_NAME=%~n0
17
+ set APP_HOME=%DIRNAME%
18
+
19
+ @rem Find java.exe
20
+ if defined JAVA_HOME goto findJavaFromJavaHome
21
+
22
+ set JAVA_EXE=java.exe
23
+ %JAVA_EXE% -version >NUL 2>&1
24
+ if "%ERRORLEVEL%" == "0" goto init
25
+
26
+ echo.
27
+ echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28
+ echo.
29
+ echo Please set the JAVA_HOME variable in your environment to match the
30
+ echo location of your Java installation.
31
+
32
+ goto fail
33
+
34
+ :findJavaFromJavaHome
35
+ set JAVA_HOME=%JAVA_HOME:"=%
36
+ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37
+
38
+ if exist "%JAVA_EXE%" goto init
39
+
40
+ echo.
41
+ echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42
+ echo.
43
+ echo Please set the JAVA_HOME variable in your environment to match the
44
+ echo location of your Java installation.
45
+
46
+ goto fail
47
+
48
+ :init
49
+ @rem Get command-line arguments, handling Windowz variants
50
+
51
+ if not "%OS%" == "Windows_NT" goto win9xME_args
52
+ if "%@eval[2+2]" == "4" goto 4NT_args
53
+
54
+ :win9xME_args
55
+ @rem Slurp the command line arguments.
56
+ set CMD_LINE_ARGS=
57
+ set _SKIP=2
58
+
59
+ :win9xME_args_slurp
60
+ if "x%~1" == "x" goto execute
61
+
62
+ set CMD_LINE_ARGS=%*
63
+ goto execute
64
+
65
+ :4NT_args
66
+ @rem Get arguments from the 4NT Shell from JP Software
67
+ set CMD_LINE_ARGS=%$
68
+
69
+ :execute
70
+ @rem Setup the command line
71
+
72
+ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73
+
74
+ @rem Execute Gradle
75
+ "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76
+
77
+ :end
78
+ @rem End local scope for the variables with windows NT shell
79
+ if "%ERRORLEVEL%"=="0" goto mainEnd
80
+
81
+ :fail
82
+ rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83
+ rem the _cmd.exe /c_ return code!
84
+ if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85
+ exit /b 1
86
+
87
+ :mainEnd
88
+ if "%OS%"=="Windows_NT" endlocal
89
+
90
+ :omega
@@ -0,0 +1,3 @@
1
+ Embulk::JavaPlugin.register_filter(
2
+ "flatten_json", "org.embulk.filter.flatten_json.FlattenJsonFilterPlugin",
3
+ File.expand_path('../../../../classpath', __FILE__))
@@ -0,0 +1,191 @@
1
+ package org.embulk.filter.flatten_json;
2
+
3
+ import com.fasterxml.jackson.databind.JsonNode;
4
+ import com.fasterxml.jackson.databind.ObjectMapper;
5
+ import com.fasterxml.jackson.databind.node.ArrayNode;
6
+ import com.fasterxml.jackson.databind.node.ObjectNode;
7
+ import com.fasterxml.jackson.databind.node.ValueNode;
8
+ import com.google.common.base.Throwables;
9
+ import com.google.common.collect.Maps;
10
+ import org.embulk.config.Config;
11
+ import org.embulk.config.ConfigDefault;
12
+ import org.embulk.config.ConfigSource;
13
+ import org.embulk.config.Task;
14
+ import org.embulk.config.TaskSource;
15
+ import org.embulk.spi.Column;
16
+ import org.embulk.spi.Exec;
17
+ import org.embulk.spi.FilterPlugin;
18
+ import org.embulk.spi.Page;
19
+ import org.embulk.spi.PageBuilder;
20
+ import org.embulk.spi.PageOutput;
21
+ import org.embulk.spi.PageReader;
22
+ import org.embulk.spi.Schema;
23
+ import org.embulk.spi.type.Types;
24
+ import org.slf4j.Logger;
25
+
26
+ import java.io.IOException;
27
+ import java.util.ArrayList;
28
+ import java.util.Iterator;
29
+ import java.util.List;
30
+ import java.util.Map;
31
+
32
+ /**
33
+ * Created by Civitaspo on 10/10/15.
34
+ */
35
+
36
+ public class FlattenJsonFilterPlugin
37
+ implements FilterPlugin
38
+ {
39
+ private static final Logger logger = Exec.getLogger(FlattenJsonFilterPlugin.class);
40
+
41
+ public interface PluginTask
42
+ extends Task
43
+ {
44
+ @Config("json_columns")
45
+ public List<String> getJsonColumns();
46
+
47
+ @Config("separator")
48
+ @ConfigDefault("\",\"")
49
+ public String getSeparator();
50
+
51
+ @Config("array_index_prefix")
52
+ @ConfigDefault("\"_\"")
53
+ public String getArrayIndexPrefix();
54
+ }
55
+
56
+ @Override
57
+ public void transaction(ConfigSource config, Schema inputSchema,
58
+ FilterPlugin.Control control)
59
+ {
60
+ PluginTask task = config.loadConfig(PluginTask.class);
61
+
62
+ Schema outputSchema = inputSchema;
63
+
64
+ control.run(task.dump(), outputSchema);
65
+ }
66
+
67
+ @Override
68
+ public PageOutput open(TaskSource taskSource, final Schema inputSchema, final Schema outputSchema, final PageOutput output)
69
+ {
70
+ final PluginTask task = taskSource.loadTask(PluginTask.class);
71
+
72
+ final List<Column> inputColumns = inputSchema.getColumns();
73
+ final List<Column> inputColumnsExceptFlattenJsonColumns = new ArrayList<>();
74
+ final List<Column> flattenJsonColumns = new ArrayList<>();
75
+ for (Column inputColumn: inputColumns) {
76
+ if (task.getJsonColumns().contains(inputColumn.getName())) {
77
+ flattenJsonColumns.add(inputColumn);
78
+ }
79
+ else {
80
+ inputColumnsExceptFlattenJsonColumns.add(inputColumn);
81
+ }
82
+ }
83
+
84
+ return new PageOutput()
85
+ {
86
+ private PageReader pageReader = new PageReader(inputSchema);
87
+
88
+ @Override
89
+ public void add(Page page)
90
+ {
91
+ try (PageBuilder pageBuilder = new PageBuilder(Exec.getBufferAllocator(), outputSchema, output)) {
92
+ pageReader.setPage(page);
93
+
94
+ while (pageReader.nextRecord()) {
95
+ setInputColumnsExceptFlattenJsonColumns(pageBuilder, inputColumnsExceptFlattenJsonColumns);
96
+ setFlattenJsonColumns(pageBuilder, flattenJsonColumns, task.getSeparator(), task.getArrayIndexPrefix());
97
+ pageBuilder.addRecord();
98
+ }
99
+ pageBuilder.finish();
100
+ }
101
+ catch (IOException e) {
102
+ logger.error(e.getMessage());
103
+ throw Throwables.propagate(e);
104
+ }
105
+ }
106
+
107
+ @Override
108
+ public void finish()
109
+ {
110
+ output.finish();
111
+ }
112
+
113
+ @Override
114
+ public void close()
115
+ {
116
+ pageReader.close();
117
+ output.close();
118
+ }
119
+
120
+ private void setInputColumnsExceptFlattenJsonColumns(PageBuilder pageBuilder, List<Column> inputColumnsExceptFlattenJsonColumns) {
121
+ for (Column inputColumn: inputColumnsExceptFlattenJsonColumns) {
122
+ if (pageReader.isNull(inputColumn)) {
123
+ pageBuilder.setNull(inputColumn);
124
+ continue;
125
+ }
126
+
127
+ if (Types.STRING.equals(inputColumn.getType())) {
128
+ pageBuilder.setString(inputColumn, pageReader.getString(inputColumn));
129
+ }
130
+ else if (Types.BOOLEAN.equals(inputColumn.getType())) {
131
+ pageBuilder.setBoolean(inputColumn, pageReader.getBoolean(inputColumn));
132
+ }
133
+ else if (Types.DOUBLE.equals(inputColumn.getType())) {
134
+ pageBuilder.setDouble(inputColumn, pageReader.getDouble(inputColumn));
135
+ }
136
+ else if (Types.LONG.equals(inputColumn.getType())) {
137
+ pageBuilder.setLong(inputColumn, pageReader.getLong(inputColumn));
138
+ }
139
+ else if (Types.TIMESTAMP.equals(inputColumn.getType())) {
140
+ pageBuilder.setTimestamp(inputColumn, pageReader.getTimestamp(inputColumn));
141
+ }
142
+ }
143
+ }
144
+
145
+ private void setFlattenJsonColumns(PageBuilder pageBuilder, List<Column> flattenJsonColumns, String separator, String arrayIndexPrefix)
146
+ throws IOException
147
+ {
148
+ for (Column flattenJsonColumn: flattenJsonColumns) {
149
+ if (pageReader.isNull(flattenJsonColumn)) {
150
+ pageBuilder.setNull(flattenJsonColumn);
151
+ continue;
152
+ }
153
+
154
+ ObjectMapper objectMapper = new ObjectMapper();
155
+ String json = pageReader.getString(flattenJsonColumn);
156
+ JsonNode jsonNode = objectMapper.readTree(json);
157
+
158
+ Map<String, String> jsonMap = Maps.newHashMap();
159
+ joinNode("", jsonNode, jsonMap, separator, arrayIndexPrefix);
160
+
161
+ String flattenedJson = objectMapper.writeValueAsString(jsonMap);
162
+
163
+ pageBuilder.setString(flattenJsonColumn, flattenedJson);
164
+ }
165
+ }
166
+
167
+ private void joinNode(String currentPath, JsonNode jsonNode, Map<String, String> map, String separator, String arrayIndexPrefix) {
168
+ if (jsonNode.isObject()) {
169
+ ObjectNode objectNode = (ObjectNode) jsonNode;
170
+ Iterator<Map.Entry<String, JsonNode>> iterator = objectNode.fields();
171
+ String pathPrefix = currentPath.isEmpty() ? "" : currentPath + separator;
172
+
173
+ while (iterator.hasNext()) {
174
+ Map.Entry<String, JsonNode> entry = iterator.next();
175
+ joinNode(pathPrefix + entry.getKey(), entry.getValue(), map, separator, arrayIndexPrefix);
176
+ }
177
+ } else if (jsonNode.isArray()) {
178
+ ArrayNode arrayNode = (ArrayNode) jsonNode;
179
+ for (int i = 0; i < arrayNode.size(); i++) {
180
+ joinNode(currentPath + separator + arrayIndexPrefix + i, arrayNode.get(i), map, separator, arrayIndexPrefix);
181
+ }
182
+ } else if (jsonNode.isValueNode()) {
183
+ ValueNode valueNode = (ValueNode) jsonNode;
184
+ map.put(currentPath, valueNode.asText());
185
+ }
186
+ }
187
+
188
+ };
189
+ }
190
+
191
+ }
@@ -0,0 +1,5 @@
1
+ package org.embulk.filter.flatten_json;
2
+
3
+ public class TestFlattenJsonFilterPlugin
4
+ {
5
+ }
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: embulk-filter-flatten_json
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Civitaspo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ requirement: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: '1.0'
25
+ prerelease: false
26
+ type: :development
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '10.0'
39
+ prerelease: false
40
+ type: :development
41
+ description: Flatten Json
42
+ email:
43
+ - civitaspo@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - LICENSE.txt
50
+ - README.md
51
+ - build.gradle
52
+ - example/config.yml
53
+ - example/data.tsv
54
+ - gradle/wrapper/gradle-wrapper.jar
55
+ - gradle/wrapper/gradle-wrapper.properties
56
+ - gradlew
57
+ - gradlew.bat
58
+ - lib/embulk/filter/flatten_json.rb
59
+ - src/main/java/org/embulk/filter/flatten_json/FlattenJsonFilterPlugin.java
60
+ - src/test/java/org/embulk/filter/flatten_json/TestFlattenJsonFilterPlugin.java
61
+ - classpath/embulk-filter-flatten_json-0.0.1.jar
62
+ homepage: https://github.com/civitaspo/embulk-filter-flatten_json
63
+ licenses:
64
+ - MIT
65
+ metadata: {}
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 2.1.9
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: Flatten Json filter plugin for Embulk
86
+ test_files: []