writer-jill commented on code in PR #17658:
URL: https://github.com/apache/druid/pull/17658#discussion_r1930603845
##########
docs/querying/sql-functions.md:
##########
@@ -1756,39 +1809,66 @@ Returns the following:
## DECODE_BASE64_COMPLEX
-Decodes a Base64-encoded string into a complex data type, where `dataType` is
the complex data type and `expr` is the Base64-encoded string to decode.
+Decodes a base64-encoded expression into a complex data type.
-* **Syntax**: `DECODE_BASE64_COMPLEX(dataType, expr)`
-* **Function type:** Scalar, other
+You can use the function to ingest data when a column contains an encoded data
sketch such as Theta or HLL.
-[Learn more](sql-scalar.md#other-scalar-functions)
+The function supports `hyperUnique` and `serializablePairLongString` data
types by default.
+You can enable support for the following complex data types by [loading their
extensions](../configuration/extensions.md):
+
+- `druid-bloom-filter`: `bloom`
+- `druid-datasketches`: `arrayOfDoublesSketch`, `HLLSketch`,
`KllDoublesSketch`, `KllFloatsSketch`, `quantilesDoublesSketch`, `thetaSketch`
+- `druid-histogram`: `approximateHistogram`, `fixedBucketsHistogram`
+- `druid-stats`: `variance`
+- `druid-compressed-bigdecimal`: `compressedBigDecimal`
+- `druid-momentsketch`: `momentSketch`
+- `druid-tdigestsketch`: `tDigestSketch`
+
+* **Syntax:** `DECODE_BASE64_COMPLEX(dataType, expr)`
+* **Function type:** Scalar
+
+<details><summary>Example</summary>
+
+The following example decodes a Theta sketch from a base64-encoded sketch
contained in `theta_input`:
+
+```sql
+DECODE_BASE64_COMPLEX('thetaSketch', "theta_input")
+```
+The following example counts the distinct values in an encoded Theta sketch
column using
[`APPROX_COUNT_DISTINCT_DS_THETA`](#approx_count_distinct_ds_theta):
+
+```sql
+APPROX_COUNT_DISTINCT_DS_THETA(DECODE_BASE64_COMPLEX('thetaSketch',
"theta_input"))
+```
+
+</details>
+
+[Learn more](./sql-scalar.md#other-scalar-functions)
## DECODE_BASE64_UTF8
-Decodes a Base64-encoded string into a UTF-8 encoded string.
+Decodes a base64-encoded expression into a UTF-8 encoded string.
* **Syntax:** `DECODE_BASE64_UTF8(expr)`
-* **Function type:** Scalar, string
+* **Function type:** Scalar
Review Comment:
Fixed.
--
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]