I am using metabase as BI tool for our analytics and my current database is in mongodb. I am able to create questions in metabase but when I try to join collections or try to do some complicated operations then I am not able to do that without writing in native query.
Is there any way to write sql queries for mongodb operations in metabase ? Or is there any other way around without using square and curly brackets for native query. And if I try to do with sql I get following error.
You can't. Since MongoDB is NoSQL you simply can't use SQL.
You can use the MongoDB native query language within Metabase.
Or you can wait for Apache Drill or Apache Spark SQL support:
https://github.com/metabase/metabase/issues/2157
Both solution would allow you to query MongoDB using SQL.
There is indeed limitation on metabase. However, I have helped our customer solve similar problems like yours. The software architecture is like this:
Metabase -> Presto SQL/Trino -> the data source that does not support SQL
In this design:
Metabase handles the dashboard part of work.
Trino translate SQL to
the query language that the data source can understand.
Note: In our customer's case, the integration really requires certain programming work. It is not a quite trivial job.
Related
Have been working on some project where I need to convert SQL query to MongoDB query language. few online converter tools I came across,
https://www.site24x7.com/tools/sql-to-mongodb.html
http://www.querymongo.com/
I have a similar requirement.
MongoDB provides BI connector which can execute SQL queries against a MongoDB database.
The mysql example may be helpful.
I am unaware of a MongoDB-supported translation tool of SQL to MQL.
After seeing this image:
http://2.bp.blogspot.com/_T-uXeKcGTnM/TIdoKBGwk9I/AAAAAAAABcs/CLW3_cRlN78/s1600/tumblr_kxovt0VLZy1qappj8.png
I wonder is exists any tool for translating SQL querys into MongoDB map/reduce query model??
Larger version of the image: http://rickosborne.org/download/SQL-to-MongoDB.pdf
Update to the question asked in Jan 2011:
A couple of sites exist now to convert sql to mongodb.
Convert MySQL Queries to MongoDB Syntax
http://www.querymongo.com/
And
Convert sql to mongodb
http://klaus.dk/sqltomongodb/
The simple anwser? No.
The slightly more complex anwser is some people have had luck translating more complex SQL to Mapreduce functions ...
http://rickosborne.org/blog/index.php/2010/02/08/playing-around-with-mongodb-and-mapreduce-functions/
http://rickosborne.org/blog/index.php/2010/02/19/yes-virginia-thats-automated-sql-to-mongodb-mapreduce/
However, that said ... generally speaking you might as well learn mapreduce properly because if the data is in MongoDB already ... you'll really need to know how to properly query MongoDB to get anything meaningful done!
MongoDB has wonderful and helpful docs http://www.mongodb.org/display/DOCS/Advanced+Queries
As well as an easy to use online tutorial: http://try.mongodb.org/
The simple answer: Yes. Hibernate OGM - JPA for NoSQL.
JPA is Java API for mapping objects to data stores.
It includes JPQL, a query language similar to SQL which adds the OOP concepts. It's not SQL, but you don't want pure SQL - that was designed for the relational paradigm.
Hibernate OGM proposes to simplify the programming model by embracing JPA/Hibernate APIs and semantics to store data in NoSQL stores like JBoss Enterprise Data Grid instead of the traditional RDBMS. (source)
Also see this Hibernate OGM: JPA for NoSQL talk by Hardy Ferentschik
Recently I happened to see this website mongoquery.com, you can try it.
You can use free sql to mongodb converter like: https://rapidapi.com/ariefsam/api/easy-sql-to-mongodb-aggregation/
Just to add to the last comment
re:The simple answer: Yes. Hibernate OGM - JPA for NoSQL.
JPA is Java API for mapping objects to data stores.
It includes JPQL, a query language similar to SQL which adds the OOP concepts. It's not SQL, but you don't want pure SQL - that was designed for the relational paradigm.
There is a company called UnityJDBC that has released a JDBC driver for Mongo that allows you to run SQL queries against mongo in any java application that supports JDBC.
you can download this driver free at
http://www.unityjdbc.com/mongojdbc/mongo_jdbc.php
hope this helps
You can also http://teiid.org which gives full range of SQL based access to MongoDB. You can use SQL through JDBC/ODBC or use REST/ODATA based access to MongoDB. Teiid uses MongoDB's aggregation framework to provide advanced SQL MongoDB query conversation.
Is there currently anything in the 2sxc module that allows you to connect to other database types? Specifically I would like to connect to a MySQL database. I know you can connect to other tables within the database.
This depends a bit on your question. Let's split
Can you use Razor-Views in 2sxc to visualize data from any kind of database?
Yes, just use c# code to get the data. Just create the sql-objects or whatever in .net and use that. For example, I wrote about using PetaPoco http://2sxc.org/en/docs/docs/feature/feature/2583
Can you use non-sql-data in your Visual Query Designer
Yes, but you'll have to work a bit. The easiest way is to map your my-sql tables in the DNN SQL server. This is a bit like a translation layer, which then let's use use them as if they were in the SQL Server.
A harder way is to create your own data source. Best to inherit the SqlDataSource (which provides a lot of security around parameter injection etc.) https://github.com/2sic/eav-server/blob/master/ToSic.Eav.DataSources/SqlDataSource.cs - and then modify it to use your mysql
I found alot of question on stack about converting mysql to mssql, but i would like to convert it otherwise.
From mssql server to mysql.
is there a (free) tool for this to do that without connecting to the databases?
i have an sql query dump and i want to convert that by putting that code in an tool.
Thanks.
You're probably best off doing this yourself to ensure everything is correct rather than relying on a third party tool (Also the additional benefit of understanding the differences between the two pieces of code). However you could use this SQL to MySQL tool:
http://download.cnet.com/SQL-To-MySQL-Converter/3000-10254_4-75693763.html
I've started using SQLite for my Android applications. What I would like to know is where I can find a list of queries to use, are they the same for MySQL, and would I be able to use similar queries from MySQL?
SQLite provides a pretty good implementation of the SQL standard. Check out the syntax here. There is a prominent link in the first paragraph that describes omissions.
EDIT: No stored procedures or functions. You can mimic these in your code at runtime, however, using prepared statements
List of queries? You would need to use 'SQLiteDatabase.query' set of methods to query your SQLite database in your Android app. There would be SQLite specific SQL that you would need to consider while migrating your MySQL queries.