Class FileType

java.lang.Object
dev.frostlake.types.DataType
dev.frostlake.types.FileType
All Implemented Interfaces:
Serializable

public class FileType extends DataType
The FILE column type: a reference to a file on a stage. The DECLARED type is FILE — live DESCRIBE TABLE, SHOW COLUMNS, GET_DDL and INFORMATION_SCHEMA.COLUMNS.DATA_TYPE all report FILE for such a column — but a FILE VALUE is not a distinct runtime type: it is an object of file metadata (CONTENT_TYPE / ETAG / LAST_MODIFIED / RELATIVE_PATH / SIZE / STAGE / ...) and SYSTEM$TYPEOF of a FILE column reports OBJECT[LOB]. Hence TypeCategory.SEMI_STRUCTURED and no dedicated value class.

FILE is deliberately NOT a cast target: NULL::FILE and CAST(NULL AS FILE) both fail live with "invalid type [...] for parameter 'TO_FILE'", so the cast is rejected where the target type is read (see ExpressionAstBuilder).

The metadata object itself is produced by TO_FILE, which resolves a stage path against the stage and reads the real file's size, mtime, MD5 and extension-derived content type. A write to a FILE column goes through it, so a stage-path string is resolved on write and fails when it names no file, while a metadata object is validated structurally but not resolved.

See Also: