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
SQL Server w/ azure data warehouse: "Catalog view 'dm_exec_sessions' is not supported in this version." #3994
Comments
Michael Bayer (@zzzeek) wrote: that's not a query emitted by SQLAlchemy and also doesn't seem to be in pyodbc either. Perhaps your ODBC driver is doing this, but mostly it looks like the application you're using is trying to emit this query. A stack trace (see bug reporting guidelines) would at least reveal what Python code has triggered this query being emitted but this does not look like a SQLAlchemy bug. |
James Bashforth wrote: Sorry, my fault. This wasn't the query that was emitted, just the error message. The query was my testing of the issue through management studio. I get the error in Management Studio when trying to run a select against dm_exec_sessions I am using pyodbc and sqlalchemy to connect through a basic script at this stage. |
James Bashforth wrote:
|
Michael Bayer (@zzzeek) wrote: can you please attach a stack trace (again, this is not a SQLAlchemy bug since we don't emit that SQL but I at least can get a clue what is emitting that SQL) |
James Bashforth wrote: Error log |
Changes by James Bashforth:
|
Michael Bayer (@zzzeek) wrote: OH. this changes everything because you showed one query but then a different error message with almost the same view name so I did not grep for that one. |
Changes by Michael Bayer (@zzzeek):
|
Changes by Michael Bayer (@zzzeek):
|
Changes by Michael Bayer (@zzzeek):
|
Michael Bayer (@zzzeek) wrote: microsoft sucks: sys.dm_exec_sessions (Transact-SQL) THIS TOPIC APPLIES TO: yesSQL Server (starting with 2008)yesAzure SQL Databaseyes Azure SQL Data Warehouse yesParallel Data Warehouse very annoying how there are 400 different variants of SQL server that don't even document supporting /not supporting these things |
Michael Bayer (@zzzeek) wrote: I don't have access to Azure data warehouse. Please run this patch against SQLAlchemy and confirm for me that this solves the issue:
|
Michael Bayer (@zzzeek) wrote: that patch is wrong, this works:
will be committed probably today |
Michael Bayer (@zzzeek) wrote: Prevent SQL server isolation level from failing Fixed bug where SQL Server transaction isolation must be fetched Change-Id: I621b5089febe8ace136428fa133fde1a7e21cda4 → d869a4d |
Changes by Michael Bayer (@zzzeek):
|
Michael Bayer (@zzzeek) wrote: Prevent SQL server isolation level from failing Fixed bug where SQL Server transaction isolation must be fetched Change-Id: I621b5089febe8ace136428fa133fde1a7e21cda4 → 2574ca4 |
James Bashforth wrote: Thank you for the help and apologies that the original request wasn't clear. I'm getting a new error now. regarding transactions. The code that i am using is the same as above, I've attached the latest log file. Do you want t a new issue creating? |
Changes by James Bashforth:
|
Michael Bayer (@zzzeek) wrote: clearly this database behaves very differently so we will need to work through each step one by one. is there a publicly available azure DW instance I can test on? im assuming there's no "express" edition |
Changes by Michael Bayer (@zzzeek):
|
Changes by Michael Bayer (@zzzeek):
|
Michael Bayer (@zzzeek) wrote: I can potentially give you workarounds on this one but this is likely a bug in PyODBC. It is legal to call rollback() on a DBAPI connection at any time assuming there's no "autocommit" flag set up. azure DW seems to be a cloud solution that you can get trial accounts for, I'd need someone to help on this and get me inside a console where I can poke around at this database. |
Changes by Michael Bayer (@zzzeek):
|
James Bashforth wrote: Yes, it works very differently, unfortunately. Even renaming the dm views with pdw makes little sense to me, but then what can you do. I have been using pyodbc natively and managed to get it working by setting the autocommit=true option. Maybe this is what I need to do for SQLAlchemy? Is there a way to set this option other than just on the execute query? |
Michael Bayer (@zzzeek) wrote:
OK these are pretty big hints, feel free to bring these up sooner rather than later :). Yes we need to do that here. Adding direct "autocommit=True" suppor to the MSSQL dialects is something we will do at some point but for now you get this using an event:
|
Changes by Michael Bayer (@zzzeek):
|
Changes by Michael Bayer (@zzzeek):
|
Migrated issue, originally created by James Bashforth
I am receiving the following error when connecting to Azure SQL DW. On further investigation it seems the the management view below has a slightly different name in Azure SQL DW. "sys.dm_pdw_exec_sessions" not sure if this is the cause of the issue, but if I run the following query on the SQL DW it returns results
SELECT login_name ,COUNT(session_id) AS session_count
FROM sys.dm_pdw_exec_sessions
GROUP BY login_name;
Error Message
sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) ('42000', "[42000] [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Catalog view 'dm_exec_sessions' is not supported in this version. (104385) (SQLExecDirectW)")
Attachments: output.log | output.1.log
The text was updated successfully, but these errors were encountered: