Skip to content

CREATE TABLE fails with NTILE window function select query  #7639

@matthewgapp

Description

@matthewgapp

Describe the bug

CREATE TABLE fails with a select query that contains a column derived from the NTILE window function

To Reproduce

in the sqllogictest directory, run this in the window.slt file

# this test fails 
# statement ok
CREATE TABLE ntile_table as SELECT NTILE(8) OVER (ORDER BY c4) as ntile_1, NTILE(12) OVER (ORDER BY c12 DESC) AS ntile_2 FROM aggregate_test_100 LIMIT 10

# this test passes 
statement ok
SELECT NTILE(8) OVER (ORDER BY c4) as ntile_1, NTILE(12) OVER (ORDER BY c12 DESC) AS ntile_2 FROM aggregate_test_100 LIMIT 10

Note that the query (select statement) succeeds while the create table ddl version does not.

Expected behavior

The table is successfully created using the DDL. Create table DDL should be compatible with all queries, including queries that contain an NTILE window function.

Additional context

I found this while writing tests for #7638.

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