Class DateFunction
java.lang.Object
dev.frostlake.functions.BuiltInFunction
dev.frostlake.functions.scalar.conversion.ToDate
dev.frostlake.functions.scalar.conversion.DateFunction
DATE(<expr>) — the alias of TO_DATE that ALSO accepts an epoch NUMBER. Live-verified on a
real account: SELECT DATE(1631711999) is 2021-09-15 while the identical
SELECT TO_DATE(1631711999) fails "invalid type [TO_DATE(1631711999)] for parameter
'TO_DATE'". Everything else is TO_DATE's behaviour.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanWhether a NUMBER argument may be read as an epoch.Methods inherited from class dev.frostlake.functions.scalar.conversion.ToDate
evaluate, getMaxArgCount, getMinArgCount, vectorRejectionMethods inherited from class dev.frostlake.functions.BuiltInFunction
approximateRejection, binaryRejection, booleanRejection, evaluate, fileRejection, geoRejection, getName, getReturnType, isVariadic, refusesMissingArgumentsByType, semiStructuredRejection, structuredRejection, temporalRejection, temporalRejection, temporalRejection, textRejection, uuidRejection
-
Constructor Details
-
DateFunction
public DateFunction()
-
-
Method Details
-
acceptsNumericEpoch
protected boolean acceptsNumericEpoch()Description copied from class:ToDateWhether a NUMBER argument may be read as an epoch. Live-verified on a real account:TO_DATE(1631711999)andTRY_TO_DATE(1631711999)both fail "invalid type [TO_DATE(1631711999)] for parameter 'TO_DATE'", while theDATE()alias of the very same function returns 2021-09-15 andTO_TIMESTAMP(1631711999)works — so the restriction belongs to the TO_DATE spelling, not to the epoch conversion. A numeric STRING stays legal (TO_DATE('1631711999')is 2021-09-15).- Overrides:
acceptsNumericEpochin classToDate
-