Skip to content

Commit debae71

Browse files
sarutakHyukjinKwon
andcommitted
[SPARK-50651][SQL][DOCS] Add note about octal representation for characters
### What changes were proposed in this pull request? This PR modifies `docs/sql-ref-literals.md` to mention about octal representation for characters. Currently there is no mention of it anywhere. This change includes a trivial typo too which is in the same file. ### Why are the changes needed? It's a public feature. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Built the doc, then confirmed the result. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #49273 from sarutak/octal-representation. Lead-authored-by: Kousuke Saruta <[email protected]> Co-authored-by: Hyukjin Kwon <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
1 parent a30a3fd commit debae71

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/sql-ref-literals.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ A string literal is used to specify a character string value.
4646
One character from the character set. Use `\` to escape special characters (e.g., `'` or `\`).
4747
To represent unicode characters, use 16-bit or 32-bit unicode escape of the form `\uxxxx` or `\Uxxxxxxxx`,
4848
where xxxx and xxxxxxxx are 16-bit and 32-bit code points in hexadecimal respectively (e.g., `\u3042` for `` and `\U0001F44D` for `👍`).
49+
An ASCII character can also be represented as an octal number preceded by `\` like `\101`, which represents `A`.
4950

5051
* **r**
5152

@@ -78,14 +79,14 @@ SELECT "SPARK SQL" AS col;
7879
+---------+
7980
| col|
8081
+---------+
81-
|Spark SQL|
82+
|SPARK SQL|
8283
+---------+
8384

8485
SELECT 'it\'s $10.' AS col;
8586
+---------+
8687
| col|
8788
+---------+
88-
|It's $10.|
89+
|it's $10.|
8990
+---------+
9091
9192
SELECT r"'\n' represents newline character." AS col;

0 commit comments

Comments
 (0)