torodb / stampede

The ToroDB solution to provide better analytics on top of MongoDB and make it easier to migrate from MongoDB to SQL
https://www.torodb.com/stampede/
GNU Affero General Public License v3.0
1.77k stars 120 forks source link

Extract nested field as an attribute not a relation #217

Closed Aleyasen closed 5 years ago

Aleyasen commented 6 years ago

@ahachete, thanks for the great open source effort, it's impressive! I am using stampede in a project, but since our schema has many nested fields, it will create a lot of tables. Since in theory, stampede can generate nested fields as attributes not as new relations, I am wondering what was the design decision behind this implementation? And more importantly, is there any configuration that can change the mode to create attribute instead relation for nested fields?

Thanks a lot.

ahachete commented 5 years ago

Hi @Aleyasen By design, if a nested field is a document, it will require a separate table. A large number of tables should not be scary. It is, after all, what you'd probably design manually if you would create the tables yourself.

There's currently no way to change this mapping. But nobody prevents you to create SQL VIEWs or functions to "group" those tables into the structure you want! :)

Closing issue as a non-issue, feel free to reopen if you consider otherwise.