Usage of LIMIT clause to fetch column names incompatible with sql server
See original GitHub issueSystem information
- OS Platform and Distribution (Windows 10 Enterprise (10.0)):
- Modin version (0.11.0`):
- Python version:3.9.5
- Sql Server version: Microsoft SQL Server Express (64-bit) version 15.0.2000.5
- Code we can use to reproduce:
Describe the problem
Modin uses Limit to get column names. This is not standard sql and is not supported by sql server. Sql_dispatcher.py line number 85 cols_names_df = pandas.read_sql( “SELECT * FROM ({}) as foo LIMIT 0”.format(sql), con, index_col=index_col )
The sql produced by the above line throws an error when used with sqlalchemy connection string. ERROR 2021-10-07 14:16:37,560 17756 21468 apriori.py get_recommendation 278 <class ‘sqlalchemy.exc.ProgrammingError’> (pyodbc.ProgrammingError) (‘42000’, “[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near ‘LIMIT’. (102) (SQLExecDirectW)”) [SQL: SELECT * FROM ({sql_query}) as foo LIMIT 0]
Source code / logs
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >How to resolve "ORDER BY clause is not in SELECT list ...
I installed the new Ubuntu and my code has got a problem with MySQL. ( ! ) Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: ...
Read more >SQL error messages and exceptions - Oracle Help Center
In an ALTER TABLE statement, the column ' <columnName> ' has been specified as NOT NULL and either the DEFAULT clause was not...
Read more >SQLSTATE values and common error codes - IBM
An undefined column name was detected. 01537, An SQL statement cannot be EXPLAINed, because it references a remote object. 01538, The table cannot...
Read more >MySQL 8.0 Reference Manual :: 13.2.13 SELECT Statement
( LIMIT is applied after HAVING .) The SQL standard requires that HAVING must reference only columns in the GROUP BY clause or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, #4279 resolves this issue.
Should this be closed in #4279?