You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Yury Gerzhedovich (Jira)" <ji...@apache.org> on 2023/05/08 12:03:00 UTC

[jira] [Updated] (IGNITE-19352) Sql. Create table from query result

     [ https://issues.apache.org/jira/browse/IGNITE-19352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yury Gerzhedovich updated IGNITE-19352:
---------------------------------------
    Summary: Sql. Create table from query result  (was: Create table from query result)

> Sql. Create table from query result
> -----------------------------------
>
>                 Key: IGNITE-19352
>                 URL: https://issues.apache.org/jira/browse/IGNITE-19352
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>    Affects Versions: 3.0.0-beta1
>            Reporter: Andrey Khitrin
>            Priority: Major
>              Labels: ignite-3, sql
>
> 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)