You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support CREATE TABLE table_name(...schema_fields) #4396
Describe the solution you'd like
Support the CREATE TABLE expression, e.g. CREATE TABLE t1(a INTEGER, b INTEGER, c INTEGER, d INTEGER, e INTEGER);
Executing this with datafusion-cli shows:
DataFusion CLI v14.0.0
❯ CREATE TABLE t1(a INTEGER, b INTEGER, c INTEGER, d INTEGER, e INTEGER);
NotImplemented("Only `CREATE TABLE table_name AS SELECT ...` statement is supported")
Additional context
The ability to create a table with one statement and then insert values into it throughout a sessions forms the basis of a lot of sqllogictests we want to incorporate into testing. See #4248
An example of a set of queries we'd like to execute are:
statement ok
CREATETABLEt1(a INTEGER, b INTEGER, c INTEGER, d INTEGER, e INTEGER)
statement ok
INSERT INTO t1(e,c,b,d,a) VALUES(103,102,100,101,104)
statement ok
INSERT INTO t1(a,c,d,e,b) VALUES(107,106,108,109,105)
...
statement ok
INSERT INTO t1(e,c,a,d,b) VALUES(177,176,179,178,175)
statement ok
INSERT INTO t1(b,e,a,d,c) VALUES(181,180,182,183,184)
statement ok
INSERT INTO t1(c,a,b,e,d) VALUES(187,188,186,189,185)
statement ok
INSERT INTO
statement ok
INSERT INTO t1(e,c,b,a,d) VALUES(242,244,240,243,241)
statement ok
INSERT INTO t1(e,d,c,b,a) VALUES(246,248,247,249,245)
query I nosort
SELECT CASE WHEN c>(SELECTavg(c) FROM t1) THEN a*2 ELSE b*10 END
FROM t1
ORDER BY1----30values hashing to 3c13dee48d9356ae19af2515e05e6b54
Activity
mvanschellebeeck commentedon Nov 27, 2022
An example of a set of queries we'd like to execute are:
see here for reference
Currently this is not possible since the
CREATE TABLEexpression is not supported.xudong963 commentedon Dec 2, 2022
I'll do it (maybe on the weekend)
melgenek commentedon Jan 22, 2023
@xudong963 Hi! I see that the ticket is assigned to you, but I gave it a shot. I hope it's alright 🙂 . Here is the pr #5026.