You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2023/09/27 14:39:01 UTC

[GitHub] [spark] MaxGekk opened a new pull request, #43152: [WIP][SQL][DOCS] Document characters unescaping in string literals

MaxGekk opened a new pull request, #43152:
URL: https://github.com/apache/spark/pull/43152

   ### What changes were proposed in this pull request?
   TODO
   
   ### Why are the changes needed?
   TODO
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   By building docs.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No.


-- 
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


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

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
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


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

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on code in PR #43152:
URL: https://github.com/apache/spark/pull/43152#discussion_r1340216443


##########
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:
   I think we can remove this cases because they duplicate the default case. In the PR, I removed them: https://github.com/apache/spark/pull/43170



-- 
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


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

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on code in PR #43152:
URL: https://github.com/apache/spark/pull/43152#discussion_r1340522386


##########
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:
   I removed the unnecessary cases: https://github.com/apache/spark/pull/43170



-- 
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


Re: [PR] [SPARK-45361][SQL][DOCS] Describe characters unescaping in string literals [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #43152: [SPARK-45361][SQL][DOCS] Describe characters unescaping in string literals
URL: https://github.com/apache/spark/pull/43152


-- 
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


Re: [PR] [SPARK-45361][SQL][DOCS] Describe characters unescaping in string literals [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #43152:
URL: https://github.com/apache/spark/pull/43152#issuecomment-1744278884

   Merged to master for Apache Spark 4.0. Thank you, @MaxGekk and all.


-- 
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


Re: [PR] [SPARK-45361][SQL][DOCS] Describe characters unescaping in string literals [spark]

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #43152:
URL: https://github.com/apache/spark/pull/43152#issuecomment-1742724108

   @HyukjinKwon @srielau @dongjoon-hyun Could you review this PR, please. I want to refer to this doc page in the future while describing string arguments with regexps.


-- 
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