Transparent User-Defined Function (UDF) Optimization
AssigneeTeradata US, Inc.
InventorsHeng Yuan, Judy Wu, Yu Long, Congnan Luo
Life of this patent
Estimating the term…
Abstract
A User-Defined Function (UDF) provided by a user and accessed through a user query is identified. A wrapper for the UDF is generated. The wrapper represents a customized instance of the UDF. The wrapper, during execution, selectively calls the UDF provided by the user. Any query that references the UDF is rewritten to process the wrapper instead of the UDF.
Claims20
A method, comprising:
- identifying a source code for a User-Defined Function (UDF) being created by a user in a Data Definition Language (DDL) statement;
- generating a new source code for the UDF;
- creating a wrapper source code representing an instance of the new source code that selectively calls the UDF;
- and
- processing an executable version of the instance when the UDF is called in a query.
The method of claim 8, wherein processing further includes rewriting the query to call the instance instead of the UDF.
The method of claim 9, wherein rewriting further includes replacing a GROUP BY clause in the query with a PARTITION BY clause.
A method, comprising:
- transparently generating a wrapper representing an instance of a User-Defined Function (UDF) in response to the User-Defined Function (UDF) being registered;
- registering the instance as a replacement for the UDF;
- and
- calling the instance when a query references the UDF.
A system, comprising:
- a data warehouse including:
- a query parser;
- and
- a User-Defined Function (UDF) Wrapper;
- wherein the query parser is configured to i) execute on a hardware processor of a network computing device, ii) generate the UDF wrapper as an equivalent instance of a UDF in response to the UDF registered by a user with the data warehouse, and iii) provide instructions that processes the equivalent instance in place of the UDF when the UDF is called within a query.
Dependencies are inferred from the claim text.