Hey All,

We are connecting presto from our redash. We are able to execute queries on the same but as soon as I select presto in a datasource - search schema disappears.

In catalog field - I have tried with all three values (hive, hive-cdh4 and hive-hadoop1).
Also - In schema contains a value - which has some tables in it.

Any suggestions/pointers what is going wrong.

Hussain Bohra

Hey Hussain,

We too use Presto in redash. The reason you are not seeing the schema browser is because the functionality has not yet been implemented for in the presto query runner here: https://github.com/getredash/redash/blob/master/redash/query_runner/presto.py

This should be easy to add, I expect that it will be something similar to what has been done for the postgres query runner here: https://github.com/getredash/redash/blob/master/redash/query_runner/pg.py#L89-L94

I was planning on contributing this feature but I am concerned about the implications of this bug https://github.com/getredash/redash/issues/1065 has we too have lots of tables in Presto.


Thanks Rohan - This helps.

Also I have another question - Can we change redash backend database to MySQL? - if yes is there any document on changing database and how can I create all initial tables.

Hussain Bohra

Hey Rohan,

As you mentioned - schema browser functionality is not implemented with Presto - but the function (_get_tables) you pointed in pg.py is written for hive datasource (hive_ds.py). But schema browser still doesn’t appear - do you know why?

Also, I wrote a similar method in /opt/redash/current/redash/query_runner/presto.py (like pg.py) to fetch details from information_schema - and restarted all process under supervisord - It seems It has compiled the new python file (I can see modified timestamp for .pyc) - but still I dont see a schema browser - do I need to rebuild redash using makefile - if yes - is there any document on the same?

Hussain Bohra

@hbohra for Presto you need to implement the method get_schema(self, get_stats=False) (you can ignore the get_stats keyword argument) and not get_tables (this is for classes that derive from a different base class).

If it works for you, you’re welcome to contribute a pull request.

Thanks @arikfr - This works.

Check out this pull request: https://github.com/getredash/redash/pull/1233 which adds schema support for Presto.

I am using the latest image still seach schema is missing for presto