MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / JSONExistsAny

Function JSONExistsAny

pkg/sql/sem/tree/eval.go:410–425  ·  view source on GitHub ↗

JSONExistsAny return true if any value in dArray is exist in the json

(json DJSON, dArray *DArray)

Source from the content-addressed store, hash-verified

408
409// JSONExistsAny return true if any value in dArray is exist in the json
410func JSONExistsAny(json DJSON, dArray *DArray) (*DBool, error) {
411 // TODO(justin): this can be optimized.
412 for _, k := range dArray.Array {
413 if k == DNull {
414 continue
415 }
416 e, err := json.JSON.Exists(string(MustBeDString(k)))
417 if err != nil {
418 return nil, err
419 }
420 if e {
421 return DBoolTrue, nil
422 }
423 }
424 return DBoolFalse, nil
425}
426
427func initArrayToArrayConcatenation() {
428 for _, t := range types.Scalar {

Callers

nothing calls this directly

Calls 2

MustBeDStringFunction · 0.85
ExistsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…