myreplicator 1.1.27 → 1.1.28
Sign up to get free protection for your applications and to get access to all the features.
@@ -123,8 +123,8 @@ module Myreplicator
|
|
123
123
|
Kernel.p options
|
124
124
|
sql = "SELECT * INTO OUTFILE '#{options[:filepath]}' "
|
125
125
|
|
126
|
-
sql += " FIELDS TERMINATED BY '\\0' ESCAPED BY '' OPTIONALLY ENCLOSED BY '\\\"' LINES TERMINATED BY '
|
127
|
-
|
126
|
+
#sql += " FIELDS TERMINATED BY '\\0' ESCAPED BY '' OPTIONALLY ENCLOSED BY '\\\"' LINES TERMINATED BY ';~~;\n'"
|
127
|
+
sql += " FIELDS TERMINATED BY '\\0' ESCAPED BY '' LINES TERMINATED BY ';~~;\n'"
|
128
128
|
sql += "FROM #{options[:db]}.#{options[:table]} "
|
129
129
|
|
130
130
|
if !options[:incremental_col].blank? && !options[:incremental_val].blank?
|
@@ -96,7 +96,9 @@ module Myreplicator
|
|
96
96
|
:file => options[:filepath],
|
97
97
|
:delimiter => "\\0",
|
98
98
|
:null_value => "NULL",
|
99
|
+
:line_terminate => ";~~;\n",
|
99
100
|
:enclosed => '')
|
101
|
+
#:enclosed => '\"')
|
100
102
|
# working now but should fix this
|
101
103
|
if !vertica_options["vsql"].blank?
|
102
104
|
options.reverse_merge!(:vsql => vertica_options["vsql"])
|
@@ -188,7 +190,7 @@ module Myreplicator
|
|
188
190
|
file_handler = ""
|
189
191
|
file_handler = "GZIP" if file_extension == "gz"
|
190
192
|
tmp_dir = Myreplicator.tmp_path
|
191
|
-
sql = "COPY #{prepared_options[:schema]}.#{prepared_options[:table]} FROM LOCAL \'#{prepared_options[:file]}\' #{file_handler} DELIMITER E\'#{prepared_options[:delimiter]}\' NULL as \'#{prepared_options[:null_value]}\' ENCLOSED BY E\'#{prepared_options[:enclosed]}\' EXCEPTIONS '#{tmp_dir}/load_logs/#{prepared_options[:schema]}_#{prepared_options[:table_name]}.log';"
|
193
|
+
sql = "COPY #{prepared_options[:schema]}.#{prepared_options[:table]} FROM LOCAL \'#{prepared_options[:file]}\' #{file_handler} DELIMITER E\'#{prepared_options[:delimiter]}\' NULL as \'#{prepared_options[:null_value]}\' ENCLOSED BY E\'#{prepared_options[:enclosed]}\' RECORD TERMINATOR \'#{prepared_options[:line_terminate]}\' EXCEPTIONS '#{tmp_dir}/load_logs/#{prepared_options[:schema]}_#{prepared_options[:table_name]}.log';"
|
192
194
|
cmd = "#{prepared_options[:vsql]} -h #{prepared_options[:host]} -U #{prepared_options[:user]} -w #{prepared_options[:pass]} -d #{prepared_options[:db]} -c \"#{sql}\""
|
193
195
|
return cmd
|
194
196
|
end
|
data/lib/myreplicator/version.rb
CHANGED
@@ -8845,3 +8845,6 @@ Connecting to database specified by database.yml
|
|
8845
8845
|
Connecting to database specified by database.yml
|
8846
8846
|
Connecting to database specified by database.yml
|
8847
8847
|
Connecting to database specified by database.yml
|
8848
|
+
Connecting to database specified by database.yml
|
8849
|
+
Connecting to database specified by database.yml
|
8850
|
+
Connecting to database specified by database.yml
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: myreplicator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.28
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -359,7 +359,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
359
359
|
version: '0'
|
360
360
|
segments:
|
361
361
|
- 0
|
362
|
-
hash:
|
362
|
+
hash: -766025267442710139
|
363
363
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
364
364
|
none: false
|
365
365
|
requirements:
|
@@ -368,7 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
368
368
|
version: '0'
|
369
369
|
segments:
|
370
370
|
- 0
|
371
|
-
hash:
|
371
|
+
hash: -766025267442710139
|
372
372
|
requirements: []
|
373
373
|
rubyforge_project:
|
374
374
|
rubygems_version: 1.8.24
|