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

SNOW-919236: sqlExpr() retains double quotes, leading to SQL compilation errors #53

Open
sfc-gh-jfreeberg opened this issue Sep 20, 2023 · 0 comments

Comments

@sfc-gh-jfreeberg
Copy link
Collaborator

sfc-gh-jfreeberg commented Sep 20, 2023

From Phani on Slack:

Example:

.withColumn("subscriptionDetails",object_construct(lit("subscriptionCurrentState"),  sqlExpr("subscriptionDetails_json:subscriptionmode")
, lit("subscriptionType"), sqlExpr("subscriptionDetails_json:subscriptiontype")
, lit("gracePeriodInd"), sqlExpr("subscriptionDetails_json:graceperiodind")
, lit("subscriptionOfferId"), sqlExpr("subscriptionDetails_json:subscriptionofferid")
, lit("subscriptionOfferType"), sqlExpr("subscriptionDetails_json:offermechanic")
,lit("campaignName"), sqlExpr("subscriptionDetails_json:campaignname"))) 

Generated SQL:

object_construct('subscriptionCurrentState', "subscriptionDetails_json:subscriptionmode", 'subscriptionType',
 "subscriptionDetails_json:subscriptiontype", 'gracePeriodInd', "subscriptionDetails_json:graceperiodind",
 'subscriptionOfferId', "subscriptionDetails_json:subscriptionofferid", 'subscriptionOfferType',
 "subscriptionDetails_json:offermechanic", 'campaignName', "subscriptionDetails_json:campaignname") 
 AS "SUBSCRIPTIONDETAILS"

The generated SQL has the double quotes, which fails on the compiler.

@github-actions github-actions bot changed the title sqlExpr() retains double quotes, leading to SQL compilation errors SNOW-919236: sqlExpr() retains double quotes, leading to SQL compilation errors Sep 20, 2023
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

No branches or pull requests

1 participant