IP Library Granted Patent US 11,055,280
Granted Patent B2
US 11,055,280 · App. 16/201,854 · Granted Jul 6, 2021

Batch data ingestion in database systems

Inventors: Jiansheng Huang (Palo Alto, CA); Jiaxing Liang (Redwood City, CA); Scott Ziegler (Oakland, CA); Haowei Yu (Mountain View, CA); Benoit Dageville (Seattle, WA); Varun Ganesh (Belmont, CA)
Assignee: Snowflake Inc.
G06F16/2386G06F16/2255G06F16/2282G06F16/254
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 11,055,280
App. No.
16/201,854
Granted
Jul 6, 2021
Kind
B2
Abstract

Systems, methods, and devices for batch ingestion of data into a table of a database. A method includes determining a notification indicating a presence of a user file received from a client account to be ingested into a database. The method includes identifying data in the user file and identifying a target table of the database to receive the data in the user file. The method includes generating an ingest task indicating the data and the target table. The method includes assigning the ingest task to an execution node of an execution platform, wherein the execution platform comprises a plurality of execution nodes operating independent of a plurality of shared storage devices collectively storing database data. The method includes registering metadata concerning the target table in a metadata store after the data has been fully committed to the target table by the execution node.

Claims (89)

1. A method comprising:

receiving a notification indicating a presence of a file to be ingested into a database, the database comprising database data, the receiving comprising polling a file queue to determine whether any new files have been committed to the file queue since a last time the file queue was polled;

identifying file data in the file;

identifying a target table of the database to receive the identified file data;

generating an ingest task indicating the identified file data and the target table;

after generating the ingest request and prior to ingesting the identified file data and the target table, persisting the identified file data in file queue that corresponds to the target table;

assigning the ingest task to an execution node of an execution platform, the execution platform comprising a plurality of execution nodes, a plurality of shared storage devices collectively storing the database data;

registering metadata in a metadata store after the identified file data has been committed to the target table by the execution node, the registered metadata pertaining to the target table; and

providing a second file queue that corresponds to a second target table, the second target table different than the target table, the file queue corresponding to a first account and the second file queue corresponds to a second account.

2. The method of claim 1 , wherein receiving the notification comprises receiving the notification from a data lake, the notification indicating that the file has been added to the data lake, the data lake comprising data storage containing a plurality of files.

3. The method of claim 1 , further comprising:

identifying a current total number of active ingest tasks and a desired number of active ingest tasks; and

managing the plurality of execution nodes of the execution platform such that the current total number of active ingest tasks is substantially equal to the desired number of active ingest tasks.

4. The method of claim 1 , further comprising generating an ingest history comprising an indication of whether data from one or more files is successfully stored in the database, wherein the ingest history is stored in a metadata store, and wherein the ingest history comprises one or more of a file name, a table identification, a file size, a row count, and an ingest error code.

5. The method of claim 1 , further comprising assigning the file to an instance of a resource manager based on hashing a table identification of the target table.

6. The method of claim 5 , further comprising adding a new instance of a resource manager, wherein adding the new instance of the resource manager comprises dividing a plurality of hashes of the hashing and assigning each of the plurality of hashes among a plurality of instances of resource managers.

7. The method of claim 1 , wherein:

generating the ingest task comprises generating one or more ingest tasks based on an amount of work in the file queue; and

the amount of work in the file queue is determined based on one or more of:

an average size of recently ingested files from an account with which the file is associated;

a number of files in the file queue; and

a size of the file.

8. The method of claim 1 , wherein the data is committed to the target table by generating a new micro-partition for the target table, wherein the new micro-partition is stored in the plurality of shared storage devices after the data is committed to the target table.

9. The method of claim 1 , wherein assigning the ingest task to the execution node of the execution platform comprises managing a total number of tasks being processed by the execution platform by on one or more of:

delaying assigning the ingest task to the execution node when a threshold number of tasks are already being processed by the execution platform;

delaying assigning the ingest task to the execution node until a threshold number of new files has been committed to an account queue;

assigning the ingest task to the execution node after the file is committed to an account queue; and

delaying assigning the ingest task to the execution node until a threshold number of new files has been committed to the account queue.

10. The method of claim 9 , wherein managing the total number of tasks being processed by the execution platform comprises keeping latency below a threshold level.

11. One or more non-transitory computer readable storage media containing instructions executable by at least one processor for causing the at least one processor to perform operations comprising:

receiving a notification indicating a presence of a file to be ingested into a database, the database comprising database data, the receiving comprising polling a file queue to determine whether any new files have been committed to the file queue since a last time the file queue was polled;

identifying file data in the file;

identifying a target table of the database to receive the identified file data;

generating an ingest task indicating the identified file data and the target table;

after generating the ingest request and prior to ingesting the identified file data and the target table, persisting the identified file data in the file queue that corresponds to the target table;

assigning the ingest task to an execution node of an execution platform, the execution platform comprising a plurality of execution nodes, a plurality of shared storage devices collectively storing the database data;

registering metadata in a metadata store after the identified file data has been committed to the target table by the execution node, the registered metadata pertaining to the target table; and

providing a second file queue that corresponds to a second target table, the second target table different than the target table, the file queue corresponding to a first account and the second file queue corresponds to a second account.

12. The non-transitory computer readable storage media of claim 11 , wherein receiving the notification comprises receiving the notification from a data lake, the notification indicating that the file has been added to the data lake, the data lake comprising data storage containing a plurality of files.

13. The non-transitory computer readable storage media of claim 11 , wherein the operations further comprise:

identifying a current total number of active ingest tasks and a desired number of active ingest tasks; and

managing the plurality of execution nodes of the execution platform such that the current total number of active ingest tasks is substantially equal to the desired number of active ingest tasks.

14. The non-transitory computer readable storage media of claim 11 , wherein the operations further comprise generating an ingest history comprising an indication of whether data from one or more files is successfully stored in the database, wherein the ingest history is stored in a metadata store, and wherein the ingest history comprises one or more of a file name, a table identification, a file size, a row count, and an ingest error code.

15. The non-transitory computer readable storage media of claim 11 , wherein the operations further comprise assigning the file to an instance of a resource manager based on hashing a table identification of the target table.

16. The non-transitory computer readable storage media of claim 15 , wherein the operations further comprise adding a new instance of a resource manager, wherein adding the new instance of the resource manager comprises dividing a plurality of hashes of the hashing and assigning each of the plurality of hashes among a plurality of instances of resource managers.

17. The non-transitory computer readable storage media of claim 11 , wherein:

generating the ingest task comprises generating one or more ingest tasks based on an amount of work in the file queue; and

the amount of work in the file queue is determined based on one or more of:

an average size of recently ingested files from an account with which the file is associated;

a number of files in the file queue; and

a size of the file.

18. The non-transitory computer readable storage media of claim 11 , wherein the data is committed to the target table by generating a new micro-partition for the target table, wherein the new micro-partition is stored in the plurality of shared storage devices after the data is committed to the target table.

19. The non-transitory computer readable storage media of claim 11 , wherein assigning the ingest task to the execution node of the execution platform comprises managing a total number of tasks being processed by the execution platform by on one or more of:

delaying assigning the ingest task to the execution node when a threshold number of tasks are already being processed by the execution platform;

delaying assigning the ingest task to the execution node until a threshold number of new files have been committed to an account queue;

assigning the ingest task to the execution node after the file is committed to an account queue; and

delaying assigning the ingest task to the execution node until a threshold number of new files has been committed to the account queue.

20. The non-transitory computer readable storage media of claim 19 , wherein managing the total number of tasks being processed by the execution platform comprises keeping latency below a threshold level.

21. A system comprising:

at least one processor; and

one or more non-transitory computer readable storage media containing instructions executable by the at least one processor for causing the at least one processor to perform operations comprising:

receiving a notification indicating a presence of a file to be ingested into a database, the database comprising database data, the receiving comprising polling a file queue to determine whether any new files have been committed to the file queue since a last time the file queue was polled;

identifying file data in the file;

identifying a target table of the database to receive the identified file data;

generating an ingest task indicating the identified file data and the target table;

after generating the ingest request and prior to ingesting the identified file data and the target table, persisting the identified file data in the file queue that corresponds to the target table;

assigning the ingest task to an execution node of an execution platform, the execution platform comprising a plurality of execution nodes, a plurality of shared storage devices collectively storing the database data;

registering metadata in a metadata store after the identified file data has been committed to the target table by the execution node, the registered metadata pertaining to the target table; and

providing a second file queue that queue that corresponds to a second target table, the second target table different than the target table, the file queue corresponding to a first account and the second file queue corresponds to a second account.

22. The system of claim 21 , wherein receiving the notification comprises receiving the notification from a data lake, the notification indicating that the file has been added to the data lake, the data lake comprising data storage containing a plurality of files.

23. The system of claim 21 , the operations further comprising:

identifying a current total number of active ingest tasks and a desired number of active ingest tasks; and

managing the plurality of execution nodes of the execution platform such that the current total number of active ingest tasks is substantially equal to the desired number of active ingest tasks.

24. The system of claim 21 , the operations further comprising generating an ingest history comprising an indication of whether data from one or more files is successfully stored in the database, wherein the ingest history is stored in a metadata store, and wherein the ingest history comprises one or more of a file name, a table identification, a file size, a row count, and an ingest error code.

25. The system of claim 21 , the operations further comprising assigning the file to an instance of a resource manager based on hashing a table identification of the target table.

26. The system of claim 25 , the operations further comprising adding a new instance of a resource manager, wherein adding the new instance of the resource manager comprises dividing a plurality of hashes of the hashing and assigning each of the plurality of hashes among a plurality of instances of resource managers.

27. The system of claim 21 , wherein:

generating the ingest task comprises generating one or more ingest tasks based on an amount of work in the file queue; and

the amount of work in the file queue is determined based on one or more of:

an average size of recently ingested files from an account with which the file is associated;

a number of files in the file queue; and

a size of the file.

28. The system of claim 21 , wherein the data is committed to the target table by generating a new micro-partition for the target table, wherein the new micro-partition is stored in the plurality of shared storage devices after the data is committed to the target table.

29. The system of claim 21 , wherein assigning the ingest task to the execution node of the execution platform comprises managing a total number of tasks being processed by the execution platform by on one or more of:

delaying assigning the ingest task to the execution node when a threshold number of tasks are already being processed by the execution platform;

delaying assigning the ingest task to the execution node until a threshold number of new files has been committed to an account queue;

assigning the ingest task to the execution node after the file is committed to an account queue; and

delaying assigning the ingest task to the execution node until a threshold number of new files has been committed to the account queue.

30. The system of claim 29 , wherein managing the total number of tasks being processed by the execution platform comprises keeping latency below a threshold level.

Assignments (3)
CORRECTIVE ASSIGNMENT TO CORRECT THE EXECUTION DATE TO APRIL 1,2019, THAT WAS INCORRECTLY RECOREDED AS MARCH 14,2019 PREVIOUSLY RECORDED AT REEL: 049127 FRAME: 0027. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Aug 11, 2021
From: SNOWFLAKE COMPUTING, INC.
To: SNOWFLAKE INC.
Reel/Frame 057160/0204 →
CHANGE OF NAME Recorded Apr 11, 2019
From: SNOWFLAKE COMPUTING, INC.
To: SNOWFLAKE INC.
Reel/Frame 049127/0027 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 27, 2018
From: HUANG, JIANSHENG; LIANG, JIAXING; ZIEGLER, SCOTT; YU, HAOWEI; DAGEVILLE, BENOIT; GANESH, VARUN
To: SNOWFLAKE COMPUTING INC.
Reel/Frame 047596/0307 →
Continuity (2)
Provisional Application 62591118 · Nov 27, 2017
Related Publication 20190163754A1 · May 30, 2019
Cited By (5)
US 12,235,875 US 12,260,128 US 12,314,254 US 12,399,900 US 12,430,315