csv test for join
parent
5be44d7fac
commit
2f1635a85d
|
@ -0,0 +1,17 @@
|
|||
left = from(bucket: "test")
|
||||
|> range(start:2018-05-22T19:53:00Z, stop:2018-05-22T19:55:00Z)
|
||||
|> drop(columns: ["_start", "_stop"])
|
||||
|> filter(fn: (r) => r.user == "user1")
|
||||
|> group(by: ["user"])
|
||||
|
||||
right = from(bucket: "test")
|
||||
|> range(start:2018-05-22T19:53:00Z, stop:2018-05-22T19:55:00Z)
|
||||
|> drop(columns: ["_start", "_stop"])
|
||||
|> filter(fn: (r) => r.user == "user2")
|
||||
|> group(by: ["_measurement"])
|
||||
|
||||
join(tables: {left:left, right:right}, on: ["_time", "_measurement"])
|
||||
|> rename(columns: {
|
||||
left__value: "left_value",
|
||||
right__value: "right_value"
|
||||
})
|
|
@ -0,0 +1,20 @@
|
|||
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string
|
||||
#group,false,false,false,false,false,false,true,true
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_start,_stop,_time,_value,_measurement,user
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,1,RAM,user1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,2,RAM,user1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,3,RAM,user1
|
||||
,,0,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,5,RAM,user1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,0,CPU,user1
|
||||
,,1,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,1,CPU,user1
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,2,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,4,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,4,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,0,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:54:06Z,2,RAM,user2
|
||||
,,2,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:54:16Z,10,RAM,user2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:26Z,4,CPU,user2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:36Z,20,CPU,user2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:46Z,7,CPU,user2
|
||||
,,3,2018-05-22T19:53:00Z,2018-05-22T19:55:00Z,2018-05-22T19:53:56Z,10,CPU,user2
|
|
|
@ -0,0 +1,11 @@
|
|||
#datatype,string,long,string,dateTime:RFC3339,double,string,double,string
|
||||
#group,false,false,true,false,false,true,false,false
|
||||
#default,_result,,,,,,,
|
||||
,result,table,_measurement,_time,left_value,left_user,right_value,right_user
|
||||
,,0,CPU,2018-05-22T19:53:26Z,0,user1,4,user2
|
||||
,,0,CPU,2018-05-22T19:53:36Z,1,user1,20,user2
|
||||
,,1,RAM,2018-05-22T19:53:26Z,1,user1,2,user2
|
||||
,,1,RAM,2018-05-22T19:53:36Z,2,user1,4,user2
|
||||
,,1,RAM,2018-05-22T19:53:46Z,3,user1,4,user2
|
||||
,,1,RAM,2018-05-22T19:53:56Z,5,user1,0,user2
|
||||
|
|
Loading…
Reference in New Issue