Functions¶
Provides utility and SQL functions that generate Column
expressions that you can pass to DataFrame
transformation methods.
These utility functions generate references to columns, literals, and SQL expressions (e.g. “c + 1”).
Use
col()
to convert a column name to aColumn
object. Refer to the API docs ofColumn
to know more ways of referencing a column.Use
lit()
to convert a Python value to aColumn
object that represents a constant value in Snowflake SQL.Use
sql_expr()
to convert a Snowflake SQL expression to aColumn
.>>> df = session.create_dataframe([[1, 'a', True, '2022-03-16'], [3, 'b', False, '2023-04-17']], schema=["a", "b", "c", "d"]) >>> res1 = df.filter(col("a") == 1).collect() >>> res2 = df.filter(lit(1) == col("a")).collect() >>> res3 = df.filter(sql_expr("a = 1")).collect() >>> assert res1 == res2 == res3 >>> res1 [Row(A=1, B='a', C=True, D='2022-03-16')]
Some DataFrame
methods accept column names or SQL expressions text aside from a Column object for convenience.
For instance:
>>> df.filter("a = 1").collect() # use the SQL expression directly in filter
[Row(A=1, B='a', C=True, D='2022-03-16')]
>>> df.select("a").collect()
[Row(A=1), Row(A=3)]
whereas Column
objects enable you to use chained column operators and transformations with
Python code fluently:
>>> # Use columns and literals in expressions.
>>> df.select(((col("a") + 1).cast("string")).alias("add_one")).show()
-------------
|"ADD_ONE" |
-------------
|2 |
|4 |
-------------
The Snowflake database has hundreds of SQL functions
This module provides Python functions that correspond to the Snowflake SQL functions. They typically accept Column
objects or column names as input parameters and return a new Column
objects.
The following examples demonstrate the use of some of these functions:
>>> # This example calls the function that corresponds to the TO_DATE() SQL function.
>>> df.select(dateadd('day', lit(1), to_date(col("d")))).show()
---------------------------------------
|"DATEADD('DAY', 1, TO_DATE(""D""))" |
---------------------------------------
|2022-03-17 |
|2023-04-18 |
---------------------------------------
If you want to use a SQL function in Snowflake but can’t find the corresponding Python function here,
you can create your own Python function with function()
:
>>> my_radians = function("radians") # "radians" is the SQL function name.
>>> df.select(my_radians(col("a")).alias("my_radians")).show()
------------------------
|"MY_RADIANS" |
------------------------
|0.017453292519943295 |
|0.05235987755982988 |
------------------------
or call the SQL function directly:
>>> df.select(call_function("radians", col("a")).as_("call_function_radians")).show()
---------------------------
|"CALL_FUNCTION_RADIANS" |
---------------------------
|0.017453292519943295 |
|0.05235987755982988 |
---------------------------
Similarly, to call a table function, you can use table_function()
, or call_table_function()
.
How to find help on input parameters of the Python functions for SQL functions The Python functions have the same name as the corresponding SQL functions.
By reading the API docs or the source code of a Python function defined in this module, you’ll see the type hints of the input parameters and return type.
The return type is always Column
. The input types tell you the acceptable values:
ColumnOrName
accepts aColumn
object, or a column name in str. Most functions accept this type. If you still want to pass a literal to it, use lit(value), which returns aColumn
object that represents a literal value.>>> df.select(avg("a")).show() ---------------- |"AVG(""A"")" | ---------------- |2.000000 | ---------------- >>> df.select(avg(col("a"))).show() ---------------- |"AVG(""A"")" | ---------------- |2.000000 | ----------------
LiteralType
accepts a value of typebool
,int
,float
,str
,bytearray
,decimal.Decimal
,datetime.date
,datetime.datetime
,datetime.time
, orbytes
. An example is the third parameter oflead()
.>>> import datetime >>> from snowflake.snowpark.window import Window >>> df.select(col("d"), lead("d", 1, datetime.date(2024, 5, 18), False).over(Window.order_by("d")).alias("lead_day")).show() --------------------------- |"D" |"LEAD_DAY" | --------------------------- |2022-03-16 |2023-04-17 | |2023-04-17 |2024-05-18 | ---------------------------
ColumnOrLiteral
accepts aColumn
object, or a value ofLiteralType
mentioned above. The difference fromColumnOrLiteral
isColumnOrLiteral
regards a str value as a SQL string value instead of a column name. When a function is much more likely to accept a SQL constant value than a column expression,ColumnOrLiteral
is used. Yet you can still pass in aColumn
object if you need to. An example is the second parameter of :func:when
.>>> df.select(when(df["a"] > 2, "Greater than 2").else_("Less than 2").alias("compare_with_2")).show() -------------------- |"COMPARE_WITH_2" | -------------------- |Less than 2 | |Greater than 2 | --------------------
int
,bool
,str
, or another specific type accepts a value of that type. An example isto_decimal()
.>>> df.with_column("e", lit("1.2")).select(to_decimal("e", 5, 2)).show() ----------------------------- |"TO_DECIMAL(""E"", 5, 2)" | ----------------------------- |1.20 | |1.20 | -----------------------------
ColumnOrSqlExpr
accepts aColumn
object, or a SQL expression. For instance, the first parameter in :func:when
.>>> df.select(when("a > 2", "Greater than 2").else_("Less than 2").alias("compare_with_2")).show() -------------------- |"COMPARE_WITH_2" | -------------------- |Less than 2 | |Greater than 2 | --------------------
Functions
|
Returns the absolute value of a numeric expression. |
|
Computes the inverse cosine (arc cosine) of its input; the result is a number in the interval [-pi, pi]. |
|
Adds or subtracts a specified number of months to a date or timestamp, preserving the end-of-month information. |
|
Returns a non-deterministic any value for the specified column. |
Uses HyperLogLog to return an approximation of the distinct cardinality of the input (i.e. |
|
|
Returns an approximated value for the desired percentile. |
Returns the internal representation of the t-Digest state (as a JSON object) at the end of aggregation. |
|
|
Combines (merges) percentile input states into a single output state. |
|
Returns the desired approximated percentile value for the specified t-Digest state. |
|
Returns the input values, pivoted into an ARRAY. |
|
Returns an ARRAY containing all elements from the source ARRAY as well as the new element. |
|
Returns the concatenation of two ARRAYs. |
|
Returns a compacted ARRAY with missing and null values removed, effectively converting sparse arrays into dense arrays. |
|
Returns an ARRAY constructed from zero, one, or more inputs. |
|
Returns an ARRAY constructed from zero, one, or more inputs. |
|
Returns True if the specified VARIANT is found in the specified ARRAY. |
|
The function excludes any duplicate elements that are present in the input ARRAY. |
|
Returns a single array from an array or arrays. |
|
Generate a range of integers from start to stop, incrementing by step. |
|
Returns an ARRAY containing all elements from the source ARRAY as well as the new element. |
|
Returns an array that contains the matching elements in the two input arrays. |
|
Returns largest defined non-NULL element in the input array. |
|
Returns smallest defined non-NULL element in the input array. |
|
Returns the index of the first occurrence of an element in an ARRAY. |
|
Returns an ARRAY containing the new element as well as all elements from the source ARRAY. |
|
Given a source ARRAY, returns an ARRAY with elements of the specified value removed. |
|
Returns the size of the input ARRAY. |
|
Returns an ARRAY constructed from a specified subset of elements of the input ARRAY. |
|
Returns rows of array column in sorted order. |
|
Returns an input ARRAY converted to a string by casting all values to strings (using TO_VARCHAR) and concatenating them (using the string from the second argument to separate the elements). |
|
Returns a Column containing the distinct values in the specified column col. |
|
Compares whether two ARRAYs have at least one element in common. |
|
Casts a VARIANT value to an array. |
|
Casts a VARIANT value to a binary string. |
|
Casts a VARIANT value to a string. |
|
Casts a VARIANT value to a date. |
|
Casts a VARIANT value to a fixed-point decimal (does not match floating-point values). |
|
Casts a VARIANT value to a floating-point value. |
|
Casts a VARIANT value to an integer. |
|
Casts a VARIANT value to a fixed-point decimal (does not match floating-point values). |
|
Casts a VARIANT value to an object. |
|
Casts a VARIANT value to a floating-point value. |
|
Casts a VARIANT value to a time value. |
|
Casts a VARIANT value to a TIMESTAMP with a local timezone. |
|
Casts a VARIANT value to a TIMESTAMP with no timezone. |
|
Casts a VARIANT value to a TIMESTAMP with a timezone. |
|
Casts a VARIANT value to a string. |
|
Returns a Column expression with values sorted in ascending order. |
Returns a Column expression with values sorted in ascending order (null values sorted before non-null values). |
|
Returns a Column expression with values sorted in ascending order (null values sorted after non-null values). |
|
|
Returns the ASCII code for the first character of a string. |
|
Computes the inverse sine (arc sine) of its input; the result is a number in the interval [-pi, pi]. |
|
Computes the inverse tangent (arc tangent) of its input; the result is a number in the interval [-pi, pi]. |
|
Computes the inverse tangent (arc tangent) of its input; the result is a number in the interval [-pi, pi]. |
|
Returns the average of non-NULL records. |
|
Returns the bitwise negation of a numeric expression. |
|
Returns the bitwise negation of a numeric expression. |
|
Returns the bitwise negation of a numeric expression. |
|
Function object to invoke a Snowflake system-defined function (built-in function). |
|
Rounds the number using HALF_TO_EVEN option. |
|
Invokes a Snowflake system-defined function (built-in function) with the specified name and arguments. |
|
Invokes a Snowflake system-defined function (built-in function) with the specified name and arguments. |
|
Invokes a Snowflake table function, including system-defined table functions and user-defined table functions. |
|
Calls a user-defined function (UDF) by name. |
|
Converts a value of one data type into another data type. |
|
Returns values from the specified column rounded to the nearest equal or larger integer. |
|
Converts a Unicode code point (including 7-bit ASCII) into the character that matches the input Unicode. |
|
Searches for |
|
Checks the validity of a JSON document. |
|
Checks the validity of an XML document. |
|
Returns the first non-NULL expression among its arguments, or NULL if all its arguments are NULL. |
|
|
|
Returns a copy of the original |
|
Returns the collation specification of expr. |
|
Returns the input values, pivoted into an ARRAY. |
|
Returns a Column containing the distinct values in the specified column col. |
|
|
|
Concatenates one or more strings, or concatenates one or more binary values. |
|
Concatenates two or more strings, or concatenates two or more binary values. |
|
Returns if col contains string for each row. |
|
Converts the given source_time to the target timezone. |
|
Returns the correlation coefficient for non-null pairs in a group. |
|
Computes the cosine of its argument; the argument should be expressed in radians. |
|
Computes the hyperbolic cosine of its argument. |
|
Returns either the number of non-NULL records for the specified columns, or the total number of records. |
|
Returns either the number of non-NULL distinct records for the specified columns, or the total number of the distinct records. |
|
Returns either the number of non-NULL distinct records for the specified columns, or the total number of the distinct records. |
|
Returns the population covariance for non-null pairs in a group. |
|
Returns the sample covariance for non-null pairs in a group. |
|
Transforms multiple column pairs into a single map |
Finds the cumulative distribution of a value with regard to other values within the same window partition. |
|
Returns the name of the account used in the current session. |
|
Returns a JSON string that lists all roles granted to the current user. |
|
Returns the name of the database in use for the current session. |
|
Returns the current date for the system. |
|
Returns the name of the region for the account where the current user is logged in. |
|
Returns the name of the role in use for the current session. |
|
Returns the name of the schema in use for the current session. |
|
Returns active search path schemas. |
|
Returns a unique system identifier for the Snowflake session corresponding to the present connection. |
|
Returns the SQL text of the statement that is currently executing. |
|
Returns the current time for the system. |
|
Returns the current timestamp for the system. |
|
Returns the name of the user currently logged into the system. |
|
Returns the current Snowflake version. |
|
Returns the name of the warehouse in use for the current session. |
|
|
Converts an input expression into the corresponding date in the specified date format. |
|
Creates a date from individual numeric components that represent the year, month, and day of the month. |
|
Extracts the specified date or time part from a date, time, or timestamp. |
|
Truncates a DATE, TIME, or TIMESTAMP to the specified precision. |
|
Adds the specified value for the specified date or time part to date or time expr. |
|
Calculates the difference between two date, time, or timestamp columns based on the date or time part requested, and returns result of |
|
Adds a number of days to a date column. |
|
Subtracts a number of days from a date column. |
|
Calculates the difference between two dates, or timestamp columns based in days. |
|
Extracts the three-letter day-of-week name from the specified date or timestamp. |
|
Extracts the corresponding day (number) of the month from a date or timestamp. |
|
Extracts the corresponding day (number) of the week from a date or timestamp. |
|
Extracts the corresponding day (number) of the year from a date or timestamp. |
|
Converts radians to degrees. |
Returns the rank of a value within a group of values, without gaps in the ranks. |
|
|
Returns a Column expression with values sorted in descending order. |
Returns a Column expression with values sorted in descending order (null values sorted before non-null values). |
|
Returns a Column expression with values sorted in descending order (null values sorted after non-null values). |
|
|
Performs division like the division operator (/), but returns 0 when the divisor is 0 (rather than reporting an error). |
|
Returns true if col ends with str. |
|
Return true if the value in the column is not a number (NaN). |
|
Computes Euler's number e raised to a floating-point value. |
|
Flattens a given array or map type column into individual rows. |
|
Flattens a given array or map type column into individual rows. |
|
Creates a |
|
Computes the factorial of its input. |
|
Returns the first value within an ordered group of values. |
|
FLATTEN explodes compound values into multiple rows. |
|
Returns values from the specified column rounded to the nearest equal or smaller integer. |
|
Converts an input expression into the corresponding timestamp. |
|
Interprets an input expression as a UTC timestamp and converts it to the given time zone. |
|
Function object to invoke a Snowflake system-defined function (built-in function). |
|
Extracts a value from an object or array; returns NULL if either of the arguments is NULL. |
|
Extracts a field value from an object. |
|
Extracts a value from semi-structured data using a path name. |
|
Returns the largest value from a list of expressions. |
|
Describes which of a list of expressions are grouped in a row produced by a GROUP BY query. |
|
Describes which of a list of expressions are grouped in a row produced by a GROUP BY query. |
|
Returns a signed 64-bit hash value. |
|
Extracts the hour from a date or timestamp. |
|
Returns one of two specified expressions, depending on a condition. |
|
Returns a conditional expression that you can pass to the filter or where methods to perform the equivalent of a WHERE . |
|
Returns the input string with the first letter of each word in uppercase and the subsequent letters in lowercase. |
|
Replaces a substring of the specified length, starting at the specified position, with a new string or binary value. |
|
Returns true if the specified VARIANT column contains an ARRAY value. |
|
Returns true if the specified VARIANT column contains a binary value. |
|
Returns true if the specified VARIANT column contains a boolean value. |
|
Returns true if the specified VARIANT column contains a string. |
|
Returns true if the specified VARIANT column contains a date value. |
|
Returns true if the specified VARIANT column contains a date value. |
|
Returns true if the specified VARIANT column contains a fixed-point decimal value or integer. |
|
Returns true if the specified VARIANT column contains a floating-point value, fixed-point decimal, or integer. |
|
Returns true if the specified VARIANT column contains a integer value. |
|
Return true if the value in the column is null. |
|
Returns true if the specified VARIANT column contains a JSON null value. |
|
Returns true if the specified VARIANT column contains an OBJECT value. |
|
Returns true if the specified VARIANT column contains a floating-point value, fixed-point decimal, or integer. |
|
Returns true if the specified VARIANT column contains a TIME value. |
|
Returns true if the specified VARIANT column contains a TIMESTAMP_LTZ value to be interpreted using the local time zone. |
|
Returns true if the specified VARIANT column contains a TIMESTAMP_NTZ value with no time zone. |
|
Returns true if the specified VARIANT column contains a TIMESTAMP_TZ value with a time zone. |
|
Returns true if the specified VARIANT column contains a string. |
|
Parses a JSON string and returns the value of an element at a specified path in the resulting JSON document. |
|
Returns the population excess kurtosis of non-NULL records. |
|
Accesses data in a previous row in the same result set without having to join the table to itself. |
|
Returns the last day of the specified date part for a date or timestamp. |
|
Returns the last value within an ordered group of values. |
|
Accesses data in a subsequent row in the same result set without having to join the table to itself. |
|
Returns the smallest value from a list of expressions. |
|
Returns a left most substring of |
|
Returns the length of an input string or binary value. |
|
Returns the concatenated input values, separated by delimiter string. |
|
Creates a |
|
Returns the natrual logarithm of given column expression. |
|
Searches for the first occurrence of the first argument in the second argument. |
|
Returns the logarithm of a numeric expression. |
|
Returns the input string with all characters converted to lowercase. |
|
Left-pads a string with characters from another string, or left-pads a binary value with bytes from another binary value. |
|
Removes leading characters, including whitespace, from a string. |
|
Creates an interval column with the specified years, quarters, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, and nanoseconds. |
|
Returns the maximum value for the records in a group. |
|
Returns a 32-character hex-encoded string containing the 128-bit MD5 message digest. |
|
Return the average for the specific numeric columns. |
|
Returns the median value for the records in a group. |
|
Returns the minimum value for the records in a group. |
|
Extracts the minute from a date or timestamp. |
|
Returns the most frequent value for the records in a group. |
|
Returns a sequence of monotonically increasing integers, with wrap-around which happens after largest representable integer of integer width 8 byte. |
|
Extracts the month from a date or timestamp. |
|
Extracts the three-letter month name from the specified date or timestamp. |
|
Returns the number of months between two DATE or TIMESTAMP values. |
|
Returns the negation of the value in the column (equivalent to a unary minus). |
|
Returns the date of the first specified DOW (day of week) that occurs after the input date. |
|
Returns the inverse of a boolean expression. |
|
Divides an ordered data set equally into the number of buckets specified by n. |
|
Returns one OBJECT per group. |
|
Returns an OBJECT constructed from the arguments. |
|
Returns an object containing the contents of the input (i.e. |
|
Returns an object consisting of the input object with one or more keys removed. |
|
Returns an object consisting of the input object with a new key-value pair inserted (or an existing key updated with a new value). |
|
Returns an array containing the list of keys in the input object. |
|
Returns a new OBJECT containing some of the key-value pairs from an existing object. |
|
Registers a Python function as a vectorized UDF and returns the UDF. |
|
Registers a Python class as a vectorized Python UDTF and returns the UDTF. |
|
Parse the value of the specified column as a JSON string and returns the resulting JSON document. |
|
Parse the value of the specified column as a JSON string and returns the resulting XML document. |
Returns the relative rank of a value within a group of values, specified as a percentage ranging from 0.0 to 1.0. |
|
|
Return a percentile value based on a continuous distribution of the input column. |
|
Returns a number (left) raised to the specified power (right). |
|
Returns the date of the first specified DOW (day of week) that occurs before the input date. |
|
Extracts the quarter from a date or timestamp. |
|
Converts degrees to radians. |
|
Each call returns a pseudo-random 64-bit integer. |
|
Returns the rank of a value within an ordered group of values. |
|
Returns the number of times that a pattern occurs in the subject. |
|
Extract a specific group matched by a regex, from the specified string column. |
|
Returns the subject with the specified pattern (or all occurrences of the pattern) either removed or replaced by a replacement string. |
|
Builds a string by repeating the input for the specified number of times. |
|
Removes all occurrences of a specified subject and optionally replaces them with replacement. |
|
Returns a right most substring of |
|
Returns rounded values from the specified column. |
Returns a unique row number for each row within a window partition. |
|
|
Right-pads a string with characters from another string, or right-pads a binary value with bytes from another binary value. |
|
Removes trailing characters, including whitespace, from a string. |
|
Extracts the second from a date or timestamp. |
|
Returns a sequence of monotonically increasing integers, with wrap-around which happens after largest representable integer of integer width 1 byte. |
|
Returns a sequence of monotonically increasing integers, with wrap-around which happens after largest representable integer of integer width 2 byte. |
|
Returns a sequence of monotonically increasing integers, with wrap-around which happens after largest representable integer of integer width 4 byte. |
|
Returns a sequence of monotonically increasing integers, with wrap-around which happens after largest representable integer of integer width 8 byte. |
|
Generate a sequence of integers from start to stop, incrementing by step. |
|
Returns a 40-character hex-encoded string containing the 160-bit SHA-1 message digest. |
|
Returns a hex-encoded string containing the N-bit SHA-2 message digest, where N is the specified output digest size. |
|
Computes the sine of its argument; the argument should be expressed in radians. |
|
Computes the hyperbolic sine of its argument. |
|
Returns the size of the input ARRAY, OBJECT or MAP. |
|
Returns the sample skewness of non-NULL records. |
Summarizes the given English-language input text. |
|
|
Returns rows of array column in sorted order. |
|
Returns a string that contains a phonetic representation of the input string. |
|
Splits a given string with a given separator and returns the result in an array of strings. |
|
Registers a Python function as a Snowflake Python stored procedure and returns the stored procedure. |
|
Creates a |
|
Returns the square-root of a non-negative numeric expression. |
|
Returns true if col starts with str. |
|
Returns the sample standard deviation (square root of sample variance) of non-NULL values. |
|
Returns the population standard deviation (square root of variance) of non-NULL values. |
|
Returns the sample standard deviation (square root of sample variance) of non-NULL values. |
|
Converts a JSON "null" value in the specified column to a SQL NULL value. |
|
Tokenizes the given string using the given set of delimiters and returns the tokens as an array. |
|
Returns an OBJECT constructed with the given columns. |
|
Returns the portion of the string or binary value str, starting from the character/byte specified by pos, with limited length. |
|
Returns the portion of the string or binary value str, starting from the character/byte specified by pos, with limited length. |
|
Returns the sum of non-NULL records in a group. |
|
Returns the sum of non-NULL distinct records in a group. |
|
Returns the current timestamp for the system, but in the UTC time zone. |
|
Returns a reference to an object (a table, view, or function). |
|
Create a function object to invoke a Snowflake table function. |
|
Computes the tangent of its argument; the argument should be expressed in radians. |
|
Computes the hyperbolic tangent of its argument. |
|
Creates a time from individual numeric components. |
Creates a timestamp from individual numeric components. |
|
|
Creates a timestamp from individual numeric components. |
Creates a timestamp from individual numeric components. |
|
|
Creates a timestamp from individual numeric components and a string timezone. |
|
Converts any value to an ARRAY value or NULL (if input is NULL). |
|
Converts the input expression to a binary value. |
|
Converts a Unicode code point (including 7-bit ASCII) into the character that matches the input Unicode. |
|
Converts an input expression into a date. |
|
Converts an input expression to a decimal. |
|
Converts an input expression to a decimal. |
|
Parses an input and returns a value of type GEOGRAPHY. |
|
Parses an input and returns a value of type GEOMETRY. |
|
Converts any VARIANT value to a string containing the JSON representation of the value. |
|
Converts any value to a OBJECT value or NULL (if input is NULL). |
|
Converts an input expression into the corresponding time. |
|
Converts an input expression into the corresponding timestamp. |
|
Interprets an input expression as a timestamp and converts from given time zone to UTC. |
|
Converts a Unicode code point (including 7-bit ASCII) into the character that matches the input Unicode. |
|
Converts any value to a VARIANT value or NULL (if input is NULL). |
|
Converts any VARIANT value to a string containing the XML representation of the value. |
|
Translates src from the characters in source_alphabet to the characters in target_alphabet. |
|
Removes leading and trailing characters from a string. |
|
Rounds the input expression down to the nearest (or equal) integer closer to zero, or to the nearest equal or smaller value with the specified number of places after the decimal point. |
|
A special version of CAST for a subset of data type conversions. |
|
Reports the type of a value stored in a VARIANT column. |
|
Registers a Python class as a Snowflake Python UDAF and returns the UDAF. |
|
Registers a Python function as a Snowflake Python UDF and returns the UDF. |
|
Registers a Python class as a Snowflake Python UDTF and returns the UDTF. |
|
Returns a uniformly random number. |
|
Converts a timestamp or a timestamp string to Unix time stamp (in seconds). |
|
Returns the input string with all characters converted to uppercase. |
|
Returns the population variance of non-NULL records in a group. |
|
Returns the sample variance of non-NULL records in a group. |
|
Returns the sample variance of non-NULL records in a group. |
|
Returns the inner product between two vectors of equal dimension and element type. |
|
Returns the l2 distance between two vectors of equal dimension and element type. |
|
Extracts the corresponding week (number) of the year from a date or timestamp. |
|
Works like a cascading if-then-else statement. |
|
Specifies a matched clause for the |
|
Specifies a not-matched clause for the |
|
Converts a time column into a window object with start and end times. |
|
Extracts an XML element object (often referred to as simply a tag) from a content of outer XML element object by the name of the tag and its instance number (counting from 0). |
|
Extracts the year from a date or timestamp. |