> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/reference-1/functions-and-operators/functions/structural/json_path.md).

# JSON\_PATH

Extracts data from JSON objects.

## Syntax

```sql
JSON_PATH(path, JSON)
```

## Arguments

<table><thead><tr><th width="134">Name</th><th width="106">Type</th><th width="343">Description</th><th>Default Value</th></tr></thead><tbody><tr><td>path</td><td>string</td><td>JSON Path Expression</td><td></td></tr><tr><td>JSON</td><td>string</td><td>A string that contains JSON Document</td><td></td></tr></tbody></table>

## Examples

| path                            | JSON                                                            | Output           |
| ------------------------------- | --------------------------------------------------------------- | ---------------- |
| '$\[\*].author.name'            | '\[{                                                            |                  |
| "name": "The Great Gatsby",     |                                                                 |                  |
| "author": {                     |                                                                 |                  |
| "name": "F. Scott Fitzgerald"   |                                                                 |                  |
| }                               |                                                                 |                  |
| },                              |                                                                 |                  |
| {                               |                                                                 |                  |
| "name": "Nineteen Eighty-Four", |                                                                 |                  |
| "author": {                     |                                                                 |                  |
| "name": "George Orwell"         |                                                                 |                  |
| }                               |                                                                 |                  |
| }]'                             | \[`F. Scott Fitzgerald`, `George Orwell`]                       |                  |
| 'net\_id'                       | '{ "net\_id": 41 }'                                             | `41`             |
| 'net\_id'                       | '{ "net\_id": \[41, 42] }'                                      | `[41,42]`        |
| 'net\_id\[\*]'                  | '{ "net\_id": \[41, 42] }'                                      | \[`41`, `42`]    |
| 'net\_id.parent'                | '{ "net\_id": \[41, 42] }'                                      | null             |
| '$\[\*]'                        | '\[1,2,3]'                                                      | \[`1`, `2`, `3`] |
| '$\[\*].author'                 | '\[{                                                            |                  |
| "name": "The Great Gatsby",     |                                                                 |                  |
| "author": {                     |                                                                 |                  |
| "name": "F. Scott Fitzgerald"   |                                                                 |                  |
| }                               |                                                                 |                  |
| },                              |                                                                 |                  |
| {                               |                                                                 |                  |
| "name": "Nineteen Eighty-Four", |                                                                 |                  |
| "author": {                     |                                                                 |                  |
| "name": "George Orwell"         |                                                                 |                  |
| }                               |                                                                 |                  |
| }]'                             | \[`{"name":"F. Scott Fitzgerald"}`, `{"name":"George Orwell"}`] |                  |

### Transformation job example

#### SQL

```sql
CREATE JOB function_operator_example
    ADD_MISSING_COLUMNS = true
AS INSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data 
  MAP_COLUMNS_BY_NAME
    SELECT path, JSON,
        JSON_PATH('$[*].author.name', JSON) AS Output
    FROM default_glue_catalog.upsolver_samples.orders_raw_data
    LET path = '$[*].author.name',
        JSON = '[{
 "name": "The Great Gatsby",
 "author": {
  "name": "F. Scott Fitzgerald"
 }
},
{
 "name": "Nineteen Eighty-Four",
 "author": {
   "name": "George Orwell"
 }
}]'
    WHERE $commit_time BETWEEN run_start_time() AND run_end_time()
    LIMIT 1;
```

#### Query result

<table><thead><tr><th width="280">path</th><th width="296.3333333333333">JSON</th><th>Output</th></tr></thead><tbody><tr><td>'$[*].author.name'</td><td>'[{</td><td></td></tr><tr><td>"name": "The Great Gatsby",</td><td></td><td></td></tr><tr><td>"author": {</td><td></td><td></td></tr><tr><td>"name": "F. Scott Fitzgerald"</td><td></td><td></td></tr><tr><td>}</td><td></td><td></td></tr><tr><td>},</td><td></td><td></td></tr><tr><td>{</td><td></td><td></td></tr><tr><td>"name": "Nineteen Eighty-Four",</td><td></td><td></td></tr><tr><td>"author": {</td><td></td><td></td></tr><tr><td>"name": "George Orwell"</td><td></td><td></td></tr><tr><td>}</td><td></td><td></td></tr><tr><td>}]'</td><td>[<code>F. Scott Fitzgerald</code>, <code>George Orwell</code>]</td><td></td></tr></tbody></table>


---

# 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://upsolver.gitbook.io/content/reference-1/functions-and-operators/functions/structural/json_path.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.
