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


##########
docs/querying/sql-functions.md:
##########
@@ -1077,11 +1077,42 @@ Calculates the base-10 of the numeric expression.
 
 ## LOOKUP
 
-`LOOKUP(<CHARACTER>, <CHARACTER>[, <CHARACTER>])`
+Searches for `expr` in a registered [query-time lookup table](lookups.md) 
named `lookupName`. Returns `replaceMissingValueWith`, which defaults to `null` 
if `expr` is null or if the lookup doesn't contain a key for `expr`.

Review Comment:
   Let's move the conditional to the start of the sentence so it doesn't look 
like the expected return behavior.
   ```suggestion
   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 `replaceMissingValueWith` if supplied, 
otherwise null.
   ```



##########
docs/querying/sql-functions.md:
##########
@@ -1077,11 +1077,42 @@ Calculates the base-10 of the numeric expression.
 
 ## LOOKUP
 
-`LOOKUP(<CHARACTER>, <CHARACTER>[, <CHARACTER>])`
+Searches for `expr` in a registered [query-time lookup table](lookups.md) 
named `lookupName`. Returns `replaceMissingValueWith`, which defaults to `null` 
if `expr` is null or if the lookup doesn't contain a key 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`-typed lookup table named `acronym_to_name`, 
made with the following key-value pairs:

Review Comment:
   ```suggestion
   The following example uses a `map`-typed lookup table named 
`acronym_to_name`, which contains the following key-value pairs:
   ```



##########
docs/querying/sql-functions.md:
##########
@@ -1077,11 +1077,42 @@ Calculates the base-10 of the numeric expression.
 
 ## LOOKUP
 
-`LOOKUP(<CHARACTER>, <CHARACTER>[, <CHARACTER>])`
+Searches for `expr` in a registered [query-time lookup table](lookups.md) 
named `lookupName`. Returns `replaceMissingValueWith`, which defaults to `null` 
if `expr` is null or if the lookup doesn't contain a key for `expr`.

Review Comment:
   Might need to update the table description too? Double check this



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