calcite icon indicating copy to clipboard operation
calcite copied to clipboard

[CALCITE-6313] Add POWER function for PostgreSQL

Open normanj-bitquill opened this issue 1 year ago • 3 comments

  • The existing power function is moved to all non PostgreSQL libraries
  • The new power function is only for PostgreSQL
  • The new function returns a decimal if any argument is a decimal

normanj-bitquill avatar Apr 16 '24 18:04 normanj-bitquill

In order to separate the POWER function for PostgreSQL and non-PostgreSQL dialects, the POWER function was moved to the SqlLibraryOperators class. This downgrades the POWER function from a standard function to a function from a library. This is problematic for things like SQRT which is a standard function and gets rewritten to a POWER expression.

Is there a more clean way to separate the POWER function so that the PostgreSQL implementation is able to return Decimal values in some cases?

normanj-bitquill avatar Apr 16 '24 18:04 normanj-bitquill

In general, until the changes are approved I would recommend adding new commits instead of force-pushing. It makes it easier for reviewers to see what's new. Then you can squash when the PR is approved.

mihaibudiu avatar Apr 24 '24 18:04 mihaibudiu