SNOW-3259059: Avoid server-side bug by using CHR(34) instead of lit('"') in concat#4139
SNOW-3259059: Avoid server-side bug by using CHR(34) instead of lit('"') in concat#4139sfc-gh-helmeleegy merged 2 commits intomainfrom
Conversation
53a529c to
cb0def0
Compare
sfc-gh-joshi
left a comment
There was a problem hiding this comment.
@sfc-gh-helmeleegy Do you know what exactly the root cause of the bug here is, and why this workaround is valid? The linked JIRA isn't very clear about it.
Is the bug also present if the concatenated literal has more than just the single double-quote character, like concat(lit('""""xxxxx'), "column")?
src/snowflake/snowpark/functions.py
Outdated
| columns = [_to_col_if_str(c, "concat") for c in cols] | ||
| columns = [ | ||
| _rewrite_concat_arg_if_double_quote_string_literal(c, _emit_ast=_emit_ast) | ||
| for c in columns | ||
| ] |
There was a problem hiding this comment.
Should we combine these into a single list comprehension?
The exact root cause on the server side is not clear (to us at least). I'm trying to work with the SQL's team oncall to understand when a mitigation is expected from their side. This PR is meant to unblock the customer using a client-side fix to the issue they faced. |
sfc-gh-mayliu
left a comment
There was a problem hiding this comment.
LGTM, thanks for fixing this
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-3259059
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Fix a Snowflake platform compatibility issue (SNOW-3259059) where
concat(lit('"'), ...)could lose the leading quote through someEXCEPT/ chained set-operation plans by lowering that literal toCHR(34)in generated SQL.