# US 2013/0254238 A1 · Techniques for processing relational data with a user-defined function (udf)

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2013/0254238 A1
- Document ID: US20130254238A1
- Status: Published application
- Kind: A1
- Application number: 13/430,034
- Filed: 2012-03-26
- Published: 2013-09-26
- Earliest claimed: 2012-03-26
- Assignees: Teradata US, Inc.
- Inventors: Lihua Yan; Zhenrong Li; Ejaz Haider
- Web page: https://patentgrep.com/patent/US20130254238A1

## CPC

- G06F 16/90: Details of database functions independent of the retrieved data types
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques for processing relational data with a user-defined function (UDF) are provided. Relational input data being requested by the UDF, from within a relational database system, is intercepted and normalized. The UDF is called with the normalized input data and as the UDF produces output data in response to the normalized input data that output data is captured and normalized. In an embodiment, the normalized output data is used to dynamically update a data model within the relational database for the input data.

## Claims

### Claim 1

A method implemented and programmed within a non-transitory computer-readable storage medium and processed by one or more processors, the processors configured to execute the method, comprising:
acquiring a data model for input data to a user-defined function (UDF), the input data housed in a relational database;
normalizing the input data;
initiating the UDF to perform custom-user defined calculations using the normalized data;
mapping output data produced from the UDF into a normalized output format; and
updating the data model based on the mapped output data in the normalized output format.

### Claim 2 (depends on 1)

The method of claim 1, wherein acquiring further includes deriving the data model from analysis of the input data.

### Claim 3 (depends on 2)

The method of claim 2, wherein deriving further includes identifying processing characteristics associated with the input data for use with parallel processing by the UDF.

### Claim 4 (depends on 1)

The method of claim 1, wherein normalizing further includes mapping the input data using the data model into an input data array for usage by the UDF.

### Claim 5 (depends on 1)

The method of claim 1, wherein normalizing further includes mapping the input data into a database table for use by the UDF.

### Claim 6 (depends on 1)

The method of claim 1, wherein mapping further includes translating the output data as it is produced by the UDF into the normalized output format.

### Claim 7 (depends on 1)

The method of claim 1, wherein mapping further includes populating the output data into a database table of the relational database.

### Claim 8 (depends on 1)

The method of claim 1, wherein updating further includes augmenting the data model with additional data definitions and/or modified data definitions based on normalized output format.

### Claim 9

A method implemented and programmed within a non-transitory computer-readable storage medium and processed by one or more processors, the processors configured to execute the method, comprising:
converting input data acquired from a relational database into a normalized data format;
passing the normalized input data to a user-customized user-defined function (UDF) for processing;
capturing output data produced by the user-customized UDF; and
translating the output data into the normalized data format for updating the relational database.

### Claim 10 (depends on 9)

The method of claim 9 further comprising, processing a debugging tool debug the method.

### Claim 11 (depends on 9)

The method of claim 9, wherein converting further includes calling a pre-processing UDF that intercepts a call being made to the user-customized UDF within the relational database to convert the input data into the normalized data format.

### Claim 12 (depends on 9)

The method of claim 9, wherein converting further includes translating the input data into a normalized input data array with different dimensions from the input data.

### Claim 13 (depends on 12)

The method of claim 12, wherein translating the input data further includes using a data model acquired from the relational database to produce the normalized input data array.

### Claim 14 (depends on 12)

The method of claim 12, wherein translating the input data further includes deriving a data model based on attributes acquired for the input data from the relational database.

### Claim 15 (depends on 9)

The method of claim 9, wherein passing further includes configuring the user-customized UDF with processing characteristics defined for the normalized input data to facilitate parallel processing throughput by the user-customized UDF.

### Claim 16 (depends on 9)

The method of claim 9, wherein passing further includes interfacing a memory management UDF and a process management UDF to the user-customized UDF to manage memory usage and processor usage of the user-customized UDF while the user-customized UDF processes the normalized input data.

### Claim 17 (depends on 9)

The method of claim 9, wherein capturing further includes intercepting the output data as it is produced by the user-customized UDF and calling a post-processing UDF.

### Claim 18 (depends on 17)

The method of claim 17, wherein translating further includes using the post-processing UDF to dynamically render the normalized output data.

### Claim 19

A system, comprising:
one or more processors of a parallel database management system (DBMS) configured with a pre-process user-defined function (UDF) and a post-process UDF, the pre-process UDF and the post-process UDF implemented, programmed, and resides within a non-transitory computer-readable storage medium that execute on the one or more processors;
wherein the pre-process UDF is configured to intercept calls made to a user-customized UDF to normalize input data being acquired by the user-customized UDF from the DBMS and configured to provide the normalized input data to the user-customized UDF for processing within the DBMS, the post-process UDF configured to intercept output data produced by the user-customized UDF and translate the output data to normalized output data.

### Claim 20 (depends on 19)

The system of claim 19 further comprising, a data model feedback module implemented, programmed, and residing within a non-transitory computer-readable storage medium and for execution on the one or more processors, the data model feedback module configured to dynamically update a data model that defines the input data based on the normalized output data.
