mirror of https://github.com/apache/druid.git
SQL: Fix POWER doc, add test. (#4953)
This commit is contained in:
parent
5cfc7f9ef7
commit
f51f346e36
|
@ -108,7 +108,7 @@ Numeric functions will return 64 bit integers or 64 bit floats, depending on the
|
|||
|`FLOOR(expr)`|Floor.|
|
||||
|`LN(expr)`|Logarithm (base e).|
|
||||
|`LOG10(expr)`|Logarithm (base 10).|
|
||||
|`POW(expr, power)`|expr to a power.|
|
||||
|`POWER(expr, power)`|expr to a power.|
|
||||
|`SQRT(expr)`|Square root.|
|
||||
|`TRUNCATE(expr[, digits])`|Truncate expr to a specific number of decimal digits. If digits is negative, then this truncates that many places to the left of the decimal point. Digits defaults to zero if not specified.|
|
||||
|`TRUNC(expr[, digits])`|Synonym for `TRUNCATE`.|
|
||||
|
|
|
@ -201,6 +201,16 @@ public class ExpressionsTest
|
|||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPower()
|
||||
{
|
||||
testExpression(
|
||||
rexBuilder.makeCall(SqlStdOperatorTable.POWER, inputRef("a"), integerLiteral(2)),
|
||||
DruidExpression.fromExpression("pow(\"a\",2)"),
|
||||
100.0
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFloor()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue