Skip to content

Commit aa0ae82

Browse files
committed
Cover PPL_REX_MAX_MATCH_LIMIT in UnifiedQueryContextTest
Pins two behaviors the previous commits introduced: * `testContextCreationWithDefaults` now asserts that `PPL_REX_MAX_MATCH_LIMIT` resolves to its static default of 10 — the fallback value `AstBuilder.visitRexCommand` reads when no cluster-side override is present. * `testContextCreationWithCustomConfig` now asserts that `setting("plugins.ppl.rex.max_match.limit", 5)` reaches `getSettingValue(PPL_REX_MAX_MATCH_LIMIT)` — the path the REST handler uses to forward an operator-configured cluster value into the unified-path settings map. Folds the two assertions into the existing default / custom-config tests rather than adding new test methods, per review feedback. Signed-off-by: Jialiang Liang <jiallian@amazon.com>
1 parent a74bbaf commit aa0ae82

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

api/src/test/java/org/opensearch/sql/api/UnifiedQueryContextTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public void testContextCreationWithDefaults() {
3333
"Settings should have default system limits",
3434
SysLimit.DEFAULT,
3535
SysLimit.fromSettings(context.getSettings()));
36+
assertEquals(
37+
"PPL_REX_MAX_MATCH_LIMIT default should be 10",
38+
Integer.valueOf(10),
39+
context.getSettings().getSettingValue(PPL_REX_MAX_MATCH_LIMIT));
3640
}
3741

3842
@Test
@@ -43,10 +47,15 @@ public void testContextCreationWithCustomConfig() {
4347
.catalog("opensearch", testSchema)
4448
.cacheMetadata(true)
4549
.setting("plugins.query.size_limit", 200)
50+
.setting("plugins.ppl.rex.max_match.limit", 5)
4651
.build();
4752

4853
Integer querySizeLimit = context.getSettings().getSettingValue(QUERY_SIZE_LIMIT);
4954
assertEquals("Custom setting should be applied", Integer.valueOf(200), querySizeLimit);
55+
assertEquals(
56+
"Cluster-side override for PPL_REX_MAX_MATCH_LIMIT should reach the unified path",
57+
Integer.valueOf(5),
58+
context.getSettings().getSettingValue(PPL_REX_MAX_MATCH_LIMIT));
5059
}
5160

5261
@Test(expected = IllegalArgumentException.class)

0 commit comments

Comments
 (0)