opensearch-project / opensearch-project/sql
[FEATURE] Scope OpenSearch-only PPL functions to OpenSearch adapter & data sources
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 176
- Forks
- 229
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 43
Description
Is your feature request related to a problem?
OpenSearch-only PPL functions (e.g., match, query_string, etc.) are currently hard-coded in the ANTLR grammar and registered in the PPL-Calcite function registry as if they were universally available. This lets queries that use full-text search functions pass parsing and semantic checks even when no OpenSearch data source is referenced, only to fail at runtime.
What solution would you like?
Scope OpenSearch-only functions so they are only valid when the OpenSearch adapter is plugged in and the query actually involves an OpenSearch data source. In all other cases, function resolution should fail during analysis with a clear syntax/analysis error message.
What alternatives have you considered?
- Maintain a list for functions from
PPLBuiltinOperatosmust not be registered for non-OpenSearch engine. - Add a validator to detect OpenSearch-only functions and guard runtime by failing early.
Do you have any additional context?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the ANTLR grammar and the PPL-Calcite function registry, then compare the proposed FunctionCatalog and Calcite adapter approaches. Verify how the active data source is identified and how function resolution reports errors. Done means OpenSearch-only functions resolve only for OpenSearch queries and fail clearly during analysis otherwise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- backend-api-design, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100