z3z1ma / dbt-osmosis

Provides automated YAML management, a dbt server, streamlit workbench, and git-integrated dbt model output diff tools
https://z3z1ma.github.io/dbt-osmosis/
Apache License 2.0
422 stars 45 forks source link

Fuzzy matching on column name (from CamelCase to snake_case) #79

Closed syou6162 closed 10 months ago

syou6162 commented 10 months ago

Partially resolve https://github.com/z3z1ma/dbt-osmosis/issues/66 FYI @awoehrl.

We often rename column names from camelCase to snake_case and it would be really helpful if dbt-osmosis could inherit column renaming like this

SELECT
  priceType AS price_type,
  countryName AS country_name,
 ...
FROM
  table_name
syou6162 commented 10 months ago

@z3z1ma Could you review this pull request?

alex-harness commented 10 months ago

LGTM

I think the other most common thing is a prefix

SELECT
  priceType AS order_price_type,
  countryName AS order_country_name,
 ...
FROM
  orders

Not part of this scope but if we could grab a "prefix" pattern from a model meta attribute, it would probably allow even more DRY documentation.

syou6162 commented 10 months ago

@alex-harness @z3z1ma Thank you merge! And it would be great if you could release a new version (v0.11.23?)!