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 create table as/like query #2457

Closed
Tracked by #3428
sundy-li opened this issue Oct 26, 2021 · 3 comments · Fixed by #3292 or #3400
Closed
Tracked by #3428

Support create table as/like query #2457

sundy-li opened this issue Oct 26, 2021 · 3 comments · Fixed by #3292 or #3400
Assignees
Labels
A-query Area: databend query community-take

Comments

@sundy-li
Copy link
Member

sundy-li commented Oct 26, 2021

Summary

mysql> create table test_b like test_a ;
ERROR 1105 (HY000): Code: 1002, displayText = sql parser error: Expected end of statement, found: like.
mysql>  create table (number UInt64) as select number from numbers(100);
ERROR 1105 (HY000): Code: 1002, displayText = sql parser error: Expected identifier, found: (.

Refer: https://dev.mysql.com/doc/refman/8.0/en/create-table-like.html

@sundy-li sundy-li added the A-query Area: databend query label Oct 26, 2021
@sundy-li sundy-li changed the title Support create table as query Support create table as/like query Oct 26, 2021
@junli1026
Copy link
Contributor

/assignme

@sundy-li
Copy link
Member Author

sundy-li commented Dec 8, 2021

@junli1026 seems create table as is not finished, would u want to continue?

@junli1026
Copy link
Contributor

junli1026 commented Dec 9, 2021

@junli1026 seems create table as is not finished, would u want to continue?

Sure. If I understand correctly, different from "CREATE LIKE" , the query 'CREATE TABLE t1 as SELECT * FROM t2' also copy data from t2 to t1. It does more than creating table.

Will keep working on that. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query Area: databend query community-take
Projects
None yet
4 participants