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

[CT-706] Consolidate data type methods in adapter interface #5317

Open
jtcohen6 opened this issue Jun 1, 2022 · 1 comment
Open

[CT-706] Consolidate data type methods in adapter interface #5317

jtcohen6 opened this issue Jun 1, 2022 · 1 comment
Labels
Team:Adapters Issues designated for the adapter area of the code tech_debt Behind-the-scenes changes, with little direct impact on end-user functionality utils Cross-database building blocks

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Jun 1, 2022

Placeholder ticket for further investigation down the line, prompted by larger initiative for moving dbt_utils functionality into dbt-core + plugins.

There are three ways we encode data types today, and make them available to users / adapter maintainers:

I'd like to see us reconcile and consolidate those data type definitions as much as possible:

  • One standard set of shared types, clearly enumerated — we sort of already have this in the form of agate types for seeds (text, number, boolean, datetime, date, time)
  • One single mapping function, translate_type, extensible/overridable for each adapter. This would translate between our standard types, and each database's type system.

As a first pass, I'm working to rewrite the dbt_utils.type_* macros to use Column.translate_type instead: dbt-labs/dbt-utils#598, dbt-labs/dbt-utils#586

@jtcohen6 jtcohen6 added tech_debt Behind-the-scenes changes, with little direct impact on end-user functionality Team:Adapters Issues designated for the adapter area of the code labels Jun 1, 2022
@github-actions github-actions bot changed the title Consolidate data type methods in adapter interface [CT-706] Consolidate data type methods in adapter interface Jun 1, 2022
@nathaniel-may
Copy link
Contributor

nathaniel-may commented Jun 8, 2022

This has the potential to be the building blocks of something much bigger. Why not translate function types as well to compose sql together? This is a good first step, but we could have a discussion on what the natural expansion of this looks like and see if it would be a good fit for a future adapter interface.

@jtcohen6 jtcohen6 added the utils Cross-database building blocks label Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Adapters Issues designated for the adapter area of the code tech_debt Behind-the-scenes changes, with little direct impact on end-user functionality utils Cross-database building blocks
Projects
None yet
Development

No branches or pull requests

2 participants