You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by te...@apache.org on 2023/02/09 16:53:58 UTC
[druid] branch master updated: Add missing documentation for constant post-aggregator (#13664)
This is an automated email from the ASF dual-hosted git repository.
techdocsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new d7b95988d7 Add missing documentation for constant post-aggregator (#13664)
d7b95988d7 is described below
commit d7b95988d7caf2f5df9a104154f31778be0abc8c
Author: Anshu Makkar <83...@users.noreply.github.com>
AuthorDate: Thu Feb 9 22:23:45 2023 +0530
Add missing documentation for constant post-aggregator (#13664)
Thanks @anshu-makkar , I was waiting for CI to complete yesterday. Failures seem unrelated, so merging.
---
.../extensions-core/datasketches-theta.md | 43 ++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/docs/development/extensions-core/datasketches-theta.md b/docs/development/extensions-core/datasketches-theta.md
index 6976293d42..bd46c4362e 100644
--- a/docs/development/extensions-core/datasketches-theta.md
+++ b/docs/development/extensions-core/datasketches-theta.md
@@ -95,6 +95,49 @@ This returns a summary of the sketch that can be used for debugging. This is the
}
```
+
+
+### Constant Theta Sketch
+
+You can use the constant theta sketch post aggregator to add a Base64-encoded constant theta sketch value for use in other post-aggregators. For example, `thetaSketchSetOp`.
+
+```json
+{
+ "type" : "thetaSketchConstant",
+ "name": DESTINATION_COLUMN_NAME,
+ "value" : CONSTANT_SKETCH_VALUE
+}
+```
+
+### Example using a constant Theta Sketch
+
+Assume you have a datasource with a variety of a variety of users. Using `filters` and `aggregation`, you generate a theta sketch of all `football fans`.
+
+A third-party provider has provided a constant theta sketch of all `cricket fans` and you want to `INTERSECT` both cricket fans and football fans in a `post-aggregation` stage to identify users who are interested in both `cricket`. Then you want to use `thetaSketchEstimate` to calculate the number of unique users.
+
+```json
+{
+ "type":"thetaSketchEstimate",
+ "name":"football_cricket_users_count",
+ "field":{
+ "type":"thetaSketchSetOp",
+ "name":"football_cricket_fans_users_theta_sketch",
+ "func":"INTERSECT",
+ "fields":[
+ {
+ "type":"fieldAccess",
+ "fieldName":"football_fans_users_theta_sketch"
+ },
+ {
+ "type":"thetaSketchConstant",
+ "name":"cricket_fans_users_theta_sketch",
+ "value":"AgMDAAAazJMCAAAAAACAPzz9j7pWTMdROWGf15uY1nI="
+ }
+ ]
+ }
+}
+```
+
## Examples
Assuming, you have a dataset containing (timestamp, product, user_id). You want to answer questions like
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org