techdocsmith commented on code in PR #16878: URL: https://github.com/apache/druid/pull/16878#discussion_r1725808008
########## docs/querying/sql-functions.md: ########## @@ -1525,11 +1525,42 @@ Returns the following: ## LOOKUP -`LOOKUP(<CHARACTER>, <CHARACTER>[, <CHARACTER>])` +Searches for `expr` in a registered [query-time lookup table](lookups.md) named `lookupName` and returns the mapped value. If `expr` is null or not contained in the lookup, returns `defaultValue` if supplied, otherwise returns null. -**Function type:** [Scalar, string](sql-scalar.md#string-functions) +* **Syntax:** `LOOKUP(expr, lookupName[, defaultValue])` +* **Function type:** Scalar, string + +<details><summary>Example</summary> + +The following example uses a `map` type lookup table named `acronym_to_name`, which contains the following key-value pairs: Review Comment: nit: they are [airport codes](https://www.world-airport-codes.com/) not acronyms -- 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]
