Class StructuredTypes

java.lang.Object
dev.frostlake.types.StructuredTypes

public final class StructuredTypes extends Object
Predicates and rendering shared by the STRUCTURED types (StructuredObjectType, StructuredArrayType, MapType).

Snowflake sorts these into two families for cast compatibility — STRUCTURED_OBJECT (structured OBJECT and MAP) and STRUCTURED_ARRAY — and reports a cross-family cast as "incompatible types: [STRUCTURED_ARRAY] and [STRUCTURED_OBJECT]" (live-verified).

  • Method Details

    • isStructured

      public static boolean isStructured(DataType type)
      Whether type is one of the STRUCTURED types (a declared shape, not plain OBJECT/ARRAY/VARIANT).
    • isStructuredObjectFamily

      public static boolean isStructuredObjectFamily(DataType type)
      Whether type is in Snowflake's STRUCTURED_OBJECT family (structured OBJECT or MAP).
    • familyName

      public static String familyName(DataType type)
      Snowflake's family label for a structured type, used verbatim in its cast error messages.
    • sameBindingShape

      public static boolean sameBindingShape(DataType source, DataType target)
      Whether two types match for UDF ARGUMENT BINDING: the same structured layout and the same leaf type FAMILIES, ignoring length/precision. Live with a parameter declared OBJECT(x VARCHAR): an OBJECT(x VARCHAR(10)) argument binds, an OBJECT(x INT) argument fails "Invalid argument types", and so do a plain OBJECT, a VARIANT, an OBJECT(y VARCHAR) and a wider OBJECT(x VARCHAR, y INT).
    • describe

      public static String describe(DataType type)
      A type as Snowflake spells it in an argument-type / cast error message.