diff --git a/models/stg_marketo__lead_describe.sql b/models/stg_marketo__lead_describe.sql index 44be656..0bcf8e1 100644 --- a/models/stg_marketo__lead_describe.sql +++ b/models/stg_marketo__lead_describe.sql @@ -16,7 +16,17 @@ with base as ( soapread_only as is_soap_readonly from base +), regex as ( + + select + *, + case + when rest_name like '%\\_\\_c%' then lower(rest_name) + else ltrim(lower(regexp_replace(rest_name, "[A-Z]",'_\\0')),'_') + end as rest_name_xf + from fields + ) select * -from fields \ No newline at end of file +from regex \ No newline at end of file