-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Support CREATE VIEW in JDBC-based connectors #11588
Comments
I guess you've mixed up SQL Server view and Trino view. Those "createView" & "listView" should be used for Trino views.
|
Ok, have understand the topic. But how, or what, has to be changed to make the "CREATE VIEW" enabled on JDBC/MSSQL connections? I have seen that there is a pull request for "direct sql command execution" on the underlaying connector. |
The ability to quickly create views from your warehouse down stream into JDBC based connectors would bring a lot of value to the project. since we can't wrap |
Currently I'm using Oracle connector and PostgreSQL connectors. |
I've moved this to a new issue #21118 as seems to be a different to OP's problem. Sorry if this is the wrong place to post or I should create a new issue. However, I've just found the same problem. I've been using DBT to transform tables on an SQL Server, but now want to connect to several DBs and Trino is the way to go. I've setup Trino and can connect successfully to the different SQL Servers. However, I'm unable to create views, which is a key task of DBT. To test "Create View" I did the following:
Try to create view directly in trino:
What is the work-around for MS SQL Server using the JDBC connector or something we can change in DBT? The documentation for the SQL Server connector (https://trino.io/docs/current/connector/sqlserver.html#sql-support) indicates it supports all basic SQL syntax, including "CREATE VIEW" (https://trino.io/docs/current/sql/create-view.html). Hence my confusion. Also of note, when I checked the catalog in DBeaver, it shows all the views that I've created previously in DBT as tables. Very odd. |
Hi @ebyhr, why isn't "creating views" via JDBC supported? It's a fundamental SQL feature and is needed for DBT. I found the PR to support generic JDBC drivers for Trino to connect to other DBs (#3105). However, development stopped in 2022. In this case, can the Trino SQL Server docs (https://trino.io/docs/current/connector/sqlserver.html) be updated to let people know of this limitation. It only mentions "Column names with leading and trailing spaces are not supported" as a limitation. Scratch that ... I just found the issue "Document CREATE VIEW is not supported in connectors #7150" This is a very big limitation that should be flagged/noted. It would have saved me setting up Trino. |
The issue should be addressed by this PR: |
I wanted to create a VIEW on a connected MSSql Server, which is handled by the JDBC Base Connector.
Which is causing a not supported error.
I have read through the source code and found that the JDBC Base doesn't include "createView" or "listView" statements.
Is there a known limitation why the JDBC is not supporting views?
Because if there will be a check included that the catalog and, maybe, also schema shall be the same on the CREATE VIEW statement,
this should work ...
The text was updated successfully, but these errors were encountered: