Skip to content

Conversation

@jmkacz
Copy link
Contributor

@jmkacz jmkacz commented Oct 25, 2024

Support more dbt contract data types (Snowflake)

- Move `column_to_dimension_types` to a constant, at the top of the file, TYPE_MAPPINGS.
- Normalize data types coming from dbt contracts by:
  - Downcasing
  - Remove extra type detail, contained in parentheses (ex. "timestamp(3)" => "timestamp")
- After looking up the type mapping, compare the target type against the short list of supported dimension types in cube.
- Support all data types in Snowflake and make a best effort of mapping them.
- I assume the bool => boolean mapping comes from a BigQuery data type, so moved that into its own constant.

Support more dbt contract data types (BigQuery)

- Since we started BIGQUERY_TYPE_MAPPINGS, let's add the rest of the BigQuery types to the map.
- Enhance normalizing data types coming from dbt contracts by:
  - Remove extra type detail, contained in angle brackets (ex. "array<struct<array<int64>>>" => "array")

Support more dbt contract data types (Redshift)

- Since we've added support for Snowflake and BigQuery, let's wrap this up by adding support for data types from the other major data warehouse, Redshift.

- Move `column_to_dimension_types` to a constant, at the top of the file, TYPE_MAPPINGS.
- Normalize data types coming from dbt contracts by:
  - Downcasing
  - Remove extra type detail, contained in parentheses (ex. "timestamp(3)" => "timestamp")
- After looking up the type mapping, compare the target type against the short list of supported dimension types in cube.
- Support all data types in Snowflake and make a best effort of mapping them.
- I assume the bool => boolean mapping comes from a BigQuery data type, so moved that into its own constant.
- Since we started BIGQUERY_TYPE_MAPPINGS, let's add the rest of the BigQuery types to the map.
- Enhance normalizing data types coming from dbt contracts by:
  - Remove extra type detail, contained in angle brackets (ex. "array<struct<array<int64>>>" => "array")
- Since we've added support for Snowflake and BigQuery, let's wrap this up by adding support for data types from the other major data warehouse, Redshift
@igorlukanin igorlukanin merged commit 75aaba4 into cube-js:main Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants