IP Library Granted Patent US 12,189,576
Granted Patent B2
US 12,189,576 · App. 18/138,013 · Granted Jan 7, 2025

Dynamic script generation for distributed query execution and aggregation

Inventors: Luke A. Higgins (Silver Spring, MD); Robert R. Bruno (Columbia, MD)
Assignee: MORGAN STANLEY SERVICES GROUP INC.
G06F16/13
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,189,576
App. No.
18/138,013
Granted
Jan 7, 2025
Kind
B2
Abstract

Computer-implemented methods and systems are disclosed for receiving and indexing a plurality of files for later querying, for dynamically generating scripts to be executed during a query of a data store, and for horizontally distributing a query and aggregating results of the distributed query.

Claims (32)

1. A system for dynamically generating scripts to be executed during a query of a data store, comprising:

a server comprising one or more processors; and

non-transitory memory comprising instructions that, when executed by the one or more processors of the server, cause the one or more processors to:

receive a query comprising key values to search on and one or both of: a filter selecting a subset of files to be searched and an aggregation of data from all of the files or from all of the files that are filtered, wherein the files are stored in a storage that exclusively receives the files during a predetermined window of time;

generate an index for a fixed window of time corresponding to a subset of the files;

dynamically generate a script based on contents of the query, optimizing the script from a template to include only features necessary to satisfy the query and to omit at least one feature unnecessary to satisfy the query; and

distribute the generated script and the index to at least one computing device that will execute the query by calling the generated script on each of the files to be searched; and

organize the subset of the files using the index.

2. The system of claim 1 , wherein the query comprises one or more enrichment fields augmenting data based on a value from a key column in the query, a value from a filter in the query, or an output column of the query with values from an external data source.

3. The system of claim 1 , wherein an index for a field in the query exists, and wherein a set of files to be searched are downloaded from storage and acted upon by the generated script only if the index indicates that each file from the set of files to be searched contains a value specified by the query for that field.

4. The system of claim 1 , wherein an index for a field in the query does not exist, and wherein a set of files to be searched are downloaded from storage and acted upon by the generated script only if a Parquet filter checking for a value specified by the query for that field indicates that each file from the set of files to be searched contains the value.

5. The system of claim 1 , wherein the generated script comprises code to short circuit a Boolean AND by examining a field of the Boolean AND first and returning a file if the field does not satisfy the query.

6. The system of claim 1 , wherein the generated script comprises code to short circuit a Boolean OR by examining a field of the Boolean OR first and returning a file if the field satisfies the query.

7. The system of claim 1 , wherein the generated script comprises code to avoid consulting any indexes if there exists a Boolean OR of at least one non-indexed column.

8. The system of claim 1 , wherein the query is expressed in JavaScript Object Notation (JSON) format.

9. The system of claim 1 , wherein the generated script is in the Python scripting language.

10. The system of claim 1 , wherein the system is locked to work on one query at a time.

11. A computer-implemented method for dynamically generating scripts to be executed during a query of a data store, comprising:

receiving a query comprising key values to search on and one or both of: a filter selecting a subset of files to be searched and an aggregation of data from all of the files or from all of the files that are filtered, wherein the files are stored in a storage that exclusively receives the files during a predetermined window of time,

generating an index for a fixed window of time corresponding to a subset of the files;

dynamically generating a script based on contents of the query, optimizing the script from a template to include only features necessary to satisfy the query and to omit at least one feature unnecessary to satisfy the query; and

distributing the generated script and the index to at least one computing device that will execute the query by calling the generated script on each of the files to be searched; and

organizing the subset of the files using the index.

12. The computer-implemented method of claim 11 , wherein the query comprises one or more enrichment fields augmenting data based on a value from a key column in the query, a value from a filter in the query, or an output column of the query with values from an external data source.

13. The computer-implemented method of claim 11 , wherein an index for a field in the query exists, and wherein a set of files to be searched are downloaded from storage and acted upon by the generated script only if the index indicates that each file from the set of files to be searched contains a value specified by the query for that field.

14. The computer-implemented method of claim 11 , wherein an index for a field in the query does not exist, and wherein a set of files to be searched are downloaded from storage and acted upon by the generated script only if a Parquet filter checking for a value specified by the query for that field indicates that each file from the set of files to be searched contains the value.

15. The computer-implemented method of claim 11 , wherein the generated script comprises code to short circuit a Boolean AND by examining a field of the Boolean AND first and returning a file if the field does not satisfy the query.

16. The computer-implemented method of claim 11 , wherein the generated script comprises code to short circuit a Boolean OR by examining a field of the Boolean OR first and returning a file if the field satisfies the query.

17. The computer-implemented method of claim 11 , wherein the generated script comprises code to avoid consulting any indexes if there exists a Boolean OR of at least one non-indexed column.

18. The computer-implemented method of claim 11 , wherein the query is expressed in JavaScript Object Notation (JSON) format.

19. The computer-implemented method of claim 11 , wherein the generated script is in the Python scripting language.

20. The computer-implemented method of claim 11 , further comprising locking a system to work on one query at a time.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 25, 2023
From: HIGGINS, LUKE; BRUNO, ROBERT
To: MORGAN STANLEY SERVICES GROUP INC.
Reel/Frame 063427/0257 →
Continuity (2)
Continuation 17727764 · Apr 24, 2022
Related Publication 20230342332A1 · Oct 26, 2023
References Cited (48)
US 5530939A · Mansfield, Jr. · 1996 [cited by examiner]
US 5673322A · Pepe · 1997 [cited by examiner]
US 5889896A · Meshinsky · 1999 [cited by examiner]
US 6154535A · Velamuri · 2000 [cited by examiner]
US 6466935B1 · Stuart · 2002 [cited by examiner]
US 6760719B1 · Hanson · 2004 [cited by examiner]
US 7702616B1 · Li · 2010 [cited by examiner]
US 7765281B1 · Crow · 2010 [cited by examiner]
US 8086598B1 · Lamb · 2011 [cited by examiner]
US 8840028B1 · Zheng · 2014 [cited by examiner]
US 8966486B2 · Phan · 2015 [cited by examiner]
US 10146822B1 · Varteresian · 2018 [cited by examiner]
US 10599635B1 · Gunn · 2020 [cited by examiner]
US 11169997B1 · Debo · 2021 [cited by examiner]
US 20020023158A1 · Polizzi · 2002 [cited by examiner]
US 20050075895A1 · Mohsenin · 2005 [cited by examiner]
US 20050222984A1 · Radestock · 2005 [cited by examiner]
US 20050240595A1 · Chandrasekaran · 2005 [cited by examiner]
US 20050283468A1 · Kamvar · 2005 [cited by examiner]
US 20070033159A1 · Cherkauer · 2007 [cited by examiner]
US 20070100873A1 · Yako · 2007 [cited by examiner]
US 20070174830A1 · Gan · 2007 [cited by examiner]
US 20070239656A1 · Santosuosso · 2007 [cited by examiner]
US 20070276825A1 · Dettinger · 2007 [cited by examiner]
US 20080040317A1 · Dettinger · 2008 [cited by examiner]
US 20090070315A1 · Ahmed · 2009 [cited by examiner]
US 20100121881A1 · O'Hern · 2010 [cited by examiner]
US 20100199354A1 · Eker · 2010 [cited by examiner]
US 20120130984A1 · Risvik · 2012 [cited by examiner]
US 20120130991A1 · Atas · 2012 [cited by examiner]
US 20120137108A1 · Koch, III · 2012 [cited by examiner]
US 20130006964A1 · Hammerschmidt · 2013 [cited by examiner]
US 20130022284A1 · Zheng · 2013 [cited by examiner]
US 20130036289A1 · Welnicki · 2013 [cited by examiner]
US 20140067900A1 · Fukumura · 2014 [cited by examiner]
US 20150180873A1 · Mooij · 2015 [cited by examiner]
US 20160224660A1 · Munk · 2016 [cited by examiner]
US 20160239544A1 · Kondo · 2016 [cited by examiner]
US 20170083573A1 · Rogers · 2017 [cited by examiner]
US 20170286458A1 · Watanabe · 2017 [cited by examiner]
US 20170357693A1 · Kumar · 2017 [cited by examiner]
US 20180089268A1 · Lee · 2018 [cited by examiner]
US 20180300370A1 · Brookler · 2018 [cited by examiner]
US 20180349398A1 · Ardite · 2018 [cited by examiner]
US 20200192891A1 · Hrastnik · 2020 [cited by examiner]
US 20200201860A1 · Vogelsgesang · 2020 [cited by examiner]
US 20220100713A1 · Hong · 2022 [cited by examiner]
Borók-Nagy et al., “Speeding Up Select Queries with Parquet Page Indexes”, Cloudera (Year: 2020). [cited by examiner]