ektravel commented on code in PR #16878:
URL: https://github.com/apache/druid/pull/16878#discussion_r1712363546


##########
docs/querying/sql-functions.md:
##########
@@ -1077,11 +1077,42 @@ Calculates the base-10 of the numeric expression.
 
 ## LOOKUP
 
-`LOOKUP(<CHARACTER>, <CHARACTER>[, <CHARACTER>])`
+Look up `expr` in a registered [query-time lookup table](lookups.md) named 
`lookupName`. Returns `replaceMissingValueWith`, which defaults to `null`, when 
the `expr` is null or when the lookup does not contain a value for `expr`.
 
-**Function type:** [Scalar, string](sql-scalar.md#string-functions)
+* **Syntax:** `LOOKUP(expr, lookupName[, replaceMissingValueWith])`
+* **Function type:** Scalar, string
+
+<details><summary>Example</summary>
+
+The following example uses a map lookup table, named `acronym_to_name` made 
with the following key-value pairs:
+
+```json
+{
+       “SJU”: Luis Munoz Marin International Airport”,
+       “IAD”: “Dulles International AirportDulles International Airport”
+}
+```
+
+The example uses `acronym_to_name` to map the `Origin` column from the 
`flight-carriers` datasource to its full airport name. Returns `NaN` if no 
matching value exist in the lookup table.

Review Comment:
   ```suggestion
   The example uses `acronym_to_name` to map the `Origin` column from the 
`flight-carriers` datasource to the corresponding full airport name. Returns 
`NaN` if no matching value exists in the lookup table.
   ```



-- 
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]

Reply via email to