# US 12,216,648 B1 · Row-order dependent dataframe workloads

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

- Number: US 12,216,648 B1
- Document ID: US12216648B1
- Status: Granted
- Kind: B1
- Application number: 18/393,324
- Filed: 2023-12-21
- Granted: 2025-02-04
- Earliest claimed: 2023-09-18
- Assignees: Snowflake Inc.
- Applicants: Snowflake Inc.
- Inventors: Srilakshmi Chintala; Jianzhun Du; Naresh Kumar; Srinath Shankar; Leonhard Franz Spiegelberg; Eric Shawn Vandenberg; Andong Zhan; Yun Zou
- Web page: https://patentgrep.com/patent/US12216648B1

## CPC

- G06F 16/244: {Grouping and aggregation}
- G06F 16/128: {Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion (error detection or correction of the data by redundancy in operations or in hardware G06F11/14, G06F11/16)}
- G06F 16/2272: {Management thereof}
- G06F 16/2453: Query optimisation
- G06F 16/256: {in federated or virtual databases}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method includes receiving instructions to perform order-dependent DataFrame operation on data. In response to receiving the instructions, the framework analyzes the instructions to identify the order-dependent DataFrame operation, and generates an executable query corresponding to the identified order-dependent DataFrame operation. The framework executes the generated executable query on the data stored in the first database in the cloud data platform, creates a row position column that generates for each row a unique integer identifier, reproducible across multiple sessions and/or queries for the same underlying data to make the data accessible via positional indexing, and assigns each row of the first database a unique row index value based on the row position column and the row position column order. The framework orders a result from performing the order-dependent DataFrame operation based on the unique row index value assigned to each row of the first database, and returns the ordered result to the user.

## Claims

### Claim 1

A method comprising:
receiving, by at least one hardware processor, instructions to perform an order-dependent DataFrame operation on data stored in a first database in a cloud data platform, the instructions specified using code authored in a programming language for executing the order-dependent DataFrame operation within the cloud data platform;
analyzing the instructions to identify the order-dependent DataFrame operation;
generating an executable query corresponding to the identified order-dependent DataFrame operation;
executing the generated executable query on the data stored in the first database in the cloud data platform;
creating a row position column that generates a row position column order to make the data accessible via positional indexing;
assigning each row of the first database a unique row position value based on the row position column and the row position column order;
ordering a result from performing the order-dependent DataFrame operation based on the unique row position value assigned to each row of the first database; and
returning, to a user, the ordered result.

### Claim 2 (depends on 1)

The method of claim 1, wherein the order-dependent DataFrame operation comprises at least one of: displaying a specified number of rows, displaying a specified set of rows based on their indices, appending rows, or aggregating rows.

### Claim 3 (depends on 2)

The method of claim 2, wherein displaying the specified number of rows further comprises at least one of displaying the rows from a beginning of the first database or displaying the rows from an end of the first database.

### Claim 4 (depends on 1)

The method of claim 1, wherein assigning each row of the first database the unique row position value comprises:
determining an offset associated with a data file; and
assigning each row of the first database the unique row position value based on the offset of the data file and the unique row position value and a position of each row within the data file.

### Claim 5 (depends on 4)

The method of claim 4, wherein ordering the result comprises:
ordering a specified number of rows based on the unique row position value assigned to each row; and
modifying the generated executable query to include an ORDER BY clause corresponding to the unique row position value assigned to each row of the first database.

### Claim 6 (depends on 1)

The method of claim 1, wherein the order-dependent DataFrame operation comprises displaying rows from the first database based on specified row indices, and wherein ordering the result comprises ordering rows corresponding to the specified row indices based on the unique row position value assigned to each row.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
appending rows to the first database;
ordering the first database with the appended rows based on the unique row position value assigned to each row of the first database; and
assigning each of the appended rows with the unique row position value.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
performing an aggregation operation on the first database; and
ordering rows of an aggregation result based on values of grouping columns from the first database.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
joining the first database with a second database; and
ordering rows of a join result based on the unique row position value assigned to the rows of the first database and the rows of the second database.

### Claim 10 (depends on 9)

The method of claim 9, wherein ordering the rows of the join result further comprises:
prioritizing ordering the rows based on the unique row position value assigned to the first database over the unique row position value assigned to the second database.

### Claim 11

A system comprising:
one or more hardware processors; 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, by at least one hardware processor, instructions to perform an order-dependent DataFrame operation on data stored in a first database in a cloud data platform, the instructions specified using code authored in a programming language for executing the order-dependent DataFrame operation within the cloud data platform;
analyzing the instructions to identify the order-dependent DataFrame operation;
generating an executable query corresponding to the identified order-dependent DataFrame operation;
executing the generated executable query on the data stored in the first database in the cloud data platform;
creating a row position column that generates a row position column order to make the data accessible via positional indexing;
assigning each row of the first database a unique row position value based on the row position column and the row position column order;
ordering a result from performing the order-dependent DataFrame operation based on the unique row position value assigned to each row of the first database; and
returning, to a user, the ordered result.

### Claim 12 (depends on 11)

The system of claim 11, wherein the order-dependent DataFrame operation comprises at least one of: displaying a specified number of rows, displaying a specified set of rows based on their indices, appending rows, or aggregating rows.

### Claim 13 (depends on 12)

The system of claim 12, wherein displaying the specified number of rows further comprises at least one of displaying the rows from a beginning of the first database or displaying the rows from an end of the first database.

### Claim 14 (depends on 11)

The system of claim 11, wherein assigning each row of the first database the unique row position value comprises:
determining an offset associated with a data file; and
assigning each row of the first database the unique row position value based on the offset of the data file and the unique row position value and a position of each row within the data file.

### Claim 15 (depends on 14)

The system of claim 14, wherein ordering the result comprises:
ordering a specified number of rows based on the unique row position value assigned to each row; and
modifying the generated executable query to include an ORDER BY clause corresponding to the unique row position value assigned to each row of the first database.

### Claim 16 (depends on 11)

The system of claim 11, wherein the order-dependent DataFrame operation comprises displaying rows from the first database based on specified row indices, and wherein ordering the result comprises ordering rows corresponding to the specified row indices based on the unique row position value assigned to each row.

### Claim 17 (depends on 11)

The system of claim 11, the operations comprising:
appending rows to the first database;
ordering the first database with the appended rows based on the unique row position value assigned to each row of the first database; and
assigning each of the appended rows with the unique row position value.

### Claim 18 (depends on 11)

The system of claim 11, the operations comprising:
performing an aggregation operation on the first database; and
ordering rows of an aggregation result based on values of grouping columns from the first database.

### Claim 19 (depends on 11)

The system of claim 11, the operations comprising:
joining the first database with a second database; and
ordering rows of a join result based on the unique row position value assigned to the rows of the first database and the rows of the second database.

### Claim 20 (depends on 19)

The system of claim 19, wherein ordering the rows of the join result further comprises:
prioritizing ordering the rows based on the unique row position value assigned to the first database over the unique row position value assigned to the second database.

### Claim 21

A machine-storage medium embodying instructions that, when executed by a machine, cause the machine to perform operations comprising:
receiving, by at least one hardware processor, instructions to perform an order-dependent DataFrame operation on data stored in a first database in a cloud data platform, the instructions specified using code authored in a programming language for executing the order-dependent DataFrame operation within the cloud data platform;
analyzing the instructions to identify the order-dependent DataFrame operation;
generating an executable query corresponding to the identified order-dependent DataFrame operation;
executing the generated executable query on the data stored in the first database in the cloud data platform;
creating a row position column that generates a row position column order to make the data accessible via positional indexing;
assigning each row of the first database a unique row position value based on the row position column and the row position column order;
ordering a result from performing the order-dependent DataFrame operation based on the unique row position value assigned to each row of the first database; and
returning, to a user, the ordered result.

### Claim 22 (depends on 21)

The machine-storage medium of claim 21, wherein the order-dependent DataFrame operation comprises at least one of: displaying a specified number of rows, displaying a specified set of rows based on their indices, appending rows, or aggregating rows.

### Claim 23 (depends on 22)

The machine-storage medium of claim 22, wherein displaying the specified number of rows further comprises at least one of displaying the rows from a beginning of the first database or displaying the rows from an end of the first database.

### Claim 24 (depends on 21)

The machine-storage medium of claim 21, wherein assigning each row of the first database the unique row position value comprises:
determining an offset associated with a data file; and
assigning each row of the first database the unique row position value based on the offset of the data file and the unique row position value and a position of each row within the data file.

### Claim 25 (depends on 24)

The machine-storage medium of claim 24, wherein ordering the result comprises:
ordering a specified number of rows based on the unique row position value assigned to each row; and
modifying the generated executable query to include an ORDER BY clause corresponding to the unique row position value assigned to each row of the first database.

### Claim 26 (depends on 21)

The machine-storage medium of claim 21, wherein the order-dependent DataFrame operation comprises displaying rows from the first database based on specified row indices, and wherein ordering the result comprises ordering rows corresponding to the specified row indices based on the unique row position value assigned to each row.

### Claim 27 (depends on 21)

The machine-storage medium of claim 21, wherein the operations comprise:
appending rows to the first database;
ordering the first database with the appended rows based on the unique row position value assigned to each row of the first database; and
assigning each of the appended rows with the unique row position value.

### Claim 28 (depends on 21)

The machine-storage medium of claim 21, wherein the operations comprise:
performing an aggregation operation on the first database; and
ordering rows of an aggregation result based on values of grouping columns from the first database.

### Claim 29 (depends on 21)

The machine-storage medium of claim 21, wherein the operations comprise:
joining the first database with a second database; and
ordering rows of a join result based on the unique row position value assigned to the rows of the first database and the rows of the second database.

### Claim 30 (depends on 29)

The machine-storage medium of claim 29, wherein ordering the rows of the join result further comprises:
prioritizing ordering the rows based on the unique row position value assigned to the first database over the unique row position value assigned to the second database.
