flydata 0.2.16 → 0.2.17
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/VERSION +1 -1
- data/flydata.gemspec +2 -2
- data/lib/flydata/command/sync.rb +8 -8
- data/lib/flydata/compatibility_check.rb +1 -1
- data/lib/flydata/table_def/mysql_table_def.rb +3 -1
- data/lib/flydata/table_def/redshift_table_def.rb +12 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3b273dc439a9c6c58398ed75794f67ab7fcd785
|
4
|
+
data.tar.gz: 20a9d323a93ebb65865e5dbee86750d3c71b8dbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1596629dd6c036e157db63f20ffef8fb84f9201f1677b201892e8b59b2f81c5178535a58a3b2f6a4e35fca908ac87a6b5cc3d8af10ecdbd8408734532a9f4a57
|
7
|
+
data.tar.gz: c113a7bdce48f2d683769b50c134efdc6925e6b40897ce14e90ac3c51cf8e54d6c018d1c9ef967ced2e7f957bb78584d7e0fdf10eac182ab3853757d3c6ec369
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.17
|
data/flydata.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "flydata"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.17"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Koichi Fujikawa", "Masashi Miyazaki", "Matthew Luu", "Mak Inada", "Sriram NS"]
|
12
|
-
s.date = "2014-11-
|
12
|
+
s.date = "2014-11-24"
|
13
13
|
s.description = "FlyData Agent"
|
14
14
|
s.email = "sysadmin@flydata.com"
|
15
15
|
s.executables = ["fdmysqldump", "flydata", "serverinfo"]
|
data/lib/flydata/command/sync.rb
CHANGED
@@ -242,16 +242,16 @@ module Flydata
|
|
242
242
|
while !stdout.eof?
|
243
243
|
begin
|
244
244
|
mysql_tabledef = Flydata::TableDef::MysqlTableDef.create(stdout)
|
245
|
-
|
245
|
+
if mysql_tabledef.nil?
|
246
|
+
# stream had no more create table definition
|
247
|
+
break
|
248
|
+
end
|
249
|
+
flydata_tabledef = mysql_tabledef.to_flydata_tabledef
|
250
|
+
puts Flydata::TableDef::RedshiftTableDef.from_flydata_tabledef(flydata_tabledef, flydata_ctl_table: create_flydata_ctl_table, schema_name: schema_name, ctl_only: opts.ctl_only?)
|
251
|
+
rescue TableDefError=> e
|
246
252
|
error_list << e.err_hash
|
247
253
|
next
|
248
254
|
end
|
249
|
-
if mysql_tabledef.nil?
|
250
|
-
# stream had no more create table definition
|
251
|
-
break
|
252
|
-
end
|
253
|
-
flydata_tabledef = mysql_tabledef.to_flydata_tabledef
|
254
|
-
puts Flydata::TableDef::RedshiftTableDef.from_flydata_tabledef(flydata_tabledef, flydata_ctl_table: create_flydata_ctl_table, schema_name: schema_name, ctl_only: opts.ctl_only?)
|
255
255
|
create_flydata_ctl_table = false
|
256
256
|
end
|
257
257
|
errors = ""
|
@@ -270,7 +270,7 @@ module Flydata
|
|
270
270
|
$stderr.puts " - #{hash[:table]}" if hash[:table]
|
271
271
|
end
|
272
272
|
end
|
273
|
-
$stderr.puts "Please fix the above error(s)
|
273
|
+
$stderr.puts "Please fix the above error(s) to try to sync those table(s) or contact us for further help."
|
274
274
|
end
|
275
275
|
end
|
276
276
|
|
@@ -54,7 +54,7 @@ module Flydata
|
|
54
54
|
end
|
55
55
|
|
56
56
|
unless errors.empty?
|
57
|
-
message = "Cannot connect to
|
57
|
+
message = "Cannot connect to outside ports. Please check to make sure you have these outgoing ports open."
|
58
58
|
errors.each do |port, e|
|
59
59
|
message += " Port #{port}, Error #{e.class.name}: #{e.to_s}"
|
60
60
|
end
|
@@ -30,6 +30,7 @@ class MysqlTableDef
|
|
30
30
|
TYPE_MAP_M2F = {
|
31
31
|
'bigint' => {type: 'int8'},
|
32
32
|
'binary' => {type: 'binary', override: PROC_override_varbinary},
|
33
|
+
'bit' => {type: 'bit'},
|
33
34
|
'blob' => {type: 'varbinary(65535)'},
|
34
35
|
'bool' => {type: 'int1'},
|
35
36
|
'boolean' => {type: 'int1'},
|
@@ -51,6 +52,7 @@ class MysqlTableDef
|
|
51
52
|
'mediumint' => {type: 'int3'},
|
52
53
|
'mediumtext' => {type: 'text'},
|
53
54
|
'numeric' => {type: 'numeric'},
|
55
|
+
'set' => {type: 'set'},
|
54
56
|
'smallint' => {type: 'int2'},
|
55
57
|
'text' => {type: 'text'},
|
56
58
|
'time' => {type: 'time'},
|
@@ -130,7 +132,7 @@ class MysqlTableDef
|
|
130
132
|
elsif stripped_line.start_with?("UNIQUE KEY")
|
131
133
|
parse_key(line, columns, :unique)
|
132
134
|
else
|
133
|
-
|
135
|
+
# "Unknown table definition. Skip. (#{line})"
|
134
136
|
end
|
135
137
|
|
136
138
|
when :after_create_table
|
@@ -4,6 +4,7 @@ module TableDef
|
|
4
4
|
class RedshiftTableDef
|
5
5
|
TYPE_MAP_F2R = {
|
6
6
|
'binary' => {type: 'varchar', use_params: true, default_value: ''},
|
7
|
+
'bit' => {type: 'bigint', default_value: '0'},
|
7
8
|
'char' => {type: 'char', use_params: true, default_value: ''},
|
8
9
|
'date' => {type: 'date', default_value: '0000-01-01'},
|
9
10
|
'datetime' => {type: 'timestamp', default_value: '0000-01-01'},
|
@@ -24,6 +25,7 @@ class RedshiftTableDef
|
|
24
25
|
'int8 unsigned' => {type: 'numeric(20,0)', unsigned: true, default_value: '0'},
|
25
26
|
'numeric' => {type: 'numeric', use_params: true, max_size: [38,37], default_value: '0'},
|
26
27
|
'numeric unsigned' => {type: 'numeric', use_params: true, max_size: [38,37], default_value: '0'},
|
28
|
+
'set' => {type: 'varchar encode bytedict', default_value: ''},
|
27
29
|
'text' => {type: 'varchar(max)', default_value: ''},
|
28
30
|
'time' => {type: 'timestamp', default_value: '0000-01-01'},
|
29
31
|
'varbinary' => {type: 'varchar', use_params: true, max_size: 65535, default_value: ''},
|
@@ -33,11 +35,16 @@ class RedshiftTableDef
|
|
33
35
|
options[:flydata_ctl_table] = true unless options.has_key?(:flydata_ctl_table)
|
34
36
|
schema_name = options[:schema_name]
|
35
37
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
begin
|
39
|
+
tabledef = ""
|
40
|
+
tabledef += create_flydata_ctl_table_sql(schema_name) if options[:flydata_ctl_table]
|
41
|
+
tabledef += create_table_sql(flydata_tabledef, schema_name) unless options[:ctl_only]
|
42
|
+
tabledef += comment_sql(flydata_tabledef, schema_name) unless options[:ctl_only]
|
43
|
+
tabledef += flydata_ctl_sql(flydata_tabledef, schema_name)
|
44
|
+
rescue => e
|
45
|
+
# Catch errors from generating schema. Generally an unsupported data type
|
46
|
+
raise TableDefError, {error: "errors generating schema. Please contact us for further instructions", table: flydata_tabledef[:table_name]}
|
47
|
+
end
|
41
48
|
end
|
42
49
|
|
43
50
|
FLYDATA_CTL_COLUMNS_TABLE = "flydata_ctl_columns"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flydata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Koichi Fujikawa
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-11-
|
15
|
+
date: 2014-11-24 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rest-client
|