Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support common table expression (CTE) #17472

Closed
zz-jason opened this issue May 28, 2020 · 6 comments · Fixed by #34574 or #36352
Closed

support common table expression (CTE) #17472

zz-jason opened this issue May 28, 2020 · 6 comments · Fixed by #34574 or #36352
Assignees
Labels
feature/accepted This feature request is accepted by product managers Priority/P1 Features that will be implemented in the latest or next major/minor version sig/execution SIG execution type/feature-request This is a feature requests on the product

Comments

@zz-jason
Copy link
Member

zz-jason commented May 28, 2020

Description

Is your feature request related to a problem? Please describe:

Related issues:

Describe the feature you'd like:

Support the common table expression feature like MySQL 13.2.15 WITH (Common Table Expressions):

A common table expression (CTE) is a named temporary result set that exists within the scope of a single statement and that can be referred to later within that statement, possibly multiple times. The following discussion describes how to write statements that use CTEs.

There are two kinds of CTEs:

  • non-recursive CTE
  • recursive CTE

A typical query example of non-recursive CTE:

WITH
  cte1 AS (SELECT a, b FROM table1),
  cte2 AS (SELECT c, d FROM table2)
SELECT b, d FROM cte1 JOIN cte2
WHERE cte1.a = cte2.c;

A typical query example of recursive CTE:

WITH RECURSIVE cte (n) AS
(
  SELECT 1
  UNION ALL
  SELECT n + 1 FROM cte WHERE n < 5
)
SELECT * FROM cte;
@zz-jason zz-jason added sig/execution SIG execution type/feature-request This is a feature requests on the product labels May 28, 2020
@github-actions github-actions bot added this to Issue Backlog: Need Triage in SIG Runtime Kanban May 28, 2020
@github-actions github-actions bot added this to Need Triage in Feature Request Kanban May 28, 2020
@scsldb scsldb added the Priority/P1 Features that will be implemented in the latest or next major/minor version label Jun 12, 2020
@scsldb scsldb added this to the v5.0-alpha.1 milestone Jun 12, 2020
@pingyu
Copy link
Contributor

pingyu commented Jun 16, 2020

Let me try...

@pingyu
Copy link
Contributor

pingyu commented Jun 17, 2020

Find these:

@SunRunAway SunRunAway added this to Backlogs in Longterm P0 Backlog Kanban via automation Jul 2, 2020
@SunRunAway SunRunAway moved this from Backlogs to Design in Longterm P0 Backlog Kanban Jul 2, 2020
@SunRunAway SunRunAway changed the title support common table expression support common table expression (CTE) Jul 5, 2020
@SunRunAway SunRunAway removed this from Design in Longterm P0 Backlog Kanban Jul 5, 2020
@zz-jason zz-jason moved this from Need Triage to Requirement: Scheduled in Feature Request Kanban Jul 9, 2020
@scsldb scsldb modified the milestones: v5.0.0-alpha.1, pools Jul 15, 2020
@ghost ghost mentioned this issue Jul 23, 2020
@scsldb scsldb moved this from Accepted: Priority/P0 to Accepted: Priority/P1 in Feature Request Kanban Jul 29, 2020
@scsldb scsldb moved this from Accepted: Priority/P1 to Accepted: Priority/P0 in Feature Request Kanban Jul 29, 2020
@zz-jason zz-jason added the feature/accepted This feature request is accepted by product managers label Jul 29, 2020
@ghost ghost mentioned this issue Sep 10, 2020
69 tasks
@wjhuang2016 wjhuang2016 added this to To do in CTE(common table expression) via automation Apr 19, 2021
@wjhuang2016 wjhuang2016 moved this from To do to Trace issue in CTE(common table expression) Apr 19, 2021
@tisonkun
Copy link
Contributor

tisonkun commented Apr 22, 2021

Here is the link to weekly report of CTE development: https://docs.google.com/document/d/1b-nL0c2akLL03ZhXXcQT6tj_tqQMmfAE8oKSfcaaDqE

@morgo
Copy link
Contributor

morgo commented Jun 11, 2021

@wjhuang2016 should we close this issue now since CTEs are in master?

@tisonkun
Copy link
Contributor

tisonkun commented Jun 11, 2021

@wjhuang2016 should we close this issue now since CTEs are in master?

A feature implemented without design doc #24147 merged 😂

@wjhuang2016
Copy link
Member

The design doc is merged. So I close it now.

SIG Runtime Kanban automation moved this from Issue Backlog: Need Triage to Develop Finished (This Week) Jun 16, 2021
Feature Request Kanban automation moved this from Accepted to Finished Jun 16, 2021
ti-chi-bot pushed a commit that referenced this issue Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/accepted This feature request is accepted by product managers Priority/P1 Features that will be implemented in the latest or next major/minor version sig/execution SIG execution type/feature-request This is a feature requests on the product
Projects
SIG Runtime Kanban
  
Develop Finished (This Week)
6 participants