Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2867 JSON support
  3. CALCITE-2975

Implement JSON_REMOVE function

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.20.0
    • None

    Description

      JSON_REMOVE(json_doc, path[, path] ...)

      Removes data from a JSON document and returns the result. Returns NULL if any argument is NULL. An error occurs if the json_doc argument is not a valid JSON document or any path argument is not a valid path expression or is $ or contains a * or ** wildcard.

      The path arguments are evaluated left to right. The document produced by evaluating one path becomes the new value against which the next path is evaluated.

      It is not an error if the element to be removed does not exist in the document; in that case, the path does not affect the document.
      JSON_REMOVE SQL:

      SELECT JSON_REMOVE(v, '$[1]') AS c1
       FROM (VALUES ('["a", ["b", "c"], "d"]')) AS t(v);
      

      RESULT:

      c1
      ["a", "d"]

      Attachments

        Issue Links

          Activity

            People

              x1q1j1 Forward Xu
              x1q1j1 Forward Xu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3.5h
                  3.5h