heavyai / heavydb

HeavyDB (formerly OmniSciDB)
https://heavy.ai
Apache License 2.0
2.94k stars 446 forks source link

SQL function LOG(number, base) is not implemented #474

Open gshimansky opened 4 years ago

gshimansky commented 4 years ago

The following code results in exception:

CREATE TABLE table1 (
double_col DOUBLE,
smallint_col SMALLINT);
SELECT LOG("double_col", 2) AS tmp FROM table1;

Exception: Exception occurred: org.apache.calcite.runtime.CalciteContextException: From line 1, column 8 to line 1, column 29: No match found for function signature Log(<NUMERIC>, <NUMERIC>)

Ibis test test_complex_math_functions_columns fails because of this.

cdessanti commented 4 years ago

the query can be rewritten with ln(2)/ln("double_col").

adding an extension function to add this functions is an easy task

gshimansky commented 4 years ago

Thanks for letting me know. In this case it is necessary to change Ibis to generate such code for the corresponding operation.

alexbaden commented 4 years ago

We should support this too.

cdessanti commented 4 years ago

We should support this too.

it's trivial to support btw