influxdata / kapacitor

Open source framework for processing, monitoring, and alerting on time series data
MIT License
2.32k stars 492 forks source link

Join returns empty #2159

Open talnis opened 5 years ago

talnis commented 5 years ago

I'm trying to make a join between two batches but it's not working and I can't figure why var meanw = batch │ |query(''' SELECT mean as value FROM "metrics"."default"."mean_week_1h" ''') │ .period(2d) │ .every(10s)

will return this result: `time mean


2019-02-11T01:00:00Z 1987.604285714286 `

var current_val = batch │ |query(''' SELECT FIRST("value") as value FROM "metrics"."default"."perf_spikes_paradise_daily_perf" where "network" =│ 'adstract' AND "measure" = 'revenue' ORDER BY "time" DESC LIMIT 1''') │ .period(1d) │ .every(10s) │ .groupBy(time(1d, 1h)) │ │ current_val │ |join(meanw) │ .as('current_val', 'meanw') │ .tolerance(1w) │ |influxDBOut() │ .database('metrics') │ .measurement('joined_measurement')

current_val result is: `time value


2019-02-12T01:00:00Z 2019.26 `

now I see the time is different so I added a tolerance to the join but still the joined measurement is not written in influx. I assume because of empty result of the join.

Can anyone help me please?

liuchyin commented 5 years ago

i meet same question and have no idea too

liuchyin commented 5 years ago

try the solution from @nathanielc , which makes the joins work in my tickscript https://github.com/influxdata/kapacitor/issues/1257