Add explain support for analytics engine path#5275
Draft
ahkcs wants to merge 1 commit intoopensearch-project:feature/mustang-ppl-integrationfrom
Draft
Add explain support for analytics engine path#5275ahkcs wants to merge 1 commit intoopensearch-project:feature/mustang-ppl-integrationfrom
ahkcs wants to merge 1 commit intoopensearch-project:feature/mustang-ppl-integrationfrom
Conversation
opensearch-project#5247) Add explain support for the analytics engine path: - AnalyticsExecutionEngine.explain(RelNode, ExplainMode, ...): returns logical plan via RelOptUtil.toString() with mode-aware SqlExplainLevel (SIMPLE/STANDARD/COST). Physical and extended plans are null since the analytics engine is not yet available. - RestUnifiedQueryAction.explain(): new entry point for explain requests, delegates to AnalyticsExecutionEngine.explain() with ExplainMode.STANDARD. Response formatted via JsonResponseFormatter with normalizeLf(). - TransportPPLQueryAction: routes explain requests for analytics indices to unifiedQueryHandler.explain() instead of unifiedQueryHandler.execute(). Integration tests (AnalyticsPPLIT): - testExplainResponseStructure: verifies JSON shape (calcite.logical, calcite.physical=null, calcite.extended=null) - testExplainProjectAndScan: LogicalProject + LogicalTableScan + table name - testExplainFilterPlan: LogicalFilter with condition value - testExplainAggregationPlan: LogicalAggregate with COUNT() - testExplainSortPlan: LogicalSort Unit tests (AnalyticsExecutionEngineTest): - explainRelNode_returnsLogicalPlan - explainRelNode_errorPropagation Signed-off-by: Kai Huang <kaihuang@amazon.com> Signed-off-by: Kai Huang <ahkcs@amazon.com>
Contributor
|
Failed to generate code suggestions for PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds explain support for the analytics engine path (#5247). This is the second PR building on #5267 (query routing and execution handoff).
This PR covers Step 3 (explain) from the issue:
Step 3: Explain support [Done]
RelOptUtil.toString()with mode-awareSqlExplainLevel(SIMPLE/STANDARD/COST). Physical and extended plans are null since the analytics engine is not yet available.JsonResponseFormatterwithnormalizeLf().isExplainRequest()for analytics indices and routes tounifiedQueryHandler.explain()instead ofexecute().Explain response format
{ "calcite": { "logical": "LogicalSystemLimit(...)\n LogicalProject(ts=[$0], message=[$2])\n LogicalFilter(condition=[=($1, 200)])\n LogicalTableScan(table=[[opensearch, parquet_logs]])\n", "physical": null, "extended": null } }Physical plan will be populated when the analytics engine provides a
QueryPlanExecutor.explain()API.Changed Files
core/.../analytics/AnalyticsExecutionEngine.javaexplain(RelNode, ExplainMode, ...)methodplugin/.../rest/RestUnifiedQueryAction.javaexplain()entry point andcreateExplainListener()plugin/.../transport/TransportPPLQueryAction.javacore/.../analytics/AnalyticsExecutionEngineTest.javainteg-test/.../ppl/AnalyticsPPLIT.javaTest plan