Package dev.frostlake.values
Class UndefinedNode
java.lang.Object
tools.jackson.databind.JacksonSerializable.Base
tools.jackson.databind.JsonNode
tools.jackson.databind.node.BaseJsonNode
tools.jackson.databind.node.ValueNode
dev.frostlake.values.UndefinedNode
- All Implemented Interfaces:
Serializable,Iterable<tools.jackson.databind.JsonNode>,tools.jackson.core.TreeNode,tools.jackson.databind.JacksonSerializable
public final class UndefinedNode
extends tools.jackson.databind.node.ValueNode
The VARIANT
undefined element — the third null of Snowflake's semi-structured layer, alongside
SQL NULL and the JSON null.
A SQL NULL placed INTO an array becomes undefined: live-verified
ARRAY_CONSTRUCT(1, NULL, 2) renders [1,undefined,2] while
PARSE_JSON('[1,null,2]') keeps [1,null,2], and the two arrays compare UNEQUAL.
This is a Jackson value node so an undefined lives inside the variant tree exactly where the
element sits, keeping every position, size and ordering intact. Two properties make it safe:
- Its node type is
JsonNodeType.NULL, soJsonNode.isNull()is TRUE. Every consumer that does not know aboutundefinedtherefore reads it as SQL NULL — which is exactly Snowflake's rule: anundefinedNEVER escapes the variant layer as a value (TYPEOF(GET(ac,1))andIS_NULL_VALUE(GET(ac,1))are both SQL NULL live, andGET(ac,1) IS NULLis TRUE). Only the handful of call sites that must tell the two nulls apart consultVariantUndefined. - It serializes as the bare token
undefined, so the canonical JSON text of an array holding one is byte-identical to Snowflake's rendering — which in turn makes text-based equality, GROUP BY, DISTINCT, storage and persistence agree with the account for free.
An undefined only ever occupies an ARRAY element. An object member is a JSON null instead —
live, PARSE_JSON('{"a":undefined}') is {"a":null} and
OBJECT_CONSTRUCT_KEEP_NULL('k', NULL) is {"k":null}.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.JsonNode
tools.jackson.databind.JsonNode.OverwriteModeNested classes/interfaces inherited from interface tools.jackson.databind.JacksonSerializable
tools.jackson.databind.JacksonSerializable.Base -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe canonical JSON text Snowflake renders for this element.Fields inherited from class tools.jackson.databind.node.ValueNode
BD_MAX_INTEGER, BD_MAX_LONG, BD_MAX_SHORT, BD_MIN_INTEGER, BD_MIN_LONG, BD_MIN_SHORT, BI_MAX_INTEGER, BI_MAX_LONG, BI_MAX_SHORT, BI_MIN_INTEGER, BI_MIN_LONG, BI_MIN_SHORT, MISSINGFields inherited from class tools.jackson.databind.node.BaseJsonNode
OPT_FALSE, OPT_TRUE -
Method Summary
Modifier and TypeMethodDescriptionprotected StringasString()Empty text — live,ARRAY_TO_STRING(ARRAY_CONSTRUCT('a', NULL), ',')is'a,'.tools.jackson.core.JsonTokenasToken()deepCopy()booleanIdentity equality — anundefinedis never equal to a JSON null (live:ac = pjis FALSE).static UndefinedNodeThe singleton sentinel.tools.jackson.databind.node.JsonNodeTypeinthashCode()protected ObjectKeeps the singleton across Java deserialization of a snapshot.voidserialize(tools.jackson.core.JsonGenerator generator, tools.jackson.databind.SerializationContext context) Methods inherited from class tools.jackson.databind.node.ValueNode
_at, findParent, findParents, findValue, findValues, findValuesAsString, get, get, has, has, hasNonNull, hasNonNull, isEmpty, path, path, serializeWithTypeMethods inherited from class tools.jackson.databind.node.BaseJsonNode
_asBoolean, _asString, _jsonPointerIfValid, _reportBigDecimalConversionNaNFail, _reportBigIntegerConversionFractionFail, _reportBigIntegerConversionNaNFail, _reportCoercionFail, _reportCoercionFail, _reportConversionFail, _reportDoubleConversionRangeFail, _reportFloatConversionRangeFail, _reportIntConversionFractionFail, _reportIntConversionNaNFail, _reportIntConversionRangeFail, _reportLongConversionFractionFail, _reportLongConversionNaNFail, _reportLongConversionRangeFail, _reportShortConversionFractionFail, _reportShortConversionRangeFail, _reportWrongNodeType, _withArray, _withObject, _withXxxMayReplace, _withXxxVerifyReplace, asArray, asArrayOpt, asBigInteger, asBigInteger, asBigIntegerOpt, asBoolean, asBoolean, asBooleanOpt, asDecimal, asDecimal, asDecimalOpt, asDouble, asDouble, asDoubleOpt, asFloat, asFloat, asFloatOpt, asInt, asInt, asIntOpt, asLong, asLong, asLongOpt, asObject, asObjectOpt, asShort, asShort, asShortOpt, asString, asStringOpt, bigIntegerValue, bigIntegerValue, bigIntegerValueOpt, binaryValue, booleanValue, booleanValue, booleanValueOpt, decimalValue, decimalValue, decimalValueOpt, doubleValue, doubleValue, doubleValueOpt, findPath, floatValue, floatValue, floatValueOpt, intValue, intValue, intValueOpt, isEmbeddedValue, isMissingNode, longValue, longValue, longValueOpt, numberType, numberValue, required, required, shortValue, shortValue, shortValueOpt, stringValue, stringValue, stringValueOpt, toPrettyString, toString, traverse, withArray, withObjectMethods inherited from class tools.jackson.databind.JsonNode
_reportRequiredViolation, _reportUnsupportedOperation, _this, asOptional, asText, asText, at, at, canConvertToExactIntegral, canConvertToInt, canConvertToLong, canConvertToShort, equals, findParents, findValues, findValuesAsString, forEachEntry, isArray, isBigDecimal, isBigInteger, isBinary, isBoolean, isContainer, isDouble, isFloat, isFloatingPointNumber, isInt, isIntegralNumber, isLong, isNull, isNumber, isObject, isPojo, isShort, isString, isTextual, isValueNode, iterator, map, missingAs, missingAs, nullAs, nullAs, optional, optional, properties, propertyNames, propertyStream, require, requiredAt, requiredAt, requireNonNull, size, spliterator, textValue, values, valueStream, withArray, withArray, withArray, withArrayProperty, withObject, withObject, withObject, withObjectPropertyMethods inherited from class tools.jackson.databind.JacksonSerializable.Base
isEmpty
-
Field Details
-
TOKEN
The canonical JSON text Snowflake renders for this element.- See Also:
-
-
Method Details
-
getInstance
The singleton sentinel. -
getNodeType
public tools.jackson.databind.node.JsonNodeType getNodeType()- Specified by:
getNodeTypein classtools.jackson.databind.JsonNode
-
asToken
public tools.jackson.core.JsonToken asToken()- Specified by:
asTokenin interfacetools.jackson.core.TreeNode- Specified by:
asTokenin classtools.jackson.databind.node.ValueNode
-
asString
Empty text — live,ARRAY_TO_STRING(ARRAY_CONSTRUCT('a', NULL), ',')is'a,'.- Overrides:
asStringin classtools.jackson.databind.node.BaseJsonNode
-
_valueDesc
- Specified by:
_valueDescin classtools.jackson.databind.node.BaseJsonNode
-
serialize
public void serialize(tools.jackson.core.JsonGenerator generator, tools.jackson.databind.SerializationContext context) - Specified by:
serializein interfacetools.jackson.databind.JacksonSerializable- Specified by:
serializein classtools.jackson.databind.node.BaseJsonNode
-
deepCopy
- Overrides:
deepCopyin classtools.jackson.databind.node.ValueNode
-
equals
Identity equality — anundefinedis never equal to a JSON null (live:ac = pjis FALSE).- Specified by:
equalsin classtools.jackson.databind.JsonNode
-
hashCode
public int hashCode()- Specified by:
hashCodein classtools.jackson.databind.node.BaseJsonNode
-
readResolve
Keeps the singleton across Java deserialization of a snapshot.
-