/
hasJsonSchema

hasJsonSchema

Determine if a JSON object contains the list of specified fieldnames (keys).

Usage Details

LQL Command

select hasJsonSchema(column, listOfFieldnames) as resultCol from table

Input:

table: Input table.
column: Name of a column that contains JSON objects.
listOfFieldnames: Comma-separated list of fields, such as "key1, key2, key3".

Output:
true if the object contains the specified the field names; otherwise false.

Example

Input

_raw
{"a":1, "b":2}
{"a":1, "c":3}

LQL command

select *, hasJsonSchema(_raw, "b, a") as resultCol from table

Output

_raw
{"a":1, "b":2}true
{"a":1, "c":3}false

Related content

getJsonFields
getJsonFields
More like this
fieldnamesFromJson
fieldnamesFromJson
More like this
extractFieldInJSON
extractFieldInJSON
More like this