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

No way to use pre-aggregations with MongoDB #2858

Closed
igorlukanin opened this issue May 31, 2021 · 5 comments
Closed

No way to use pre-aggregations with MongoDB #2858

igorlukanin opened this issue May 31, 2021 · 5 comments
Labels
driver:mongodb Issues relating to the MongoBI driver pre-aggregations Issues related to pre-aggregations

Comments

@igorlukanin
Copy link
Member

Describe the bug
Cube.js connects to MongoDB via its BI Connector which is accessed in the read-only fashion. That's why Cube.js is unable to store temporary tables when building pre-aggregations. So, it's also unable to determine the types of the values in the query result. This leads to no pre-aggregations possible when using MongoDB.

To Reproduce

  1. Connect Cube.js to MongoDB
  2. Enable pre-aggregations
  3. See the error that Cube.js cannot build them

Expected behavior

@igorlukanin igorlukanin added the driver:mongodb Issues relating to the MongoBI driver label May 31, 2021
@mspiegel31
Copy link
Contributor

mspiegel31 commented Jun 9, 2021

is it expected that external pre-aggregations via cubestore or mysql would work with the current mongobi driver? If so, that could be part of the error messaging for

Or, at least, Cube.js emits informative error messages when pre-aggregations are enabled with MongoDB as a data source

@igorlukanin
Copy link
Member Author

@mspiegel31 It's not, unfortunately, because Cube.js wouldn't build pre-aggregations with MongoDB as a data source.

@mspiegel31
Copy link
Contributor

mspiegel31 commented Jun 9, 2021

I'm not familiar with cube's current pre- aggregation implementation, but would that be an acceptable workaround? "Make MongoBI driver compatible with external preaggregations"? As I understand it, CubeJS is tied pretty heavily to SQL syntax. The ability to leverage pre-aggregations at all would be a big win for our team, and if it's less work to make it work with an external DB, I imagine that would be enough for most current mongo users.

@keydunov keydunov added the pre-aggregations Issues related to pre-aggregations label Jun 10, 2021
@atishayjainmono
Copy link

@igorlukanin @mspiegel31
I have setup external db as mysql for pre-aggregation with MongoBI as source DB.
I was able to find pre-aggregated data in mysql, and also was able to query pre-aggregated data for certain period(14 days).
But beyond certain period, I was getting this error.

 preAggregations: {
    testaggregation: {
      type: `rollup`,
      external: true,
      sqlAlias: `actvty`,
      measureReferences: [syncCount, activationCount, downloadCount],
      dimensionReferences: [name, subType, customerId],
      timeDimensionReference: date,
      scheduledRefresh: true,
      granularity: `day`,
      partitionGranularity: `week`,
      refreshKey: {
        every: `1 day`,
        incremental: true,
        updateWindow: `7 day`,
      },
    },
  },

@paveltiunov
Copy link
Member

This one should be resolved. If you think it isn't please create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
driver:mongodb Issues relating to the MongoBI driver pre-aggregations Issues related to pre-aggregations
Projects
None yet
Development

No branches or pull requests

5 participants