-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- use pydruid and not fork - add support for doubles sketch aggregator and post aggregator - add query timeout of 10 seconds - fix logging --------- Signed-off-by: shrivardhan <shrivardhan92@gmail.com>
- Loading branch information
1 parent
2973dd2
commit dfab26e
Showing
8 changed files
with
145 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from numalogic.connectors.druid._druid import DruidFetcher, make_filter_pairs, build_params | ||
|
||
__all__ = ["DruidFetcher", "make_filter_pairs", "build_params"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
def quantiles_doubles_sketch( | ||
raw_column: str, aggregator_name: str, k: int = 128, max_stream_length: int = 1000000000 | ||
) -> dict: | ||
""" | ||
Args: | ||
raw_column: Name of the column in druid | ||
aggregator_name: Arbitrary aggregator name | ||
k: Controls accuracy, higher the better. Must be a power of 2 from 2 to 32768 | ||
max_stream_length: This parameter defines the number of items that can be presented to | ||
each sketch before it may need to move from off-heap to on-heap memory. | ||
Returns: quantilesDoublesSketch aggregator dict | ||
""" | ||
return { | ||
"type": "quantilesDoublesSketch", | ||
"name": aggregator_name, | ||
"fieldName": raw_column, | ||
"k": k, | ||
"maxStreamLength": max_stream_length, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from pydruid.utils.postaggregator import Field | ||
from pydruid.utils.postaggregator import Postaggregator | ||
|
||
|
||
class QuantilesDoublesSketchToQuantile(Postaggregator): | ||
"""Class for building QuantilesDoublesSketchToQuantile post aggregator.""" | ||
|
||
def __init__(self, field: Field, fraction: float, output_name=None): | ||
name = output_name or "quantilesDoublesSketchToQuantile" | ||
|
||
super().__init__(None, None, name) | ||
self.field = field | ||
self.fraction = fraction | ||
self.post_aggregator = { | ||
"type": "quantilesDoublesSketchToQuantile", | ||
"name": name, | ||
"field": self.field.post_aggregator, | ||
"fraction": self.fraction, | ||
} |
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters