path_exists

Description

Given a column and path, return whether the JSON path exists in that column. Must have a valid column.

Return type

bool

Domain

This is a scalar function (calculates a single output value for a single input row.)

Categories

Usage

path_exists(object, path)

Argument

Type

Optional

Repeatable

Restrictions

object

object

no

no

none

path

string

no

no

none

Examples

path_exists(A, 'C')

Returns whether JSON path ‘C’ exists in column A.

path_exists(A, 'B.C')

Returns whether JSON path ‘B.C’ exists in column A. A value containing the path may be { B: { C: 1 } }.

path_exists(@aaa.B, 'C')

Returns whether JSON path ‘C’ exists in column A of input ‘aaa’. Referencing non-default inputs only works in join verb projection expressions.