ColumnStore User Defined Functions

You are viewing an old version of this article. View the current version here.

Introduction

MariaDB provides extensibility support through user defined functions. For more details on the MariaDB server framework see the [user-defined-functions] article.

MariaDB ColumnStore provides scale out query processing and as such requires a separate distributed implementation of each SQL function. This allows for the function application to happen on each PM server node providing distributed scale out performance.

Thus, to fully implement a user defined function for MariaDB ColumnStore requires implementing 2 different API's:

  • The MariaDB server UDF API: This allows utilization on all storage engines and is the implementation used if applied in the select list.
  • The ColumnStore distributed UDF API: This enables distributed execution of where clause and group by usage of the function and will be pushed down to PM nodes for execution where possible.

MariaDB ColumnStore supports user defined function implementations in C++. User defined aggregate and window functions are not supported in ColumnStore 1.0.

Development Environment

The development kit can be found under the [https://github.com/mariadb-corporation/mariadb-columnstore-engine/tree/master/utils/udfsdk | utils/udfsdk] directory of the mariadb-columnstore-engine source tree. To develop a user defined function requires you to set up a development environment and be comfortable with c++ development. To setup a ColumnStore development environment please follow the instructions on dependencies in the [https://github.com/mariadb-corporation/mariadb-columnstore-server | ColumnStore server fork] repository.

Three main files will need to be modified in order to add a new UDF:

  • udfmysql.cpp : mariadb server UDF implementation
  • udfsdk.h : class headers.
  • udfinfinidb.cpp : distributed columnstore UDF implementation.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.