diff --git a/docs/datasources.rst b/docs/datasources.rst index 2d1c83b0..20eb9168 100644 --- a/docs/datasources.rst +++ b/docs/datasources.rst @@ -179,3 +179,18 @@ VPN and with users you trust). - Allowed Modules in a comma separated list (optional). **NOTE:** You MUST make sure these modules are installed on the machine running the Celery workers. + +Vertica +----- + +- **Options**: + + - Database (mandatory) + - User + - Password + - Host + - Port + +- **Additional requirements**: + + - ``vertica-python`` python package diff --git a/redash/query_runner/vertica.py b/redash/query_runner/vertica.py index 6a058418..2f9d9ebc 100644 --- a/redash/query_runner/vertica.py +++ b/redash/query_runner/vertica.py @@ -43,15 +43,15 @@ class Vertica(BaseQueryRunner): 'type': 'string', 'title': 'Password' }, - 'schema': { + 'database': { 'type': 'string', - 'title': 'Database schema name' + 'title': 'Database name' }, "port": { "type": "number" }, }, - 'required': ['schema'] + 'required': ['database'] } @classmethod @@ -80,10 +80,7 @@ class Vertica(BaseQueryRunner): schema = {} for row in results['rows']: - if row['table_schema'] != self.configuration['schema']: - table_name = '{}.{}'.format(row['table_schema'], row['table_name']) - else: - table_name = row['table_name'] + table_name = '{}.{}'.format(row['table_schema'], row['table_name']) if table_name not in schema: schema[table_name] = {'name': table_name, 'columns': []} @@ -107,11 +104,11 @@ class Vertica(BaseQueryRunner): 'port': self.configuration.get('port', 5433), 'user': self.configuration.get('user', ''), 'password': self.configuration.get('password', ''), - 'database': self.configuration.get('schema', '') + 'database': self.configuration.get('database', '') } connection = vertica_python.connect(**conn_info) cursor = connection.cursor() - logger.info("Vetica running query: %s", query) + logger.debug("Vetica running query: %s", query) cursor.execute(query) # TODO - very similar to pg.py diff --git a/requirements.txt b/requirements.txt index 9aafa2e3..383e0d25 100644 --- a/requirements.txt +++ b/requirements.txt @@ -32,3 +32,4 @@ wtf-peewee==0.2.3 pysaml2==2.4.0 pycrypto==2.6.1 funcy==1.5 +vertica-python==0.5.1