named_struct(...) or a STRUCT column. This function does not access storage or infer metadata.
Syntax
Parameters
struct_expr: a STRUCT expression that describes the file. The following fields are accepted:
Return value
Returns a FILE value. Ifstruct_expr is NULL, returns NULL.
Usage notes
- Field names are case-insensitive and can appear in any order. Unknown or duplicate names cause an analysis error.
- Missing fields and explicit NULL values become NULL. No defaults are filled in, including for
offsetandsize. - For each non-NULL STRUCT, exactly one of
uriandinlinemust be non-NULL. Missing fields count as NULL. - Integer inputs are widened to BIGINT. Untyped NULL is accepted for every field. Other input types require an explicit CAST.
- For URI references,
offsetandsizecan be NULL; non-NULL values must be greater than or equal to zero. For inline content, both fields must be NULL. A row that violates these rules or theuri/inlinerule causes the query to fail. To return NULL for such rows instead, use try_to_file. - URI syntax, MIME types, checksums, and the referenced byte range are not validated.
inlinecontains raw bytes. Empty strings and empty binary values count as non-NULL and are preserved.
ai_complete or ai_embed consumes a FILE with a missing or empty content_type, the AI function attempts to infer it. See FILE input support.