techdocsmith commented on code in PR #16745: URL: https://github.com/apache/druid/pull/16745#discussion_r1681637401
########## docs/querying/sql-functions.md: ########## @@ -697,11 +739,30 @@ Returns the value of a numeric or string expression corresponding to the earlies ## EXP -`EXP(<NUMERIC>)` +Calculates _e_ raised to the power of the numeric expression. -**Function type:** [Scalar, numeric](sql-scalar.md#numeric-functions) +* **Syntax:** `EXP(<NUMERIC>)` +* **Function type:** Scalar, numeric -Calculates _e_ raised to the power of the numeric expression. +<details><summary>Example</summary> + +The following example raise _e_ to the power of `trip_id`, from the `trips_xaa` datasource. + +```sql +SELECT + "trip_id" AS "exponent_value", + EXP(trip_id) AS "Exp" +FROM "trips_xaa" +LIMIT 1 +``` +Returns the following: + +| `exponent_value` | `Exp` | +| -- | -- | +| `1` | `2.7182818284590455` | Review Comment: There are going to be a few of these where there may not exist a column in the dataset that makes sense for the function. this is one of those. Wondering if it makes more sense to just demo the function with a constant rather than a column value like this: ``` SELECT EXP(1) AS "exponential" ``` Returns the following: | `exponential` | | -- | -- | | `2.7182818284590455` | @vtlim or @ektravel , any opinion here? -- 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]
