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 instantiates an object of 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 is invoked to initialize the computation of an instance of the user-defined aggregate, a second method that is invoked to accumulate a plurality of values to be aggregated, and a third method that is invoked to compute a final result of the instance of the user-defined aggregate, the contract further comprising a requirement that the class specify one of a plurality of different formats which describes how instances of the user-defined aggregate are to be persisted in a database store, wherein the plurality of different formats which describe how instances of the user-defined aggregate are to be persisted in the database store comprises;
a first format in which an instance of the user-defined aggregate is automatically serialized in accordance with a native format of the database system; and
a second format in which an instance of the user-defined aggregate is serialized in a manner defined by the class.
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 certain specified methods that can be invoked on an instance of the class. 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
23 Claims
-
1. A method for allowing users to define new aggregates in a database system, comprising:
-
receiving code that instantiates an object of 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 is invoked to initialize the computation of an instance of the user-defined aggregate, a second method that is invoked to accumulate a plurality of values to be aggregated, and a third method that is invoked to compute a final result of the instance of the user-defined aggregate, the contract further comprising a requirement that the class specify one of a plurality of different formats which describes how instances of the user-defined aggregate are to be persisted in a database store, wherein the plurality of different formats which describe how instances of the user-defined aggregate are to be persisted in the database store comprises; a first format in which an instance of the user-defined aggregate is automatically serialized in accordance with a native format of the database system; and a second format in which an instance of the user-defined aggregate is serialized in a manner defined by the class. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 23)
-
-
12. A database system that allows users to define new aggregates, comprising:
-
a processing unit to perform the following; a runtime that provides code execution within the database system; and a database server that receives code that instantiates an object of 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 is invoked to initialize the computation of an instance of the user-defined aggregate, a second method that is invoked to accumulate a plurality of values to be aggregated, and a third method that is invoked to compute a final result of the instance of the user-defined aggregate, the contract further comprising a requirement that the class specify one of a plurality of different formats which describes how instances of the user-defined aggregate are to be persisted in a database store, wherein the plurality of different formats which describe how instances of the user-defined aggregate are to be persisted in the database store comprises; a first format in which an instance of the user-defined aggregate is automatically serialized in accordance with a native format of the database system; and a second format in which an instance of the user-defined aggregate is serialized in a manner defined by the class. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
-
Specification