Built-in query language functions
Like constants and variables, there are many built-in functions that can be called from the query language with no additional imports or setup. In most cases, users will prefer these built-in functions over user-defined functions in query strings because:
- They are coded with an eye for performance and correctness.
- Ease of use - built-in functions don't require any additional coding.
Built-in functions
Built-in functions range from simple mathematical functions to date-time arithmetic, string manipulation, and more.
The following query calculates the absolute value of a column using the built-in abs function:
The following query parses a column of strings containing integers into Java primitive int values using parseInt:
The following query uses the built-in and function to evaluate whether or not three different columns are all true:
Built-in functions gracefully handle null values as input. For example, the following example calls the built-in sin function on a column that contains null values:
This page does not provide a comprehensive list of all built-ins. For the complete list of functions built into the query language, see Auto-imported functions.