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 CTEs (WITH statement) #289

Closed
tlightsky opened this issue Apr 15, 2019 · 10 comments
Closed

Support CTEs (WITH statement) #289

tlightsky opened this issue Apr 15, 2019 · 10 comments
Labels
type/enhancement New feature or request

Comments

@tlightsky
Copy link

tlightsky commented Apr 15, 2019

Feature Request

any plan to support with clause from SQL:1999 and supported by MySQL 8.0

https://dev.mysql.com/doc/refman/8.0/en/with.html#common-table-expressions-syntax

@morgo morgo added the type/enhancement New feature or request label Apr 15, 2019
@morgo morgo changed the title Support With Clause Support CTEs (WITH statement) Apr 15, 2019
@morgo
Copy link
Contributor

morgo commented Apr 15, 2019

@tlightsky Thank you for the feature request. CTEs are currently on the roadmap.

@tlightsky
Copy link
Author

@morgo thanks for reply
need this feature recently,
maybe i can make a pr when i finish it,
is there any hint that i can add it quickly?
(maybe just point out where i should make changes)

@tlightsky
Copy link
Author

i have do some work about adding CTEs (WITH statement),
need some help to fix failed tests

@zz-jason
Copy link
Member

@tlightsky Common Table Expression is a huge feature, we need a detailed discuss and design document about it.

@zz-jason
Copy link
Member

I've created a github project to trace the progress: https://github.com/pingcap/tidb/projects/21

@tlightsky
Copy link
Author

@zz-jason
thanks for response,

Currently, my plan is to parse it to ast tree(without recursive),
then expand those CTEs to form a SQL without WITH Statement,
so i can use WITH Statement in platforms like MySQL 5.7, Clickhouse

Also noticed OceanBase support non-recursive CTEs by only expanding them too,
would be nice to have CTEs support in TiDB even only just expand those subqueries

@kyleconroy
Copy link

Is this still on the roadmap? I don't need CTE support in TiDB, just in the parser.

@kennytm
Copy link
Contributor

kennytm commented Sep 9, 2020

yes, compatibility with mysql 8 is always desirable.

(you may also want to follow pingcap/tidb#17472 for the overall roadmap of CTE support in TiDB, which drives the parser implementation.)

@zz-jason
Copy link
Member

zz-jason commented Sep 9, 2020

Is this still on the roadmap? I don't need CTE support in TiDB, just in the parser.

@kyleconroy Oh, seems you are using this parser as a library in a project. May I know your use scenarios?

@wjhuang2016
Copy link
Member

Supported by #1207
/cc @tlightsky @kyleconroy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants