generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 181
Implement spath partial document traversal #4185
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
Closed
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
750fefb
Add missing license headers from 4120
Swiddis 1dad193
Minor robustness fixes for spath
Swiddis 0b67eda
Add spath partial-rewriting
Swiddis a132134
Add docs for invalid value handling
Swiddis 9402980
Add example for rename usage
Swiddis a53f1b2
Clarify a comment
Swiddis 3be5558
Merge remote-tracking branch 'upstream/main' into feature/spath-grace
Swiddis f843775
Apply spotless
Swiddis 5ec775f
Add field as a possible keyword
Swiddis da24c3a
Deal with initial nits
Swiddis 07b3f31
Merge branch 'main' into feature/spath-grace
Swiddis 94ca365
Fix style
Swiddis d2b1760
Simplify path matching logic
Swiddis 472e768
Fix spotless again
Swiddis 48ef6e6
Merge remote-tracking branch 'upstream/main' into feature/spath-grace
Swiddis 78bee6d
Fix spath doctest
Swiddis 2b5a50d
Fix metadata doctest
Swiddis 6734c50
Merge branch 'main' into feature/spath-grace
Swiddis a8b39ac
Fix doctest
Swiddis aeaa9f5
Merge branch 'feature/spath-grace' of https://github.com/Swiddis/sql …
Swiddis d975954
Merge branch 'main' into feature/spath-grace
Swiddis 147b5dc
Merge branch 'main' into feature/spath-grace
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
Some comments aren't visible on the classic Files Changed page.
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
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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| {"doc_n":"{\"n\": 1}","doc_list":"{\"list\": [1, 2, 3, 4], \"nest_out\": {\"nest_in\": \"a\"}}","obj_field":{"field": "a"}} | ||
| {"doc_n":"{\"n\": 2}","doc_list":"{\"list\": [], \"nest_out\": {\"nest_in\": \"a\"}}","obj_field":{"field": "b"}} | ||
| {"doc_n":"{\"n\": 3}","doc_list":"{\"list\": [5, 6], \"nest_out\": {\"nest_in\": \"a\"}}","obj_field":{"field": "c"}} |
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,17 @@ | ||
| { | ||
| "mappings": { | ||
| "properties": { | ||
| "doc_n": { | ||
| "type": "text" | ||
| }, | ||
| "doc_list": { | ||
| "type": "text" | ||
| }, | ||
| "obj_field": { | ||
| "properties": { | ||
| "field": { "type": "text" } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
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.
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 am confused. Is
inputparameter for specifying where we want to read JSON from? This description looks like we are reading JSON which includesouterattribute inside.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.
Input is the outermost field we want to start extracting the inner values from, so on something like
{ "outer": { "inner": "{\"data\": 0}" }}theninput=outermeans that Spath will be processing the document{ "inner": "{\"data\": 0}" }. Thenpath=inner.datawould access the value0, orpath=innerwould access the value"{\"data\": 0}"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.
Does that mean
outeris a column? In that case I think we want to separate that from JSON string.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.
Yeah, I think in the future it makes sense to remove the
inputfield and just navigate directly to the specified path. For this change, the intended behavior is to allow this type of mixing so you don't need to worry about where exactly the boundary is. I might cut a future PR to makeinputbe an empty string by default?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 feel it is making thing more complicated.
In my opinion, it is simpler and easier to understand if
inputsimply point the column containing JSON, andpathspecifies the path in JSON.But I am open if others feels current approach is better.