-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Caravel with Vertica #1193
Comments
Have you read the tutorial? http://airbnb.io/caravel/tutorial.html |
Yes, I'm getting stuck at the definition of the table. BTW, I manage to connect to Vertica using It seems like the table that Carvel identifies automatically have nothing to do with those that are actually available on Vertica |
Possibly your tables are on a different schema? |
I'm afraid I'm a little lost in naming conventions. In order to connect, I use something of this sort:
Inside |
@drorata For your specific problem, I will try to connect just to DB instead of DB.schema and I will specify the schema inside the Table configuration in Caravel. At least Vertica with the ODBC driver doesn't work well with schemas in the string. Let me know if removing the schema from the connection string and configuring it in the Tables help. |
I'm also a bit confused :( It seems like the connection to Vertica is OK (I'm still using the When I try to set manually a table, I tried to fill the At that point it returns the following error:
|
The error returned now make sense to me. The driver you are using is Buggy. When you add a table, Caravel uses SQLAlchemy reflection capabilities to create a model of the Table you just added. Behind the scenes, SQLAlchemy uses the driver to get the table schema. As you could see from the error message it is trying to inspect the table schema using the table pg_catalog, that is Postgres, instead of v_catalog. Vertica uses PostgreSQL syntax but changed the table name for the schema. The driver you are using still uses the Postgres function to perform the schema reflection and it fails. You probably need to patch the driver. In my case was just one function missing. Since the driver you are using comes from the same ancestor that I used, maybe my patch could help you. Try to look at the diff if it helps. jamescasbon/vertica-sqlalchemy@master...shopkick:master |
This was helpful! Even though your patch didn't do the trick for me. Here's my version: @reflection.cache
def get_unique_constraints(self, connection, table_name, schema=None, **kw):
query = None
if schema is not None:
query = "select constraint_id, constraint_name, column_name from v_catalog.constraint_columns \n\
WHERE table_name = '" + table_name + "' AND table_schema = '" + schema + "'"
else:
query = "select constraint_id, constraint_name, column_name from v_catalog.constraint_columns \n\
WHERE table_name = '" + table_name + "'"
rs = connection.execute(query)
unique_names = {row[1] for row in rs}
result_dict = {unique: [] for unique in unique_names}
for row in rs:
result_dict[row[1]].append(row[2])
result = []
for key in result_dict.keys():
result.append(
{"name": key,
"column_names": result_dict[key]}
)
return result |
Here's my fork: drorata/sqlalchemy-vertica-python@40defc7 |
@drorata Thanks for the fix to sqlalchemy-vertica-python -- it fixed it for me. If you haven't already, it would be great if you could submit this fix as a PR to https://github.com/LocusEnergy/sqlalchemy-vertica-python Thanks for your work! |
@drorata Could you pls share steps to connect with Vertica from super-set? Am a newbie with superset and couldn't get enough material for this online.
|
@dany9988 I'm sorry, I don't have Vertica at the moment, so I cannot reproduce the steps. |
@drorata- Ok. Can you pls suggest whether you were able to add tables from vertica. Am stuck at that step. Getting Table [SchemaName.tablename] could not be found, please double check your database connection, schema, and table name. |
@dany9988 use SQLAlchemy URI: |
I'm trying to connect Caravel to a Vertica cluster. The steps I took are:
sqlalchemy-vertica-python
andpsycopg2
.vertica+vertica_python://dba:psss@host.name:5433/DB.schema
. Testing the connection seems to be OK.Table Name
(is it free text or refers to a table on Vertica?) andSchema
? Almost all my attempts end withTable doesn't seem to exist in the specified database, couldn't fetch column information
red message.Thanks
The text was updated successfully, but these errors were encountered: