question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Usage of LIMIT clause to fetch column names incompatible with sql server

See original GitHub issue

System 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:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mvashishthacommented, Mar 9, 2022

Yes, #4279 resolves this issue.

0reactions
YarShevcommented, Mar 9, 2022

Should this be closed in #4279?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found