influxdata / influxdata/kapacitor

Support subquery inside tick script

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

Description

InfluxDB 1.2 supports subqueries, but when trying to define a tick script of type batch with subqueries, we get an error.
The query we run:
`SELECT COUNT(DISTINCT(last)) FROM (SELECT LAST("version")  FROM "dbname"."autogen".measurement where time > now() - 120h GROUP BY "host") group by cluster`
The error:

> failed to parse InfluxQL query: found (, expected identifier at line 1, char 35

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported batch tick-script query and its InfluxQL parse error, then trace the tick script query-parsing entry point. Compare parsing of the outer query with the nested SELECT and verify that the supplied subquery is accepted without regressing existing query handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.