select: add MISSING operator support (#14406)

Probably not full support, but for regular checks it should work.

Fixes #14358
This commit is contained in:
Klaus Post
2022-02-25 12:31:19 -08:00
committed by GitHub
parent e43cc316ff
commit 88fd1cba71
8 changed files with 153 additions and 29 deletions

View File

@@ -449,6 +449,8 @@ func jsonToValue(result interface{}) (*Value, error) {
return FromArray(rval), nil
case nil:
return FromNull(), nil
case Missing:
return FromMissing(), nil
}
return nil, fmt.Errorf("Unhandled value type: %T", result)
}
@@ -493,6 +495,8 @@ func (e *LitValue) evalNode(_ Record) (res *Value, err error) {
return FromString(string(*e.String)), nil
case e.Boolean != nil:
return FromBool(bool(*e.Boolean)), nil
case e.Missing:
return FromMissing(), nil
}
return FromNull(), nil
}