Package dev.frostlake.types
Class FileType
java.lang.Object
dev.frostlake.types.DataType
dev.frostlake.types.FileType
- All Implemented Interfaces:
Serializable
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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformatValue(Object value) getCommonType(DataType other) intgetSize()booleanisCompatible(DataType other) parseValue(String value)
-
Field Details
-
FILE
-
-
Constructor Details
-
FileType
public FileType()
-
-
Method Details
-
parseValue
- Specified by:
parseValuein classDataType
-
formatValue
- Specified by:
formatValuein classDataType
-
isCompatible
- Specified by:
isCompatiblein classDataType
-
getCommonType
- Specified by:
getCommonTypein classDataType
-
getSize
public int getSize()
-