Skip to content

Commit

Permalink
[SPARK-50651][SQL][DOCS] Add note about octal representation for char…
Browse files Browse the repository at this point in the history
…acters

### 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 apache#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]>
  • Loading branch information
sarutak and HyukjinKwon committed Dec 24, 2024
1 parent a30a3fd commit debae71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/sql-ref-literals.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ A string literal is used to specify a character string value.
One character from the character set. Use `\` to escape special characters (e.g., `'` or `\`).
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 `👍`).
An ASCII character can also be represented as an octal number preceded by `\` like `\101`, which represents `A`.

* **r**

Expand Down Expand Up @@ -78,14 +79,14 @@ SELECT "SPARK SQL" AS col;
+---------+
| col|
+---------+
|Spark SQL|
|SPARK SQL|
+---------+

SELECT 'it\'s $10.' AS col;
+---------+
| col|
+---------+
|It's $10.|
|it's $10.|
+---------+
SELECT r"'\n' represents newline character." AS col;
Expand Down

0 comments on commit debae71

Please sign in to comment.