You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/08/02 02:36:50 UTC
[GitHub] [spark] sarutak commented on a change in pull request #33599: [SPARK-36371][SQL] Support raw string literal
sarutak commented on a change in pull request #33599:
URL: https://github.com/apache/spark/pull/33599#discussion_r680617158
##########
File path: docs/sql-ref-literals.md
##########
@@ -47,6 +47,10 @@ A string literal is used to specify a character string value.
To represent unicode characters, use 16-bit or 32-bit unicode escape of the form `\uxxxx` or `\Uxxxxxxxx`,
where xxxx and xxxxxxxx are 16-bit and 32-bit code points in hexadecimal respectively (e.g., `\u3042` for `あ` and `\U0001F44D` for `👍`).
+* **R**
Review comment:
Actually, I investigated raw string syntax support in other RDBMS beforehand, and I found there is no standard way to represent raw string literals.
In PostgreSQL, any special character isn't escaped by `\` unless a string literal starts with `E` prefix.
https://www.postgresql.org/docs/13/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS
In MySQL, special characters in a string literal are not escaped if `NO_BACKSLASH_ESCAPES` is enabled.
https://dev.mysql.com/doc/refman/8.0/en/string-literals.html
In MsSQLServer, any special character isn't escaped by `\` but `STRING_ESCAPE` function can escape such characters.
https://docs.microsoft.com/en-us/sql/t-sql/functions/string-escape-transact-sql?view=sql-server-ver15
It's not a RDBMS but BigQuery supports raw string literals like Python.
https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#literals
So, I choose this syntax.
--
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