This is an automated email from the ASF dual-hosted git repository.
MartijnVisser pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new 560ba5c77bb [FLINK-40979][table-planner] Run HashAggITCase's inherited
tests with adaptive local hash agg
560ba5c77bb is described below
commit 560ba5c77bb741b45ed555a077b399942ce4a4f8
Author: Martijn Visser <[email protected]>
AuthorDate: Mon Oct 12 17:41:14 2026 +0100
[FLINK-40979][table-planner] Run HashAggITCase's inherited tests with
adaptive local hash agg
- Drop ParameterizedTestExtension, the inherited tests are plain @Test
- Add AdaptiveLocalHashAggITCase, which runs the class with adaptive local
hash aggregation enabled
Generated-by: Claude Code (Claude Opus 5.5)
---
.../batch/sql/agg/AdaptiveLocalHashAggITCase.java | 28 ++++++++++++++++++++++
.../runtime/batch/sql/agg/HashAggITCase.scala | 27 +++++++--------------
2 files changed, 37 insertions(+), 18 deletions(-)
diff --git
a/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/batch/sql/agg/AdaptiveLocalHashAggITCase.java
b/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/batch/sql/agg/AdaptiveLocalHashAggITCase.java
new file mode 100644
index 00000000000..43f0de7d56f
--- /dev/null
+++
b/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/batch/sql/agg/AdaptiveLocalHashAggITCase.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.runtime.batch.sql.agg;
+
+/** {@link HashAggITCase} with adaptive local hash aggregation enabled. */
+class AdaptiveLocalHashAggITCase extends HashAggITCase {
+
+ @Override
+ public boolean adaptiveLocalHashAggEnable() {
+ return true;
+ }
+}
diff --git
a/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/agg/HashAggITCase.scala
b/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/agg/HashAggITCase.scala
index dca4d0fbbf0..2be620d4ac9 100644
---
a/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/agg/HashAggITCase.scala
+++
b/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/agg/HashAggITCase.scala
@@ -22,20 +22,18 @@ import
org.apache.flink.table.api.config.{AggregatePhaseStrategy, ExecutionConfi
import org.apache.flink.table.planner.plan.stats.FlinkStatistic
import org.apache.flink.table.planner.runtime.utils.BatchTestBase.row
import org.apache.flink.table.planner.runtime.utils.TestData.{data1,
nullablesOfData1, type1}
-import org.apache.flink.testutils.junit.extensions.parameterized.{Parameter,
ParameterizedTestExtension, Parameters}
-import org.junit.jupiter.api.TestTemplate
-import org.junit.jupiter.api.extension.ExtendWith
+import org.junit.jupiter.api.Test
import java.math.BigDecimal
import scala.collection.JavaConverters._
/** AggregateITCase using HashAgg Operator. */
-@ExtendWith(Array(classOf[ParameterizedTestExtension]))
class HashAggITCase extends AggregateITCaseBase("HashAggregate") {
- @Parameter var adaptiveLocalHashAggEnable: Boolean = _
+ // AdaptiveLocalHashAggITCase overrides this to also run the inherited tests
with it enabled
+ def adaptiveLocalHashAggEnable: Boolean = false
override def prepareAggOp(): Unit = {
registerCollection(
@@ -61,7 +59,7 @@ class HashAggITCase extends
AggregateITCaseBase("HashAggregate") {
}
}
- @TestTemplate
+ @Test
def testAdaptiveLocalHashAggWithHighAggregationDegree(): Unit = {
checkQuery(
Seq(
@@ -93,7 +91,7 @@ class HashAggITCase extends
AggregateITCaseBase("HashAggregate") {
)
}
- @TestTemplate
+ @Test
def testAdaptiveLocalHashAggWithLowAggregationDegree(): Unit = {
checkQuery(
Seq(
@@ -128,7 +126,7 @@ class HashAggITCase extends
AggregateITCaseBase("HashAggregate") {
)
}
- @TestTemplate
+ @Test
def testAdaptiveLocalHashAggWithRowLessThanSamplingThreshold(): Unit = {
checkQuery(
Seq((1, 1, 1, 1, 1L, 1.1d), (1, 1, 1, 2, 1L, 1.2d), (1, 2, 2, 3, 2L,
2.2d)),
@@ -140,7 +138,7 @@ class HashAggITCase extends
AggregateITCaseBase("HashAggregate") {
)
}
- @TestTemplate
+ @Test
def testAdaptiveLocalHashAggWithNullValue(): Unit = {
val testDataWithNullValue = tEnv.fromValues(
DataTypes.ROW(
@@ -182,7 +180,7 @@ class HashAggITCase extends
AggregateITCaseBase("HashAggregate") {
}
- @TestTemplate
+ @Test
def testAdaptiveHashAggWithSumAndAvgFunctionForNumericalType(): Unit = {
val testDataWithAllTypes = tEnv.fromValues(
DataTypes.ROW(
@@ -344,7 +342,7 @@ class HashAggITCase extends
AggregateITCaseBase("HashAggregate") {
)
}
- @TestTemplate
+ @Test
def testAdaptiveHashAggWithAuxGrouping(): Unit = {
checkResult(
"SELECT a, b, COUNT(c) FROM AuxGroupingTable GROUP BY a, b",
@@ -359,10 +357,3 @@ class HashAggITCase extends
AggregateITCaseBase("HashAggregate") {
)
}
}
-
-object HashAggITCase {
- @Parameters(name = "adaptiveLocalHashAggEnable={0}")
- def parameters(): java.util.Collection[Boolean] = {
- java.util.Arrays.asList(true, false)
- }
-}