Tamr Documentation

Functions

Tamr provides a number of functions for its data types.

Tamr provides a large number of functions and operators for its data types.

General Functions

NameSyntaxOutput
ABSabs(input)number
ADDadd(integer1, integer2)int
ARRAYarray(elements)array
ARRAY_CONCATarray_concat(array)string
ATOFatof(string_to_convert)double
ATOIatoi(string_to_convert)int
CEILceil(input)long
COALESCEcoalesce(a)any
CONCATconcat(a)string
DATEDIFFdatediff(endDate, startDate)long
DATETIME_ERRORdatetime_error(input)string
DATETIME_TO_ISOdatetime_to_iso(datetime_string, patterns)string
DATE_AND_TIME_TO_ISOdate_and_time_to_iso(date_string, time_string, patterns)string
DAYOFMONTHdayofmonth(datetime)int
DECIMALdecimal(input)double
DISTINCTdistinct(array)array
DURATION_TO_ISOduration_to_iso(duration, time_unit, minimal)string
EQUALS_IGNORE_CASEequals_ignore_case(str1, str2)bool
EXTRACTextract(input, regex, group_index)string
EXTRACT_ALLextract_all(input, regex)array
FLOORfloor(input)long
GETget(data, index)any
GREATESTgreatest(a)any
HASHhash(inputs)long
HEXhex(input)string
ENCODE_BASE64encode_base64(input)string
INTEGERinteger(input)int
ISNULLisnull(input)bool
ISO_DIFFERENCE_DAYSiso_difference_days(date1, date2)int
ISO_DATETIME_ADDiso_datetime_add(datetime, duration, time_unit)string
IS_NOT_NULLis_not_null(input)bool
IS_NOT_EMPTYis_not_empty(input)bool
JACCARD_INDEXjaccard_index(a, b)double
LEASTleast(a)any
LENlen(array)int
LENGTHlength(input)int
LOWERlower(input)string
MATCHESmatches(regex, input)bool
MD5md5(input)string
MONTHmonth(datetime)int
MONOTONICALLY_INCREASING_IDmonotonically_increasing_id()long
NUMnum(array)double
PARSE_JSON_ARRAYparse_json_array(json_array)array
PMODpmod(dividend, divisor)number
POWpow(base, exponent)double
SQRTsqrt(input)double
RANDrand()double
REPLACEreplace(string, target, replacement)string
REPLACE_ALLreplace_all(string, target_regex, replacement)string
RINTrint(input)double
ROUNDround(input)long
RUNTIME_DATEruntime_date()string
RUNTIME_DATETIMEruntime_datetime()string
SHA1sha1(input)string
SIZEsize(input)int
SORT_ARRAYsort_array(input)array
SPLITsplit(string, regex)array
STRIP_ACCENTSstrip_accents(string)string
STRstr(some_object)string
STR_FORMATstr_format(format_template, objects_to_insert)string
STR_JOINstr_join(delimiter, string_array)string
SUBSTRsubstr(string, start_index)string
SUBSTR2substr2(string, start_index, end_index)string
TAMR_IDtamr_id(source_id, entity_id)string
TO_BOOLEANto_boolean(input)bool
TO_BOOLEAN_ERRORto_boolean_error(input)string
TO_DOUBLEto_double(input)double
TO_DOUBLE_ERRORto_double_error(input)string
TO_INTto_int(value)int
TO_INT_ERRORto_int_error(input)string
TO_LONGto_long(value)long
TO_LONG_ERRORto_long_error(input)string
TO_STRINGto_string(value)string
TO_STRING_ERRORto_string_error(input)string
TRIMtrim(input)string
TYPEOFtypeof(object)string
UPPERupper(input)string
VALID_EMAILvalid_email(this_might_be_an_email)bool
YEARyear(datetime)int
INT.RANGEint.range(start, stop)array
LEGACY.HASHlegacy.hash(inputs)long

Array Functions

Array functions operate exclusively on arrays, allowing easy creation of and interaction with arrays.

NameSyntaxOutput
ARRAY.APPENDarray.append(array, value)array
ARRAY.CONCATarray.concat(arrays)array
ARRAY.DIFFarray.diff(array1, array2)array
ARRAY.CONTAINSarray.contains(array, item)bool
ARRAY.DISTINCTarray.distinct(array)array
ARRAY.MOST_FREQUENTarray.most_frequent(N, array)array
ARRAY.FIRSTarray.first(array)any
ARRAY.LASTarray.last(array)any
ARRAY.RESTarray.rest(array)array
ARRAY.REVERSEarray.reverse(array)array
ARRAY.SORTarray.sort(array)array
ARRAY.NULLSarray.nulls(array)array
ARRAY.NON_NULLSarray.non_nulls(array)array
ARRAY.NON_EMPTIESarray.non_empties(array)array
ARRAY.SLICEarray.slice(array, start_index)array
ARRAY.SLICE2array.slice2(array, start_index, end_index)array

Mathematical Functions

Mathematical trigonometric functions to calculate the sine, cosine and tangent of angles in radians.

NameSyntaxOutput
MATH.SINmath.sin(input)double
MATH.COSmath.cos(input)double
MATH.TANmath.tan(input)double
MATH.ASINmath.asin(input)double
MATH.ACOSmath.acos(input)double
MATH.ATANmath.atan(input)double
MATH.ATAN2math.atan2(y, x)double
MATH.DEGREESmath.degrees(input)double
MATH.RADIANSmath.radians(input)double
MATH.LNmath.ln(input)double
MATH.LOG10math.log10(input)double
MATH.LOGmath.log(input, base)double

GIS Functions

Geographic Information System (GIS) functions.

NameSyntaxOutput
GIS.POINTgis.point(lon, lat)record
GIS.MULTI_POINTgis.multi_point(multiPoint)record
GIS.LINE_STRINGgis.line_string(lineString)record
GIS.MULTI_LINE_STRINGgis.multi_line_string(multiLineString)record
GIS.POLYGONgis.polygon(polygon)record
GIS.MULTI_POLYGONgis.multi_polygon(polygon)record
GIS.AREAgis.area(geometry)double
GIS.CENTROIDgis.centroid(geo)record
GIS.GEOMETRY_ERRORgis.geometry_error(geo)string
GIS.PERIMETERgis.perimeter(geo)double
GIS.RELOCATE_TO_ORIGINgis.relocate_to_origin(geo)record

Aggregate Functions

🚧

Functions that only work with WINDOW

Please note that functions that are only supported for Window statements must be used in the select list. When used, the Window statement must include an Order By clause.

For more information on using aggregate functions, see aggregate expressions.

NameOutputKind
DENSE_RANKintWindow
LAGanyWindow
LEADanyWindow
RANKintWindow
ROW_NUMBERintWindow
LEGACY.TOParrayWindow, Group By
MINanyWindow, Group By
MIN_SIZEanyWindow, Group By
MAXanyWindow, Group By
MAX_SIZEanyWindow, Group By
COUNTlongWindow, Group By
COUNT_DISTINCTlongWindow, Group By
SUMnumberWindow, Group By
AVGdoubleWindow, Group By
MEANdoubleWindow, Group By
MODEanyWindow, Group By
FIRSTanyWindow, Group By
LASTanyWindow, Group By
TOParrayWindow, Group By
HISTOGRAMarrayWindow, Group By
COLLECT_LISTarrayWindow, Group By
COLLECT_SETarrayWindow, Group By
COLLECT_SUBSETarrayWindow, Group By
STDDEV_SAMPdoubleWindow, Group By
STDDEV_POPdoubleWindow, Group By
VAR_SAMPdoubleWindow, Group By
VAR_POPdoubleWindow, Group By

Map, Filter, and Reduce

Transformations support the higher order functions map, filter, and reduce. They allow you to apply a Tamr defined function across multi-value fields. Map applies the function to each element of an array field, filter filters elements of array fields, and reduce accumulates values. See here for more details.

🚧

Functions supported by Map, Filter, and Reduce

Currently, the only functions that can be used with map and filter are ones that take a single argument (e.g. upper(String)).

Updated about a month ago



Functions


Tamr provides a number of functions for its data types.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.