-
Notifications
You must be signed in to change notification settings - Fork 178
Support escaped field names in SPath parsing #4813
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
Support escaped field names in SPath parsing #4813
Conversation
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
This reverts commit 5ae2b06. Signed-off-by: Simeon Widdis <[email protected]>
penghuo
left a comment
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.
Update doc and doctest to explain this feature.
| @Test | ||
| public void testSpathEscapedParse() { | ||
| SPath sp = | ||
| (SPath) plan("source = t | spath input=f output=o path=`attributes.['cluster.name']`"); |
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.
double quoted also supported? "attributes.['cluster.name']"
I think SPL spath only support double quote.
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.
Added support for string escapes + relevant testing/docs
Signed-off-by: Simeon Widdis <[email protected]>
(cherry picked from commit 5a68caa) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Implemented the unquoting as part of #4185 but we decided against the full change. But the unquoting itself is still necessary for e.g.
@timestamp, and rewriting nontrivial paths to json_extract. This PR implements string-quoted spath paths.Related Issues
Unable to parse literal dots in fields like
{"a.b.c": "value"}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.