# US 2026/0037665 A1 · Aggregation constraints in a query processing system

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

- Number: US 2026/0037665 A1
- Document ID: US20260037665A1
- Status: Published application
- Kind: A1
- Application number: 19/350,894
- Filed: 2025-10-06
- Published: 2026-02-05
- Earliest claimed: 2023-03-06
- Assignees: Snowflake Inc.
- Applicants: Snowflake Inc.
- Inventors: Khalid Zaman Bijon; Bowei Chen; Thierry Cruanes; Simon Holm Jensen; Allison Waingold Lee; Valentin K. Kuznetsov; Jun Li; Subramanian Muralidhar; Carl Yates Perry; David Schultz; Zixi Zhang
- Web page: https://patentgrep.com/patent/US20260037665A1

## CPC

- G06F 21/6245: {Protecting personal data, e.g. for financial or medical purposes}
- G06F 16/244: {Grouping and aggregation}
- G06F 2221/2113: Multi-level security, e.g. mandatory access control
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system is disclosed that includes one or more hardware processors and at least one memory storing instructions. The system receives a first query directed towards a shared dataset and accesses a first set of data from a first table in the shared dataset. The system determines that an aggregation constraint policy is attached to the first table, which restricts output of data values stored in the table. The system performs a uniqueness check on join keys for a join operation associated with the first table, verifying that at least one row from the first table is not amplified in the result. The system enforces the aggregation constraint policy on the first query based on this verification. The system generates an output to the first query based on the first set of data. This approach helps control data aggregation and ensures privacy when accessing shared datasets.

## Claims

### Claim 1

A system comprising:
one or more hardware processors of a machine; and
at least one memory storing instructions that, when executed by the one or more hardware processors, cause the system to perform operations comprising:
receiving a first query directed towards a shared dataset;
accessing a first set of data from the shared dataset, the first set of data comprising data from a first table of the shared dataset;
determining that an aggregation constraint policy is attached to the first table, the aggregation constraint policy restricting output of data values stored in the first table;
performing a uniqueness check on join keys for a join operation associated with the first table, the uniqueness check comprising a verification that at least one row from the first table is not amplified in a result of the join operation;
enforcing the aggregation constraint policy on the first query based on the verification; and
generating an output to the first query based on the first set of data.

### Claim 2 (depends on 1)

The system of claim 1, wherein a context of the first query is based on at least one of an account associated with the first query, a role of a user that submitted the first query, or data shares associated with the first query.

### Claim 3 (depends on 1)

The system of claim 1, the operations further comprising:
receiving data defining the aggregation constraint policy attached to the first table.

### Claim 4 (depends on 3)

The system of claim 3, wherein data defining the aggregation constraint policy is associated with:
specifying a principal that is subject to the aggregation constraint policy; and
specifying, for the principal that is subject to the aggregation constraint policy, a minimum number of rows in the first table that must be aggregated in any valid query.

### Claim 5 (depends on 4)

The system of claim 4, the operations further comprising:
determining whether the first query is a valid query based, at least in part, on the minimum number of rows in the first table, and rejecting the first query based on determining that the first query is invalid.

### Claim 6 (depends on 1)

The system of claim 1, wherein the output to the first query comprises identifying a number of matching data values in the first table and a second table of the shared dataset.

### Claim 7 (depends on 1)

The system of claim 1, the operations further comprising:
receiving a second query directed towards the shared dataset, the second query identifying a second operation;
accessing a second set of data from the shared dataset to perform the second operation, the second set of data comprising second data accessed from a second table of the shared dataset, the second table being different from the first table;
determining that a second aggregation constraint policy is attached with the second table, the second aggregation constraint policy associated with the second table restricting aggregation of data values stored in the second table; and
enforcing the second aggregation constraint policy on the second query, and generating an output to the second query based on the second set of data.

### Claim 8 (depends on 1)

The system of claim 1, the operations further comprising:
receiving a second query directed towards the shared dataset, the second query identifying a second operation;
accessing a second set of data from the shared dataset to perform the second operation, the second set of data comprising the data accessed from the first table of the shared dataset, determining that the aggregation constraint policy is attached to the first table;
opting not to enforce the aggregation constraint policy on the second query based on a context of the second query; and
generating an output to the second query based on the second set of data, the output to the second query comprising the data values stored in the first table based on the opting not to enforce the aggregation constraint policy on the second query.

### Claim 9 (depends on 1)

The system of claim 1, wherein the shared dataset comprises a first dataset associated with a first entity and a second dataset associated with a second entity, the first entity being associated with a first account of a cloud data platform that receives the first query, the first query being received from the second entity.

### Claim 10 (depends on 9)

The system of claim 9, the operations further comprising:
generating a data clean room in the first account, the first account being associated with a provider database account;
installing, in a second account, an application instance that implements the data clean room, the second account being associated with a consumer database account of the second entity; and
sharing, by the provider database account, source provider data with the data clean room, the sharing making the source provider data accessible to the consumer database account via the application instance.

### Claim 11 (depends on 1)

The system of claim 1, the operations further comprising:
generating an audit log of queries received and actions taken in response to enforcement of the aggregation constraint policy; and
limiting a rate at which queries are received from a user or account subject to the aggregation constraint policy.

### Claim 12 (depends on 1)

The system of claim 1, the operations further comprising:
applying differential privacy noise to aggregate query results in accordance with a privacy budget parameter specified in the aggregation constraint policy.

### Claim 13 (depends on 3)

The system of claim 3, wherein the data defining the aggregation constraint policy further comprises data specifying a set of conditions for triggering enforcement of the aggregation constraint policy, the conditions including at least one of user role, account identity, or query type.

### Claim 14 (depends on 2)

The system of claim 2, wherein the context of the first query further comprises a temporal parameter, and the aggregation constraint policy is enforced based on the temporal parameter.

### Claim 15 (depends on 7)

The system of claim 7, wherein the second aggregation constraint policy specifies a different minimum group size or permitted aggregate function class than the aggregation constraint policy attached to the first table.

### Claim 16 (depends on 1)

The system of claim 1, the operations further comprising:
prior to aggregation, restricting pre-processing operations on the first set of data to allow at least one of: filtering, joining with unique keys, or a set of cleaning functions; and
prohibiting arbitrary transformations that amplify or reveal individual data values.

### Claim 17

A method comprising:
receiving, by at least one hardware processor, a first query directed towards a shared dataset;
accessing a first set of data from the shared dataset, the first set of data comprising data from a first table of the shared dataset;
determining, by the at least one hardware processor, that an aggregation constraint policy is attached to the first table, the aggregation constraint policy restricting output of data values stored in the first table;
performing, by the at least one hardware processor, a uniqueness check on join keys for a join operation associated with the first table, the uniqueness check comprising a verification that at least one row from the first table is not amplified in a result of the join operation;
enforcing the aggregation constraint policy on the first query based on the verification; and
generating an output to the first query based on the first set of data.

### Claim 18 (depends on 17)

The method of claim 17, wherein a context of the first query is based on at least one of an account associated with the first query, a role of a user that submitted the first query, or data shares associated with the first query, and wherein the method further comprises:
receiving data defining the aggregation constraint policy attached to the first table.

### Claim 19

A machine-storage medium embodying instructions that, when executed by a machine, cause the machine to perform operations comprising:
receiving a first query directed towards a shared dataset;
accessing a first set of data from the shared dataset, the first set of data comprising data from a first table of the shared dataset;
determining that an aggregation constraint policy is attached to the first table, the aggregation constraint policy restricting output of data values stored in the first table;
performing a uniqueness check on join keys for a join operation associated with the first table, the uniqueness check comprising a verification that at least one row from the first table is not amplified in a result of the join operation;
enforcing the aggregation constraint policy on the first query based on the verification; and
generating an output to the first query based on the first set of data.

### Claim 20 (depends on 19)

The machine-storage medium of claim 19, wherein a context of the first query is based on at least one of an account associated with the first query, a role of a user that submitted the first query, or data shares associated with the first query, and the operations further comprising:
receiving data defining the aggregation constraint policy attached to the first table, wherein data defining the aggregation constraint policy is associated with:
specifying a principal that is subject to the aggregation constraint policy; and
specifying, for the principal that is subject to the aggregation constraint policy, a minimum number of rows in the first table that must be aggregated in any valid query.
