generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 181
Fix fallback error handling to show original Calcite error #5133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Swiddis
merged 6 commits into
opensearch-project:main
from
Swiddis:fix/calcite-fallback-preserve-calcite-error
Feb 13, 2026
+214
−28
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
03d691e
Fix fallback error handling to show original Calcite error
Swiddis 2ada127
coderabbit: preserve exception types
Swiddis 244f27b
Refactoring for coderabbit: consistent handling of calcite and legacy…
Swiddis 3596379
Update explain error handling to match non-explain
Swiddis 114c152
Minor tweaks: commenting & eval order
Swiddis e81cf26
Add a yaml test
Swiddis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
66 changes: 66 additions & 0 deletions
66
integ-test/src/yamlRestTest/resources/rest-api-spec/test/issues/5060.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # Issue: https://github.com/opensearch-project/sql/issues/5060 | ||
| # PR: https://github.com/opensearch-project/sql/pull/5133 | ||
| # When Calcite falls back to V2 and V2 also fails, return the original Calcite error instead of V2's. | ||
| # | ||
| # The AD command forces a V2 fallback, then join is only supported in V3 (Calcite). | ||
| # This test verifies that when both Calcite and V2 fail, the error message correctly shows | ||
| # the Calcite error (CalciteUnsupportedException) rather than the V2 error. | ||
|
|
||
| setup: | ||
| - do: | ||
| query.settings: | ||
| body: | ||
| transient: | ||
| plugins.calcite.enabled: true | ||
| - do: | ||
| indices.create: | ||
| index: test_join_ad_error_5133 | ||
| body: | ||
| mappings: | ||
| properties: | ||
| "event.id": | ||
| type: keyword | ||
| "@timestamp": | ||
| type: date | ||
| message: | ||
| type: text | ||
| - do: | ||
| bulk: | ||
| index: test_join_ad_error_5133 | ||
| refresh: true | ||
| body: | ||
| - '{"index": {}}' | ||
| - '{"event.id": "evt1", "@timestamp": "2025-01-15T10:30:00Z", "message": "test message 1"}' | ||
| - '{"index": {}}' | ||
| - '{"event.id": "evt2", "@timestamp": "2025-01-15T10:31:00Z", "message": "test message 2"}' | ||
|
|
||
| --- | ||
| teardown: | ||
| - do: | ||
| query.settings: | ||
| body: | ||
| transient: | ||
| plugins.calcite.enabled: false | ||
| - do: | ||
| indices.delete: | ||
| index: test_join_ad_error_5133 | ||
|
|
||
| --- | ||
| "Join with AD command should return Calcite error when both Calcite and V2 fail": | ||
| - skip: | ||
| features: | ||
| - headers | ||
| - allowed_warnings | ||
| # Before the fix: Returns V2 error "Join is supported only when plugins.calcite.enabled=true" (status 500) | ||
| # After the fix: Returns Calcite error "AD command is unsupported in Calcite" (status 400) | ||
| - do: | ||
| allowed_warnings: | ||
| - 'Loading the fielddata on the _id field is deprecated and will be removed in future versions. If you require sorting or aggregating on this field you should also include the id in the body of your documents, and map this field as a keyword field that has [doc_values] enabled' | ||
| catch: bad_request | ||
| headers: | ||
| Content-Type: 'application/json' | ||
| ppl: | ||
| body: | ||
| query: source=test_join_ad_error_5133 | join `event.id` [source = test_join_ad_error_5133] | ad time_field='@timestamp' | ||
| - match: { "$body": "/CalciteUnsupportedException/" } | ||
| - match: { "$body": "/AD\\s+command\\s+is\\s+unsupported\\s+in\\s+Calcite/" } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.