Table in database


how to check whether a database contains table using pymapd
if it contains table then database name must be included in mapd url


Good morning @nagulan -

You should be able to do this using base functionality in Python, as far as I can tell there is nothing pymapd specific here.

Per this other thread, you can get the list of tables from the get_tables() method in pymapd.

From there, you can do something like:

tbl = conn.get_tables()
if "AthenaFinance" in tbl:
    url = 'mapd://’

Or you could use string substitution, since your base url of mapd:// seems to be constant. Or write a function…how to solve this problem is dependent on how robust you want to make the solution, but again, it’s all just standard python code.