techdocsmith commented on code in PR #16761:
URL: https://github.com/apache/druid/pull/16761#discussion_r1690446716
##########
docs/querying/sql-functions.md:
##########
@@ -1398,11 +1447,31 @@ Returns the rightmost number of characters from an
expression.
## ROUND
-`ROUND(expr[, digits])`
+Calculates the rounded value for a numerical expression.
-**Function type:** [Scalar, numeric](sql-scalar.md#numeric-functions)
+* **Syntax:** `ROUND(expr[, digits])`
+* **Function type:** Scalar, numeric
-Calculates the rounded value for a numerical expression.
+<details><summary>Example</summary>
+
+The following applies the ROUND function to 0 decimal points on the
`pickup_longitude` column. The `pickup_longitude` column is from the
`taxi-trips` datasource.
Review Comment:
```suggestion
The following applies the ROUND function to 0 decimal points on the
`pickup_longitude` column from the `taxi-trips` datasource.
```
##########
docs/querying/sql-functions.md:
##########
@@ -1398,11 +1447,31 @@ Returns the rightmost number of characters from an
expression.
## ROUND
-`ROUND(expr[, digits])`
+Calculates the rounded value for a numerical expression.
-**Function type:** [Scalar, numeric](sql-scalar.md#numeric-functions)
+* **Syntax:** `ROUND(expr[, digits])`
+* **Function type:** Scalar, numeric
-Calculates the rounded value for a numerical expression.
+<details><summary>Example</summary>
+
+The following applies the ROUND function to 0 decimal points on the
`pickup_longitude` column. The `pickup_longitude` column is from the
`taxi-trips` datasource.
+
+```sql
+SELECT
+ "pickup_longitude" AS "pickup_longitude",
+ ROUND("pickup_longitude", 0) as "round_pickup_longitude"
Review Comment:
```suggestion
ROUND("pickup_longitude", 0) as "rounded_pickup_longitude"
```
nit
##########
docs/querying/sql-functions.md:
##########
@@ -1720,20 +1804,41 @@ Trims the leading or trailing characters of an
expression.
## TRUNC
-`TRUNC(expr[, digits])`
+Alias for [`TRUNCATE`](#truncate).
-**Function type:** [Scalar, numeric](sql-scalar.md#numeric-functions)
+* **Syntax:** `TRUNC(expr[, digits])`
+* **Function type:** Scalar, numeric
-Alias for [`TRUNCATE`](#truncate).
+[Learn more](sql-scalar.md#numeric-functions)
## TRUNCATE
-`TRUNCATE(expr[, digits])`
+Truncates a numerical expression to a specific number of decimal digits.
-**Function type:** [Scalar, numeric](sql-scalar.md#numeric-functions)
+* **Syntax:** `TRUNCATE(expr[, digits])`
+* **Function type:** Scalar, numeric
-Truncates a numerical expression to a specific number of decimal digits.
+<details><summary>Example</summary>
+The following applies the TRUNCATE function to 1 decimal place on the
`pickup_longitude` column. The `pickup_longitude` column is from the
`taxi-trips` datasource.
Review Comment:
```suggestion
The following applies the TRUNCATE function to 1 decimal place on the
`pickup_longitude` column from the `taxi-trips` datasource.
```
##########
docs/querying/sql-functions.md:
##########
@@ -1398,11 +1447,31 @@ Returns the rightmost number of characters from an
expression.
## ROUND
-`ROUND(expr[, digits])`
+Calculates the rounded value for a numerical expression.
-**Function type:** [Scalar, numeric](sql-scalar.md#numeric-functions)
+* **Syntax:** `ROUND(expr[, digits])`
+* **Function type:** Scalar, numeric
-Calculates the rounded value for a numerical expression.
+<details><summary>Example</summary>
+
+The following applies the ROUND function to 0 decimal points on the
`pickup_longitude` column. The `pickup_longitude` column is from the
`taxi-trips` datasource.
+
+```sql
+SELECT
+ "pickup_longitude" AS "pickup_longitude",
+ ROUND("pickup_longitude", 0) as "round_pickup_longitude"
+FROM "taxi-trips"
+WHERE "pickup_longitude" IS NOT NULL
+LIMIT 1
+```
+Returns the following:
+
+| `pickup_longitude` | `round_pickup_longitude` |
Review Comment:
```suggestion
| `pickup_longitude` | `rounded_pickup_longitude` |
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]