SIGN
This page describes the SIGN function in Lenses SQL.
SIGN(numExpr)
Returns +1 if a value is positive or -1 if a value is negative.
Available in:
Processors
SQL Studio
✓
✓
Sample code:
USE `kafka`;
SELECT
SIGN(integer) AS positive,
SIGN(NEG(integer)) AS negative
FROM numbers-data
LIMIT 1;
Output:
{
"value": {
"positive": 1,
"negative": -1
}
}
We use the NEG function to emulate a negative value in this function.
Last updated
Was this helpful?