Class ConvertTimezone
java.lang.Object
dev.frostlake.functions.BuiltInFunction
dev.frostlake.functions.scalar.datetime.ConvertTimezone
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription★ THE TWO ARITIES ARE TWO FUNCTIONS.intThe most arguments a call to this function may pass;Integer.MAX_VALUEmarks a variadic function (seeBuiltInFunction.isVariadic()).intThe fewest arguments a call to this function may pass; fewer is an argument-count error.Methods inherited from class dev.frostlake.functions.BuiltInFunction
approximateRejection, binaryRejection, booleanRejection, evaluate, fileRejection, geoRejection, getName, getReturnType, isVariadic, refusesMissingArgumentsByType, semiStructuredRejection, structuredRejection, temporalRejection, temporalRejection, temporalRejection, textRejection, uuidRejection, vectorRejection
-
Constructor Details
-
ConvertTimezone
public ConvertTimezone()
-
-
Method Details
-
evaluate
★ THE TWO ARITIES ARE TWO FUNCTIONS. The THREE-argument form names the source zone itself, so its input is a wall clock and its answer is one — a TIMESTAMP_NTZ, which is what this declares. The TWO-argument form takes an INSTANT and re-expresses it in the named zone, so its answer carries that zone's offset and is a TIMESTAMP_TZ: live gives2020-01-02 03:00:00.000 +0900for an Asia/Tokyo conversion, not the session's offset.Frostlake read the value's wall clock and re-labelled it UTC, which converted nothing at all — the two-argument form handed its input straight back.
- Specified by:
evaluatein classBuiltInFunction- Parameters:
args- the target zone and the value, or the source zone, the target zone and the value- Returns:
- the converted timestamp, or null when the value is null
-
getMinArgCount
public int getMinArgCount()Description copied from class:BuiltInFunctionThe fewest arguments a call to this function may pass; fewer is an argument-count error.- Specified by:
getMinArgCountin classBuiltInFunction- Returns:
- the minimum accepted argument count
-
getMaxArgCount
public int getMaxArgCount()Description copied from class:BuiltInFunctionThe most arguments a call to this function may pass;Integer.MAX_VALUEmarks a variadic function (seeBuiltInFunction.isVariadic()).- Specified by:
getMaxArgCountin classBuiltInFunction- Returns:
- the maximum accepted argument count
-