IP Library › Granted Patent US 12,248,485
Granted Patent B2
US 12,248,485 · App. 18/419,165 · Granted Mar 11, 2025

Fetching query result data using result batches

Inventors: Harsha S. Kapre (San Mateo, CA); Mark T. Keller (San Mateo, CA); Srinath Shankar (Belmont, CA); Kushan A Zaveri (North York, CA)
Assignee: Snowflake Inc.
G06F16/2471G06F16/24532G06F16/24561G06F16/256G06F16/258
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,248,485
App. No.
18/419,165
Granted
Mar 11, 2025
Kind
B2
Abstract

Techniques for fetching query result data using result batches includes retrieving query result information from a first computing node of a database system. The query result information includes result data associated with a multi-stage execution of a query. A plurality of result batches are generated based on the query result information. Each result batch of the plurality of result batches includes a retrieval function for a portion of the result data. The portion of the result data for each result batch of the plurality of result batches is retrieved based on execution of the retrieval function by at least a second computing node of the database system. The result data associated with the multi-stage execution of the query is output based on completion of the retrieval.

Claims (95)

1. A system comprising:

at least one hardware processor; and

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

retrieving query result information from a first computing node of a database system, the query result information including result data associated with a multi-stage execution of a query;

generating a plurality of result batches based on the query result information, the plurality of result batches corresponding to a plurality of execution stages of the multi-stage execution, and each result batch of the plurality of result batches including a retrieval function for a portion of the result data for a corresponding execution stage of the plurality of execution stages;

causing retrieval of the portion of the result data for each result batch of the plurality of result batches based on execution of the retrieval function by at least a second computing node of the database system; and

outputting the result data associated with the multi-stage execution of the query based on completion of the retrieval.

2. The system of claim 1 , wherein the portion of the result data corresponds to an execution stage of the multi-stage execution of the query, and wherein the instructions further cause the at least one hardware processor to perform operations comprising:

decoding the query result information to obtain storage information, the storage information indicating a storage location storing the result data associated with the multi-stage execution of the query.

3. The system of claim 2 , wherein the instructions further cause the at least one hardware processor to perform operations comprising:

encoding the retrieval function to include the storage information; and

causing retrieving of the result data from the storage location using the storage information.

4. The system of claim 2 , wherein the storage information is a uniform resource locator (URL) associated with the storage location.

5. The system of claim 2 , wherein the instructions further cause the at least one hardware processor to perform operations comprising:

decoding the query result information to further obtain authentication information associated with the storage location storing the result data.

6. The system of claim 5 , wherein the instructions further cause the at least one hardware processor to perform operations comprising:

encoding the retrieval function to include the storage information and the authentication information; and

causing retrieving of a plurality of data portions of the result data from the storage location using the storage information and the authentication information.

7. The system of claim 1 , wherein the instructions further cause the at least one hardware processor to perform operations comprising:

serializing the plurality of result batches before distribution to the at least a second computing node; and

causing deserialization of the plurality of result batches at the at least a second computing node before the retrieving.

8. The system of claim 1 , wherein the instructions further cause the at least one hardware processor to perform operations comprising:

decoding the query result information to obtain schema information, the schema information indicating a plurality of schemas associated with a plurality of data portions of the result data; and

parsing the plurality of data portions based on the plurality of schemas to obtain parsed result data; and

outputting the parsed result data.

9. The system of claim 1 , wherein the instructions further cause the at least one hardware processor to perform operations comprising:

distributing the plurality of result batches to a plurality of processing threads executing on the at least a second computing node;

causing parallel fetching and processing of corresponding portions of a plurality of data portions of the result data by the plurality of processing threads to generate processed data, using the plurality of result batches; and

causing retrieving of the processed data from the at least a second computing node.

10. The system of claim 1 , wherein the instructions further cause the at least one hardware processor to perform operations comprising:

obtaining a plurality of data portions of the result data from the at least a second computing node;

converting one or more of the plurality of data portions of the result data into a data table or a data object; and

providing the data table or the data object as output, in response to a data processing request associated with the multi-stage execution of the query.

11. A method comprising:

retrieving, by at least one hardware processor, query result information from a first computing node of a database system, the query result information including result data associated with a multi-stage execution of a query;

generating a plurality of result batches based on the query result information, the plurality of result batches corresponding to a plurality of execution stages of the multi-stage execution, and each result batch of the plurality of result batches including a retrieval function for a portion of the result data for a corresponding execution stage of the plurality of execution stages;

causing retrieval of the portion of the result data for each result batch of the plurality of result batches based on execution of the retrieval function by at least a second computing node of the database system; and

outputting the result data associated with the multi-stage execution of the query based on completion of the retrieval.

12. The method of claim 11 , wherein the portion of the result data corresponds to an execution stage of the multi-stage execution of the query, and the method further comprising:

decoding the query result information to obtain storage information, the storage information indicating a storage location storing the result data associated with the multi-stage execution of the query.

13. The method of claim 12 , further comprising:

encoding the retrieval function to include the storage information; and

causing retrieving of the result data from the storage location using the storage information.

14. The method of claim 12 , wherein the storage information is a uniform resource locator (URL) associated with the storage location.

15. The method of claim 12 , further comprising:

decoding the query result information to further obtain authentication information associated with the storage location storing the result data.

16. The method of claim 15 , further comprising:

encoding the retrieval function to include the storage information and the authentication information; and

causing retrieving of a plurality of data portions of the result data from the storage location using the storage information and the authentication information.

17. The method of claim 11 , further comprising:

serializing the plurality of result batches before distribution to the at least a second computing node; and

causing deserialization of the plurality of result batches at the at least a second computing node before the retrieving.

18. The method of claim 11 , further comprising:

decoding the query result information to obtain schema information, the schema information indicating a plurality of schemas associated with a plurality of data portions of the result data; and

parsing the plurality of data portions based on the plurality of schemas to obtain parsed result data; and

outputting the parsed result data.

19. The method of claim 11 , further comprising:

distributing the plurality of result batches to a plurality of processing threads executing on the at least a second computing node;

causing parallel fetching and processing of corresponding portions of a plurality of data portions of the result data by the plurality of processing threads to generate processed data, using the plurality of result batches; and

causing retrieving of the processed data from the at least a second computing node.

20. The method of claim 11 , further comprising:

obtaining a plurality of data portions of the result data from the at least a second computing node;

converting one or more of the plurality of data portions of the result data into a data table or a data object; and

providing the data table or the data object as output, in response to a data processing request associated with the multi-stage execution of the query.

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

retrieving query result information from a first computing node of a database system, the query result information including result data associated with a multi-stage execution of a query;

generating a plurality of result batches based on the query result information, the plurality of result batches corresponding to a plurality of execution stages of the multi-stage execution, and each result batch of the plurality of result batches including a retrieval function for a portion of the result data for a corresponding execution stage of the plurality of execution stages;

causing retrieval of the portion of the result data for each result batch of the plurality of result batches based on execution of the retrieval function by at least a second computing node of the database system; and

outputting the result data associated with the multi-stage execution of the query based on completion of the retrieval.

22. The computer-storage medium of claim 21 , wherein the portion of the result data corresponds to an execution stage of the multi-stage execution of the query, and the operations further comprising:

decoding the query result information to obtain storage information, the storage information indicating a storage location storing the result data associated with the multi-stage execution of the query.

23. The computer-storage medium of claim 22 , the operations further comprising:

encoding the retrieval function to include the storage information; and

causing retrieving of the result data from the storage location using the storage information.

24. The computer-storage medium of claim 22 , wherein the storage information is a uniform resource locator (URL) associated with the storage location.

25. The computer-storage medium of claim 22 , the operations further comprising:

decoding the query result information to further obtain authentication information associated with the storage location storing the result data.

26. The computer-storage medium of claim 25 , the operations further comprising:

encoding the retrieval function to include the storage information and the authentication information; and

causing retrieving of a plurality of data portions of the result data from the storage location using the storage information and the authentication information.

27. The computer-storage medium of claim 21 , the operations further comprising:

serializing the plurality of result batches before distribution to the at least a second computing node; and

causing deserialization of the plurality of result batches at the at least a second computing node before the retrieving.

28. The computer-storage medium of claim 21 , the operations further comprising:

decoding the query result information to obtain schema information, the schema information indicating a plurality of schemas associated with a plurality of data portions of the result data; and

parsing the plurality of data portions based on the plurality of schemas to obtain parsed result data; and

outputting the parsed result data.

29. The computer-storage medium of claim 21 , the operations further comprising:

distributing the plurality of result batches to a plurality of processing threads executing on the at least a second computing node;

causing parallel fetching and processing of corresponding portions of a plurality of data portions of the result data by the plurality of processing threads to generate processed data, using the plurality of result batches; and

causing retrieving of the processed data from the at least a second computing node.

30. The computer-storage medium of claim 21 , the operations further comprising:

obtaining a plurality of data portions of the result data from the at least a second computing node;

converting one or more of the plurality of data portions of the result data into a data table or a data object; and

providing the data table or the data object as output, in response to a data processing request associated with the multi-stage execution of the query.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 22, 2024
From: KAPRE, HARSHA S.; KELLER, MARK T.; SHANKAR, SRINATH; ZAVERI, KUSHAN A.
To: SNOWFLAKE INC.
Reel/Frame 066203/0302 →
Continuity (3)
Continuation 17813662 · Jul 20, 2022
Continuation 17501992 · Oct 14, 2021
Related Publication 20240160636A1 · May 16, 2024
References Cited (68)
US 8312037B1 · Bacthavachalu et al. · 2012 [cited by applicant]
US 8880502B2 · Waldvogel et al. · 2014 [cited by applicant]
US 9218354B2 · Lang et al. · 2015 [cited by applicant]
US 9633073B1 · Allen · 2017 [cited by applicant]
US 11086688B2 · Bishop et al. · 2021 [cited by applicant]
US 11132367B1 · Chud · 2021 [cited by examiner]
US 11188593B1 · Hale et al. · 2021 [cited by applicant]
US 11288241B1 · Merritt et al. · 2022 [cited by applicant]
US 11436245B1 · Kapre et al. · 2022 [cited by applicant]
US 11449520B1 · Kapre et al. · 2022 [cited by applicant]
US 11636108B1 · Xu et al. · 2023 [cited by applicant]
US 11636126B1 · Kapre et al. · 2023 [cited by applicant]
US 11921733B2 · Kapre et al. · 2024 [cited by applicant]
US 12124462B2 · Kapre et al. · 2024 [cited by applicant]
US 20090204593A1 · Bigby et al. · 2009 [cited by applicant]
US 20140114994A1 · Lindblad et al. · 2014 [cited by applicant]
US 20140280032A1 · Kornacker · 2014 [cited by examiner]
US 20170177411A1 · Thomas · 2017 [cited by applicant]
US 20180307723A1 · Bhargava et al. · 2018 [cited by applicant]
US 20190171634A1 · Nowakiewicz et al. · 2019 [cited by applicant]
US 20190334705A1 · Parimal et al. · 2019 [cited by applicant]
US 20190340179A1 · Konik et al. · 2019 [cited by applicant]
US 20200050612A1 · Bhattacharjee et al. · 2020 [cited by applicant]
US 20200226156A1 · Borra et al. · 2020 [cited by applicant]
US 20200233661A1 · Grosse et al. · 2020 [cited by applicant]
US 20200242118A1 · Dageville et al. · 2020 [cited by applicant]
US 20200250167A1 · Brunel et al. · 2020 [cited by applicant]
US 20200272619A1 · Alferov · 2020 [cited by applicant]
US 20210117425A1 · Rao et al. · 2021 [cited by applicant]
US 20210240705A1 · Trigonakis et al. · 2021 [cited by applicant]
US 20210397611A1 · Boutros et al. · 2021 [cited by applicant]
US 20220067047A1 · Wang · 2022 [cited by examiner]
US 20220083552A1 · Gupta et al. · 2022 [cited by applicant]
US 20220092067A1 · Zhu et al. · 2022 [cited by applicant]
US 20220100757A1 · Hong · 2022 [cited by examiner]
US 20220309067A1 · Anand et al. · 2022 [cited by applicant]
US 20230006813A1 · Fox-Epstein et al. · 2023 [cited by applicant]
US 20230055992A1 · Vinayagamurthy et al. · 2023 [cited by applicant]
US 20230117449A1 · Kapre et al. · 2023 [cited by applicant]
US 20230120159A1 · Kapre et al. · 2023 [cited by applicant]
US 20230196199A1 · Stefani · 2023 [cited by applicant]
US 20230205777A1 · Kapre et al. · 2023 [cited by applicant]
WO 2023064837 · 2023 [cited by applicant]
“U.S. Appl. No. 17/501,992, Non Final Office Action mailed Feb. 2, 2022”, 15 pgs. [cited by applicant]
“U.S. Appl. No. 17/453,756, Non Final Office Action mailed Feb. 11, 2022”, 18 pgs. [cited by applicant]
“U.S. Appl. No. 17/501,992, Response filed Apr. 27, 2022 to Non Final Office Action mailed Feb. 2, 2022”, 11 pgs. [cited by applicant]
“U.S. Appl. No. 17/501,992, Examiner Interview Summary mailed Apr. 29, 2022”, 2 pgs. [cited by applicant]
“U.S. Appl. No. 17/453,756, Response filed May 9, 2022 to Non Final Office Action mailed Feb. 11, 2022”, 12 pgs. [cited by applicant]
“U.S. Appl. No. 17/501,992, Notice of Allowance mailed May 17, 2022”, 10 pgs. [cited by applicant]
“U.S. Appl. No. 17/453,756, Notice of Allowance mailed May 18, 2022”, 10 pgs. [cited by applicant]
“U.S. Appl. No. 17/813,539, Non Final Office Action mailed Sep. 8, 2022”, 19 pgs. [cited by applicant]
“U.S. Appl. No. 17/813,539, Response filed Nov. 21, 2022 to Non Final Office Action mailed Sep. 8, 2022”, 12 pgs. [cited by applicant]
“International Application Serial No. PCT US2022 078016, International Search Report mailed Nov. 22, 2022”, 2 pgs. [cited by applicant]
“International Application Serial No. PCT US2022 078016, Written Opinion mailed Nov. 22, 2022”, 7 pgs. [cited by applicant]
“U.S. Appl. No. 17/813,539, Notice of Allowance mailed Dec. 21, 2022”, 10 pgs. [cited by applicant]
“U.S. Appl. No. 17/813,662, Non Final Office Action mailed May 24, 2023”, 18 pgs. [cited by applicant]
“U.S. Appl. No. 17/813,662, Response filed Aug. 21, 2023 to Non Final Office Action mailed May 24, 2023”, 12 pgs. [cited by applicant]
“U.S. Appl. No. 17/813,662, Notice of Allowance mailed Oct. 20, 2023”, 10 pgs. [cited by applicant]
“U.S. Appl. No. 18/178,758, Non Final Office Action mailed Jan. 31, 2024”, 19 pgs. [cited by applicant]
U.S. Appl. No. 17/501,992 U.S. Pat. No. 11,449,520, filed Oct. 14, 2021, Parallel Fetching of Query Result Data. [cited by applicant]
U.S. Appl. No. 17/453,756 U.S. Pat. No. 11,436,245, filed Nov. 5, 2021, Parallel Fetching in a Database System. [cited by applicant]
U.S. Appl. No. 17/813,539 U.S. Pat. No. 11,636,126, filed Jul. 19, 2022, Configuring Query Result Information for Result Data Obtained at Multiple Execution Stages. [cited by applicant]
U.S. Appl. No. 17/813,662 U.S. Pat. No. 11,921,733, filed Jul. 20, 2022, Fetching Query Result Data Using Result Batches. [cited by applicant]
U.S. Appl. No. 18/178,758, filed Mar. 6, 2023, Configuring Query Result Information Based on Multi-Stage Query Execution. [cited by applicant]
“U.S. Appl. No. 18/178,758, Notice of Allowance mailed Jun. 26, 2024”, 10 pgs. [cited by applicant]
“U.S. Appl. No. 18/178,758, Response filed Apr. 30, 2024 to Non Final Office Action mailed Jan. 31, 2024”, 12 pgs. [cited by applicant]
“International Application Serial No. PCT/US2022/078016, International Preliminary Report on Patentability mailed Apr. 25, 2024”, 9 pgs. [cited by applicant]
“European Application Serial No. 22882002.3, Extended European Search Report mailed Dec. 23, 2024”, 12 pages. [cited by applicant]