testing.diff() function produces a diff between two streams.
import "testing" testing.diff( got: stream2, want: stream1, epsilon: 0.000000001, nansEqual: false, verbose: false )
It matches tables from each stream with the same group keys.
For each matched table, it produces a diff.
Any added or removed rows are added to the table as a row.
An additional string column with the name
diff is created and contains a
- if the
row was present in the
got table and not in the
want table or
+ if the opposite is true.
The diff function is guaranteed to emit at least one row if the tables are different and no rows if the tables are the same. The exact diff produced may change.
testing.diff() function can be used to perform in-line diffs in a query.
Stream containing data to test.
Default is piped-forward data (
Stream that contains the expected data to test against.
Specifies how far apart two float values can be, but still considered equal.
NaN float values equal.
Include detailed differences in output.
Diff separate streams
import "testing" want = from(bucket: "backup-example-bucket") |> range(start: -5m) got = from(bucket: "example-bucket") |> range(start: -5m) testing.diff(got: got, want: want)
import "testing" want = from(bucket: "backup-example-bucket") |> range(start: -5m) from(bucket: "example-bucket") |> range(start: -5m) |> testing.diff(want: want)
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.