You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2023/09/28 03:51:00 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #43152: [SPARK-45361][SQL][DOCS] Describe characters unescaping in string literals

cloud-fan commented on code in PR #43152:
URL: https://github.com/apache/spark/pull/43152#discussion_r1339486747


##########
docs/sql-ref-literals.md:
##########
@@ -51,6 +51,20 @@ A string literal is used to specify a character string value.
 
     Case insensitive, indicates `RAW`. If a string literal starts with `r` prefix, neither special characters nor unicode characters are escaped by `\`.
 
+The following escape sequences are recognized in regular string literals (without the `r` prefix), and replaced according to the following rules:
+- `\0` -> `\u0000`, unicode character with the code 0;
+- `\'` -> `'`, skip the slash before `'`;
+- `\"` -> `"`, skip the slash before `"`;

Review Comment:
   How is this different from ``` `\<other char>` -> `<other char>` ```? I think the key difference is, here the escaping happens, while `\<other char>` is kind of a fallback for invalid escaping. Shall we make this clearer?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org