Class ExpandableAggregationFunction
java.lang.Object
cern.nxcals.api.custom.service.aggregation.AggregationFunction
cern.nxcals.api.custom.service.aggregation.ExpandableAggregationFunction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.apache.spark.sql.expressions.WindowSpecFields inherited from class cern.nxcals.api.custom.service.aggregation.AggregationFunction
TIMESTAMP_COLUMN_NAME, VALUE_COLUMN_NAME -
Method Summary
Modifier and TypeMethodDescriptionexpandTimeWindowBy(long amountBefore, long amountAfter, @NonNull TemporalUnit unit) Replaces the default data query time window expansion associated with thisAggregationFunctionsimplementation.Methods inherited from class cern.nxcals.api.custom.service.aggregation.AggregationFunction
getTimeWindowExpansion
-
Field Details
-
RECORDS_ROW_WINDOW
protected static final org.apache.spark.sql.expressions.WindowSpec RECORDS_ROW_WINDOW
-
-
Method Details
-
expandTimeWindowBy
public ExpandableAggregationFunction expandTimeWindowBy(long amountBefore, long amountAfter, @NonNull @NonNull TemporalUnit unit) Replaces the default data query time window expansion associated with thisAggregationFunctionsimplementation.- Parameters:
amountBefore- the amount of the duration to expand, before the start time of query time window, measured in terms of the unit. Parameter should be a positive value and would be validated against that expectationamountAfter- the amount of the duration to expand, after the end time of query time window, measured in terms of the unit. Parameter should be a positive value and would be validated against that expectationunit- the unit that the duration is measured in, must have an exact duration, not null- Returns:
- a new
ExpandableAggregationFunctionbased on this function containing the specified time window expansion settings
-