If you are working on contributing a new PPL command, please read this guide and review all items in the checklist are done before code review. You also can leverage this checklist to guide how to add new PPL command.
-
Open an RFC issue before starting to code:
- Describe the purpose of the new command
- Include at least syntax definition, usage and examples
- Implementation options are welcome if you have multiple ways to implement it
-
Obtain PM review approval for the RFC:
- If PM unavailable, consult repository maintainers as alternative
- An offline meeting might be required to discuss the syntax and usage
-
Lexer/Parser Updates:
- Add new keywords to OpenSearchPPLLexer.g4
- Add grammar rules to OpenSearchPPLParser.g4
- Update
commandNameandkeywordsCanBeId
-
AST Implementation:
- Add new tree nodes under package
org.opensearch.sql.ast.tree - Prefer reusing
Argumentfor command arguments over creating new expression nodes underorg.opensearch.sql.ast.expression
- Add new tree nodes under package
-
Visitor Pattern:
- Add
visit*inAbstractNodeVisitor - Overriding
visit*inAnalyzer,CalciteRelNodeVisitorandPPLQueryDataAnonymizer
- Add
-
Unit Tests:
- Extend
CalcitePPLAbstractTest - Keep test queries minimal
- Include
verifyLogical()andverifyPPLToSparkSQL()
- Extend
-
Integration tests (pushdown):
- Extend
PPLIntegTestCase - Use complex real-world queries
- Include
verifySchema()andverifyDataRows()
- Extend
-
Integration tests (Non-pushdown):
- Add test class to
CalciteNoPushdownIT
- Add test class to
-
Explain tests:
- Add tests to
ExplainITorCalciteExplainIT
- Add tests to
-
Unsupported in v2 test:
- Add a test in
NewAddedCommandsIT
- Add a test in
-
Anonymizer tests:
- Add a test in
PPLQueryDataAnonymizerTest
- Add a test in
-
Cross-cluster Tests (optional, nice to have):
- Add a test in
CrossClusterSearchIT, or inCalciteCrossClusterSearchITif the command requires Calcite.
- Add a test in
-
User doc:
- Add a xxx.md under
docs/user/ppl/cmdand link the new doc todocs/user/ppl/index.md
- Add a xxx.md under