Skip to content
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

lookup schemas in a case-insensitive way #1411

Closed
drewbanin opened this issue Apr 24, 2019 · 1 comment
Closed

lookup schemas in a case-insensitive way #1411

drewbanin opened this issue Apr 24, 2019 · 1 comment
Assignees
Labels
bug Something isn't working snowflake

Comments

@drewbanin
Copy link
Contributor

Issue

Issue description

Snowflake information schema queries should be case-insensitive, but the Snowflake plugin does not override the default implementation of list_schemas which is case-sensitive.

We should either change the default implementation of list_schemas to be case-insensitive, or we should override the Snowflake implementation to do a case-insensitive lookup. Let's also scan for other case-sensitive default implementations that aren't overridden by the Snowflake plugin.

Results

Given schema: my_schema in profiles.yml, dbt furnishes the following list_schemas query on Snowflake:

select distinct schema_name
    from dw_dev.information_schema.schemata
    where catalog_name = 'my_schema'

dbt uses this query to determine which schemas already exist, circumventing a create schema if not exists ... query. This issue probably only manifests in an error if the dbt user does not have permissions to create a new schema.

System information

The output of dbt --version:

0.13.0
@drewbanin drewbanin added bug Something isn't working snowflake labels Apr 24, 2019
@drewbanin drewbanin added this to the 0.13.1 - bugfix release milestone Apr 24, 2019
@beckjake beckjake self-assigned this Apr 24, 2019
beckjake added a commit that referenced this issue Apr 24, 2019
…-schemas

use ilike instead of = for database when listing schemas (#1411)
@beckjake
Copy link
Contributor

Fixed in #1412

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working snowflake
Projects
None yet
Development

No branches or pull requests

2 participants