Looks like the current approach to adding a limit to queries doesn't work if the user adds distinct to their model, example
with
source as (
select * from "raw_emails"
),
renamed as (
select
id as email_id,
email,
email_top_level_domain
from source
)
select distinct * from renamed order by (select null)
offset 0 rows fetch first 1 rows only
Error:
('42000', '[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]ORDER BY items must appear in the select list if SELECT DISTINCT is specified. (145) (SQLExecDirectW)')
We might be able to get around this by wrapping in a subquery
Looks like the current approach to adding a limit to queries doesn't work if the user adds
distinct
to their model, exampleError:
('42000', '[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]ORDER BY items must appear in the select list if SELECT DISTINCT is specified. (145) (SQLExecDirectW)')
We might be able to get around this by wrapping in a subquery