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, so JsonNode.isNull() is TRUE. Every consumer that does not know about undefined therefore reads it as SQL NULL — which is exactly Snowflake's rule: an undefined NEVER escapes the variant layer as a value (TYPEOF(GET(ac,1)) and IS_NULL_VALUE(GET(ac,1)) are both SQL NULL live, and GET(ac,1) IS NULL is TRUE). Only the handful of call sites that must tell the two nulls apart consult VariantUndefined.
  • 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.OverwriteMode

    Nested classes/interfaces inherited from interface tools.jackson.databind.JacksonSerializable

    tools.jackson.databind.JacksonSerializable.Base
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The 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, MISSING

    Fields inherited from class tools.jackson.databind.node.BaseJsonNode

    OPT_FALSE, OPT_TRUE
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
     
    Empty text — live, ARRAY_TO_STRING(ARRAY_CONSTRUCT('a', NULL), ',') is 'a,'.
    tools.jackson.core.JsonToken
     
     
    boolean
    equals(Object other)
    Identity equality — an undefined is never equal to a JSON null (live: ac = pj is FALSE).
    The singleton sentinel.
    tools.jackson.databind.node.JsonNodeType
     
    int
     
    protected Object
    Keeps the singleton across Java deserialization of a snapshot.
    void
    serialize(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, serializeWithType

    Methods 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, withObject

    Methods 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, withObjectProperty

    Methods inherited from class tools.jackson.databind.JacksonSerializable.Base

    isEmpty

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach
  • Field Details

  • Method Details

    • getInstance

      public static UndefinedNode getInstance()
      The singleton sentinel.
    • getNodeType

      public tools.jackson.databind.node.JsonNodeType getNodeType()
      Specified by:
      getNodeType in class tools.jackson.databind.JsonNode
    • asToken

      public tools.jackson.core.JsonToken asToken()
      Specified by:
      asToken in interface tools.jackson.core.TreeNode
      Specified by:
      asToken in class tools.jackson.databind.node.ValueNode
    • asString

      public String asString()
      Empty text — live, ARRAY_TO_STRING(ARRAY_CONSTRUCT('a', NULL), ',') is 'a,'.
      Overrides:
      asString in class tools.jackson.databind.node.BaseJsonNode
    • _valueDesc

      protected String _valueDesc()
      Specified by:
      _valueDesc in class tools.jackson.databind.node.BaseJsonNode
    • serialize

      public void serialize(tools.jackson.core.JsonGenerator generator, tools.jackson.databind.SerializationContext context)
      Specified by:
      serialize in interface tools.jackson.databind.JacksonSerializable
      Specified by:
      serialize in class tools.jackson.databind.node.BaseJsonNode
    • deepCopy

      public UndefinedNode deepCopy()
      Overrides:
      deepCopy in class tools.jackson.databind.node.ValueNode
    • equals

      public boolean equals(Object other)
      Identity equality — an undefined is never equal to a JSON null (live: ac = pj is FALSE).
      Specified by:
      equals in class tools.jackson.databind.JsonNode
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class tools.jackson.databind.node.BaseJsonNode
    • readResolve

      protected Object readResolve()
      Keeps the singleton across Java deserialization of a snapshot.