Skip to content

Conversation

@elbinpallimalilibm
Copy link
Contributor

Description

This PR adds a new read only connector for Opensearch

Motivation and Context

We had a need to run federated queries that also retrieved values from indices in Opensearch instances. This OpenSearch connector enables Presto to query OpenSearch indices using SQL syntax with support for vector similarity search via k-NN plugin and nested field access using dot notation.

Basic OpenSearch Index Querying

Query OpenSearch indices using standard SQL syntax:

SELECT _id, title, category, price
FROM opensearch.default.products
WHERE category = 'electronics' AND price > 100
ORDER BY price DESC
LIMIT 10;

Vector Search Table Function

Execute k-NN vector similarity searches directly in SQL using the table function syntax:

SELECT * FROM TABLE(opensearch.system.knn_search(
  index_name => 'documents',
  vector_field => 'embedding',
  query_vector => ARRAY[0.1, 0.2, 0.3],
  k => 10
)) ORDER BY _score DESC;

Nested Field Access with Dot Notation

Query nested JSON structures using dot notation without complex parsing:

SELECT id, user.name, user.profile.age, metadata.tags
FROM opensearch.default.users
WHERE user.profile.age > 25;

Impact

Test Plan

The unit tests include test classes extending AbstractTestQueries. So the full set of regression tests intended for connectors are run against this connector as well. Additional tests are included for the vector functions and individual classes.

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

General Changes
* Added new read only Opensearch connector.

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Jan 5, 2026
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @elbinpallimalilibm, your pull request is larger than the review limit of 150000 diff characters

@elbinpallimalilibm elbinpallimalilibm force-pushed the opensearch_connector branch 2 times, most recently from 4cb87c3 to 3d143ad Compare January 6, 2026 12:01
@elbinpallimalilibm
Copy link
Contributor Author

@sourcery-ai review

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 6, 2026

Sorry @elbinpallimalilibm, your pull request is larger than the review limit of 150000 diff characters

@elbinpallimalilibm elbinpallimalilibm force-pushed the opensearch_connector branch 6 times, most recently from 517dfa6 to 218da55 Compare January 9, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:IBM PR from IBM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants