Skip to content

docs: document TQL CTE support in CREATE FLOW#2405

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/update-docs-flow-tql-cte
Closed

docs: document TQL CTE support in CREATE FLOW#2405
Copilot wants to merge 1 commit intomainfrom
copilot/update-docs-flow-tql-cte

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

Documents the new TQL CTE pattern for CREATE FLOW introduced in GreptimeTeam/greptimedb#7702, which allows wrapping TQL EVAL in a CTE for cleaner flow definitions and stable output column names.

What's Changed in this PR

  • docs/user-guide/flow-computation/continuous-aggregation.md — Added "Wrapping TQL with a CTE" section covering syntax, use case (column renaming before sink table schema inference), and supported shape restrictions
  • docs/reference/sql/create.md — Extended CREATE FLOW section with the TQL CTE form and its strict shape requirements
  • docs/user-guide/query-data/cte.md — Added key point noting that TQL CTEs in CREATE FLOW only support the simplest form (single CTE + SELECT *)
  • All changes mirrored in i18n/zh/ (Chinese) and versioned_docs/version-1.0/

The supported syntax:

CREATE FLOW calc_rate_cte
SINK TO rate_reqs_cte
EVAL INTERVAL '1m' AS
WITH rate_data (ts, req_rate, host, job, instance) AS (
    TQL EVAL (now() - '1m'::interval, now(), '30s')
    rate(http_requests_total{job="my_service"}[1m])
    AS req_rate
)
SELECT * FROM rate_data;

Restrictions: exactly one TQL CTE, outer query must be SELECT * FROM <cte-name>, no WHERE/joins/projections/extra CTEs. Quoted CTE names must be referenced consistently.

Checklist

  • Please confirm that all corresponding versions of the documents have been revised.
  • Please ensure that the content in sidebars.ts matches the current document structure when you changed the document structure.
  • This change requires follow-up update in localized docs.

Copilot AI linked an issue Apr 9, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Update documentation for feat: flow tql cte docs: document TQL CTE support in CREATE FLOW Apr 9, 2026
Copilot AI requested a review from fengjiachun April 9, 2026 21:15
@fengjiachun fengjiachun requested a review from discord9 April 19, 2026 15:30
Copy link
Copy Markdown
Contributor

@discord9 discord9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if diff is actually added then LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update docs for feat: flow tql cte

3 participants