influxdata / influxdata/kapacitor

join point at timestamp of tMax with others use tolerance not work

Open
#1,477 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

**my data:**
2017-06-02T00:49:57Z energy_kwh 1h measure 962.5600000000001 elec main_power pm1_1 sys wx01 fac
2017-06-02T01:00:00Z energy_kwh 1h measure 249 elec main_power pm2_2 sys wx01 fac

**TICK script:**
var fac_sys_elec_main_power_pm2_2_energy_kwh_measure_1h = batch
|query('''
SELECT value
FROM "flux_auc"."autogen"."li.base.v1.auc.fac"
WHERE "where" = 'wx01'
AND "where_type" = 'fac'
AND "what_type" = 'sys'
AND "what1" = 'elec'
AND "what2" = 'main_power'
AND "what3" = 'pm2_2'
AND "output" = 'energy_kwh'
AND "tool" = 'measure'
AND "time_step" = '1h'
''')
.period(1h)
.every(1h)
.offset(96h)
.align()

var fac_sys_elec_main_power_pm1_1_energy_kwh_measure_1h = batch
|query('''
SELECT value
FROM "flux_auc"."autogen"."li.base.v1.auc.fac"
WHERE "where" = 'wx01'
AND "where_type" = 'fac'
AND "what_type" = 'sys'
AND "what1" = 'elec'
AND "what2" = 'main_power'
AND "what3" = 'pm1_1'
AND "output" = 'energy_kwh'
AND "tool" = 'measure'
AND "time_step" = '1h'
''')
.period(1h)
.every(1h)
.offset(96h)
.align()

fac_sys_elec_main_power_pm2_2_energy_kwh_measure_1h
|join(fac_sys_elec_main_power_pm1_1_energy_kwh_measure_1h)
.tolerance(15m)
.as('v1', 'v2')
|eval(lambda: "v1.value" + "v2.value")
.as('value')
|influxDBOut()
.database('flux_auc')
.measurement('li.base.v1.auc.fac')
.......

**Problem:**
I know "query" use tMax as end point, so the above two query will get "2017-06-02T00:49:57Z 962.56 " as first data series , and "2017-06-02T01:00:00Z 249" as second data series. When join with tolerance of 15min, nothing output, only use tolerance larger than 1h (for example 61), there would get output, but that is not what I want. I want these tow point added and write out at timestamp about 01:00:00.
I guess tolerance will round timestamp and use tMin as start edge, not include 01:00:00, so the two timestamp not in one round, if so, I think let tolerance use tMax as end edge same as query will make sense.

Contributor guide

Open the contributing guide

Research direction

Start by locating the implementation and tests for the join node's tolerance handling, then compare its timestamp matching with the query and align behavior described in the issue. Reproduce the two timestamps with a 15-minute tolerance; done means the points are joined and emitted near 2017-06-02T01:00:00Z.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.