-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(bug/functions/transformations): fix union to be compatible with hete…
…rogeneous table types (#246) * (bug/functions/transformations): fix union to be compatible with heterogeneous table types added LevelColumns to table interface, fixed union and added a batch of tests that came up mid-stream
- Loading branch information
1 parent
7009b18
commit 69370f6
Showing
13 changed files
with
2,568 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
functions/transformations/testdata/join_across_measurements.flux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
memUsed = from(bucket: "telegraf/autogen") | ||
|> range(start:2018-05-22T19:53:00Z, stop:2018-05-22T19:55:00Z) | ||
|> filter(fn: (r) => r._measurement == "mem" AND r._field == "used" ) | ||
|
||
procTotal = from(bucket: "telegraf/autogen") | ||
|> range(start:2018-05-22T19:53:00Z, stop:2018-05-22T19:55:00Z) | ||
|> filter(fn: (r) => | ||
r._measurement == "processes" AND | ||
r._field == "total" | ||
) | ||
|
||
join(tables: {mem:memUsed, proc:procTotal}, on: ["_time", "_stop", "_start", "host"]) |> yield() |
1,093 changes: 1,093 additions & 0 deletions
1,093
functions/transformations/testdata/join_across_measurements.in.csv
Large diffs are not rendered by default.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
functions/transformations/testdata/join_across_measurements.out.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#datatype,string,long,string,string,string,string,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,long,string | ||
#group,false,false,true,true,true,true,false,false,false,false,false,true | ||
#default,_result,,,,,,,,,,, | ||
,result,table,_field_mem,_field_proc,_measurement_mem,_measurement_proc,_start,_stop,_time,_value_mem,_value_proc,host | ||
,,0,used,total,mem,processes,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:26Z,10832478208,417,host.local | ||
,,0,used,total,mem,processes,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:36Z,10774417408,416,host.local | ||
,,0,used,total,mem,processes,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:46Z,10718109696,416,host.local | ||
,,0,used,total,mem,processes,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:53:56Z,10779672576,418,host.local | ||
,,0,used,total,mem,processes,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:06Z,10785837056,418,host.local | ||
,,0,used,total,mem,processes,2018-05-22T19:53:24.421470485Z,2018-05-22T19:54:24.421470485Z,2018-05-22T19:54:16Z,10731827200,417,host.local | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from(bucket:"telegraf") | ||
|> range(start:2018-05-22T19:53:26Z) | ||
|> keys(except: ["_time","_value","_start","_stop"]) | ||
|> group(none: true) | ||
|> distinct() | ||
|> map(fn:(r) => r._value) |
Oops, something went wrong.