-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Adding ES|QL command URI_PARTS #140004
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
Merged
Adding ES|QL command URI_PARTS #140004
Changes from all commits
Commits
Show all changes
100 commits
Select commit
Hold shift + click to select a range
4b693fb
Adding ES|QL command URI_PART
eyalkoren 3a92c2d
[CI] Auto commit changes from spotless
5bb2450
Fix yaml test to include new capability
eyalkoren 0ec10eb
Merge remote-tracking branch 'eyalkoren/esql-uri_parts-command' into …
eyalkoren 84172a6
Making UriPartsFunction a singleton
eyalkoren c39da7c
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren b990cf1
Refix yaml test
eyalkoren 34d8d16
[CI] Auto commit changes from spotless
6cd0eb3
Ensure consistent creation of UriParts and UriPartsExec
eyalkoren 24c8e28
Merge remote-tracking branch 'eyalkoren/esql-uri_parts-command' into …
eyalkoren c1cce24
[CI] Auto commit changes from spotless
fac8358
Extending tests
eyalkoren 318e57a
Workaround generative test failure through dataset changes
eyalkoren 2f14092
Fix also dataset mappings
eyalkoren 1950acc
Optimizing rules
eyalkoren 7397c82
Adding unit tests for planning, analysis and optimizations
eyalkoren 14c922e
Spotless
eyalkoren 8117d21
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren fecdf1c
Handling inconsistency between coordinating and data node
eyalkoren ceabffb
spotless
eyalkoren 41a94df
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 0c36fe1
Fix tests
eyalkoren f835ef8
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 67998e9
Add serialization tests
eyalkoren 3b881ff
Update docs/changelog/140004.yaml
eyalkoren 58fd5b2
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 5c24bd0
Update docs/changelog/140004.yaml
eyalkoren 38e0380
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren b33a887
Restoring regenerated ANTLR products
eyalkoren a3159b8
Restoring AnalyzerTests after merge
eyalkoren b5460c1
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren ea9ac7f
Making evaluation allocation-free and write directly to blocks
eyalkoren 8f7d68d
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren fd22eed
Complete merge
eyalkoren 2ed210f
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren d5215f2
Some fixes
eyalkoren c120466
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 8d8ffa2
Applying review comments
eyalkoren 1a94463
Adding infrastructure for multi-value unit tests
eyalkoren 9768d70
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 4e793e3
Adding approximation optimization support and test
eyalkoren b4c8ba3
Simplify row output evaluation
eyalkoren 9ef68fa
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren e9b9997
Add more csv test cases
eyalkoren 5eb2ab6
Applying OperatorTestCase tests for AbstractCompoundOutputEvaluatorTests
eyalkoren c67ad86
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren d261373
Complete merge fixes
eyalkoren 2cbfe74
Add docs
eyalkoren e2bd54c
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 4340112
Complete merge
eyalkoren 7ec42eb
Adding to toc
eyalkoren 3bf8574
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren d346fb4
Minimizing capability name
eyalkoren 11fdd7e
Adding chicken to syntax description in docs
eyalkoren 1dcd144
Making all compound output commands implement Streaming
eyalkoren d00d217
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 84f6dc5
Fix: creating a collector and RowOutput per evaluator instance
eyalkoren 7d1bfab
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 654b75f
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 05b6e65
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 4ba1271
Applying some review comments
eyalkoren 6880575
Refactor command name - enable on official builds
eyalkoren 597e8b2
Adding requested csv tests
eyalkoren 55d40e4
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 92a4626
Removing unused inport
eyalkoren 3fc1184
Refactor to avoid hard coded warnings mode
eyalkoren 479049f
Spotless
eyalkoren 1360926
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren c15e691
Swtich to use UriParts logic from shared web-utils lib
eyalkoren dd057b2
Applying code review request
eyalkoren bb80e54
Applying review comments
eyalkoren 8fc353e
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 0a49935
Switching to use SequenceBytesRefBlockSourceOperator
eyalkoren 675e0f3
Merge branch 'main' into esql-uri_parts-command
eyalkoren 9db6c5d
Merge branch 'main' into esql-uri_parts-command
eyalkoren 5a84db8
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 3e3df4f
Complete merge
eyalkoren fd75ee9
[CI] Auto commit changes from spotless
bea8c40
Adding generative tests
eyalkoren 6d4b01e
spotless
eyalkoren 910b96f
Merge remote-tracking branch 'eyalkoren/esql-uri_parts-command' into …
eyalkoren 0d856fa
Aligning generative test validation with other command generators
eyalkoren a924285
spotless
eyalkoren d86122c
Changing web-utils dependency to implementation
eyalkoren caca597
Publishing web-utils lib
eyalkoren 1ec3af4
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren b1c2b45
Remove snapshot build feature flag
eyalkoren ebeae1a
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren a16bdba
Complete merge
eyalkoren d4be7b2
Fix 60_usage.yml test
eyalkoren fb6556f
Adding special sources to csv tests
eyalkoren ee224a9
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 2f3d4ec
Move mappings to new location
eyalkoren dc3fae2
Restoring strict generative test validation
eyalkoren 35363ed
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren 3e6b438
Fixing generative test framework and restoring even stricter validation
eyalkoren 05b1647
[CI] Auto commit changes from spotless
332bf3e
Commenting out invalid column validation for LOOKUP_JOIN generative test
eyalkoren ae46d4f
Merge remote-tracking branch 'upstream/main' into esql-uri_parts-command
eyalkoren a1eb5b6
Remove dev-command leftover
eyalkoren 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| pr: 140004 | ||
| summary: "Adding ES|QL command URI_PART" | ||
| area: ES|QL | ||
| type: feature | ||
| issues: | ||
| - 134885 |
11 changes: 11 additions & 0 deletions
11
...ce/query-languages/esql/_snippets/commands/examples/uri_parts.csv-spec/basic.md
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,11 @@ | ||
| % This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. | ||
|
|
||
| ```esql | ||
| ROW uri = "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment" | ||
| | URI_PARTS parts = uri | ||
| | KEEP parts.* | ||
| ``` | ||
|
|
||
| | parts.domain:keyword | parts.fragment:keyword | parts.path:keyword | parts.extension:keyword | parts.port:integer | parts.query:keyword | parts.scheme:keyword | parts.user_info:keyword | parts.username:keyword | parts.password:keyword | | ||
| | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | ||
| | www.example.com | fragment | /foo.gif | gif | 80 | key1=val1&key2=val2 | http | myusername:mypassword | myusername | mypassword | |
84 changes: 84 additions & 0 deletions
84
docs/reference/query-languages/esql/_snippets/commands/layout/uri_parts.md
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,84 @@ | ||
| ```yaml {applies_to} | ||
| serverless: preview | ||
| stack: preview | ||
| ``` | ||
|
|
||
| The `URI_PARTS` processing command parses a Uniform Resource Identifier (URI) string and extracts its components into new columns. | ||
|
|
||
| ::::{note} | ||
| This command doesn't support multi-value inputs. | ||
| :::: | ||
|
|
||
|
|
||
| **Syntax** | ||
|
|
||
| ```esql | ||
| URI_PARTS prefix = expression | ||
| ``` | ||
|
|
||
| **Parameters** | ||
|
|
||
| `prefix` | ||
| : The prefix for the output columns. The extracted components are available as `prefix.component`. | ||
|
|
||
| `expression` | ||
| : The string expression containing the URI to parse. | ||
|
|
||
| **Description** | ||
|
|
||
| The `URI_PARTS` command parses a URI string and extracts its components into new columns. | ||
| The new columns are prefixed with the specified `prefix` followed by a dot (`.`). | ||
|
|
||
| This command is the query-time equivalent of the [URI parts ingest processor](/reference/enrich-processor/uri-parts-processor.md). | ||
|
|
||
| The following columns are created: | ||
|
|
||
| `prefix.domain` | ||
| : The host part of the URI. | ||
|
|
||
| `prefix.fragment` | ||
| : The fragment part of the URI (the part after `#`). | ||
|
|
||
| `prefix.path` | ||
| : The path part of the URI. | ||
|
|
||
| `prefix.extension` | ||
| : The file extension extracted from the path. | ||
|
|
||
| `prefix.port` | ||
| : The port number as an integer. | ||
|
|
||
| `prefix.query` | ||
| : The query string part of the URI (the part after `?`). | ||
|
|
||
| `prefix.scheme` | ||
| : The scheme (protocol) of the URI (e.g., `http`, `https`, `ftp`). | ||
|
|
||
| `prefix.user_info` | ||
| : The user information part of the URI. | ||
|
|
||
| `prefix.username` | ||
| : The username extracted from the user information. | ||
|
|
||
| `prefix.password` | ||
| : The password extracted from the user information. | ||
|
|
||
| If a component is missing from the URI, the corresponding column contains `null`. | ||
| If the expression evaluates to `null`, all output columns are `null`. | ||
| If the expression is not a valid URI, a warning is issued and all output columns are `null`. | ||
|
|
||
| **Examples** | ||
|
|
||
| The following example parses a URI and extracts its parts: | ||
|
|
||
| :::{include} ../examples/uri_parts.csv-spec/basic.md | ||
| ::: | ||
|
|
||
| You can use the extracted parts in subsequent commands, for example to filter by domain: | ||
|
|
||
| ```esql | ||
| FROM web_logs | ||
| | URI_PARTS p = uri | ||
| | WHERE p.domain == "www.example.com" | ||
| | STATS COUNT(*) BY p.path | ||
| ``` |
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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| navigation_title: "URI_PARTS" | ||
| mapped_pages: | ||
| - https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-commands.html#esql-uri_parts | ||
| --- | ||
|
|
||
| # {{esql}} `URI_PARTS` command [esql-uri_parts] | ||
|
|
||
| :::{include} ../_snippets/commands/layout/uri_parts.md | ||
| ::: |
5 changes: 5 additions & 0 deletions
5
docs/reference/query-languages/esql/kibana/definition/commands/uriparts.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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.