Fix SQL query routing to analytics engine after V2 parser change#5456
Conversation
PR Reviewer Guide 🔍(Review updated until commit a58f5ae)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to a58f5ae Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 74f3f80
Suggestions up to commit a9ad0bf
|
a9ad0bf to
74f3f80
Compare
|
Persistent review updated to latest commit 74f3f80 |
The switch from CalciteSqlQueryParser to SqlV2QueryParser (opensearch-project#5438) changed the parse return type from SqlNode to UnresolvedPlan. This caused a ClassCastException in extractIndexName(), which was silently caught and returned false, routing all SQL queries to V2 engine instead of analytics. Fix: unify SQL and PPL paths to both use UnresolvedPlan + IndexNameExtractor. Remove dead SqlNode-based extraction code (SqlTableNameExtractor). Signed-off-by: Chen Dai <daichen@amazon.com>
74f3f80 to
a58f5ae
Compare
|
Persistent review updated to latest commit a58f5ae |
Description
The switch from Calcite parser to SQL V2 parser in PR #5438 changed the SQL parse result type from
SqlNodetoUnresolvedPlan. This brokeextractIndexName()inRestUnifiedQueryActionand caused all SQL queries to fall through to the V2 engine instead of routing to the analytics engine.Related Issues
Part of #5248
Check List
--signoffor-s.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.