You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Andrey Khitrin (Jira)" <ji...@apache.org> on 2023/04/24 11:32:00 UTC
[jira] [Created] (IGNITE-19352) Create table from query result
Andrey Khitrin created IGNITE-19352:
---------------------------------------
Summary: Create table from query result
Key: IGNITE-19352
URL: https://issues.apache.org/jira/browse/IGNITE-19352
Project: Ignite
Issue Type: Improvement
Components: sql
Reporter: Andrey Khitrin
Like in IGNITE-14555 for AI2, it would be useful to create tables from the result of the query:
{code:sql}
CREATE TABLE <name> AS <SELECT QUERY>
{code}
In the AI3 beta1 and current `main` it's not possible:
{code:sql}
sql-cli> create table xx (key_field INT PRIMARY KEY, field1 INT);
Updated 0 rows.
sql-cli> insert into xx values (1, 1);
Updated 1 rows.
sql-cli> insert into xx values (2, 10);
Updated 1 rows.
sql-cli> create table xy as select key_field, field1 from xx where field1 < 5;
SQL query execution error
Exception while executing query [query=create table xy as select key_field, field1 from xx where field1 < 5;]. Error message:IGN-SQL-3 TraceId:ff6bc711-14e5-42ab-b80c-5515a8b77c7c Failed to parse query: Encountered " "AS" "as "" at line 1, column 17.
Was expecting:
"(" ...
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)