Package dev.frostlake.types
Class StructuredObjectType
java.lang.Object
dev.frostlake.types.DataType
dev.frostlake.types.ObjectType
dev.frostlake.types.StructuredObjectType
- All Implemented Interfaces:
Serializable
A STRUCTURED object type —
OBJECT(x VARCHAR, y NUMBER) — as opposed to the plain
semi-structured ObjectType. Snowflake treats the two as different types: a plain OBJECT is
rejected where a structured one is required and vice versa, and only a structured value may carry
the RENAME FIELDS / ADD FIELDS cast modifiers (live-verified).
Structured-ness is a STATIC property of the type, not a tag on the value: live,
SYSTEM$TYPEOF(NULL::OBJECT(x VARCHAR)) still reports OBJECT(x VARCHAR)[LOB] even
though the value is SQL NULL, and it propagates through table columns, CTEs and subqueries.
Field ORDER is significant and is preserved on output: live,
CAST(<OBJECT(x VARCHAR)> AS OBJECT(z INT, x VARCHAR) ADD FIELDS) renders
{"z":null,"x":"a"} — declaration order, NOT the sorted key order a semi-structured OBJECT
renders in.
- See Also:
-
Field Summary
Fields inherited from class dev.frostlake.types.ObjectType
OBJECT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe declared field with this VERBATIM name, or null when the type has no such field.booleanisCompatible(DataType other) toString()Methods inherited from class dev.frostlake.types.ObjectType
formatValue, getCommonType, getSize, parseValueMethods inherited from class dev.frostlake.types.DataType
equals, getCategory, getName, hashCode
-
Constructor Details
-
StructuredObjectType
-
-
Method Details
-
getFields
-
field
The declared field with this VERBATIM name, or null when the type has no such field. -
isCompatible
- Overrides:
isCompatiblein classObjectType
-
toString
-