ClickHouse/tests/queries/0_stateless/02366_kql_create_table.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
1.3 KiB
MySQL
Raw Normal View History

DROP TABLE IF EXISTS Customers;
CREATE TABLE Customers
2024-06-17 03:12:45 +00:00
(
FirstName Nullable(String),
2024-06-17 03:12:45 +00:00
LastName String,
Occupation String,
Education String,
Age Nullable(UInt8)
) ENGINE = Memory;
INSERT INTO Customers VALUES ('Theodore','Diaz','Skilled Manual','Bachelors',28),('Stephanie','Cox','Management abcd defg','Bachelors',33),('Peter','Nara','Skilled Manual','Graduate Degree',26),('Latoya','Shen','Professional','Graduate Degree',25),('Apple','','Skilled Manual','Bachelors',28),(NULL,'why','Professional','Partial College',38);
Select '-- test create table --' ;
2024-06-17 03:12:45 +00:00
Select * from kql($$Customers|project FirstName$$) limit 1;;
DROP TABLE IF EXISTS kql_table1;
2024-06-17 03:12:45 +00:00
CREATE TABLE kql_table1 ENGINE = Memory AS select *, now() as new_column From kql($$Customers | project LastName | filter LastName=='Diaz'$$);
select LastName from kql_table1 limit 1;
DROP TABLE IF EXISTS kql_table2;
CREATE TABLE kql_table2
2024-06-17 03:12:45 +00:00
(
FirstName Nullable(String),
2024-06-17 03:12:45 +00:00
LastName String,
Age Nullable(UInt8)
) ENGINE = Memory;
2024-06-17 03:12:45 +00:00
INSERT INTO kql_table2 select * from kql($$Customers|project FirstName,LastName,Age | filter FirstName=='Theodore'$$);
select * from kql_table2 limit 1;
2024-06-17 03:12:45 +00:00
-- select * from kql($$Customers | where FirstName !in ("test", "test2")$$);
DROP TABLE IF EXISTS Customers;
DROP TABLE IF EXISTS kql_table1;
2024-06-17 03:12:45 +00:00
DROP TABLE IF EXISTS kql_table2;