Commit b95f6d6
[MINOR][DOCS] The default fractional numeric literal in SQL is a decimal
### What changes were proposed in this pull request?
Explain that a number like `123.456`, without a postfix but with a decimal point, is a decimal literal.
### Why are the changes needed?
In Python (and I think Java too) fractional numeric literals are typically floats. To get decimals, you need to provide an explicit postfix or use an explicit class.
In Spark, it's the other way around. I found this surprising and couldn't find documentation about it.
I discovered this after reading SPARK-45786. I did a little searching and came across #10796, which shows that we used to default to floats as the fractional numeric literal, but then switched to decimals.
### Does this PR introduce _any_ user-facing change?
Yes, it adds a bit of documentation.
### How was this patch tested?
No testing.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #45003 from nchammas/decimal-literal.
Authored-by: Nicholas Chammas <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>1 parent 1e13d8d commit b95f6d6
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| |||
0 commit comments