Flux is a lightweight scripting language for querying databases (like InfluxDB) and working with data. It's part of InfluxDB 1.7 and 2.0, but can be run independently of those.
It's possible for side effects that should be contained in the first expression of chain, which is the expression that is executed in a sub-execution environment, to emerge in the containing execution and also be planned, executed and drained there.
To reproduce, start with an empty dest bucket and run the following in OSS
import "csv"
import "experimental"
import "system"
csvdata ="
#group,false,false,true,true,false,false,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string
#default,_result,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement
,,0,2018-04-06T10:49:41.565Z,2020-04-06T11:49:41.564Z,2020-02-22T15:01:00Z,50,bottom_degrees,h2o_temperature
"
A = csv.from( csv: csvdata )
|> map( fn: (r) => ({ r with _time: system.time() }) )
|> to( bucket: "dest" )
B = csv.from( csv: csvdata )
experimental.chain( first: A, second: B )
The output will include the following, which should not be present.
It's possible for side effects that should be contained in the first expression of chain, which is the expression that is executed in a sub-execution environment, to emerge in the containing execution and also be planned, executed and drained there.
To reproduce, start with an empty
dest
bucket and run the following in OSSThe output will include the following, which should not be present.
And the dest bucket will contain two points, when it should contain only one.
An attempt to reproduce this in pure flux, using the
sql.to
function, does not work. The writing does not occur twice.Then run the following, only one row will show up, as expected.