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

ER_TOO_LONG_IDENT error when using pre-aggreations in MySQL #86

Closed
gizmodus opened this issue Apr 18, 2019 · 6 comments
Closed

ER_TOO_LONG_IDENT error when using pre-aggreations in MySQL #86

gizmodus opened this issue Apr 18, 2019 · 6 comments
Labels
help wanted Community contributions are welcome.

Comments

@gizmodus
Copy link

Describe the bug
As discussed with @paveltiunov: I get the following error when using pre-aggregations with MySQL:
ER_TOO_LONG_IDENT: Identifier name 'xxxxxxxx_xxxxxxxxxxxxxxxxx_category_and_date_grxbl5i2_qpwevmo0_1555596567123' is too long

To Reproduce
Define a pre-aggregation in the cube.js schema with a long name.

Version:
0.4.5

@paveltiunov
Copy link
Member

Hey Reto! Thanks for posting this! MySQL is very restrictive in terms of table name length. First of all I think we can replace integer timestamp with string version.
Here's the place that parses timestamp:
https://github.com/statsbotco/cube.js/blob/50f1bbb7aac34ae7c4fd82a86ecee8506b17f4ea/packages/cubejs-query-orchestrator/orchestrator/PreAggregations.js#L40
Here's the place that generates table names:
https://github.com/statsbotco/cube.js/blob/50f1bbb7aac34ae7c4fd82a86ecee8506b17f4ea/packages/cubejs-query-orchestrator/orchestrator/PreAggregations.js#L255

@gizmodus
Copy link
Author

@paveltiunov What do you mean with string version of the timestamp? Like date + time, e.g. "201904231718". This would save 2 characters 😃

@paveltiunov
Copy link
Member

@gizmodus Hey Reto! I mean we can use for example the same base32 encoding we use for hash.

@paveltiunov paveltiunov added the help wanted Community contributions are welcome. label Apr 30, 2019
@beefs
Copy link

beefs commented Apr 6, 2020

What about having a table to store the mapping of the tables?

@paveltiunov
Copy link
Member

@beefs Hey Sunny! Great question! Cube.js was designed to minimize requirements for target DB in terms of pre-aggregations and one of design decision was not to store metadata in DB itself due to many big data backends doesn't support consistent transactional inserts/updates.

@lihan
Copy link

lihan commented May 19, 2020

This issue happens on Postgres too, the table names are truncated and will not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Community contributions are welcome.
Projects
None yet
Development

No branches or pull requests

4 participants