Add hyperbolic functions: sinh, cosh, tanh.#118
Conversation
Signed-off-by: elias <eliaskamadis@gmail.com>
sfc-gh-okalaci
left a comment
There was a problem hiding this comment.
Thanks for the PR and sorry for the late review!
I don't think we should re-write the functions, they have the exact equivalents in DuckDB, so we should let it pushdown as is. Re-writing is required when there is no 1-1 mapping between the functions in DuckDB and Postgres. It seems all 3 functions have equivalents in DuckDB, and they produce the same results for all the inputs.
So, basically we don't need to create functions in duckdb_pglake, such as SinhPG or function in Postgres like __lake__internal__nsp__.sinh_pg.
Extending the pg_lake_engine/src/pgduck/shippable_builtin_functions.c and adding the test should be sufficient.
nd they produce the same results for all the inputs.
Though, please make sure the functions produce the same results for all possible input values (e.g., negative values, values between -1 and 1, etc), as our experience show that sometimes there are some minor behavioral differences between Postgres and DuckDB in such functions. If that's the case, it requires some more detailed investigation on how to map the functions.
|
yeh, seems like the DuckDB docs are stale and these functions are actually supported. D select sinh(3);
┌────────────────────┐
│ sinh(3) │
│ double │
├────────────────────┤
│ 10.017874927409903 │
└────────────────────┘ |
Add Hyperbolic Functions: sinh, cosh, tanh
Description
This PR adds support for the following hyperbolic functions:
The following changes are included: