diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/pivot/TransformAggregations.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/pivot/TransformAggregations.java index 87bf3cc5c473a..92524086fa2a3 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/pivot/TransformAggregations.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/pivot/TransformAggregations.java @@ -103,7 +103,7 @@ enum AggregationType { GEO_CENTROID("geo_centroid", GEO_POINT), GEO_BOUNDS("geo_bounds", GEO_SHAPE), SCRIPTED_METRIC("scripted_metric", DYNAMIC), - WEIGHTED_AVG("weighted_avg", DYNAMIC), + WEIGHTED_AVG("weighted_avg", DOUBLE), BUCKET_SELECTOR("bucket_selector", DYNAMIC), BUCKET_SCRIPT("bucket_script", DYNAMIC), PERCENTILES("percentiles", DOUBLE), diff --git a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/pivot/TransformAggregationsTests.java b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/pivot/TransformAggregationsTests.java index 43d4938a7fccd..ec20a6994e980 100644 --- a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/pivot/TransformAggregationsTests.java +++ b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/pivot/TransformAggregationsTests.java @@ -78,8 +78,9 @@ public void testResolveTargetMapping() { assertEquals("_dynamic", TransformAggregations.resolveTargetMapping("bucket_selector", "int")); // weighted_avg - assertEquals("_dynamic", TransformAggregations.resolveTargetMapping("weighted_avg", null)); - assertEquals("_dynamic", TransformAggregations.resolveTargetMapping("weighted_avg", "double")); + assertEquals("double", TransformAggregations.resolveTargetMapping("weighted_avg", null)); + assertEquals("double", TransformAggregations.resolveTargetMapping("weighted_avg", "double")); + assertEquals("double", TransformAggregations.resolveTargetMapping("weighted_avg", "int")); // percentile assertEquals("double", TransformAggregations.resolveTargetMapping("percentiles", null));