generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 180
[Doc] Enable doctest with Calcite #4379
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 13 commits into
opensearch-project:main
from
LantaoJin:pr/issues/4314_test
Sep 29, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
316c697
Enable Calcite by default and implicit fallback the unsupported commands
LantaoJin fa8284d
Update docs
LantaoJin 09122c2
doctest update
LantaoJin 6dbc293
Merge remote-tracking branch 'upstream/main' into issues/4314_test
LantaoJin 854f311
Enable doctest with Calcite
LantaoJin 8aab53c
Merge remote-tracking branch 'upstream/main' into issues/4314_test
LantaoJin 2901483
Merge remote-tracking branch 'upstream/main' into issues/4314_test
LantaoJin 6fa4426
revert useless code
LantaoJin 891bd32
Merge remote-tracking branch 'upstream/main' into issues/4314_test
LantaoJin 4c3e510
remove empty file
LantaoJin cf9a12b
revert the math.rst
LantaoJin cf9debe
not stable in doctest
LantaoJin 8d629ce
Merge remote-tracking branch 'upstream/main' into issues/4314_test
LantaoJin 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
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 |
|---|---|---|
|
|
@@ -99,7 +99,7 @@ Example 1: Two indices join | |
|
|
||
| PPL query:: | ||
|
|
||
| PPL> source = state_country | inner join left=a right=b ON a.name = b.name occupation | stats avg(salary) by span(age, 10) as age_span, b.country; | ||
| os> source = state_country | inner join left=a right=b ON a.name = b.name occupation | stats avg(salary) by span(age, 10) as age_span, b.country; | ||
| fetched rows / total rows = 5/5 | ||
| +-------------+----------+-----------+ | ||
| | avg(salary) | age_span | b.country | | ||
|
|
@@ -116,17 +116,8 @@ Example 2: Join with subsearch | |
|
|
||
| PPL query:: | ||
|
|
||
| PPL> source = state_country as a | ||
| | where country = 'USA' OR country = 'England' | ||
| | left join ON a.name = b.name [ | ||
| source = occupation | ||
| | where salary > 0 | ||
| | fields name, country, salary | ||
| | sort salary | ||
| | head 3 | ||
| ] as b | ||
| | stats avg(salary) by span(age, 10) as age_span, b.country; | ||
| fetched rows / total rows = 5/5 | ||
| PPL> source = state_country as a | where country = 'USA' OR country = 'England' | left join ON a.name = b.name [ source = occupation | where salary > 0 | fields name, country, salary | sort salary | head 3 ] as b | stats avg(salary) by span(age, 10) as age_span, b.country; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure why this query failed in linux/doctest only. I cannot reproduce in local and IT. Will keep the |
||
| fetched rows / total rows = 3/3 | ||
| +-------------+----------+-----------+ | ||
| | avg(salary) | age_span | b.country | | ||
| |-------------+----------+-----------| | ||
|
|
@@ -140,32 +131,23 @@ Example 3: Join with field list | |
|
|
||
| PPL query:: | ||
|
|
||
| PPL> source = state_country | ||
| | where country = 'USA' OR country = 'England' | ||
| | join type=left overwrite=true name [ | ||
| source = occupation | ||
| | where salary > 0 | ||
| | fields name, country, salary | ||
| | sort salary | ||
| | head 3 | ||
| ] | ||
| | stats avg(salary) by span(age, 10) as age_span, country; | ||
| fetched rows / total rows = 5/5 | ||
| +-------------+----------+-----------+ | ||
| | avg(salary) | age_span | country | | ||
| |-------------+----------+-----------| | ||
| | null | 40 | null | | ||
| | 70000.0 | 30 | USA | | ||
| | 100000.0 | 70 | England | | ||
| +-------------+----------+-----------+ | ||
| PPL> source = state_country | where country = 'USA' OR country = 'England' | join type=left overwrite=true name [ source = occupation | where salary > 0 | fields name, country, salary | sort salary | head 3 ] | stats avg(salary) by span(age, 10) as age_span, country; | ||
| fetched rows / total rows = 3/3 | ||
| +-------------+----------+---------+ | ||
| | avg(salary) | age_span | country | | ||
| |-------------+----------+---------| | ||
| | null | 40 | null | | ||
| | 70000.0 | 30 | USA | | ||
| | 100000.0 | 70 | England | | ||
| +-------------+----------+---------+ | ||
|
|
||
| Example 4: Join with options | ||
| ============================ | ||
|
|
||
| PPL query:: | ||
|
|
||
| PPL> source = state_country | join type=inner overwrite=false max=1 name occupation | stats avg(salary) by span(age, 10) as age_span, country; | ||
| fetched rows / total rows = 5/5 | ||
| os> source = state_country | join type=inner overwrite=false max=1 name occupation | stats avg(salary) by span(age, 10) as age_span, country; | ||
| fetched rows / total rows = 4/4 | ||
| +-------------+----------+---------+ | ||
| | avg(salary) | age_span | country | | ||
| |-------------+----------+---------| | ||
|
|
||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the #4380 closed. but grok, parse, patterns are still not able to 100% match the result of doctest in v2. @songkant-aws can you fix it or link an issue. Or it just needs to update the doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reopen #4380