Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Anselme Goetschmann committed Jul 18, 2018
2 parents 8bc9ae0 + 273e6ac commit 8161e56
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions influxdb-schema-updater
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ use strict;
use warnings;

use InfluxDB::HTTP;

use Getopt::Long;
use Pod::Usage qw(pod2usage);
use IPC::Run qw(run);
use JSON::MaybeXS;
use File::Slurper qw(read_text);
use List::Util qw(sum0);


sub main {
my $show_usage;
Expand Down Expand Up @@ -308,6 +305,7 @@ sub compare_cqs {
$cq =~ s/;//g;
$cq =~ s/"//g;
$cq = lc $cq;
$cq =~ s/fill\(null\)//g; # since fill(null) doesn't change anything, influx doesn't store it
}
return $cq1 cmp $cq2;
}
Expand Down
2 changes: 2 additions & 0 deletions t/data/test06.2/cq/db1.ifql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE CONTINUOUS QUERY cq1 ON test RESAMPLE EVERY 5m FOR 10m BEGIN SELECT LAST(a) AS b, c INTO test.rp2.m FROM test.rp1.m GROUP BY time(5m) fill(null) END;
CREATE CONTINUOUS QUERY cq2 ON test RESAMPLE EVERY 5m FOR 10m BEGIN SELECT MAX(a) AS b, c INTO test.rp2.m FROM test.rp1.m GROUP BY time(5m) END;
2 changes: 2 additions & 0 deletions t/data/test06.2/db/db1.ifql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE DATABASE test WITH DURATION 260w REPLICATION 1 SHARD DURATION 12w NAME rp2;
CREATE RETENTION POLICY rp1 ON test DURATION 100d REPLICATION 1 SHARD DURATION 2w;
5 changes: 5 additions & 0 deletions t/influxdb-schema-updater.t
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ sub test {
run_updater($curdir, "$schemas_dir/test06", $port);
is run_updater($curdir, "$schemas_dir/test06", $port, '--diff'), '' => 'CQ is updated';

# check that fill(null) is ignored
run_updater($curdir, "$schemas_dir/test06.2", $port, '--force');
is run_updater($curdir, "$schemas_dir/test06.2", $port, '--diff'), '' => 'fill(null) in CQ is ignored';
run_updater($curdir, "$schemas_dir/test06", $port, '--force'); # reset

# remove a continuous query
is run_updater($curdir, "$schemas_dir/test07", $port, '--diff'), "-- DROP CONTINUOUS QUERY cq2 ON test;\n"
=> 'CQ removal is detected';
Expand Down

0 comments on commit 8161e56

Please sign in to comment.