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

Fix for syntax error in compiled SQL from sfdc_formula_view_sql macro... #92

Conversation

corca
Copy link
Contributor

@corca corca commented Jun 30, 2023

Fixes syntax issue in the compiled SQL from the sfdc_formula_view_sql macro when using Databricks.

Please provide your name and company
Andrew Corcoran - West Shore Home

Link the issue/feature request which this PR is meant to address
#91

Detail what changes this PR introduces and how this addresses the issue/feature request linked above.
When using the package with Databricks, the sfdc_formula_view_sql macro now uses the same replace filter for `fivetran_formula` as BigQuery, since the backtick syntax returned from the source() function is the same.

Before:

select main__table.id, ( opportunity__alias.secondary_campaign_c ) as secondary_campaign_c 
from `fivetran`.`salesforce`.``service_appointment as main__table 
left join `fivetran`.`salesforce`.``opportunity as opportunity__alias on main__table.opportunity_c = opportunity__alias.id

After:

select main__table.id, ( opportunity__alias.secondary_campaign_c ) as secondary_campaign_c 
from `fivetran`.`salesforce`.service_appointment as main__table 
left join `fivetran`.`salesforce`.opportunity as opportunity__alias on main__table.opportunity_c = opportunity__alias.id

How did you validate the changes introduced within this PR?
Local testing with dbt compile, Databricks warehouse testing with dbt run

Which warehouse did you use to develop these changes?
Databricks

Did you update the CHANGELOG?

  • Yes

Did you update the dbt_project.yml files with the version upgrade (please leverage standard semantic versioning)? (In both your main project and integration_tests)

  • Yes

Provide an emoji that best describes your current mood
🔨

…. When using Databricks, the macro should use the same replace filter as BigQuery since the backtick syntax is the same.
@fivetran-reneeli fivetran-reneeli changed the base branch from main to bugfix/compilation_error July 18, 2023 20:42
@fivetran-reneeli fivetran-reneeli merged commit 4d896b3 into fivetran:bugfix/compilation_error Jul 18, 2023
@fivetran-reneeli
Copy link
Contributor

Hi @corca! Thank you for opening and contributing this PR! We've merged this into our current PR that we are working off of. Expect this to be released within the next week!

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.

None yet

2 participants