-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
accepted_values test doesn't work in all database engines #3905
Comments
@sdebruyn Thanks for opening! The best solution for this is dispatch, which allows database plugins to reimplement macros (such as That said, I agree that we should work toward ANSI SQL support for the |
I faced with a same issue with ClickHouse, so I checked some DBMS for "group by" syntax: create table sample_table (
sample_column int
);
select
sample_column as value_field,
count(*) as n_records
from sample_table
group by 1;
As you see, |
Describe the bug
The
accepted_values
test produces SQL withgroup by 1
. The group by index syntax is not ANSI SQL and not supported in all database engines. This should be avoided in shared code like tests.Steps To Reproduce
Put an
accepted_values
test in your code and connect to a MS SQL database.Expected behavior
Test checks for the values.
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using: macOS
The output of
python --version
: Python 3.9.7The text was updated successfully, but these errors were encountered: