From 901bb696f9a9e134c9d9a1b226cee193a910f498 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 11:13:10 -0700 Subject: [PATCH] added type check for pipeline aggregator types in Transform initialization (#1014) (#1029) (cherry picked from commit cd99b0f39f2fd279d6f85161cef3b65e7adc6236) Signed-off-by: n-dohrmann Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] Co-authored-by: Joanne Wang <109310487+jowg-amazon@users.noreply.github.com> --- .../opensearch/indexmanagement/transform/model/Transform.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/Transform.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/Transform.kt index ce6e50401..1403639af 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/Transform.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/Transform.kt @@ -77,6 +77,9 @@ data class Transform( aggregations.aggregatorFactories.forEach { require(supportedAggregations.contains(it.type)) { "Unsupported aggregation [${it.type}]" } } + aggregations.pipelineAggregatorFactories.forEach { + require(supportedAggregations.contains(it.type)) { "Unsupported aggregation [${it.type}]" } + } when (jobSchedule) { is CronSchedule -> { // Job scheduler already correctly throws errors for this