opensearch-project / opensearch-project/sql

[FEATURE] Scope OpenSearch-only PPL functions to OpenSearch adapter & data sources

Open
#4,769 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement feature PPL
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 PPLBuiltinOperatos must 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.