Base User-Defined Functions for Database Query Engines
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Developing user-defined functions (UDFs) for database management systems can be cumbersome and hard to maintain, especially when wrapping multiple operators, as it is not scalable for large libraries of functions.
Innovation Solution
The base user-defined function (BUDF) approach encapsulates query engine interactions, providing a base class that can be specialized by developers to create reusable and scalable UDFs, simplifying the development process by hiding database read/write interfaces and allowing for automatic generation of function signatures.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If traditional UDF development approach is used to wrap multiple operators, then functionality can be extended, but development becomes cumbersome and hard to maintain
Solution Approach 1:
The patent segments the UDF development process by separating the base class (providing common functionality and query engine interactions) from specialized operations (specific analytics functions). This segmentation allows developers to extend functionality by implementing only the specific operation without dealing with the complex base infrastructure, thus reducing development complexity while maintaining versatility.
Solution Approach 2:
The base class acts as an intermediary between the query engine and specialized analytics operations. It provides a standardized interface and handles common operations, allowing specialized functions to be added without directly interacting with the complex query engine internals. This intermediary layer simplifies the development process while enabling extensive functionality extension.
2Adaptability or versatility
If multiple operators are wrapped individually into UDFs, then specific functions can be implemented, but scalability is poor for large libraries of functions
Solution Approach 1:
The base class is designed to be universal, providing common functionality that can be reused across multiple specialized operations. Instead of creating separate UDFs for each operator, a single base class implementation serves multiple specialized analytics functions, dramatically improving scalability while maintaining the ability to implement diverse functions.
Solution Approach 2:
The base class performs preliminary actions by pre-implementing common operations and query engine interactions that are needed by all specialized functions. This preliminary setup eliminates the need to repeat these operations for each new function, enabling rapid scaling of the function library without proportional increases in development effort.
3Manufacturing precision
If direct interfacing with DBMS APIs is required for each UDF, then precise control can be achieved, but the process becomes tedious and not maintainable
Solution Approach 1:
The base class serves as an intermediary that encapsulates direct DBMS API interactions. It provides a simplified interface that maintains precise control over query engine operations while shielding developers from the complexity of direct API interfacing. This allows precise control to be achieved through the standardized base class interface without the tedium of direct API calls.
Solution Approach 2:
The base class implements self-service by automatically handling common operations and query engine interactions that would otherwise require manual API interfacing. Developers can achieve precise control by simply implementing their specific operations, as the base class automatically manages the complex interfacing details, making the process maintainable and easier to develop.
Data Source
AI summary
Methods, devices, and techniques for base user defined functions in a database management system are discussed herein. For example, in one aspect, a query request is received from a computer device. The query request may include a query operator representing a specialized user defined function (SUDF). The SUDF may then be executed. Executing the SUDF may include executing a base operation of a base user defined function (BUDF). The base operation may interact with an application programming interface (API) of the query engine to obtain a tuple stored in the database. Executing the SUDF may further include executing a specialized operation that processes the tuple according to an analytics function. The specialized operation may generate a result. Then, a query result may be returned to the computer device. The query result can include the result.


