Skip to main content
Question

Function APPROXIMATE_MEDIAN(int) does not exist, or permission is denied for APPROXIMATE_MEDIAN(int)

  • October 27, 2020
  • 2 replies
  • 11 views

Pieter_Sheth-Vo
Forum|alt.badge.img+2

According to the docs, APPROXIMATE_MEDIAN and APPROXIMATE_PERCENTILE were added in Vertica 8.1. However, in Vertica 9.3, this yields the error
ERROR 3457: Function APPROXIMATE_MEDIAN(int) does not exist, or permission is denied for APPROXIMATE_MEDIAN(int)

It fails for integers and floats, both as a regular db user as well as when signed in as dbadmin. Does this method need to be compiled or added before it can be used?

2 replies

Pieter_Sheth-Vo
Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • October 27, 2020

I found this script in the directory, and running the following command as dbadmin successfully installed it.

\i /opt/vertica/packages/approximate/ddl/install.sql

Out of curiosity, where might I find the documentation for these? I didn't see a link from the main page https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Functions/Aggregate/APPROXIMATE_PERCENTILE.htm


Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • October 28, 2020

You can also use admintools to reinstall the any package:

Example:

[dbadmin@localhost ~]$ admintools -t list_packages
             Package Description
                 AWS Amazon Web Services Package
        ComplexTypes Functions for Complex Types
     MachineLearning In-dataBase Machine Learning package.
       ParquetExport Functions that support Parquet Export
      SparkConnector Spark connector for reading from and writing into Vertica
       TFIntegration Using Tensorflow models in Vertica
          VFunctions Vertica functions
         approximate Probabilistic/Approximate Aggregation Functions
           flextable Flexible Tables Data Load and Query
                hcat Java/HCatalog data load and query
               kafka Kafka streaming load and export
           logsearch Common Advanced text search functions
               place Geospatial Data Query
            txtindex Common string-manipulation functions
       voltagesecure Voltage SecureData functions

[dbadmin@localhost ~]$ admintools -t install_package -d verticademos -P approximate --force-reinstall
Installing package approximate...
...Success!

Documenation:
https://www.vertica.com/docs/latest/HTML/Content/Authoring/InstallationGuide/Upgrade/PostUpgrade/UpgradingandReinstallingPackages.htm