Skip to content

Not implemented SELECT INTO #5943

@r4ntix

Description

@r4ntix

Describe the bug

Currently we do not support SELECT INTO, but the SQL does not report errors and does not execute correctly:

select table_catalog, table_schema into test from information_schema.tables;
+---------------+--------------------+
| table_catalog | table_schema       |
+---------------+--------------------+
| datafusion    | information_schema |
| datafusion    | information_schema |
| datafusion    | information_schema |
| datafusion    | information_schema |
+---------------+--------------------+
4 rows in set. Query took 0.002 seconds.

❯ explain select table_catalog, table_schema into test from information_schema.tables;
+---------------+-------------------------------------------------------------------------------+
| plan_type     | plan                                                                          |
+---------------+-------------------------------------------------------------------------------+
| logical_plan  | TableScan: information_schema.tables projection=[table_catalog, table_schema] |
| physical_plan | ExecutionPlan(PlaceHolder)                                                    |
|               |                                                                               |
+---------------+-------------------------------------------------------------------------------+
2 rows in set. Query took 0.003 seconds.

❯ show tables;
+---------------+--------------------+-------------+------------+
| table_catalog | table_schema       | table_name  | table_type |
+---------------+--------------------+-------------+------------+
| datafusion    | information_schema | tables      | VIEW       |
| datafusion    | information_schema | views       | VIEW       |
| datafusion    | information_schema | columns     | VIEW       |
| datafusion    | information_schema | df_settings | VIEW       |
+---------------+--------------------+-------------+------------+
4 rows in set. Query took 0.002 seconds.

To Reproduce

👆

Expected behavior

No response

Additional context

If we don't support it now, the SQL execution can return NotImplemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions