Processing user-defined functions (UDFs) using multiple UDF clients
A method to process UDFs includes performing, by at least one hardware processor of a database system, a resolution of application components to determine a plurality of resolved components of an application and a plurality of data types corresponding to the plurality of resolved components. The method includes instantiating a plurality of UDF clients. The plurality of UDF clients are associated with the plurality of data types. The method includes detecting a received database query specifies a data type of the plurality of data types. The method includes executing the received database query at a UDF client of the plurality of UDF clients.
1 . A method comprising:
performing, by at least one hardware processor of a database system, a resolution of application components to determine a plurality of resolved components of an application and a plurality of data types corresponding to the plurality of resolved components;
instantiating a plurality of user-defined function (UDF) clients, the plurality of UDF clients associated with the plurality of data types;
processing a received database query with a mapping engine to detect that the received database query specifies a data type of the plurality of data types;
reformatting database data specified by the received database query using a data transport mechanism of a UDF client to generate reformatted data, the reformatted data comprising columnar data;
forwarding the columnar data to an execution environment corresponding to the UDF client; and
executing the received database query at the UDF client of the plurality of UDF clients.
2 . The method of claim 1 , further comprising:
determining a plurality of dependencies of the application to determine the plurality of resolved components.
3 . The method of claim 2 , further comprising:
determining one or more of at least one software package, a code version, and a code library associated with UDF code of the application to determine the plurality of dependencies.
4 . The method of claim 1 , further comprising:
instantiating a first execution process within a computing node of the database system.
5 . The method of claim 4 , further comprising:
configuring the plurality of UDF clients within the first execution process, the plurality of UDF clients corresponding to a plurality of execution environments.
6 . The method of claim 5 , further comprising:
selecting the UDF client of the plurality of UDF clients based on the data type of the received database query.
7 . The method of claim 6 , further comprising:
forwarding using the UDF client, the received query to an execution environment of the plurality of execution environments to generate results data, the execution environment corresponding to the UDF client.
8 . The method of claim 5 , further comprising:
instantiating a second execution process within the computing node; and
instantiating a user code runtime within the second execution process.
9 . The method of claim 8 , further comprising:
instantiating the plurality of execution environments corresponding to the plurality of resolved components as UDF server processes within the user code runtime; and
instantiating the second execution process as a sandbox process within the computing node.
10 . A system comprising:
at least one hardware processor; and
at least one memory storing instructions that cause the at least one hardware processor to perform operations comprising:
performing a resolution of application components to determine a plurality of resolved components of an application and a plurality of data types corresponding to the plurality of resolved components;
instantiating a plurality of user-defined function (UDF) clients, the plurality of UDF clients associated with the plurality of data types;
processing a received database query with a mapping engine to detect that the received database query specifies a data type of the plurality of data types;
reformatting database data specified by the received database query using a data transport mechanism of a UDF client to generate reformatted data, the reformatted data comprising columnar data;
forwarding the columnar data to an execution environment corresponding to the UDF client; and
executing the received database query at the UDF client of the plurality of UDF clients.
11 . The system of claim 10 , the operations further comprising:
determining a plurality of dependencies of the application to determine the plurality of resolved components.
12 . The system of claim 11 , the operations further comprising:
determining one or more of at least one software package, a code version, and a code library associated with UDF code of the application to determine the plurality of dependencies.
13 . The system of claim 10 , the operations further comprising:
instantiating a first execution process within a computing node of a database system.
14 . The system of claim 13 , the operations further comprising:
configuring the plurality of UDF clients within the first execution process, the plurality of UDF clients corresponding to a plurality of execution environments.
15 . The system of claim 14 , the operations further comprising:
selecting the UDF client of the plurality of UDF clients based on the data type of the received database query.
16 . The system of claim 15 , the operations further comprising:
forwarding using the UDF client, the received query to an execution environment of the plurality of execution environments to generate results data, the execution environment corresponding to the UDF client.
17 . The system of claim 14 , the operations further comprising:
instantiating a second execution process within the computing node; and
instantiating a user code runtime within the second execution process.
18 . The system of claim 17 , the operations further comprising:
instantiating the plurality of execution environments corresponding to the plurality of resolved components as UDF server processes within the user code runtime; and
instantiating the second execution process as a sandbox process within the computing node.
19 . A computer-storage medium comprising instructions that, when executed by one or more processors of a machine, configure the machine to perform operations comprising:
performing a resolution of application components to determine a plurality of resolved components of an application and a plurality of data types corresponding to the plurality of resolved components;
instantiating a plurality of user-defined function (UDF) clients, the plurality of UDF clients associated with the plurality of data types;
processing a received database query with a mapping engine to detect that the received database query specifies a data type of the plurality of data types;
reformatting database data specified by the received database query using a data transport mechanism of a UDF client to generate reformatted data, the reformatted data comprising columnar data;
forwarding the columnar data to an execution environment corresponding to the UDF client; and
executing the received database query at the UDF client of the plurality of UDF clients.
20 . The computer-storage medium of claim 19 , the operations further comprising:
determining a plurality of dependencies of the application to determine the plurality of resolved components.
21 . The computer-storage medium of claim 20 , the operations further comprising:
determining one or more of at least one software package, a code version, and a code library associated with UDF code of the application to determine the plurality of dependencies.
22 . The computer-storage medium of claim 19 , the operations further comprising:
instantiating a first execution process within a computing node of a database system.
23 . The computer-storage medium of claim 22 , the operations further comprising:
configuring the plurality of UDF clients within the first execution process, the plurality of UDF clients corresponding to a plurality of execution environments.
24 . The computer-storage medium of claim 23 , the operations further comprising:
selecting the UDF client of the plurality of UDF clients based on the data type of the received database query.
25 . The computer-storage medium of claim 24 , the operations further comprising:
forwarding using the UDF client, the received query to an execution environment of the plurality of execution environments to generate results data, the execution environment corresponding to the UDF client.
26 . The computer-storage medium of claim 23 , the operations further comprising:
instantiating a second execution process within the computing node; and
instantiating a user code runtime within the second execution process.
27 . The computer-storage medium of claim 26 , the operations further comprising:
instantiating the plurality of execution environments corresponding to the plurality of resolved components as UDF server processes within the user code runtime; and
instantiating the second execution process as a sandbox process within the computing node.