Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for scalar function LN(num) #3520

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Add support for scalar function LN(num) #3520

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2014-07-25 12:00:13 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: -- development

Last updated: 2019-04-30 12:36:02 +0200

Comment 19927

Date: 2014-07-25 12:00:13 +0200
From: Martin van Dinther <<martin.van.dinther>>

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0
Build Identifier:

For compatibility with other SQL DBMSes it would be nice to have support for function LN(num).

The LN function returns the natural logarithm of a number, which is the power to which you would need to raise the mathematical constant e (approximately 2.718281) in order to get the number in question as the result.

SQL2003 Syntax: LN( expression )

Reproducible: Always

Steps to Reproduce:

  1. start mserver5
  2. start mclient
  3. enter: select ln(20);

Actual Results:

sql>select ln(20);
SELECT: no such unary operator 'ln(tinyint)'

Expected Results:

sql>select ln(20);
+------------------+
| log_single_value |
+==================+
| 2.99573231 |
+------------------+

Currently MonetDB supports log(num) which returns the natural logarithm of a number. However in PostgreSQL log(num) is implemented to return base 10 logarithm. See http://www.postgresql.org/docs/9.3/static/functions-math.htmlFUNCTIONS-MATH-FUNC-TABLE

This will cause migration (PostgreSQL -> MonetDB) issues.
By adding support for LN(num) at least that scalar function will not have to be converted to MonetDB log() function.

Comment 26849

Date: 2019-01-24 16:25:57 +0100
From: MonetDB Mercurial Repository <>

Changeset 9cb052c21919 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=9cb052c21919

Changeset description:

Implemented function ln as alias for function log.
Fixes bug #3520.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant