Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1.59 KB

jsonextractkey.md

File metadata and controls

34 lines (24 loc) · 1.59 KB
description
This section contains reference documentation for the JSONEXTRACTKEY function.

jsonextractkey

Extracts all matched JSON field keys based on 'jsonPath' into a STRING_ARRAY.

Signature

JSONEXTRACTKEY(jsonField, 'jsonPath')

Arguments Description
jsonField An Identifier/Expression contains JSON documents.
'jsonPath' Follows JsonPath Syntax to read values from JSON documents.

{% hint style="warning" %} 'jsonPath'` is a literal. Pinot uses single quotes to distinguish them from identifiers. {% endhint %}

Usage Examples

The examples in this section are based on the Batch JSON Quick Start. In particular we'll be querying the row WHERE id = 7044874109.

select id, repo, JSONEXTRACTKEY(repo, '$.*') AS keys
from githubEvents 
WHERE id = 7044874109
id repo keys
7044874109 {"id":115911530,"name":"LimeVista/Tapes","url":"https://api.github.com/repos/LimeVista/Tapes"} $['id'],$['name'],$['url']