-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds missing Float and String aggregators #86
Conversation
anskarl
commented
Jan 12, 2020
- Float-based: FloatSum, FloatMin, FloatMax, FloatFirst and FloatLast
- String-based: StringFirst and StringLast
- Updates the corresponding DQL operators
- Adds two missing DQL operator functions for Javascript aggregator (same arguments, but without requiring to specify an aggregator name).
- Float-based: FloatSum, FloatMin, FloatMax, FloatFirst and FloatLast - String-based: StringFirst and StringLast - Updates the corresponding DQL operators - Adds two missing DQL operator functions for Javascript aggregator without requiring name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oncemore: thank you for this PR.
docs/dql.md
Outdated
@@ -397,6 +397,16 @@ d"dim_name".longFirst as "agg_first" | |||
doubleLast(d"dim_name") as "agg_last" | |||
``` | |||
|
|||
`stringFirst` computes the metric value with the minimum timestamp or `null` if no row exist. | |||
`stringLast` computes the metric value with the maximum timestamp or `null` if no row exist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"if no row exist" → "if no row exists"
override def getName: String = name.getOrElse(s"string_first_${fieldName}") | ||
|
||
def maxStringBytes(v: Int): StringFirstAgg = { | ||
require(v > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add an exception message to the requirement, otherwise it's just "requirement failed".
Thank you for updating the PR. I have no further remarks |