Skip to content

Conversation

@lezzago
Copy link
Member

@lezzago lezzago commented Sep 24, 2025

Description

Support for queries other data sources like prometheus via REST API.
PR is a merge from feature/direct-query-prometheus. It is not a straight merge as that PR shows more changes than there are: #4357.

Most changes are isolated in the direct-query and direct-query-core modules

Introduces 3 new APIs:

  • Direct query: Query non-opensearch datasources like Prometheus with PromQL
    • uri: GET /_plugins/_directquery/_query/{dataSources}
  • Read resources: Fetch resources from non-opensearch datasources like Prometheus to fetch labels/series/alerts
    • base uri: GET /_plugins/_directquery/_resources/{dataSource}
      • example: GET /_plugins/_directquery/_resources/{dataSource}/api/v1/{resourceType}/{resourceName}/values
  • Write resources: Write resources to non-opensearch datasources like Prometheus to put alert manager silences
    • base uri: POST /_plugins/_directquery/_resources/{dataSource}
      • example: POST /_plugins/_directquery/_resources/{dataSource}/alertmanager/api/v2/{resourceType}

Related Issues

#4229

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • New PPL command checklist all confirmed.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff or -s.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

joshuali925 and others added 30 commits September 4, 2025 12:11
…roject#3440)

Signed-off-by: Joshua Li <joshuali925@gmail.com>
Co-authored-by: Megha Goyal <goyamegh@amazon.com>
…t#3441)

Signed-off-by: Joshua Li <joshuali925@gmail.com>
Co-authored-by: Megha Goyal <goyamegh@amazon.com>
* distinct_count doc for eventstats

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* doc enhancement

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* add fields for consistency between different Java versions

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* remove changes

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* add bin to index.rst

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* add link

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* fix

Signed-off-by: Kai Huang <ahkcs@amazon.com>

---------

Signed-off-by: Kai Huang <ahkcs@amazon.com>
* Implement Append Command

Signed-off-by: Songkan Tang <songkant@amazon.com>

* Fix spotless check

Signed-off-by: Songkan Tang <songkant@amazon.com>

* Rephrase append.rst

Signed-off-by: Songkan Tang <songkant@amazon.com>

* Support subsearch different index for append command

Signed-off-by: Songkan Tang <songkant@amazon.com>

* Fix some tests and add cross cluster IT

Signed-off-by: Songkan Tang <songkant@amazon.com>

* Not support empty subsearch input for now

Signed-off-by: Songkan Tang <songkant@amazon.com>

* Fix doctest

Signed-off-by: Songkan Tang <songkant@amazon.com>

* Support empty source edge case

Signed-off-by: Songkan Tang <songkant@amazon.com>

* Fix anonymizer tests

Signed-off-by: Songkan Tang <songkant@amazon.com>

* Add missing test cases for nested join or lookup command in appended subsearch

Signed-off-by: Songkan Tang <songkant@amazon.com>

* Fix compile issue

Signed-off-by: Songkan Tang <songkant@amazon.com>

---------

Signed-off-by: Songkan Tang <songkant@amazon.com>
* Bin command big5 queries

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* update IT

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* fix

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* remove tests

Signed-off-by: Kai Huang <ahkcs@amazon.com>

---------

Signed-off-by: Kai Huang <ahkcs@amazon.com>
Signed-off-by: Kai Huang <105710027+ahkcs@users.noreply.github.com>
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
…ject#4213)

* Enable filtered aggregation pushdown

Signed-off-by: Chen Dai <daichen@amazon.com>

* Add basic UT and ignore IT for now

Signed-off-by: Chen Dai <daichen@amazon.com>

* Enable aggregate case to filter rule and fix UT and IT

Signed-off-by: Chen Dai <daichen@amazon.com>

* Add expected json file for no pushdown test

Signed-off-by: Chen Dai <daichen@amazon.com>

* Remove unnecessary aggregate case to filter rule

Signed-off-by: Chen Dai <daichen@amazon.com>

* Add UT for IS_TRUE support

Signed-off-by: Chen Dai <daichen@amazon.com>

* Add more explain IT

Signed-off-by: Chen Dai <daichen@amazon.com>

* Refactor UT

Signed-off-by: Chen Dai <daichen@amazon.com>

* Extract aggregate filter analyzer abstraction

Signed-off-by: Chen Dai <daichen@amazon.com>

* Add more UT

Signed-off-by: Chen Dai <daichen@amazon.com>

* Refactor UT with fluent API

Signed-off-by: Chen Dai <daichen@amazon.com>

* Add UT for distinct count

Signed-off-by: Chen Dai <daichen@amazon.com>

* Address comment by adding UT for script filter pushdown

Signed-off-by: Chen Dai <daichen@amazon.com>

* Fix spotless

Signed-off-by: Chen Dai <daichen@amazon.com>

---------

Signed-off-by: Chen Dai <daichen@amazon.com>
…project#4193)

* Run unit test suites in parallel

Signed-off-by: Simeon Widdis <sawiddis@gmail.com>

* Split out our test actions

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>

* Make unit test step run in parallel

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>

* Fix removed bwc tests

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>

* Add another missing parallel flag

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>

---------

Signed-off-by: Simeon Widdis <sawiddis@gmail.com>
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
…ject#4109)

* rex - initial implementation

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* stop using utils

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix spotless check

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* offset_field - initial implementation

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* max_match - initial implementation

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* sed - initial implementation

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix name capture group for extraction

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* add rex rst doc

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* IT - initial setup

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* add a analyzer test for legacy engine

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* Add UT for rex

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* sed - add pushdown for sed and explain IT and IT with fix

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* anonymizer - add rex for anonymizer and test

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* Add cross cluster IT for rex

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* peng - resolve comments for rst doc 0

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* peng - address some comments 1

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* peng - resolve comment in rst doc to add a java doc link

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* kai - modify the bin ast builder test

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* peng - fix the extraction behavior without filter even when there is zero match

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix rex explain no pushdown

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* change the offset val output format

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix rst file

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* peng - SWITCH TO USE CALCITE NATIVE OPERATORS

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* Peng - fix tests after operator change

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* support mode=extract and update doc

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix the issue after rebase

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* peng - enforce specifying field in antlr for now

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* relocate rex cmd IT

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* peng - simplify vistFunciton

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* peng - add UT for RexExtractMultiFunction

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* peng - add UT RexOffsetFunction

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix some tests

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* DECOUPLE SED + OFFSET FIELD

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* Improve error handling for extract

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* add this rex rst into index

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix return type in extract multi

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* add rex doc into doc test

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix doc test

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* Fix linting

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix rebase issue

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix regex anonymizer tests

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix analyzer test and setup to use util function

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* lint fix

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix doc test

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* Add max match limit implementation

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* fix anonymizer test

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* peng - simplify if

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* peng - make extract multi to only handle the case of max_match > 1

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

---------

Signed-off-by: Jialiang Liang <jiallian@amazon.com>
* add wildcard support for rename

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* fix calcite wildcard support and add tests

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* fix formatting

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* add check to analyzer

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* update doc formatting

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* remove v2 engine wildcard support

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* update doc

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* fix formatting

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* support cascading rename

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* update formatting

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* add cross cluster test

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* add test for cascading rename

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* fix formatting

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* add test for cascading rename

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* change behavior for renaming existing fields

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* add tests and update docs

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* update docs

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* update docs

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* fix renaming to same name

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* fix behavior for consecutive wildcards/address comments

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* add back import

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* fix doc

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* fix doc

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

* fix formatting

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>

---------

Signed-off-by: Ritvi Bhatt <ribhatt@amazon.com>
Signed-off-by: ritvibhatt <53196324+ritvibhatt@users.noreply.github.com>
* First revision

Signed-off-by: Aaron Alvarez <aaarone@amazon.com>

* Fixing documentation

Signed-off-by: Aaron Alvarez <aaarone@amazon.com>

* Removing unnecessary comments

Signed-off-by: Aaron Alvarez <aaarone@amazon.com>

* Fixinf stats.rst documentation

Signed-off-by: Aaron Alvarez <aaarone@amazon.com>

* Fixing documentation

Signed-off-by: Aaron Alvarez <aaarone@amazon.com>

* Addressing comments

Signed-off-by: Aaron Alvarez <aaarone@amazon.com>

---------

Signed-off-by: Aaron Alvarez <aaarone@amazon.com>
Signed-off-by: Aaron Alvarez <900908alvarezaaron@gmail.com>
Co-authored-by: Aaron Alvarez <aaarone@amazon.com>
Signed-off-by: Vamsi Manohar <reddyvam@amazon.com>
Signed-off-by: Tomoyuki Morita <moritato@amazon.com>
* Support join field list and join options

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Add SPL-compatible syntax setting

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Revert SPL settings

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Fix IT

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Fix IT

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Support max=n option

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* support max=n in sql-like join syntax

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Add Explain IT for new join syntax

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Refactor the user doc

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Fix conflicts

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Fix conflicts

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Disable the collapse pushdown

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* refactor

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Fix IT

Signed-off-by: Lantao Jin <ltjin@amazon.com>

---------

Signed-off-by: Lantao Jin <ltjin@amazon.com>
* Support first/last aggregation functions for PPL

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* Support null

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* remove legacy

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* update doc

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* fix doctest

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* fix stats.rst file

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* fixes

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* move pushdown logic to AggregateAnalyzer

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* fix IT and update null handling

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* add test cases for null handling

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* handle parallelism

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* Simplify CalciteExplainIT and add UT for AggregateAnalyzer

Signed-off-by: Kai Huang <ahkcs@amazon.com>

# Conflicts:
#	opensearch/src/test/java/org/opensearch/sql/opensearch/request/AggregateAnalyzerTest.java

* fixes

Signed-off-by: Kai Huang <ahkcs@amazon.com>

---------

Signed-off-by: Kai Huang <ahkcs@amazon.com>
add comment

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>
…ject#4228)

* Push down limit operator into aggregation bucket size

Signed-off-by: Heng Qian <qianheng@amazon.com>

* Fix IT

Signed-off-by: Heng Qian <qianheng@amazon.com>

* Fix robust issue in OpenSearchLimitIndexScanRule

Signed-off-by: Heng Qian <qianheng@amazon.com>

* Refine comments

Signed-off-by: Heng Qian <qianheng@amazon.com>

---------

Signed-off-by: Heng Qian <qianheng@amazon.com>
Signed-off-by: Heng Qian <qianheng@amazon.com>
* Print links to test logs after integTest

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* print even when tets failed

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

---------

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>
…command (opensearch-project#4241)

* [Feature] Implementation of mode sed and offset_field in rex PPL command

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* update rex rst doc

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* chen - address comment and merge grammar in parser

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* chen - limit offset field only in extraction mode

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* chen - specify exception type of o_f UDF

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* chen - add exception type of o_f UDF - 2

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* chen - add exception type of o_f UDF - also fix the test

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

* chen - alphabetical order of o_f return

Signed-off-by: Jialiang Liang <jiallian@amazon.com>

---------

Signed-off-by: Jialiang Liang <jiallian@amazon.com>
…ensearch-project#4212)

* Add earliest/latest aggregate function for eventstats command

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* update docs

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Minor refactoring

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Fix doctest

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Simplify logics

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Revert visitWindowFunction

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Add sort to some examples

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Refactor tests

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Fix argument validation error (WIP)

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Add argument validation for window functions

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Fix validation

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Fix tests

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Fix tests and refactor

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Fix test

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Fix merge issue

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

---------

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>
…rch-project#3550)

* Speed up aggregation pushdown for single group-by expression

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Add configs nullable_bucket

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Fix IT

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* revert typo

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Fix conflicts error

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* fix unit tests

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Fix order

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Fix UT

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Fix UT in windows

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* fix compile error of conflicts

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Add more ITs after merging push down limit to agg buckets

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* fix IT

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* address comments

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Clear sorts in source builder for aggregation pushdown

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Delete the TODO of v2, it's resolved now

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* fix doctest

Signed-off-by: Lantao Jin <ltjin@amazon.com>

---------

Signed-off-by: Lantao Jin <ltjin@amazon.com>
…ject#4274)

* Implement YamlFormatter

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Enable YAML based plan comparison in tests

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Fix line break issue in Windows

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Minor fix in test case

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Fix line break issue

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

* Fix comment

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>

---------

Signed-off-by: Tomoyuki Morita <moritato@amazon.com>
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
Signed-off-by: Vamsi Manohar <reddyvam@amazon.com>
* mvjoin support in PPL Caclite

Signed-off-by: ps48 <pshenoy36@gmail.com>

* fix texts

Signed-off-by: ps48 <pshenoy36@gmail.com>

* update docs

Signed-off-by: ps48 <pshenoy36@gmail.com>

* update doc examples

Signed-off-by: ps48 <pshenoy36@gmail.com>

* rebase main, update test

Signed-off-by: ps48 <pshenoy36@gmail.com>

* update test with real array fields

Signed-off-by: ps48 <pshenoy36@gmail.com>

* use verifyQueryThrowsException in CalcitePPLFunctionTypeTest

Signed-off-by: ps48 <pshenoy36@gmail.com>

* spotless check fix

Signed-off-by: ps48 <pshenoy36@gmail.com>

* remove string,string registration for mvjoin

Signed-off-by: ps48 <pshenoy36@gmail.com>

* remove string,string test

Signed-off-by: ps48 <pshenoy36@gmail.com>

---------

Signed-off-by: ps48 <pshenoy36@gmail.com>
Signed-off-by: Vamsi Manohar <reddyvam@amazon.com>
…project#4300)

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Signed-off-by: Ashish Agrawal <ashish81394@gmail.com>
Copy link
Member

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

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

It is not a straight merge as that PR shows more changes than there are: #4357

Probably because I squashed #4374, GitHub had conflict to rebase it and merge is disabled here. Squash doesn't really merge it with main, and that commit content will show in the diff main...feature/direct-query-prometheus during review.

If you want to send the PR from feature branch let me know, i might be able to push the merge commit. But if not this works as well

Comment on lines +26 to +36
public ExecuteDirectQueryActionRequest(StreamInput in) throws IOException {
// In a real implementation, deserialize the request
// This is just a placeholder since we don't have the full serialization code
this.directQueryRequest = new ExecuteDirectQueryRequest();
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
// Add serialization logic if needed
}
Copy link
Member

Choose a reason for hiding this comment

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

i had the question since beginning: are these actionable TODO items, or are we ok to just leave them? I believe this is for transport layer communications, which we don't have a use case, so "real implementation" would mean when this request is being used at transport laayer?

Copy link
Member Author

Choose a reason for hiding this comment

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

We have no current requirements for transport layer. We want to support this when its GA, but there will be a bit of refactoring needed, so was not worth to implement this yet.

@Override
public ExecuteDirectQueryResponse executeDirectQuery(ExecuteDirectQueryRequest request) {
// TODO: Replace with the data source query id.
String queryId = UUID.randomUUID().toString();
Copy link
Member

Choose a reason for hiding this comment

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

direct query (non async query) shouldn't have a query id?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking of keeping this for now for the purpose of tracing the call to debug errors.

@lezzago
Copy link
Member Author

lezzago commented Sep 24, 2025

Probably because I squashed #4374, GitHub had conflict to rebase it and merge is disabled here. Squash doesn't really merge it with main, and that commit content will show in the diff main...feature/direct-query-prometheus during review.

If you want to send the PR from feature branch let me know, i might be able to push the merge commit. But if not this works as well

I am fine with either choice. If this would be a preferred approach, feel free to try to push a merge commit to fix that.

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Copy link
Collaborator

@Swiddis Swiddis left a comment

Choose a reason for hiding this comment

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

I looked over many of the original PRs going into this and don't have major architectural concerns. I'm okay to merge this as-is and address any smaller issues later. (Note: haven't carefully looked over the code here, this is a very large change.)

I'd like if you could add testing details for this though: what's the testing plan for the new module? How is it different from our current one? Any known bugs/operational changes we should be aware of?

@Swiddis Swiddis added the enhancement New feature or request label Sep 26, 2025
@Swiddis Swiddis merged commit c203bda into opensearch-project:main Sep 26, 2025
33 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.