Class SqlLibraryOperators
They are read by SqlLibraryOperatorTableFactory
into instances
of SqlOperatorTable
that contain functions and operators for
particular libraries.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SqlFunction
TheACOSD(numeric)
function; returns the inverse cosine ofvalue
in degrees.static final SqlFunction
TheACOSH(numeric)
function; returns the inverse hyperbolic cosine ofvalue
.static final SqlFunction
The "ADD_MONTHS(start_date, num_months)" function (SPARK) Returns the date that is num_months after start_date.static final SqlFunction
The "AGGREGATE(m)" aggregate function; aggregates a measure column according to the measure's rollup strategy.static final SqlFunction
The "ARRAY(exp, ...)" function (Spark); compare with the standard array value constructor, "ARRAY [exp, ...]".static final SqlAggFunction
The "ARRAY_AGG(value [ ORDER BY ...])" aggregate function, in BigQuery and PostgreSQL, gathers values into arrays.static final SqlFunction
The "ARRAY_APPEND(array, element)" function.static final SqlFunction
The "ARRAY_COMPACT(array)" function.static final SqlFunction
The "ARRAY_CONCAT(array [, array]*)" function.static final SqlAggFunction
The "ARRAY_CONCAT_AGG(value [ ORDER BY ...])" aggregate function, in BigQuery and PostgreSQL, concatenates array values into arrays.static final SqlFunction
The "ARRAY_CONTAINS(array, element)" function.static final SqlFunction
The "ARRAY_DISTINCT(array)" function.static final SqlFunction
The "ARRAY_EXCEPT(array1, array2)" function.static final SqlFunction
The "ARRAY_INSERT(array, pos, val)" function (Spark).static final SqlFunction
The "ARRAY_INTERSECT(array1, array2)" function.static final SqlFunction
The "ARRAY_JOIN(array, delimiter [, nullText ])" function.static final SqlFunction
The "ARRAY_LENGTH(array)" function.static final SqlFunction
The "ARRAY_MAX(array)" function.static final SqlFunction
The "ARRAY_MAX(array)" function.static final SqlFunction
The "ARRAY_POSITION(array, element)" function.static final SqlFunction
The "ARRAY_PREPEND(array, element)" function.static final SqlFunction
The "ARRAY_REMOVE(array, element)" function.static final SqlFunction
The "ARRAY_REPEAT(element, count)" function.static final SqlFunction
The "ARRAY_REVERSE(array)" function.static final SqlFunction
The "ARRAY_SIZE(array)" function.static final SqlFunction
The "ARRAY_TO_STRING(array, delimiter [, nullText ])" function.static final SqlFunction
The "ARRAY_UNION(array1, array2)" function.static final SqlFunction
The "ARRAYS_OVERLAP(array1, array2)" function (Spark).static final SqlFunction
The "ARRAYS_ZIP(array, ...)" function (Spark).static final SqlFunction
TheACOSD(numeric)
function; returns the inverse sine ofvalue
in degrees.static final SqlFunction
TheASINH(numeric)
function; returns the inverse hyperbolic sine ofvalue
.static final SqlFunction
TheACOSD(numeric)
function; returns the inverse tangent ofvalue
in degrees.static final SqlFunction
TheATANH(numeric)
function; returns the inverse hyperbolic tangent ofvalue
.static final SqlFunction
Alias forSqlStdOperatorTable.BITCOUNT
.static final SqlFunction
static final SqlBasicFunction
The "BIT_GET(value, position)" function.static final SqlFunction
The "BIT_LENGTH(string or binary)" function.static final SqlAggFunction
The "BITAND_AGG(expression)" function.static final SqlAggFunction
The "BITOR_AGG(expression)" function.static final SqlAggFunction
The "BOOL_AND(condition)" aggregate function, PostgreSQL and Redshift's equivalent toSqlStdOperatorTable.EVERY
.static final SqlAggFunction
The "BOOL_OR(condition)" aggregate function, PostgreSQL and Redshift's equivalent toSqlStdOperatorTable.SOME
.static final SqlAggFunction
The "BOOLAND_AGG(condition)" aggregate function, Snowflake's equivalent toSqlStdOperatorTable.EVERY
.static final SqlAggFunction
The "BOOLOR_AGG(condition)" aggregate function, Snowflake's equivalent toSqlStdOperatorTable.SOME
.static final SqlFunction
The "CEIL(value)" function.static final SqlFunction
The "CHAR(n)" function; returns the character whose ASCII code isn
% 256, or null ifn
< 0.static final SqlFunction
The "CHR(n)" function; returns the character whose UTF-8 code isn
.static final SqlFunction
The "CODE_POINTS_TO_BYTES(integers)" function (BigQuery); Converts an array of extended ASCII code points to bytes.static final SqlFunction
The "CODE_POINTS_TO_STRING(integers)" function (BigQuery); Converts an array of Unicode code points to string.static final SqlFunction
static final SqlFunction
The "CONCAT(arg, ...)" function that concatenates strings.static final SqlFunction
The "CONCAT(arg, ...)" function that concatenates strings, which never returns null.static final SqlFunction
The "CONCAT_WS(separator, arg1, ...)" function (MySQL); concatenates strings with separator, and treats null arguments as empty strings.static final SqlFunction
The "CONCAT_WS(separator, arg1, arg2, ...)" function in (MSSQL).static final SqlFunction
The "CONCAT_WS(separator, arg1, ...)" function (Postgres).static final SqlFunction
The "CONCAT_WS(separator[, str | array(str)]+)" function in (SPARK).static final SqlFunction
The "CONCAT(arg0, arg1)" function that concatenates strings.static final SqlFunction
"CONTAINS_SUBSTR(expression, string[, json_scope => json_scope_value ])" function; returns whether string exists as substring in expression, with optional json_scope argument.static final SqlFunction
The "CONVERT_TIMEZONE(tz1, tz2, datetime)" function; converts the timezone ofdatetime
fromtz1
totz2
.static final SqlFunction
TheCOSD(numeric)
function; returns the cosine ofvalue
.static final SqlFunction
static final SqlFunction
The "COTH(value)" function; returns the hyperbolic cotangent ofvalue
.static final SqlAggFunction
The "COUNTIF(condition) [OVER (...)]" function, in BigQuery, returns the count of TRUE values for expression.static final SqlFunction
static final SqlFunction
The "COTH(value)" function; returns the hyperbolic cosecant ofvalue
.static final SqlFunction
The "CURRENT_DATETIME([timezone])" function.static final SqlFunction
The "DATE" function.static final SqlFunction
THE "DATE_ADD(date, interval)" function (BigQuery) adds the interval to the date.static final SqlFunction
The "DATE_ADD(start_date, num_days)" function (Spark) Returns the date that is num_days after start_date.static final SqlFunction
THE "DATE_DIFF(date, date2, timeUnit)" function (BigQuery) returns the number of timeUnit in (date - date2).static final SqlFunction
The "DATE_FROM_UNIX_DATE(integer)" function; returns a DATE value a given number of seconds after 1970-01-01.static final SqlFunction
The "DATE_PART(timeUnit, datetime)" function (Databricks, Postgres, Redshift, Snowflake).static final SqlFunction
The "DATE_SUB(date, interval)" function (BigQuery); subtracts interval from the date, independent of any time zone.static final SqlFunction
The "DATE_TRUNC(date, timeUnit)" function (BigQuery); truncates a DATE value to the beginning of a timeUnit.static final SqlFunction
The "DATEADD(timeUnit, numeric, datetime)" function (Microsoft SQL Server, Redshift, Snowflake).static final SqlFunction
The "DATEDIFF(timeUnit, datetime, datetime2)" function (Microsoft SQL Server, Redshift, Snowflake).static final SqlFunction
The "DATEPART(timeUnit, datetime)" function (Microsoft SQL Server).static final SqlFunction
The "DATETIME" function returns a CalciteTIMESTAMP
(which BigQuery calls aDATETIME
).static final SqlFunction
The "DATETIME_ADD(timestamp, interval)" function (BigQuery).static final SqlFunction
The "DATETIME_DIFF(timestamp, timestamp2, timeUnit)" function (BigQuery).static final SqlFunction
The "DATETIME_SUB(timestamp, interval)" function (BigQuery).static final SqlFunction
The "DATETIME_TRUNC(timestamp, timeUnit)" function (BigQuery); truncates a TIMESTAMP value to the beginning of a timeUnit.static final SqlFunction
The "DAYNAME(datetime)" function; returns the name of the day of the week, in the current locale, of a TIMESTAMP or DATE argument.static final SqlFunction
The "DECODE(v, v1, result1, [v2, result2, ...], resultN)" function.static final SqlFunction
static final SqlBasicFunction
The "ENDS_WITH(value1, value2)" function (BigQuery).static final SqlFunction
The "ENDSWITH(value1, value2)" function (Snowflake).static final SqlFunction
The "EXISTS(array, lambda)" function (Spark); returns whether a predicate holds for one or more elements in the array.static final SqlFunction
static final SqlFunction
static final SqlFunction
static final SqlFunction
TheFACTORIAL(integer)
function.static final SqlFunction
The "FIND_IN_SET(matchStr, textStr)" function.static final SqlFunction
The "FLOOR(value)" function.static final SqlFunction
The "FORMAT_DATE(string, date)" function (BigQuery); Formats a date object according to the specified string.static final SqlFunction
The "FORMAT_DATETIME(string, timestamp)" function (BigQuery); formats a timestamp object according to the specified string.static final SqlFunction
The "FORMAT_NUMBER(value, decimalOrFormat)" function.static final SqlFunction
The "FORMAT_TIME(string, time)" function (BigQuery); Formats a time object according to the specified string.static final SqlFunction
The "FORMAT_TIMESTAMP(string, timestamp)" function (BigQuery); Formats a timestamp object according to the specified string.static final SqlFunction
static final SqlFunction
static final SqlFunction
The "FROM_HEX(varchar)" function; converts a hexadecimal-encodedvarchar
into bytes.static final SqlFunction
Alias forBIT_GET
.static final SqlFunction
The "GREATEST(value, value)" function.static final SqlFunction
The "GREATEST(value, value)" function.static final SqlAggFunction
The "GROUP_CONCAT([DISTINCT] expr [, ...] [ORDER BY ...] [SEPARATOR sep])" aggregate function, MySQL's equivalent ofSqlStdOperatorTable.LISTAGG
.static final SqlFunction
The "IF(condition, thenValue, elseValue)" function.static final SqlFunction
The "IFNULL(value, value)" function.static final SqlSpecialOperator
The case-insensitive variant of the LIKE operator.static final SqlOperator
Infix "::" cast operator used by PostgreSQL, for example'100'::INTEGER
.static final SqlFunction
The "INSTR(string, substring [, position [, occurrence]])" function.static final SqlFunction
The "IS_INF(value)" function.static final SqlFunction
The "IS_NAN(value)" function.static final SqlFunction
static final SqlFunction
static final SqlFunction
static final SqlFunction
static final SqlFunction
static final SqlFunction
static final SqlFunction
static final SqlFunction
static final SqlFunction
static final SqlFunction
static final SqlFunction
The "LEAST(value, value)" function.static final SqlFunction
The "GREATEST(value, value)" function.static final SqlFunction
static final SqlFunction
The "LEN(string)" function.static final SqlFunction
The "LENGTH(string)" function.static final SqlFunction
The "LEVENSHTEIN(string1, string2)" function.static final SqlFunction
The "LOG(value [, value2])" function.static final SqlFunction
The "LOG(numeric1 [, numeric2 ]) " function.static final SqlFunction
The "LOG(numeric1 [, numeric2 ]) " function.static final SqlFunction
The "LOG1p(numeric)" function.static final SqlFunction
The "LOG2(numeric)" function.static final SqlAggFunction
The "LOGICAL_AND(condition)" aggregate function, BigQuery's equivalent toSqlStdOperatorTable.EVERY
.static final SqlAggFunction
The "LOGICAL_OR(condition)" aggregate function, BigQuery's equivalent toSqlStdOperatorTable.SOME
.static final SqlFunction
The "LPAD(original_value, return_length[, pattern])" function.static final SqlFunction
The "LTRIM(string)" function.static final SqlFunction
The "MAP(key, value, ...)" function (Spark); compare with the standard map value constructor, "MAP[key, value, ...]".static final SqlFunction
The "MAP_CONCAT(map [, map]*)" function.static final SqlFunction
The "MAP_CONTAINS_KEY(map, key)" function.static final SqlFunction
The "MAP_ENTRIES(map)" function.static final SqlFunction
The "MAP_FROM_ARRAYS(keysArray, valuesArray)" function.static final SqlFunction
The "MAP_FROM_ENTRIES(arrayOfEntries)" function.static final SqlFunction
The "MAP_KEYS(map)" function.static final SqlFunction
The "MAP_VALUES(map)" function.static final SqlAggFunction
The "MAX_BY(value, comp)" aggregate function, Spark's equivalent toSqlStdOperatorTable.ARG_MAX
.static final SqlFunction
static final SqlAggFunction
The "MIN_BY(condition)" aggregate function, Spark's equivalent toSqlStdOperatorTable.ARG_MIN
.static final SqlFunction
The "MONTHNAME(datetime)" function; returns the name of the month, in the current locale, of a TIMESTAMP or DATE argument.static final SqlFunction
The "CONVERT(type, expr [,style])" function (Microsoft SQL Server).static final SqlSpecialOperator
The case-insensitive variant of the NOT LIKE operator.static final SqlSpecialOperator
The regex variant of the NOT LIKE operator.static final SqlOperator
NULL-safe "<=>" equal operator used by MySQL, for example1<=>NULL
.static final SqlBasicFunction
The "NVL(value, value)" function.static final SqlBasicFunction
The "NVL2(value, value, value)" function.static final SqlOperator
The "OFFSET(index)" array subscript operator used by BigQuery.static final SqlOperator
The "ORDINAL(index)" array subscript operator used by BigQuery.static final SqlFunction
The "PARSE_DATE(string, string)" function (BigQuery); Converts a string representation of date to a DATE object.static final SqlFunction
The "PARSE_DATETIME(string, string [, timezone])" function (BigQuery); Formats a timestamp object according to the specified string.static final SqlFunction
The "PARSE_TIME(string, string)" function (BigQuery); converts a string representation of time to a TIME value.static final SqlFunction
The "PARSE_TIMESTAMP(string, string [, timezone])" function (BigQuery); Formats a timestamp object according to the specified string.static final SqlFunction
The "PARSE_URL(urlString, partToExtract [, keyToExtract] )" function.static final SqlAggFunction
ThePERCENTILE_CONT
function, BigQuery's equivalent toSqlStdOperatorTable.PERCENTILE_CONT
, but uses anOVER
clause rather thanWITHIN GROUP
.static final SqlAggFunction
ThePERCENTILE_DISC
function, BigQuery's equivalent toSqlStdOperatorTable.PERCENTILE_DISC
, but uses anOVER
clause rather thanWITHIN GROUP
.static final SqlFunction
static final SqlFunction
ThePOWER(numeric, numeric)
function.static final SqlFunction
The RANDOM() function.static final SqlFunction
The "REGEXP(value, regexp)" function, equivalent toRLIKE
.static final SqlFunction
The "REGEXP_CONTAINS(value, regexp)" function.static final SqlBasicFunction
The "REGEXP_EXTRACT(value, regexp[, position[, occurrence]])" function.static final SqlBasicFunction
The "REGEXP_EXTRACT_ALL(value, regexp)" function.static final SqlBasicFunction
The "REGEXP_INSTR(value, regexp [, position[, occurrence, [occurrence_position]]])" function.static final SqlFunction
The "REGEXP_LIKE(value, regexp)" function, equivalent toRLIKE
.static final SqlFunction
The "REGEXP_REPLACE(value, regexp)" function.static final SqlFunction
The "REGEXP_REPLACE(value, regexp, rep)" function.static final SqlFunction
The "REGEXP_REPLACE(value, regexp, rep, pos)" function.static final SqlFunction
The "REGEXP_REPLACE(value, regexp, rep, pos, [ occurrence | matchType ])" function.static final SqlFunction
The "REGEXP_REPLACE(value, regexp, rep, pos, matchType)" function.static final SqlFunction
The "REGEXP_REPLACE(value, regexp, rep, pos, occurrence, matchType)" function.static final SqlFunction
The "REGEXP_REPLACE(value, regexp, rep)" function.static final SqlFunction
The "REGEXP_REPLACE(value, regexp, rep)" function.static final SqlFunction
The "REGEXP_REPLACE(value, regexp, rep, flags)" function.static final SqlFunction
The "REGEXP_SUBSTR(value, regexp[, position[, occurrence]])" function.static final SqlFunction
static final SqlFunction
static final SqlFunction
The "REVERSE(string|array)" function.static final SqlFunction
static final SqlSpecialOperator
The regex variant of the LIKE operator.static final SqlFunction
The "RPAD(original_value, return_length[, pattern])" function.static final SqlFunction
The "RTRIM(string)" function.static final SqlFunction
The "SAFE_ADD(numeric1, numeric2)" function; equivalent to the+
operator but returns null if overflow occurs.static final SqlFunction
The "SAFE_CAST(expr AS type)" function; identical to CAST(), except that if conversion fails, it returns NULL instead of raising an error.static final SqlFunction
The "SAFE_DIVIDE(numeric1, numeric2)" function; equivalent to the/
operator but returns null if an error occurs, such as overflow or division by zero.static final SqlFunction
The "SAFE_MULTIPLY(numeric1, numeric2)" function; equivalent to the*
operator but returns null if overflow occurs.static final SqlFunction
The "SAFE_NEGATE(numeric)" function; negatesnumeric
and returns null if overflow occurs.static final SqlOperator
The "SAFE_OFFSET(index)" array subscript operator used by BigQuery.static final SqlOperator
The "SAFE_ORDINAL(index)" array subscript operator used by BigQuery.static final SqlFunction
The "SAFE_SUBTRACT(numeric1, numeric2)" function; equivalent to the-
operator but returns null if overflow occurs.static final SqlFunction
static final SqlFunction
The "COTH(value)" function; returns the hyperbolic secant ofvalue
.static final SqlFunction
static final SqlFunction
static final SqlFunction
static final SqlFunction
TheSIND(numeric)
function; returns the sine ofvalue
.static final SqlFunction
static final SqlFunction
The "SORT_ARRAY(array)" function (Spark).static final SqlFunction
static final SqlFunction
The variant of the SOUNDEX operator.static final SqlFunction
static final SqlFunction
The "SPLIT(string [, delimiter])" function.static final SqlBasicFunction
The "STARTS_WITH(value1, value2)" function (BigQuery, PostgreSQL).static final SqlFunction
The "STARTSWITH(value1, value2)" function (Snowflake).static final SqlFunction
The "STR_TO_MAP(string[, stringDelimiter[, keyValueDelimiter]])" function.static final SqlFunction
static final SqlAggFunction
The "STRING_AGG(value [, separator ] [ ORDER BY ...])" aggregate function, BigQuery and PostgreSQL's equivalent ofSqlStdOperatorTable.LISTAGG
.static final SqlFunction
The "STRPOS(string, substring)" function.static final SqlFunction
BigQuery's "SUBSTR(string, position [, substringLength ])" function.static final SqlFunction
MySQL's "SUBSTR(string, position [, substringLength ])" function.static final SqlFunction
Oracle's "SUBSTR(string, position [, substringLength ])" function.static final SqlFunction
PostgreSQL's "SUBSTR(string, position [, substringLength ])" function.static final SqlFunction
The "SUBSTRING_INDEX(string, delimiter, count)" function.static final SqlFunction
TheTAND(numeric)
function; returns the tangent ofvalue
.static final SqlFunction
static final SqlFunction
The "TIME" function.static final SqlFunction
The "TIME_ADD(time, interval)" function (BigQuery); adds interval expression to the specified time expression.static final SqlFunction
The "TIME_DIFF(time, time, timeUnit)" function (BigQuery); returns the number of timeUnit between the two time expressions.static final SqlFunction
The "TIME_SUB(time, interval)" function (BigQuery); subtracts an interval from a time, independent of any time zone.static final SqlFunction
The "TIME_TRUNC(time, timeUnit)" function (BigQuery); truncates a TIME value to the beginning of a timeUnit.static final SqlFunction
The "TIMESTAMP" function returns a CalciteTIMESTAMP WITH LOCAL TIME ZONE
(which BigQuery calls aTIMESTAMP
).static final SqlBasicFunction
The "TIMESTAMP_ADD(timestamp, interval)" function (BigQuery), the two-argument variant of the built-inTIMESTAMPADD
function, which has three arguments.static final SqlFunction
The "TIMESTAMP_DIFF(timestamp, timestamp, timeUnit)" function (BigQuery); returns the number of timeUnit between the two timestamp expressions.static final SqlFunction
The "TIMESTAMP_MICROS(bigint)" function; returns a TIMESTAMP value a given number of micro-seconds after 1970-01-01 00:00:00.static final SqlFunction
The "TIMESTAMP_MILLIS(bigint)" function; returns a TIMESTAMP value a given number of milliseconds after 1970-01-01 00:00:00.static final SqlFunction
The "TIMESTAMP_SECONDS(bigint)" function; returns a TIMESTAMP value a given number of seconds after 1970-01-01 00:00:00.static final SqlBasicFunction
The "TIMESTAMP_SUB(timestamp, interval)" function (BigQuery); subtracts an interval from a timestamp, independent of any time zone.static final SqlFunction
The "TIMESTAMP_TRUNC(timestamp, timeUnit[, timeZone])" function (BigQuery); truncates aTIMESTAMP WITH LOCAL TIME ZONE
value to the beginning of a timeUnit.static final SqlFunction
static final SqlFunction
static final SqlFunction
The "TO_CHAR(timestamp, format)" function; convertstimestamp
to string according to the givenformat
.static final SqlFunction
The "TO_CHAR(timestamp, format)" function; convertstimestamp
to string according to the givenformat
.static final SqlFunction
The "TO_CODE_POINTS(string or binary)" function (BigQuery); Converts astring
orbinary
value to an array of integers that represent code points or extended ASCII character values.static final SqlFunction
The "TO_DATE(string1, string2)" function; casts string1 to a DATE using the format specified in string2.static final SqlFunction
The "TO_DATE(string1, string2)" function for PostgreSQL; casts string1 to a DATE using the format specified in string2.static final SqlFunction
The "TO_HEX(binary)" function; convertsbinary
into a hexadecimal varchar.static final SqlFunction
The "TO_TIMESTAMP(string1, string2)" function; casts string1 to a TIMESTAMP using the format specified in string2.static final SqlFunction
The "TO_TIMESTAMP(string1, string2)" function for PostgreSQL; casts string1 to a TIMESTAMP using the format specified in string2.static final SqlFunction
TheTRANSLATE(string_expr, search_chars, replacement_chars)
function returns string_expr with all occurrences of each character in search_chars replaced by its corresponding character in replacement_chars.static final SqlFunction
The "TRUNC(numeric1 [, integer2])" function.static final SqlFunction
The "TRY_CAST(expr AS type)" function, equivalent to SAFE_CAST.static final SqlFunction
The "UNIX_DATE(date)" function; returns the number of days since 1970-01-01.static final SqlFunction
The "UNIX_MICROS(bigint)" function; returns the number of microseconds since 1970-01-01 00:00:00.static final SqlFunction
The "UNIX_MILLIS(bigint)" function; returns the number of milliseconds since 1970-01-01 00:00:00.static final SqlFunction
The "UNIX_SECONDS(bigint)" function; returns the number of seconds since 1970-01-01 00:00:00.static final SqlFunction
The "URL_DECODE(string)" function.static final SqlFunction
The "URL_ENCODE(string)" function.static final SqlFunction
-
Method Summary
-
Field Details
-
AGGREGATE
The "AGGREGATE(m)" aggregate function; aggregates a measure column according to the measure's rollup strategy. This is a Calcite-specific extension.This operator is for SQL (and AST); for internal use (RexNode and Aggregate) use
AGG_M2M
. -
CONVERT_TIMEZONE
The "CONVERT_TIMEZONE(tz1, tz2, datetime)" function; converts the timezone ofdatetime
fromtz1
totz2
. This function is only on Redshift, but we list it in PostgreSQL because Redshift does not have its own library. -
DATE_ADD
THE "DATE_ADD(date, interval)" function (BigQuery) adds the interval to the date. -
DATE_DIFF
THE "DATE_DIFF(date, date2, timeUnit)" function (BigQuery) returns the number of timeUnit in (date - date2). -
DATEADD
The "DATEADD(timeUnit, numeric, datetime)" function (Microsoft SQL Server, Redshift, Snowflake). -
DATE_ADD_SPARK
The "DATE_ADD(start_date, num_days)" function (Spark) Returns the date that is num_days after start_date. -
ADD_MONTHS
The "ADD_MONTHS(start_date, num_months)" function (SPARK) Returns the date that is num_months after start_date. -
DATEDIFF
The "DATEDIFF(timeUnit, datetime, datetime2)" function (Microsoft SQL Server, Redshift, Snowflake).MySQL has "DATEDIFF(date, date2)" and "TIMEDIFF(time, time2)" functions but Calcite does not implement these because they have no "timeUnit" argument.
-
MSSQL_CONVERT
The "CONVERT(type, expr [,style])" function (Microsoft SQL Server).Syntax:
CONVERT( data_type [ ( length ) ], expression [, style ] )
The optional "style" argument specifies how the value is going to be converted; this implementation ignores the
style
parameter.CONVERT(type, expr, style)
is equivalent to CAST(expr AS type), and the implementation delegates most of its logic to actual CAST operator.Not to be confused with standard
SqlStdOperatorTable.CONVERT
, which converts a string from one character set to another. -
DATE_PART
The "DATE_PART(timeUnit, datetime)" function (Databricks, Postgres, Redshift, Snowflake). -
DATE_SUB
The "DATE_SUB(date, interval)" function (BigQuery); subtracts interval from the date, independent of any time zone. -
DATEPART
The "DATEPART(timeUnit, datetime)" function (Microsoft SQL Server). -
DECODE
The "DECODE(v, v1, result1, [v2, result2, ...], resultN)" function. -
IF
The "IF(condition, thenValue, elseValue)" function. -
NVL
The "NVL(value, value)" function. -
NVL2
The "NVL2(value, value, value)" function. -
IFNULL
The "IFNULL(value, value)" function. -
LEN
The "LEN(string)" function. -
LENGTH
The "LENGTH(string)" function. -
LPAD
The "LPAD(original_value, return_length[, pattern])" function. -
RPAD
The "RPAD(original_value, return_length[, pattern])" function. -
LTRIM
The "LTRIM(string)" function. -
RTRIM
The "RTRIM(string)" function. -
SPLIT
The "SPLIT(string [, delimiter])" function. -
STRPOS
The "STRPOS(string, substring)" function. -
INSTR
The "INSTR(string, substring [, position [, occurrence]])" function. -
ENDS_WITH
The "ENDS_WITH(value1, value2)" function (BigQuery). -
ENDSWITH
The "ENDSWITH(value1, value2)" function (Snowflake). -
STARTS_WITH
The "STARTS_WITH(value1, value2)" function (BigQuery, PostgreSQL). -
STARTSWITH
The "STARTSWITH(value1, value2)" function (Snowflake). -
SUBSTR_BIG_QUERY
BigQuery's "SUBSTR(string, position [, substringLength ])" function. -
SUBSTR_MYSQL
MySQL's "SUBSTR(string, position [, substringLength ])" function. -
SUBSTR_ORACLE
Oracle's "SUBSTR(string, position [, substringLength ])" function.It has different semantics to standard SQL's
SqlStdOperatorTable.SUBSTRING
function:- If
substringLength
≤ 0, result is the empty string (Oracle would return null, because it treats the empty string as null, but Calcite does not have these semantics); - If
position
= 0, treatposition
as 1; - If
position
< 0, treatposition
as "length(string) + position + 1".
- If
-
SUBSTR_POSTGRESQL
PostgreSQL's "SUBSTR(string, position [, substringLength ])" function. -
PARSE_URL
The "PARSE_URL(urlString, partToExtract [, keyToExtract] )" function. -
FIND_IN_SET
The "FIND_IN_SET(matchStr, textStr)" function. -
GREATEST
The "GREATEST(value, value)" function. -
GREATEST_PG
The "GREATEST(value, value)" function. -
LEAST
The "LEAST(value, value)" function. -
LEAST_PG
The "GREATEST(value, value)" function. -
CEIL_BIG_QUERY
The "CEIL(value)" function. Identical to the standardCEIL
function except the return type should be a double if the operand is an integer. -
FLOOR_BIG_QUERY
The "FLOOR(value)" function. Identical to the standardFLOOR
function except the return type should be a double if the operand is an integer. -
TRANSLATE3
TheTRANSLATE(string_expr, search_chars, replacement_chars)
function returns string_expr with all occurrences of each character in search_chars replaced by its corresponding character in replacement_chars.It is not defined in the SQL standard, but occurs in Oracle and PostgreSQL.
-
JSON_TYPE
-
JSON_DEPTH
-
JSON_LENGTH
-
JSON_KEYS
-
JSON_PRETTY
-
JSON_REMOVE
-
JSON_STORAGE_SIZE
-
JSON_INSERT
-
JSON_REPLACE
-
JSON_SET
-
REGEXP_CONTAINS
The "REGEXP_CONTAINS(value, regexp)" function. Returns TRUE if value is a partial match for the regular expression, regexp. -
REGEXP_EXTRACT
The "REGEXP_EXTRACT(value, regexp[, position[, occurrence]])" function. Returns the substring in value that matches the regexp. Returns NULL if there is no match. -
REGEXP_EXTRACT_ALL
The "REGEXP_EXTRACT_ALL(value, regexp)" function. Returns the substring in value that matches the regexp. Returns NULL if there is no match. -
REGEXP_INSTR
The "REGEXP_INSTR(value, regexp [, position[, occurrence, [occurrence_position]]])" function. Returns the lowest 1-based position of a regexp in value. Returns NULL if there is no match. -
REGEXP_REPLACE_2
The "REGEXP_REPLACE(value, regexp)" function. Replaces all substrings of value that match regexp withrep
and returns modified value. -
REGEXP_REPLACE_3
The "REGEXP_REPLACE(value, regexp, rep)" function. Replaces all substrings of value that match regexp withrep
and returns modified value. -
REGEXP_REPLACE_4
The "REGEXP_REPLACE(value, regexp, rep, pos)" function. Replaces all substrings of value that match regexp withrep
and returns modified value. Start searching value from character position pos. -
REGEXP_REPLACE_5
The "REGEXP_REPLACE(value, regexp, rep, pos, [ occurrence | matchType ])" function. Replaces all substrings of value that match regexp withrep
and returns modified value. Start searching value from character position pos. Replace only the occurrence match or all matches if occurrence is 0. matchType is a string of flags to apply to the search. -
REGEXP_REPLACE_5_ORACLE
The "REGEXP_REPLACE(value, regexp, rep, pos, matchType)" function. Replaces all substrings of value that match regexp withrep
and returns modified value. Start searching value from character position pos. Replace only the occurrence match or all matches if occurrence is 0. -
REGEXP_REPLACE_6
The "REGEXP_REPLACE(value, regexp, rep, pos, occurrence, matchType)" function. Replaces all substrings of value that match regexp withrep
and returns modified value. Start searching value from character position pos. Replace only the occurrence match or all matches if occurrence is 0. matchType is a string of flags to apply to the search. -
REGEXP_REPLACE_BIG_QUERY_3
The "REGEXP_REPLACE(value, regexp, rep)" function. Replaces all substrings of value that match regexp withrep
and returns modified value. -
REGEXP_REPLACE_PG_3
The "REGEXP_REPLACE(value, regexp, rep)" function. Replaces all substrings of value that match regexp withrep
and returns modified value. -
REGEXP_REPLACE_PG_4
The "REGEXP_REPLACE(value, regexp, rep, flags)" function. Replaces all substrings of value that match regexp withrep
and returns modified value. flags are applied to the search. -
REGEXP_SUBSTR
The "REGEXP_SUBSTR(value, regexp[, position[, occurrence]])" function. Returns the substring in value that matches the regexp. Returns NULL if there is no match. -
REGEXP
The "REGEXP(value, regexp)" function, equivalent toRLIKE
. -
REGEXP_LIKE
The "REGEXP_LIKE(value, regexp)" function, equivalent toRLIKE
. -
COMPRESS
-
URL_DECODE
The "URL_DECODE(string)" function. -
URL_ENCODE
The "URL_ENCODE(string)" function. -
EXTRACT_VALUE
-
XML_TRANSFORM
-
EXTRACT_XML
-
EXISTS_NODE
-
BOOL_AND
The "BOOL_AND(condition)" aggregate function, PostgreSQL and Redshift's equivalent toSqlStdOperatorTable.EVERY
. -
BOOL_OR
The "BOOL_OR(condition)" aggregate function, PostgreSQL and Redshift's equivalent toSqlStdOperatorTable.SOME
. -
BOOLAND_AGG
The "BOOLAND_AGG(condition)" aggregate function, Snowflake's equivalent toSqlStdOperatorTable.EVERY
. -
BOOLOR_AGG
The "BOOLOR_AGG(condition)" aggregate function, Snowflake's equivalent toSqlStdOperatorTable.SOME
. -
LOGICAL_AND
The "LOGICAL_AND(condition)" aggregate function, BigQuery's equivalent toSqlStdOperatorTable.EVERY
. -
LOGICAL_OR
The "LOGICAL_OR(condition)" aggregate function, BigQuery's equivalent toSqlStdOperatorTable.SOME
. -
COUNTIF
The "COUNTIF(condition) [OVER (...)]" function, in BigQuery, returns the count of TRUE values for expression.COUNTIF(b)
is equivalent toCOUNT(*) FILTER (WHERE b)
. -
ARRAY_AGG
The "ARRAY_AGG(value [ ORDER BY ...])" aggregate function, in BigQuery and PostgreSQL, gathers values into arrays. -
ARRAY_CONCAT_AGG
The "ARRAY_CONCAT_AGG(value [ ORDER BY ...])" aggregate function, in BigQuery and PostgreSQL, concatenates array values into arrays. -
STRING_AGG
The "STRING_AGG(value [, separator ] [ ORDER BY ...])" aggregate function, BigQuery and PostgreSQL's equivalent ofSqlStdOperatorTable.LISTAGG
.STRING_AGG(v, sep ORDER BY x, y)
is implemented by rewriting toLISTAGG(v, sep) WITHIN GROUP (ORDER BY x, y)
. -
GROUP_CONCAT
The "GROUP_CONCAT([DISTINCT] expr [, ...] [ORDER BY ...] [SEPARATOR sep])" aggregate function, MySQL's equivalent ofSqlStdOperatorTable.LISTAGG
.GROUP_CONCAT(v ORDER BY x, y SEPARATOR s)
is implemented by rewriting toLISTAGG(v, s) WITHIN GROUP (ORDER BY x, y)
. -
MAX_BY
The "MAX_BY(value, comp)" aggregate function, Spark's equivalent toSqlStdOperatorTable.ARG_MAX
. -
MIN_BY
The "MIN_BY(condition)" aggregate function, Spark's equivalent toSqlStdOperatorTable.ARG_MIN
. -
PERCENTILE_CONT2
ThePERCENTILE_CONT
function, BigQuery's equivalent toSqlStdOperatorTable.PERCENTILE_CONT
, but uses anOVER
clause rather thanWITHIN GROUP
. -
PERCENTILE_DISC2
ThePERCENTILE_DISC
function, BigQuery's equivalent toSqlStdOperatorTable.PERCENTILE_DISC
, but uses anOVER
clause rather thanWITHIN GROUP
. -
DATE
The "DATE" function. It has the following overloads:DATE(string)
is syntactic sugar forCAST(string AS DATE)
DATE(year, month, day)
DATE(timestampLtz [, timeZone])
DATE(timestamp)
-
DATETIME
The "DATETIME" function returns a CalciteTIMESTAMP
(which BigQuery calls aDATETIME
).It has the following overloads:
DATETIME(year, month, day, hour, minute, second)
DATETIME(date[, time])
DATETIME(timestampLtz[, timeZone])
-
TIME
The "TIME" function. It has the following overloads:TIME(hour, minute, second)
TIME(timestampLtz [, timeZone])
TIME(timestamp)
-
TIMESTAMP
The "TIMESTAMP" function returns a CalciteTIMESTAMP WITH LOCAL TIME ZONE
(which BigQuery calls aTIMESTAMP
). It has the following overloads:TIMESTAMP(string[, timeZone])
TIMESTAMP(date[, timeZone])
TIMESTAMP(timestamp[, timeZone])
-
CURRENT_DATETIME
The "CURRENT_DATETIME([timezone])" function. -
DATE_FROM_UNIX_DATE
The "DATE_FROM_UNIX_DATE(integer)" function; returns a DATE value a given number of seconds after 1970-01-01. -
UNIX_DATE
The "UNIX_DATE(date)" function; returns the number of days since 1970-01-01. -
CONTAINS_SUBSTR
"CONTAINS_SUBSTR(expression, string[, json_scope => json_scope_value ])" function; returns whether string exists as substring in expression, with optional json_scope argument. -
MONTHNAME
The "MONTHNAME(datetime)" function; returns the name of the month, in the current locale, of a TIMESTAMP or DATE argument. -
DAYNAME
The "DAYNAME(datetime)" function; returns the name of the day of the week, in the current locale, of a TIMESTAMP or DATE argument. -
LEFT
-
REPEAT
-
RIGHT
-
SPACE
-
STRCMP
-
SOUNDEX
-
SOUNDEX_SPARK
The variant of the SOUNDEX operator. -
DIFFERENCE
-
ILIKE
The case-insensitive variant of the LIKE operator. -
NOT_ILIKE
The case-insensitive variant of the NOT LIKE operator. -
RLIKE
The regex variant of the LIKE operator. -
NOT_RLIKE
The regex variant of the NOT LIKE operator. -
BIT_COUNT_BIG_QUERY
Alias forSqlStdOperatorTable.BITCOUNT
. -
BIT_COUNT_MYSQL
-
CONCAT_FUNCTION
The "CONCAT(arg, ...)" function that concatenates strings. For example, "CONCAT('a', 'bc', 'd')" returns "abcd".It accepts at least 1 argument and returns null if any of the arguments is null.
-
CONCAT_FUNCTION_WITH_NULL
The "CONCAT(arg, ...)" function that concatenates strings, which never returns null. For example, "CONCAT('a', 'bc', 'd')" returns "abcd".If one of the arguments is null, it will be treated as empty string. "CONCAT('a', null)" returns "a". "CONCAT('a', null, 'b')" returns "ab".
Returns empty string only when all arguments are null or the empty string. "CONCAT(null)" returns "". "CONCAT(null, '')" returns "". "CONCAT(null, null, null)" returns "".
It differs from
CONCAT_FUNCTION
when processing null values. -
CONCAT2
The "CONCAT(arg0, arg1)" function that concatenates strings. For example, "CONCAT('a', 'bc')" returns "abc".If one of the arguments is null, it will be treated as empty string. "CONCAT('a', null)" returns "a".
Returns null only when both arguments are null. "CONCAT(null, null)" returns null.
It is assigned
SqlKind.CONCAT2
to make it not equal toCONCAT_FUNCTION
. -
CONCAT_WS
The "CONCAT_WS(separator, arg1, ...)" function (MySQL); concatenates strings with separator, and treats null arguments as empty strings. For example:CONCAT_WS(',', 'a')
returns "a
";CONCAT_WS(',', 'a', 'b')
returns "a,b
".
Returns null if the separator arg is null. For example,
CONCAT_WS(null, 'a', 'b')
returns null.If all the arguments except the separator are null, it also returns the empty string. For example,
CONCAT_WS(',', null, null)
returns "". -
CONCAT_WS_POSTGRESQL
The "CONCAT_WS(separator, arg1, ...)" function (Postgres).Differs from
CONCAT_WS
(MySQL) in that its arg1 can be of any type, not limited to string. For example:CONCAT_WS(',', 'a')
returns "a
";CONCAT_WS(',', 'a', DATE '1945-02-24')
returns "a,1945-02-24
";CONCAT_WS(',', 'a', ARRAY['b', 'c'])
returns "a,[b, c]
".
-
CONCAT_WS_MSSQL
The "CONCAT_WS(separator, arg1, arg2, ...)" function in (MSSQL).Differs from
CONCAT_WS
(MySQL, Postgres) in that it accepts between 3 and 254 arguments, and never returns null (even if the separator is null). For example:CONCAT_WS(',', 'a', 'b')
returns "a,b
";CONCAT_WS(null, 'a', 'b')
returns "ab
";CONCAT_WS(',', null, null)
returns "";CONCAT_WS(null, null, null)
returns "".
-
CONCAT_WS_SPARK
The "CONCAT_WS(separator[, str | array(str)]+)" function in (SPARK).For example:
CONCAT_WS(',', 'a', 'b')
returns "a,b
";CONCAT_WS(null, 'a', 'b')
returns NULL";CONCAT_WS('s')
returns "";CONCAT_WS('/', 'a', null, 'b')
returns "a/b
";CONCAT_WS('/', array('a', 'b'))
returns "a/b
";CONCAT_WS('/', 'c', array('a', 'b'))
returns "c/a/b
".
-
ARRAY
The "ARRAY(exp, ...)" function (Spark); compare with the standard array value constructor, "ARRAY [exp, ...]". -
MAP
The "MAP(key, value, ...)" function (Spark); compare with the standard map value constructor, "MAP[key, value, ...]". -
ARRAY_APPEND
The "ARRAY_APPEND(array, element)" function. -
EXISTS
The "EXISTS(array, lambda)" function (Spark); returns whether a predicate holds for one or more elements in the array. -
ARRAY_COMPACT
The "ARRAY_COMPACT(array)" function. -
ARRAY_CONCAT
The "ARRAY_CONCAT(array [, array]*)" function. -
ARRAY_CONTAINS
The "ARRAY_CONTAINS(array, element)" function. -
ARRAY_DISTINCT
The "ARRAY_DISTINCT(array)" function. -
ARRAY_EXCEPT
The "ARRAY_EXCEPT(array1, array2)" function. -
ARRAY_INSERT
The "ARRAY_INSERT(array, pos, val)" function (Spark). -
ARRAY_INTERSECT
The "ARRAY_INTERSECT(array1, array2)" function. -
ARRAY_JOIN
The "ARRAY_JOIN(array, delimiter [, nullText ])" function. -
ARRAY_LENGTH
The "ARRAY_LENGTH(array)" function. -
ARRAY_MAX
The "ARRAY_MAX(array)" function. -
ARRAY_MIN
The "ARRAY_MAX(array)" function. -
ARRAY_POSITION
The "ARRAY_POSITION(array, element)" function. -
ARRAY_PREPEND
The "ARRAY_PREPEND(array, element)" function. -
ARRAY_REMOVE
The "ARRAY_REMOVE(array, element)" function. -
ARRAY_REPEAT
The "ARRAY_REPEAT(element, count)" function. -
ARRAY_REVERSE
The "ARRAY_REVERSE(array)" function. -
ARRAY_SIZE
The "ARRAY_SIZE(array)" function. -
ARRAY_UNION
The "ARRAY_UNION(array1, array2)" function. -
ARRAY_TO_STRING
The "ARRAY_TO_STRING(array, delimiter [, nullText ])" function. -
ARRAYS_OVERLAP
The "ARRAYS_OVERLAP(array1, array2)" function (Spark). -
ARRAYS_ZIP
The "ARRAYS_ZIP(array, ...)" function (Spark). -
SORT_ARRAY
The "SORT_ARRAY(array)" function (Spark). -
MAP_CONCAT
The "MAP_CONCAT(map [, map]*)" function. -
MAP_ENTRIES
The "MAP_ENTRIES(map)" function. -
MAP_KEYS
The "MAP_KEYS(map)" function. -
MAP_VALUES
The "MAP_VALUES(map)" function. -
MAP_CONTAINS_KEY
The "MAP_CONTAINS_KEY(map, key)" function. -
MAP_FROM_ARRAYS
The "MAP_FROM_ARRAYS(keysArray, valuesArray)" function. -
MAP_FROM_ENTRIES
The "MAP_FROM_ENTRIES(arrayOfEntries)" function. -
STR_TO_MAP
The "STR_TO_MAP(string[, stringDelimiter[, keyValueDelimiter]])" function. -
SUBSTRING_INDEX
The "SUBSTRING_INDEX(string, delimiter, count)" function. -
REVERSE
-
REVERSE_SPARK
The "REVERSE(string|array)" function. -
LEVENSHTEIN
The "LEVENSHTEIN(string1, string2)" function. -
FROM_BASE64
-
TO_BASE64
-
FROM_BASE32
-
TO_BASE32
-
FROM_HEX
The "FROM_HEX(varchar)" function; converts a hexadecimal-encodedvarchar
into bytes. -
TO_HEX
The "TO_HEX(binary)" function; convertsbinary
into a hexadecimal varchar. -
FORMAT_NUMBER
The "FORMAT_NUMBER(value, decimalOrFormat)" function. -
TO_CHAR
The "TO_CHAR(timestamp, format)" function; convertstimestamp
to string according to the givenformat
.(
TO_CHAR
is not supported in MySQL, but it is supported in MariaDB, a variant of MySQL covered bySqlLibrary.MYSQL
.) -
TO_CHAR_PG
The "TO_CHAR(timestamp, format)" function; convertstimestamp
to string according to the givenformat
. -
TO_DATE
The "TO_DATE(string1, string2)" function; casts string1 to a DATE using the format specified in string2. -
TO_DATE_PG
The "TO_DATE(string1, string2)" function for PostgreSQL; casts string1 to a DATE using the format specified in string2. -
TO_TIMESTAMP
The "TO_TIMESTAMP(string1, string2)" function; casts string1 to a TIMESTAMP using the format specified in string2. -
TO_TIMESTAMP_PG
The "TO_TIMESTAMP(string1, string2)" function for PostgreSQL; casts string1 to a TIMESTAMP using the format specified in string2. -
PARSE_TIME
The "PARSE_TIME(string, string)" function (BigQuery); converts a string representation of time to a TIME value. -
PARSE_DATE
The "PARSE_DATE(string, string)" function (BigQuery); Converts a string representation of date to a DATE object. -
PARSE_TIMESTAMP
The "PARSE_TIMESTAMP(string, string [, timezone])" function (BigQuery); Formats a timestamp object according to the specified string.In BigQuery, the "TIMESTAMP" datatype maps to Calcite's TIMESTAMP_WITH_LOCAL_TIME_ZONE
-
PARSE_DATETIME
The "PARSE_DATETIME(string, string [, timezone])" function (BigQuery); Formats a timestamp object according to the specified string.Note that the
TIMESTAMP
type of Calcite and Standard SQL is calledDATETIME
in BigQuery. -
FORMAT_TIME
The "FORMAT_TIME(string, time)" function (BigQuery); Formats a time object according to the specified string. -
FORMAT_DATE
The "FORMAT_DATE(string, date)" function (BigQuery); Formats a date object according to the specified string. -
FORMAT_TIMESTAMP
The "FORMAT_TIMESTAMP(string, timestamp)" function (BigQuery); Formats a timestamp object according to the specified string.In BigQuery, the "TIMESTAMP" datatype maps to Calcite's TIMESTAMP_WITH_LOCAL_TIME_ZONE
-
FORMAT_DATETIME
The "FORMAT_DATETIME(string, timestamp)" function (BigQuery); formats a timestamp object according to the specified string.Note that the
TIMESTAMP
type of Calcite and Standard SQL is calledDATETIME
in BigQuery. -
TIMESTAMP_ADD2
The "TIMESTAMP_ADD(timestamp, interval)" function (BigQuery), the two-argument variant of the built-inTIMESTAMPADD
function, which has three arguments.In BigQuery, the syntax is "TIMESTAMP_ADD(timestamp, INTERVAL int64_expression date_part)" but in Calcite the second argument can be any interval expression, not just an interval literal.
-
TIMESTAMP_DIFF3
The "TIMESTAMP_DIFF(timestamp, timestamp, timeUnit)" function (BigQuery); returns the number of timeUnit between the two timestamp expressions.TIMESTAMP_DIFF(t1, t2, unit)
is equivalent toTIMESTAMPDIFF(unit, t2, t1)
and(t1 - t2) unit
. -
TIME_ADD
The "TIME_ADD(time, interval)" function (BigQuery); adds interval expression to the specified time expression. -
TIME_DIFF
The "TIME_DIFF(time, time, timeUnit)" function (BigQuery); returns the number of timeUnit between the two time expressions. -
DATE_TRUNC
The "DATE_TRUNC(date, timeUnit)" function (BigQuery); truncates a DATE value to the beginning of a timeUnit. -
TIME_SUB
The "TIME_SUB(time, interval)" function (BigQuery); subtracts an interval from a time, independent of any time zone.In BigQuery, the syntax is "TIME_SUB(time, INTERVAL int64 date_part)" but in Calcite the second argument can be any interval expression, not just an interval literal.
-
TIME_TRUNC
The "TIME_TRUNC(time, timeUnit)" function (BigQuery); truncates a TIME value to the beginning of a timeUnit. -
TIMESTAMP_SUB
The "TIMESTAMP_SUB(timestamp, interval)" function (BigQuery); subtracts an interval from a timestamp, independent of any time zone.In BigQuery, the syntax is "TIMESTAMP_SUB(timestamp, INTERVAL int64 date_part)" but in Calcite the second argument can be any interval expression, not just an interval literal.
-
DATETIME_SUB
The "DATETIME_SUB(timestamp, interval)" function (BigQuery).Note that the
TIMESTAMP
type of Calcite and Standard SQL is calledDATETIME
in BigQuery.A synonym for
TIMESTAMP_SUB
, which supports bothTIMESTAMP
andTIMESTAMP WITH LOCAL TIME ZONE
operands. -
TIMESTAMP_TRUNC
The "TIMESTAMP_TRUNC(timestamp, timeUnit[, timeZone])" function (BigQuery); truncates aTIMESTAMP WITH LOCAL TIME ZONE
value to the beginning of a timeUnit.Note that the
TIMESTAMP WITH LOCAL TIME ZONE
type of Calcite is calledTIMESTAMP
in BigQuery. -
DATETIME_TRUNC
The "DATETIME_TRUNC(timestamp, timeUnit)" function (BigQuery); truncates a TIMESTAMP value to the beginning of a timeUnit.Note that the
TIMESTAMP
type of Calcite and Standard SQL is calledDATETIME
in BigQuery. -
TIMESTAMP_SECONDS
The "TIMESTAMP_SECONDS(bigint)" function; returns a TIMESTAMP value a given number of seconds after 1970-01-01 00:00:00. -
TIMESTAMP_MILLIS
The "TIMESTAMP_MILLIS(bigint)" function; returns a TIMESTAMP value a given number of milliseconds after 1970-01-01 00:00:00. -
TIMESTAMP_MICROS
The "TIMESTAMP_MICROS(bigint)" function; returns a TIMESTAMP value a given number of micro-seconds after 1970-01-01 00:00:00. -
UNIX_SECONDS
The "UNIX_SECONDS(bigint)" function; returns the number of seconds since 1970-01-01 00:00:00. -
UNIX_MILLIS
The "UNIX_MILLIS(bigint)" function; returns the number of milliseconds since 1970-01-01 00:00:00. -
UNIX_MICROS
The "UNIX_MICROS(bigint)" function; returns the number of microseconds since 1970-01-01 00:00:00. -
DATETIME_ADD
The "DATETIME_ADD(timestamp, interval)" function (BigQuery). AsTIMESTAMP_ADD
, returns a CalciteTIMESTAMP
(which BigQuery calls aDATETIME
). -
DATETIME_DIFF
The "DATETIME_DIFF(timestamp, timestamp2, timeUnit)" function (BigQuery).Note that the
TIMESTAMP
type of Calcite and Standard SQL is calledDATETIME
in BigQuery. -
SAFE_ADD
The "SAFE_ADD(numeric1, numeric2)" function; equivalent to the+
operator but returns null if overflow occurs. -
SAFE_DIVIDE
The "SAFE_DIVIDE(numeric1, numeric2)" function; equivalent to the/
operator but returns null if an error occurs, such as overflow or division by zero. -
SAFE_MULTIPLY
The "SAFE_MULTIPLY(numeric1, numeric2)" function; equivalent to the*
operator but returns null if overflow occurs. -
SAFE_NEGATE
The "SAFE_NEGATE(numeric)" function; negatesnumeric
and returns null if overflow occurs. -
SAFE_SUBTRACT
The "SAFE_SUBTRACT(numeric1, numeric2)" function; equivalent to the-
operator but returns null if overflow occurs. -
CHAR
The "CHAR(n)" function; returns the character whose ASCII code isn
% 256, or null ifn
< 0. -
CHR
The "CHR(n)" function; returns the character whose UTF-8 code isn
. -
CODE_POINTS_TO_BYTES
The "CODE_POINTS_TO_BYTES(integers)" function (BigQuery); Converts an array of extended ASCII code points to bytes. -
CODE_POINTS_TO_STRING
The "CODE_POINTS_TO_STRING(integers)" function (BigQuery); Converts an array of Unicode code points to string. -
TO_CODE_POINTS
The "TO_CODE_POINTS(string or binary)" function (BigQuery); Converts astring
orbinary
value to an array of integers that represent code points or extended ASCII character values. -
TANH
-
COTH
The "COTH(value)" function; returns the hyperbolic cotangent ofvalue
. -
COSH
-
ACOSH
TheACOSH(numeric)
function; returns the inverse hyperbolic cosine ofvalue
. -
ASINH
TheASINH(numeric)
function; returns the inverse hyperbolic sine ofvalue
. -
ATANH
TheATANH(numeric)
function; returns the inverse hyperbolic tangent ofvalue
. -
COSD
TheCOSD(numeric)
function; returns the cosine ofvalue
.value
is treated as degrees. -
SIND
TheSIND(numeric)
function; returns the sine ofvalue
.value
is treated as degrees. -
TAND
TheTAND(numeric)
function; returns the tangent ofvalue
.value
is treated as degrees. -
ACOSD
TheACOSD(numeric)
function; returns the inverse cosine ofvalue
in degrees. -
ASIND
TheACOSD(numeric)
function; returns the inverse sine ofvalue
in degrees. -
ATAND
TheACOSD(numeric)
function; returns the inverse tangent ofvalue
in degrees. -
SECH
The "COTH(value)" function; returns the hyperbolic secant ofvalue
. -
CSCH
The "COTH(value)" function; returns the hyperbolic cosecant ofvalue
. -
SINH
-
CSC
-
SEC
-
FACTORIAL
TheFACTORIAL(integer)
function. Returns the factorial of integer, the range of integer is [0, 20]. Otherwise, returns NULL. -
MD5
-
SHA1
-
SHA256
-
SHA512
-
IS_INF
The "IS_INF(value)" function. Returns whether value is infinite. -
IS_NAN
The "IS_NAN(value)" function. Returns whether value is NaN. -
LOG
The "LOG(value [, value2])" function. -
LOG_MYSQL
The "LOG(numeric1 [, numeric2 ]) " function. Returns the logarithm of numeric2 to base numeric1. -
LOG_POSTGRES
The "LOG(numeric1 [, numeric2 ]) " function. Returns the logarithm of numeric2 to base numeric1. -
LOG2
The "LOG2(numeric)" function. Returns the base 2 logarithm of numeric. -
LOG1P
The "LOG1p(numeric)" function. Returns log(1 + numeric). -
POW
-
POWER_PG
ThePOWER(numeric, numeric)
function.The return type is
DECIMAL
if either argument is aDECIMAL
. In all other cases, the return type is a double. -
TRUNC_BIG_QUERY
The "TRUNC(numeric1 [, integer2])" function. Identical to the standardTRUNCATE
function except the return type should be a double if numeric1 is an integer. -
INFIX_CAST
Infix "::" cast operator used by PostgreSQL, for example'100'::INTEGER
. -
SAFE_CAST
The "SAFE_CAST(expr AS type)" function; identical to CAST(), except that if conversion fails, it returns NULL instead of raising an error. -
TRY_CAST
The "TRY_CAST(expr AS type)" function, equivalent to SAFE_CAST. -
OFFSET
The "OFFSET(index)" array subscript operator used by BigQuery. The index starts at 0 and produces an error if the index is out of range. -
ORDINAL
The "ORDINAL(index)" array subscript operator used by BigQuery. The index starts at 1 and produces an error if the index is out of range. -
SAFE_OFFSET
The "SAFE_OFFSET(index)" array subscript operator used by BigQuery. The index starts at 0 and returns null if the index is out of range. -
SAFE_ORDINAL
The "SAFE_ORDINAL(index)" array subscript operator used by BigQuery. The index starts at 1 and returns null if the index is out of range. -
NULL_SAFE_EQUAL
NULL-safe "<=>" equal operator used by MySQL, for example1<=>NULL
. -
BITAND_AGG
The "BITAND_AGG(expression)" function. Equivalent to the standard "BIT_AND(expression)". -
BITOR_AGG
The "BITOR_AGG(expression)" function. Equivalent to the standard "BIT_OR(expression)". -
BIT_LENGTH
The "BIT_LENGTH(string or binary)" function. -
BIT_GET
The "BIT_GET(value, position)" function. -
GETBIT
Alias forBIT_GET
. -
RANDOM
The RANDOM() function. Equivalent to RAND().
-