Skip to content

SELECT INTO with ORDER BY or LIMIT  #6440

@berkaysynnada

Description

@berkaysynnada

Describe the bug

SELECT * INTO new_table FROM my_table While this query works properly,
SELECT * INTO new_table FROM my_table LIMIT 5 and SELECT * INTO new_table FROM my_table ORDER BY c1 queries give an error as: External error: statement failed: DataFusion error: This feature is not implemented: Unsupported logical plan: CreateMemoryTable.

To Reproduce

statement ok
CREATE TABLE my_table(c1 int, c2 float, c3 varchar) AS VALUES(1, 2, 'hello')
statement ok
SELECT * INTO new_table FROM my_table LIMIT 5

Expected behavior

SELECT * INTO new_table FROM my_table LIMIT 5 gives the same result as CREATE TABLE new_table AS SELECT * FROM my_table LIMIT 5 (and for ORDER BY cases).

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions