Search code examples
monetdb

Neither of the statistical functions appear to work in MonetDB


When I attempt to run following query on a double column:

SELECT stddev_samp(col1) FROM t1

I get:

Error: SELECT: no such unary operator 'stddev_samp(double)'
SQLState:  22000
ErrorCode: 0

If I run it against an int column, I get:

Error: SELECT: no such unary operator 'stddev_samp(int)'
SQLState:  22000
ErrorCode: 0

And I am getting the same type of error when I attempt to execute any of the stat_func mentioned at: https://www.monetdb.org/Documentation/SQLreference/StatisticFunctions

It looks like if I didn't install support for statistic functions because otherwise MonetDB works well. Is there a procedure how to add statistic functions?

Background knowledge:

  1. Version: MonetDB Database Server Toolkit v1.1 (Oct2014-SP2)

  2. OS: OS X 10.9.5

  3. The database was installed from archive: MonetDB-11.19.9-x86_64-Darwin-9-bin.tar.bz2


Solution

  • This is what worked for me:

    Option 1) try using

    SYS.STDDEV_SAMPLE ()
    SYS.MEDIAN ()
    

    etc... instead of "plain"

    STDDEV_SAMPLE ()
    MEDIAN ()
    

    Option 2) (not recommended):

    Work with the user named monetdb.