infobright-loader 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +19 -0
  3. data/LICENSE-2.0.txt +202 -0
  4. data/README.md +232 -0
  5. data/Rakefile +2 -0
  6. data/bin/infobright-loader +45 -0
  7. data/control-file/template.yml +23 -0
  8. data/infobright-loader.gemspec +35 -0
  9. data/lib/infobright-loader.rb +5 -0
  10. data/lib/infobright-loader/cli/config.rb +204 -0
  11. data/lib/infobright-loader/cli/loader.rb +66 -0
  12. data/lib/infobright-loader/db.rb +90 -0
  13. data/lib/infobright-loader/loader.rb +175 -0
  14. data/lib/infobright-loader/version.rb +4 -0
  15. data/tests/manual/bad-files/.gitignore +1 -0
  16. data/tests/manual/bad-files/control-file-raw.yml +50 -0
  17. data/tests/manual/bad-files/data/b/b_1.txt +6 -0
  18. data/tests/manual/bad-files/data/b/b_2.txt +6 -0
  19. data/tests/manual/bad-files/data/b/b_3.txt +6 -0
  20. data/tests/manual/bad-files/data/b/b_4.txt +6 -0
  21. data/tests/manual/bad-files/data/b/b_5.txt +6 -0
  22. data/tests/manual/bad-files/data/b/b_6.txt +6 -0
  23. data/tests/manual/bad-files/data/c/c_1.txt +6 -0
  24. data/tests/manual/bad-files/data/c/c_2.txt +6 -0
  25. data/tests/manual/bad-files/data/c/c_3.txt +6 -0
  26. data/tests/manual/bad-files/data/c/c_4.txt +6 -0
  27. data/tests/manual/bad-files/data/c/c_5.txt +6 -0
  28. data/tests/manual/bad-files/data/c/c_6.txt +6 -0
  29. data/tests/manual/bad-files/data/d/d_1.txt +6 -0
  30. data/tests/manual/bad-files/data/d/d_2.txt +6 -0
  31. data/tests/manual/bad-files/data/d/d_3.txt +6 -0
  32. data/tests/manual/bad-files/data/d/d_4.txt +6 -0
  33. data/tests/manual/bad-files/data/d/d_5.txt +6 -0
  34. data/tests/manual/bad-files/data/d/d_6.txt +6 -0
  35. data/tests/manual/bad-files/data/e/e_1.txt +6 -0
  36. data/tests/manual/bad-files/data/e/e_2.txt +6 -0
  37. data/tests/manual/bad-files/data/e/e_3.txt +6 -0
  38. data/tests/manual/bad-files/data/e/e_4.txt +6 -0
  39. data/tests/manual/bad-files/data/e/e_5.txt +6 -0
  40. data/tests/manual/bad-files/data/e/e_6.txt +6 -0
  41. data/tests/manual/bad-files/data/f/f_1.txt +6 -0
  42. data/tests/manual/bad-files/data/f/f_2.txt +6 -0
  43. data/tests/manual/bad-files/data/f/f_3.txt +6 -0
  44. data/tests/manual/bad-files/data/f/f_4.txt +6 -0
  45. data/tests/manual/bad-files/data/f/f_5.txt +6 -0
  46. data/tests/manual/bad-files/data/f/f_6.txt +6 -0
  47. data/tests/manual/bad-files/run_test.sh +40 -0
  48. data/tests/manual/bad-files/setup.sql +8 -0
  49. data/tests/manual/bad-files/verify.sql +10 -0
  50. data/tests/manual/control-file/.gitignore +1 -0
  51. data/tests/manual/control-file/control-file-raw.yml +50 -0
  52. data/tests/manual/control-file/data/b/b_1.txt +6 -0
  53. data/tests/manual/control-file/data/b/b_2.txt +6 -0
  54. data/tests/manual/control-file/data/b/b_3.txt +6 -0
  55. data/tests/manual/control-file/data/b/b_4.txt +6 -0
  56. data/tests/manual/control-file/data/b/b_5.txt +6 -0
  57. data/tests/manual/control-file/data/b/b_6.txt +6 -0
  58. data/tests/manual/control-file/data/c/c_1.txt +6 -0
  59. data/tests/manual/control-file/data/c/c_2.txt +6 -0
  60. data/tests/manual/control-file/data/c/c_3.txt +6 -0
  61. data/tests/manual/control-file/data/c/c_4.txt +6 -0
  62. data/tests/manual/control-file/data/c/c_5.txt +6 -0
  63. data/tests/manual/control-file/data/c/c_6.txt +6 -0
  64. data/tests/manual/control-file/data/d/d_1.txt +6 -0
  65. data/tests/manual/control-file/data/d/d_2.txt +6 -0
  66. data/tests/manual/control-file/data/d/d_3.txt +6 -0
  67. data/tests/manual/control-file/data/d/d_4.txt +6 -0
  68. data/tests/manual/control-file/data/d/d_5.txt +6 -0
  69. data/tests/manual/control-file/data/d/d_6.txt +6 -0
  70. data/tests/manual/control-file/data/e/e_1.txt +6 -0
  71. data/tests/manual/control-file/data/e/e_2.txt +6 -0
  72. data/tests/manual/control-file/data/e/e_3.txt +6 -0
  73. data/tests/manual/control-file/data/e/e_4.txt +6 -0
  74. data/tests/manual/control-file/data/e/e_5.txt +6 -0
  75. data/tests/manual/control-file/data/e/e_6.txt +6 -0
  76. data/tests/manual/control-file/data/f/f_1.txt +6 -0
  77. data/tests/manual/control-file/data/f/f_2.txt +6 -0
  78. data/tests/manual/control-file/data/f/f_3.txt +6 -0
  79. data/tests/manual/control-file/data/f/f_4.txt +6 -0
  80. data/tests/manual/control-file/data/f/f_5.txt +6 -0
  81. data/tests/manual/control-file/data/f/f_6.txt +6 -0
  82. data/tests/manual/control-file/run_test.sh +40 -0
  83. data/tests/manual/control-file/setup.sql +8 -0
  84. data/tests/manual/control-file/verify.sql +10 -0
  85. data/tests/manual/folder/data/a/a_1.txt +6 -0
  86. data/tests/manual/folder/data/a/a_2.txt +6 -0
  87. data/tests/manual/folder/data/a/a_3.txt +6 -0
  88. data/tests/manual/folder/data/a/a_4.txt +6 -0
  89. data/tests/manual/folder/data/a/a_5.txt +6 -0
  90. data/tests/manual/folder/data/a/a_6.txt +6 -0
  91. data/tests/manual/folder/run_test.sh +37 -0
  92. data/tests/manual/folder/setup.sql +4 -0
  93. data/tests/manual/folder/verify.sql +2 -0
  94. metadata +158 -0
@@ -0,0 +1,6 @@
1
+ "7"|"row 7"
2
+ "8"|"row 8"
3
+ "9"|"row 9"
4
+ "10"|"row 10"
5
+ "11"|"row 11"
6
+ "12"|"row 12"
@@ -0,0 +1,6 @@
1
+ "13"|"row 13"
2
+ "14"|"row 14"
3
+ "15"|"row 15"
4
+ "16"|"row 16"
5
+ "17"|"row 17"
6
+ "18"|"row 18"
@@ -0,0 +1,6 @@
1
+ "19"|"row 19"
2
+ "20"|"row 20"
3
+ "21"|"row 21"
4
+ "22"|"row 22"
5
+ "23"|"row 23"
6
+ "24"|"row 24"
@@ -0,0 +1,6 @@
1
+ "25"|"row 25"
2
+ "26"|"row 26"
3
+ "27"|"row 27"
4
+ "28"|"row 28"
5
+ "29"|"row 29"
6
+ "30"|"row 30"
@@ -0,0 +1,6 @@
1
+ "31"|"row 31"
2
+ "32"|"row 32"
3
+ "33"|"row 33"
4
+ "34"|"row 34"
5
+ "35"|"row 35"
6
+ "36"|"row 36"
@@ -0,0 +1,37 @@
1
+ #!/bin/bash
2
+ # Copyright (c) 2012 SnowPlow Analytics Ltd. All rights reserved.
3
+ #
4
+ # This program is licensed to you under the Apache License Version 2.0,
5
+ # and you may not use this file except in compliance with the Apache License Version 2.0.
6
+ # You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
7
+ #
8
+ # Unless required by applicable law or agreed to in writing,
9
+ # software distributed under the Apache License Version 2.0 is distributed on an
10
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
12
+
13
+ # Author:: Alex Dean (mailto:support@snowplowanalytics.com)
14
+ # Copyright:: Copyright (c) 2012 SnowPlow Analytics Ltd
15
+ # License:: Apache License Version 2.0
16
+
17
+ # input parameters
18
+ if [ $# != 2 ]; then
19
+ echo; echo 'syntax: '$0' <username> <password>'; echo
20
+ exit 1
21
+ else
22
+ # assign parameters
23
+ USERNAME=$1
24
+ PASSWORD=$2
25
+ fi
26
+
27
+ echo "Running folder-based test..."
28
+ SQL=`locate mysql-ib`
29
+
30
+ echo "Setting up Infobright"
31
+ cat setup.sql | ${SQL} -u ${USERNAME} --password=${PASSWORD}
32
+
33
+ echo "Running Infobright Ruby Loader in folder mode"
34
+ bundle exec infobright-loader -d irl_tests -e \" -u ${USERNAME} -p ${PASSWORD} -t a -f data/a
35
+
36
+ echo "Verifying the load into Infobright - please visually inspect:"
37
+ cat verify.sql | ${SQL} -u ${USERNAME} --password=${PASSWORD}
@@ -0,0 +1,4 @@
1
+ drop database if exists irl_tests;
2
+ create database irl_tests;
3
+ use irl_tests;
4
+ create table a (id int, description varchar(255)) engine=brighthouse;
@@ -0,0 +1,2 @@
1
+ use irl_tests;
2
+ select * from a order by a.id;
metadata ADDED
@@ -0,0 +1,158 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: infobright-loader
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Alex Dean <support@snowplowanalytics.com>
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2012-10-22 00:00:00 Z
19
+ dependencies: []
20
+
21
+ description: Loads data files into Infobright
22
+ email:
23
+ - support@snowplowanalytics.com
24
+ executables:
25
+ - infobright-loader
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - .gitignore
32
+ - Gemfile
33
+ - LICENSE-2.0.txt
34
+ - README.md
35
+ - Rakefile
36
+ - bin/infobright-loader
37
+ - control-file/template.yml
38
+ - infobright-loader.gemspec
39
+ - lib/infobright-loader.rb
40
+ - lib/infobright-loader/cli/config.rb
41
+ - lib/infobright-loader/cli/loader.rb
42
+ - lib/infobright-loader/db.rb
43
+ - lib/infobright-loader/loader.rb
44
+ - lib/infobright-loader/version.rb
45
+ - tests/manual/bad-files/.gitignore
46
+ - tests/manual/bad-files/control-file-raw.yml
47
+ - tests/manual/bad-files/data/b/b_1.txt
48
+ - tests/manual/bad-files/data/b/b_2.txt
49
+ - tests/manual/bad-files/data/b/b_3.txt
50
+ - tests/manual/bad-files/data/b/b_4.txt
51
+ - tests/manual/bad-files/data/b/b_5.txt
52
+ - tests/manual/bad-files/data/b/b_6.txt
53
+ - tests/manual/bad-files/data/c/c_1.txt
54
+ - tests/manual/bad-files/data/c/c_2.txt
55
+ - tests/manual/bad-files/data/c/c_3.txt
56
+ - tests/manual/bad-files/data/c/c_4.txt
57
+ - tests/manual/bad-files/data/c/c_5.txt
58
+ - tests/manual/bad-files/data/c/c_6.txt
59
+ - tests/manual/bad-files/data/d/d_1.txt
60
+ - tests/manual/bad-files/data/d/d_2.txt
61
+ - tests/manual/bad-files/data/d/d_3.txt
62
+ - tests/manual/bad-files/data/d/d_4.txt
63
+ - tests/manual/bad-files/data/d/d_5.txt
64
+ - tests/manual/bad-files/data/d/d_6.txt
65
+ - tests/manual/bad-files/data/e/e_1.txt
66
+ - tests/manual/bad-files/data/e/e_2.txt
67
+ - tests/manual/bad-files/data/e/e_3.txt
68
+ - tests/manual/bad-files/data/e/e_4.txt
69
+ - tests/manual/bad-files/data/e/e_5.txt
70
+ - tests/manual/bad-files/data/e/e_6.txt
71
+ - tests/manual/bad-files/data/f/f_1.txt
72
+ - tests/manual/bad-files/data/f/f_2.txt
73
+ - tests/manual/bad-files/data/f/f_3.txt
74
+ - tests/manual/bad-files/data/f/f_4.txt
75
+ - tests/manual/bad-files/data/f/f_5.txt
76
+ - tests/manual/bad-files/data/f/f_6.txt
77
+ - tests/manual/bad-files/run_test.sh
78
+ - tests/manual/bad-files/setup.sql
79
+ - tests/manual/bad-files/verify.sql
80
+ - tests/manual/control-file/.gitignore
81
+ - tests/manual/control-file/control-file-raw.yml
82
+ - tests/manual/control-file/data/b/b_1.txt
83
+ - tests/manual/control-file/data/b/b_2.txt
84
+ - tests/manual/control-file/data/b/b_3.txt
85
+ - tests/manual/control-file/data/b/b_4.txt
86
+ - tests/manual/control-file/data/b/b_5.txt
87
+ - tests/manual/control-file/data/b/b_6.txt
88
+ - tests/manual/control-file/data/c/c_1.txt
89
+ - tests/manual/control-file/data/c/c_2.txt
90
+ - tests/manual/control-file/data/c/c_3.txt
91
+ - tests/manual/control-file/data/c/c_4.txt
92
+ - tests/manual/control-file/data/c/c_5.txt
93
+ - tests/manual/control-file/data/c/c_6.txt
94
+ - tests/manual/control-file/data/d/d_1.txt
95
+ - tests/manual/control-file/data/d/d_2.txt
96
+ - tests/manual/control-file/data/d/d_3.txt
97
+ - tests/manual/control-file/data/d/d_4.txt
98
+ - tests/manual/control-file/data/d/d_5.txt
99
+ - tests/manual/control-file/data/d/d_6.txt
100
+ - tests/manual/control-file/data/e/e_1.txt
101
+ - tests/manual/control-file/data/e/e_2.txt
102
+ - tests/manual/control-file/data/e/e_3.txt
103
+ - tests/manual/control-file/data/e/e_4.txt
104
+ - tests/manual/control-file/data/e/e_5.txt
105
+ - tests/manual/control-file/data/e/e_6.txt
106
+ - tests/manual/control-file/data/f/f_1.txt
107
+ - tests/manual/control-file/data/f/f_2.txt
108
+ - tests/manual/control-file/data/f/f_3.txt
109
+ - tests/manual/control-file/data/f/f_4.txt
110
+ - tests/manual/control-file/data/f/f_5.txt
111
+ - tests/manual/control-file/data/f/f_6.txt
112
+ - tests/manual/control-file/run_test.sh
113
+ - tests/manual/control-file/setup.sql
114
+ - tests/manual/control-file/verify.sql
115
+ - tests/manual/folder/data/a/a_1.txt
116
+ - tests/manual/folder/data/a/a_2.txt
117
+ - tests/manual/folder/data/a/a_3.txt
118
+ - tests/manual/folder/data/a/a_4.txt
119
+ - tests/manual/folder/data/a/a_5.txt
120
+ - tests/manual/folder/data/a/a_6.txt
121
+ - tests/manual/folder/run_test.sh
122
+ - tests/manual/folder/setup.sql
123
+ - tests/manual/folder/verify.sql
124
+ homepage: http://snowplowanalytics.com
125
+ licenses: []
126
+
127
+ post_install_message:
128
+ rdoc_options: []
129
+
130
+ require_paths:
131
+ - lib
132
+ required_ruby_version: !ruby/object:Gem::Requirement
133
+ none: false
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ hash: 3
138
+ segments:
139
+ - 0
140
+ version: "0"
141
+ required_rubygems_version: !ruby/object:Gem::Requirement
142
+ none: false
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ hash: 3
147
+ segments:
148
+ - 0
149
+ version: "0"
150
+ requirements: []
151
+
152
+ rubyforge_project:
153
+ rubygems_version: 1.8.24
154
+ signing_key:
155
+ specification_version: 3
156
+ summary: Infobright Ruby Loader (IRL) is a data loader for Infobright Community Edition (ICE) and Enterprise Edition (IEE), built as a Ruby gem. Inspired by ParaFlex (the bash equivalent)
157
+ test_files: []
158
+