public final class ClickHouseFunctions extends IsoFunctions
| 构造器和说明 |
|---|
ClickHouseFunctions() |
| 限定符和类型 | 方法和说明 |
|---|---|
static NativeFunction |
cast(Expression expression,
Expression dataType) |
static NativeFunction |
dateDiff(Expression unit,
Expression startTime,
Expression endTime)
Returns the difference between two Date or DateTime values.
|
static NativeFunction |
dateDiff(Expression unit,
Expression startTime,
Expression endTime,
Expression timeZone) |
static NativeFunction |
divide(Expression expression1,
Expression expression2)
Calculates the quotient of the numbers.
|
static NativeFunction |
formatDateTime(Expression time,
Expression formatter)
Function formats a Time according given Format string.
|
static NativeFunction |
formatDateTime(Expression time,
Expression formatter,
Expression timeZone) |
static NativeFunction |
fromUnixTime(Expression timeStamp)
When there is only single argument of integer type, it act in the same way as toDateTime and return DateTime.
|
static NativeFunction |
fromUnixTime(Expression timeStamp,
Expression formatter)
When there are two arguments, first is integer or DateTime, second is constant format string,
it act in the same way as formatDateTime and return String type.
|
static NativeFunction |
intDiv(Expression expression1,
Expression expression2)
Calculates the quotient of the numbers.
|
static NativeFunction |
intDivOrZero(Expression expression1,
Expression expression2)
Differs from ‘intDiv’ in that it returns zero when dividing by zero or when dividing a minimal
negative number by minus one.
|
static NativeFunction |
minus(Expression expression1,
Expression expression2)
Calculates the difference.
|
static NativeFunction |
modulo(Expression expression1,
Expression expression2)
Calculates the remainder after division.
|
static NativeFunction |
moduloOrZero(Expression expression1,
Expression expression2)
Differs from modulo in that it returns zero when the divisor is zero.
|
static NativeFunction |
multiply(Expression expression1,
Expression expression2)
Calculates the product of the numbers.
|
static NativeFunction |
now()
Accepts zero arguments and returns the current time at one of the moments of request execution.
|
static NativeFunction |
plus(Expression expression1,
Expression expression2)
Calculates the sum of the numbers.
|
static NativeFunction |
toDate(Expression expression) |
static NativeFunction |
toDateTime(Expression expression) |
static NativeFunction |
today()
Accepts zero arguments and returns the current date at one of the moments of request execution.
|
static NativeFunction |
toDayOfMonth(Expression expression)
Converts a date or date with time to a UInt8 number containing the number of the day of the month (1-31).
|
static NativeFunction |
toDayOfWeek(Expression expression)
Converts a date or date with time to a UInt8 number containing the number of the day of the
week (Monday is 1, and Sunday is 7).
|
static NativeFunction |
toDayOfYear(Expression expression)
Converts a date or date with time to a UInt16 number containing the number of the day of the year (1-366).
|
static NativeFunction |
toDecimal128(Expression value,
Expression scale)
To see toDecimal32
|
static NativeFunction |
toDecimal32(Expression value,
Expression scale)
Converts value to the Decimal data type with precision of scale.
|
static NativeFunction |
toDecimal64(Expression value,
Expression scale)
To see toDecimal32
|
static NativeFunction |
toFloat32(Expression expression) |
static NativeFunction |
toFloat64(Expression expression) |
static NativeFunction |
toHour(Expression expression)
Converts a date with time to a UInt8 number containing the number of the hour in 24-hour time (0-23).
|
static NativeFunction |
toInt16(Expression expression) |
static NativeFunction |
toInt32(Expression expression) |
static NativeFunction |
toInt64(Expression expression) |
static NativeFunction |
toInt8(Expression expression) |
static NativeFunction |
toMinute(Expression expression)
Converts a date with time to a UInt8 number containing the number of the minute of the hour (0-59).
|
static NativeFunction |
toMonth(Expression expression)
Converts a date or date with time to a UInt8 number containing the month number (1-12).
|
static NativeFunction |
toSecond(Expression expression)
Converts a date with time to a UInt8 number containing the number of the second in the minute (0-59).
|
static NativeFunction |
toString(Expression expression) |
static NativeFunction |
toString(Expression expression,
Expression formatter)
Functions for converting dates, and dates with times.
|
static NativeFunction |
toUInt16(Expression expression) |
static NativeFunction |
toUInt32(Expression expression) |
static NativeFunction |
toUInt64(Expression expression) |
static NativeFunction |
toUInt8(Expression expression) |
static NativeFunction |
toUnixTimestamp(Expression expression) |
static NativeFunction |
toUnixTimestamp(Expression expression,
Expression timeZone) |
static NativeFunction |
toYear(Expression expression)
Converts a date or date with time to a UInt16 number containing the year number (AD).
|
static NativeFunction |
toYYYYMM(Expression expression)
Converts a date or date with time to a UInt32 number containing the year and month number (YYYY * 100 + MM).
|
static NativeFunction |
toYYYYMMDD(Expression expression)
Converts a date or date with time to a UInt32 number containing the year and month
number (YYYY * 10000 + MM * 100 + DD).
|
static NativeFunction |
toYYYYMMDDhhmmss(Expression expression)
Converts a date or date with time to a UInt64 number containing the year and month number
(YYYY * 10000000000 + MM * 100000000 + DD * 1000000 + hh * 10000 + mm * 100 + ss).
|
static NativeFunction |
yesterday()
Accepts zero arguments and returns yesterday’s date at one of the moments of request execution.
|
public static NativeFunction plus(Expression expression1, Expression expression2)
public static NativeFunction minus(Expression expression1, Expression expression2)
public static NativeFunction multiply(Expression expression1, Expression expression2)
public static NativeFunction divide(Expression expression1, Expression expression2)
public static NativeFunction intDiv(Expression expression1, Expression expression2)
public static NativeFunction intDivOrZero(Expression expression1, Expression expression2)
public static NativeFunction modulo(Expression expression1, Expression expression2)
public static NativeFunction moduloOrZero(Expression expression1, Expression expression2)
public static NativeFunction toInt8(Expression expression)
public static NativeFunction toInt16(Expression expression)
public static NativeFunction toInt32(Expression expression)
public static NativeFunction toInt64(Expression expression)
public static NativeFunction toUInt8(Expression expression)
public static NativeFunction toUInt16(Expression expression)
public static NativeFunction toUInt32(Expression expression)
public static NativeFunction toUInt64(Expression expression)
public static NativeFunction toFloat32(Expression expression)
public static NativeFunction toFloat64(Expression expression)
public static NativeFunction toDate(Expression expression)
public static NativeFunction toDateTime(Expression expression)
public static NativeFunction toDecimal32(Expression value, Expression scale)
value - The value can be a number or a string.scale - The scale parameter specifies the number of decimal places.public static NativeFunction toDecimal64(Expression value, Expression scale)
public static NativeFunction toDecimal128(Expression value, Expression scale)
public static NativeFunction toString(Expression expression)
public static NativeFunction toString(Expression expression, Expression formatter)
expression - the value for convertingformatter - The date and date-with-time formats for the toDate/toDateTime functions are
defined as follows: "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss"public static NativeFunction cast(Expression expression, Expression dataType)
public static NativeFunction toUnixTimestamp(Expression expression)
expression - the value of datetime typepublic static NativeFunction toUnixTimestamp(Expression expression, Expression timeZone)
expression - the value of String typetimeZone - timeZone like "UTC", "GMT", .etcpublic static NativeFunction toYear(Expression expression)
public static NativeFunction toMonth(Expression expression)
public static NativeFunction toDayOfYear(Expression expression)
public static NativeFunction toDayOfMonth(Expression expression)
public static NativeFunction toDayOfWeek(Expression expression)
public static NativeFunction toHour(Expression expression)
public static NativeFunction toMinute(Expression expression)
public static NativeFunction toSecond(Expression expression)
public static NativeFunction now()
public static NativeFunction today()
public static NativeFunction yesterday()
public static NativeFunction toYYYYMM(Expression expression)
public static NativeFunction toYYYYMMDD(Expression expression)
public static NativeFunction toYYYYMMDDhhmmss(Expression expression)
public static NativeFunction dateDiff(Expression unit, Expression startTime, Expression endTime)
unit - Time unit, in which the returned value is expressed.
Supported values: second, minute, hour, day, week, month, quarter, yearstartTime - The first time value to compare. Date or DateTime.endTime - The second time value to compare. Date or DateTime.public static NativeFunction dateDiff(Expression unit, Expression startTime, Expression endTime, Expression timeZone)
timeZone - If specified, it is applied to both startdate and enddate. If not specified,
timezones of startdate and enddate are used. If they are not the same, the
result is unspecified.public static NativeFunction formatDateTime(Expression time, Expression formatter)
public static NativeFunction formatDateTime(Expression time, Expression formatter, Expression timeZone)
timeZone - timeZone like "UTC", "GMT", .etcpublic static NativeFunction fromUnixTime(Expression timeStamp)
timeStamp - argument of integer typepublic static NativeFunction fromUnixTime(Expression timeStamp, Expression formatter)
timeStamp - argument of integer typeformatter - constant format stringCopyright © 2020 com.github.braisdom. All rights reserved.