Configure the use of UDFs
The process for configuring the use of UDFs is as follows:
1. Specify the languages (other than SQL) that UDFs are implemented in on the installation configuration parameter ii.hostname.config.udf_languages in config.dat. You can also use the cbf command to change this configuration parameter.
Valid values for udf_languages are:
none - No languages are available; UDFs cannot be created.
javascript - (Default) Only JavaScript UDFs are available.
python - Only Python UDFs are available.
javascript,python - Both JavaScript and Python UDFs are available.
For example:
iisetres ii.hostname.config.udf_languages javascript,python
Notes:
• If the udf_languages configuration changes after the initial configuration, UDFs dependent on using the initial language configuration will report an error when used in queries.
• If language support cannot be loaded for a specified language, then the database will not start and the createdb command will fail.
2. [Optional] If you plan to use Python UDFs non-containerized:
Linux:
a. Install Python 3.6.8 libraries using the Python 3.6.8 installer appropriate for your operating system and version.
Note: Do not change the default version of Python on your operating system. Install 3.6.8 in a separate area and set this library path for Vector.
b. Create a symbolic link in the /usr/lib directory of your installation, pointing libpython3.6m.so.rh-python36-1.0 to the Python 3.6.8 library to be used. For example:
ln -s /usr/lib64/libpython3.6m.so.1.0 /opt/Actian/VectorVW/ingres/lib
/libpython3.6m.so.rh-python36-1.0
c. Install Numpy. If you are using the default Python 3.6 for Vector, use the following command:
pip3 install numpy
Note: The Linux environment variable PYTHONHOME must either be empty or set to a valid path.
Windows:
d. Set the Vector environment variable UDF_PYTHONHOME to the path where Python is installed. For example:
ingsetenv UDF_PYTHONHOME C:\Python36
e. Set the Windows System environment variable PYTHONHOME in System Properties (select Control Panel, System, Advanced system settings, Environment variables, System variables) to the path where Python is installed. For example:
PYTHONHOME=C:\Python36
f. Install Numpy. If you are using the default Python 3.6 for Vector, use the following command:
pip3 install numpy
Last modified date: 12/06/2024