IP Library Granted Patent US 12,367,186
Granted Patent B2
US 12,367,186 · App. 18/496,734 · Granted Jul 22, 2025

Distributed in-database vectorized operations using user defined table functions

Inventors: Pradeep Dorairaj (Fremont, CA); Garrett Frere (Long Island City, NY); Carsten Stann (Warsaw, PL); Boyu Wang (Menlo Park, CA); Mengjia Xia (Philadelphia, PA)
Assignee: Snowflake Inc.
G06F16/2291G06F16/244G06F16/24532
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,367,186
App. No.
18/496,734
Granted
Jul 22, 2025
Kind
B2
Abstract

The subject technology receives first data. The subject technology transforms first data to a wide format, the wide format comprising a second table. The subject technology splits a set of rows into a set of shards of rows. The subject technology, for each shard from the set of shards, sends a particular user defined table function (UDTF), including a particular shard of rows, to a different execution node to perform a set of operations for determining a rolling correlation over a window size. The subject technology provides a set of output values of each particular UDTF corresponding to each shard from the set of shards in a second UDTF. The subject technology sends the second UDTF to a particular execution node to perform an aggregate operation. The subject technology receives a value of the rolling correlation from the particular execution node based on the aggregate operation.

Claims (68)

1. A system comprising:

at least one hardware processor; and

a memory storing instructions that cause the at least one hardware processor to perform operations comprising:

receiving first data comprising a first table, the first table comprising a first set of columns;

transforming the first data to a wide format, the wide format comprising a second table, the second table comprising a second set of columns, each column representing a particular asset, the second set of columns corresponding to a set of rows, and each row of the set of rows corresponding to a particular date;

splitting the set of rows into a set of shards of rows;

determining, based on a first number of the set of shards, a first number of execution nodes for processing the set of shards;

for each shard from the set of shards, sending a particular user defined table function (UDTF), including a particular shard of rows, to a different execution node to perform a set of operations for determining a rolling correlation over a window size, a particular vector processor of the different execution node being utilized to perform the set of operations for determining the rolling correlation over the window size;

providing a set of output values of each particular UDTF corresponding to each shard from the set of shards in a second UDTF;

sending the second UDTF to a particular execution node to perform an aggregate operation using the set of output values of each particular UDTF; and

receiving a value of the rolling correlation from the particular execution node based on the aggregate operation.

2. The system of claim 1 , wherein the first set of columns comprises a first column corresponding to a date, a second column corresponding to a financial asset, and a third column corresponding to a return.

3. The system of claim 2 , wherein each shard from the set of shards includes a same number of rows.

4. The system of claim 1 , wherein the window size comprises a period of time, the period of time comprising a particular number of days.

5. The system of claim 1 , wherein each shard from the set of shards of rows is not stored entirely in memory.

6. The system of claim 1 , wherein sending the particular UDTF further comprises:

for each shard from the set of shards, sending a shard identifier to the different execution node.

7. The system of claim 1 , wherein the operations further comprise:

performing a join operation based on an individual financial asset table to a correlation table; and

determining an aggregate value at risk using matrix multiplication.

8. The system of claim 1 , wherein the operations further comprise:

determining a set of overlap rows, the set of overlap rows comprising a particular number of rows between two different shards; and

sending the set of overlap rows to another different node to compute rolling correlation for those rows.

9. The system of claim 1 , wherein each execution node comprises a different server instance or is included in a different virtual warehouse.

10. A method comprising:

receiving first data comprising a first table, the first table comprising a first set of columns;

transforming the first data to a wide format, the wide format comprising a second table, the second table comprising a second set of columns, each column representing a particular asset, the second set of columns corresponding to a set of rows, and each row of the set of rows corresponding to a particular date;

splitting the set of rows into a set of shards of rows;

determining, based on a first number of the set of shards, a first number of execution nodes for processing the set of shards;

for each shard from the set of shards, sending a particular user defined table function (UDTF), including a particular shard of rows, to a different execution node to perform a set of operations for determining a rolling correlation over a window size, a particular vector processor of the different execution node being utilized to perform the set of operations for determining the rolling correlation over the window size;

providing a set of output values of each particular UDTF corresponding to each shard from the set of shards in a second UDTF;

sending the second UDTF to a particular execution node to perform an aggregate operation using the set of output values of each particular UDTF; and

receiving a value of the rolling correlation from the particular execution node based on the aggregate operation.

11. The method of claim 10 , wherein the first set of columns comprises a first column corresponding to a date, a second column corresponding to a financial asset, and a third column corresponding to a return.

12. The method of claim 11 , wherein each shard from the set of shards includes a same number of rows.

13. The method of claim 10 , wherein the window size comprises a period of time, the period of time comprising a particular number of days.

14. The method of claim 10 , wherein each shard from the set of shards of rows is not stored entirely in memory.

15. The method of claim 10 , wherein sending the particular UDTF further comprises:

for each shard from the set of shards, sending a shard identifier to the different execution node.

16. The method of claim 10 , further comprising:

performing a join operation based on an individual financial asset table to a correlation table; and

determining an aggregate value at risk using matrix multiplication.

17. The method of claim 10 , further comprising:

determining a set of overlap rows, the set of overlap rows comprising a particular number of rows between two different shards; and

sending the set of overlap rows to another different node to compute the rolling correlation for the set of overlap rows.

18. The method of claim 10 , wherein each execution node comprises a different server instance or is included in a different virtual warehouse.

19. A non-transitory computer-storage medium comprising instructions that, when executed by one or more processors of a machine, configure the machine to perform operations comprising:

receiving first data comprising a first table, the first table comprising a first set of columns;

transforming the first data to a wide format, the wide format comprising a second table, the second table comprising a second set of columns, each column representing a particular asset, the second set of columns corresponding to a set of rows, and each row of the set of rows corresponding to a particular date;

splitting the set of rows into a set of shards of rows;

determining, based on a first number of the set of shards, a first number of execution nodes for processing the set of shards;

for each shard from the set of shards, sending a particular user defined table function (UDTF), including a particular shard of rows, to a different execution node to perform a set of operations for determining a rolling correlation over a window size, a particular vector processor of the different execution node being utilized to perform the set of operations for determining the rolling correlation over the window size;

providing a set of output values of each particular UDTF corresponding to each shard from the set of shards in a second UDTF;

sending the second UDTF to a particular execution node to perform an aggregate operation using the set of output values of each particular UDTF; and

receiving a value of the rolling correlation from the particular execution node based on the aggregate operation.

20. The non-transitory computer-storage medium of claim 19 , wherein the first set of columns comprises a first column corresponding to a date, a second column corresponding to a financial asset, and a third column corresponding to a return.

21. The non-transitory computer-storage medium of claim 20 , wherein each shard from the set of shards includes a same number of rows.

22. The non-transitory computer-storage medium of claim 19 , wherein the window size comprises a period of time, the period of time comprising a particular number of days.

23. The non-transitory computer-storage medium of claim 19 , wherein each shard from the set of shards of rows is not stored entirely in memory.

24. The non-transitory computer-storage medium of claim 19 , wherein sending the particular UDTF further comprises:

for each shard from the set of shards, sending a shard identifier to the different execution node.

25. The non-transitory computer-storage medium of claim 19 , wherein the operations further comprise:

performing a join operation based on an individual financial asset table to a correlation table; and

determining an aggregate value at risk using matrix multiplication.

26. The non-transitory computer-storage medium of claim 19 , wherein the operations further comprise:

determining a set of overlap rows, the set of overlap rows comprising a particular number of rows between two different shards; and

sending the set of overlap rows to another different node to compute the rolling correlation for the set of overlap rows.

27. The non-transitory computer-storage medium of claim 19 , wherein each execution node comprises a different server instance or is included in a different virtual warehouse.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 15, 2024
From: DORAIRAJ, PRADEEP; FRERE, GARRETT; STANN, CARSTEN; WANG, BOYU; XIA, MENGJIA
To: SNOWFLAKE INC.
Reel/Frame 066119/0972 →
Continuity (1)
Related Publication 20250139076A1 · May 1, 2025
References Cited (28)
US 7953728B2 · Hu · 2011 [cited by examiner]
US 11055262B1 · Cseri · 2021 [cited by examiner]
US 11113390B1 · Brossard · 2021 [cited by examiner]
US 11347527B1 · Brossard · 2022 [cited by examiner]
US 11461351B1 · Field · 2022 [cited by examiner]
US 11514080B1 · Angius · 2022 [cited by examiner]
US 11561946B1 · Jiang · 2023 [cited by examiner]
US 11726976B1 · Brossard · 2023 [cited by examiner]
US 12174817B2 · Brossard · 2024 [cited by examiner]
US 20080288446A1 · Hu · 2008 [cited by examiner]
US 20170235750A1 · Dageville · 2017 [cited by examiner]
US 20180196091A1 · Ferguson · 2018 [cited by examiner]
US 20200195743A1 · Jiang · 2020 [cited by examiner]
US 20210318994A1 · Cseri · 2021 [cited by examiner]
US 20210374235A1 · Brossard · 2021 [cited by examiner]
US 20220035611A1 · Cseri · 2022 [cited by examiner]
US 20220058160A1 · Cseri · 2022 [cited by examiner]
US 20220058206A1 · Breß · 2022 [cited by examiner]
US 20220237192A1 · Jiang · 2022 [cited by examiner]
US 20220292213A1 · Holboke · 2022 [cited by examiner]
US 20220358139A1 · Dageville · 2022 [cited by examiner]
US 20220405249A1 · Cseri · 2022 [cited by examiner]
US 20230409552A1 · Brossard · 2023 [cited by examiner]
US 20250068616A1 · Brossard · 2025 [cited by examiner]
CN 114911773A · 2022 [cited by examiner]
CN 115033649A · 2022 [cited by examiner]
CN 115061994A · 2022 [cited by examiner]
CN 116340351A · 2023 [cited by examiner]