jsonextractscalar
This section contains reference documentation for the JSONEXTRACTSCALAR function.
Last updated
Was this helpful?
This section contains reference documentation for the JSONEXTRACTSCALAR function.
Last updated
Was this helpful?
Evaluates the 'jsonPath' on jsonField, returns the result as the type 'resultsType', use optional defaultValuefor null or parsing error.
JSONEXTRACTSCALAR(jsonField, 'jsonPath', 'resultsType', [defaultValue])
jsonField
An Identifier/Expression contains JSON documents.
'jsonPath'
'results_type'
One of the Pinot supported data types:INT, LONG, FLOAT, DOUBLE, BOOLEAN, TIMESTAMP, STRING,
INT_ARRAY, LONG_ARRAY, FLOAT_ARRAY, DOUBLE_ARRAY, STRING_ARRAY
.
'jsonPath'
and`` ``
'results_type'
are literals. Pinot uses single quotes to distinguish them from identifiers.
The examples in this section are based on the . In particular we'll be querying the row WHERE id = 7044874109
:
{"id":115911530,"name":"LimeVista/Tapes","url":"https://api.github.com/repos/LimeVista/Tapes"}
The following examples show how to use the JSONEXTRACTSCALAR
function:
7044874109
LimeVista/Tapes
7044874109
dummyValue
Follows to read values from JSON documents.