# US 2026/0064667 A1 · Execution environment agnostic federated queries

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

- Number: US 2026/0064667 A1
- Document ID: US20260064667A1
- Status: Published application
- Kind: A1
- Application number: 18/820,991
- Filed: 2024-08-30
- Published: 2026-03-05
- Earliest claimed: 2024-08-30
- Assignees: Capital One Services, LLC
- Applicants: Capital One Services, LLC
- Inventors: Brian YUHAS
- Web page: https://patentgrep.com/patent/US20260064667A1

## CPC

- G06F 16/242: Query formulation
- G06F 16/2471: {Distributed queries}
- G06F 16/256: {in federated or virtual databases}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In some implementations, a device may obtain a federated query for a set of data associated with multiple data sources. The device may generate, based on the federated query, an abstract syntax tree indicating relationships between statements included in the federated query. The device may identify, based on the abstract syntax tree, one or more homogeneous statements in the federated query. The device may register, in a local database, one or more functions for respective homogeneous statements of the one or more homogeneous statements, wherein each function, of the one or more functions, includes execution code associated with multiple execution environments. The device may execute, via an execution environment based on the federated query, a local query for the local database using the one or more functions. The local query calls a subset of execution code, from the execution code, that is associated with an execution environment.

## Claims

### Claim 1

A system for execution environment agnostic federated queries, the system comprising:
one or more memories; and
one or more processors, communicatively coupled to the one or more memories, configured to:
obtain configuration information which includes configurations for multiple execution environments,
wherein the configuration information indicates sets of execution code association with the multiple execution environments;
obtain a federated structured query language (SQL) query requesting a set of data from multiple data sources;
parse, based on the configuration information, the federated SQL query to generate an abstract syntax tree indicating relationships between SQL statements included in the federated SQL query;
identify, based on the abstract syntax tree, one or more homogeneous SQL statements in the federated SQL query, wherein the one or more homogeneous SQL statements request one or more subsets of data, of the set of data, from respective data sources of the multiple data sources;
generate, based on executing the one or more homogeneous SQL statements, one or more functions for respective homogeneous SQL statements of the one or more homogeneous SQL statements,
wherein each function, of the one or more functions, enables the one or more subsets of data to be accessible via a virtual table in a local database, and
wherein each function includes the sets of execution code associated with the multiple execution environments;
generate, based on the federated SQL query, a local query to the local database using the one or more functions, wherein the local query accesses a subset of execution code, from the sets of execution code associated with the multiple execution environments, that is associated with an execution environment;
register, in the local database, the one or more functions; and
execute, via the execution environment, the local query to obtain the set of data while the one or more functions are capable of being executed via the multiple execution environments.

### Claim 2 (depends on 1)

The system of claim 1, wherein the one or more processors are further configured to:
obtain an indication that the execution environment is to be used to execute the federated SQL query.

### Claim 3 (depends on 1)

The system of claim 1, wherein the one or more processors, to generate the one or more functions, are configured to:
perform, based on the abstract syntax tree, a common subexpression elimination operation to generate one or more common expressions, wherein at least one function of the one or more functions indicates a common expression of the one or more common expressions.

### Claim 4 (depends on 3)

The system of claim 3, wherein the one or more common expressions are associated with respective hash identifiers, and wherein the at least one function indicates a hash identifier associated with the common expression.

### Claim 5 (depends on 1)

The system of claim 1, wherein the one or more processors are further configured to:
perform one or more filtering operations for one or more SQL statements included in the federated SQL query;
generate, based on performing the one or more filtering operations, an updated version of the federated SQL query; and
wherein the one or more processors, to generate the one or more functions, are configured to:
generate the one or more functions based on the updated version of the federated SQL query.

### Claim 6 (depends on 5)

The system of claim 5, wherein the one or more filtering operations include at least one of:
a projection pushdown operation, or
a predicate pushdown operation.

### Claim 7 (depends on 1)

The system of claim 1, wherein the one or more processors, to generate the one or more functions, are configured to:
determine, for a data source of the multiple data sources and based on a homogeneous SQL statement of the one or more homogeneous SQL statements, one or more data access operations to access data, from the set of data, associated with the data source; and
generate a function, of the one or more functions, to indicate the one or more data access operations.

### Claim 8

A method for execution environment agnostic federated queries comprising:
obtaining, by a device, configuration information which includes configurations for multiple execution environments,
wherein the configuration information indicates sets of execution code associated with the multiple execution environments;
obtaining, by the device, a federated query for a set of data associated with multiple data sources;
generating, by the device and based on the federated query and the configuration information, an abstract syntax tree indicating relationships between statements included in the federated query;
identifying, by the device and based on the abstract syntax tree, one or more homogeneous statements in the federated query, wherein the one or more homogeneous statements are associated with respective data sources of the multiple data sources;
registering, by the device and in a local database, one or more functions for respective homogeneous statements of the one or more homogeneous statements,
wherein each function, of the one or more functions, indicates information that enables one or more operations to be performed as indicated by a homogeneous statement associated with that function, and
wherein each function includes the sets of execution code associated with the multiple execution environments;
generating, by the device and based on the federated query, a local query for the local database using the one or more functions, wherein the local query calls a subset of execution code, from the sets of execution code associated with the multiple execution environments, that is associated with an execution environment of the multiple execution environments; and
executing, by the device and via the execution environment, the local query to perform the federated query for the set of data while the one or more functions are capable of being executed via the multiple execution environments.

### Claim 9 (depends on 8)

The method of claim 8, wherein executing the local query comprises at least one of:
obtaining at least a first portion of the set of data from the multiple data sources;
joining at least a second portion of the set of data from the multiple data sources; or
writing at least a third portion of the set of data to the multiple data sources.

### Claim 10 (depends on 8)

The method of claim 8, further comprising:
obtaining an indication that the execution environment is to be used to execute the federated query.

### Claim 11 (depends on 8)

The method of claim 8, further comprising:
performing, based on the abstract syntax tree, a common subexpression elimination operation to generate one or more common expressions, wherein at least one function of the one or more functions indicates a common expression of the one or more common expressions.

### Claim 12 (depends on 11)

The method of claim 11, wherein the one or more common expressions are associated with respective identifiers, and wherein the at least one function indicates an identifier associated with the common expression.

### Claim 13 (depends on 8)

The method of claim 8, further comprising:
performing one or more filtering operations for one or more statements included in the federated query;
generating, based on performing the one or more filtering operations, an updated version of the federated query; and
generating the one or more functions based on the updated version of the federated query.

### Claim 14 (depends on 8)

The method of claim 8, further comprising:
determining, for a data source of the multiple data sources and based on a homogeneous SQL statement of the one or more homogeneous SQL statements, one or more data access operations to access data, from the set of data, associated with the data source; and
generating a function, of the one or more functions, to indicate the one or more data access operations.

### Claim 15 (depends on 8)

The method of claim 8, wherein registering the one or more functions comprises:
storing views for respective functions of the one or more functions in the local database.

### Claim 16

A non-transitory computer-readable medium storing a set of instructions, the set of instructions comprising:
one or more instructions that, when executed by one or more processors of a device, cause the device to:
obtain configuration information which includes configurations for multiple execution environments,
wherein the configuration information indicates sets of execution code association with the multiple execution environments;
obtain a federated structured query language (SQL) query requesting a set of data from multiple data sources;
parse, based on the configuration information, the federated SQL query to generate an abstract syntax tree indicating relationships between SQL statements included in the federated SQL query;
identify, based on the abstract syntax tree, one or more homogeneous SQL statements in the federated SQL query, wherein the one or more homogeneous SQL statements request one or more subsets of data, of the set of data, from respective data sources of the multiple data sources;
generate, based on executing the one or more homogeneous SQL statements, one or more functions for respective homogeneous SQL statements of the one or more homogeneous SQL statements,
wherein each function, of the one or more functions, enables the one or more subsets of data to be accessible via a virtual table in a local database, and
wherein each function includes the sets of execution code associated with the multiple execution environments;
generate, based on the federated SQL query, a local query to the local database using the one or more functions, wherein the local query accesses a subset of execution code, from the sets of execution code associated with the multiple execution environments, that is associated with an execution environment; and
execute, via the execution environment, the local query to obtain the set of data while the one or more functions are capable of being executed via the multiple execution environments.

### Claim 17 (depends on 16)

The non-transitory computer-readable medium of claim 16, wherein the one or more instructions, that cause the device to generate the one or more functions, cause the device to:
perform, based on the abstract syntax tree, a common subexpression elimination operation to generate one or more common expressions, wherein at least one function of the one or more functions indicates a common expression of the one or more common expressions.

### Claim 18 (depends on 16)

The non-transitory computer-readable medium of claim 16, wherein the one or more instructions further cause the device to:
perform one or more filtering operations for one or more SQL statements included in the federated SQL query;
generate, based on performing the one or more filtering operations, an updated version of the federated SQL query; and
wherein the one or more instructions, that cause the device to generate the one or more functions, cause the device to:
generate the one or more functions based on the updated version of the federated SQL query.

### Claim 19 (depends on 18)

The non-transitory computer-readable medium of claim 18, wherein the one or more filtering operations include at least one of:
a projection pushdown operation, or
a predicate pushdown operation.

### Claim 20 (depends on 16)

The non-transitory computer-readable medium of claim 16, wherein the one or more instructions, that cause the device to generate the one or more functions, cause the device to:
determine, for a data source of the multiple data sources and based on a homogeneous SQL statement of the one or more homogeneous SQL statements, one or more data access operations to access data, from the set of data, associated with the data source; and
generate a function, of the one or more functions, to indicate the one or more data access operations.
