1. 算术函数
| — | – | ||
|---|---|---|---|
| 求和 plus | 求差值 minus | 求积 multiply | 求商 divide |
| 求余数 modulo | 取反 negate | 绝对值 abs | 最大公约数 gcd |
| 最小公倍数 lcm |
2. 比较函数
| — | – | ||
|---|---|---|---|
| 相等 equals | 不等 notEquals | 大于 greater | 大于等于 greaterOrEquals |
| 小于 less | 小于等于 lessOrEquals |
3. 取整函数
| — | — | — | — |
|---|---|---|---|
| 向下取整:floor | 向上取整:ceil | 四舍五入:round | 向下舍入到2^x:roundToExp2 |
4. 逻辑函数
| — | — | — | — |
|---|---|---|---|
| 与 and | 或 or | 非 not | 异或 xor |
5. Hash函数
| — | — | — | — |
|---|---|---|---|
| MD5 | halfMD5 | intHash | sha |
| farmHash | javaHash | hiveHash |
6. 类型转换函数
| — | — | — |
|---|---|---|
| 转换为数值 | 转换为字符串 | 转换为值类型 |
7 条件函数
| – | – |
|---|---|
| 三元运算符 if | 多个条件判断 multiIf |
8. UUID函数
| — | — |
|---|---|
| 生成UUID:generateUUIDv4 | String 转 UUID:toUUID |
| FixedString转换成 UUID:UUIDNumToString | 将 UUID 转换成FixedString:UUIDStringToNum |
9. URL函数
| — | — |
|---|---|
| protocol(截取传输协议) | domain (获取域名) |
| domainWithoutWWW (返回域名并删除首个3w) | topLevelDomain(获取顶级域名) |
| firstSignificantSubdomain(第一个有效子域名) | path(返回URL路径) |
| pathFull(返回URL路径包括参数) | queryString(请求参数) |
| fragment (fragment标识) | queryStringAndFragment(请求参数和fragment标识) |
| cutWWW(删除 3w) | cutQueryString(删除请求参数) |
| cutFragment (删除fragment标识) | cutQueryStringAndFragment(删除请求参数以及fragment标识) |
| cutURLParameter(删除URL参数) |
10. 字典函数
| — | — |
|---|---|
| dictGet | dictGetTOrDefault |
| dictGetXX (获取指定类型数据) | dictHas |
11. 字符串函数
| — | — | — |
|---|---|---|
| 长度计算 length | isValidUTF8 检测 UTF8 编码 | 检查字符串是否为有效的UTF-8编码 |
| 为空判断 empty | 非空判断 notEmpty | 字符反转 reverse |
| 转大写 upper | 转小写 lower | 字符串定义 format |
| 字符串拼接 concat | 字符串拼接 concatAssumeInjective | 字符串拼接 appendTrailingCharIfAbsent |
| 数组合并成字符串 arrayStringConcat | 字符串截取 substring | 字符串截取 mid |
| 字符串截取 substr | 正则获取字符串 extract | 正则获取字符串 extractAll |
| 字符串编码转换 convertCharset | 字符串转base64 base64Encode | base64转字符串 base64Decode |
| base64转字符串 tryBase64Decode | 判断指定字符开头 startsWith | 判断指定字符结尾 endsWith |
| 删除左侧空字符 trimLeft | 删除右侧空字符 trimRight | 删除两侧空字符 trimRight |
| 字符串拆分 splitByChar | 字符串拆分 splitByString | 拆分连续字符 alphaTokens |
| 字符串替换 replace | 字符串替换 replaceAll | 字符串替换 replaceOne |
| 正则替换 replaceRegexpOne | 正则替换 replaceRegexpAll | 搜索字符串出现位置 pasition |
| 搜索字符串出现位置 positionUTF8 | 字符串出现位置 positionCaseInsensitive | 定位 locate |
| 模糊匹配 like | 模糊匹配 not like |
12. 时间日期函数
| — | — | — | — |
|---|---|---|---|
| toUnixTimestamp | now | toDate | today |
| toTime | toYear | toMonth | toQuarter |
| toHour | toMinute | toSecond | toDayOfYear |
| toDayOfMonth | toDayOfWeek | toDateTime | toStartOfYear |
| toStartOfMonth | toStartOfQuarter | toStartOfDay | toStartOfHour |
| toStartOfMinute | toRelativeYearNum | toRelativeQuarterNum | toISOYear |
| toISOWeek | yesterday | toYYYYMMDDhhmmss | toYYYYMMDD |
| toYYYYMM | formatDateTime | addYears/Months… | subtractYears/Months… |
| dateDiff | timeSlot |
13. 数组函数
| — | — | — | — |
|---|---|---|---|
| empty | notEmpty | length | emptyArray* |
| has | range | arrayElement | emptyArrayToSingle |
| array | arrayConcat | hasAny | arrayEnumerateUniq |
| indexOf | countEqual | hasAll | arrayEnumerate |
| arrayPop | arrayPush | arrayResize | arraySlice |
| arraySort | arrayReverse | arrayUniq | arrayEnumerateDense |
| sumArray | uniqArray | arrayDistinct | arrayDifference |
| arrayJoin | arrayIntersect | arrayReduce | arrayFilter |
| arrayCompact | arrayStringConcat | runningDifference | arrayWithConstant |
| neighbor |