J Selecta
J Selecta

Reputation: 301

How to add multiple databases to one Presto catalog?

I'm using Presto version 0.216 and I want to connect multiple databases in one catalog file. I am using Apache SuperSet to run queries via presto and it forces me to one catalog called hive.properties.

I am running Presto on an Ubuntu instance in AWS. I can access all the databases and run 'join' queries over multiple databases defined in multiple catalog files (one.properties, hive.properties, etc..). However as stated above that's not how superset integrates with presto.

In the presto docs it says that I can run a command that groups the databases via the connector name, here.

SHOW SCHEMAS FROM mysql

However that fails with the error:

Catalog mysql does not exist

I know I don't have a catalog called mysql.properties but all my catalogs have:

connector.name=mysql

So I believe this should work. I just want to query multiple databases from Apache SuperSet via Presto. Unfortunately I cant just add multiple , or ; seperated connection URL's to my catalog variable:

connection-url=jdbc:mysql://myurl:3306/ 

Upvotes: 0

Views: 5402

Answers (2)

J Selecta
J Selecta

Reputation: 301

You can only configure superset to point at some (one) catalog in Presto. There is currently no other way to configure Superset. However, you still can issue queries (use SQL Lab feature to test this) joining data from multiple catalogs, just like normally via Presto CLI:

select ..from catalog1.schema.table_name join catalog2.schema.table_name on ...

(What you don't get this way is Superset showing you the list of tables, etc.)

MySQL is confusing because they use the term "database" to mean "schema". A single MySQL server has one or more user databases, plus internal databases including "mysql". So when the documentation says "The MySQL connector provides a schema for every MySQL database", it is referring to multiple "databases" inside a single MySQL server.

As to meril's answer:

The "datasources" property mentioned in the Qubole documentation is a property that used to go in the main etc/config.properties file, but has not been needed in many years. It is deprecated, so you shouldn't set it, and we should remove it entirely.

Upvotes: 1

meril
meril

Reputation: 592

try this. connect-to-mysql-jdbc-sources

config.properties:
datasources=jmx,hive,mysqlcatalog

Upvotes: 0

Related Questions