Skip to content

Commit

Permalink
address 2nd PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
saiyan86 authored and QubitPi committed Aug 30, 2017
1 parent aba730c commit b221012
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 35 deletions.
30 changes: 15 additions & 15 deletions docs/built-in-makers.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ details on metric makers.
Makers for Druid Aggregation Operations
---------------------------------------

These makers are used to make first-level metrics, and are in a one-to-one mapping to the
These makers are used to make first-level metrics, and are in a one-to-one mapping to the
[Druid aggregations][druid aggregations].


Expand All @@ -21,7 +21,7 @@ These makers are used to make first-level metrics, and are in a one-to-one mappi

Additionally, the Fili core libraries support Sketch datatypes and sketch set operations provided by
[theta sketches in Druid][druid sketch module].

8. [`SketchCountMaker`][sketchCountMaker] - The sketchCount is associated with the [sketch aggregation][sketch module]

More details about sketches can be found at http://datasketches.github.io/.
Expand All @@ -30,7 +30,7 @@ More details about sketches can be found at http://datasketches.github.io/.
Makers for Druid Post-Aggregation Operations
--------------------------------------------

The following makers apply single Druid post-aggregators to queries. They correspond to the
The following makers apply single Druid post-aggregators to queries. They correspond to the
[Druid post-aggregations][druid post-aggregations]

1. [`ArithmeticMaker`][arithmeticMaker]
Expand All @@ -41,31 +41,31 @@ Sketch set operations are supported as well.
3. [`SketchSetOperationMaker`][sketchSetOperationMaker] - Part of the [Druid sketch module][sketch module]

We currently support neither the native Druid `JavaScript` nor the `HyperUnique Cardinality` post aggregators. Fili
supports sketches rather than hyperUnique objects, which handle the same problem domain. `JavaScript` post-aggregators
supports sketches rather than hyperUnique objects, which handle the same problem domain. `JavaScript` post-aggregators
are not considered production-safe in terms of performance or server load.


Makers for Constructed Operations
---------------------------------

These makers represent more complex operations which do not correspond directly to a single Druid aggregation or
These makers represent more complex operations which do not correspond directly to a single Druid aggregation or
post-aggregation. They might create additional columns, constrain the grain of a druid query, or be a shorthand
for an arithmetic expression across aggregations (such as an average).

Currently, we only have one built-in metric maker of this type:

1. [`AggregationAverageMaker`][aggregationAverageMaker]:
The `AggregationAverageMaker` allows us to aggregate a metric at one granularity, and then take the average of the
aggregated metric across a coarser granularity. For example, suppose we want to compute the daily average page views
for each month of the year 2012. In other words, for each month we first compute the total number of page views for
every day of the month. Then, we take the average of those totals, giving us the daily average page views for that
month. The `AggregationAverageMaker` is rather complex, and has [its own document][aggregationAverageMaker-docs]
The `AggregationAverageMaker` allows us to aggregate a metric at one granularity, and then take the average of the
aggregated metric across a coarser granularity. For example, suppose we want to compute the daily average page views
for each month of the year 2012. In other words, for each month we first compute the total number of page views for
every day of the month. Then, we take the average of those totals, giving us the daily average page views for that
month. The `AggregationAverageMaker` is rather complex, and has [its own document][aggregationAverageMaker-docs]
that explains how `AggregationAverageMaker` works.
<sub><a name="countCaveat">1</a>: Technically, `CountMaker` does not translate directly to the Druid count aggregation,


<sub><a name="countCaveat">1</a>: Technically, `CountMaker` does not translate directly to the Druid count aggregation,
because of a bug that existed in Druid when `CountMaker` was first implemented. Instead, `CountMaker` creates a nested
query. The inner query adds a constant field with a value of 1 to each result row. The outer query then performs a
query. The inner query adds a constant field with a value of 1 to each result row. The outer query then performs a
`longSum` on said constant.</sub>


Expand All @@ -90,4 +90,4 @@ query. The inner query adds a constant field with a value of 1 to each result ro

[sketchCountMaker]: ../fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/makers/SketchCountMaker.java
[sketchSetOperationMaker]: ../fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/makers/SketchSetOperationMaker.java
[sketch module]: https://github.com/druid-io/druid/pull/1991/files
[sketch module]: https://github.com/druid-io/druid/pull/1991/files
39 changes: 19 additions & 20 deletions translations/zh/built-in-makers-zh.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
内置建造器 Built In Makers
===============
下面是一个Fili内置标准建造器表格。对于标准建造器,请参考[`Configuring Metrics`][configuring metrics]
下面是一个Fili内置指标列(metric)建造器表格。对于指标列(metric)建造器,请参考[`Configuring Metrics`][configuring metrics]

Druid集合操作建造器
Druid聚合操作建造器
---------------------------------------

下列建造器用于制造一级标准,和Druid数据聚合功能一一对应。
如下列举的是一些一级指标列(metric)制造器,它们和Druid数据聚合功能一一对应。
[Druid aggregations][druid aggregations]


Expand All @@ -25,10 +24,10 @@ sketchCount与[sketch aggregation][sketch module]相关联。

关于sketch的更多内容可参考http://datasketches.github.io/.

Druid后集合操作建造器
Druid后聚合操作建造器
--------------------------------------------

下列建造器在查询上使用单次Druid后集合运算符。这些运算符对应Druid的后期数据聚合操作。
下列这些建造器在查询上应用了一次Druid后聚合运算符。这些运算符对应Druid的后期数据聚合操作。
[Druid post-aggregations][druid post-aggregations]

1. [`运算建造器ArithmeticMaker`][运算建造器ArithmeticMaker]
Expand All @@ -38,38 +37,38 @@ Fili也支持Sketch集合操作。

3. [`Sketch集合运算建造器SketchSetOperationMaker`][Sketch集合运算建造器SketchSetOperationMaker] - 是[Druid sketch module][sketch module]的一部分。

我们现在并不支持源生Druid `JavaScript``HyperUnique Cardinality`后集合运算符
Fili支持sketches而不是hyperUnique对象,因为二者功能重复。`JavaScript`后运算符在大规模运行中会造成性能瓶颈
我们现在并不支持源生Druid `JavaScript``HyperUnique Cardinality`后聚合器
Fili支持sketches而不是hyperUnique对象,因为二者功能重复。`JavaScript`后聚合器在大规模运行中会造成性能瓶颈

建造操作建造器
自定义操作建造器
---------------------------------

这些建造器代表了一些并不能被单次Druid(后)数据聚合操作完成的操作。他们可能会创建新的列,细分Druid查询的规模,或者是在集合操作之上的进一步数学运算(比如平均数)。
这些建造器代表了一些并不能被单次Druid(后)数据聚合操作完成的操作。他们可能会创建新的列,细分Druid查询的规模,或者是在聚合操作之上的进一步数学运算(比如平均数)。

现在,我们只支持一个这样的内置标准建造器
现在,我们只支持一个这样的内置指标列(metric)建造器

1. [`集合平均建造器AggregationAverageMaker`][集合平均建造器AggregationAverageMaker]:
`集合平均建造器`可以在一个精度上聚合一个方面的数据,然后取更广维度的集合后的标准之平均数
1. [`聚合平均建造器AggregationAverageMaker`][聚合平均建造器AggregationAverageMaker]:
`聚合平均建造器`可以在一个精度(dimension)上聚合一个方面的数据,然后取更广维度的聚合后的标准之平均数
举个例子,我们想计算2012年每月的日平均页面访问量。实际上,对于每个月份,我们先计算当月每日页面访问量,再把结果取平均值,就得到了当月的日平均页面访问量。
`集合平均建造器` 比较复杂,而且有[其自己的文档][aggregationAverageMaker-docs]
`聚合平均建造器` 比较复杂,而且有[其自己的文档][aggregationAverageMaker-docs]
详细说明。


<sub><a name="countCaveat">1</a>: 实际上`计数器建造器CountMaker`并不直接对应Druid的计数集合操作,因为实现`计数器建造器CountMaker`的时候,Druid内部有一个bug。`计数器建造器CountMaker`的内部实现是创建一个多重查询。内层查询在每一个返回的结果列里插入一个值为1的常数列。外部查询则对该常数执行`长整数之和longSum`
<sub><a name="countCaveat">1</a>: 实际上`计数器建造器CountMaker`并不直接对应Druid的计数聚合操作,因为实现`计数器建造器CountMaker`的时候,Druid内部有一个bug。`计数器建造器CountMaker`的内部实现是创建一个多重查询。内层查询在每一个返回的结果列里插入一个值为1的常数列。外部查询则对该常数执行`长整数之和longSum`

[集合平均建造器AggregationAverageMaker]: ../fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/makers/AggregationAverageMaker.java
[集合平均建造器AggregationAverageMaker-文档]: https://github.com/yahoo/fili/issues/10
[聚合平均建造器AggregationAverageMaker]: ../fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/makers/AggregationAverageMaker.java
[聚合平均建造器AggregationAverageMaker-文档]: https://github.com/yahoo/fili/issues/10
[数学建造器arithmeticMaker]: ../fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/makers/ArithmeticMaker.java

[设置标准configuring metrics]: configuring-metrics.md
[设置指标列configuring metrics]: configuring-metrics.md
[常数建造器constantMaker]: ../fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/makers/ConstantMaker.java
[计数器建造器countMaker]: ../fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/makers/CountMaker.java

[双精度最大值建造器DoubleMaxMaker]: ../fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/makers/DoubleMaxMaker.java
[双精度最小值建造器DoubleMinMaker]: ../fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/makers/DoubleMinMaker.java
[双精度之和建造器DoubleSumMaker]: ../fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/makers/DoubleSumMaker.java
[Druid集合操作druid aggregations]: http://druid.io/docs/0.8.1/querying/aggregations.html
[Druid后集合操作druid post-aggregations]: http://druid.io/docs/0.8.1/querying/post-aggregations.html
[Druid聚合操作druid aggregations]: http://druid.io/docs/0.8.1/querying/aggregations.html
[Druid后聚合操作druid post-aggregations]: http://druid.io/docs/0.8.1/querying/post-aggregations.html
[Druid sketch模块druid sketch module]: https://github.com/DataSketches/sketches-core

[长整数最大值建造器LongMaxMaker]: ../fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/makers/LongMaxMaker.java
Expand Down

0 comments on commit b221012

Please sign in to comment.