|
| 1 | +--- |
| 2 | +title: Workers Analytics Engine now supports additional SQL functions |
| 3 | +description: Workers Analytics Engine now supports additional SQL functions including mathematical operations, advanced string manipulation, and improved documentation structure. |
| 4 | +date: 2025-09-26 |
| 5 | +products: |
| 6 | + - workers-analytics-engine |
| 7 | +--- |
| 8 | + |
| 9 | +We've expanded the SQL capabilities of Workers Analytics Engine with several new functions: |
| 10 | + |
| 11 | +**New window functions:** |
| 12 | +- `first_value()` - Returns the first value in an ordered set of values within a partition |
| 13 | +- `last_value()` - Returns the last value in an ordered set of values within a partition |
| 14 | + |
| 15 | +**New bit functions:** |
| 16 | +- `bitAnd()` - Returns the bitwise AND of two expressions |
| 17 | +- `bitCount()` - Returns the number of bits set to one in the binary representation of a number |
| 18 | +- `bitHammingDistance()` - Returns the number of bits that differ between two numbers |
| 19 | +- `bitNot()` - Returns a number with all bits flipped |
| 20 | +- `bitOr()` - Returns the inclusive bitwise OR of two expressions |
| 21 | +- `bitRotateLeft()` - Rotates all bits in a number left by specified positions |
| 22 | +- `bitRotateRight()` - Rotates all bits in a number right by specified positions |
| 23 | +- `bitShiftLeft()` - Shifts all bits in a number left by specified positions |
| 24 | +- `bitShiftRight()` - Shifts all bits in a number right by specified positions |
| 25 | +- `bitTest()` - Returns the value of a specific bit in a number |
| 26 | +- `bitXor()` - Returns the bitwise exclusive-or of two expressions |
| 27 | + |
| 28 | +**New mathematical functions:** |
| 29 | +- `abs()` - Returns the absolute value of a number |
| 30 | +- `log()` - Computes the natural logarithm of a number |
| 31 | +- `round()` - Rounds a number to a specified number of decimal places |
| 32 | +- `ceil()` - Rounds a number up to the nearest integer |
| 33 | +- `floor()` - Rounds a number down to the nearest integer |
| 34 | + |
| 35 | +**New string functions:** |
| 36 | +- `lowerUTF8()` - Converts a string to lowercase using UTF-8 encoding |
| 37 | +- `upperUTF8()` - Converts a string to uppercase using UTF-8 encoding |
| 38 | + |
| 39 | +**New encoding functions:** |
| 40 | +- `hex()` - Converts a number to its hexadecimal representation |
| 41 | +- `bin()` - Converts a string to its binary representation |
| 42 | + |
| 43 | +**New type conversion functions:** |
| 44 | +- `toUInt8()` - Converts any numeric expression, or expression resulting in a string representation of a decimal, into an unsigned 8 bit integer |
| 45 | + |
| 46 | +To get started, checkout out our docs to read more on newly added and existing [Workers Analytics Engine SQL functions](/analytics/analytics-engine/sql-reference/). |
0 commit comments