aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/json/json_exists/on_error.sql
blob: 9cb826d6f9b82cd031994dc7d3e3a31fe5e41787 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
/* syntax version 1 */
/* postgres can not */

-- Accessing absent object member will cause jsonpath error in strict mode
$json = CAST("{}" as Json);
SELECT
    JSON_EXISTS($json, "strict $.key"), -- defaults to FALSE ON ERROR
    JSON_EXISTS($json, "strict $.key" FALSE ON ERROR),
    JSON_EXISTS($json, "strict $.key" TRUE ON ERROR),
    JSON_EXISTS($json, "strict $.key" UNKNOWN ON ERROR);