This is an automated email from the ASF dual-hosted git repository.

gian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 91e7ec44022 Remove redundant TopNQueryConfig#minTopNThreshold (#18790)
91e7ec44022 is described below

commit 91e7ec4402290e9431b0b223857a1c0f460279de
Author: zhan7236 <[email protected]>
AuthorDate: Sat Mar 21 03:21:40 2026 +0800

    Remove redundant TopNQueryConfig#minTopNThreshold (#18790)
    
    This removes the minTopNThreshold config from TopNQueryConfig as it
    can be overridden by the query context variable. The default value is
    still available as a constant TopNQueryConfig.DEFAULT_MIN_TOPN_THRESHOLD.
---
 docs/configuration/index.md                        |  6 --
 docs/querying/topnquery.md                         |  2 +-
 .../apache/druid/query/topn/TopNQueryConfig.java   | 18 ++----
 .../druid/query/topn/TopNQueryQueryToolChest.java  | 10 +---
 .../query/topn/TopNQueryQueryToolChestTest.java    |  6 +-
 .../org/apache/druid/server/QueryStackTests.java   | 66 ++++++++++++++--------
 .../druid/sql/calcite/CalciteJoinQueryTest.java    |  7 +--
 .../druid/sql/calcite/SqlTestFrameworkConfig.java  | 34 +----------
 .../sql/calcite/SqlTestFrameworkConfigTest.java    | 10 +---
 .../druid/sql/calcite/util/SqlTestFramework.java   | 18 +-----
 .../testExactTopNOnInnerJoinWithLimit.iq           |  5 +-
 11 files changed, 67 insertions(+), 115 deletions(-)

diff --git a/docs/configuration/index.md b/docs/configuration/index.md
index a8b50b5bf23..b9ee7d7c4c7 100644
--- a/docs/configuration/index.md
+++ b/docs/configuration/index.md
@@ -2226,12 +2226,6 @@ If runtime property only contains 
`druid.query.default.context.maxQueuedBytes=y`
 `druid.query.default.context.maxQueuedBytes`, `y`, is use (given that query 
does not have `maxQueuedBytes` in the
 context). If query does have `maxQueuedBytes` in the context, then that value 
is use instead.
 
-### TopN query config
-
-|Property|Description|Default|
-|--------|-----------|-------|
-|`druid.query.topN.minTopNThreshold`|See [TopN 
Aliasing](../querying/topnquery.md#aliasing) for details.|1000|
-
 ### Search query config
 
 |Property|Description|Default|
diff --git a/docs/querying/topnquery.md b/docs/querying/topnquery.md
index fe03532314e..c9c0f7b62e2 100644
--- a/docs/querying/topnquery.md
+++ b/docs/querying/topnquery.md
@@ -171,7 +171,7 @@ See [Multi-value dimensions](multi-value-dimensions.md) for 
more details.
 
 The current TopN algorithm is an approximate algorithm. The top 1000 local 
results from each segment are returned for merging to determine the global 
topN. As such, the topN algorithm is approximate in both rank and results. 
Approximate results *ONLY APPLY WHEN THERE ARE MORE THAN 1000 DIM VALUES*. A 
topN over a dimension with fewer than 1000 unique dimension values can be 
considered accurate in rank and accurate in aggregates.
 
-The threshold can be modified from its default 1000 via the server parameter 
`druid.query.topN.minTopNThreshold`, which needs a restart of the servers to 
take effect, or via `minTopNThreshold` in the query context, which takes effect 
per query.
+The threshold can be modified from its default 1000 via `minTopNThreshold` in 
the query context, which takes effect per query.
 
 If you are wanting the top 100 of a high cardinality, uniformly distributed 
dimension ordered by some low-cardinality, uniformly distributed dimension, you 
are potentially going to get aggregates back that are missing data.
 
diff --git 
a/processing/src/main/java/org/apache/druid/query/topn/TopNQueryConfig.java 
b/processing/src/main/java/org/apache/druid/query/topn/TopNQueryConfig.java
index 2793b270b8a..a50c937f3c7 100644
--- a/processing/src/main/java/org/apache/druid/query/topn/TopNQueryConfig.java
+++ b/processing/src/main/java/org/apache/druid/query/topn/TopNQueryConfig.java
@@ -19,22 +19,14 @@
 
 package org.apache.druid.query.topn;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-import javax.validation.constraints.Min;
-
 /**
+ * Configuration for TopN queries.
+ *
+ * The minTopNThreshold setting has been moved to the query context parameter
+ * {@link org.apache.druid.query.QueryContexts#MIN_TOP_N_THRESHOLD}.
+ * This class is kept for backwards compatibility and to hold the default 
constant.
  */
 public class TopNQueryConfig
 {
   public static final int DEFAULT_MIN_TOPN_THRESHOLD = 1000;
-
-  @JsonProperty
-  @Min(1)
-  private int minTopNThreshold = DEFAULT_MIN_TOPN_THRESHOLD;
-
-  public int getMinTopNThreshold()
-  {
-    return minTopNThreshold;
-  }
 }
diff --git 
a/processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java
 
b/processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java
index 7b46e404676..fd98fb94005 100644
--- 
a/processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java
+++ 
b/processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java
@@ -451,8 +451,7 @@ public class TopNQueryQueryToolChest extends 
QueryToolChest<Result<TopNResultVal
   public QueryRunner<Result<TopNResultValue>> postMergeQueryDecoration(final 
QueryRunner<Result<TopNResultValue>> runner)
   {
     final ThresholdAdjustingQueryRunner thresholdRunner = new 
ThresholdAdjustingQueryRunner(
-        runner,
-        config
+        runner
     );
     return new QueryRunner<>()
     {
@@ -605,15 +604,12 @@ public class TopNQueryQueryToolChest extends 
QueryToolChest<Result<TopNResultVal
   static class ThresholdAdjustingQueryRunner implements 
QueryRunner<Result<TopNResultValue>>
   {
     private final QueryRunner<Result<TopNResultValue>> runner;
-    private final TopNQueryConfig config;
 
     public ThresholdAdjustingQueryRunner(
-        QueryRunner<Result<TopNResultValue>> runner,
-        TopNQueryConfig config
+        QueryRunner<Result<TopNResultValue>> runner
     )
     {
       this.runner = runner;
-      this.config = config;
     }
 
     @Override
@@ -629,7 +625,7 @@ public class TopNQueryQueryToolChest extends 
QueryToolChest<Result<TopNResultVal
 
       final TopNQuery query = (TopNQuery) input;
       final int minTopNThreshold = query.context()
-                                        
.getInt(QueryContexts.MIN_TOP_N_THRESHOLD, config.getMinTopNThreshold());
+                                        
.getInt(QueryContexts.MIN_TOP_N_THRESHOLD, 
TopNQueryConfig.DEFAULT_MIN_TOPN_THRESHOLD);
       if (query.getThreshold() > minTopNThreshold) {
         return runner.run(queryPlus, responseContext);
       }
diff --git 
a/processing/src/test/java/org/apache/druid/query/topn/TopNQueryQueryToolChestTest.java
 
b/processing/src/test/java/org/apache/druid/query/topn/TopNQueryQueryToolChestTest.java
index b120bdeea4b..6d791cc1a0b 100644
--- 
a/processing/src/test/java/org/apache/druid/query/topn/TopNQueryQueryToolChestTest.java
+++ 
b/processing/src/test/java/org/apache/druid/query/topn/TopNQueryQueryToolChestTest.java
@@ -280,16 +280,16 @@ public class TopNQueryQueryToolChestTest extends 
InitializedNullHandlingTest
 
       TopNQuery query1 = builder.threshold(10).context(null).build();
       MockQueryRunner mockRunner = new MockQueryRunner(runner);
-      new TopNQueryQueryToolChest.ThresholdAdjustingQueryRunner(mockRunner, 
config).run(QueryPlus.wrap(query1));
+      new 
TopNQueryQueryToolChest.ThresholdAdjustingQueryRunner(mockRunner).run(QueryPlus.wrap(query1));
       Assert.assertEquals(1000, mockRunner.query.getThreshold());
 
       TopNQuery query2 = builder.threshold(10).context(context).build();
 
-      new TopNQueryQueryToolChest.ThresholdAdjustingQueryRunner(mockRunner, 
config).run(QueryPlus.wrap(query2));
+      new 
TopNQueryQueryToolChest.ThresholdAdjustingQueryRunner(mockRunner).run(QueryPlus.wrap(query2));
       Assert.assertEquals(500, mockRunner.query.getThreshold());
 
       TopNQuery query3 = builder.threshold(2000).context(context).build();
-      new TopNQueryQueryToolChest.ThresholdAdjustingQueryRunner(mockRunner, 
config).run(QueryPlus.wrap(query3));
+      new 
TopNQueryQueryToolChest.ThresholdAdjustingQueryRunner(mockRunner).run(QueryPlus.wrap(query3));
       Assert.assertEquals(2000, mockRunner.query.getThreshold());
     }
   }
diff --git a/server/src/test/java/org/apache/druid/server/QueryStackTests.java 
b/server/src/test/java/org/apache/druid/server/QueryStackTests.java
index 8e1372add6f..2659f12def7 100644
--- a/server/src/test/java/org/apache/druid/server/QueryStackTests.java
+++ b/server/src/test/java/org/apache/druid/server/QueryStackTests.java
@@ -272,25 +272,29 @@ public class QueryStackTests
    * Returns a new {@link QueryRunnerFactoryConglomerate}. Adds relevant 
closeables to the passed-in {@link Closer}.
    */
   public static QueryRunnerFactoryConglomerate 
createQueryRunnerFactoryConglomerate(final Closer closer)
-  {
-    return createQueryRunnerFactoryConglomerate(closer, 
TopNQueryConfig.DEFAULT_MIN_TOPN_THRESHOLD);
-  }
-
-  public static QueryRunnerFactoryConglomerate 
createQueryRunnerFactoryConglomerate(
-      final Closer closer,
-      final Integer minTopNThreshold
-  )
   {
     return createQueryRunnerFactoryConglomerate(
         closer,
         getProcessingConfig(
             DEFAULT_NUM_MERGE_BUFFERS
         ),
-        minTopNThreshold,
         TestHelper.makeJsonMapper()
     );
   }
 
+  /**
+   * @deprecated The minTopNThreshold parameter is no longer used. Use query 
context to set minTopNThreshold.
+   */
+  @Deprecated
+  @SuppressWarnings("unused")
+  public static QueryRunnerFactoryConglomerate 
createQueryRunnerFactoryConglomerate(
+      final Closer closer,
+      final Integer minTopNThreshold
+  )
+  {
+    return createQueryRunnerFactoryConglomerate(closer);
+  }
+
   public static QueryRunnerFactoryConglomerate 
createQueryRunnerFactoryConglomerate(
       final Closer closer,
       final DruidProcessingConfig processingConfig
@@ -299,7 +303,6 @@ public class QueryStackTests
     return createQueryRunnerFactoryConglomerate(
         closer,
         processingConfig,
-        TopNQueryConfig.DEFAULT_MIN_TOPN_THRESHOLD,
         TestHelper.makeJsonMapper()
     );
   }
@@ -324,7 +327,6 @@ public class QueryStackTests
   public static QueryRunnerFactoryConglomerate 
createQueryRunnerFactoryConglomerate(
       final Closer closer,
       final DruidProcessingConfig processingConfig,
-      final Integer minTopNThreshold,
       final ObjectMapper jsonMapper
   )
   {
@@ -333,23 +335,34 @@ public class QueryStackTests
 
     return createQueryRunnerFactoryConglomerate(
         processingConfig,
-        minTopNThreshold,
         jsonMapper,
         testBufferPool,
         groupByBuffers);
   }
 
-
+  /**
+   * @deprecated The minTopNThreshold parameter is no longer used. Use query 
context to set minTopNThreshold.
+   */
+  @Deprecated
+  @SuppressWarnings("unused")
   public static QueryRunnerFactoryConglomerate 
createQueryRunnerFactoryConglomerate(
+      final Closer closer,
       final DruidProcessingConfig processingConfig,
       final Integer minTopNThreshold,
+      final ObjectMapper jsonMapper
+  )
+  {
+    return createQueryRunnerFactoryConglomerate(closer, processingConfig, 
jsonMapper);
+  }
+
+  public static QueryRunnerFactoryConglomerate 
createQueryRunnerFactoryConglomerate(
+      final DruidProcessingConfig processingConfig,
       final ObjectMapper jsonMapper,
       final TestBufferPool testBufferPool,
       final TestGroupByBuffers groupByBuffers)
   {
     ImmutableMap<Class<? extends Query>, QueryRunnerFactory> factories = 
makeDefaultQueryRunnerFactories(
         processingConfig,
-        minTopNThreshold,
         jsonMapper,
         testBufferPool,
         groupByBuffers
@@ -365,10 +378,24 @@ public class QueryStackTests
     return conglomerate;
   }
 
+  /**
+   * @deprecated The minTopNThreshold parameter is no longer used. Use query 
context to set minTopNThreshold.
+   */
+  @Deprecated
+  @SuppressWarnings("unused")
+  public static QueryRunnerFactoryConglomerate 
createQueryRunnerFactoryConglomerate(
+      final DruidProcessingConfig processingConfig,
+      final Integer minTopNThreshold,
+      final ObjectMapper jsonMapper,
+      final TestBufferPool testBufferPool,
+      final TestGroupByBuffers groupByBuffers)
+  {
+    return createQueryRunnerFactoryConglomerate(processingConfig, jsonMapper, 
testBufferPool, groupByBuffers);
+  }
+
   @SuppressWarnings("rawtypes")
   public static ImmutableMap<Class<? extends Query>, QueryRunnerFactory> 
makeDefaultQueryRunnerFactories(
       final DruidProcessingConfig processingConfig,
-      final Integer minTopNThreshold,
       final ObjectMapper jsonMapper,
       final TestBufferPool testBufferPool,
       final TestGroupByBuffers groupByBuffers)
@@ -420,14 +447,7 @@ public class QueryStackTests
             TopNQuery.class,
             new TopNQueryRunnerFactory(
                 testBufferPool,
-                new TopNQueryQueryToolChest(new TopNQueryConfig()
-                {
-                  @Override
-                  public int getMinTopNThreshold()
-                  {
-                    return minTopNThreshold;
-                  }
-                }),
+                new TopNQueryQueryToolChest(new TopNQueryConfig()),
                 QueryRunnerTestHelper.NOOP_QUERYWATCHER
             )
         )
diff --git 
a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java 
b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java
index 8aab634527b..f5ace8e84eb 100644
--- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java
+++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java
@@ -86,7 +86,6 @@ import org.apache.druid.server.security.AuthorizationResult;
 import org.apache.druid.sql.calcite.DecoupledTestConfig.IgnoreQueriesReason;
 import org.apache.druid.sql.calcite.DecoupledTestConfig.QuidemTestCaseReason;
 import org.apache.druid.sql.calcite.NotYetSupported.Modes;
-import org.apache.druid.sql.calcite.SqlTestFrameworkConfig.MinTopNThreshold;
 import org.apache.druid.sql.calcite.expression.DruidExpression;
 import org.apache.druid.sql.calcite.filtration.Filtration;
 import org.apache.druid.sql.calcite.planner.PlannerConfig;
@@ -123,13 +122,13 @@ public class CalciteJoinQueryTest extends 
BaseCalciteQueryTest
     return false;
   }
 
-  @MinTopNThreshold(1)
   @Test
   public void testInnerJoinWithLimitAndAlias()
   {
 
     Map<String, Object> context = new HashMap<>(QUERY_CONTEXT_DEFAULT);
     context.put(PlannerConfig.CTX_KEY_USE_APPROXIMATE_TOPN, false);
+    context.put(QueryContexts.MIN_TOP_N_THRESHOLD, 1);
     testQuery(
         "select t1.b1 from (select __time as b1 from numfoo group by 1 order 
by 1) as t1 inner join (\n"
         + "  select __time as b2 from foo group by 1 order by 1\n"
@@ -185,7 +184,6 @@ public class CalciteJoinQueryTest extends 
BaseCalciteQueryTest
 
   // Adjust topN threshold, so that the topN engine keeps only 1 slot for 
aggregates, which should be enough
   // to compute the query with limit 1.
-  @SqlTestFrameworkConfig.MinTopNThreshold(1)
   @Test
   @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.EQUIV_PLAN)
   public void testExactTopNOnInnerJoinWithLimit()
@@ -193,6 +191,7 @@ public class CalciteJoinQueryTest extends 
BaseCalciteQueryTest
     Map<String, Object> context = new HashMap<>(QUERY_CONTEXT_DEFAULT);
     context.put(PlannerConfig.CTX_KEY_USE_APPROXIMATE_TOPN, false);
     context.put(PlannerConfig.CTX_KEY_USE_LEXICOGRAPHIC_TOPN, true);
+    context.put(QueryContexts.MIN_TOP_N_THRESHOLD, 1);
     testQuery(
         "select f1.\"dim4\", sum(\"m1\") from numfoo f1 inner join (\n"
         + "  select \"dim4\" from numfoo where dim4 <> 'a' group by 1\n"
@@ -5805,12 +5804,12 @@ public class CalciteJoinQueryTest extends 
BaseCalciteQueryTest
     );
   }
 
-  @SqlTestFrameworkConfig.MinTopNThreshold(1)
   @Test
   public void testJoinWithAliasAndOrderByNoGroupBy()
   {
     Map<String, Object> context = new HashMap<>(QUERY_CONTEXT_DEFAULT);
     context.put(PlannerConfig.CTX_KEY_USE_APPROXIMATE_TOPN, false);
+    context.put(QueryContexts.MIN_TOP_N_THRESHOLD, 1);
     testQuery(
         "select t1.__time from druid.foo as t1 join\n"
         + "  druid.numfoo as t2 on t1.dim2 = t2.dim2\n"
diff --git 
a/sql/src/test/java/org/apache/druid/sql/calcite/SqlTestFrameworkConfig.java 
b/sql/src/test/java/org/apache/druid/sql/calcite/SqlTestFrameworkConfig.java
index 87919839a02..59b2c8e0683 100644
--- a/sql/src/test/java/org/apache/druid/sql/calcite/SqlTestFrameworkConfig.java
+++ b/sql/src/test/java/org/apache/druid/sql/calcite/SqlTestFrameworkConfig.java
@@ -30,7 +30,6 @@ import com.google.common.collect.Sets;
 import org.apache.druid.error.DruidException;
 import org.apache.druid.java.util.common.IAE;
 import org.apache.druid.java.util.common.StringUtils;
-import org.apache.druid.query.topn.TopNQueryConfig;
 import org.apache.druid.server.QueryStackTests;
 import org.apache.druid.sql.calcite.util.CacheTestHelperModule.ResultCacheMode;
 import org.apache.druid.sql.calcite.util.FakeIndexTaskUtil;
@@ -81,7 +80,7 @@ import java.util.stream.Collectors;
  * Specifies current framework settings.
  *
  * Intended usage from tests is via the annotations:
- *   @SqlTestFrameworkConfig.MinTopNThreshold(33)
+ *   @SqlTestFrameworkConfig.NumMergeBuffers(3)
  *
  * In case of annotations used; it picks up all annotations from:
  *  * the method
@@ -112,23 +111,6 @@ public class SqlTestFrameworkConfig
     int value();
   }
 
-  @Retention(RetentionPolicy.RUNTIME)
-  @Target({ElementType.METHOD, ElementType.TYPE})
-  @MinTopNThreshold(TopNQueryConfig.DEFAULT_MIN_TOPN_THRESHOLD)
-  public @interface MinTopNThreshold
-  {
-    ConfigOptionProcessor<Integer> PROCESSOR = new 
ConfigOptionProcessor<>(MinTopNThreshold.class)
-    {
-      @Override
-      public Integer fromString(String str) throws NumberFormatException
-      {
-        return Integer.valueOf(str);
-      }
-    };
-
-    int value();
-  }
-
   @Retention(RetentionPolicy.RUNTIME)
   @Target({ElementType.METHOD, ElementType.TYPE})
   @ResultCache(ResultCacheMode.DISABLED)
@@ -194,14 +176,12 @@ public class SqlTestFrameworkConfig
 
   private static final Set<String> KNOWN_CONFIG_KEYS = 
ImmutableSet.<String>builder()
       .add(NumMergeBuffers.PROCESSOR.getConfigName())
-      .add(MinTopNThreshold.PROCESSOR.getConfigName())
       .add(ResultCache.PROCESSOR.getConfigName())
       .add(ComponentSupplier.PROCESSOR.getConfigName())
       .add(Datasets.PROCESSOR.getConfigName())
       .build();
 
   public final int numMergeBuffers;
-  public final int minTopNThreshold;
   public final ResultCacheMode resultCache;
   public final Class<? extends QueryComponentSupplier> componentSupplier;
   public final String datasets;
@@ -211,7 +191,6 @@ public class SqlTestFrameworkConfig
   {
     try {
       numMergeBuffers = NumMergeBuffers.PROCESSOR.fromAnnotations(annotations);
-      minTopNThreshold = 
MinTopNThreshold.PROCESSOR.fromAnnotations(annotations);
       resultCache = ResultCache.PROCESSOR.fromAnnotations(annotations);
       componentSupplier = 
ComponentSupplier.PROCESSOR.fromAnnotations(annotations);
       datasets = Datasets.PROCESSOR.fromAnnotations(annotations);
@@ -226,7 +205,6 @@ public class SqlTestFrameworkConfig
     validateConfigKeys(queryParams.keySet());
     try {
       numMergeBuffers = NumMergeBuffers.PROCESSOR.fromMap(queryParams);
-      minTopNThreshold = MinTopNThreshold.PROCESSOR.fromMap(queryParams);
       resultCache = ResultCache.PROCESSOR.fromMap(queryParams);
       componentSupplier = ComponentSupplier.PROCESSOR.fromMap(queryParams);
       datasets = Datasets.PROCESSOR.fromMap(queryParams);
@@ -248,7 +226,7 @@ public class SqlTestFrameworkConfig
   @Override
   public int hashCode()
   {
-    return Objects.hash(minTopNThreshold, numMergeBuffers, resultCache, 
componentSupplier, datasets);
+    return Objects.hash(numMergeBuffers, resultCache, componentSupplier, 
datasets);
   }
 
   @Override
@@ -258,8 +236,7 @@ public class SqlTestFrameworkConfig
       return false;
     }
     SqlTestFrameworkConfig other = (SqlTestFrameworkConfig) obj;
-    return minTopNThreshold == other.minTopNThreshold
-        && numMergeBuffers == other.numMergeBuffers
+    return numMergeBuffers == other.numMergeBuffers
         && resultCache == other.resultCache
         && componentSupplier == other.componentSupplier
         && Objects.equals(datasets, other.datasets);
@@ -396,7 +373,6 @@ public class SqlTestFrameworkConfig
       SqlTestFramework.Builder builder = new SqlTestFramework.Builder(testHost)
           .withConfig(config)
           .catalogResolver(testHost.createCatalogResolver())
-          .minTopNThreshold(config.minTopNThreshold)
           .mergeBufferCount(config.numMergeBuffers)
           .withOverrideModule(config.resultCache.makeModule());
 
@@ -446,9 +422,6 @@ public class SqlTestFrameworkConfig
     if (def.numMergeBuffers != numMergeBuffers) {
       map.put("numMergeBuffers", String.valueOf(numMergeBuffers));
     }
-    if (def.minTopNThreshold != minTopNThreshold) {
-      map.put("minTopNThreshold", String.valueOf(minTopNThreshold));
-    }
     if (def.componentSupplier != componentSupplier) {
       map.put("componentSupplier", componentSupplier.getSimpleName());
     }
@@ -460,7 +433,6 @@ public class SqlTestFrameworkConfig
 
   public static SqlTestFrameworkConfig fromURL(String url)
   {
-
     Map<String, String> queryParams;
     queryParams = new HashMap<>();
     try {
diff --git 
a/sql/src/test/java/org/apache/druid/sql/calcite/SqlTestFrameworkConfigTest.java
 
b/sql/src/test/java/org/apache/druid/sql/calcite/SqlTestFrameworkConfigTest.java
index 9b727fd9eaf..4d76ce684b6 100644
--- 
a/sql/src/test/java/org/apache/druid/sql/calcite/SqlTestFrameworkConfigTest.java
+++ 
b/sql/src/test/java/org/apache/druid/sql/calcite/SqlTestFrameworkConfigTest.java
@@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableMap;
 import nl.jqno.equalsverifier.EqualsVerifier;
 import org.apache.druid.java.util.common.IAE;
 import 
org.apache.druid.sql.calcite.DrillWindowQueryTest.DrillComponentSupplier;
-import org.apache.druid.sql.calcite.SqlTestFrameworkConfig.MinTopNThreshold;
 import org.apache.druid.sql.calcite.SqlTestFrameworkConfig.NumMergeBuffers;
 import org.apache.druid.sql.calcite.SqlTestFrameworkConfig.ResultCache;
 import org.apache.druid.sql.calcite.util.CacheTestHelperModule.ResultCacheMode;
@@ -54,7 +53,6 @@ public class SqlTestFrameworkConfigTest
   @NumMergeBuffers(3)
   static class C extends B
   {
-    @MinTopNThreshold(1)
     public void imaginaryTestMethod1()
     {
     }
@@ -64,7 +62,6 @@ public class SqlTestFrameworkConfigTest
     }
   }
 
-  @MinTopNThreshold(2)
   static class D extends C
   {
     @NumMergeBuffers(1)
@@ -74,7 +71,6 @@ public class SqlTestFrameworkConfigTest
 
     @ResultCache(ResultCacheMode.DISABLED)
     @NumMergeBuffers(1)
-    @MinTopNThreshold(1)
     public void imaginaryTestMethod4()
     {
     }
@@ -86,7 +82,6 @@ public class SqlTestFrameworkConfigTest
     List<Annotation> annotations = SqlTestFrameworkConfig
         .collectAnnotations(C.class, 
D.class.getMethod("imaginaryTestMethod1"));
     SqlTestFrameworkConfig config = new SqlTestFrameworkConfig(annotations);
-    assertEquals(1, config.minTopNThreshold);
     assertEquals(3, config.numMergeBuffers);
     assertEquals(ResultCacheMode.ENABLED, config.resultCache);
   }
@@ -97,7 +92,6 @@ public class SqlTestFrameworkConfigTest
     List<Annotation> annotations = SqlTestFrameworkConfig
         .collectAnnotations(D.class, 
D.class.getMethod("imaginaryTestMethod2"));
     SqlTestFrameworkConfig config = new SqlTestFrameworkConfig(annotations);
-    assertEquals(2, config.minTopNThreshold);
     assertEquals(3, config.numMergeBuffers);
     assertEquals(ResultCacheMode.ENABLED, config.resultCache);
   }
@@ -108,7 +102,6 @@ public class SqlTestFrameworkConfigTest
     List<Annotation> annotations = SqlTestFrameworkConfig
         .collectAnnotations(D.class, 
D.class.getMethod("imaginaryTestMethod3"));
     SqlTestFrameworkConfig config = new SqlTestFrameworkConfig(annotations);
-    assertEquals(2, config.minTopNThreshold);
     assertEquals(1, config.numMergeBuffers);
     assertEquals(ResultCacheMode.ENABLED, config.resultCache);
   }
@@ -119,7 +112,6 @@ public class SqlTestFrameworkConfigTest
     List<Annotation> annotations = SqlTestFrameworkConfig
         .collectAnnotations(D.class, 
D.class.getMethod("imaginaryTestMethod4"));
     SqlTestFrameworkConfig config = new SqlTestFrameworkConfig(annotations);
-    assertEquals(1, config.minTopNThreshold);
     assertEquals(1, config.numMergeBuffers);
     assertEquals(ResultCacheMode.DISABLED, config.resultCache);
   }
@@ -136,7 +128,7 @@ public class SqlTestFrameworkConfigTest
     );
 
     assertEquals(
-        "Invalid configuration key(s) specified [[nonExistent]]; valid options 
are [[numMergeBuffers, minTopNThreshold, resultCache, componentSupplier, 
datasets]]",
+        "Invalid configuration key(s) specified [[nonExistent]]; valid options 
are [[numMergeBuffers, resultCache, componentSupplier, datasets]]",
         e.getMessage()
     );
   }
diff --git 
a/sql/src/test/java/org/apache/druid/sql/calcite/util/SqlTestFramework.java 
b/sql/src/test/java/org/apache/druid/sql/calcite/util/SqlTestFramework.java
index 607b159ad8f..5838f9a2eb8 100644
--- a/sql/src/test/java/org/apache/druid/sql/calcite/util/SqlTestFramework.java
+++ b/sql/src/test/java/org/apache/druid/sql/calcite/util/SqlTestFramework.java
@@ -449,16 +449,9 @@ public class SqlTestFramework
 
                 @Provides
                 @LazySingleton
-                public TopNQueryConfig makeTopNQueryConfig(Builder builder)
+                public TopNQueryConfig makeTopNQueryConfig()
                 {
-                  return new TopNQueryConfig()
-                  {
-                    @Override
-                    public int getMinTopNThreshold()
-                    {
-                      return builder.minTopNThreshold;
-                    }
-                  };
+                  return new TopNQueryConfig();
                 }
 
                 @Provides
@@ -757,7 +750,6 @@ public class SqlTestFramework
   public static class Builder
   {
     private final QueryComponentSupplier componentSupplier;
-    private int minTopNThreshold = TopNQueryConfig.DEFAULT_MIN_TOPN_THRESHOLD;
     private int mergeBufferCount;
     private CatalogResolver catalogResolver = CatalogResolver.NULL_RESOLVER;
     private List<Module> overrideModules = new ArrayList<>();
@@ -769,12 +761,6 @@ public class SqlTestFramework
       this.componentSupplier = componentSupplier;
     }
 
-    public Builder minTopNThreshold(int minTopNThreshold)
-    {
-      this.minTopNThreshold = minTopNThreshold;
-      return this;
-    }
-
     public Builder mergeBufferCount(int mergeBufferCount)
     {
       this.mergeBufferCount = mergeBufferCount;
diff --git 
a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit.iq
 
b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit.iq
index 65fa54a6d70..32af61ad6c6 100644
--- 
a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit.iq
+++ 
b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit.iq
@@ -1,15 +1,16 @@
-# testExactTopNOnInnerJoinWithLimit case-crc:2128ebbe
+# testExactTopNOnInnerJoinWithLimit case-crc:f16f81b5
 # quidem testcase reason: EQUIV_PLAN
 !set debug true
 !set defaultTimeout 300000
 !set maxScatterGatherBytes 9223372036854775807
+!set minTopNThreshold 1
 !set plannerStrategy DECOUPLED
 !set sqlCurrentTimestamp 2000-01-01T00:00:00Z
 !set sqlQueryId dummy
 !set useApproximateTopN false
 !set useLexicographicTopN true
 !set outputformat mysql
-!use druidtest:///?minTopNThreshold=1
+!use druidtest:///
 select f1."dim4", sum("m1") from numfoo f1 inner join (
   select "dim4" from numfoo where dim4 <> 'a' group by 1
 ) f2 on f1."dim4" = f2."dim4" group by 1 limit 1;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to