Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ODataStore - Remote Aggregation Support #7974

Open
Seteh opened this issue May 7, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@Seteh
Copy link
Contributor

commented May 7, 2019

The Problem

The ODataStore does not support server-side grouping and summary calculations. Grouping is performed on the client, and summaries are not supported.

The DataGrid and TreeList widgets allow users to group data and calculate summaries. However, these calculations are performed in the browser and can reduce performance with large data sets in the following cases:

A Possible Solution

The OData Extension for Data Aggregation standard introduces a new $applyquery option. It adds basic grouping and aggregation functionality to the protocol. We would like to use it to enable remote aggregation in the ODataStore.

Draft specification

A new supportsAggregation flag will be added to the ODataStore configuration, and its default value will depend on the remoteOperations value.

If the flag is enabled, the ODataStore constructs the $apply query parameter based on the load options.

Example:

var store = new ODataStore({
  url: "/Products",
  version: 4,
  supportsAggregation: true 
});

store.load({
  group: "Name",
  groupSummary: { selector: "Quantity", summaryType: "sum" },
  totalSummary: { selector: "UnitPrice", summaryType: "sum" },
  requireGroupCount: true
});

The following query will be sent to the OData server:

/Products?$apply=concat(
  group((Name), aggregate(Quantity with sum as a1)),
  aggregate(UnitPrice with sum as a2)
)

The response is then transformed to a format that the ODataStore can work with.

Limitations of OData Server Libraries

.NET OData stack documentation suggests using OData Web API and RESTier. The OData Web API has ASP.NET Web API and ASP.NET Core implementations, and the RESTier framework is based on the OData Web API.

We have tested $apply implementations in these libraries and found the following limitations.

Microsoft ASP.NET Web API for OData v4.0

This library supports group and aggregate transformations since v5.9. However, the following features are missing:

  • Support for compute (issue 794). Without it, we cannot build a query for header filter items in Date columns or when the groupInterval is used.

  • Support for concat. We cannot execute the following query:

    $apply=concat(
      group((Name), aggregate(Quantity with sum as a1)),
      aggregate(UnitPrice with sum as a2)
    )   
    

    Without it, the ODataStore has to send multiple requests.

Microsoft ASP.NET Core for OData v4.0

Aggregation is not supported (issue 893). This might be added in v7.2.

We Need Your Feedback

Before we implement this feature, we would like to hear from you. Please take a quick poll.

Get Notified of Updates

Subscribe to this thread or to our Facebook and Twitter accounts for updates on this topic.

@Seteh Seteh self-assigned this May 7, 2019

@Seteh Seteh changed the title ODataStore: Remote Aggregation Support ODataStore - Remote Aggregation Support May 7, 2019

@San4es San4es pinned this issue May 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.