Skip to content
Snippets Groups Projects
Unverified Commit a602ef8a authored by Mira's avatar Mira Committed by GitHub
Browse files

Merge pull request #54 from Ensembl/test/ubuntu_20

Mysql 8 comressed data import
parents e2e286ba 5779f1a0
No related branches found
No related tags found
No related merge requests found
Pipeline #98451 passed with stage
in 4 minutes and 15 seconds
......@@ -42,9 +42,21 @@ use base 'Bio::EnsEMBL::Test::MultiTestDB';
sub load_txt_dump {
my ($self, $txt_file, $tablename, $db) = @_;
my $load = sprintf(q{LOAD DATA LOCAL INFILE '%s' INTO TABLE `%s` FIELDS ESCAPED BY '\\\\'}, $txt_file, $tablename);
$db->do($load);
return $db;
if(index($txt_file, 'compressed_genotype_var') != -1) {
my $load = sprintf(q{LOAD DATA LOCAL INFILE '%s' INTO TABLE `%s`FIELDS ESCAPED BY '\\\\'
SET genotypes = UNHEX(@var1)}, $txt_file, $tablename);
$db->do($load);
return $db;
} elsif (index($txt_file, 'compressed_genotype_region') != -1) {
my $load = sprintf(q{LOAD DATA LOCAL INFILE '%s' INTO TABLE `%s`FIELDS ESCAPED BY '\\\\' (sample_id, seq_region_id, seq_region_start, seq_region_end, seq_region_strand, @var1) SET genotypes = UNHEX(@var1)}, $txt_file, $tablename);
$db->do($load);
return $db;
} else {
my $load = sprintf(q{LOAD DATA LOCAL INFILE '%s' INTO TABLE `%s` FIELDS ESCAPED BY '\\\\'}, $txt_file, $tablename);
$db->do($load);
return $db;
}
}
sub create_and_use_db {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment