vertica/verticasdk
container to build user defined extensions (UDX)
1.1K
Important
Go to opentext/vertica-sdk for all
verticasdk
images. Thevertica/verticasdk
repository is not actively maintained.
The Vertica SDK container packages the binaries, libaries, and compilers required to create Vertica user-defined extensions (UDxs) with C++.
Vertica tags each image with the host operating system and the Vertica version. Each tag follows this format:
<host-os>-v<major>.<minor>.<patch>
For example, centos-v12.0.3
creates an image with a CentOS operating system and Vertica version 12.0, service pack 3.
For a comprehensive list, see Tags.
Vertica is a unified analytics platform, based on a massively scalable architecture with the broadest set of analytical functions spanning event and time series, pattern matching, geospatial and end-to-end in-database machine learning. Vertica enables you to easily apply these powerful functions to the largest and most demanding analytical workloads, arming you and your customers with predictive business insights faster than any analytics data warehouse in the market. Vertica provides a unified analytics platform across major public clouds and on-premises data centers and integrates data in cloud object storage and HDFS without forcing you to move any of your data.
This image is built using the open-source UDx-container. To simplify development, you might want to use the vsdk-*
scripts in the UDx-container repository with this image.
To build a UDx with this image, you have to compile the C++ file, build the image, and then test the image.
Compile the C++ file and run it with the Vertica SDK image by appending a g++
command to a docker run
command that maps the necessary users, groups, and working directory.
For example, if you compile a C++ file with this command:
$ g++ -O3 -D HAVE_LONG_INT_64 -Wall -std=c++11 -shared -Wno-unused-value -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC program.cpp
You can compile it within a running Vertica SDK container with the following docker run
command:
$ docker run --rm -u "$(id -u):$(id -g)" -w "$PWD" -v "$PWD:$PWD:rw" vertica/verticasdk:ubuntu-v11.1.1 g++ -O3 -D HAVE_LONG_INT_64 -Wall -std=c++11 -shared -Wno-unused-value -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC program.cpp
For a demonstration, review the Makefile in the vertica/dblink repository.
Create a local Makefile and build an image with your UDxs:
/tmp
directory:
$ cp -r /opt/vertica/sdk/examples /tmp
/examples
directory:
$ cd /tmp/examples
vsdk-make
file from the UDx-container repository:
$ curl https://raw.githubusercontent.com/vertica/vertica-containers/main/UDx-container/vsdk-exec > vsdk-make
$ chmod 755 vsdk-make
$ export VERTICA_VERSION=11.1.1$ export OSTAG=ubuntu
$ ./vsdk-make ScalarFunctions TransformFunctions AnalyticFunctions AggregateFunctions UserDefinedLoad
$ ls -l build/*.so
Run vertica
inside the Vertica SDK container to start the Vertica server. This is most easily done with a Docker compose file, such as this minimal example:
version: '2'
networks:
verticanet:
driver: bridge
services:
vertica:
image: vertica/verticasdk:ubuntu-v11.1.1
command: ["vertica"]
networks:
- verticanet
volumes:
- $PWD
expose:
- '5433'
- '5444'
You can see a demonstration of this in dblink's tests.
docker pull vertica/verticasdk