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.
Describe the bug
CREATE TABLEfails with a select query that contains a column derived from theNTILEwindow functionTo Reproduce
in the sqllogictest directory, run this in the window.slt file
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.