> For the complete documentation index, see [llms.txt](https://docs.pinot.apache.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pinot.apache.org/functions/json/jsonextractobject.md).

# JSONEXTRACTOBJECT

Parses a JSON document into a reusable object or array value for downstream extraction. This function returns `null` for `null`, scalar, or non-JSON input without throwing, which makes it a good fit for [ingestion transformation functions](/build-with-pinot/ingestion/transformations-and-aggregations/ingestion-level-transformations.md) that need to parse once and extract many fields.

## Signature

> JSONEXTRACTOBJECT(jsonField)

| Arguments   | Description                                                                                                        |
| ----------- | ------------------------------------------------------------------------------------------------------------------ |
| `jsonField` | An **Identifier** or **Expression** that contains a JSON object, JSON array, or an already-parsed container value. |

## When to use it

Use `JSONEXTRACTOBJECT` when multiple transform configs need fields from the same JSON document. Parse the document once into an intermediate column, then point `JSONPATHSTRING`, `JSONPATHLONG`, `JSONPATHDOUBLE`, or `JSONPATHARRAY` at that intermediate instead of re-parsing the original string for every extracted field.

Because the function returns `null` for plain-text or scalar input, it also works well with the default-value `JSONPATH*` overloads on columns that sometimes contain JSON and sometimes contain unstructured text.

## Usage examples

The following ingestion config parses `message` once, then extracts two fields from the parsed intermediate column:

```json
{
  "tableConfig": {
    "ingestionConfig": {
      "transformConfigs": [
        {
          "columnName": "message_obj",
          "transformFunction": "JSONEXTRACTOBJECT(message)"
        },
        {
          "columnName": "level",
          "transformFunction": "JSONPATHSTRING(message_obj, '$.level', null)"
        },
        {
          "columnName": "msg_time",
          "transformFunction": "JSONPATHSTRING(message_obj, '$.time', null)"
        }
      ]
    }
  }
}
```

When `message` is plain text instead of JSON, `JSONEXTRACTOBJECT(message)` returns `null`, so the downstream default-value extraction returns the configured default instead of failing the row.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pinot.apache.org/functions/json/jsonextractobject.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
