Skip to content

Commit d70dc77

Browse files
committed
Move some stuff around
Signed-off-by: Simeon Widdis <[email protected]>
1 parent 824ee95 commit d70dc77

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

ppl/src/main/antlr/OpenSearchPPLParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ topCommand
306306
;
307307

308308
rareCommand
309-
: RARE (number = integerLiteral)? (COUNTFIELD EQUAL countfield = stringLiteral)? (SHOWCOUNT EQUAL showcount = booleanLiteral)? fieldList (byClause)?
309+
: RARE ((LIMIT EQUAL)? number = integerLiteral)? (COUNTFIELD EQUAL countfield = stringLiteral)? (SHOWCOUNT EQUAL showcount = booleanLiteral)? fieldList (byClause)?
310310
;
311311

312312
grokCommand

ppl/src/test/java/org/opensearch/sql/ppl/AstPlanningTest.java renamed to ppl/src/test/java/org/opensearch/sql/ppl/AstPlanningTestBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import org.opensearch.sql.ppl.parser.AstBuilder;
1313

1414
/** Base class for tests for the AST query planner. */
15-
public class AstPlanningTest {
15+
public class AstPlanningTestBase {
1616
protected final Settings settings = Mockito.mock(Settings.class);
1717
protected final PPLSyntaxParser parser = new PPLSyntaxParser();
1818

ppl/src/test/java/org/opensearch/sql/ppl/parser/AstBuilderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@
7676
import org.opensearch.sql.ast.tree.RareTopN.CommandType;
7777
import org.opensearch.sql.common.antlr.SyntaxCheckException;
7878
import org.opensearch.sql.common.setting.Settings.Key;
79-
import org.opensearch.sql.ppl.AstPlanningTest;
79+
import org.opensearch.sql.ppl.AstPlanningTestBase;
8080
import org.opensearch.sql.utils.SystemIndexUtils;
8181

82-
public class AstBuilderTest extends AstPlanningTest {
82+
public class AstBuilderTest extends AstPlanningTestBase {
8383

8484
@Rule public ExpectedException exceptionRule = ExpectedException.none();
8585

ppl/src/test/java/org/opensearch/sql/ppl/parser/AstEquivalenceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import static org.junit.Assert.assertEquals;
99

1010
import org.junit.Test;
11-
import org.opensearch.sql.ppl.AstPlanningTest;
11+
import org.opensearch.sql.ppl.AstPlanningTestBase;
1212

13-
public class AstEquivalenceTest extends AstPlanningTest {
13+
public class AstEquivalenceTest extends AstPlanningTestBase {
1414
@Test
1515
public void testSpathArgumentDeshuffle() {
1616
assertEquals(plan("source = t | spath path=a input=a"), plan("source = t | spath input=a a"));

ppl/src/test/java/org/opensearch/sql/ppl/utils/SPathRewriteTest.java renamed to ppl/src/test/java/org/opensearch/sql/ppl/rewrite/SpathRewriteTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
package org.opensearch.sql.ppl.utils;
6+
package org.opensearch.sql.ppl.rewrite;
77

88
import static org.junit.Assert.assertEquals;
99
import static org.opensearch.sql.ast.dsl.AstDSL.eval;
@@ -17,9 +17,9 @@
1717
import org.junit.Test;
1818
import org.opensearch.sql.ast.tree.Eval;
1919
import org.opensearch.sql.ast.tree.SPath;
20-
import org.opensearch.sql.ppl.AstPlanningTest;
20+
import org.opensearch.sql.ppl.AstPlanningTestBase;
2121

22-
public class SPathRewriteTest extends AstPlanningTest {
22+
public class SpathRewriteTest extends AstPlanningTestBase {
2323
// Control test to make sure something fundamental hasn't changed about the json_extract parsing
2424
@Test
2525
public void testEvalControl() {

0 commit comments

Comments
 (0)