ClickHouse
65 строк · 2.6 Кб
1#include <Functions/FunctionFactory.h>2
3#include "FunctionsUniqTheta.h"4
5#if USE_DATASKETCHES6
7namespace DB8{
9
10REGISTER_FUNCTION(UniqTheta)11{
12factory.registerFunction<FunctionUniqThetaIntersect>(13FunctionDocumentation{.description = R"(14Two uniqThetaSketch objects to do intersect calculation(set operation ∩), the result is a new uniqThetaSketch.
15
16A uniqThetaSketch object is to be constructed by aggregation function uniqTheta with -State.
17
18UniqThetaSketch is a data structure storage of approximate values set.
19For more information on RoaringBitmap, see: [Theta Sketch Framework](https://datasketches.apache.org/docs/Theta/ThetaSketchFramework.html).
20
21Typical usage:
22[example:typical]
23)",24.examples{25{"typical", "select finalizeAggregation(uniqThetaIntersect(arrayReduce('uniqThetaState',[1,2]), arrayReduce('uniqThetaState',[2,3,4])));", ""}},26.categories{"uniqTheta"}27});28
29factory.registerFunction<FunctionUniqThetaUnion>(30FunctionDocumentation{.description = R"(31Two uniqThetaSketch objects to do union calculation(set operation ∪), the result is a new uniqThetaSketch.
32
33A uniqThetaSketch object is to be constructed by aggregation function uniqTheta with -State.
34
35UniqThetaSketch is a data structure storage of approximate values set.
36For more information on RoaringBitmap, see: [Theta Sketch Framework](https://datasketches.apache.org/docs/Theta/ThetaSketchFramework.html).
37
38Typical usage:
39[example:typical]
40)",41.examples{42{"typical", "select finalizeAggregation(uniqThetaUnion(arrayReduce('uniqThetaState',[1,2]), arrayReduce('uniqThetaState',[2,3,4])));", ""}},43.categories{"uniqTheta"}44});45factory.registerFunction<FunctionUniqThetaNot>(46FunctionDocumentation{.description = R"(47Two uniqThetaSketch objects to do a_not_b calculation(set operation ×), the result is a new uniqThetaSketch.
48
49A uniqThetaSketch object is to be constructed by aggregation function uniqTheta with -State.
50
51UniqThetaSketch is a data structure storage of approximate values set.
52For more information on RoaringBitmap, see: [Theta Sketch Framework](https://datasketches.apache.org/docs/Theta/ThetaSketchFramework.html).
53
54Typical usage:
55[example:typical]
56)",57.examples{58{"typical", "select finalizeAggregation(uniqThetaNot(arrayReduce('uniqThetaState',[1,2]), arrayReduce('uniqThetaState',[2,3,4])));", ""}},59.categories{"uniqTheta"}60});61}
62
63}
64
65#endif66