-
Notifications
You must be signed in to change notification settings - Fork 532
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
CustomAggregator #572
CustomAggregator #572
Conversation
…nto entityTypes
Can we add a unit test that shows the usage of this analyzer along with other analyzers? See |
instance: String) | ||
extends Analyzer[AggregatedMetricState, AttributeDoubleMetric] { | ||
|
||
def computeStateFrom(data: DataFrame, filterCondition: Option[String] = None) |
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.
Can we add the override
keyword here and in front of computeMetricFrom
?
Great PR description! Can you also add the output of the |
// Define the analyzer | ||
case class ConditionalAggregationAnalyzer(aggregatorFunc: DataFrame => AggregatedMetricState, | ||
metricName: String, | ||
instance: String) |
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.
Since we are running the aggregator on the entire dataframe, we can probably use Dataset
for the instance (like how we do in other analyzers like rowcount). That way, we do not need to ask for this parameter from the user. We should keep the public facing API as simple as possible.
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.
Great PR on both the implementation and description
This pull request introduces the CustomAggregator, a tool designed for dynamic data aggregation based on user-specified conditions within Apache Spark DataFrames. This addition can preform customized metric calculations and aggregations, making it applicable where conditional data aggregation is required.
Core Features:
How It Can Be Used:
To use the CustomAggregator, developers will need to:
Usage Examples:
Included in the pull request are unit tests that demonstrate potential use cases:
Content Engagement Metrics:
Resource Utilization in Cloud Services:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.