Skip to content

Commit 8161e56

Browse files
author
Anselme Goetschmann
committed
Merge branch 'develop'
2 parents 8bc9ae0 + 273e6ac commit 8161e56

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

influxdb-schema-updater

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ use strict;
1818
use warnings;
1919

2020
use InfluxDB::HTTP;
21-
2221
use Getopt::Long;
2322
use Pod::Usage qw(pod2usage);
2423
use IPC::Run qw(run);
2524
use JSON::MaybeXS;
2625
use File::Slurper qw(read_text);
27-
use List::Util qw(sum0);
28-
2926

3027
sub main {
3128
my $show_usage;
@@ -308,6 +305,7 @@ sub compare_cqs {
308305
$cq =~ s/;//g;
309306
$cq =~ s/"//g;
310307
$cq = lc $cq;
308+
$cq =~ s/fill\(null\)//g; # since fill(null) doesn't change anything, influx doesn't store it
311309
}
312310
return $cq1 cmp $cq2;
313311
}

t/data/test06.2/cq/db1.ifql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
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;
2+
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;

t/data/test06.2/db/db1.ifql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CREATE DATABASE test WITH DURATION 260w REPLICATION 1 SHARD DURATION 12w NAME rp2;
2+
CREATE RETENTION POLICY rp1 ON test DURATION 100d REPLICATION 1 SHARD DURATION 2w;

t/influxdb-schema-updater.t

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ sub test {
8585
run_updater($curdir, "$schemas_dir/test06", $port);
8686
is run_updater($curdir, "$schemas_dir/test06", $port, '--diff'), '' => 'CQ is updated';
8787

88+
# check that fill(null) is ignored
89+
run_updater($curdir, "$schemas_dir/test06.2", $port, '--force');
90+
is run_updater($curdir, "$schemas_dir/test06.2", $port, '--diff'), '' => 'fill(null) in CQ is ignored';
91+
run_updater($curdir, "$schemas_dir/test06", $port, '--force'); # reset
92+
8893
# remove a continuous query
8994
is run_updater($curdir, "$schemas_dir/test07", $port, '--diff'), "-- DROP CONTINUOUS QUERY cq2 ON test;\n"
9095
=> 'CQ removal is detected';

0 commit comments

Comments
 (0)