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

Mp/attempt to patch snowflake types #851

Merged
merged 6 commits into from
Mar 3, 2025

Conversation

VersusFacit
Copy link
Contributor

@VersusFacit VersusFacit commented Feb 26, 2025

resolves #310
docs issue

Problem

If a given column is a complex ARRAY type such as ARRAY(VARCHAR(16777216)), the macro get_columns_in_relation raises an error.

In the SnowflakeColumn class, we're restricting things artificially by trying to parsing this among other simple types as a LABEL(NUMERIC) type.

Solution

Structured types are more generic and require overrides not to go through this parsing song and dance.

We can override at the Snowflake level to avoid disruption the Base Adapter and other adapters which have different type names.

Alternative Considered

I thought about doing more sophisticated parsing here into these types' subtypes. But, this presents a major problem. In particular, we'd be building a Snowflake compliant AST for not much value to the user. Instead, we trust users to employ these types in their columns and that Snowflake will flag any subtyping problems in an intelligent way.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@cla-bot cla-bot bot added the cla:yes The PR author has signed the CLA label Feb 26, 2025
@VersusFacit VersusFacit force-pushed the mp/attempt_to_patch_snowflake_types branch from 2029e21 to 476e755 Compare February 26, 2025 14:46
@VersusFacit VersusFacit self-assigned this Feb 26, 2025
@VersusFacit VersusFacit merged commit d562dd2 into main Mar 3, 2025
19 checks passed
@VersusFacit VersusFacit deleted the mp/attempt_to_patch_snowflake_types branch March 3, 2025 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes The PR author has signed the CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Support complex Array data types for macro get_columns_in_relation
2 participants