[CT-1701] [CT-1700] [Bug] escape_single_quotes
is not correct for Spark/Databricks
#572
Closed
2 tasks done
Labels
Is this a new bug in dbt-core?
Current Behavior
Currently,
escape_single_quotes()
is dispatched to{{ expression | replace("'","''") }}
for all adapters.In Spark and Databricks single quotes need to be escaped with
\\'
(see here) instead of''
.We fixed the behavior in dbt_project_evaluator but it should most likely be fixed in Core.
Expected Behavior
Single quotes are correctly escaped in Spark/Databricks
Steps To Reproduce
Use
{{ dbt.escape_single_quotes("ab'c") }}
in Spark/Databricks. The result isabc
instead ofab'c
Relevant log output
No response
Environment
No response
Which database adapter are you using with dbt?
spark
Additional Context
No response
The text was updated successfully, but these errors were encountered: