System and method for providing user defined aggregates in a database system
First Claim
1. A method for allowing users to define new aggregates in a database system, comprising:
- receiving code that implements a class defining the structure of a user-defined aggregate and methods that can be invoked on instances of the user-defined aggregate; and
enforcing a contract against the class so that the code, when executed at runtime, satisfies requirements of the contract to ensure desired execution thereof, the contract requiring that the class comprise a first method that can be invoked to initialize the computation of an instance of the user-defined aggregate, a second method that can be invoked to accumulate a plurality of values to be aggregated, and a third method that can be invoked to compute a final result of the instance of the user-defined aggregate.
2 Assignments
0 Petitions
Accused Products
Abstract
A database system and method allows a user to write program code in a high-level programming language that implements a class that defines the structure of a user-defined aggregate and methods that can be invoked on instances of the user-defined aggregate. The class is then registered with the database system, which enforces a specific contract for user-defined aggregates against the class. The contract comprises the following requirements. First, the class must specify one of a plurality of different formats for persisting instances of the user-defined aggregate in a database store. Second, the class must comprise a first method that can be invoked to initialize the computation of an instance of the user-defined aggregate, a second method that can be invoked to accumulate a plurality of values to be aggregated with the user-defined aggregate, a third method that can be invoked to merge an instance of the user-defined aggregate with another partial aggregation, and a fourth method that can be invoked to compute a final result of an instance of the user-defined aggregate. Once these requirements are satisfied, the database system enables instances of the user-defined aggregate to be created. Preferably, the database system stores metadata about the user-defined aggregate for subsequent use in creating instances of the aggregate.
-
Citations
27 Claims
-
1. A method for allowing users to define new aggregates in a database system, comprising:
-
receiving code that implements a class defining the structure of a user-defined aggregate and methods that can be invoked on instances of the user-defined aggregate; and
enforcing a contract against the class so that the code, when executed at runtime, satisfies requirements of the contract to ensure desired execution thereof, the contract requiring that the class comprise a first method that can be invoked to initialize the computation of an instance of the user-defined aggregate, a second method that can be invoked to accumulate a plurality of values to be aggregated, and a third method that can be invoked to compute a final result of the instance of the user-defined aggregate. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 27)
-
-
14. A database system that allows users to define new aggregates, comprising:
-
a runtime that provides code execution within the database system; and
a database server that receives code that implements a class defining the structure of a user-defined aggregate and methods that can be invoked on instances of the user-defined aggregate and that enforces a contract against the class so that the code, when executed at runtime, satisfies requirements of the contract to ensure desired execution thereof, the contract requiring that the class comprise a first method that can be invoked to initialize the computation of an instance of the user-defined aggregate, a second method that can be invoked to accumulate a plurality of values to be aggregated, and a third method that can be invoked to compute a final result of the instance of the user-defined aggregate. - View Dependent Claims (15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)
-
Specification