TECHNICAL FIELD

The subject matter described herein relates generally to database processing and more specifically to a cloud-based analytics engine operating on data stored in a database.

BACKGROUND

A database may be configured to store a plurality of electronic data records. These data records may be organized, in accordance with a database schema, into various database objects including, for example, one or more database tables. The database is coupled with a database management system (DBMS), which may be configured to support a variety of database operations for accessing the data records stored in the database. These database operations may include, for example, structured query language (SQL) queries and/or the like.

SUMMARY

Systems, methods, and articles of manufacture, including computer program products, are provided for a calculation scenario including a ranking filter operation. In one aspect, there is provided a system. The system may include at least one data processor and at least one memory. The at least one memory may store instructions that result in operations when executed by the at least one data processor. The operations may include: receiving, at a calculation engine of a database management system, a query associated with a calculation scenario defining a data flow model that includes one or more calculation nodes, each of the one or more calculation nodes corresponding to an operation performed on one or more database tables stored at a database, and the one or more calculation nodes including a first calculation node corresponding to a ranking filter operation; and executing, by the calculation engine, the query including by executing the calculation scenario, the executing of the calculation scenario includes performing the ranking filter operation to generate a result corresponding to at least a portion of rows included in a first partition of a database table stored at the database.

In some variations, one or more features disclosed herein including the following features may optionally be included in any feasible combination. The ranking filter operation may be performed by at least aggregating and filtering a plurality of rows included in the first partition. The plurality of rows may be filtered by at least applying a filter to one or more rows starting at an offset from a first row the first partition or a last row in the first partition. The filter may be applied such that the result of the ranking filter operation corresponds to a specified quantity of rows.

In some variations, the filter may be applied such that the result of the ranking filter operation includes the specified quantity of rows in the first partition having a row number that does not exceed a threshold value or is in a threshold percentage of row numbers.

In some variations, the filter may be applied such that the result of the ranking filter operation includes the specified quantity of rows in the first partition having a rank not exceed a threshold value or is in a threshold percentage of ranks.

In some variations, the filter may be applied such that the result of the ranking filter operation includes an aggregate of values occupying the specified quantity of rows in the first partition having a row number that does not exceed a threshold value or is in a threshold percentage of row numbers. The aggregate may be a sum, an average, a minimum, a maximum, a medium, a count, a mode, or a range.

In some variations, a filter attribute that is not required at the first node may be pushed down. The filter attribute may be pushed down to a second calculation node that is lower in a hierarchy formed by the one or more calculation nodes than the first calculation node. The filter attribute may be pushed down to at least minimize a quantity of intermediate results at the first calculation node.

In some variations, the database table may be partitioned, based at least on a quantity of rows included in the database table, into the first partition and a second partition.

In some variations, the query may be received from an application server implementing a database client. The result of the calculation engine executing the query may be sent to the application server.

In another aspect, there is provided a method for a calculation scenario including a ranking filter operation. The method may include: receiving, at a calculation engine of a database management system, a query associated with a calculation scenario defining a data flow model that includes one or more calculation nodes, each of the one or more calculation nodes corresponding to an operation performed on one or more database tables stored at a database, and the one or more calculation nodes including a first calculation node corresponding to a ranking filter operation; and executing, by the calculation engine, the query including by executing the calculation scenario, the executing of the calculation scenario includes performing the ranking filter operation to generate a result corresponding to at least a portion of rows included in a first partition of a database table stored at the database.

In some variations, one or more features disclosed herein including the following features may optionally be included in any feasible combination. The ranking filter operation may be performed by at least aggregating and filtering a plurality of rows included in the first partition. The plurality of rows may be filtered by at least applying a filter to one or more rows starting at an offset from a first row the first partition or a last row in the first partition. The filter may be applied such that the result of the ranking filter operation corresponds to a specified quantity of rows.

In some variations, the filter may be applied such that the result of the ranking filter operation includes the specified quantity of rows in the first partition having a row number that does not exceed a threshold value or is in a threshold percentage of row numbers.

In some variations, the filter may be applied such that the result of the ranking filter operation includes the specified quantity of rows in the first partition having a rank not exceed a threshold value or is in a threshold percentage of ranks.

In some variations, the filter may be applied such that the result of the ranking filter operation includes an aggregate of values occupying the specified quantity of rows in the first partition having a row number that does not exceed a threshold value or is in a threshold percentage of row numbers. The aggregate may be a sum, an average, a minimum, a maximum, a medium, a count, a mode, or a range.

In some variations, the method may further include pushing down a filter attribute that is not required at the first node. The filter attribute may be pushed down to a second calculation node that is lower in a hierarchy formed by the one or more calculation nodes than the first calculation node. The filter attribute may be pushed down to at least minimize a quantity of intermediate results at the first calculation node.

In some variations, the method may further include partitioning, based at least on a quantity of rows included in the database table, the database table into the first partition and a second partition.

In another aspect, there is provided a computer program product that includes a non-transitory computer readable storage medium. The non-transitory computer-readable storage medium may include program code that causes operations when executed by at least one data processor. The operations may include: receiving, at a calculation engine of a database management system, a query associated with a calculation scenario defining a data flow model that includes one or more calculation nodes, each of the one or more calculation nodes corresponding to an operation performed on one or more database tables stored at a database, and the one or more calculation nodes including a first calculation node corresponding to a ranking filter operation; and executing, by the calculation engine, the query including by executing the calculation scenario, the executing of the calculation scenario includes performing the ranking filter operation to generate a result corresponding to at least a portion of rows included in a first partition of a database table stored at the database.

Implementations of the current subject matter can include methods consistent with the descriptions provided herein as well as articles that comprise a tangibly embodied machine-readable medium operable to cause one or more machines (e.g., computers, etc.) to result in operations implementing one or more of the described features. Similarly, computer systems are also described that may include one or more processors and one or more memories coupled to the one or more processors. A memory, which can include a non-transitory computer-readable or machine-readable storage medium, may include, encode, store, or the like one or more programs that cause one or more processors to perform one or more of the operations described herein. Computer implemented methods consistent with one or more implementations of the current subject matter can be implemented by one or more data processors residing in a single computing system or multiple computing systems. Such multiple computing systems can be connected and can exchange data and/or commands or other instructions or the like via one or more connections, including, for example, to a connection over a network (e.g. the Internet, a wireless wide area network, a local area network, a wide area network, a wired network, or the like), via a direct connection between one or more of the multiple computing systems, etc.

The details of one or more variations of the subject matter described herein are set forth in the accompanying drawings and the description below. Other features and advantages of the subject matter described herein will be apparent from the description and drawings, and from the claims. While certain features of the currently disclosed subject matter are described for illustrative purposes in relation to a ranking filter operation for calculation scenarios, it should be readily understood that such features are not intended to be limiting. The claims that follow this disclosure are intended to define the scope of the protected subject matter.

