Skip to content
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

[PPL-Lang]Json function support for json_delete & json_extend #969

Closed
YANG-DB opened this issue Dec 4, 2024 · 0 comments
Closed

[PPL-Lang]Json function support for json_delete & json_extend #969

YANG-DB opened this issue Dec 4, 2024 · 0 comments
Labels
0.7 enhancement New feature or request Lang:PPL Pipe Processing Language support untriaged

Comments

@YANG-DB
Copy link
Member

YANG-DB commented Dec 4, 2024

Is your feature request related to a problem?
Continue Supporting the PPL Json grammar with adding the next functions:

  • json_delete(object,[keys list])

    • Removes one or more keys and their corresponding values from the specified JSON object.
      • objects: the Json object is the field being evaluated
      • [keys list]: keys is the list of keys to remove from the object
  • json_extend(object, [(path key, array values) list])

    • Adds multiple values to an array, json_extend flattens arrays into their component values and appends those values to the ends of the arrays.
      • objects: the Json object is the field being evaluated
      • [(path key, array values) list]): path key is the json path name of the array and the array values are the values to be added

Each designates an array or value within the object json document. The json_extend function adds the values of the corresponding after the last value of the array designated by the .

What solution would you like?

support the following json_delete

source = accounts | eval contacts = json_delete(contacts, ["addresses.email"])

support the following json_extend

` source = accounts | eval contacts = json_extend(contacts, "addresses.email", json_array("[email protected]", "[email protected]"))

Do you have any additional context?

@YANG-DB YANG-DB added enhancement New feature or request untriaged Lang:PPL Pipe Processing Language support 0.7 labels Dec 4, 2024
@YANG-DB YANG-DB closed this as completed Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.7 enhancement New feature or request Lang:PPL Pipe Processing Language support untriaged
Projects
None yet
Development

No branches or pull requests

1 participant