Class FileFunctionHelper
FL_* accessors, mirroring the family-local helper
pattern of VectorFunctionHelper.
Live, an accessor VALIDATES a caller-supplied metadata object exactly as
TO_FILE does — FL_GET_SIZE(OBJECT_CONSTRUCT('RELATIVE_PATH','hello.txt','SIZE',24))
fails "Invalid file metadata. Missing required fields: LAST_MODIFIED, CONTENT_TYPE, ETAG." and
FL_GET_SIZE(42) fails "Unsupported cast to FILE." A VARCHAR argument never reaches here: it
is rejected at COMPILE time as "Invalid argument types for function 'FL_GET_RELATIVE_PATH':
(VARCHAR(14))", which the expression layer raises from its strict-argument map.
The NULL rules split the family in two, and are the least guessable thing about it. The eight
plain getters propagate NULL. FL_GET_FILE_TYPE and all five FL_IS_* DO NOT: live,
FL_GET_FILE_TYPE(NULL) is the string 'unknown' and FL_IS_IMAGE(NULL) is
FALSE, never NULL — measured both for a literal NULL and for a NULL FILE column.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringcontentTypeOf(Object value) TheCONTENT_TYPEthe classifiers key off, WITHOUT propagating NULL — a NULL file simply has no content type, whichFileContentTypesmaps tounknown/ FALSE.static tools.jackson.databind.JsonNodedescriptorOf(Object value) The validated descriptor behind an accessor's argument.static BigDecimalnumberField(Object value, String field) A descriptor'sSIZEas a number, NULL-propagating.static StringA descriptor field as a string, NULL-propagating.
-
Method Details
-
descriptorOf
The validated descriptor behind an accessor's argument.- Parameters:
value- the argument value- Returns:
- the descriptor node, or null when the argument is SQL NULL
-
textField
A descriptor field as a string, NULL-propagating.- Parameters:
value- the accessor's argumentfield- the descriptor field name- Returns:
- the field's text, or null when the argument or the field is absent
-
numberField
A descriptor'sSIZEas a number, NULL-propagating.- Parameters:
value- the accessor's argument- Returns:
- the size, or null
-
contentTypeOf
TheCONTENT_TYPEthe classifiers key off, WITHOUT propagating NULL — a NULL file simply has no content type, whichFileContentTypesmaps tounknown/ FALSE.- Parameters:
value- the accessor's argument- Returns:
- the content type, or null
-