Class StructuredObjectType

All Implemented Interfaces:
Serializable

public class StructuredObjectType extends ObjectType
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: