We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
json_delete
Is your feature request related to a problem?
As part of the RFC to add JSON functions, the json_delete function would be useful to remove elements from json documents by key.
JSON
What solution would you like?
### `JSON_DELETE` **Description** `json_delete(doc, path [, path]...)` Deletes json elements from a json document at the specified path(s). Returns the updated document. **Arguments type:** JSON_OBJECT, STRING **Return type:** JSON_OBJECT `json_delete(doc, paths)` Deletes json elements from a json document at the specified paths. Returns the updated document. **Arguments type:** JSON_OBJECT, ARRAY **Return type:** JSON_OBJECT Example: os> source=people | eval deleted = json_delete(json('{"account_number":1,"balance":39225,"age":32,"gender":"M"}'), array('age','gender')) | head 1 | fields deleted fetched rows / total rows = 1/1 +------------------------------------------+ | deleted | +-----------------------------------------+ |{"account_number":1,"balance":39225} | +-----------------------------------------+ os> source=people | eval deleted = json_delete(json('{"f1":"abc","f2":{"f3":"a","f4":"b"}}'), 'f2.f3') | head 1 | fields deleted fetched rows / total rows = 1/1 +-----------------------------------------------------------+ | deleted | +-----------------------------------------------------------+ | {"f1":"abc","f2":{"f4":"b"}} | +-----------------------------------------------------------+ os> source=people | eval deleted = json_delete(json('{"teacher":"Alice","student":[{"name":"Bob","rank":1},{"name":"Charlie","rank":2}]}'), 'teacher', 'student.rank') | head 1 | fields deleted fetched rows / total rows = 1/1 +--------------------------------------------------+ | deleted | +--------------------------------------------------+ |{"student":[{"name":"Bob"},{"name":"Charlie"}]} | +--------------------------------------------------+
What alternatives have you considered?
N/A
Do you have any additional context?
opensearch-project/opensearch-spark#780 - PR to add json functions to spark ppl
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your feature request related to a problem?
As part of the RFC to add JSON functions, the
json_delete
function would be useful to remove elements from json documents by key.JSON
extended functions support #3027JSON
extended functions support #3028JSON
functions: construction and extraction opensearch-spark#780What solution would you like?
What alternatives have you considered?
N/A
Do you have any additional context?
opensearch-project/opensearch-spark#780 - PR to add json functions to spark ppl
The text was updated successfully, but these errors were encountered: