# US 12,118,038 B2 · Accessing data using a file reference-based user defined function

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

- Number: US 12,118,038 B2
- Document ID: US12118038B2
- Status: Granted
- Kind: B2
- Application number: 18/063,253
- Filed: 2022-12-08
- Published: 2023-03-30
- Granted: 2024-10-15
- Earliest claimed: 2020-06-30
- Assignees: Snowflake Inc.
- Applicants: Snowflake Inc.
- Inventors: Elliott Brossard; Sukruth Komarla Sukumar; Isaac Kunen; Ju-Yi Kuo; Jonathan Lee Leang; Edward Ma; Schuyler James Manchester; Polita Paulus; Saurin Shah; Igor Zinkovsky
- Web page: https://patentgrep.com/patent/US12118038B2

## CPC

- G06F 16/9017: {using directory or table look-up (use of a directory or look-up table in file systems G06F16/13)}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 16/24568: {Data stream processing; Continuous queries}
- G06F 16/908: using metadata automatically derived from the content
- G06F 16/955: using information identifiers, e.g. uniform resource locators [URL]
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method includes decoding, by at least one hardware processor, a request for a user-defined function (UDF). The request includes a reference to one or more files. The method further includes generating, by the at least one hardware processor, the UDF based on the request. The UDF includes a file reference object with file path information corresponding to the reference. The file path information identifies a file path to the one or more files. A UDF call into the UDF is detected. The UDF call specifies the file path information. The UDF call is processed to generate result data using the one or more files.

## Claims

### Claim 1

A method comprising:
decoding, by at least one hardware processor, a request for a user-defined function (UDF), the request including a reference to one or more files;
generating in a UDF execution environment, by the at least one hardware processor, the UDF based on the request, the UDF including a file reference object with file path information corresponding to the reference, and the file path information identifying a file path to the one or more files specified by the request;
detecting a UDF call into the UDF, the UDF call specifying the file path information of the file reference object; and
processing the UDF call in a sandbox process to access the one or more files via the file path and to generate result data using the one or more files.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
parsing the file reference object to determine a storage location storing the one or more files.

### Claim 3 (depends on 2)

The method of claim 2, further comprising:
retrieving the one or more files from the storage location using the file path;
applying a function associated with the UDF to the one or more files to generate the result data; and
storing the result data.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
configuring the file reference object to pass the file path to a class of the UDF.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
detecting the UDF call specifies the file path and includes a call to the class of the UDF; and
processing the UDF call using the class of the UDF, the processing including retrieving the one or more files from a storage location indicated by the file path.

### Claim 6 (depends on 5)

The method of claim 5, wherein the class of the UDF indicates a database type associated with the storage location, and the method further comprising:
processing the UDF call based on the database type associated with the storage location.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
detecting the UDF call at a function server of a network-based database system.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
transmitting the UDF call to a network node using a remote procedure call (RPC) channel, the network node being separate from the function server.

### Claim 9 (depends on 8)

The method of claim 8, further comprising:
processing the UDF in a runtime environment executing on the network node.

### Claim 10 (depends on 9)

The method of claim 9, further comprising:
executing the runtime environment within a sandbox process configured as a sub-process of the network node.

### Claim 11

A system comprising:
one or more processors of a machine; and
at least one memory storing instructions that, when executed by the one or more processors, cause the machine to perform operations comprising:
decoding a request for a user-defined function (UDF), the request including a reference to one or more files;
generating in a UDF execution environment, the UDF based on the request, the UDF including a file reference object with file path information corresponding to the reference, and the file path information identifying a file path to the one or more files specified by the request;
detecting a UDF call into the UDF, the UDF call specifying the file path information of the file reference object; and
processing the UDF call in a sandbox process to access the one or more files via the file path and to generate result data using the one or more files.

### Claim 12 (depends on 11)

The system of claim 11, the operations further comprising:
parsing the file reference object to determine a storage location storing the one or more files.

### Claim 13 (depends on 12)

The system of claim 12, further comprising:
retrieving the one or more files from the storage location using the file path;
applying a function associated with the UDF to the one or more files to generate the result data; and
storing the result data.

### Claim 14 (depends on 11)

The system of claim 11, the operations further comprising:
configuring the file reference object to pass the file path to a class of the UDF.

### Claim 15 (depends on 14)

The system of claim 14, the operations further comprising:
detecting the UDF call specifies the file path and includes a call to the class of the UDF; and
processing the UDF call using the class of the UDF, the processing including retrieving the one or more files from a storage location indicated by the file path.

### Claim 16 (depends on 15)

The system of claim 15, wherein the class of the UDF indicates a database type associated with the storage location, and the operations further comprising:
processing the UDF call based on the database type associated with the storage location.

### Claim 17 (depends on 11)

The system of claim 11, the operations further comprising:
detecting the UDF call at a function server of a network-based database system.

### Claim 18 (depends on 17)

The system of claim 17, the operations further comprising:
transmitting the UDF call to a network node using a remote procedure call (RPC) channel, the network node being separate from the function server.

### Claim 19 (depends on 18)

The system of claim 18, the operations further comprising:
processing the UDF in a runtime environment executing on the network node.

### Claim 20 (depends on 19)

The system of claim 19, the operations further comprising:
executing the runtime environment within a sandbox process configured as a sub-process of the network node.

### Claim 21

A machine storage medium embodying instructions that, when executed by a machine, cause the machine to perform operations comprising:
decoding a request for a user-defined function (UDF), the request including a reference to one or more files;
generating in a UDF execution environment, the UDF based on the request, the UDF including a file reference object with file path information corresponding to the reference, and the file path information identifying a file path to the one or more files specified by the request;
detecting a UDF call into the UDF, the UDF call specifying the file path information of the file reference object; and
processing the UDF call in a sandbox process to access the one or more files via the file path and to generate result data using the one or more files.

### Claim 22 (depends on 21)

The machine storage medium of claim 21, the operations further comprising:
parsing the file reference object to determine a storage location storing the one or more files.

### Claim 23 (depends on 22)

The machine storage medium of claim 22, further comprising:
retrieving the one or more files from the storage location using the file path;
applying a function associated with the UDF to the one or more files to generate the result data; and
storing the result data.

### Claim 24 (depends on 21)

The machine storage medium of claim 21, the operations further comprising:
configuring the file reference object to pass the file path to a class of the UDF.

### Claim 25 (depends on 24)

The machine storage medium of claim 24, the operations further comprising:
detecting the UDF call specifies the file path and includes a call to the class of the UDF; and
processing the UDF call using the class of the UDF, the processing including retrieving the one or more files from a storage location indicated by the file path.

### Claim 26 (depends on 25)

The machine storage medium of claim 25, wherein the class of the UDF indicates a database type associated with the storage location, and the operations further comprising:
processing the UDF call based on the database type associated with the storage location.

### Claim 27 (depends on 21)

The machine storage medium of claim 21, the operations further comprising:
detecting the UDF call at a function server of a network-based database system.

### Claim 28 (depends on 27)

The machine storage medium of claim 27, the operations further comprising:
transmitting the UDF call to a network node using a remote procedure call (RPC) channel, the network node being separate from the function server.

### Claim 29 (depends on 28)

The machine storage medium of claim 28, the operations further comprising:
processing the UDF in a runtime environment executing on the network node.

### Claim 30 (depends on 29)

The machine storage medium of claim 29, the operations further comprising:
executing the runtime environment within a sandbox process configured as a sub-process of the network node.
